diff options
1345 files changed, 66563 insertions, 24782 deletions
diff --git a/LICENSE.md b/LICENSE.md index b039d9596fd..722ca3133f0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -4,7 +4,7 @@ MAME is a registered trademark of Gregory Ember. The text of version 2 of the GNU General Public License follows. - Copyright (C) 1997-2019 MAMEDev and contributors + Copyright (C) 1997-2020 MAMEDev and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/README.md b/README.md index 100fe401a78..28b9c11a301 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Please note that MAME is a registered trademark of Gregory Ember, and permission <img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png"> </a> - Copyright (C) 1997-2019 MAMEDev and contributors + Copyright (C) 1997-2020 MAMEDev and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/android-project/LICENSE b/android-project/LICENSE index fb9f046cc43..9b30d5a81a9 100644 --- a/android-project/LICENSE +++ b/android-project/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019, MAME Development Team +Copyright (c) 2020, MAME Development Team All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 145b7bb3a4f..6bd4a141cec 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.mamedev.mame" - android:versionCode="216" - android:versionName="0.216" + android:versionCode="217" + android:versionName="0.217" android:installLocation="auto"> <!-- OpenGL ES 2.0 --> diff --git a/benchmarks/LICENSE b/benchmarks/LICENSE index fb9f046cc43..9b30d5a81a9 100644 --- a/benchmarks/LICENSE +++ b/benchmarks/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019, MAME Development Team +Copyright (c) 2020, MAME Development Team All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/benchmarks/eminline_noasm.cpp b/benchmarks/eminline_noasm.cpp index f577154a6b7..d24ee8ec4e3 100644 --- a/benchmarks/eminline_noasm.cpp +++ b/benchmarks/eminline_noasm.cpp @@ -1,5 +1,5 @@ #include "benchmark/benchmark_api.h" -#include <time.h> +#include <ctime> #include "osdcore.h" #include "osdcomm.h" #define MAME_NOASM 1 diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst index e2154f6c849..636aef571ec 100644 --- a/docs/source/commandline/commandline-all.rst +++ b/docs/source/commandline/commandline-all.rst @@ -2357,7 +2357,7 @@ Core Misc Options **\-confirm_quit** - Display a Confirm Quit dialong to screen on exit, requiring one extra step + Display a Confirm Quit dialog to screen on exit, requiring one extra step to exit MAME. The default is OFF (**-noconfirm_quit**). diff --git a/docs/source/conf.py b/docs/source/conf.py index f9f86c1c431..a93b84c0289 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,16 +55,16 @@ master_doc = 'index' # General information about the project. project = u'MAME Documentation' -copyright = u'2019, MAMEdev Team' +copyright = u'2020, MAMEdev Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.216' +version = '0.217' # The full version, including alpha/beta/rc tags. -release = '0.216' +release = '0.217' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/license.rst b/docs/source/license.rst index db2eb2f41d0..b405ddc9fe6 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -6,7 +6,7 @@ The MAME project as a whole is distributed under the terms of the `GNU General P Please note that MAME is a registered trademark of Gregory Ember, and permission is required to use the "MAME" name, logo, or wordmark. - Copyright (C) 1997-2019 MAMEDev and contributors + Copyright (C) 1997-2020 MAMEDev and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/docs/source/techspecs/luaengine.rst b/docs/source/techspecs/luaengine.rst index 26d6da6a253..6abde32f54c 100644 --- a/docs/source/techspecs/luaengine.rst +++ b/docs/source/techspecs/luaengine.rst @@ -53,7 +53,7 @@ Let's first run MAME in a terminal to reach the LUA console: _/ _/ _/ _/_/_/_/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ - mame v0.205 + mame v0.217 Copyright (C) Nicola Salmoria and the MAME team Lua 5.3 @@ -77,7 +77,7 @@ You can check at runtime which version of MAME you are running, with: :: [MAME]> print(emu.app_name() .. " " .. emu.app_version()) - mame 0.205 + mame 0.217 We now start exploring screen related methods. First, let's enumerate available screens: diff --git a/docs/source/whatis.rst b/docs/source/whatis.rst index 51f9d244226..6b912c0d1f7 100644 --- a/docs/source/whatis.rst +++ b/docs/source/whatis.rst @@ -7,7 +7,7 @@ MAME's purpose is to preserve decades of software history. As electronic technol | | **MAME®** -| **Copyright © 1997-2019 by Nicola Salmoria and the MAME team** +| **Copyright © 1997-2020 by Nicola Salmoria and the MAME team** | **MAME is a registered trademark owned by Gregory Ember** | diff --git a/hash/32x.xml b/hash/32x.xml index dc7941efbcb..dd05b557f44 100644 --- a/hash/32x.xml +++ b/hash/32x.xml @@ -79,7 +79,7 @@ </software> <!-- boot OK --> - <software name="toughman" supported="yes"> + <software name="toughman"> <description>Toughman Contest (Euro, USA)</description> <year>1995</year> <publisher>Electronic Arts</publisher> diff --git a/hash/a800_cass.xml b/hash/a800_cass.xml new file mode 100644 index 00000000000..16bb3c0f046 --- /dev/null +++ b/hash/a800_cass.xml @@ -0,0 +1,46 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<softwarelist name="a800_cass" description="Atari 400 / 800 cassettes"> + + <software name="serpent" supported="no"> + <description>Serpentine</description> + <year>1982</year> + <publisher>Broderbund</publisher> + <part name="cass1" interface="a800_cass"> + <dataarea name="cass" size="18938"> + <rom name="serpentine (atari 400) (side a).cas" size="18938" crc="7a42459f" sha1="f717fdf02c55ecdbd8f4284da249bd87abb09708"/> + </dataarea> + </part> + <part name="cass2" interface="a800_cass"> + <dataarea name="cass" size="19059"> + <rom name="serpentine (atari 400) (side b).cas" size="19059" crc="386999b4" sha1="4a308f95f94c00ee861ba7facbfcd0ca31e01f1f"/> + </dataarea> + </part> + </software> + + <software name="zaxxon" supported="no"> + <description>Zaxxon (set 1)</description> + <year>1983</year> + <publisher>Datasoft</publisher> + <info name="developer" value="Ron J. Fortier"/> + <part name="cass1" interface="a800_cass"> + <dataarea name="cass" size="20596"> + <rom name="zaxxon (1983, datasoft, inc.).cas" size="20596" crc="bd63c369" sha1="8dda73ce267d9fe7afe0a0d6833525144c746c41"/> + </dataarea> + </part> + </software> + + <software name="zaxxona" cloneof="zaxxon" supported="no"> + <description>Zaxxon (set 2)</description> + <year>1984</year> + <publisher>US Gold</publisher> + <info name="developer" value="Ron J. Fortier"/> + <part name="cass1" interface="a800_cass"> + <dataarea name="cass" size="20612"> + <rom name="zaxxon (us_gold).cas" size="20612" crc="83f30fc0" sha1="3e26e3b98bd17a5097b80b27d8b595fe1411b66b"/> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/apple2_flop_clcracked.xml b/hash/apple2_flop_clcracked.xml index 04b1747ff77..0b2a385c879 100644 --- a/hash/apple2_flop_clcracked.xml +++ b/hash/apple2_flop_clcracked.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> -<softwarelist name="apple2_flop_clcracked" description="Apple II cleanly cracked 5.25 disks"> +<softwarelist name="apple2_flop_clcracked" description="Apple II cleanly cracked 5.25" disks"> <!-- Several sets are missing disks. As of July 21st, 2019 we don't have complete dumps for the following sets: @@ -240,7 +240,7 @@ <software name="cogito"> <description>Cogito! (cleanly cracked)</description> - <year>198??</year> + <year>1984</year> <publisher>Reader's Digest Software</publisher> <info name="release" value="2016-07-14"/> <!-- No compatibility data known at this time. --> @@ -298,7 +298,7 @@ </software> <software name="carmntime35"> - <description>Where in Time is Carmen Sandiego (Version 1.1) 800K 3.5 disk (cleanly cracked)</description> + <description>Where in Time is Carmen Sandiego (Version 1.1) (800K 3.5") (cleanly cracked)</description> <year>1989</year> <publisher>Broderbund Software</publisher> <!-- No compatibility data known at this time. --> @@ -18352,12 +18352,14 @@ <description>Music Construction Set (cleanly cracked)</description> <year>1983</year> <publisher>Electronic Arts</publisher> - <info name="release" value="2017-03-02"/> + <info name="release" value="2019-12-09"/> + <!-- This crack was updated on 2019-12-09 to fix corruption on track + $20. --> <!-- No compatibility data known at this time. --> <part name="flop1" interface="floppy_5_25"> <dataarea name="flop" size="143360"> - <rom name="music construction set (4am and san inc crack).dsk" size="143360" crc="07fb5f2f" sha1="d266f61abf5ca1c013449748eac3fb43edb7c63b" /> + <rom name="music construction set (4am and san inc crack).dsk" size="143360" crc="221034cd" sha1="ff22eb248c1a6d270ebb97f4660c97ff832cf0a2" /> </dataarea> </part> </software> @@ -24737,7 +24739,7 @@ <software name="wrabbt10"> <description>Writer Rabbit (Version 1.0) (cleanly cracked)</description> - <year>19861986</year> + <year>1986</year> <publisher>The Learning Company</publisher> <info name="release" value="2015-09-04"/> @@ -25217,7 +25219,7 @@ <software name="35mbpl37"> <description>Math Blaster Plus (800K 3.5") (Version 3.7) (cleanly cracked)</description> - <year>19871988</year> + <year>1987</year> <publisher>Davidson and Associates</publisher> <info name="release" value="2015-11-04"/> <!-- This is version 3.7, distributed on a single 3.5-inch (800K) disk for @@ -25279,7 +25281,7 @@ <software name="35spelit"> <description>Spell It (800K 3.5") (cleanly cracked)</description> - <year>19871984</year> + <year>1984</year> <publisher>Davidson and Associates</publisher> <info name="release" value="2015-12-08"/> <!-- This is distributed on a single 3.5-inch (800K) disk for the Apple IIgs, @@ -28592,7 +28594,7 @@ </software> <software name="simlineq"> - <description>Simultaneous Linear Functions (cleanly cracked)</description> + <description>Simultaneous Linear Equations (cleanly cracked)</description> <year>1984</year> <publisher>Microcomputer Workshops</publisher> <info name="release" value="2017-04-18"/> @@ -35652,7 +35654,6 @@ <year>1984</year> <publisher>CBS</publisher> <info name="release" value="2019-11-22"/> - <!-- No compatibility data known at this time. --> <part name="flop1" interface="floppy_5_25"> <dataarea name="flop" size="143360"> @@ -35661,4 +35662,416 @@ </part> </software> + <software name="boyjesus"> + <description>The Boy Jesus (cleanly cracked)</description> + <year>1984</year> + <publisher>Educational Publishing Concepts</publisher> + <info name="release" value="2019-11-23"/> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="143360"> + <rom name="the boy jesus (4am crack) side a.dsk" size="143360" crc="88c20d44" sha1="17d9afc0952ea153a502768a1316fe33d5bc699c"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="143360"> + <rom name="the boy jesus (4am crack) side b.dsk" size="143360" crc="7b549ae0" sha1="d75c8e9301b81b50ec101906016e72692ae83674"/> + </dataarea> + </part> + </software> + + <software name="amzthgr0"> + <description>In Search of the Most Amazing Thing (First Revision) (cleanly cracked)</description> + <year>1983</year> + <publisher>Spinnaker Software</publisher> + <info name="release" value="2019-11-30"/> + <!-- This is the first release.--> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="in search of the most amazing thing r0 (4am crack).dsk" size="143360" crc="5045cc20" sha1="f2cbef99f1144124957e03b3db1f882997669c34"/> + </dataarea> + </part> + </software> + + <software name="mchess20"> + <description>MicroChess (Version 2.0) (cleanly cracked)</description> + <year>1978</year> + <publisher>Personal Software</publisher> + <info name="release" value="2019-12-08"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="microchess 2.0 (4am crack).dsk" size="143360" crc="9fc08a09" sha1="b52c1b418187e89d6e941be49b99c1ae98578a26"/> + </dataarea> + </part> + </software> + + <software name="spyntham"> + <description>The Spy's Adventures in North America (Version 1987-10-31) (cleanly cracked)</description> + <year>1987</year> + <publisher>Polarware</publisher> + <info name="release" value="2019-12-12"/> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="143360"> + <rom name="the spy's adventures in north america v1987-10-31 (4am crack) side a.dsk" size="143360" crc="812f1df0" sha1="05918f348c77e2514e2d3b4476ef0d7483013f39"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="the spy's adventures in north america v1987-10-31 (4am crack) side b (boot).dsk" size="143360" crc="71682a55" sha1="a93665520b5293770d8ae46fb4dd89bb49ddcef9"/> + </dataarea> + </part> + </software> + + <software name="mmailr11"> + <description>Magic Mailer (Version 1.1) (cleanly cracked)</description> + <year>1982</year> + <publisher>ArtSci</publisher> + <info name="release" value="2019-12-16"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="magic mailer v1.1 (4am crack).dsk" size="143360" crc="d4f7f600" sha1="cb04683075e506bf169f578faa39273c6b6ab4e0"/> + </dataarea> + </part> + </software> + + <software name="mindminr"> + <description>Mind Over Minors (cleanly cracked)</description> + <year>1985</year> + <publisher>Human Edge Software</publisher> + <info name="release" value="2019-12-16"/> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A"/> + <dataarea name="flop" size="143360"> + <rom name="mind over minors (4am crack) disk 1a.dsk" size="143360" crc="81d1b2f5" sha1="57b039650596b4403060c1ed9e7ce7fd533c5dde"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B"/> + <dataarea name="flop" size="143360"> + <rom name="mind over minors (4am crack) disk 1b.dsk" size="143360" crc="4c54738d" sha1="b4f21f2f1bac110d6f49f397bf5453b47b779151"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2"/> + <dataarea name="flop" size="143360"> + <rom name="mind over minors (4am crack) disk 2.dsk" size="143360" crc="72fafddd" sha1="95f28e618f6b32d324707e91e64ecaba74f59a6b"/> + </dataarea> + </part> + </software> + + <software name="toapshai"> + <description>Temple of Apshai (cleanly cracked)</description> + <year>1979</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2019-12-16"/> + <!-- 4am has this to say about this disk: + There were several releases of this game. One only booted + on 13-sector drives and had no title screen at all. Another + booted on 13-sector drives but had a title screen. + + This release only boots on 16-sector drives and has a title + screen and a hi-res character generator. There is at least one + later version that has all the features of this one, plus allows + you to choose between "Old English" and "Standard" hi-res + fonts. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="temple of apshai (4am crack).dsk" size="143360" crc="dd57eac2" sha1="b0b20e251ab5ffdf6981ffeaf4991ae31256e0e8"/> + </dataarea> + </part> + </software> + + <software name="grglobge"> + <description>Green Globs and Graphing Equations (cleanly cracked)</description> + <year>1986</year> + <publisher>Sunburst Communications</publisher> + <info name="release" value="2020-01-02"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="green globs and graphing equations (4am crack).dsk" size="143360" crc="949b5a00" sha1="5c4453baf8d2eb89ee8a403c042861e36a219765"/> + </dataarea> + </part> + </software> + + <software name="inrecall"> + <description>Instant Recall (Version 1.1) (cleanly cracked)</description> + <year>1983</year> + <publisher>Howard W. Sams, Inc.</publisher> + <info name="release" value="2020-01-02"/> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Master"/> + <dataarea name="flop" size="143360"> + <rom name="instant recall (4am crack) disk 1 - master.dsk" size="143360" crc="9eb1544d" sha1="54b6c873b097f5656c9610b8786d3ec2cb8cc6d2"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Data"/> + <dataarea name="flop" size="143360"> + <rom name="instant recall (4am crack) disk 2 - data.dsk" size="143360" crc="372ec6b6" sha1="4bf6c083cd70bfb30a2671f6781ff3f6f1d5d4a6"/> + </dataarea> + </part> + </software> + + <software name="barrnsat"> + <description>Barron's Computer SAT Study Program (Version 1.0) (cleanly cracked)</description> + <year>1983</year> + <publisher>Barron's Educational Series, Inc.</publisher> + <info name="release" value="2020-01-02"/> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Math preparation 1"/> + <dataarea name="flop" size="143360"> + <rom name="barron's computer sat study program (4am crack) disk 1 - math preparation 1.dsk" size="143360" crc="9f87f812" sha1="97a8a14110dc62443f733eba4c3c8fade8f613c3"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Math preparation 2"/> + <dataarea name="flop" size="143360"> + <rom name="barron's computer sat study program (4am crack) disk 2 - math preparation 2.dsk" size="143360" crc="2db92df8" sha1="7971d64ed79365ddb89f43caabc87da8359b8cec"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 - Verbal preparation 1"/> + <dataarea name="flop" size="143360"> + <rom name="barron's computer sat study program (4am crack) disk 3 - verbal preparation 1.dsk" size="143360" crc="0554261c" sha1="e293c115297811e90c30150be53551fd21d75510"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 - Verbal preparation 2"/> + <dataarea name="flop" size="143360"> + <rom name="barron's computer sat study program (4am crack) disk 4 - verbal preparation 2.dsk" size="143360" crc="3431ad95" sha1="f83be0824ee3189e393119c8818e9fee9a657dec"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 5 - Verbal preparation 3"/> + <dataarea name="flop" size="143360"> + <rom name="barron's computer sat study program (4am crack) disk 5 - verbal preparation 3.dsk" size="143360" crc="397dab95" sha1="4981c4296b67cab353fb7fee74afbecd520ee6a1"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 6 - Verbal preparation 4"/> + <dataarea name="flop" size="143360"> + <rom name="barron's computer sat study program (4am crack) disk 6 - verbal preparation 4.dsk" size="143360" crc="df710598" sha1="a726b79315090a9d471083d92bd7a0b8a5f849cd"/> + </dataarea> + </part> + </software> + + <software name="wizip201"> + <description>Wiziprint (Version 2.01) (cleanly cracked)</description> + <year>1982</year> + <publisher>Sir-Tech</publisher> + <info name="release" value="2020-01-02"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="wiziprint (4am crack).dsk" size="143360" crc="354fab0c" sha1="00ab6c5edc0fd0985ecbf425bb2a5c850d0c7b87"/> + </dataarea> + </part> + </software> + + <software name="aeclfsci"> + <description>Life Science (cleanly cracked)</description> + <year>1987</year> + <publisher>American Educational Computer</publisher> + <info name="release" value="2020-01-06"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="life science (4am crack).dsk" size="143360" crc="98d4717e" sha1="5f649d6d7f5cbbf2cdccfeeb1f05314df062fe4d"/> + </dataarea> + </part> + </software> + + <software name="advcreat"> + <description>Adventure Creator (cleanly cracked)</description> + <year>1984</year> + <publisher>Spinnaker</publisher> + <info name="release" value="2020-01-06"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="adventure creator (4am crack).dsk" size="143360" crc="9113263a" sha1="dda864a6965a75f27b78bb0510bf21389b720b2a"/> + </dataarea> + </part> + </software> + + <software name="midi4r5"> + <description>MIDI/4 (Revision 5) (cleanly cracked)</description> + <year>1984</year> + <publisher>Passport Designs, Inc</publisher> + <info name="release" value="2020-01-06"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="midi-4 (4am and san inc crack).dsk" size="143360" crc="14b0ad62" sha1="9e9eb73bd28412c2176c8b6d6b7fbe14b3a2f65e"/> + </dataarea> + </part> + </software> + + <software name="cnstwrd2"> + <description>Construct-A-Word II (cleanly cracked)</description> + <year>1984</year> + <publisher>Developmental Learning Materials</publisher> + <info name="release" value="2020-01-08"/> + <!-- It requires an Echo or compatible speech card. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Level 1"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 1.dsk" size="143360" crc="35aea731" sha1="913496e493d2c0bab3aac80c1f1d0d307e418bf8"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Level 2"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 2.dsk" size="143360" crc="bf747723" sha1="1a5f061a3346446ecb31b65d02d0bb28c7d37e0d"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 - Level 3"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 3.dsk" size="143360" crc="2bd53e92" sha1="39c569049ea004fdac1e8854a4404ee936f7bb69"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 - Level 4"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 4.dsk" size="143360" crc="08883e2e" sha1="02809df0cbc35e821daf6c9b5eb548ea90b9f3bc"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 5 - Level 5"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 5.dsk" size="143360" crc="692e9ce2" sha1="25fdda6e4b6c0002333c861748861036549dd93a"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 6 - Level 6"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 6.dsk" size="143360" crc="b1f7c706" sha1="2369e3b8838bda71a557aa4370b9aa0c29fe1c18"/> + </dataarea> + </part> + <part name="flop7" interface="floppy_5_25"> + <feature name="part_id" value="Disk 7 - Level 7"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 7.dsk" size="143360" crc="1e103d20" sha1="aa2326e6e2469b65c22956a58355c88731696111"/> + </dataarea> + </part> + <part name="flop8" interface="floppy_5_25"> + <feature name="part_id" value="Disk 8 - Level 8"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 8.dsk" size="143360" crc="d04a2d95" sha1="4dced6142950f8750afa80d5e3ce48ae4081e25e"/> + </dataarea> + </part> + <part name="flop9" interface="floppy_5_25"> + <feature name="part_id" value="Disk 9 - Level 9"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 9.dsk" size="143360" crc="4c1a7963" sha1="19f84f1241b97895b9265d55c1510454f64f6d34"/> + </dataarea> + </part> + <part name="flop10" interface="floppy_5_25"> + <feature name="part_id" value="Disk 10 - Level 10"/> + <dataarea name="flop" size="143360"> + <rom name="construct-a-word ii (4am crack) level 10.dsk" size="143360" crc="3580d65d" sha1="8aa57e573de133dfc091912d2457b18686c26e2d"/> + </dataarea> + </part> + </software> + + <software name="qmile40"> + <description>The Quarter Mile (Version 4.0) (800K 3.5") (cleanly cracked)</description> + <year>1992</year> + <publisher>Barnum Software</publisher> + <info name="release" value="2020-01-09"/> + <!-- This is version 4.0, originally distributed on a 3.5-inch (800K) + disk for Apple IIgs, //c+, or //e users with a UniDisk 3.5-inch drive. + --> + + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size="819264"> + <rom name="the quarter mile v4.0 800k (4am crack).2mg" size="819264" crc="0ecf0ca5" sha1="09f1df0b1819296037ed00020cfca537bc510793"/> + </dataarea> + </part> + </software> + + <software name="whtlgcr1"> + <description>What's My Logic? (Version 1.0) (cleanly cracked)</description> + <year>1984</year> + <publisher>Midwest Publications</publisher> + <info name="release" value="2020-01-21"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="what's my logic? (4am crack).dsk" size="143360" crc="433922c6" sha1="2902ea9aa9ef0f75d51d555d36b82feef4b51f12"/> + </dataarea> + </part> + </software> + + <software name="diaread1"> + <description>Diascriptive Reading I (cleanly cracked)</description> + <year>1984</year> + <publisher>Educational Activities</publisher> + <info name="release" value="2020-01-21"/> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Details"/> + <dataarea name="flop" size="143360"> + <rom name="diascriptive reading i (4am crack) disk 1 - details.dsk" size="143360" crc="84cf8618" sha1="aa682b4da097993877d086b86717625b946944db"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Inference"/> + <dataarea name="flop" size="143360"> + <rom name="diascriptive reading i (4am crack) disk 2 - inference.dsk" size="143360" crc="8585d61e" sha1="a0910aed62bddf4d56c59ae9b6057a8338f56b68"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 - Main idea"/> + <dataarea name="flop" size="143360"> + <rom name="diascriptive reading i (4am crack) disk 3 - main idea.dsk" size="143360" crc="e36d1a25" sha1="bd0a63fd197d51c6271747e764eabfc2888c8a19"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 - Sequence"/> + <dataarea name="flop" size="143360"> + <rom name="diascriptive reading i (4am crack) disk 4 - sequence.dsk" size="143360" crc="bc8f308a" sha1="d63a62cef26488b2d76d6ceb26f791e5531b3127"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 5 - Vocabulary"/> + <dataarea name="flop" size="143360"> + <rom name="diascriptive reading i (4am crack) disk 5 - vocabulary.dsk" size="143360" crc="947000e5" sha1="e44284a73af9e9d15d6b1eacff9400096e10cf31"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 6 - Diagnostic tests"/> + <dataarea name="flop" size="143360"> + <rom name="diascriptive reading i (4am crack) disk 6 - diagnostic tests.dsk" size="143360" crc="d487f31c" sha1="ffba07158f024a3668b286e308734a637533b222"/> + </dataarea> + </part> + </software> + + <software name="airnavtr"> + <description>Air Navigation Trainer (cleanly cracked)</description> + <year>1982</year> + <publisher>Space-Time Associates</publisher> + <info name="release" value="2020-01-21"/> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="air navigation trainer (4am crack).dsk" size="143360" crc="dbd68189" sha1="03e9791a1bf6b4c0560935e8bd7e9b6b8566abcf"/> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/apple2_flop_misc.xml b/hash/apple2_flop_misc.xml index 107929ff024..6a9509adc99 100644 --- a/hash/apple2_flop_misc.xml +++ b/hash/apple2_flop_misc.xml @@ -2,7 +2,7 @@ <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> <!-- Generated by SLIST 0.2.1 --> -<softwarelist name="apple2_flop_misc" description="Apple II 5.25 miscellaneous disks"> +<softwarelist name="apple2_flop_misc" description="Apple II 5.25" miscellaneous disks"> <software name="4080trkd"> <description>40 and 80 Track DOS</description> @@ -5183,23 +5183,6 @@ </part> </software> - <software name="marble"> - <description>Marble Madness</description> - <year>1986</year> - <publisher>Electronic Arts</publisher> - - <part name="flop1" interface="floppy_5_25"> - <dataarea name="flop" size="143360"> - <rom name="marble_madness1.dsk" size="143360" crc="ffb2fc00" sha1="0985fce38eafd30dd56ea273e72049a43dd42ebc" /> - </dataarea> - </part> - <part name="flop2" interface="floppy_5_25"> - <dataarea name="flop" size="143360"> - <rom name="marble_madness2.dsk" size="143360" crc="ffb2fc00" sha1="0985fce38eafd30dd56ea273e72049a43dd42ebc" /> - </dataarea> - </part> - </software> - <software name="mario"> <description>Mario Bros.</description> <year>1983</year> diff --git a/hash/apple2_flop_orig.xml b/hash/apple2_flop_orig.xml index d03fd5d1b04..882cfb21578 100644 --- a/hash/apple2_flop_orig.xml +++ b/hash/apple2_flop_orig.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> -<softwarelist name="apple2_flop_orig" description="Apple II 5.25 original disks"> +<softwarelist name="apple2_flop_orig" description="Apple II 5.25" original disks"> <software name="agentusa"> <description>Agent USA</description> @@ -4661,7 +4661,7 @@ </software> <software name="samisimp"> - <description>Mission Impossible (Version 2.1/306)</description> + <description>Scott Adams Graphic Adventure 3: Mission Impossible (Version 2.1/306)</description> <year>1982</year> <publisher>Adventure International</publisher> <info name="release" value="2019-04-23"/> @@ -7634,7 +7634,7 @@ </software> <software name="dbotcwv1"> - <description>Decisive Battles of the Civil War: Volume One</description> + <description>Decisive Battles of the American Civil War: Volume One</description> <year>1987</year> <publisher>Strategic Studies Group</publisher> <info name="release" value="2019-09-12"/> @@ -8877,4 +8877,1527 @@ </part> </software> + <software name="krift"> + <description>Koronis Rift</description> + <year>1985</year> + <publisher>Epyx</publisher> + <info name="release" value="2019-11-25"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234737"> + <rom name="koronis rift.woz" size="234737" crc="657888ad" sha1="97f86d1d2b7bc39c86f81cc6c3adf6528c19e81b"/> + </dataarea> + </part> + </software> + + <software name="tantales"> + <description>Tangled Tales</description> + <year>1989</year> + <publisher>Origin Systems</publisher> + <info name="release" value="2019-11-25"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A - Boot"/> + <dataarea name="flop" size="234868"> + <rom name="tangled tales disk 1a - boot.woz" size="234868" crc="079c0226" sha1="505a512df0a5f36115cd2eac0d092bd9a5d7518c"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B - Adventure 3"/> + <dataarea name="flop" size="234868"> + <rom name="tangled tales disk 1b - adventure 3.woz" size="234868" crc="cd208f55" sha1="8b1fc202a9878fc0c7e5f356d78b270891a416c8"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A - Adventure 1"/> + <dataarea name="flop" size="234868"> + <rom name="tangled tales disk 2a - adventure 1.woz" size="234868" crc="1fbdee91" sha1="813f0033b3242387542caab350dc687c57764333"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B - Adventure 2"/> + <dataarea name="flop" size="234868"> + <rom name="tangled tales disk 2b - adventure 2.woz" size="234868" crc="c03b8ec4" sha1="ebaf93937fd0dae6a85ea410fc9547aa82867a6c"/> + </dataarea> + </part> + </software> + + <software name="nordbert"> + <description>Nord and Bert Couldn't Make Head or Tail of It (Release 19 / 870722)</description> + <year>1987</year> + <publisher>Infocom</publisher> + <info name="release" value="2019-11-25"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234837"> + <rom name="nord and bert couldn't make head or tail of it r19 side a.woz" size="234837" crc="c9519b7c" sha1="3488765db40e404775bb9cf3df73a8fd37165296"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="108373"> + <rom name="nord and bert couldn't make head or tail of it r19 side b.woz" size="108373" crc="8137995a" sha1="b3934608cc519e9663d04daabc051a9fcd7c7750"/> + </dataarea> + </part> + </software> + + <software name="drugalrt"> + <description>Drug Alert!</description> + <year>1986</year> + <publisher>Methods \& Solutions</publisher> + <info name="release" value="2019-11-26"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + <!-- The password to read the handbook in-game is SESAME.--> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234793"> + <rom name="drug alert.woz" size="234793" crc="7761dd4f" sha1="c7ca43dc87efa8e10641f0e108ca57f69d031d63"/> + </dataarea> + </part> + </software> + + <software name="amzthng"> + <description>In Search of the Most Amazing Thing</description> + <year>1983</year> + <publisher>Spinnaker Software</publisher> + <info name="release" value="2019-11-26"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234804"> + <rom name="in search of the most amazing thing.woz" size="234804" crc="ab9f24eb" sha1="db71277402a4457c039a67efb2d8f6891c04185c"/> + </dataarea> + </part> + </software> + + <software name="dinodayp"> + <description>Dinosaur Days Plus!</description> + <year>1988</year> + <publisher>Pelican Software</publisher> + <info name="release" value="2019-11-30"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A - Program"/> + <dataarea name="flop" size="242157"> + <rom name="dinosaur days plus disk 1a - program.woz" size="242157" crc="f728b2e8" sha1="2b424a4b6d9b7dd55b3ea57ef25cda030185ca09"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B - Program"/> + <dataarea name="flop" size="242157"> + <rom name="dinosaur days plus disk 1b - program.woz" size="242157" crc="13f62316" sha1="5625f28455880a93f83f4a777605133f88a9dab2"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A - Graphics database"/> + <dataarea name="flop" size="242166"> + <rom name="dinosaur days plus disk 2a - graphics database.woz" size="242166" crc="31eb42c4" sha1="e154aec0d97913b9cede4b4e0a7c42b89db50f88"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B - Graphics database"/> + <dataarea name="flop" size="242166"> + <rom name="dinosaur days plus disk 2b - graphics database.woz" size="242166" crc="317fd228" sha1="cf19f2fb9a8bdd393465508eea23da8945e15319"/> + </dataarea> + </part> + </software> + + <software name="nysiwit"> + <description>Now You See It, Now You Don't - Was it there? Was it missing?</description> + <year>1987</year> + <publisher>Sunburst Communications</publisher> + <info name="release" value="2019-11-30"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="241348"> + <rom name="now you see it, now you don't - was it there - was it missing.woz" size="241348" crc="a7e51505" sha1="9aacdba6d7067cb8062336a177d7721203715dc9"/> + </dataarea> + </part> + </software> + + <software name="eaglnest"> + <description>Into The Eagle's Nest</description> + <year>1986</year> + <publisher>Mindscape</publisher> + <info name="release" value="2019-12-02"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="241445"> + <rom name="into the eagle's nest.woz" size="241445" crc="65eb8066" sha1="0555eb4c26b06ad98f520ad205f15b13d033242d"/> + </dataarea> + </part> + </software> + + <software name="ecosim2"> + <description>Ecology Simulations II</description> + <year>1979</year> + <publisher>Creative Computing Software</publisher> + <info name="release" value="2019-12-02"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234788"> + <rom name="ecology simulations ii.woz" size="234788" crc="e5ea95d8" sha1="97614fa13e1f42e3e1385f29206dc785898a6703"/> + </dataarea> + </part> + </software> + + <software name="thrilogy"> + <description>Thrilogy</description> + <year>1980</year> + <publisher>On-Line Systems</publisher> + <info name="release" value="2019-12-02"/> + <sharedfeat name="compatibility" value="A2"/> + <!-- It requires a 48K Apple ][ and Integer BASIC in ROM. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234787"> + <rom name="thrilogy.woz" size="234787" crc="ea5dabec" sha1="96eacd29aac4e1c4f7fb7cd36ad62e5f8b360909"/> + </dataarea> + </part> + </software> + + <software name="spcquest"> + <description>Space Quest: The Sarien Encounter</description> + <year>1987</year> + <publisher>Sierra On-Line</publisher> + <info name="release" value="2019-12-03"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 1a.woz" size="234865" crc="81c67f99" sha1="09b7a3f594deeab5aeea1ad35f6fca4b65d08eca"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 1b.woz" size="234865" crc="76b0499f" sha1="2924d85702b43ed05610961d2c6f0a96b9f59c2b"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 2a.woz" size="234865" crc="3fcb9942" sha1="d4d9ba684109086c82d8ab2d6112337f523bb046"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 2b.woz" size="234865" crc="2ff225c1" sha1="437b75a0781da96e477093d61e98fed88edb8554"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 Side A"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 3a.woz" size="234865" crc="2c1f654c" sha1="4621fa85bb2c82d103d66225382a4d78bfd44a97"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 Side B"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 3b.woz" size="234865" crc="303bc684" sha1="13f7e97ac1b9de79ae0d5c2034cfb0689be40f09"/> + </dataarea> + </part> + <part name="flop7" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 Side A"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 4a.woz" size="234865" crc="ccfdac78" sha1="a414e236d18a223fa63594db1483c9dec988c850"/> + </dataarea> + </part> + <part name="flop8" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 Side B"/> + <dataarea name="flop" size="234865"> + <rom name="space quest disk 4b.woz" size="234865" crc="f4ccb762" sha1="1455fed9e6b87a65ec0ffcbc48527bd94d4f99dd"/> + </dataarea> + </part> + </software> + + <software name="portal"> + <description>Portal</description> + <year>1986</year> + <publisher>Activision</publisher> + <info name="release" value="2019-12-03"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A"/> + <dataarea name="flop" size="234764"> + <rom name="portal disk 1a.woz" size="234764" crc="9124938e" sha1="df84aaa83a87789c20281817de4e16daf44b044f"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B"/> + <dataarea name="flop" size="234764"> + <rom name="portal disk 1b.woz" size="234764" crc="82efa13a" sha1="89de2ddf48c5dd34682b8bf95895d0de2d013b94"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A"/> + <dataarea name="flop" size="234764"> + <rom name="portal disk 2a.woz" size="234764" crc="3076a666" sha1="3dae926019a047e099036dfef0f63aacf5c2b488"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B"/> + <dataarea name="flop" size="234764"> + <rom name="portal disk 2b.woz" size="234764" crc="30be5252" sha1="687f63418cfd15737517e0b033c15388c346d09a"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 Side A"/> + <dataarea name="flop" size="234764"> + <rom name="portal disk 3a.woz" size="234764" crc="a77fa6ec" sha1="4dd8558cda08138dac43e6dba5bef7c66c88eb73"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 Side B"/> + <dataarea name="flop" size="234764"> + <rom name="portal disk 3b.woz" size="234764" crc="09cc654c" sha1="2788586879264aba90bb53b5d27f097044595cdb"/> + </dataarea> + </part> + </software> + + <software name="eostatn"> + <description>Earth Orbit Stations</description> + <year>1987</year> + <publisher>Electronic Arts</publisher> + <info name="release" value="2019-12-05"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Game disk"/> + <dataarea name="flop" size="228132"> + <rom name="earth orbit stations disk 1 game disk.woz" size="228132" crc="3b1205cd" sha1="5ef6c82a865c0745878c99961a28b97e8f276d00"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A - Archive disk"/> + <dataarea name="flop" size="234791"> + <rom name="earth orbit stations disk 2a archive disk.woz" size="234791" crc="c86b1340" sha1="3cdbac14d51c7a89353243ce57101f89b582a665"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B - Mission disk"/> + <dataarea name="flop" size="234791"> + <rom name="earth orbit stations disk 2b mission disk.woz" size="234791" crc="0d01aa81" sha1="81f03a9308daa27cc8e7a5d0651cdbe36ad4c16a"/> + </dataarea> + </part> + </software> + + <software name="advent"> + <description>Adventure</description> + <year>1980</year> + <publisher>Apple Computer</publisher> + <info name="release" value="2019-12-06"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234786"> + <rom name="adventure (apple).woz" size="234786" crc="c6af7c16" sha1="65cdf99121bc72e053f0314b4b46ce6e70324c36"/> + </dataarea> + </part> + </software> + + <software name="swdthrst"> + <description>SwordThrust</description> + <year>1981</year> + <publisher>CE Software</publisher> + <info name="release" value="2019-12-13"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - The King's Testing Ground"/> + <dataarea name="flop" size="234803"> + <rom name="swordthrust 1 - the king's testing ground.woz" size="234803" crc="2fc15f87" sha1="2485fabc0bdb7c0510aba117bbb2c061132e5308"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - The Vampyre Caves"/> + <dataarea name="flop" size="234795"> + <rom name="swordthrust 2 - the vampyre caves.woz" size="234795" crc="ae2a955a" sha1="7535103884553e0e76cc6431bef451781f824625"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 - Kidnapper's Cove"/> + <dataarea name="flop" size="234794"> + <rom name="swordthrust 3 - kidnapper's cove.woz" size="234794" crc="0b6a7b1f" sha1="8d8a082318dbd1dbbe2f70345bfb20370b09d778"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 - The Case of the Sultan's Pearl"/> + <dataarea name="flop" size="234808"> + <rom name="swordthrust 4 - the case of the sultan's pearl.woz" size="234808" crc="44f9dd98" sha1="92a92e08f88d532baac14ded24e715eb0927e4a2"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 5 - The Green Plague"/> + <dataarea name="flop" size="234794"> + <rom name="swordthrust 5 - the green plague.woz" size="234794" crc="1c31328c" sha1="1f6259ded174a8e6c92106e70ddbe2e81ff8188e"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 6 - The Eternal Curse"/> + <dataarea name="flop" size="234795"> + <rom name="swordthrust 6 - the eternal curse.woz" size="234795" crc="aa3ddc2d" sha1="63f26fe03b5c07a6acd114770337c0b6230c58f7"/> + </dataarea> + </part> + <part name="flop7" interface="floppy_5_25"> + <feature name="part_id" value="Disk 7 - The Hall of Alchemie"/> + <dataarea name="flop" size="234797"> + <rom name="swordthrust 7 - the hall of alchemie.woz" size="234797" crc="c1342b27" sha1="c64d8b50d94e899181dda44d9077b39e5bcd953e"/> + </dataarea> + </part> + </software> + + <software name="redoctbr"> + <description>The Hunt for Red October</description> + <year>1988</year> + <publisher>Datasoft</publisher> + <info name="release" value="2019-12-14"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234814"> + <rom name="the hunt for red october side a.woz" size="234814" crc="45889aad" sha1="b5480e897774e02d351133dec715aae15c434748"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <dataarea name="flop" size="234814"> + <rom name="the hunt for red october side b (boot).woz" size="234814" crc="d37c8b65" sha1="9d2c0caffb1999f987954a4337232ad68fee1135"/> + </dataarea> + </part> + </software> + + <software name="galattk"> + <description>Galactic Attack</description> + <year>1980</year> + <publisher>Sir-Tech</publisher> + <info name="release" value="2019-12-14"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234790"> + <rom name="galactic attack.woz" size="234790" crc="013efc71" sha1="68975194ff1b597ed4e2773649bb8880d050a1cd"/> + </dataarea> + </part> + </software> + + <software name="journey"> + <description>Journey (version 16)</description> + <year>1989</year> + <publisher>Infocom</publisher> + <info name="release" value="2019-12-14"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="234863"> + <rom name="journey side 1.woz" size="234863" crc="590b865d" sha1="65dcb44b636ac6f612b3fc53a69f8430205b5798"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2"/> + <dataarea name="flop" size="234863"> + <rom name="journey side 2.woz" size="234863" crc="6a5ca90b" sha1="8a5a75b251a55ab1d215011d084aba3cf6277712"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side 3"/> + <dataarea name="flop" size="234863"> + <rom name="journey side 3.woz" size="234863" crc="b630f8c3" sha1="d6a1d079d3eab8a151009c442c93d548cce436bc"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side 4"/> + <dataarea name="flop" size="234863"> + <rom name="journey side 4.woz" size="234863" crc="18343fa8" sha1="0b89081e7dd389e6a3e84117c80cde562743439c"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Side 5"/> + <dataarea name="flop" size="234863"> + <rom name="journey side 5.woz" size="234863" crc="7d133bcb" sha1="ea92c49226e060015a941debe86dbc51386508c3"/> + </dataarea> + </part> + </software> + + <software name="sthcmnd"> + <description>Southern Command</description> + <year>1981</year> + <publisher>Strategic Simulations</publisher> + <info name="release" value="2019-12-14"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + <!--"Southern Command" is a 1981 strategy game created by Roger Keating and published by Strategic Simulations. It requires a 48K Apple ][+ or later.--> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234863"> + <rom name="southern command.woz" size="234863" crc="e04bb52c" sha1="bc53a1a66fc347859c17238a28b3bd4a8b178739"/> + </dataarea> + </part> + </software> + + <software name="wizrdry4"> + <description>Wizardry IV: The Return of Werdna</description> + <year>1987</year> + <publisher>Sir-Tech</publisher> + <info name="release" value="2019-12-14"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234833"> + <rom name="wizardry iv - the return of werdna side a.woz" size="234833" crc="0c6ac6a0" sha1="f465fb3b88eb38c197e24da1ae1962f6d0a58cd9"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="234833"> + <rom name="wizardry iv - the return of werdna side b.woz" size="234833" crc="179d1324" sha1="7bff6956d76129cc82d5e5ac6ba30d8806054bdf"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side C"/> + <dataarea name="flop" size="234833"> + <rom name="wizardry iv - the return of werdna side c.woz" size="234833" crc="0493f3d5" sha1="22efb911669d42525a8e8ab35b2a34ca5ef2fdbd"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side D"/> + <dataarea name="flop" size="234833"> + <rom name="wizardry iv - the return of werdna side d.woz" size="234833" crc="897eb0dc" sha1="21f4d0bd66d9d3a275678dbfc7cabb0cc023910f"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Side E"/> + <dataarea name="flop" size="234833"> + <rom name="wizardry iv - the return of werdna side e.woz" size="234833" crc="0fd25eba" sha1="eb07e89850635da688a5aa1d372eebbc19594c9e"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Side F"/> + <dataarea name="flop" size="234833"> + <rom name="wizardry iv - the return of werdna side f.woz" size="234833" crc="3a8a7986" sha1="a2684a58605af6ddbd6554bc99333ab3947dd4e9"/> + </dataarea> + </part> + </software> + + <software name="arthurqe"> + <description>Arthur: The Quest for Excalibur</description> + <year>1989</year> + <publisher>Infocom</publisher> + <info name="release" value="2019-12-15"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="234839"> + <rom name="arthur side 1.woz" size="234839" crc="8534268e" sha1="4162e37f10fd7651f75aa66a6892840f472e7af0"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2"/> + <dataarea name="flop" size="234839"> + <rom name="arthur side 2.woz" size="234839" crc="18b74288" sha1="ee97de7925d9292f474168102caa91c618335893"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side 3"/> + <dataarea name="flop" size="234839"> + <rom name="arthur side 3.woz" size="234839" crc="0c73db6b" sha1="c9bc4068148fcef5871cd43a1aef2b60130148d9"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side 4"/> + <dataarea name="flop" size="234839"> + <rom name="arthur side 4.woz" size="234839" crc="00d35f7c" sha1="1c8f142f965b2b7fd992a992cfc6c8bf8d51c113"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Side 5"/> + <dataarea name="flop" size="234839"> + <rom name="arthur side 5.woz" size="234839" crc="f0d35742" sha1="d955728b5aca8bb88b8f6027ff7979bbc88b5303"/> + </dataarea> + </part> + </software> + + <software name="brdstale"> + <description>The Bard's Tale</description> + <year>1985</year> + <publisher>Electronic Arts</publisher> + <info name="release" value="2019-12-15"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Boot disk"/> + <dataarea name="flop" size="228117"> + <rom name="the bard's tale - boot disk.woz" size="228117" crc="ca391217" sha1="2965afea19b022330efdc4c4be3890f7558018d9"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Character disk"/> + <dataarea name="flop" size="234773"> + <rom name="the bard's tale - character disk.woz" size="234773" crc="92e2f239" sha1="1f1967c425c64118addb3d8bae0e2821259d4b89"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Dungeon disk"/> + <dataarea name="flop" size="234773"> + <rom name="the bard's tale - dungeon disk.woz" size="234773" crc="b9099a69" sha1="45c9eb7161bc5c71fdbe2fc5c2ef99002cc81fed"/> + </dataarea> + </part> + </software> + + <software name="advconst"> + <description>Adventure Construction Set</description> + <year>1985</year> + <publisher>Electronic Arts</publisher> + <info name="release" value="2019-12-17"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A"/> + <dataarea name="flop" size="228148"> + <rom name="adventure construction set disk 1a.woz" size="228148" crc="022a20bc" sha1="5594992d7ffeaeb01f74f9c37ba2456a86526a9c"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B"/> + <dataarea name="flop" size="234811"> + <rom name="adventure construction set disk 1b.woz" size="234811" crc="2adc0181" sha1="f2d67823dd388d908b54ed3a369aa75afaf438dc"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A"/> + <dataarea name="flop" size="234801"> + <rom name="adventure construction set disk 2a.woz" size="234801" crc="fa373c36" sha1="9c415fbfa4ecb4dc99b17f58f0846c3c744d77f2"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B"/> + <dataarea name="flop" size="234808"> + <rom name="adventure construction set disk 2b.woz" size="234808" crc="60c30a5e" sha1="fabefc06dd40ef79952a4f099b1cad70b386b02e"/> + </dataarea> + </part> + </software> + + <software name="artowar"> + <description>The Ancient Art of War</description> + <year>1989</year> + <publisher>Broderbund Software</publisher> + <info name="release" value="2019-12-18"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234786"> + <rom name="the ancient art of war side a.woz" size="234786" crc="eeb41109" sha1="d3310c0abb88c1c51df4982eeb6c32f2844f2a77"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="234786"> + <rom name="the ancient art of war side b.woz" size="234786" crc="86261140" sha1="6e5e4a0b030f83ecd0f0939b166a0b9ff57e8e0a"/> + </dataarea> + </part> + </software> + + <software name="borg"> + <description>Borg</description> + <year>1981</year> + <publisher>Sirius Software</publisher> + <info name="release" value="2019-12-18"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + <!-- Note: this game is not currently playable in-browser due to its copy protection not being fully supported by the emulator. You can download it and play it in a supporting emulator.--> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="214789"> + <rom name="borg.woz" size="214789" crc="2b69a453" sha1="d315d7b642986409f79257465f2d6ed99220ad07"/> + </dataarea> + </part> + </software> + + <software name="kingbnty"> + <description>King's Bounty</description> + <year>1990</year> + <publisher>New World Computing</publisher> + <info name="release" value="2019-12-23"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + <!-- Note that the game writes to side B. You can't write to softlist + entries, so you'll need to make a backup copy of side B to play. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234784"> + <rom name="king's bounty side a.woz" size="234784" crc="d16b4cc6" sha1="83efe2ecd32d543fb64f7bea6e872866ff6e8fc9"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="241440"> + <rom name="king's bounty side b.woz" size="241440" crc="dc625dd6" sha1="5e6cd06d66e66e49d6c36046dfe69d9461dbffbc"/> + </dataarea> + </part> + </software> + + <software name="alpenctr"> + <description>The Alpine Encounter</description> + <year>1993</year> + <publisher>Random House</publisher> + <info name="release" value="2019-12-23"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234802"> + <rom name="the alpine encounter side a.woz" size="234802" crc="1c919d52" sha1="3b0b47c40b52f3d4d501564145bc6b56b02d7b02"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="234802"> + <rom name="the alpine encounter side b.woz" size="234802" crc="21f25d7c" sha1="aecb717cd980a5a63a0252d194d303c9d2836f1f"/> + </dataarea> + </part> + </software> + + <software name="grglobge"> + <description>Green Globs and Graphing Equations</description> + <year>1986</year> + <publisher>Sunburst Communications</publisher> + <info name="release" value="2019-12-26"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234834"> + <rom name="green globs and graphing equations.woz" size="234834" crc="1ad7bc19" sha1="e27ca259bb83d91853d2f0e136f5de735e8b5d28"/> + </dataarea> + </part> + </software> + + <software name="sbgears"> + <description>Gears</description> + <year>1985</year> + <publisher>Sunburst Communications</publisher> + <info name="release" value="2019-12-26"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234800"> + <rom name="gears.woz" size="234800" crc="8cd3cfc1" sha1="184d0e74d8fe357706d5d6a995557f1d960b1810"/> + </dataarea> + </part> + </software> + + <software name="intrgrph"> + <description>Interpreting Graphs</description> + <year>1986</year> + <publisher>Sunburst Communications</publisher> + <info name="release" value="2019-12-26"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234815"> + <rom name="interpreting graphs.woz" size="234815" crc="8406f7d9" sha1="92846ac3a0d8516f86a50cb5fb23f19edb467e57"/> + </dataarea> + </part> + </software> + + <software name="dwbatrup"> + <description>Dave Winfield's Batter Up!</description> + <year>1985</year> + <publisher>Avant-Garde Publishing</publisher> + <info name="release" value="2019-12-27"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234741"> + <rom name="dave winfield's batter up side a.woz" size="234741" crc="b401407e" sha1="59d0e33d1dcf7d62ab8ed04c3fc36d49264489db"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B"/> + <dataarea name="flop" size="234741"> + <rom name="dave winfield's batter up side b.woz" size="234741" crc="297dbbd7" sha1="9bcd646e723bae406ebcafdfcb95718af6fbff82"/> + </dataarea> + </part> + </software> + + <software name="dqhfwv1"> + <description>Dunjonquest: Hellfire Warrior (Version 1)</description> + <year>1980</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-03"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 13-sector drive and a 48K Apple ][+ or later.--> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234830"> + <rom name="dunjonquest - hellfire warrior v1.woz" size="234830" crc="e50e2f5e" sha1="06aeeb9fda26ba4e7d0803413d8da5d4fe3917bb"/> + </dataarea> + </part> + </software> + + <software name="dqhfwv2"> + <description>Dunjonquest: Hellfire Warrior (Version 2)</description> + <year>1980</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-03"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 13-sector drive and a 48K Apple ][+ or later.--> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234803"> + <rom name="dunjonquest - hellfire warrior v2.woz" size="234803" crc="97d67a1b" sha1="388d5069ef938229fe26d975f77993662622843d"/> + </dataarea> + </part> + </software> + + <software name="dqhfwv3"> + <description>Dunjonquest: Hellfire Warrior (Version 3)</description> + <year>1980</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-03"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later.--> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234830"> + <rom name="dunjonquest - hellfire warrior v3.woz" size="234830" crc="f2d3d1f0" sha1="90593ca39505dbe34c40efd6e19d67675e1a447e"/> + </dataarea> + </part> + </software> + + <software name="shogun"> + <description>Shogun</description> + <year>1988</year> + <publisher>Infocom</publisher> + <info name="release" value="2019-12-21"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="234808"> + <rom name="shogun - side 1.woz" size="234808" crc="267d0d5b" sha1="d5617acb5c030d9d892e7a18a4f23ba6a8be11f1"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2"/> + <dataarea name="flop" size="234808"> + <rom name="shogun - side 2.woz" size="234808" crc="2c8b4d9b" sha1="839dc25160ee254234ad62b28dd592e4eff6389d"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side 3"/> + <dataarea name="flop" size="234808"> + <rom name="shogun - side 3.woz" size="234808" crc="e4eb4b28" sha1="696eae6c1d603c46a062f131a28b3c389c27da00"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side 4"/> + <dataarea name="flop" size="234808"> + <rom name="shogun - side 4.woz" size="234808" crc="7808401c" sha1="b7baabf9e20328384977d18398c4da5bd44db626"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Side 5"/> + <dataarea name="flop" size="234808"> + <rom name="shogun - side 5.woz" size="234808" crc="58d9ff6b" sha1="4d35c2a094d5ebb32436b64c9c048792e7541fc3"/> + </dataarea> + </part> + </software> + + <software name="zorkzero"> + <description>Zork Zero</description> + <year>1989</year> + <publisher>Infocom</publisher> + <info name="release" value="2019-12-21"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="234852"> + <rom name="zork zero side 1.woz" size="234852" crc="00021beb" sha1="77b0208d3e318e3d097efe9140811944ab9bafdd"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2"/> + <dataarea name="flop" size="234852"> + <rom name="zork zero side 2.woz" size="234852" crc="3b6c57d1" sha1="786fc0bf12f66a1abc88a08bffb7754e4ea1a8ff"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side 3"/> + <dataarea name="flop" size="234852"> + <rom name="zork zero side 3.woz" size="234852" crc="e2e1284c" sha1="688da0f1543d7d484cd3d5f66bd45d413cabb151"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side 4"/> + <dataarea name="flop" size="234852"> + <rom name="zork zero side 4.woz" size="234852" crc="447e1b53" sha1="b02d9e060313de72a6d36348555024176cf27feb"/> + </dataarea> + </part> + </software> + + <software name="alntyphn"> + <description>Alien Typhoon</description> + <year>1981</year> + <publisher>Broderbund Software</publisher> + <info name="release" value="2019-12-21"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="101963"> + <rom name="alien typhoon.woz" size="101963" crc="5f8ca7f0" sha1="ace78dc02257b9e09fcf962bf2e5caa9cf5ae55c"/> + </dataarea> + </part> + </software> + + <software name="tmpapsr1"> + <description>Dunjonquest: The Temple of Apshai (Revision 1)</description> + <year>1979</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-06"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + <!--It requires a 13-sector drive and a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234834"> + <rom name="dunjonquest - the temple of apshai rev. 1.woz" size="234834" crc="558d8c4d" sha1="210ae265fc085655888c4dbad7f763a7c2e9c68d"/> + </dataarea> + </part> + </software> + + <software name="tmpapsr2"> + <description>Dunjonquest: The Temple of Apshai (Revision 2)</description> + <year>1979</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-06"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- This is revision 2, which fixes unspecified bugs and adds a + graphical title screen. It requires a 13-sector drive and a + 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234734"> + <rom name="dunjonquest - the temple of apshai rev. 2.woz" size="234734" crc="cde02b29" sha1="cb5e566436d64026dccd2f622d24aff1b529c71b"/> + </dataarea> + </part> + </software> + + <software name="tmpapsr3"> + <description>Dunjonquest: The Temple of Apshai (Revision 3)</description> + <year>1979</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-07"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- This is revision 3, with updated copy protection and a hi-res + character generator for on-screen text. It requires a 16-sector drive + and a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234807"> + <rom name="dunjonquest - the temple of apshai rev. 3.woz" size="234807" crc="6d43c84e" sha1="4fdadd64a576d5fce2a0af5aaced36429fd35b19"/> + </dataarea> + </part> + </software> + + <software name="tmpapsr4"> + <description>Dunjonquest: The Temple of Apshai (Revision 4)</description> + <year>1979</year> + <publisher>Automated Simulations</publisher> + <info name="release" value="2020-01-07"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- This is revision 4, with updated copy protection and a hi-res + character generator with two choices of font. It requires a 16-sector + drive and a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="248222"> + <rom name="dunjonquest - the temple of apshai rev. 4.woz" size="248222" crc="03743196" sha1="be872c142dfff107fed23e23fecb2ab1fb035ce0"/> + </dataarea> + </part> + </software> + + <software name="streksos"> + <description>Star Trek: Strategic Operations Simulator</description> + <year>1983</year> + <publisher>Sega</publisher> + <info name="release" value="2020-01-07"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="88341"> + <rom name="star trek - strategic operations simulator.woz" size="88341" crc="4c47c392" sha1="8ac0afa85358e8d9ab4a58daeb3b92a8b0330a55"/> + </dataarea> + </part> + </software> + + <software name="wzdryr21"> + <description>Wizardry: Proving Grounds of the Mad Overlord (Version 2.1)</description> + <year>1981</year> + <publisher>Sir-Tech</publisher> + <info name="release" value="2020-01-11"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + <!-- Note: some emulators may have difficulty loading this disk + because of its especially timing-sensitive copy protection.--> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Boot disk"/> + <dataarea name="flop" size="234829"> + <rom name="wizardry - proving grounds of the mad overlord v2.1 - boot disk.woz" size="234829" crc="29dfa2a6" sha1="6c0416fb7cb91bde8da05df77ecfc5f7b7c645f1"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Scenario master disk"/> + <dataarea name="flop" size="234829"> + <rom name="wizardry - proving grounds of the mad overlord v2.1 - scenario master disk.woz" size="234829" crc="7951ca26" sha1="604a416c50ca6fccb39c11142f8be00d51ce627c"/> + </dataarea> + </part> + </software> + + <software name="wzrdry2"> + <description>Wizardry II: The Knight of Diamonds (Version PV3S2V1/10-MAR-82)</description> + <year>1982</year> + <publisher>Sir-Tech</publisher> + <info name="release" value="2020-01-11"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + <!-- This is version PV3S2V1 of 10-MAR-82. + Note: some emulators may have difficulty loading this disk because of + its especially timing-sensitive copy protection.--> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Boot disk"/> + <dataarea name="flop" size="234854"> + <rom name="wizardry ii - knight of diamonds - boot disk.woz" size="234854" crc="16a794a8" sha1="db098051302810edb8aa5c56c8a3dd7cc9ab0772"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Master scenario disk"/> + <dataarea name="flop" size="234865"> + <rom name="wizardry ii - knight of diamonds - master scenario disk.woz" size="234865" crc="ac3a27d9" sha1="59f7c602c6347c732ddd8222d667622bf8749a29"/> + </dataarea> + </part> + </software> + + <software name="wizipr21"> + <description>Wiziprint (Version 2.1)</description> + <year>1982</year> + <publisher>Sir-Tech</publisher> + <info name="release" value="2020-01-13"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234840"> + <rom name="wiziprint v2.01.woz" size="234840" crc="593dc847" sha1="d8628dbce3441820cbbd2ef4ac5a94421e514226"/> + </dataarea> + </part> + </software> + + <software name="tramazon"> + <description>Amazon</description> + <year>1984</year> + <publisher>Trillium</publisher> + <info name="release" value="2020-01-14"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="234765"> + <rom name="amazon side 1.woz" size="234765" crc="3b40f777" sha1="423b5ac50f78b437147fd8dbe9eda9e4d47759b7"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2"/> + <dataarea name="flop" size="234765"> + <rom name="amazon side 2.woz" size="234765" crc="99779f7b" sha1="3fb413d6e6600257d4a28fcf0f3af7c72b3548ad"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side 3 (Boot)"/> + <dataarea name="flop" size="234765"> + <rom name="amazon side 3 (boot).woz" size="234765" crc="0e5a0504" sha1="2728aa48758297ad385fa49f30353a49e62bd888"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side 4"/> + <dataarea name="flop" size="234765"> + <rom name="amazon side 4.woz" size="234765" crc="41ed7aa5" sha1="0b3d7c70f1ed66366ea57d20c0846fb92be4fc0d"/> + </dataarea> + </part> + </software> + + <software name="lrdskrma"> + <description>Lords of Karma</description> + <year>1981</year> + <publisher>Avalon Hill</publisher> + <info name="release" value="2020-01-14"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234768"> + <rom name="lords of karma.woz" size="234768" crc="36d0b276" sha1="cda44968d7b4902af648fbb04597ea50b1b7947a"/> + </dataarea> + </part> + </software> + + <software name="xyphus"> + <description>Xyphus</description> + <year>1984</year> + <publisher>Penguin Software</publisher> + <info name="release" value="2020-01-14"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 - Program disk"/> + <dataarea name="flop" size="121619"> + <rom name="xyphus - program disk.woz" size="121619" crc="9126e743" sha1="04d5ad0a6a547cc672769f0512d374072ad0d950"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 - Scenario disk"/> + <dataarea name="flop" size="221460"> + <rom name="xyphus - scenario disk.woz" size="221460" crc="081fa985" sha1="116c2cdd0240393c2920c665fc0a251e6d5b8bf5"/> + </dataarea> + </part> + </software> + + <software name="ochess70"> + <description>Chess (Odesta) (Version 7.0)</description> + <year>1982</year> + <publisher>Odesta Software</publisher> + <info name="release" value="2020-01-14"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234821"> + <rom name="chess v7.0 (odesta).woz" size="234821" crc="dea3482d" sha1="40d127ba91d83be331a266e4f7d9727baeb78711"/> + </dataarea> + </part> + </software> + + <software name="rambop2"> + <description>Rambo: First Blood Part II</description> + <year>1985</year> + <publisher>Mindscape</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires an 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234786"> + <rom name="rambo - first blood part ii.woz" size="234786" crc="92ca8258" sha1="e8c90cd2690c0cdf3760184ccc9befdfde4d171c"/> + </dataarea> + </part> + </software> + + <software name="newworld"> + <description>New World</description> + <year>1982</year> + <publisher>Epyx</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234801"> + <rom name="new world.woz" size="234801" crc="2e45639d" sha1="2b64556b6c107d07f382b4fdbb4c61db7e3bcadc"/> + </dataarea> + </part> + </software> + + <software name="qstscltr"> + <description>Quest for the Scarlet Letter</description> + <year>1982</year> + <publisher>Superior Software</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234802"> + <rom name="quest for the scarlet letter.woz" size="234802" crc="8af2dc02" sha1="f5548d1ad829df311e71d4682741569946054cee"/> + </dataarea> + </part> + </software> + + <software name="cubnftsy"> + <description>Cuban Fantasy</description> + <year>1982</year> + <publisher>Yukon Computer Products</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="235483"> + <rom name="cuban fantasy.woz" size="235483" crc="952f53c4" sha1="22eb3c69a4ef8a77dbc72cde2fa2d79a951b8f7b"/> + </dataarea> + </part> + </software> + + <software name="neuromnc"> + <description>Neuromancer</description> + <year>1988</year> + <publisher>Interplay Productions</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="241467"> + <rom name="neuromancer - side 1.woz" size="241467" crc="450dc5ec" sha1="540d98c2c7aceb2160d25b4136e84deec63e213c"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2"/> + <dataarea name="flop" size="241467"> + <rom name="neuromancer - side 2.woz" size="241467" crc="4a7de9ee" sha1="5cdb323c885869dacd466122ebd6ce698fcb2471"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Side 3"/> + <dataarea name="flop" size="241467"> + <rom name="neuromancer - side 3.woz" size="241467" crc="f041598b" sha1="51073328024c3568cda596656395f570044b7e31"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Side 4"/> + <dataarea name="flop" size="241467"> + <rom name="neuromancer - side 4.woz" size="241467" crc="73642b5f" sha1="ac839fd7419df495bf263f05f70784d74d1c1f16"/> + </dataarea> + </part> + </software> + + <software name="dhuukrul"> + <description>The Dark Heart of Uukrul</description> + <year>1989</year> + <publisher>Broderbund Software</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Archive Disk"/> + <dataarea name="flop" size="234821"> + <rom name="the dark heart of uukrul - archive disk.woz" size="234821" crc="e3defc5a" sha1="8ac090f8a5ead4aedea6f337d2dcf6322d463838"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Boot Disk"/> + <dataarea name="flop" size="234818"> + <rom name="the dark heart of uukrul - boot disk.woz" size="234818" crc="94ecd9db" sha1="2892c5b5d1000f08a525fdf2d90842b9fb588eae"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Scenario disk A"/> + <dataarea name="flop" size="234824"> + <rom name="the dark heart of uukrul - scenario disk a.woz" size="234824" crc="5cfa9773" sha1="69ec3686d9b562fc4bd318a10bf2ae464fc3cfd0"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Scenario disk B"/> + <dataarea name="flop" size="234824"> + <rom name="the dark heart of uukrul - scenario disk b.woz" size="234824" crc="766dc1ee" sha1="ae4084e5af24a8ecfded776371e470d150ade818"/> + </dataarea> + </part> + </software> + + <software name="brck1798"> + <description>The Breckenridge Caper of 1798</description> + <year>1982</year> + <publisher>Superior Software</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234798"> + <rom name="the breckenridge caper of 1798.woz" size="234798" crc="d1399d24" sha1="e61b445913b556052f08a5b3abdaa923fc8c6dde"/> + </dataarea> + </part> + </software> + + <software name="amnesia"> + <description>Amnesia</description> + <year>1986</year> + <publisher>Electronic Arts</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 64K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A"/> + <dataarea name="flop" size="228118"> + <rom name="amnesia disk 1a.woz" size="228118" crc="2bc5a39f" sha1="927c536daae91d82175efab5e707881673c4d73a"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B"/> + <dataarea name="flop" size="234774"> + <rom name="amnesia disk 1b.woz" size="234774" crc="b1a530f1" sha1="abf89dd7a83002b7b62cd77b9fd73582bc707333"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A"/> + <dataarea name="flop" size="234774"> + <rom name="amnesia disk 2a.woz" size="234774" crc="28042b7f" sha1="5dbce53fc06e1e9dea2ea3ae9c6c4f1d8dc03a82"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B"/> + <dataarea name="flop" size="234774"> + <rom name="amnesia disk 2b.woz" size="234774" crc="edc22834" sha1="7a2570b1a124fc1cea148f9cd899ccab25958b93"/> + </dataarea> + </part> + </software> + + <software name="goldrush"> + <description>Gold Rush! (Version 1.0M)</description> + <year>1989</year> + <publisher>Sierra On-Line</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 128K Apple //e or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 1a.woz" size="234823" crc="353becc5" sha1="4017229d3201a124fd6e3279e5636a22f1db2ed4"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Disk 1 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 1b.woz" size="234823" crc="65579b17" sha1="719361e313bdbec9750d905cc9e6df1fcd0b4309"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 2a.woz" size="234823" crc="402a1809" sha1="e7bfc6707a0dc06a3a056e65ff97e98ba5c832f6"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="Disk 2 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 2b.woz" size="234823" crc="00c89187" sha1="851bd9fba6b918fa53db274f02325d8e3940609b"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 3a.woz" size="234823" crc="b1f9a9cf" sha1="a3c335e3dcdcaa46a0a98f709f64fbdef4cfaf0b"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="Disk 3 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 3b.woz" size="234823" crc="846d5ff7" sha1="11d4faa4492c0bb7fe6bc444b4ff7426aec449c3"/> + </dataarea> + </part> + <part name="flop7" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 4a.woz" size="234823" crc="aa7a4cd6" sha1="c6487a07ca5841aafcaa3674dfe3a7e695b66fc3"/> + </dataarea> + </part> + <part name="flop8" interface="floppy_5_25"> + <feature name="part_id" value="Disk 4 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 4b.woz" size="234823" crc="98a27bfc" sha1="bb7bb6bcf6fd0e25007ebd179c2cc9f8b321d4b7"/> + </dataarea> + </part> + <part name="flop9" interface="floppy_5_25"> + <feature name="part_id" value="Disk 5 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 5a.woz" size="234823" crc="52f1b57d" sha1="70a2741ef18489ccb8b9e219e9d7a2092a7ab02d"/> + </dataarea> + </part> + <part name="flop10" interface="floppy_5_25"> + <feature name="part_id" value="Disk 5 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 5b.woz" size="234823" crc="5c286071" sha1="fbfa17119806934af718514aa6622861c2d7b16c"/> + </dataarea> + </part> + <part name="flop11" interface="floppy_5_25"> + <feature name="part_id" value="Disk 6 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 6a.woz" size="234823" crc="3308207f" sha1="41aff7efcf1775f675ada82eccb89fe7fc19e981"/> + </dataarea> + </part> + <part name="flop12" interface="floppy_5_25"> + <feature name="part_id" value="Disk 6 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 6b.woz" size="234823" crc="51bd3df5" sha1="124f7cba9bef89e63674209ff44f30207f405ade"/> + </dataarea> + </part> + <part name="flop13" interface="floppy_5_25"> + <feature name="part_id" value="Disk 7 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 7a.woz" size="234823" crc="ba529141" sha1="eaadffc83064fc9f709f79fbb47a63569b96e8d1"/> + </dataarea> + </part> + <part name="flop14" interface="floppy_5_25"> + <feature name="part_id" value="Disk 7 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 7b.woz" size="234823" crc="a985bb4d" sha1="c10dbcc84e67fccd627a17a0e7a1f86a38463162"/> + </dataarea> + </part> + <part name="flop15" interface="floppy_5_25"> + <feature name="part_id" value="Disk 8 Side A"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 8a.woz" size="234823" crc="0d6cd2e5" sha1="5fd0a83ea530e010a34353f3a663887aa16c3964"/> + </dataarea> + </part> + <part name="flop16" interface="floppy_5_25"> + <feature name="part_id" value="Disk 8 Side B"/> + <dataarea name="flop" size="234823"> + <rom name="gold rush! disk 8b.woz" size="234823" crc="9894e285" sha1="63a441f0bee1b130b7883e2bbfc20882884c40ef"/> + </dataarea> + </part> + </software> + + <software name="qphulk"> + <description>Questprobe featuring The Hulk (Version 2.3/127)</description> + <year>1984</year> + <publisher>Adventure International</publisher> + <info name="release" value="2020-01-20"/> + <sharedfeat name="compatibility" value=",A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires an Apple ][+ with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side A"/> + <dataarea name="flop" size="234828"> + <rom name="questprobe featuring the hulk side a.woz" size="234828" crc="5878d49d" sha1="84cf1dbe3c38a0b98e8030932217f911a9146643"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side B (Boot)"/> + <dataarea name="flop" size="234828"> + <rom name="questprobe featuring the hulk side b (boot).woz" size="234828" crc="54ddc830" sha1="c8884b9fb356cfb5dc496920e0653ee6b2572c2f"/> + </dataarea> + </part> + </software> + + <software name="horizv"> + <description>Horizon V</description> + <year>1982</year> + <publisher>Gebelli Software</publisher> + <info name="release" value="2020-01-22"/> + <sharedfeat name="compatibility" value="A2,A2P"/> + <!-- It requires an Apple ][ or Apple ][+. Due to restrictive copy protection, it will not boot on later models. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="354579"> + <rom name="horizon v.woz" size="354579" crc="4ba97a3e" sha1="57c0c36f919df498693e235614bd0c1c83183181"/> + </dataarea> + </part> + </software> + + <software name="crwnarth"> + <description>Crown of Arthain</description> + <year>1980</year> + <publisher>Micro Lab</publisher> + <info name="release" value="2020-01-22"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="234789"> + <rom name="crown of arthain.woz" size="234789" crc="454ac2fa" sha1="068c976a64a2b0563e5f98983a8d7b46976307c2"/> + </dataarea> + </part> + </software> + + <software name="diamine"> + <description>Diamond Mine</description> + <year>1983</year> + <publisher>Roklan Corporation</publisher> + <info name="release" value="2020-01-22"/> + <sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It runs on any Apple II with 48K. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="201487"> + <rom name="diamond mine.woz" size="201487" crc="d7e143f3" sha1="66d84fd826d0bed64c585c00deedbfbc570854ce"/> + </dataarea> + </part> + </software> + + <software name="abyszone"> + <description>The Abyssal Zone</description> + <year>1984</year> + <publisher>Salty Software</publisher> + <info name="release" value="2020-01-22"/> + <sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS"/> + <!-- It requires a 48K Apple ][+ or later. --> + + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Side 1"/> + <dataarea name="flop" size="234815"> + <rom name="the abyssal zone side 1.woz" size="234815" crc="36ed024c" sha1="1cb3db556bbbc417e16f0021579d636b461107d2"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Side 2 - Boot"/> + <dataarea name="flop" size="234813"> + <rom name="the abyssal zone side 2 (boot).woz" size="234813" crc="4113c4f4" sha1="6cee828e9f6ed6adbe799b2579f35b05f9821f01"/> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/archimedes.xml b/hash/archimedes.xml index 76e51fb923d..79d61142208 100644 --- a/hash/archimedes.xml +++ b/hash/archimedes.xml @@ -231,7 +231,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="airsuprm" supported="yes"> + <software name="airsuprm"> <description>Air Supremacy</description> <year>1991</year> <publisher>Superior Software/Acornsoft</publisher> @@ -255,7 +255,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="alerion" supported="yes"> + <software name="alerion"> <description>Alerion</description> <year>1994</year> <publisher>Archimedes World</publisher> @@ -327,7 +327,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="allinbox" supported="yes"> + <software name="allinbox"> <description>All-In Boxing</description> <year>1994</year> <publisher>Archimedes World</publisher> @@ -395,7 +395,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="alps" supported="yes"> + <software name="alps"> <description>ALPS - Adventure Language Programming System</description> <year>1994</year> <publisher>Alpine Software</publisher> @@ -477,7 +477,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="axis" supported="yes"> + <software name="axis"> <description>Axis</description> <year>1993</year> <publisher>TBA Software</publisher> @@ -496,7 +496,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="bigbang" supported="yes"> + <software name="bigbang"> <description>Big Bang</description> <year>1996</year> <publisher>Psycore</publisher> @@ -508,7 +508,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="blitz" supported="yes"> + <software name="blitz"> <description>Blitz!</description> <year>1991</year> <publisher>Arxe Systems</publisher> @@ -520,7 +520,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="blowpipe" supported="yes"> + <software name="blowpipe"> <description>Blowpipe</description> <year>1990</year> <publisher>Eclipse</publisher> @@ -551,7 +551,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="break147" supported="yes"> + <software name="break147"> <description>Break 147</description> <year>1991</year> <publisher>Fourth Dimension</publisher> @@ -649,7 +649,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="cataclys" supported="yes"> + <software name="cataclys"> <description>Cataclysm</description> <year>1991</year> <publisher>Fourth Dimension</publisher> @@ -669,7 +669,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- Boot OK --> - <software name="caverns" supported="yes"> + <software name="caverns"> <description>Caverns</description> <year>1991</year> <publisher>Minerva</publisher> @@ -681,7 +681,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has hacker note in !ChessInfo --> - <software name="chess3d" supported="yes"> + <software name="chess3d"> <description>Chess 3D</description> <year>1991</year> <publisher>Micro Power</publisher> @@ -693,7 +693,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has hacker note in !ChessInfo --> - <software name="chess3da" cloneof="chess3d" supported="yes"> + <software name="chess3da" cloneof="chess3d"> <description>Chess 3D (Alt)</description> <year>1991</year> <publisher>Micro Power</publisher> @@ -775,7 +775,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="chuckrck" supported="yes"> + <software name="chuckrck"> <description>Chuck Rock</description> <year>1991</year> <publisher>Krisalis</publisher> @@ -794,7 +794,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="conquer" supported="yes"> + <software name="conquer"> <description>Conqueror</description> <year>1988</year> <publisher>Superior Software/Acornsoft</publisher> @@ -1053,7 +1053,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="ego" supported="yes"> + <software name="ego"> <description>EGO: Repton 4</description> <year>1992</year> <publisher>Superior Software</publisher> @@ -1065,7 +1065,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- Hangs at boot screen --> - <software name="egoc" cloneof="ego" supported="yes"> + <software name="egoc" cloneof="ego"> <description>EGO: Repton 4 [passwords]</description> <year>1992</year> <publisher>ProAction</publisher> @@ -1113,7 +1113,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, Has trainer and passwords file --> - <software name="enigma" supported="yes"> + <software name="enigma"> <description>Enigma</description> <year>1993</year> <publisher>Archimedes World</publisher> @@ -1125,7 +1125,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, Has trainer and passwords file --> - <software name="enigmaa" cloneof="enigma" supported="yes"> + <software name="enigmaa" cloneof="enigma"> <description>Enigma (Alt)</description> <year>1993</year> <publisher>Archimedes World</publisher> @@ -1186,7 +1186,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="fireice" supported="yes"> + <software name="fireice"> <description>Fire & Ice</description> <year>1995</year> <publisher>Krisalis</publisher> @@ -1205,7 +1205,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has unemulated printer --> - <software name="fish" supported="yes"> + <software name="fish"> <description>Fish!</description> <year>1990</year> <publisher>Magnetic Scrolls</publisher> @@ -1371,7 +1371,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="galacdan" supported="yes"> + <software name="galacdan"> <description>Galactic Dan</description> <year>1992</year> <publisher>Fourth Dimension</publisher> @@ -1383,7 +1383,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, title screen logo have few black dots --> - <software name="gods" supported="yes"> + <software name="gods"> <description>Gods</description> <year>1992</year> <publisher>Krisalis</publisher> @@ -1402,7 +1402,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, title screen logo have few black dots --> - <software name="godsc" cloneof="gods" supported="yes"> + <software name="godsc" cloneof="gods"> <description>Gods [cracked]</description> <year>1992</year> <publisher>Krisalis</publisher> @@ -1421,7 +1421,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="gorm" supported="yes"> + <software name="gorm"> <description>Gorm</description> <year>1994</year> <publisher>Archimedes World</publisher> @@ -1445,7 +1445,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="gribblys" supported="yes"> + <software name="gribblys"> <description>Gribbly's Day Out on the Arc</description> <year>1992</year> <publisher>Coin-Age</publisher> @@ -1457,7 +1457,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="guildthvs" supported="yes"> + <software name="guildthvs"> <description>The Guild of Thieves</description> <year>1989</year> <publisher>Magnetic Scrolls</publisher> @@ -1481,7 +1481,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, only stage 1 (recheck on Arculator) --> - <software name="hamsters" supported="yes"> + <software name="hamsters"> <description>Hamsters (Demo)</description> <year>1994</year> <publisher>Eclipse</publisher> @@ -1544,7 +1544,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="hexatoms" supported="yes"> + <software name="hexatoms"> <description>Hex Atoms</description> <year>1992</year> <publisher>BitBox</publisher> @@ -1594,7 +1594,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has trainer --> - <software name="ironlord" supported="yes"> + <software name="ironlord"> <description>Iron Lord</description> <year>1990</year> <publisher>Cygnus</publisher> @@ -1607,7 +1607,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="ironlorda" cloneof="ironlord" supported="yes"> + <software name="ironlorda" cloneof="ironlord"> <description>Iron Lord (Alt)</description> <year>1990</year> <publisher>Ubi Soft</publisher> @@ -1716,7 +1716,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="lander" supported="yes"> + <software name="lander"> <description>Lander (Demo)</description> <year>1987</year> <publisher>Acorn</publisher> @@ -1728,7 +1728,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="ldaydoom" supported="yes"> + <software name="ldaydoom"> <description>The Last Days of Doom (includes Hezarin)</description> <year>1993</year> <publisher>Topologika</publisher> @@ -1740,7 +1740,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="lastninja" supported="yes"> + <software name="lastninja"> <description>The Last Ninja</description> <year>1992</year> <publisher>Superior Software</publisher> @@ -1753,7 +1753,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="lastninjac" cloneof="lastninja" supported="yes"> + <software name="lastninjac" cloneof="lastninja"> <description>The Last Ninja [cracked]</description> <year>1992</year> <publisher>Superior Software</publisher> @@ -1873,7 +1873,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="magpockets" supported="yes"> + <software name="magpockets"> <description>Magic Pockets</description> <year>1993</year> <publisher>Renegade</publisher> @@ -1885,7 +1885,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="magscrolls" supported="yes"> + <software name="magscrolls"> <description>The Magnetic Scrolls Collection</description> <year>1991</year> <publisher>Magnetic Scrolls</publisher> @@ -1917,7 +1917,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="mariarti" supported="yes"> + <software name="mariarti"> <description>Mad Professor Mariarti</description> <year>1990</year> <publisher>Krisalis</publisher> @@ -1941,7 +1941,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="mariartib" cloneof="mariarti" supported="yes"> + <software name="mariartib" cloneof="mariarti"> <description>Mad Professor Mariarti (Alt 2)</description> <year>1990</year> <publisher>Krisalis</publisher> @@ -2008,7 +2008,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="moonquak" supported="yes"> + <software name="moonquak"> <description>Moon Quake</description> <year>1992</year> <publisher>Archimedes World</publisher> @@ -2021,7 +2021,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, main sprite cuts off when moving --> - <software name="mrdoo" supported="yes"> + <software name="mrdoo"> <description>Mr. Doo</description> <year>1994</year> <publisher>Archimedes World</publisher> @@ -2033,7 +2033,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, main sprite cuts off when moving --> - <software name="mrdooa" cloneof="mrdoo" supported="yes"> + <software name="mrdooa" cloneof="mrdoo"> <description>Mr. Doo (Alt)</description> <year>1994</year> <publisher>Archimedes World</publisher> @@ -2141,7 +2141,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="pacmania" supported="yes"> + <software name="pacmania"> <description>Pac-Mania</description> <year>1991</year> <publisher>Domark</publisher> @@ -2191,7 +2191,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has Vertical Twist joystick utility --> - <software name="paradr2k" supported="yes"> + <software name="paradr2k"> <description>Paradroid 2000</description> <year>1993</year> <publisher>Coin-Age</publisher> @@ -2203,7 +2203,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has Vertical Twist joystick utility --> - <software name="paradr2ka" cloneof="paradr2k" supported="yes"> + <software name="paradr2ka" cloneof="paradr2k"> <description>Paradroid 2000 (Alt)</description> <year>1993</year> <publisher>Coin-Age</publisher> @@ -2307,7 +2307,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="populous" supported="yes"> + <software name="populous"> <description>Populous</description> <year>1992</year> <publisher>Krisalis</publisher> @@ -2319,7 +2319,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="populousc" cloneof="populous" supported="yes"> + <software name="populousc" cloneof="populous"> <description>Populous [cracked]</description> <year>1992</year> <publisher>Krisalis</publisher> @@ -2373,7 +2373,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="repton3" supported="yes"> + <software name="repton3"> <description>Repton 3</description> <year>1988</year> <publisher>Superior Software/Acornsoft</publisher> @@ -2396,7 +2396,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="revelatn" supported="yes"> + <software name="revelatn"> <description>Revelation</description> <year>1993</year> <publisher>Krisalis</publisher> @@ -2408,7 +2408,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="revolver" supported="yes"> + <software name="revolver"> <description>Revolver</description> <year>1995</year> <publisher>Psycore</publisher> @@ -2420,7 +2420,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, using a "c" command prints the floppy contents? --> - <software name="risecrime" supported="yes"> + <software name="risecrime"> <description>Rise In Crime</description> <year>1988</year> <publisher>Robico</publisher> @@ -2475,7 +2475,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="serpents" supported="yes"> + <software name="serpents"> <description>Serpents</description> <year>1993</year> <publisher>CIS</publisher> @@ -2566,7 +2566,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, initial speech pitch sounds very low (btanb) --> - <software name="small" supported="yes"> + <software name="small"> <description>Small</description> <year>1993</year> <publisher>Virgo Software</publisher> @@ -2614,7 +2614,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="spheres" supported="yes"> + <software name="spheres"> <description>Spheres of Chaos (Demo)</description> <year>1992</year> <publisher>Matt Black</publisher> @@ -2626,7 +2626,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="spheresa" cloneof="spheres" supported="yes"> + <software name="spheresa" cloneof="spheres"> <description>Spheres of Chaos (Demo)(Alt)</description> <year>1992</year> <publisher>Matt Black</publisher> @@ -2638,7 +2638,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="spheresc" supported="yes"> + <software name="spheresc"> <description>Spheres of Chaos</description> <year>1993</year> <publisher>Matt Black</publisher> @@ -2737,7 +2737,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="suprpool" supported="yes"> + <software name="suprpool"> <description>Super Pool</description> <year>1991</year> <publisher>Fourth Dimension</publisher> @@ -2785,7 +2785,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, joystick isn't detected --> - <software name="swiv" supported="yes"> + <software name="swiv"> <description>SWIV</description> <year>1992</year> <publisher>Krisalis</publisher> @@ -2809,7 +2809,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, mouse gfx on Frozen screen looks bad --> - <software name="talismana" cloneof="talisman" supported="yes"> + <software name="talismana" cloneof="talisman"> <description>Talisman (Alt)</description> <year>1989</year> <publisher>Minerva</publisher> @@ -2821,7 +2821,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="terramex" supported="yes"> + <software name="terramex"> <description>Terramex</description> <year>1988</year> <publisher>Krisalis</publisher> @@ -2834,7 +2834,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) <!-- boot OK --> <!-- Revised version means it can run on RiscOS 3.5+ --> - <software name="terramexa" cloneof="terramex" supported="yes"> + <software name="terramexa" cloneof="terramex"> <description>Terramex (Revised Version, v2.05)</description> <year>1991</year> <publisher>Krisalis</publisher> @@ -2846,7 +2846,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="topbanan" supported="yes"> + <software name="topbanan"> <description>Top Banana</description> <year>1988</year> <publisher>Hex</publisher> @@ -2858,7 +2858,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="topbanana" cloneof="topbanan" supported="yes"> + <software name="topbanana" cloneof="topbanan"> <description>Top Banana (Alt)</description> <year>1988</year> <publisher>Hex</publisher> @@ -2870,7 +2870,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="towbabel" supported="yes"> + <software name="towbabel"> <description>Tower of Babel</description> <year>1991</year> <publisher>Cygnus</publisher> @@ -2955,7 +2955,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has ZX Spectrum like raster effect when dying with the fan --> - <software name="wimpgame" supported="yes"> + <software name="wimpgame"> <description>The Wimp Game</description> <year>1990</year> <publisher>Fourth Dimension</publisher> @@ -2968,7 +2968,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has ZX Spectrum like raster effect when dying with the fan --> - <software name="wimpgamec" cloneof="wimpgame" supported="yes"> + <software name="wimpgamec" cloneof="wimpgame"> <description>The Wimp Game [cracked]</description> <year>1990</year> <publisher>Fourth Dimension</publisher> @@ -2981,7 +2981,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="wolf3d" supported="yes"> + <software name="wolf3d"> <description>Wolfenstein 3D</description> <year>1994</year> <publisher>Powerslave Software</publisher> @@ -3019,7 +3019,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="worldbox" supported="yes"> + <software name="worldbox"> <description>World Championship Boxing Manager</description> <year>1991</year> <publisher>Krisalis</publisher> @@ -3082,7 +3082,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="zarch" supported="yes"> + <software name="zarch"> <description>Zarch</description> <year>1987</year> <publisher>Superior Software/Acornsoft</publisher> @@ -3095,7 +3095,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="zarchc" cloneof="zarch" supported="yes"> + <software name="zarchc" cloneof="zarch"> <description>Zarch [cracked]</description> <year>1987</year> <publisher>Superior Software/Acornsoft</publisher> @@ -3130,7 +3130,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) <!-- Other disks to sort (homebrew?!?) --> <!-- boot OK --> - <software name="3dtanks" supported="yes"> + <software name="3dtanks"> <description>3D Tanks</description> <year>19??</year> <publisher><homebrew></publisher> @@ -3193,7 +3193,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="bloxed" supported="yes"> + <software name="bloxed"> <description>Bloxed (v1.09, 23 Feb 1995)</description> <year>1995</year> <publisher><homebrew></publisher> @@ -3206,7 +3206,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="blackhrt" supported="yes"> + <software name="blackhrt"> <description>Castle Black Heart</description> <year>1991</year> <publisher><homebrew></publisher> @@ -3242,7 +3242,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="colourum" supported="yes"> + <software name="colourum"> <description>Colour UMoria (v5.4.0)</description> <year>1992</year> <publisher><homebrew></publisher> @@ -3256,7 +3256,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) <!-- boot OK --> <!-- TBD: counter check contents of "other" folder with an anti-virus suite --> - <software name="corewars" supported="yes"> + <software name="corewars"> <description>Core Wars (v1.17)</description> <year>1990</year> <publisher><homebrew></publisher> @@ -3268,7 +3268,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="creepie" supported="yes"> + <software name="creepie"> <description>Creepie Crawlie 1 & 2</description> <year>19??</year> <publisher><homebrew></publisher> @@ -3306,7 +3306,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="dinosaw" supported="yes"> + <software name="dinosaw"> <description>DinoSaw PD (v1.0)</description> <year>1993</year> <publisher><homebrew></publisher> @@ -3331,7 +3331,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="gyrinus2" supported="yes"> + <software name="gyrinus2"> <description>Gyrinus II - Son of Gyrinus (v3.5)</description> <year>19??</year> <publisher><homebrew></publisher> @@ -3351,7 +3351,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="hacker" supported="yes"> + <software name="hacker"> <description>The Hacker (v3.05)</description> <year>1993</year> <publisher>DoggySoft</publisher> @@ -3363,7 +3363,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="hackera" cloneof="hacker" supported="yes"> + <software name="hackera" cloneof="hacker"> <description>The Hacker (Alt, v3.05)</description> <year>1993</year> <publisher>DoggySoft</publisher> @@ -3405,7 +3405,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="lemings" supported="yes"> + <software name="lemings"> <description>Lemings</description> <year>19??</year> <publisher><homebrew></publisher> @@ -3430,7 +3430,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK, has minor RMW bug on second screen with text scroll --> - <software name="riscdrm" supported="yes"> + <software name="riscdrm"> <description>RiscDream</description> <year>1991</year> <publisher><homebrew></publisher> @@ -3483,7 +3483,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="sysintd" supported="yes"> + <software name="sysintd"> <description>System Interrupt Demos 1-5</description> <year>1989</year> <publisher><homebrew></publisher> @@ -3509,7 +3509,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) </software> <!-- boot OK --> - <software name="coconizr" supported="yes"> + <software name="coconizr"> <description>Coconizer+ (v1.3)</description> <year>1991</year> <publisher>Playfield</publisher> diff --git a/hash/bbc_rom.xml b/hash/bbc_rom.xml index 035d551b109..8c4953d1775 100644 --- a/hash/bbc_rom.xml +++ b/hash/bbc_rom.xml @@ -641,6 +641,7 @@ <publisher>Acorn</publisher> <info name="release" value="ANB29" /> <info name="usage" value="Requires Acorn 1770 FDC" /> + <sharedfeat name="compatibility" value="B"/> <part name="rom1" interface="bbc_rom"> <dataarea name="rom" size="16384"> <rom name="Acorn-ADFS-1.30.rom" size="16384" crc="d3855588" sha1="301fd05c475a629c4bec70510d4507256a5b00d8"/> @@ -648,6 +649,42 @@ </part> </software> + <software name="adfs133"> + <description>Acorn ADFS 1.33 (IDE)</description> + <year>2005</year> + <publisher>Acorn / J.G.Harston</publisher> + <sharedfeat name="compatibility" value="B"/> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="Acorn-ADFS-1.33.rom" size="16384" crc="16568e34" sha1="3433c4518b51e333058fedc524b0e31c04e17474"/> + </dataarea> + </part> + </software> + + <software name="adfs153"> + <description>Acorn ADFS 1.53 (IDE)</description> + <year>2005</year> + <publisher>Acorn / J.G.Harston</publisher> + <sharedfeat name="compatibility" value="M"/> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="Acorn-ADFS-1.53.rom" size="16384" crc="d8f17d6f" sha1="2e169ec7b35a407b5d537bacada8b4188ae18bef"/> + </dataarea> + </part> + </software> + + <software name="adfs157"> + <description>Acorn ADFS 1.57 (MMC)</description> + <year>2016</year> + <publisher>Acorn / J.G.Harston</publisher> + <sharedfeat name="compatibility" value="M"/> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="Acorn-ADFS-1.57.rom" size="16384" crc="0c9473ea" sha1="2cfa3d17455627739bfafb0538b3705692ace35d"/> + </dataarea> + </part> + </software> + <software name="adfsutil"> <description>ADFS Utilities</description> <year>1988</year> @@ -681,6 +718,17 @@ </part> </software> + <software name="advros" supported="no"> + <description>Advanced Ram Operating System 1.00</description> + <year>1985</year> + <publisher>Permanent Memory Systems</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="AdvancedROS-PMS-1.0.rom" size="16384" crc="aed8aa74" sha1="bc5e5d5d6bcf8114cd41192cdc114a41b16bc357"/> + </dataarea> + </part> + </software> + <software name="aerodrom"> <description>Aerodrome Training Aid</description> <year>1986</year> @@ -3128,6 +3176,17 @@ </part> </software> + <software name="eprom103" cloneof="eprom" supported="no"> + <description>EPROM 1.03</description> + <year>1983</year> + <publisher>Watford Electronics</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="EPROM-1.03.rom" size="8192" crc="06b7d662" sha1="dc9593fea03500a1942cb631a1f318f486d22fc6"/> + </dataarea> + </part> + </software> + <software name="eprom104" cloneof="eprom" supported="no"> <description>EPROM 1.04</description> <year>1984</year> @@ -3882,6 +3941,28 @@ </part> </software> + <software name="hadfs600" cloneof="hadfs"> + <description>Harston ADFS 6.00</description> + <year>2012</year> + <publisher>J.G.Harston</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="HADFS-6.00.rom" size="16384" crc="1642bfae" sha1="fce389d29ff9188ae700ccf191d49b9567bd96fa"/> + </dataarea> + </part> + </software> + + <software name="hadfs"> + <description>Harston ADFS 6.10</description> + <year>2018</year> + <publisher>J.G.Harston</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="HADFS-6.10.rom" size="16384" crc="17567a9a" sha1="cb94b8660bd11f75fd07a7c51cb2579ca4ef7689"/> + </dataarea> + </part> + </software> + <software name="hebrew"> <description>Hebrew</description> <year>198?</year> @@ -4139,8 +4220,8 @@ <software name="informnt"> <description>The Informant</description> - <year>1989</year> - <publisher><unknown></publisher> + <year>1990</year> + <publisher>Alan Blundell</publisher> <part name="rom1" interface="bbc_rom"> <dataarea name="rom" size="16384"> <rom name="Informant-1.00.rom" size="16384" crc="094c5f01" sha1="7b78d3f1ab7d4ac0e6960a0a90f6fb7ad0a36ea8"/> @@ -6101,6 +6182,54 @@ </part> </software> + <software name="ramfs100"> + <description>RetroClinic RamFS 1.00</description> + <year>2009</year> + <publisher>RetroClinic</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="RamFS-1.00.rom" size="16384" crc="728c8134" sha1="b39591bddb896745ce1a1cacd01e369ac5971800"/> + </dataarea> + </part> + </software> + + <software name="ramfs"> + <description>RetroClinic RamFS 1.04</description> + <year>2016</year> + <publisher>RetroClinic</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="RamFS-1.04.rom" size="16384" crc="2e52e331" sha1="d3c501fb29d35c2d144b164fa3ceb5a3b65d2850"/> + </dataarea> + </part> + </software> + + <software name="ramagicb" supported="no"> + <description>RAMagic! 2.0B</description> + <year>2008</year> + <publisher>Martin Barr</publisher> + <sharedfeat name="compatibility" value="B"/> + <part name="rom1" interface="bbc_rom"> + <feature name="slot" value="ramagic" /> + <dataarea name="rom" size="16384"> + <rom name="RAMagic-2.0B.rom" size="16384" crc="9653777d" sha1="a8048b0655f2bf8bf962300e1f19335b2f0f8cf7"/> + </dataarea> + </part> + </software> + + <software name="ramagicm" supported="no"> + <description>RAMagic! 2.1M</description> + <year>2008</year> + <publisher>Martin Barr</publisher> + <sharedfeat name="compatibility" value="M"/> + <part name="rom1" interface="bbc_rom"> + <feature name="slot" value="ramagic" /> + <dataarea name="rom" size="16384"> + <rom name="RAMagic-2.1M.rom" size="16384" crc="972f1f77" sha1="dbc485df39461036d7edd1f322bd66d70495c84e"/> + </dataarea> + </part> + </software> + <software name="ravideo240" cloneof="ravideo" supported="no"> <description>Ramamp Video 2.40</description> <year>1986</year> @@ -6735,6 +6864,17 @@ </part> </software> + <software name="smartspi" supported="no"> + <description>Smart SPI</description> + <year>2016</year> + <publisher>Duikkie</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="SmartSPI-0.10.rom" size="16384" crc="f5782b50" sha1="1058b85bfa3141cc74371a012ed4d6141ba3783a"/> + </dataarea> + </part> + </software> + <software name="solimon"> <description>Solimon 1.02</description> <year>1984</year> @@ -7470,6 +7610,39 @@ </part> </software> + <software name="streamer005" cloneof="streamer" supported="no"> + <description>Digistore Streamer 0.05</description> + <year>1986</year> + <publisher>Digital Services</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="Streamer-0.05.rom" size="8192" crc="9b6d6039" sha1="8f3bfd1b1201942641236b4fbf282410fdfe9a80"/> + </dataarea> + </part> + </software> + + <software name="streamer007" cloneof="streamer" supported="no"> + <description>Digistore Streamer 0.07</description> + <year>1986</year> + <publisher>Digital Services</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="Streamer-0.07.rom" size="8192" crc="4d87e756" sha1="72f574edee756dc3ea91221ff6b8a4c97136a360"/> + </dataarea> + </part> + </software> + + <software name="streamer" supported="no"> + <description>Digistore Streamer 0.09</description> + <year>1986</year> + <publisher>Digital Services</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="Streamer-0.09.rom" size="8192" crc="e0c28921" sha1="ffdab09962f61ff674157533ee977abce64dbe63"/> + </dataarea> + </part> + </software> + <software name="style"> <description>Style 1.3</description> <year>1991</year> @@ -8069,7 +8242,7 @@ </part> </software> - <software name="turbommc" supported="no"> + <software name="turbommca1" cloneof="turbommc" supported="no"> <description>Turbo MMC 0.A1</description> <year>2009</year> <publisher>IFEL</publisher> @@ -8080,6 +8253,17 @@ </part> </software> + <software name="turbommc" supported="no"> + <description>Turbo MMC 0.A3</description> + <year>2009</year> + <publisher>IFEL</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="TurboMMC-0.A3.rom" size="16384" crc="6f46faf0" sha1="d4db96b96c489209477903d08eaeaa00f0bf5fea"/> + </dataarea> + </part> + </software> + <software name="turbprom"> <description>Turbo-PROM</description> <year>1984</year> @@ -8163,6 +8347,94 @@ </part> </software> + <software name="upurs30r" cloneof="upurs" supported="no"> + <description>UPURS 3.0R</description> + <year>2011</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="UPURS-3.0R.rom" size="8192" crc="43784f3f" sha1="951c1098d21e710606ee0a225413ce2bcf86afcc"/> + </dataarea> + </part> + </software> + + <software name="upurs31r" cloneof="upurs" supported="no"> + <description>UPURS 3.1R</description> + <year>2011</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="UPURS-3.1R.rom" size="8192" crc="7c2571b9" sha1="1d2986d2af35c456ced269a4b9eab62671029105"/> + </dataarea> + </part> + </software> + + <software name="upurs32r" cloneof="upurs" supported="no"> + <description>UPURS 3.2R</description> + <year>2011</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="UPURS-3.2R.rom" size="8192" crc="a149bb89" sha1="76cbcac50e078dbcc48182d1b5060aa63bae4194"/> + </dataarea> + </part> + </software> + + <software name="upurs33r" cloneof="upurs" supported="no"> + <description>UPURS 3.3R</description> + <year>2011</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="8192"> + <rom name="UPURS-3.3R.rom" size="8192" crc="584ac7bc" sha1="80f6394374268fa3e491e09410e5ec7da5c3d540"/> + </dataarea> + </part> + </software> + + <software name="upurs40r" cloneof="upurs" supported="no"> + <description>UPURS 4.0R</description> + <year>2011</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="UPURS-4.0R.rom" size="16384" crc="8fd5d877" sha1="12a9a448b47efb0eebc6622897b08dd4965ebf6d"/> + </dataarea> + </part> + </software> + + <software name="upurs41r" cloneof="upurs" supported="no"> + <description>UPURS 4.1R</description> + <year>2011</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="UPURS-4.1R.rom" size="16384" crc="9a57906b" sha1="85af1466d966ce05725133dda4b4ba20c29c0c90"/> + </dataarea> + </part> + </software> + + <software name="upurs50r" cloneof="upurs" supported="no"> + <description>UPURS 5.0R</description> + <year>2012</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="UPURS-5.0R.rom" size="16384" crc="fce08231" sha1="ad8ccb3cf9a83f6331383139fe7b7c1a2334f944"/> + </dataarea> + </part> + </software> + + <software name="upurs" supported="no"> + <description>UPURS 5.1R</description> + <year>2018</year> + <publisher>Martin Barr</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="UPURS-5.1R.rom" size="16384" crc="27d87f01" sha1="4725b436c8a31ac88efacf170b27666b68e04869"/> + </dataarea> + </part> + </software> + <software name="urom12" cloneof="urom"> <description>UROM 1.2</description> <year>1983</year> diff --git a/hash/bbcb_flop.xml b/hash/bbcb_flop.xml index 5277fe2f04d..e27151633eb 100644 --- a/hash/bbcb_flop.xml +++ b/hash/bbcb_flop.xml @@ -305,6 +305,7 @@ <description>Dunjunz</description> <year>1987</year> <publisher>Bug Byte</publisher> + <info name="usage" value="BBC B version requires Acorn DFS 0.90" /> <part name="flop1" interface="floppy_5_25"> <feature name="part_id" value="Side A: Master Version"/> <dataarea name="flop" size="102400"> @@ -366,6 +367,17 @@ </part> </software> + <software name="enigma"> + <description>Enigma</description> + <year>1990</year> + <publisher>Cervin Games</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="55040"> + <rom name="Enigma.ssd" size="55040" crc="8373a65c" sha1="ef317adfb56efed21713bbf3d2ed038a982a1606"/> + </dataarea> + </part> + </software> + <software name="esb"> <description>The Empire Strikes Back</description> <year>1988</year> @@ -577,6 +589,18 @@ </part> </software> + <software name="krystalc"> + <description>The Krystal Connection</description> + <year>2009</year> + <publisher>Retro Software</publisher> + <info name="author" value="Stephen Smith" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="38400"> + <rom name="The Krystal Connection (2009)(Retro Software).ssd" size="38400" crc="0949d4ea" sha1="237a4a4fce3bddca16822c3281ed5328ad793480" /> + </dataarea> + </part> + </software> + <software name="ldaydoom"> <description>Last Days of Doom</description> <year>1990</year> @@ -610,6 +634,17 @@ </part> </software> + <software name="mntpanic"> + <description>Mountain Panic</description> + <year>2013</year> + <publisher>Retro Software</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="102400"> + <rom name="MountainPanic-v1.2(2013)(Retro Software).ssd" size="102400" crc="1c893b3a" sha1="f1ef8cec1c3b86e9578b94c66137687c070e13c7" /> + </dataarea> + </part> + </software> + <software name="nevryon"> <description>Nevryon</description> <year>1990</year> @@ -622,6 +657,17 @@ </part> </software> + <software name="paranoid"> + <description>Paranoid</description> + <year>1990</year> + <publisher>Cervin Games</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="73984"> + <rom name="Paranoid.ssd" size="73984" crc="4f9fc969" sha1="07f1be5511f5391a2759304986b16d321241f0d5"/> + </dataarea> + </part> + </software> + <software name="phquestt"> <description>Philosopher's Quest (Topologika)</description> <year>1987</year> @@ -997,6 +1043,18 @@ </part> </software> + <software name="whitelt"> + <description>White Light</description> + <year>2017</year> + <publisher>Retro Software</publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="WhiteLight-v10_BBCMicro-DFS.ssd" size="204800" crc="813285df" sha1="dd1bf2af17dadec1c33f4caac8e4ff8394640007" /> + </dataarea> + </part> + </software> + <software name="whimagic"> <description>White Magic</description> <year>1989</year> @@ -1021,6 +1079,18 @@ </part> </software> + <software name="zap"> + <description>Zap!</description> + <year>2009</year> + <publisher>Retro Software</publisher> + <info name="author" value="Jamie Woodhouse" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="44032"> + <rom name="Zap! (2009)(Retro Software).ssd" size="44032" crc="12dbbc47" sha1="535e24688f3a9c00aee9b9cba678c25961c4564c" /> + </dataarea> + </part> + </software> + <software name="zen"> <description>Zen</description> <year>2012</year> @@ -1641,7 +1711,7 @@ <software name="wrldword"> <description>World Without Words</description> - <year>198?</year> + <year>1988</year> <publisher>4mation</publisher> <info name="notes" value="Deprotected" /> <part name="flop1" interface="floppy_5_25"> @@ -1813,6 +1883,17 @@ </part> </software> + <software name="chauffr"> + <description>Chauffeur</description> + <year>1987</year> + <publisher>Nidd Valley</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="102400"> + <rom name="Chauffeur-NiddValley.ssd" size="102400" crc="c34012cf" sha1="7877d8b9fc0ae7ff87556fe9ed43d6d87692015c" /> + </dataarea> + </part> + </software> + <software name="cumaform"> <description>Cumana - BBC disk formatter issue B</description> <year>198?</year> @@ -1835,6 +1916,17 @@ </part> </software> + <software name="ev1"> + <description>EV1 Camera Interface</description> + <year>1984</year> + <publisher>Micro-Robotics</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="EV1CameraInterface.ssd" size="204800" crc="fc182d92" sha1="0990e8fd0f3ac552fb36d5cf41cca76f7d76cf26" /> + </dataarea> + </part> + </software> + <software name="l1fsutil"> <description>Econet Level 1 Fileserver Software</description> <year>1985</year> @@ -1847,6 +1939,17 @@ </part> </software> + <software name="hadfs"> + <description>Harston ADFS System Disk 6.10</description> + <year>2018</year> + <publisher>J.G.Harston</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="409600"> + <rom name="HADFS_System_6.10.dsd" size="409600" crc="fa5301c0" sha1="28d3afaa870ae6300861dbf34a511934882187c6" /> + </dataarea> + </part> + </software> + <software name="integraw" supported="no"> <description>Integra Windows 1.00</description> <year>1989</year> @@ -1858,6 +1961,17 @@ </part> </software> + <software name="mr4200"> + <description>MR4200 32K RAM Board</description> + <year>1986</year> + <publisher>Peartree Computers</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="MR4200 32K RAM Board (Peartree).ssd" size="204800" crc="04a03cec" sha1="ae642ebecdf968db098e60c06d4ed5383e905c7c" /> + </dataarea> + </part> + </software> + <software name="opusutil"> <description>Opus Utilities Disc</description> <year>1983</year> @@ -1952,6 +2066,39 @@ </part> </software> + <software name="utilram"> + <description>UTILRAM: The Utility RAM</description> + <year>1987</year> + <publisher>Tubelink</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="102400"> + <rom name="Utility RAM (Tubelink).ssd" size="102400" crc="9f4c7b3d" sha1="02a82744c7de260e5a52eddb98443cd03420fae6" /> + </dataarea> + </part> + </software> + + <software name="vci"> + <description>Video Camera Interface</description> + <year>1984</year> + <publisher>Data Harvest</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="98304"> + <rom name="VideoCameraInterface-DataHarvest.ssd" size="98304" crc="25b1f1be" sha1="f3cd82be317b22cccd6df042b82fc2f0338b5f74" /> + </dataarea> + </part> + </software> + + <software name="vnula"> + <description>VideoNuLA Support Disc</description> + <year>2017</year> + <publisher>Rob Coleman</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="36864"> + <rom name="VideoNuLA Support Disc.ssd" size="36864" crc="a2dfc1fa" sha1="9cc6c6f45695a5dc3be9ea9d6d9f2237b8203ecb" /> + </dataarea> + </part> + </software> + <software name="wwtyping"> <description>Typing Tutor for Wordwise Plus</description> <year>1983</year> @@ -1974,6 +2121,17 @@ </part> </software> + <software name="z88link"> + <description>BBC-Z88 Transfer Link</description> + <year>1988</year> + <publisher>Watford Electronics</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="20992"> + <rom name="BBC-Z88_Transfer_Link.ssd" size="20992" crc="0b3eecf1" sha1="0d6a7371a04b233acd2d58655ac333535aa12c4e" /> + </dataarea> + </part> + </software> + <!-- AMX Mouse --> <software name="amxart"> @@ -2040,7 +2198,7 @@ </software> <software name="amxpagem"> - <description>AMX Pagemaker</description> + <description>AMX Pagemaker Plus</description> <year>1985</year> <publisher>Advanced Memory Systems</publisher> <part name="flop1" interface="floppy_5_25"> @@ -2068,6 +2226,30 @@ </part> </software> + <software name="amxstpress"> + <description>AMX Stop Press</description> + <year>1987</year> + <publisher>Advanced Memory Systems</publisher> + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="System Disc"/> + <dataarea name="flop" size="102400"> + <rom name="AMX_Stop_Press_System_Disc.ssd" size="102400" crc="f93eaff2" sha1="007951af6d62ba96fbbdd7f03ba438529dae8c92" /> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Font Disc"/> + <dataarea name="flop" size="102400"> + <rom name="AMX_Stop_Press_Font_Disc.ssd" size="102400" crc="0d9b3297" sha1="40e0c924924eba3b6d9e901304d0fe199e1b8f31" /> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Master Downloader"/> + <dataarea name="flop" size="102400"> + <rom name="AMX_Stop_Press_Master_Downloader.ssd" size="102400" crc="e5ac6f26" sha1="e3b458078a651b0312e75af96a603442a5d6246e" /> + </dataarea> + </part> + </software> + <software name="amxsart"> <description>AMX Super Art</description> <year>1985</year> @@ -2123,6 +2305,18 @@ </part> </software> + <software name="iconartm"> + <description>Icon Art Master</description> + <year>1985</year> + <publisher>Micro-Draw</publisher> + <sharedfeat name="userport_default" value="tracker"/> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="102400"> + <rom name="Icon Art Master.ssd" size="102400" crc="84737b02" sha1="d3367f85d3aad2a04335c0fc2a09f6d2d1e632f2" /> + </dataarea> + </part> + </software> + <software name="qpfonts"> <description>Quest Page Fonts</description> <year>1987</year> @@ -2156,6 +2350,41 @@ </part> </software> + <software name="tracker"> + <description>MEDL Tracker Ball Utilities</description> + <year>1985</year> + <publisher>MEDL</publisher> + <sharedfeat name="userport_default" value="tracker"/> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="Trackerball Utilities.ssd" size="204800" crc="a21d155e" sha1="bd2a2b29098e81bbe17c76a55e70e80f67a3f225" /> + </dataarea> + </part> + </software> + + <software name="wedit121" cloneof="wedit"> + <description>The Wapping Editor Utilities 1.21</description> + <year>1988</year> + <publisher>Watford Electronics</publisher> + <info name="usage" value="Requires Wapping Editor ROM" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="102400"> + <rom name="WappingEditorUtilities_1.21.ssd" size="102400" crc="4ce8e621" sha1="4828e13b038055fe2a325e55da3912bee9bf74b7" /> + </dataarea> + </part> + </software> + + <software name="wedit"> + <description>The Wapping Editor Utilities 1.30</description> + <year>1988</year> + <publisher>Watford Electronics</publisher> + <info name="usage" value="Requires Wapping Editor ROM" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="102400"> + <rom name="WappingEditorUtilities_1.30.ssd" size="102400" crc="029759c7" sha1="a1de2fc1a642888bb5de9a5c859bb758ae74d869" /> + </dataarea> + </part> + </software> <!-- Magazines --> @@ -2322,6 +2551,17 @@ </part> </software> + <software name="ccracker"> + <description>Christmas Crackers</description> + <year>1986</year> + <publisher>Database Publications</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="96512"> + <rom name="Christmas Crackers (Database).ssd" size="96512" crc="5c2012df" sha1="ce865dd8115fe052bede403972076bd91174df71" /> + </dataarea> + </part> + </software> + <software name="du01"> <description>Disk User 01 June/July 1987</description> <year>1987</year> @@ -2476,6 +2716,17 @@ </part> </software> + <software name="magscan"> + <description>MagScan - The Beebug Bibliography Disc v1.31</description> + <year>1991</year> + <publisher>Beebugsoft</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="409600"> + <rom name="Magscan-1.31.dsd" size="409600" crc="e84790ac" sha1="f596f06d0aa083efc416a240a1dfd28a333d93f1" /> + </dataarea> + </part> + </software> + <software name="swdmastr"> <description>Sword Master</description> <year>1985</year> @@ -2503,7 +2754,7 @@ <software name="beebtrk"> <description>Beeb Tracker Volume 1: Battle of the Bits</description> <year>2016</year> - <publisher>Bitshifters</publisher> + <publisher>Bitshifters Collective</publisher> <part name="flop1" interface="floppy_5_25"> <dataarea name="flop" size="187648"> <rom name="bs-beebtrk.ssd" size="187648" crc="d7fb81cc" sha1="668769f8c09daba7068bbf2eca84e6164c922c75"/> @@ -2514,7 +2765,7 @@ <software name="beebtrk2"> <description>Beeb Tracker Volume 2: Ninja Gaiden</description> <year>2016</year> - <publisher>Bitshifters</publisher> + <publisher>Bitshifters Collective</publisher> <part name="flop1" interface="floppy_5_25"> <dataarea name="flop" size="142592"> <rom name="bs-beebtrk2.ssd" size="142592" crc="0174737c" sha1="75d298ab55cedd5e8492096956b7971fd1db158b"/> @@ -2525,7 +2776,7 @@ <software name="beebtrk3"> <description>Beeb Tracker Volume 3: Sonic the Hedgehog</description> <year>2016</year> - <publisher>Bitshifters</publisher> + <publisher>Bitshifters Collective</publisher> <part name="flop1" interface="floppy_5_25"> <dataarea name="flop" size="110592"> <rom name="bs-beebtrk3.ssd" size="110592" crc="4d349403" sha1="c82e305827cbebebf6f2d2f3fbd362ba6b5ac6f6"/> @@ -2536,7 +2787,7 @@ <software name="badapple"> <description>Teletext Bad Apple</description> <year>2017</year> - <publisher>Bitshifters</publisher> + <publisher>Bitshifters Collective</publisher> <part name="flop1" interface="floppy_5_25"> <dataarea name="flop" size="409600"> <rom name="bs-badappl.dsd" size="409600" crc="6c06dafd" sha1="92c4cd382c7073b47fa359d3352892d2d20c9b65"/> @@ -2776,6 +3027,189 @@ </part> </software> + <!-- BeebOPL --> + + <software name="oplbonus"> + <description>Beeb OPL: AdLib Jukebox Bonus Disc</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Robert Lazarus" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143104"> + <rom name="beebopl_adlib_bonus.ssd" size="143104" crc="8323968a" sha1="93b29ae5f7ce6dd1c53c4671d522de5fbca3a7eb"/> + </dataarea> + </part> + </software> + + <software name="oplbrix"> + <description>Beeb OPL: Brix</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="109568"> + <rom name="beebopl_brix.ssd" size="109568" crc="e2d450f4" sha1="7c0a9ece1f2c2eef312d06c5f269c79ea419d6f5"/> + </dataarea> + </part> + </software> + + <software name="oplclassic"> + <description>Beeb OPL: AdLib Classical Favourites #1</description> + <year>2017</year> + <publisher><homebrew></publisher> + <info name="author" value="Robert Lazarus" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="404992"> + <rom name="beebopl_adlib_classic1.dsd" size="404992" crc="33c32278" sha1="4f47172bb5f661fb989e3999af5bcebb65ec8c40"/> + </dataarea> + </part> + </software> + + <software name="opldroplay"> + <description>Beeb OPL: Droplay</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Robert Lazarus" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="158976"> + <rom name="beebopl_droplay.ssd" size="158976" crc="cfbd0cf7" sha1="0eaef5111aa59f3b4079371860e4d02fd2155200"/> + </dataarea> + </part> + </software> + + <software name="opldynab"> + <description>Beeb OPL: DynaBlaster</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="49664"> + <rom name="beebopl_dynablaster.ssd" size="49664" crc="ce15f065" sha1="fa3661c558e2d27478b69dff8f7379045104fcf3"/> + </dataarea> + </part> + </software> + + <software name="opljill"> + <description>Beeb OPL: Jill of the Jungle</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="106752"> + <rom name="beebopl_jillofthejungle.ssd" size="106752" crc="3b8a2e89" sha1="4cccecc5681d0897d1cd654f8e2b58bb2b758182"/> + </dataarea> + </part> + </software> + + <software name="opljukebox"> + <description>Beeb OPL: AdLib Jukebox</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Robert Lazarus" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="171776"> + <rom name="beebopl_adlib_jukebox.ssd" size="171776" crc="b9a8d090" sha1="391eda20b944af844bee995db1c67776c88445c4"/> + </dataarea> + </part> + </software> + + <software name="oplkilob"> + <description>Beeb OPL: KiloBlaster</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="394240"> + <rom name="beebopl_kiloblaster.dsd" size="394240" crc="f6cece26" sha1="28f61f4049597ba983a6a4e3f89d2961de9a8d03"/> + </dataarea> + </part> + </software> + + <software name="oplpop"> + <description>Beeb OPL: AdLib Pop/Rock Grooves</description> + <year>2017</year> + <publisher><homebrew></publisher> + <info name="author" value="Robert Lazarus" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="314880"> + <rom name="beebopl_adlib_pop.dsd" size="314880" crc="927c5f13" sha1="984c5eb9926b816300e1deaca57c998861f5fd78"/> + </dataarea> + </part> + </software> + + <software name="oplsolar"> + <description>Beeb OPL: Solar Winds</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="159232"> + <rom name="beebopl_solarwinds.ssd" size="159232" crc="48405a04" sha1="bf9bedf8be63acb1e2b7a74b1f18308d3ff746d6"/> + </dataarea> + </part> + </software> + + <software name="oplwacky"> + <description>Beeb OPL: Wacky Wheels</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="384000"> + <rom name="beebopl_wackywheels.dsd" size="384000" crc="97d35b09" sha1="cb3fdec1fd8c735d00c8fdfa73f448bb082fc259"/> + </dataarea> + </part> + </software> + + <software name="oplxargon"> + <description>Beeb OPL: Xargon</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="140288"> + <rom name="beebopl_xargon.ssd" size="140288" crc="36f5a3ca" sha1="bba409d3c775ec9dc66d352ef238ad518f425756"/> + </dataarea> + </part> + </software> + + <software name="oplxmas"> + <description>Beeb OPL: AdLib Christmas Carols</description> + <year>2016</year> + <publisher><homebrew></publisher> + <info name="author" value="Robert Lazarus" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="179200"> + <rom name="beebopl_adlib_xmas.ssd" size="179200" crc="b484f806" sha1="5715479054c7183deaa54fa0454e25080c2c66c0"/> + </dataarea> + </part> + </software> + + <software name="oplzone66"> + <description>Beeb OPL: Zone 66</description> + <year>2017</year> + <publisher><homebrew></publisher> + <info name="author" value="Sarah Walker" /> + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="Standard"/> + <dataarea name="flop" size="86016"> + <rom name="beebopl_zone66.ssd" size="86016" crc="8ee0e0ca" sha1="e2806acef0851cd750aa508b6b3666fb160fb3fb"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="Master 128"/> + <dataarea name="flop" size="655360"> + <rom name="beebopl_zone66_m128.adl" size="655360" crc="ecd94eb7" sha1="ecd4c5b9efec49dbbe71fb5f6377a4e6ff04fb60"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="Master 128 + DAC"/> + <dataarea name="flop" size="655360"> + <rom name="beebopl_zone66_m128_dac.adl" size="655360" crc="43e8e9fb" sha1="ccf4e2854bd3e68e5e99efd7caa1bd16b64fc22e"/> + </dataarea> + </part> + </software> + <!-- BeebSID --> <software name="beebsid1"> @@ -2994,6 +3428,18 @@ </part> </software> + <software name="beebsid19"> + <description>BeebSID 19 - Classical</description> + <year>2018</year> + <publisher><homebrew></publisher> + <info name="author" value="PitfallJones" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="56320"> + <rom name="beebsid19.ssd" size="56320" crc="81ac0684" sha1="990062cb1a5ec73608f2aeee775e9dd3bfff10de"/> + </dataarea> + </part> + </software> + <software name="sidquiz"> <description>Beeb SID Quiz</description> <year>2010</year> diff --git a/hash/bdesignm_design_cart.xml b/hash/bdesignm_design_cart.xml new file mode 100644 index 00000000000..c6fada92148 --- /dev/null +++ b/hash/bdesignm_design_cart.xml @@ -0,0 +1,85 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<!-- + Game cartridges for Bandai Design Master + + Design carts, these plug into the Game carts, they're data ROMs, they do not contain boot vectors + + M.01 - Dragon Ball Z + M.02 - From TV Animation Slam Dunk + M.03 - Super Street Fighter 2 + M.04 - Rockman X3 Buster Battle + Weekly Shonen Jump Special + + Cart info: + + M-Cartridge (DESIGN): + + FRONT BACK + __________________ __________________ + | ___ _ | | | + | |1mb| | |HC74 | | | + | |ROM| ‾ | | | + | ‾‾‾ | | | + |__________________| | | + |||||||||||||||||||| |||||||||||||||||||| + 1‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾18 19‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾36 + + PINOUT: + + 1|NC 19|NC + 2|GND 20|NC + 3|GND 21|A2 + 4|VCC 22|A3 + 5|CE 23|A4 + 6|NC 24|A5 + 7|OE 25|A6 + 8|D0 26|A7 + 9|D1 27|A8 + 10|D2 28|A9 + 11|D3 29|A10 + 12|D4 30|A11 + 13|D5 31|A12 + 14|D6 32|A13 + 15|D7 33|A14 + 16|A0 34|Pin3 & Pin11 of HC74 -> Clock Signal + 17|A1 35|VCC + 18|NC 36|GND + + HC74: + ________ + VCC-| |-VCC + D0-| |-VCC + CLK-| |-D1 + VCC-| |-CLK + A15-| |-VCC + NC-| |-A16 + GND-| |-NC + ‾‾‾‾‾‾‾‾ +--> + +<softwarelist name="bdesignm_design_cart" description="Bandai Design Master 'Design / Media' cartridges"> + + <software name="dbzm" supported="no"> + <description>Dragon Ball Z (design)</description> + <year>1995</year> + <publisher>Bandai</publisher> + <part name="cart" interface="bdesignm_cart"> + <dataarea name="rom" size="0x20000"> + <rom loadflag="load16_word_swap" name="m01_dragonballz.bin" size="0x20000" crc="5a514a14" sha1="e79f215255b230bec5835e229f415d277dd8d762" /> + </dataarea> + </part> + </software> + + <software name="sf2m" supported="no"> + <description>Super Street Fighter 2 (design)</description> + <year>1995</year> + <publisher>Bandai</publisher> + <part name="cart" interface="bdesignm_cart"> + <dataarea name="rom" size="0x20000"> + <rom loadflag="load16_word_swap" name="m03_streetfighterii.bin" size="0x20000" crc="f4a59015" sha1="a607628a4fbae143e34294a4363c286feb21d770" /> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/bdesignm_game_cart.xml b/hash/bdesignm_game_cart.xml new file mode 100644 index 00000000000..3727105cb0c --- /dev/null +++ b/hash/bdesignm_game_cart.xml @@ -0,0 +1,89 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<!-- + Game cartridges for Bandai Design Master + + Game carts, these plug into the system + + G.01 - Dragon Ball Z Taisen-gata Search Battle + G.02 - Dungeon Diver + G.03 - Bishoujo Senshi Sailor Moon SS Illustration Club + G.04 - Rockman X3 Buster Battle + + Cart info: + + G-Cartridge (GAME): + + FRONT BACK + ____________________ ____________________ + | 2x18 EDGE-SOCKET | | 2x18 EDGE-SOCKET | + |____________________| |____________________| + | | | | + | | | | + | | | | + | ________ HC74 | | | + | |1MbitROM| |‾‾| | | | + | ‾‾‾‾‾‾‾‾ ‾‾ | | | + | | | | + |__________________| |__________________| + |||||||||||||||||||| |||||||||||||||||||| + 1‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾18 19‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾36 + + PINOUT: + + 1|CE_G-Cart 19|NC + 2|GND 20|HC74_3&11 -> Clock Signal (CLK) + 3|GND 21|A2 + 4|VCC 22|A3 + 5|CE_M-Cart 23|A4 + 6|NC 24|A5 + 7|OE 25|A6 + 8|D0 26|A7 + 9|D1 27|A8 + 10|D2 28|A9 + 11|D3 29|A10 + 12|D4 30|A11 + 13|D5 31|A12 + 14|D6 32|A13 + 15|D7 33|A14 + 16|A0 34|CLK_M-Cart + 17|A1 35|VCC + 18|HC74_1&13 36|GND + + HC74: + ________ + C18-| |-VCC + D0-| |-C18 + CLK-| |-D1 + VCC-| |-CLK + A15-| |-VCC + NC-| |-A16 + GND-| |-NC + ‾‾‾‾‾‾‾‾ +--> + +<softwarelist name="bdesignm_game_cart" description="Bandai Design Master 'Game' cartridges"> + + <software name="dbzg" supported="no"> + <description>Dragon Ball Z Taisen-gata Search Battle (game)</description> + <year>1995</year> + <publisher>Bandai</publisher> + <part name="cart" interface="bdesignm_cart"> + <dataarea name="rom" size="0x20000"> + <rom loadflag="load16_word_swap" name="g01_dragonballz.bin" size="0x20000" crc="94107404" sha1="c86d48e9f0262da36ac9bbcffd9cea8e9bb672b7" /> + </dataarea> + </part> + </software> + + <software name="sailormng" supported="no"> + <description>Bishoujo Senshi Sailor Moon SS Illustration Club (game)</description> + <year>1995</year> + <publisher>Bandai</publisher> + <part name="cart" interface="bdesignm_cart"> + <dataarea name="rom" size="0x20000"> + <rom loadflag="load16_word_swap" name="g03_sailormoon.bin" size="0x20000" crc="641f20e6" sha1="b9f3a37385eeaf2e66b28ad5bac24a8a9cd46bdd" /> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/bkrankp_cart.xml b/hash/bkrankp_cart.xml new file mode 100644 index 00000000000..577348b77dc --- /dev/null +++ b/hash/bkrankp_cart.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<!-- + +Official site: https://girls.channel.or.jp/karaoke/ + +Known carts: + ++======+=======+=========================+ +|Dumped| Serial|Title | ++======+=======+=========================+ +| NO |2315998|J-Pop - Blue | +| NO |2315999|Aikatsu Ver. Best | +| NO |2316073|J-Pop - Strawberry | +| NO |2316095|J-Pop - Green | +| NO |2316096|J-Pop - Pink | +| NO |2316097|J-Pop - Lemmon Yellow | +| NO |2323098|Yo-Kai Watch Selection | +| NO |2333250|J-Pop - Purple | +| NO |2333251|J-Pop - White | +| YES |2333252|J-Pop - Rose | +| NO |2333253|J-Pop - Red | +| YES |2333254|Vocaloid | +| NO |2336074|J-Pop - Apple Green | +| NO |2336075|J-Pop - Grapefruit | +| NO |2336076|Disney Dream Hit Song | +| NO |2350534|J-Pop - Mint | +| NO |2350535|Best Hit Song | ++======+=======+=========================+ + +--> + +<softwarelist name="bkrankp_cart" description="Bandai Karaoke Ranking Party cartridges"> + + <software name="jpoprose" supported="no"> + <description>J-Pop Rose</description> + <year>20??</year> + <publisher>Bandai</publisher> + <info name="serial" value="2333252" /> + <part name="cart" interface="bkrankp_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="jpoprose_mx25l3206e_c22016.bin" size="0x400000" crc="6f8f1764" sha1="2802e1fe51a3fca9e0a8d0b577a9751adeb98db0" /> + </dataarea> + </part> + </software> + + <software name="vocaloid" supported="no"> + <description>Vocaloid</description> + <year>20??</year> + <publisher>Bandai</publisher> + <info name="serial" value="2333254" /> + <part name="cart" interface="bkrankp_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="vocaloid_mx25l3206e_c22016.BIN" size="0x400000" crc="17569b76" sha1="9205fb80ac03092be274b9fd78eaffad52ef8d15" /> + </dataarea> + </part> + </software> + +</softwarelist> + + diff --git a/hash/buzztime_cart.xml b/hash/buzztime_cart.xml new file mode 100644 index 00000000000..38fd947a6c7 --- /dev/null +++ b/hash/buzztime_cart.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + + +<softwarelist name="buzztime_cart" description="Cadaco Buzztime Trivia Cartridges"> + <software name="s1tv" supported="no"> + <description>Series 1 - TV</description> + <year>200?</year> + <publisher>Cadaco</publisher> + <part name="cart" interface="buzztime_cart"> + <dataarea name="rom" size="0x200000"> + <rom name="buzztimeseries1tv.bin" size="0x200000" crc="295be60f" sha1="960065e7b8eb0b65dfb7c3b067940de3362d1b0e"/> + </dataarea> + </part> + </software> + + <software name="s1hist" supported="no"> + <description>Series 1 - History</description> + <year>200?</year> + <publisher>Cadaco</publisher> + <part name="cart" interface="buzztime_cart"> + <dataarea name="rom" size="0x200000"> + <rom name="buzztimeseries1history.bin" size="0x200000" crc="384b0c0e" sha1="c359e69b5c91ba98ebf477aee1bb5f62b721b427"/> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/c64_cass.xml b/hash/c64_cass.xml index 48704a3803a..d34f536c16d 100644 --- a/hash/c64_cass.xml +++ b/hash/c64_cass.xml @@ -920,7 +920,7 @@ </software> <software name="bmxracers"> - <description>BMX Racers</description> + <description>BMX Racers (set 1, Mastertronic Burner loader)</description> <year>1984</year> <publisher>Mastertronic</publisher> @@ -932,7 +932,7 @@ </software> <software name="bmxracersa" cloneof="bmxracers"> - <description>BMX Racers (alt)</description> + <description>BMX Racers (set 2, Burner loader)</description> <year>1984</year> <publisher>Mastertronic</publisher> @@ -944,7 +944,7 @@ </software> <software name="bmxracersa2" cloneof="bmxracers"> - <description>BMX Racers (alt2)</description> + <description>BMX Racers (set 3)</description> <year>1984</year> <publisher>Mastertronic</publisher> @@ -955,6 +955,22 @@ </part> </software> + <software name="bmxracersa3" cloneof="bmxracers"> + <description>BMX Racers (set 4, Visiload loaders)</description> + <year>1984</year> + <publisher>Mastertronic</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="485799"> + <rom name="bmx racers side a.tap" size="485799" crc="109ceaef" sha1="7bbaa334f90f202aefc065588755b5eb69c4aed1"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="478027"> + <rom name="bmx racers side b.tap" size="478027" crc="44efcf46" sha1="b813aae24a6abfe77afb1d4c151d1a5f36dac06f"/> + </dataarea> + </part> + </software> + <software name="bmxsim"> <description>BMX Simulator</description> <year>1986</year> @@ -1373,6 +1389,42 @@ </part> </software> + <software name="cfpp5"> + <description>The CF Power Pack Tape 5</description> + <year>1991</year> + <publisher>Future Publishing</publisher> + <part name="cass1" interface="cbm_cass"> + <feature name="part_id" value="Side 1: Shockway Rider / Viz (Demo)"/> + <dataarea name="cass" size="954275"> + <rom name="The CF Powerpack 5 Side 1.tap" size="954275" crc="c83b0f7a" sha1="2a9f63ba087f991d7eb739525d4d68784f4f6779"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <feature name="part_id" value="Side 2: Sun Star / Warlock (Demo)"/> + <dataarea name="cass" size="763444"> + <rom name="The CF Powerpack 5 Side 2.tap" size="763444" crc="80af587a" sha1="8920fa414fdf2024aa965a90e3b656c23c4067c5"/> + </dataarea> + </part> + </software> + + <software name="cfpp9"> + <description>The CF Power Pack Tape 9</description> + <year>1991</year> + <publisher>Future Publishing</publisher> + <part name="cass1" interface="cbm_cass"> + <feature name="part_id" value="Side 1: Zamzara / HeroQuest"/> + <dataarea name="cass" size="1008161"> + <rom name="The CF Powerpack 9 Side 1.tap" size="1008161" crc="6d6687a6" sha1="28de672d1ee73b5df64327f6c53608ea2d94c490"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <feature name="part_id" value="Side 2: Bulldog / Firepower"/> + <dataarea name="cass" size="1005608"> + <rom name="The CF Powerpack 9 Side 2.tap" size="1005608" crc="7ef0ecff" sha1="e8e0d3c2f4ba04f2aa0a96e3216f259e49c945aa"/> + </dataarea> + </part> + </software> + <software name="chainreac"> <description>Chain Reaction</description> <year>19??</year> @@ -3002,6 +3054,17 @@ </part> </software> + <software name="hotgt"> + <description>Hero of the Golden Talisman</description> + <year>1985</year> + <publisher>Mastertronic Added Dimension</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="737275"> + <rom name="hero of the golden talisman.tap" size="737275" crc="188a8887" sha1="f8f57df8de811bb8bcf6fe9eeb93688da86c947d"/> + </dataarea> + </part> + </software> + <software name="hexpert"> <description>Hexpert</description> <year>1983</year> @@ -3014,6 +3077,24 @@ </part> </software> + <software name="holinone"> + <description>Hole In One</description> + <year>1987</year> + <publisher>Mastertronic Added Dimension</publisher> + <part name="cass1" interface="cbm_cass"> + <feature name="part_id" value="Side 1"/> + <dataarea name="cass" size="692452"> + <rom name="hole in one side a.tap" size="692452" crc="99fe83f3" sha1="6124084b5c7bdc0d68ab5625b1bba2d6e167abc6"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <feature name="part_id" value="Side 2"/> + <dataarea name="cass" size="710167"> + <rom name="hole in one side b.tap" size="710167" crc="a9707464" sha1="d8ff00e94e4ff907657e6be074b43d26fabd9132"/> + </dataarea> + </part> + </software> + <software name="hpoker"> <description>Hollywood Poker</description> <year>1988</year> @@ -3877,7 +3958,7 @@ </software> <software name="matchpnt"> - <description>Match Point</description> + <description>Match Point (set 1)</description> <year>1984</year> <publisher>Psion</publisher> @@ -3888,6 +3969,28 @@ </part> </software> + <software name="matchpnt1" cloneof="matchpnt" > + <description>Match Point (set 2)</description> + <year>1984</year> + <publisher>The Hit Squad</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="412484"> + <rom name="Match Point.tap" size="412484" crc="4fb72ed9" sha1="7bcc2d1c6dc9818b24236e1e8ef094e98111d623"/> + </dataarea> + </part> + </software> + + <software name="mermaidm"> + <description>Mermaid Madness</description> + <year>1986</year> + <publisher>Firebird Silver</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="430865"> + <rom name="mermaid madness.tap" size="430865" crc="c9984f7d" sha1="ddcf116b3b5ce2e174110f93008b36861c48786f"/> + </dataarea> + </part> + </software> + <software name="metrox"> <description>Metro Cross</description> <year>1988</year> @@ -4323,6 +4426,17 @@ </part> </software> + <software name="octennis"> + <description>On Court Tennis</description> + <year>1984</year> + <publisher>Firebird Silver</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="517655"> + <rom name="on court tennis.tap" size="517655" crc="c7dbf50b" sha1="df6dc7bec0c870a387cc6478c0a81e9a00ddbdaa"/> + </dataarea> + </part> + </software> + <software name="oncue"> <description>On Cue</description> <year>1987</year> @@ -4343,6 +4457,17 @@ </part> </software> + <software name="offootb"> + <description>On Field Football</description> + <year>1985</year> + <publisher>Firebird Silver</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="522986"> + <rom name="on field football.tap" size="522986" crc="3017a952" sha1="5ea48ba9d6f69b8b29479124564d03a488e0750e"/> + </dataarea> + </part> + </software> + <software name="omahd"> <description>One Man and His Droid</description> <year>1985</year> @@ -4426,6 +4551,22 @@ </part> </software> + <software name="outlaws"> + <description>Outlaws</description> + <year>1985</year> + <publisher>Ricochet</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="663257"> + <rom name="outlaws side a.tap" size="663257" crc="332f4483" sha1="f5752d3fad3971662c5b13f9570e5625821854a2"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="658990"> + <rom name="outlaws side b.tap" size="658990" crc="429754e6" sha1="5fae6c04243e532008efe477eb7ffeab6178ca7c"/> + </dataarea> + </part> + </software> + <software name="pod"> <description>P.O.D. - Proof of Destruction</description> <year>1987</year> @@ -4731,6 +4872,17 @@ </part> </software> + <software name="postman2"> + <description>Postman Pat 2</description> + <year>1989</year> + <publisher>Alternative Software</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="638869"> + <rom name="postman pat 2.tap" size="638869" crc="b892a405" sha1="d85b42eecbabb3b615bfb783869c4d98ef5f772a"/> + </dataarea> + </part> + </software> + <software name="pwrpack"> <description>The Power Pack</description> <year>1990</year> @@ -5039,6 +5191,17 @@ </part> </software> + <software name="radrampr"> + <description>Rad Ramp Racer</description> + <year>1990</year> + <publisher>Mastertronic Plus</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="526363"> + <rom name="rad ramp racer.tap" size="526363" crc="1ab3938b" sha1="65b7a3c1dde85ef83e2b7d139b16218d2258bfa1"/> + </dataarea> + </part> + </software> + <software name="ragbeast"> <description>Raging Beast</description> <year>1985</year> @@ -5513,6 +5676,22 @@ </part> </software> + <software name="runtheg"> + <description>Run the Gauntlet</description> + <year>1989</year> + <publisher>The Hit Squad</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="2223542"> + <rom name="run the gauntlet side a.tap" size="2223542" crc="d0e77cb1" sha1="8592b26a06bde96cdb6a0877ceda75e4ed8db256"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="2217669"> + <rom name="run the gauntlet side b.tap" size="2217669" crc="493bae24" sha1="17ff144092680f6635414e05586cb7af405772de"/> + </dataarea> + </part> + </software> + <software name="rygar"> <description>Rygar</description> <year>19??</year> @@ -5609,6 +5788,17 @@ </part> </software> + <software name="shrtcirc"> + <description>Short Circuit</description> + <year>1987</year> + <publisher>The Hit Squad</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="522357"> + <rom name="short circuit.tap" size="522357" crc="8f9cde33" sha1="534878fbe66ab1498f4393886de5bbec484179d0"/> + </dataarea> + </part> + </software> + <software name="silkworm"> <description>Silkworm</description> <year>1992</year> @@ -5621,6 +5811,22 @@ </part> </software> + <software name="skatrock"> + <description>Skate Rock Simulator</description> + <year>1988</year> + <publisher>Ricochet</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="384129"> + <rom name="skate rock simulator side a.tap" size="384129" crc="6206b92b" sha1="a41536410684885f1f3d32f0c0841cfc57503a36"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="373450"> + <rom name="skate rock simulator side b.tap" size="373450" crc="b62714a6" sha1="d97a307473e269811974050e3bb370e09420b35d"/> + </dataarea> + </part> + </software> + <software name="skatnusa"> <description>Skatin' USA</description> <year>1990</year> @@ -5807,6 +6013,22 @@ </part> </software> + <software name="spacehnt"> + <description>Space Hunter</description> + <year>1985</year> + <publisher>Mastertronic</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="565246"> + <rom name="space hunter side a.tap" size="565246" crc="11c74761" sha1="5ee2e011ea5afa76823964000d7bd5c57e1ec863"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="562360"> + <rom name="space hunter side b.tap" size="562360" crc="3f93d15b" sha1="27c9d41cb322cae98a40e462ffbd596ee289268a"/> + </dataarea> + </part> + </software> + <software name="spacewalk"> <description>Space Walk</description> <year>1984</year> @@ -5862,6 +6084,22 @@ </part> </software> + <software name="spellbnd"> + <description>Spellbound</description> + <year>1985</year> + <publisher>Mastertronic Added Dimension</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="746474"> + <rom name="spellbound side a.tap" size="746474" crc="e93aabc7" sha1="af2c9c92e1c9b5b2580e57b89c2b98b2620714f1"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="739097"> + <rom name="spellbound side b.tap" size="739097" crc="b5fccac8" sha1="5d89eec43f411237b72a8e4d238e1db879c549e8"/> + </dataarea> + </part> + </software> + <software name="spiktrans"> <description>Spike in Transilvania</description> <year>1991</year> @@ -6514,6 +6752,22 @@ </part> </software> + <software name="sweep"> + <description>Sweep</description> + <year>19??</year> + <publisher>Mastertronic</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="400020"> + <rom name="sweep (c64) (side a).tap" size="400020" crc="5c9225bf" sha1="d1c27f0d9833b91b5fc506087c83d49578f93257"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="388837"> + <rom name="sweep (c64) (side b).tap" size="388837" crc="ab92b874" sha1="0a24b3db81b5ffd378dbb50e82f13daf4a645072"/> + </dataarea> + </part> + </software> + <software name="tbird"> <description>T-Bird</description> <year>1988</year> @@ -6526,6 +6780,22 @@ </part> </software> + <software name="taladega"> + <description>Talladega</description> + <year>1985</year> + <publisher>Americana</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="9586010"> + <rom name="talladega side a.wav" size="9586010" crc="01c0818d" sha1="95d85240fad0bd24ad35dcff31a07cbe098a1987"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="9876600"> + <rom name="talladega side b.wav" size="9876600" crc="1bcc0a7e" sha1="d8b1625572636eb31bc04ea4cea5f7af592179ab"/> + </dataarea> + </part> + </software> + <software name="targtren"> <description>Target Renegade</description> <year>1988</year> @@ -7193,7 +7463,7 @@ </software> <software name="yogisesc"> - <description>Yogi's Great Escape</description> + <description>Yogi's Great Escape (set 1)</description> <year>1990</year> <publisher>HiTEC Software</publisher> @@ -7204,6 +7474,22 @@ </part> </software> + <software name="yogisesc1" cloneof="yogisesc"> + <description>Yogi's Great Escape (set 2)</description> + <year>1990</year> + <publisher>HiTEC Software</publisher> + <part name="cass1" interface="cbm_cass"> + <dataarea name="cass" size="664916"> + <rom name="yogi's great escape side a.tap" size="664916" crc="e07c6a8c" sha1="777a03d414eaebceca0ff28a3df3dbe61e9f6494"/> + </dataarea> + </part> + <part name="cass2" interface="cbm_cass"> + <dataarea name="cass" size="665130"> + <rom name="yogi's great escape side b.tap" size="665130" crc="268e5891" sha1="bca798fa1f984ace680442205c63fc7ee06e67ec"/> + </dataarea> + </part> + </software> + <software name="zoids"> <description>Zoids</description> <year>1983</year> diff --git a/hash/c64_flop_misc.xml b/hash/c64_flop_misc.xml index e116cb2bf2d..b911be92675 100644 --- a/hash/c64_flop_misc.xml +++ b/hash/c64_flop_misc.xml @@ -343,7 +343,7 @@ </software> <software name="1541demob" cloneof="1541demo"> - <description>Commodore 1541 Floppy Disk Drive Test/Demo Disk (Alt)</description> + <description>Commodore 1541 Floppy Disk Drive Test/Demo Disk (alt)</description> <year>1984</year> <publisher>Commodore</publisher> @@ -355,7 +355,7 @@ </software> <software name="1541democ" cloneof="1541demo"> - <description>Commodore 1541 Floppy Disk Drive Test/Demo Disk (Alt 2)</description> + <description>Commodore 1541 Floppy Disk Drive Test/Demo Disk (alt 2)</description> <year>1985</year> <publisher>Commodore</publisher> @@ -652,7 +652,7 @@ </software> <software name="cpma" cloneof="cpm"> - <description>Commodore 64 CP/M Cartridge Boot Disk (Alt)</description> + <description>Commodore 64 CP/M Cartridge Boot Disk (alt)</description> <year>1982</year> <publisher>Commodore</publisher> <sharedfeat name="requirement" value="c64_cart:cpm"/> @@ -665,7 +665,7 @@ </software> <software name="cpmb" cloneof="cpm"> - <description>Commodore 64 CP/M Cartridge Boot Disk (Alt 2)</description> + <description>Commodore 64 CP/M Cartridge Boot Disk (alt 2)</description> <year>1982</year> <publisher>Commodore</publisher> <info name="serial" value="D CP2 622-04414" /> diff --git a/hash/casloopy.xml b/hash/casloopy.xml index 0d18faeed1e..c7f6b667871 100644 --- a/hash/casloopy.xml +++ b/hash/casloopy.xml @@ -3,9 +3,7 @@ <softwarelist name="casloopy" description="Casio Loopy cartridges"> <!-- Undumped titles: -- Little Romance (リトルロマンス) - Chakura-kun no Omajinai Paradise (チャクラくんのおまじないパラダイス) -- Magical Shop [add-on to extract images from vhs/dvd?] --> <software name="animelnd"> @@ -47,6 +45,20 @@ </part> </software> + <software name="ltlromance"> + <description>Little Romance</description> + <year>1996</year> + <publisher>Casio</publisher> + <info name="serial" value="XK-503"/> + <info name="alt_name" value="リトルロマンス"/> + <part name="cart" interface="loopy_cart"> + <dataarea name="rom" size="0x3000000"> + <rom name="d23c16000.ic104" size="0x200000" crc="947a96c3" sha1="df27293c136420d4c21724517953510292319433" offset="0x000000" /> + <rom name="d23c8000.ic105" size="0x100000" crc="a868e597" sha1="87226d26dbb3a95ce8f75a595bd874af6e5cb17b" offset="0x200000" /> + </dataarea> + </part> + </software> + <software name="nigaoart"> <description>Nigaoe Artist</description> <year>1995</year> @@ -108,7 +120,20 @@ <info name="alt_name" value="ルピトンのワンダーパレット"/> <part name="cart" interface="loopy_cart"> <dataarea name="rom" size="0x200000"> - <rom name="lupiton.bin" size="0x200000" crc="338a5af7" sha1="ddb3e2b363ef0325a1370511f3692ca47031cb46" offset="0x000000" /> + <rom name="lupiton.bin" size="0x200000" crc="338a5af7" sha1="ddb3e2b363ef0325a1370511f3692ca47031cb46" /> + </dataarea> + </part> + </software> + + <software name="vswordp"> + <description>Video Seal Wordprocessor</description> + <year>1995</year> + <publisher>Casio</publisher> + <info name="serial" value="XK-700"/> + <info name="alt_name" value="Magical Shop"/> + <part name="cart" interface="loopy_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="mx23c8100.lsi102" size="0x100000" crc="5764591f" sha1="16a2ade7e08f16e44d5c74c714840df1b48da4ad" /> </dataarea> </part> </software> diff --git a/hash/cgenie_cass.xml b/hash/cgenie_cass.xml index 4b1ccfc268e..7a278c0696a 100644 --- a/hash/cgenie_cass.xml +++ b/hash/cgenie_cass.xml @@ -42,7 +42,7 @@ Screen-Printer (standalone) <!-- Applications --> - <software name="adressd2" supported="yes"> + <software name="adressd2"> <description>Adressdatei II</description> <year>198?</year> <publisher><unknown></publisher> @@ -54,7 +54,7 @@ Screen-Printer (standalone) </part> </software> - <software name="basicode" supported="yes"> + <software name="basicode"> <description>Basicode</description> <year>1983</year> <publisher>TCS</publisher> @@ -67,7 +67,7 @@ Screen-Printer (standalone) </part> </software> - <software name="basicp5" supported="yes"> + <software name="basicp5"> <description>Basic +5</description> <year>1983</year> <publisher>TCS</publisher> @@ -79,7 +79,7 @@ Screen-Printer (standalone) </part> </software> - <software name="baspack" supported="yes"> + <software name="baspack"> <description>Basic-Packer 2.13</description> <year>1983</year> <publisher>TCS</publisher> @@ -92,7 +92,7 @@ Screen-Printer (standalone) </software> <!-- This version doesn't have a help message when you start it with just / --> - <software name="baspacka" cloneof="baspack" supported="yes"> + <software name="baspacka" cloneof="baspack"> <description>Basic-Packer 2.13 (alternate)</description> <year>1983</year> <publisher>TCS</publisher> @@ -104,7 +104,7 @@ Screen-Printer (standalone) </part> </software> - <software name="benchm" supported="yes"> + <software name="benchm"> <description>Benchmark Test</description> <year>198?</year> <publisher><unknown></publisher> @@ -117,7 +117,7 @@ Screen-Printer (standalone) </part> </software> - <software name="casloader" supported="yes"> + <software name="casloader"> <description>Genie I II / TRS 80 Cassettenlader</description> <year>1984</year> <publisher><unknown></publisher> @@ -130,7 +130,7 @@ Screen-Printer (standalone) </part> </software> - <software name="charset" supported="yes"> + <software name="charset"> <description>Charset</description> <year>198?</year> <publisher><unknown></publisher> @@ -143,7 +143,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colcom" supported="yes"> + <software name="colcom"> <description>Colour Basic Compiler 3.05</description> <year>1982</year> <publisher>TCS</publisher> @@ -155,7 +155,7 @@ Screen-Printer (standalone) </part> </software> - <software name="coldesig" supported="yes"> + <software name="coldesig"> <description>Colour Design 3.0</description> <year>19??</year> <publisher><unknown></publisher> @@ -167,7 +167,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colforth" supported="yes"> + <software name="colforth"> <description>Colour-Forth 2.0 (with cassette support)</description> <year>1983</year> <publisher>TCS</publisher> @@ -179,7 +179,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colfortha" cloneof="colforth" supported="yes"> + <software name="colfortha" cloneof="colforth"> <description>Colour-Forth 2.0</description> <year>1983</year> <publisher>TCS</publisher> @@ -191,7 +191,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colmon2" supported="yes"> + <software name="colmon2"> <description>Colour-Monitor 2.0</description> <year>198?</year> <publisher><unknown></publisher> @@ -203,7 +203,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colmon3" supported="yes"> + <software name="colmon3"> <description>Colour-Monitor 3.0</description> <year>1983</year> <publisher>TCS</publisher> @@ -215,7 +215,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colpasc" supported="yes"> + <software name="colpasc"> <description>Colour-PASCAL 2.0</description> <year>198?</year> <publisher><unknown></publisher> @@ -227,7 +227,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colrot" supported="yes"> + <software name="colrot"> <description>Colour-ROT</description> <year>1983</year> <publisher>TCS</publisher> @@ -240,7 +240,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colzap" supported="yes"> + <software name="colzap"> <description>Colour-Zap Ver 1.0 (TCS)</description> <year>1983</year> <publisher>TCS</publisher> @@ -252,7 +252,7 @@ Screen-Printer (standalone) </part> </software> - <software name="dezhex" supported="yes"> + <software name="dezhex"> <description>Dez-Hex</description> <year>198?</year> <publisher><unknown></publisher> @@ -264,7 +264,7 @@ Screen-Printer (standalone) </part> </software> - <software name="ebasic" supported="yes"> + <software name="ebasic"> <description>EBASIC (32k version)</description> <year>1985</year> <publisher><unknown></publisher> @@ -277,7 +277,7 @@ Screen-Printer (standalone) </part> </software> - <software name="editdef" supported="yes"> + <software name="editdef"> <description>Editor fuer definierbare Zeichen</description> <year>198?</year> <publisher><unknown></publisher> @@ -294,7 +294,7 @@ Screen-Printer (standalone) <!-- * Mastercopy (Joerg L) --> <!-- * Kopiermonitor (1983, Ernst Schoeberl) --> <!-- * Ultracopy (TTS) --> - <software name="excopy" supported="yes"> + <software name="excopy"> <description>Extended Copy</description> <year>198?</year> <publisher>TTS</publisher> @@ -306,7 +306,7 @@ Screen-Printer (standalone) </part> </software> - <software name="extrabas" supported="yes"> + <software name="extrabas"> <description>Extra-Basic</description> <year>198?</year> <publisher><unknown></publisher> @@ -319,7 +319,7 @@ Screen-Printer (standalone) </part> </software> - <software name="grafiked" supported="yes"> + <software name="grafiked"> <description>Grafik-Editor</description> <year>1983</year> <publisher>TCS</publisher> @@ -333,7 +333,7 @@ Screen-Printer (standalone) </part> </software> - <software name="natomors" supported="yes"> + <software name="natomors"> <description>Nato Morsing Standard Code</description> <year>1983</year> <publisher><unknown></publisher> @@ -347,7 +347,7 @@ Screen-Printer (standalone) </part> </software> - <software name="nodos80" supported="yes"> + <software name="nodos80"> <description>NODOS 80</description> <year>198?</year> <publisher><unknown></publisher> @@ -359,7 +359,7 @@ Screen-Printer (standalone) </part> </software> - <software name="primzahl" supported="yes"> + <software name="primzahl"> <description>Primzahlsuche</description> <year>198?</year> <publisher><unknown></publisher> @@ -372,7 +372,7 @@ Screen-Printer (standalone) </part> </software> - <software name="realcomp" supported="yes"> + <software name="realcomp"> <description>Real-Compiler</description> <year>198?</year> <publisher>MM-Software</publisher> @@ -384,7 +384,7 @@ Screen-Printer (standalone) </part> </software> - <software name="rs232" supported="yes"> + <software name="rs232"> <description>RS-232 Treiberprogramm</description> <year>198?</year> <publisher><unknown></publisher> @@ -396,7 +396,7 @@ Screen-Printer (standalone) </part> </software> - <software name="screened" supported="yes"> + <software name="screened"> <description>Screen Editor (incl. Adventure screen)</description> <year>198?</year> <publisher><unknown></publisher> @@ -408,7 +408,7 @@ Screen-Printer (standalone) </part> </software> - <software name="shifttra" supported="yes"> + <software name="shifttra"> <description>Shift Transformation</description> <year>198?</year> <publisher><unknown></publisher> @@ -421,7 +421,7 @@ Screen-Printer (standalone) </part> </software> - <software name="softschu" supported="yes"> + <software name="softschu"> <description>Software-Schutz</description> <year>1983</year> <publisher>Harald Bögeholz</publisher> @@ -433,7 +433,7 @@ Screen-Printer (standalone) </part> </software> - <software name="spriteed" supported="yes"> + <software name="spriteed"> <description>Sprite-Editor</description> <year>1983</year> <publisher><unknown></publisher> @@ -446,7 +446,7 @@ Screen-Printer (standalone) </part> </software> - <software name="superbas" supported="yes"> + <software name="superbas"> <description>Super-Basic</description> <year>198?</year> <publisher>Heinz Hübben Software Verlag</publisher> @@ -458,7 +458,7 @@ Screen-Printer (standalone) </part> </software> - <software name="supergra" supported="yes"> + <software name="supergra"> <description>Super-Grafik</description> <year>1984</year> <publisher>The Colour Connection</publisher> @@ -471,7 +471,7 @@ Screen-Printer (standalone) </part> </software> - <software name="synthi" supported="yes"> + <software name="synthi"> <description>Synthesizer (TCS)</description> <year>1983</year> <publisher>TCS</publisher> @@ -484,7 +484,7 @@ Screen-Printer (standalone) </part> </software> - <software name="syscopy" supported="yes"> + <software name="syscopy"> <description>System Copy</description> <year>198?</year> <publisher><unknown></publisher> @@ -497,7 +497,7 @@ Screen-Printer (standalone) </part> </software> - <software name="tapedisk" supported="yes"> + <software name="tapedisk"> <description>Tape-Disk Converter 1.11</description> <year>198?</year> <publisher><unknown></publisher> @@ -509,7 +509,7 @@ Screen-Printer (standalone) </part> </software> - <software name="tapeedit" supported="yes"> + <software name="tapeedit"> <description>Tape-Edit</description> <year>1983</year> <publisher>TCS</publisher> @@ -522,7 +522,7 @@ Screen-Printer (standalone) </part> </software> - <software name="tracemon" supported="yes"> + <software name="tracemon"> <description>Tracemon</description> <year>1983</year> <publisher>Juergen Buchmueller</publisher> @@ -535,7 +535,7 @@ Screen-Printer (standalone) </part> </software> - <software name="transist" supported="yes"> + <software name="transist"> <description>Die Physik des Transistors</description> <year>198?</year> <publisher><unknown></publisher> @@ -559,7 +559,7 @@ Screen-Printer (standalone) </part> </software> - <software name="utpack2" supported="yes"> + <software name="utpack2"> <description>Utilities Package Ver. 2.0</description> <year>1983</year> <publisher>Algray Software</publisher> @@ -572,7 +572,7 @@ Screen-Printer (standalone) </part> </software> - <software name="zeichen2" supported="yes"> + <software name="zeichen2"> <description>Zeicheneditor + (incl. SCREEN-Editor)</description> <year>1983</year> <publisher>TCS</publisher> @@ -584,7 +584,7 @@ Screen-Printer (standalone) </part> </software> - <software name="zeichene" supported="yes"> + <software name="zeichene"> <description>Zeicheneditor +</description> <year>1983</year> <publisher>TCS</publisher> @@ -596,7 +596,7 @@ Screen-Printer (standalone) </part> </software> - <software name="zeichens" supported="yes"> + <software name="zeichens"> <description>Zeichensätze (incl. Screen-Printer)</description> <year>1983</year> <publisher>TCS</publisher> @@ -611,7 +611,7 @@ Screen-Printer (standalone) <!-- Demos --> - <software name="coldemo" supported="yes"> + <software name="coldemo"> <description>Colour Genie Demonstration Kassette</description> <year>198?</year> <publisher>Carsten Schmidt</publisher> @@ -624,7 +624,7 @@ Screen-Printer (standalone) </part> </software> - <software name="floh" supported="yes"> + <software name="floh"> <description>Der Flohwalzer</description> <year>198?</year> <publisher><unknown></publisher> @@ -636,7 +636,7 @@ Screen-Printer (standalone) </part> </software> - <software name="musik" supported="yes"> + <software name="musik"> <description>Musik</description> <year>1983</year> <publisher>TCS</publisher> @@ -649,7 +649,7 @@ Screen-Printer (standalone) </software> <!-- From the Colour Genie manual --> - <software name="peng" supported="yes"> + <software name="peng"> <description>Peng</description> <year>198?</year> <publisher>TCS</publisher> @@ -663,7 +663,7 @@ Screen-Printer (standalone) <!-- Games --> - <software name="abenteue" supported="yes"> + <software name="abenteue"> <description>Abenteuerland</description> <year>198?</year> <publisher><unknown></publisher> @@ -675,7 +675,7 @@ Screen-Printer (standalone) </part> </software> - <software name="africa" supported="yes"> + <software name="africa"> <description>Africa</description> <year>198?</year> <publisher><unknown></publisher> @@ -688,7 +688,7 @@ Screen-Printer (standalone) </part> </software> - <software name="andromed" supported="yes"> + <software name="andromed"> <description>Andromeda (32k)</description> <year>1982</year> <publisher>TCG</publisher> @@ -701,7 +701,7 @@ Screen-Printer (standalone) </part> </software> - <software name="andromed16" cloneof="andromed" supported="yes"> + <software name="andromed16" cloneof="andromed"> <description>Andromeda (16k)</description> <year>1982</year> <publisher>TCG</publisher> @@ -714,7 +714,7 @@ Screen-Printer (standalone) </part> </software> - <software name="astrnaut" supported="yes"> + <software name="astrnaut"> <description>Astronaut</description> <year>1984</year> <publisher>N. A. Taylor</publisher> @@ -726,7 +726,7 @@ Screen-Printer (standalone) </part> </software> - <software name="ballon" supported="yes"> + <software name="ballon"> <description>Ballon</description> <year>198?</year> <publisher><unknown></publisher> @@ -738,7 +738,7 @@ Screen-Printer (standalone) </part> </software> - <software name="botschaf" supported="yes"> + <software name="botschaf"> <description>Botschaft</description> <year>1985</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -751,7 +751,7 @@ Screen-Printer (standalone) </part> </software> - <software name="bruecke" supported="yes"> + <software name="bruecke"> <description>Brücke</description> <year>1984</year> <publisher><unknown></publisher> @@ -765,7 +765,7 @@ Screen-Printer (standalone) </software> <!-- From the Colour Genie manual --> - <software name="bumm" supported="yes"> + <software name="bumm"> <description>Bumm Bumm</description> <year>198?</year> <publisher>TCS</publisher> @@ -780,7 +780,7 @@ Screen-Printer (standalone) </part> </software> - <software name="caveman" supported="yes"> + <software name="caveman"> <description>Cave Man</description> <year>198?</year> <publisher><unknown></publisher> @@ -793,7 +793,7 @@ Screen-Printer (standalone) </part> </software> - <software name="chessm" supported="yes"> + <software name="chessm"> <description>Chess Machine</description> <year>1984</year> <publisher>Heinz Hübben Software Verlag</publisher> @@ -805,7 +805,7 @@ Screen-Printer (standalone) </part> </software> - <software name="chop83" supported="yes"> + <software name="chop83"> <description>Chopper (1983)</description> <year>1983</year> <publisher>Jürgen Buchmüller</publisher> @@ -818,7 +818,7 @@ Screen-Printer (standalone) </part> </software> - <software name="chopper" supported="yes"> + <software name="chopper"> <description>Chopper (TCS)</description> <year>198?</year> <publisher>TCS</publisher> @@ -831,7 +831,7 @@ Screen-Printer (standalone) </part> </software> - <software name="ciaagent" supported="yes"> + <software name="ciaagent"> <description>CIA-Agent</description> <year>1985</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -844,7 +844,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colkong" supported="yes"> + <software name="colkong"> <description>Colour Kong (32k)</description> <year>1983</year> <publisher>TCS</publisher> @@ -857,7 +857,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colkong16" cloneof="colkong" supported="yes"> + <software name="colkong16" cloneof="colkong"> <description>Colour Kong (16k)</description> <year>1983</year> <publisher>TCS</publisher> @@ -870,7 +870,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colkong16a" cloneof="colkong" supported="yes"> + <software name="colkong16a" cloneof="colkong"> <description>Colour Kong (16k, no autostart)</description> <year>1983</year> <publisher>TCS</publisher> @@ -883,7 +883,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colscha" supported="yes"> + <software name="colscha"> <description>Colour Schach</description> <year>1983</year> <publisher><unknown></publisher> @@ -896,7 +896,7 @@ Screen-Printer (standalone) </part> </software> - <software name="colsch" supported="yes"> + <software name="colsch"> <description>Colour Schach (TCS)</description> <year>1983</year> <publisher>TCS</publisher> @@ -909,7 +909,7 @@ Screen-Printer (standalone) </part> </software> - <software name="cosmicat" supported="yes"> + <software name="cosmicat"> <description>Cosmic Attack</description> <year>198?</year> <publisher>Kansas Software</publisher> @@ -922,7 +922,7 @@ Screen-Printer (standalone) </part> </software> - <software name="crzchase" supported="yes"> + <software name="crzchase"> <description>Crazy Chaser</description> <year>198?</year> <publisher><unknown></publisher> @@ -934,7 +934,7 @@ Screen-Printer (standalone) </part> </software> - <software name="crzpaint" supported="yes"> + <software name="crzpaint"> <description>Crazy Paint</description> <year>1983</year> <publisher>TCS</publisher> @@ -947,7 +947,7 @@ Screen-Printer (standalone) </part> </software> - <software name="crzpaintc" supported="yes"> + <software name="crzpaintc"> <description>Crazy Paint (The Colour Connection)</description> <year>1984</year> <publisher>The Colour Connection</publisher> @@ -960,7 +960,7 @@ Screen-Printer (standalone) </part> </software> - <software name="crzpaintca" cloneof="crzpaintc" supported="yes"> + <software name="crzpaintca" cloneof="crzpaintc"> <description>Crazy Paint (The Colour Connection, alternate)</description> <year>1984</year> <publisher>The Colour Connection</publisher> @@ -973,7 +973,7 @@ Screen-Printer (standalone) </part> </software> - <software name="deathsta" supported="yes"> + <software name="deathsta"> <description>Deathstar</description> <year>1983</year> <publisher>Algray Software</publisher> @@ -986,7 +986,7 @@ Screen-Printer (standalone) </part> </software> - <software name="deathtra" supported="yes"> + <software name="deathtra"> <description>Deathtrap</description> <year>198?</year> <publisher><unknown></publisher> @@ -999,7 +999,7 @@ Screen-Printer (standalone) </part> </software> - <software name="defender" supported="yes"> + <software name="defender"> <description>Defender</description> <year>198?</year> <publisher>Andreas Goldau Softwareproduction</publisher> @@ -1012,7 +1012,7 @@ Screen-Printer (standalone) </part> </software> - <software name="digboy" supported="yes"> + <software name="digboy"> <description>DIG-BOY (TCS)</description> <year>1983</year> <publisher>TCS</publisher> @@ -1025,7 +1025,7 @@ Screen-Printer (standalone) </part> </software> - <software name="disvilla" supported="yes"> + <software name="disvilla"> <description>Disastrous Villa</description> <year>1985</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1038,7 +1038,7 @@ Screen-Printer (standalone) </part> </software> - <software name="dracula" supported="yes"> + <software name="dracula"> <description>Die Juwelen des Grafen Dracula</description> <year>198?</year> <publisher>Cooperated Software</publisher> @@ -1056,7 +1056,7 @@ Screen-Printer (standalone) </part> </software> - <software name="eagle" supported="yes"> + <software name="eagle"> <description>Eagle</description> <year>1983</year> <publisher>TCS</publisher> @@ -1069,7 +1069,7 @@ Screen-Printer (standalone) </part> </software> - <software name="eatman" supported="yes"> + <software name="eatman"> <description>Eatman</description> <year>1983</year> <publisher>Molimerx Ltd.</publisher> @@ -1082,7 +1082,7 @@ Screen-Printer (standalone) </part> </software> - <software name="eis" supported="yes"> + <software name="eis"> <description>Eis</description> <year>1983</year> <publisher>TCS</publisher> @@ -1095,7 +1095,7 @@ Screen-Printer (standalone) </part> </software> - <software name="eliminat" supported="yes"> + <software name="eliminat"> <description>Eliminator</description> <year>1984</year> <publisher>TCC</publisher> @@ -1108,7 +1108,7 @@ Screen-Printer (standalone) </part> </software> - <software name="empire" supported="yes"> + <software name="empire"> <description>Empire</description> <year>198?</year> <publisher><unknown></publisher> @@ -1120,7 +1120,7 @@ Screen-Printer (standalone) </part> </software> - <software name="exrevers" supported="yes"> + <software name="exrevers"> <description>ExReversic</description> <year>1983</year> <publisher>TCS</publisher> @@ -1133,7 +1133,7 @@ Screen-Printer (standalone) </part> </software> - <software name="fastfood" supported="yes"> + <software name="fastfood"> <description>Fast Food</description> <year>1983</year> <publisher>cc Computer Studio</publisher> @@ -1146,7 +1146,7 @@ Screen-Printer (standalone) </part> </software> - <software name="firebird" supported="yes"> + <software name="firebird"> <description>Firebird</description> <year>1983</year> <publisher>Heinz Hübben Software Verlag</publisher> @@ -1159,7 +1159,7 @@ Screen-Printer (standalone) </part> </software> - <software name="flugsim" supported="yes"> + <software name="flugsim"> <description>Colour Genie Flugsimulator</description> <year>1984</year> <publisher>TCS</publisher> @@ -1171,7 +1171,7 @@ Screen-Printer (standalone) </part> </software> - <software name="fraggels" supported="yes"> + <software name="fraggels"> <description>Im Reich der Fraggels</description> <year>19??</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1185,7 +1185,7 @@ Screen-Printer (standalone) </part> </software> - <software name="frog" supported="yes"> + <software name="frog"> <description>Colour Frog</description> <year>1983</year> <publisher>TCS</publisher> @@ -1198,7 +1198,7 @@ Screen-Printer (standalone) </part> </software> - <software name="glueck" supported="yes"> + <software name="glueck"> <description>Glückspilz</description> <year>1983</year> <publisher><unknown></publisher> @@ -1212,7 +1212,7 @@ Screen-Printer (standalone) </part> </software> - <software name="gorilla" supported="yes"> + <software name="gorilla"> <description>Gorilla</description> <year>1983</year> <publisher>Heinz Hübben Software Verlag</publisher> @@ -1225,7 +1225,7 @@ Screen-Printer (standalone) </part> </software> - <software name="grauen" supported="yes"> + <software name="grauen"> <description>Schiff des Grauens</description> <year>198?</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1239,7 +1239,7 @@ Screen-Printer (standalone) </part> </software> - <software name="hdeath" supported="yes"> + <software name="hdeath"> <description>House of Death</description> <year>1985</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1253,7 +1253,7 @@ Screen-Printer (standalone) </part> </software> - <software name="hektik" supported="yes"> + <software name="hektik"> <description>Hektik</description> <year>1983</year> <publisher>TCS</publisher> @@ -1266,7 +1266,7 @@ Screen-Printer (standalone) </part> </software> - <software name="hektika" cloneof="hektik" supported="yes"> + <software name="hektika" cloneof="hektik"> <description>Hektik (alternate)</description> <year>1983</year> <publisher>TCS</publisher> @@ -1279,7 +1279,7 @@ Screen-Printer (standalone) </part> </software> - <software name="helikopt" supported="yes"> + <software name="helikopt"> <description>Helikopter</description> <year>1983</year> <publisher>Heinz Hübben Software Verlag</publisher> @@ -1292,7 +1292,7 @@ Screen-Printer (standalone) </part> </software> - <software name="horror" supported="yes"> + <software name="horror"> <description>Horror Castle</description> <year>198?</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1305,7 +1305,7 @@ Screen-Printer (standalone) </part> </software> - <software name="invasion" supported="yes"> + <software name="invasion"> <description>Invasion aus dem Weltraum</description> <year>1982</year> <publisher>TCS</publisher> @@ -1337,7 +1337,7 @@ Screen-Printer (standalone) </part> </software> - <software name="jpoker" supported="yes"> + <software name="jpoker"> <description>Joker Poker</description> <year>1983</year> <publisher>TCS</publisher> @@ -1350,7 +1350,7 @@ Screen-Printer (standalone) </part> </software> - <software name="kaefer" supported="yes"> + <software name="kaefer"> <description>Marienkäfer</description> <year>1984</year> <publisher><unknown></publisher> @@ -1363,7 +1363,7 @@ Screen-Printer (standalone) </part> </software> - <software name="king" supported="yes"> + <software name="king"> <description>King</description> <year>1983</year> <publisher>TCS</publisher> @@ -1376,7 +1376,7 @@ Screen-Printer (standalone) </part> </software> - <software name="kniffel" supported="yes"> + <software name="kniffel"> <description>Kniffel</description> <year>1985</year> <publisher>TTS</publisher> @@ -1389,7 +1389,7 @@ Screen-Printer (standalone) </part> </software> - <software name="labyfear" supported="yes"> + <software name="labyfear"> <description>Labyrinth of Fear</description> <year>1983</year> <publisher>Algray Software</publisher> @@ -1407,7 +1407,7 @@ Screen-Printer (standalone) </part> </software> - <software name="laenquiz" supported="yes"> + <software name="laenquiz"> <description>Länder-Quiz</description> <year>1984</year> <publisher>TCS</publisher> @@ -1420,7 +1420,7 @@ Screen-Printer (standalone) </part> </software> - <software name="lasverga" supported="yes"> + <software name="lasverga"> <description>Las Vergas Spiel-Automat</description> <year>198?</year> <publisher><unknown></publisher> @@ -1433,7 +1433,7 @@ Screen-Printer (standalone) </part> </software> - <software name="life" supported="yes"> + <software name="life"> <description>Life</description> <year>1983</year> <publisher>TCS</publisher> @@ -1446,7 +1446,7 @@ Screen-Printer (standalone) </part> </software> - <software name="lunarlan" supported="yes"> + <software name="lunarlan"> <description>Lunar Lander</description> <year>1983</year> <publisher>TCS</publisher> @@ -1471,7 +1471,7 @@ Screen-Printer (standalone) </part> </software> - <software name="madtree" supported="yes"> + <software name="madtree"> <description>Madtree</description> <year>1983</year> <publisher>TCS</publisher> @@ -1484,7 +1484,7 @@ Screen-Printer (standalone) </part> </software> - <software name="mampf2" supported="yes"> + <software name="mampf2"> <description>Mampf Man II</description> <year>1983</year> <publisher>TCS</publisher> @@ -1497,7 +1497,7 @@ Screen-Printer (standalone) </part> </software> - <software name="meteor" supported="yes"> + <software name="meteor"> <description>Meteor</description> <year>1983</year> <publisher>TCS</publisher> @@ -1522,7 +1522,7 @@ Screen-Printer (standalone) </part> </software> - <software name="mordzepp" supported="yes"> + <software name="mordzepp"> <description>Mord im Zeppelin</description> <year>198?</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1535,7 +1535,7 @@ Screen-Printer (standalone) </part> </software> - <software name="motten" supported="yes"> + <software name="motten"> <description>Motten</description> <year>1982</year> <publisher>TCS</publisher> @@ -1548,7 +1548,7 @@ Screen-Printer (standalone) </part> </software> - <software name="mysttave" supported="yes"> + <software name="mysttave"> <description>Mysterious Tavern</description> <year>198?</year> <publisher>Scholz Baeumner Schaffarzik (SBS)</publisher> @@ -1561,7 +1561,7 @@ Screen-Printer (standalone) </part> </software> - <software name="netzo" supported="yes"> + <software name="netzo"> <description>Netzo</description> <year>1983</year> <publisher>TCS</publisher> @@ -1574,7 +1574,7 @@ Screen-Printer (standalone) </part> </software> - <software name="pacboy" supported="yes"> + <software name="pacboy"> <description>Pac Boy</description> <year>1984</year> <publisher>Heinz Hübben Software Verlag</publisher> @@ -1587,7 +1587,7 @@ Screen-Printer (standalone) </part> </software> - <software name="santapar" supported="yes"> + <software name="santapar"> <description>Santa Paravia und Fuimaccio</description> <year>198?</year> <publisher><unknown></publisher> @@ -1599,7 +1599,7 @@ Screen-Printer (standalone) </part> </software> - <software name="saug" supported="yes"> + <software name="saug"> <description>Saug</description> <year>1983</year> <publisher>TCS</publisher> @@ -1612,7 +1612,7 @@ Screen-Printer (standalone) </part> </software> - <software name="schnick" supported="yes"> + <software name="schnick"> <description>Schnick Schnack Schnuck</description> <year>1986</year> <publisher><unknown></publisher> @@ -1625,7 +1625,7 @@ Screen-Printer (standalone) </part> </software> - <software name="scuttle" supported="yes"> + <software name="scuttle"> <description>Scuttle</description> <year>198?</year> <publisher><unknown></publisher> @@ -1638,7 +1638,7 @@ Screen-Printer (standalone) </part> </software> - <software name="skramble" supported="yes"> + <software name="skramble"> <description>Skramble</description> <year>1983</year> <publisher>Algray Software</publisher> @@ -1652,7 +1652,7 @@ Screen-Printer (standalone) </part> </software> - <software name="spaceatt" supported="yes"> + <software name="spaceatt"> <description>Space Attack</description> <year>1984</year> <publisher>TCC</publisher> @@ -1665,7 +1665,7 @@ Screen-Printer (standalone) </part> </software> - <software name="spaceman" supported="yes"> + <software name="spaceman"> <description>Spaceman</description> <year>198?</year> <publisher><unknown></publisher> @@ -1691,7 +1691,7 @@ Screen-Printer (standalone) </part> </software> - <software name="superhrn" supported="yes"> + <software name="superhrn"> <description>Superhirn</description> <year>198?</year> <publisher>TTS</publisher> @@ -1704,7 +1704,7 @@ Screen-Printer (standalone) </part> </software> - <software name="tausend" supported="yes"> + <software name="tausend"> <description>Tausendfuss</description> <year>1983</year> <publisher>TCS</publisher> @@ -1716,7 +1716,7 @@ Screen-Printer (standalone) </part> </software> - <software name="toadman" supported="yes"> + <software name="toadman"> <description>Toad Mania</description> <year>1983</year> <publisher>Gumboot Software</publisher> @@ -1730,7 +1730,7 @@ Screen-Printer (standalone) </part> </software> - <software name="trashman" supported="yes"> + <software name="trashman"> <description>Trash-Man</description> <year>1983</year> <publisher>Schmidtke Electronic</publisher> @@ -1743,7 +1743,7 @@ Screen-Printer (standalone) </part> </software> - <software name="triton" supported="yes"> + <software name="triton"> <description>Triton Battle</description> <year>19??</year> <publisher>Schmidtke Electronic</publisher> @@ -1757,7 +1757,7 @@ Screen-Printer (standalone) </part> </software> - <software name="ubootjag" supported="yes"> + <software name="ubootjag"> <description>U-Boot-Jagd</description> <year>198?</year> <publisher><unknown></publisher> @@ -1769,7 +1769,7 @@ Screen-Printer (standalone) </part> </software> - <software name="wurm" supported="yes"> + <software name="wurm"> <description>Wurm</description> <year>1982</year> <publisher><unknown></publisher> @@ -1781,7 +1781,7 @@ Screen-Printer (standalone) </part> </software> - <software name="zalaga" supported="yes"> + <software name="zalaga"> <description>Zalaga</description> <year>198?</year> <publisher><unknown></publisher> diff --git a/hash/clickstart_cart.xml b/hash/clickstart_cart.xml index bbf6b4010be..ccdbdb68646 100644 --- a/hash/clickstart_cart.xml +++ b/hash/clickstart_cart.xml @@ -33,8 +33,8 @@ </part> </software> - <software name="backyardingans" supported="no"> - <description>Nick Jr. The Backyardingans (UK)</description> + <software name="backyardigans" supported="no"> + <description>Nick Jr. The Backyardigans (UK)</description> <year>2007</year> <publisher>LeapFrog / VIACOM</publisher> <part name="cart" interface="clickstart_cart"> @@ -42,7 +42,7 @@ <feature name="pcbtype" value="LF300-10485-0A" /> <feature name="pcbdate" value="03262007" /> <dataarea name="rom" size="0x400000"> - <rom name="500-12892-a - the backyardingans (uk).bin" size="0x400000" crc="d33777fd" sha1="3245cd4f86cf7d1e59f9484eeb61078981fcf6e8"/> + <rom name="500-12892-a - the backyardigans (uk).bin" size="0x400000" crc="d33777fd" sha1="3245cd4f86cf7d1e59f9484eeb61078981fcf6e8"/> </dataarea> </part> </software> diff --git a/hash/electron_flop.xml b/hash/electron_flop.xml index 90fb123191f..bb40365400b 100644 --- a/hash/electron_flop.xml +++ b/hash/electron_flop.xml @@ -871,6 +871,19 @@ </part> </software> + <software name="sp64"> + <description>Stop Press 64</description> + <year>1992</year> + <publisher>Slogger</publisher> + <info name="usage" value="Requires SP64i" /> + <info name="format" value="ADFS" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size="327680"> + <rom name="sp64_boot-adfs_e.adf" size="327680" crc="8e83fb1d" sha1="d5c4ed8182c0202fd664e5714527a1091a1495ca"/> + </dataarea> + </part> + </software> + <!-- Magazines --> <software name="euser401"> @@ -879,7 +892,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "163840"> + <dataarea name="flop" size="163840"> <rom name="eup401-adfs_e.adf" size="163840" crc="877cb96a" sha1="ef8120efcecbd188be7f7c8d0f4ad7d37dd055bd"/> </dataarea> </part> @@ -891,7 +904,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "163840"> + <dataarea name="flop" size="163840"> <rom name="eup402-adfs_e.adf" size="163840" crc="b9be7a87" sha1="e5b388acdb543b704928bf0da3a25212c36ff3b8"/> </dataarea> </part> @@ -903,7 +916,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "143360"> + <dataarea name="flop" size="143360"> <rom name="eup408-adfs_e.adf" size="143360" crc="b53e5255" sha1="0a8075adaf1a4be5d8ada3f49d855a8b6caf30d5"/> </dataarea> </part> @@ -915,7 +928,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eup411-adfs_e.adf" size="327680" crc="37fe65b8" sha1="d87df67bafa2f6680a53c9b74007df6ba056c52b"/> </dataarea> </part> @@ -927,7 +940,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eup501-adfs_e.adf" size="327680" crc="e0236dec" sha1="b02577cadb34522267f5b57b215725cdb0cb695a"/> </dataarea> </part> @@ -939,7 +952,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "163840"> + <dataarea name="flop" size="163840"> <rom name="eup503-adfs_e.adf" size="163840" crc="120862d9" sha1="b4181c5416fe7b8805a719214f3f755798c54888"/> </dataarea> </part> @@ -951,7 +964,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eup506-adfs_e.adf" size="327680" crc="ab8e73a2" sha1="94d39072552cd39b863d4bc8262d698811e608ae"/> </dataarea> </part> @@ -963,7 +976,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "163840"> + <dataarea name="flop" size="163840"> <rom name="eup512-adfs_e.adf" size="163840" crc="df8498ad" sha1="0b92f865b054e19395fd66a1448c4ab1998116bb"/> </dataarea> </part> @@ -975,7 +988,7 @@ <publisher>P.R.E.S.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eup609-adfs_e.adf" size="327680" crc="87677d8b" sha1="411a85d374b00d56f90bacb436477dad62354ca0"/> </dataarea> </part> @@ -987,7 +1000,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug00-adfs_e.adm" size="327680" crc="4740034e" sha1="f490213581c04d7dcf71ba67202060edeb3c8df5"/> </dataarea> </part> @@ -1011,7 +1024,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug01-adfs_e.adm" size="327680" crc="c88aa2cc" sha1="e0241b8efb8db79aa1b2198dc8cb0da7ce1f1636"/> </dataarea> </part> @@ -1035,7 +1048,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug02-adfs_e.adm" size="327680" crc="7183e0aa" sha1="a14ef8e51dd657aa68e91239f5ac1a28630001af"/> </dataarea> </part> @@ -1059,7 +1072,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug03-adfs_e.adm" size="327680" crc="23dcd1ee" sha1="f56dd7eeea3d6cc909cf74ce4460de96474d2432"/> </dataarea> </part> @@ -1083,7 +1096,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug04-adfs_e.adm" size="327680" crc="582e6244" sha1="7bda20012b374bad4c5616cc59ecc6308a8a47e8"/> </dataarea> </part> @@ -1107,7 +1120,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug05-adfs_e.adm" size="327680" crc="75b230f4" sha1="7c576854b68e6ff9dd3342fc222b26cf869b4c98"/> </dataarea> </part> @@ -1131,7 +1144,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug06-adfs_e.adm" size="327680" crc="0f93e2f4" sha1="53d97babb475dcd11ff418a998a21a49e6afb398"/> </dataarea> </part> @@ -1155,7 +1168,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug07-adfs_e.adm" size="327680" crc="0893a33c" sha1="25410596e4d2c79b09e3ef0ff2b9cbec373b0c45"/> </dataarea> </part> @@ -1179,7 +1192,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug08-adfs_e.adm" size="327680" crc="975081c0" sha1="5df40bbce6ad50df548ac2c18f304c1b64b0a5b2"/> </dataarea> </part> @@ -1203,7 +1216,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug09-adfs_e.adm" size="327680" crc="c692fd87" sha1="ec3264586f02d779b9599b966724805fc66790fb"/> </dataarea> </part> @@ -1227,7 +1240,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug10-adfs_e.adf" size="327680" crc="81aece86" sha1="af32dd473f9dddb1d4bbeeb14531ffe89dec7527"/> </dataarea> </part> @@ -1251,7 +1264,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug11-adfs_e.adm" size="327680" crc="48bc3d92" sha1="07c7af3781474ee070b6de5df58b11b5328b3dba"/> </dataarea> </part> @@ -1275,7 +1288,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug12-adfs_e.adm" size="327680" crc="23b0a6e2" sha1="398a4e27c5e56fdde5dcc516a8e99a84eff99afa"/> </dataarea> </part> @@ -1299,7 +1312,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug13-adfs_e.adm" size="327680" crc="f563737e" sha1="a503691cd455ba0039b1bd7be5319823cf8af0f3"/> </dataarea> </part> @@ -1323,7 +1336,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug14-adfs_e.adm" size="327680" crc="f779d137" sha1="c761cfc7af876c2a8d927a5167de822cf4948bda"/> </dataarea> </part> @@ -1347,7 +1360,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug15-adfs_e.adm" size="327680" crc="c88bb350" sha1="9cfbd3da8717c0c420bad302da4f95e6e3b0fbbb"/> </dataarea> </part> @@ -1371,7 +1384,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug16-adfs_e.adm" size="327680" crc="79f77d2a" sha1="4a6733504baf7eb7220b5bc5b8ce399474a801eb"/> </dataarea> </part> @@ -1395,7 +1408,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug17-adfs_e.adm" size="327680" crc="b3d12948" sha1="bc6fd15c12569ece9c3ee8326e3ce852c958bccf"/> </dataarea> </part> @@ -1419,7 +1432,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug18-adfs_e.adm" size="327680" crc="5836ed85" sha1="cb1724ede0b0a49c059f3090dfdb022e3534d46f"/> </dataarea> </part> @@ -1443,7 +1456,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug19-adfs_e.adm" size="327680" crc="35e99e94" sha1="70d40fb376abf398b084aeab9e5f53707905cdbf"/> </dataarea> </part> @@ -1467,7 +1480,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug20-adfs_e.adm" size="327680" crc="8e49a4e0" sha1="3e45590a628b7ba2dc663c900fe6d12f46d0276a"/> </dataarea> </part> @@ -1492,19 +1505,19 @@ <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> <feature name="part_id" value="Disc A"/> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug21a-adfs_e.adm" size="327680" crc="976e8253" sha1="bfd50a79bab5b3027de2ace13a1fff847e5a5eca"/> </dataarea> </part> <part name="flop2" interface="floppy_3_5"> <feature name="part_id" value="Disc B"/> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug21b-adfs_e.adm" size="327680" crc="c4c0d47a" sha1="2f382946ae07514aff952a3ca1915f56f7f3ffac"/> </dataarea> </part> <part name="flop3" interface="floppy_3_5"> <feature name="part_id" value="Disc C"/> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug21c-adfs_e.adm" size="327680" crc="5b11bb25" sha1="faaa66492b1ec2bb18e367b82e0ebaf837ac51f5"/> </dataarea> </part> @@ -1538,7 +1551,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug22-adfs_e.adm" size="327680" crc="489bc91c" sha1="ed35a3d364d7931cc9bec21dbf33a8cf5ef9f8d5"/> </dataarea> </part> @@ -1562,7 +1575,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug23-adfs_e.adm" size="327680" crc="e0891b3d" sha1="029b2f6a796101f111bb8d9b0644345f0200d73d"/> </dataarea> </part> @@ -1586,7 +1599,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug24-adfs_e.adm" size="327680" crc="8e598e9c" sha1="2dbf77c95a7013ec345eaf57ac698a45f4daa4aa"/> </dataarea> </part> @@ -1610,7 +1623,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug25-adfs_e.adm" size="327680" crc="60eb9705" sha1="fd5c5f9a30456a12eb1518b01096ebf6ea41fc0d"/> </dataarea> </part> @@ -1634,7 +1647,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug26-adfs_e.adm" size="327680" crc="b3e71512" sha1="9f2dcfa9ab34e3bc7355225a25938384e69e9f61"/> </dataarea> </part> @@ -1658,7 +1671,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug27-adfs_e.adm" size="327680" crc="031f778e" sha1="c6cb8c8baa3fe6fdf452d1e248e8cc6103c5d184"/> </dataarea> </part> @@ -1682,7 +1695,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug28-adfs_e.adm" size="327680" crc="262049db" sha1="68c40fa3e6729bd0106b939b46ebf717c97ae945"/> </dataarea> </part> @@ -1706,7 +1719,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug29-adfs_e.adf" size="327680" crc="b79dfb85" sha1="5d78e0b086c17337fb71dc6bff965e078478d9d4"/> </dataarea> </part> @@ -1730,7 +1743,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug30-adfs_e.adm" size="327680" crc="52dba14a" sha1="406c7623410a79455121d6b9bcb26e8b6bc66843"/> </dataarea> </part> @@ -1754,7 +1767,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug31-adfs_e.adm" size="327680" crc="2bf82f9a" sha1="df9d4ec4838932c249870b6bb4357bfc926dc740"/> </dataarea> </part> @@ -1778,7 +1791,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug32-adfs_e.adm" size="327680" crc="a94ab4a3" sha1="081103e7db38e37060c54dfc65a1f75daf833eff"/> </dataarea> </part> @@ -1802,7 +1815,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug33-adfs_e.adf" size="327680" crc="f59e6869" sha1="621e303427d9af758148d25f9bc07c2204ea05d4"/> </dataarea> </part> @@ -1826,7 +1839,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug34-adfs_e.adf" size="327680" crc="6f6e5dce" sha1="3083b46f4981baabe6226e6bfdb6316105abbed1"/> </dataarea> </part> @@ -1850,7 +1863,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug35-adfs_e.adm" size="327680" crc="c3128438" sha1="a429eee99e4897335c3803f403ef83668abc7014"/> </dataarea> </part> @@ -1874,7 +1887,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug36-adfs_e.adm" size="327680" crc="ee1d86c0" sha1="e752e9ef6941c70b60f755088fb20d287e9839ca"/> </dataarea> </part> @@ -1898,7 +1911,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug37-adfs_e.adf" size="327680" crc="ea443e37" sha1="fd738688da3eb774db367f9f3f1291ccea447ba6"/> </dataarea> </part> @@ -1922,7 +1935,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug38-adfs_e.adm" size="327680" crc="2834da9b" sha1="c2e63b880af59994563fe1deb873d59edc65d0fb"/> </dataarea> </part> @@ -1946,7 +1959,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug39-adfs_e.adm" size="327680" crc="5610df83" sha1="635f9ac634d8f5ec7c44efeca6b876d9f9adc9f2"/> </dataarea> </part> @@ -1970,7 +1983,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug40-adfs_e.adm" size="327680" crc="2d434783" sha1="6468062b255070c088faedc183da1441996a5d7d"/> </dataarea> </part> @@ -1994,7 +2007,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug41-adfs_e.adf" size="327680" crc="67529ec8" sha1="390b5e990aa2a7620101fc86fcbcba4df61cacef"/> </dataarea> </part> @@ -2018,7 +2031,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug42-adfs_e.adm" size="327680" crc="1e62f7f9" sha1="aa7be72517733346210a6426d0273aff206da65f"/> </dataarea> </part> @@ -2042,7 +2055,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug43a44-adfs_e.adm" size="327680" crc="1ba16ac2" sha1="4bc42e457c72c821fda5ef9a63d48c39b0693fcb"/> </dataarea> </part> @@ -2066,7 +2079,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug45-adfs_e.adf" size="327680" crc="da5d1965" sha1="d12be02c36dc83214431570c97c91da226783433"/> </dataarea> </part> @@ -2090,7 +2103,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug46-adfs_e.adf" size="327680" crc="0b2b8091" sha1="91c478b242b6770f5e4a079200badceecdf39c66"/> </dataarea> </part> @@ -2114,7 +2127,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug47-adfs_e.adf" size="327680" crc="c0d85427" sha1="6d83d56b71b5745328ba1b238f742a0107ee7849"/> </dataarea> </part> @@ -2138,7 +2151,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug48-adfs_e.adf" size="327680" crc="305509f0" sha1="456397bc0a42d01d7ef32fefbb1e18a87d342253"/> </dataarea> </part> @@ -2162,7 +2175,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug49-adfs_e.adf" size="327680" crc="e1ac5b94" sha1="abfe757fa476c76f23c2a5ecbfb85766ec431ab3"/> </dataarea> </part> @@ -2186,7 +2199,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug50-adfs_e.adf" size="327680" crc="e0356521" sha1="a63a769abd8ccfc99292d53ea63a4664c780425d"/> </dataarea> </part> @@ -2210,7 +2223,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug51-adfs_e.adf" size="327680" crc="fdca6ecc" sha1="a51eab375275cb8a83e839fb6ad81c9a272ed703"/> </dataarea> </part> @@ -2234,7 +2247,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug52-adfs_e.adf" size="327680" crc="0f5edcc1" sha1="d791b0c10c5a7429b49aaa78f1f3d71a56cf174a"/> </dataarea> </part> @@ -2258,7 +2271,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug53-adfs_e.adf" size="327680" crc="a475842f" sha1="40625793a26410de1e11e9a8fa7d109df555cbdd"/> </dataarea> </part> @@ -2282,7 +2295,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug54-adfs_e.adf" size="327680" crc="edf5e56e" sha1="404cd6816031a64469389ede117f0b8c30e515d4"/> </dataarea> </part> @@ -2306,7 +2319,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug55-adfs_e.adf" size="327680" crc="ce6f0c16" sha1="d1be66c7a50921a880a38dc92046fbf906b3b4d1"/> </dataarea> </part> @@ -2330,7 +2343,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug56-adfs_e.adf" size="327680" crc="f2c49d81" sha1="c14e47e9586d262dbf5208fcf4d51742ba7ae17b"/> </dataarea> </part> @@ -2354,7 +2367,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug57-adfs_e.adf" size="327680" crc="d1affeb3" sha1="27a55185d7d803013d5b5f19b1707ec2bc6d8ec0"/> </dataarea> </part> @@ -2378,7 +2391,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug58-adfs_e.adf" size="327680" crc="7d9bfb12" sha1="e9166bc7f2dd6975e46284fe8ac64e03cf8649b8"/> </dataarea> </part> @@ -2402,7 +2415,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug59-adfs_e.adf" size="327680" crc="4bde890a" sha1="0a16ddd6e7fb2f449a74cc6d6e6c4d69acf4e9bc"/> </dataarea> </part> @@ -2426,7 +2439,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug60-adfs_e.adf" size="327680" crc="d284acb3" sha1="8436e13c9115538f8a0b76621599b8e999a55f97"/> </dataarea> </part> @@ -2450,7 +2463,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug61-adfs_e.adf" size="327680" crc="5fd813c5" sha1="283f35e0f59afc936084cfe13033f759d2df38dc"/> </dataarea> </part> @@ -2474,7 +2487,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug62-adfs_e.adf" size="327680" crc="7eb2d4c0" sha1="af149ecb6a1925e691310cfa45a7931076cc01b7"/> </dataarea> </part> @@ -2498,7 +2511,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug63-adfs_e.adf" size="327680" crc="3af73966" sha1="dd705c947e5b8643626a93e458293036a6e95758"/> </dataarea> </part> @@ -2522,7 +2535,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug64-adfs_e.adf" size="327680" crc="25e82d8c" sha1="02fc1710bcb6c7a4cd8996c9a29733d460b8a2c6"/> </dataarea> </part> @@ -2546,7 +2559,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug65-adfs_e.adf" size="327680" crc="1bfe96a4" sha1="e3142d3d37044cca97911a25e93fbc6796d7318b"/> </dataarea> </part> @@ -2570,7 +2583,7 @@ <publisher>E.U.G.</publisher> <info name="format" value="ADFS" /> <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "327680"> + <dataarea name="flop" size="327680"> <rom name="eug66-adfs_e.adf" size="327680" crc="c7ce4f99" sha1="35bedcbb14806525a4a37bb35c24ade254183f05"/> </dataarea> </part> @@ -2699,4 +2712,208 @@ </part> </software> + <software name="hdpd000"> + <description>HeadFirst PD Disk E000/M000/B000</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="81664"> + <rom name="headfirst-pd-disk-000.ssd" size="81664" crc="2e060e6e" sha1="499c6f2283693ff11717082393a8056ece47de6f"/> + </dataarea> + </part> + </software> + + <software name="hdpd001"> + <description>HeadFirst PD Disk E001/M005/B001</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="headfirst-pd-disk-001.ssd" size="204800" crc="3921402f" sha1="bc4b2a795c4726cd94f62b0c0a577ca22c56ab99"/> + </dataarea> + </part> + </software> + + <software name="hdpd002"> + <description>HeadFirst PD Disk E002/M006/B002</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="58880"> + <rom name="headfirst-pd-disk-002.ssd" size="58880" crc="3e52014a" sha1="d82362d5d1fb4d7d1f9b439b8f045958168e415b"/> + </dataarea> + </part> + </software> + + <software name="hdpd003"> + <description>HeadFirst PD Disk E003</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="20224"> + <rom name="headfirst-pd-disk-003.ssd" size="20224" crc="89f761c4" sha1="d615fd893b3df04f509c91f5489dad329d1fdf8c"/> + </dataarea> + </part> + </software> + + <software name="hdpd004"> + <description>HeadFirst PD Disk E004</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="37632"> + <rom name="headfirst-pd-disk-e004.ssd" size="37632" crc="86d5906c" sha1="1d44a83aedbefb62e1137e1892bf696b58ba1f54"/> + </dataarea> + </part> + </software> + + <software name="hdpd005"> + <description>HeadFirst PD Disk E005</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="203264"> + <rom name="headfirst-pd-disk-005.ssd" size="203264" crc="be21a88b" sha1="f9508fd4dc9ca35aa0b9557704e5b79c8f89fa9b"/> + </dataarea> + </part> + </software> + + <software name="hdpd006"> + <description>HeadFirst PD Disk E006</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143104"> + <rom name="headfirst-pd-disk-006.ssd" size="143104" crc="f8940d6c" sha1="4981b2680c4f02ff8d3452e335792d39031c4bfb"/> + </dataarea> + </part> + </software> + + <software name="hdpd007"> + <description>HeadFirst PD Disk E007</description> + <year>1992</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="138496"> + <rom name="headfirst-pd-disk-007.ssd" size="138496" crc="55bc7b3f" sha1="69e695847190142c5c6ce9fb7c6d9fb27b8596f9"/> + </dataarea> + </part> + </software> + + <software name="hdpd008"> + <description>HeadFirst PD Disk E008</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="58112"> + <rom name="headfirst-pd-disk-008.ssd" size="58112" crc="cb2bcb60" sha1="7e761cc17fc81759102a2ca07c3eb085f5dfc295"/> + </dataarea> + </part> + </software> + + <software name="hdpd009"> + <description>HeadFirst PD Disk E009</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="37120"> + <rom name="headfirst-pd-disk-009.ssd" size="37120" crc="ab798b8d" sha1="a521a87c8bc93391cdb6aebeaa884752950a91a4"/> + </dataarea> + </part> + </software> + + <software name="hdpd010"> + <description>HeadFirst PD Disk E010/M009/B005</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="headfirst-pd-disk-010.ssd" size="204800" crc="097e2fcd" sha1="854f4a49170eb15d3d6c7d7e6b680507e9bc11d6"/> + </dataarea> + </part> + </software> + + <software name="hdpd011"> + <description>HeadFirst PD Disk E011</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="204800"> + <rom name="headfirst-pd-disk-011.ssd" size="204800" crc="8a16052b" sha1="5ba9281e66f89fa9b5b92e79c00ea953a7d2b02c"/> + </dataarea> + </part> + </software> + + <software name="hdpd012"> + <description>HeadFirst PD Disk M013/B012</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="170496"> + <rom name="headfirst-pd-disk-012.ssd" size="170496" crc="e6d2b477" sha1="f24a77a807da86ab4542b8e9f9863371daae9d5a"/> + </dataarea> + </part> + </software> + + <software name="hdpd013"> + <description>HeadFirst PD Disk E013</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="167424"> + <rom name="headfirst-pd-disk-013.ssd" size="167424" crc="1d443c20" sha1="0bb592b5f3b721401477530be2d9e1807b8ecd9f"/> + </dataarea> + </part> + </software> + + <software name="hdpd015"> + <description>HeadFirst PD Disk E015/M015/B014</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="157440"> + <rom name="headfirst-pd-disk-015.ssd" size="157440" crc="d263683b" sha1="d91c3198f9d798e75d562a08a483ea79aefa153d"/> + </dataarea> + </part> + </software> + + <software name="hdpd016"> + <description>HeadFirst PD Disk E016/M016/B015</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="355840"> + <rom name="headfirst-pd-disk-016.dsd" size="355840" crc="1cbd7c10" sha1="e9c114827efcceb397be669589bb7de6c4c5a93c"/> + </dataarea> + </part> + </software> + + <software name="hdpd017"> + <description>HeadFirst PD Disk E017</description> + <year>1993</year> + <publisher>HeadFirst PD</publisher> + <info name="format" value="DFS" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="200448"> + <rom name="headfirst-pd-disk-017.ssd" size="200448" crc="5f3a0c33" sha1="52dd3d2ae027cc01c3c087905d35ce6be4a63578"/> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/fmtowns_cd.xml b/hash/fmtowns_cd.xml index d43787b94b4..b460ac15e28 100644 --- a/hash/fmtowns_cd.xml +++ b/hash/fmtowns_cd.xml @@ -27,6 +27,7 @@ Ablemax Suugaku Able Serve AD&D Heroes of the Lance Pony Canyon 1990/6 CD Aesop World Dai-1-shuu (Denshi Ehon) Fujitsu 1993/12 CD Aesop World Dai-2-shuu (Denshi Ehon) Fujitsu 1993/12 CD +After Burner (v1.02) CRI 1989/11 CD Airwave Adventure Toshiba EMI 1989/12 CD Aishuu to Netsujou no Chouwa Fujitsu 1995/4 CD Akiko Gold Fairytale (Red Zone) 1995/1 SET(CD+FD) @@ -203,7 +204,6 @@ FreeColle Marty 1 Fujitsu * Fujitsu Air Warrior V1.1 Fujitsu 1992/3 SET(CD+FD) Fujitsu Air Warrior V2.1 Fujitsu 1995/4 SET(CD+FD) Fujitsu Habitat V1.1 Fujitsu 1990/1 SET(CD+FD) -* Fujitsu Habitat V2.1 L10 Fujitsu 1994/5 SET(CD+FD) Fujitsu Habitat V2.1 L11 Fujitsu 1994/? SET(CD+FD) Fukui Toshio no Otenki Map Inter Limited Logic 1991/2 CD Functioning in Business Part 1 DynEd Japan 1992/7 SET(CD+FD) @@ -600,7 +600,6 @@ Shiki wo Irodoru Nihon no Shouka: Fuyu-hen Toshiba EMI Shiki wo Irodoru Nihon no Shouka: Haru-hen Toshiba EMI 1991/4 CD Shiki wo Irodoru Nihon no Shouka: Natsu-hen Toshiba EMI 1991/4 CD Shin Eiwa / Waei Chuujiten Fujitsu 1993/11 CD -Shooting Towns Amorphous 1990/3 CD Shoubunsha Area Guide: 74 Zenkoku Pension Guide Com Staff 1989/12 CD Shougakkou 4-nen Kyouzai Set Uchida Youkou 1993/5 CD Shougakkou 5-nen Kyouzai Set Uchida Youkou 1993/5 CD @@ -1604,29 +1603,45 @@ User/save disks that can be created from the game itself are not included. <!-- Runs too fast --> <software name="aburner" supported="partial"> <!-- - Origin: Neo Kobe Collection - <rom name="After Burner.ccd" size="2145" crc="c88c38a9" sha1="88f2a8ff8f7c8f27b43e7b2ac2e92e856e97def2"/> - <rom name="After Burner.cue" size="386" crc="a1a8850b" sha1="986ad6875e82ba8c8c20684606cd86d6aeebf5f5"/> - <rom name="After Burner.img" size="230907600" crc="37fa03b7" sha1="1cfa47e4767f4048160149a7c7f3c0bc7ccc60cd"/> - <rom name="After Burner.sub" size="9424800" crc="7a728a6d" sha1="c12601658d2c4863b7c40e2a5c56abe4b2c1e671"/> - --> - <description>After Burner</description> + Origin: redump.org + <rom name="After Burner (Japan) (Track 1).bin" size="7126560" crc="789fc2c6" sha1="0604f645a7777df34006b93baa1c2f68d3379dad"/> + <rom name="After Burner (Japan) (Track 2).bin" size="15709008" crc="e82058e2" sha1="53b1455a8e0db651d5404e3f49aaa6fb6fd00303"/> + <rom name="After Burner (Japan) (Track 3).bin" size="36136128" crc="32986b6c" sha1="78d6b64dc121363bef3ac57fbf1e96b0e3a3d510"/> + <rom name="After Burner (Japan) (Track 4).bin" size="58696512" crc="8bcb4924" sha1="2f399b78429d8b5d91b48379cc3bf54e208fc1c1"/> + <rom name="After Burner (Japan) (Track 5).bin" size="20107248" crc="ef8c6543" sha1="a83c5f182f7bfc41adb8bb94b1965bf7be10298b"/> + <rom name="After Burner (Japan) (Track 6).bin" size="52546032" crc="cb19df25" sha1="3890a42757ce4c220177b748465902e7fd53cced"/> + <rom name="After Burner (Japan) (Track 7).bin" size="35207088" crc="a7e97277" sha1="a932119e322e21c61d71f42ead2c61e41375cfba"/> + <rom name="After Burner (Japan) (Track 8).bin" size="5379024" crc="a9397468" sha1="c7bba81a93d0a5ab5575ad976b5de22a7825e6a7"/> + <rom name="After Burner (Japan).cue" size="917" crc="cac464a9" sha1="31cb5ced76d61f0a76ef1c8f455b6483a2ddcfa7"/> + --> + <description>After Burner (v1.01)</description> <year>1989</year> <publisher>CRI</publisher> <info name="alt_title" value="アフターバーナー" /> - <info name="release" value="198911xx" /> + <info name="release" value="198903xx" /> <part name="cdrom" interface="fmt_cdrom"> <diskarea name="cdrom"> - <disk name="after burner" sha1="e1c6cc2df19b89ca1dab88358337d97ece90dd58" /> + <disk name="after burner (japan)" sha1="a7889124b3e67f6ef8b129b2ecb5914da14e9ed7" /> </diskarea> </part> </software> <software name="aburner3"> <!-- - Origin: Neo Kobe Collection - <rom name="After Burner III.bin" size="414645840" crc="d58140b8" sha1="2a7b13067e1e810f173021e8cdd7e8bdaedfe08c"/> - <rom name="After Burner III.cue" size="554" crc="c686ae32" sha1="fd6f1618b9ea5c15300044a8e1626802fa4bbab9"/> + Origin: redump.org + <rom name="After Burner III (Japan) (Track 01).bin" size="10231200" crc="0d6bc39a" sha1="9a3eecc6b1dbf4a30e0cc62e4ddb54a1298038d2"/> + <rom name="After Burner III (Japan) (Track 02).bin" size="12496176" crc="97def07f" sha1="4e9f21e85d2bb4c2d4108ad1510d8d920a157cd8"/> + <rom name="After Burner III (Japan) (Track 03).bin" size="58393104" crc="243ee025" sha1="b1bd4b5aab7a926d02f3ca5818621690b122d708"/> + <rom name="After Burner III (Japan) (Track 04).bin" size="61500096" crc="7b3225f8" sha1="ec12fa3b41ea7ee94fa800aa7f6e44ec3c263358"/> + <rom name="After Burner III (Japan) (Track 05).bin" size="53030544" crc="6e9be897" sha1="9ddc5c079c066b9cf5e02bef684c39b42584f63d"/> + <rom name="After Burner III (Japan) (Track 06).bin" size="54714576" crc="d7e48924" sha1="34853c8d662b5898926adba7b60dca92fdd8a874"/> + <rom name="After Burner III (Japan) (Track 07).bin" size="56734944" crc="ea9507e7" sha1="7d8edd52637cc65af0853fd678798fa95e8bb4fd"/> + <rom name="After Burner III (Japan) (Track 08).bin" size="60300576" crc="bc0325ae" sha1="6826f501a1d7c5d54441ca60ddf6443398bac077"/> + <rom name="After Burner III (Japan) (Track 09).bin" size="12947760" crc="f5b3562b" sha1="e82dc93b13aa4fa1b4f1706f68597ddf3cc49809"/> + <rom name="After Burner III (Japan) (Track 10).bin" size="13328784" crc="10bc34e6" sha1="2f72bc2635cd10760e2795d479e72eb1de25d6bd"/> + <rom name="After Burner III (Japan) (Track 11).bin" size="6157536" crc="5a8629c2" sha1="9eb2f74518d840fbc73410c34f6647cddee919cf"/> + <rom name="After Burner III (Japan) (Track 12).bin" size="15163344" crc="2b7add3d" sha1="9490084e6b4a95494869784e23a634075b6c343b"/> + <rom name="After Burner III (Japan).cue" size="1410" crc="a13d9e08" sha1="a2f29ae1c5edb4b11ddf39cc196aea9192c54461"/> --> <description>After Burner III</description> <year>1992</year> @@ -1635,7 +1650,7 @@ User/save disks that can be created from the game itself are not included. <info name="release" value="199206xx" /> <part name="cdrom" interface="fmt_cdrom"> <diskarea name="cdrom"> - <disk name="after burner iii" sha1="70b10643e32f4d4a254a0c8f29e3224c2f810c1d" /> + <disk name="after burner iii (japan)" sha1="fe11d382c3efef8ed4a698f6a9832fb6bcd09167" /> </diskarea> </part> </software> @@ -3937,7 +3952,6 @@ User/save disks that can be created from the game itself are not included. </part> </software> - <software name="emit2"> <!-- Origin: redump.org @@ -3969,6 +3983,36 @@ User/save disks that can be created from the game itself are not included. </part> </software> + <software name="emit3"> + <!-- + Origin: redump.org + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 1).bin" size="20815200" crc="d77c413f" sha1="5ddc8bcbd38929a6e74845df23de3a730d79adf1"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 2).bin" size="42547680" crc="c4e86795" sha1="f22e3636eaff62524d189c4bcc771dd63cd226d5"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 3).bin" size="158341344" crc="8f6b1bb1" sha1="268de6a023126d32931b04a3291ed4854f956375"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 4).bin" size="183209040" crc="cf38ec52" sha1="525c83befa09f26c8a5b1ce1a53b3bfb22e21bac"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 5).bin" size="46428480" crc="de12b148" sha1="9d413ac2e691b07a918bcf9699b303dd217309e3"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 6).bin" size="123785760" crc="4796d502" sha1="bdeb2600fa79e451db3468d7bc6880d1473391a6"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 7).bin" size="68991216" crc="19056db5" sha1="bd59802aacf935d0e0807b36c34270061b27cf26"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja) (Track 8).bin" size="3356304" crc="a77f098e" sha1="59f1048a47f199b1b5311e09e6cdcaa777ccc314"/> + <rom name="Emit Vol. 3 - Watashi ni Sayonara o (Japan) (En,Ja).cue" size="1142" crc="1c6b0466" sha1="dcaef9c9d047f96aa269271c29a62f200a5a8acb"/> + --> + <description>Emit Vol. 3 - Watashi ni Sayonara o</description> + <year>1994</year> + <publisher>光栄 (Koei)</publisher> + <info name="release" value="199409xx" /> + <info name="alt_title" value="エミット Vol. 3 私にさよならを" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size="1261568"> + <rom name="emit3.hdm" size="1261568" crc="4e00e431" sha1="8feb87e951bb4030c085a3a37add7091533c7272" /> + </dataarea> + </part> + <part name="cdrom" interface="fmt_cdrom"> + <diskarea name="cdrom"> + <disk name="emit vol. 3 - watashi ni sayonara o (japan) (en,ja)" sha1="b19d7321c656c3c8722ece8a17622e441422ec20" /> + </diskarea> + </part> + </software> + <software name="enkaio"> <!-- Origin: redump.org / r09 @@ -4676,10 +4720,13 @@ User/save disks that can be created from the game itself are not included. </part> </software> - <!-- Missing a floppy disk --> + <!-- + Habitat is an early MMORPG, so it's marked as "not supported" since it requires a modem, and obviously the original online service. + There is an open source server replacement called NeoHabitat, but for now it only works with the Commodore 64 version. + --> <software name="habitat" supported="no"> <!-- - Origin: redump.org + Origin: redump.org + private floppy dump (StuBlad) <rom name="Fujitsu Habitat V2.1L10 (Japan) (Track 1).bin" size="101959200" crc="29a91a0f" sha1="ecff62e56a93cc5d357e012fe21f1ae6c9a2cf70"/> <rom name="Fujitsu Habitat V2.1L10 (Japan) (Track 2).bin" size="47150544" crc="f61961ed" sha1="c89982352db456c812c486b59088656363cde992"/> <rom name="Fujitsu Habitat V2.1L10 (Japan) (Track 3).bin" size="20551776" crc="7e452f3c" sha1="4a8fc3891643ffeff4ea74e4dbd50ad38cd29823"/> @@ -4692,6 +4739,11 @@ User/save disks that can be created from the game itself are not included. <publisher>富士通 (Fujitsu)</publisher> <info name="alt_title" value="富士通 Habitat V2.1L10" /> <info name="release" value="199405xx" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size="1261568"> + <rom name="habitatv2.1l10.hdm" size="1261568" crc="4dc2691b" sha1="a99ada487e1970240a284eb67f7420b13c45f265" /> + </dataarea> + </part> <part name="cdrom" interface="fmt_cdrom"> <diskarea name="cdrom"> <disk name="fujitsu habitat v2.1l10 (japan)" sha1="5704f482ca0bb17e0a01f82bfc4ea272a7534bda" /> @@ -6561,11 +6613,16 @@ User/save disks that can be created from the game itself are not included. <!-- Runs too fast? --> <software name="lastsurv" supported="partial"> <!-- - Origin: Neo Kobe Collection - <rom name="Last Survivor.ccd" size="2083" crc="dd87d31e" sha1="8453a35a485de1b0343da937e5a2236e799032fe"/> - <rom name="Last Survivor.cue" size="350" crc="b39f0cbd" sha1="63a66fd501fdea977ffc97ba88b24d48db4778a3"/> - <rom name="Last Survivor.img" size="291942000" crc="e221b966" sha1="8d9318700dfddf70bd932ce08b12cbc53b584e94"/> - <rom name="Last Survivor.sub" size="11916000" crc="3c61313c" sha1="c839a29dfc45bf1bb074cc76c334561fd9949df1"/> + Origin: redump.org + <rom name="Last Survivor (Japan) (Track 1).bin" size="13759200" crc="8655d470" sha1="e57e9280e729ae54ffda5bbe0b87879b45907d81"/> + <rom name="Last Survivor (Japan) (Track 2).bin" size="1587600" crc="9bec6429" sha1="e47f903e9c644bb77e4459c7d854c946660f3945"/> + <rom name="Last Survivor (Japan) (Track 3).bin" size="14112000" crc="bda965b3" sha1="40681625e19826dd490d9b7f049e07ad16c94911"/> + <rom name="Last Survivor (Japan) (Track 4).bin" size="66502800" crc="f3447abd" sha1="ec4711adfda4718c17f53445117a5e36aa492ae3"/> + <rom name="Last Survivor (Japan) (Track 5).bin" size="67914000" crc="1c0ad2eb" sha1="b349258bd0502166b3ae0c6d529e0d26bd9c48b3"/> + <rom name="Last Survivor (Japan) (Track 6).bin" size="67032000" crc="c178c066" sha1="6446297de98387d8f7cb07005ef36a3a75bb6a6d"/> + <rom name="Last Survivor (Japan) (Track 7).bin" size="57153600" crc="f4a16773" sha1="e2771df7800bee85ac6b40bafb32a3d46c63c43b"/> + <rom name="Last Survivor (Japan) (Track 8).bin" size="3880800" crc="f3e8c4c3" sha1="78e4b91400e7fc2b41f9e687ebd1277f0059ca3b"/> + <rom name="Last Survivor (Japan).cue" size="925" crc="210d69e8" sha1="59987b4b5018e93426d81a1a5dcfc22f10599926"/> --> <description>Last Survivor</description> <year>1990</year> @@ -6574,7 +6631,7 @@ User/save disks that can be created from the game itself are not included. <info name="release" value="199011xx" /> <part name="cdrom" interface="fmt_cdrom"> <diskarea name="cdrom"> - <disk name="last survivor" sha1="d853e7cc1be3d5b10d67f81c9c92ec0b2b360ddd" /> + <disk name="last survivor (japan)" sha1="2daa0d86cda7f88037065f1a70924261fecc3afd" /> </diskarea> </part> </software> @@ -6670,7 +6727,7 @@ User/save disks that can be created from the game itself are not included. <rom name="Lemmings 2 - The Tribes.img" size="335865600" crc="b92ab9cc" sha1="1b45b55ccb0cd2df1cce6475221204deb2d17984"/> <rom name="Lemmings 2 - The Tribes.sub" size="13708800" crc="fe714f95" sha1="1be99f829fdc8926a8a8a879706e66cc0c258b05"/> --> - <description>Lemmings 2 - The Tribes (Japanese)</description> + <description>Lemmings 2 - The Tribes</description> <year>1994</year> <publisher>富士通 (Fujitsu)</publisher> <info name="alt_title" value="レミングス2 ザ・トライブス" /> @@ -9881,6 +9938,29 @@ User/save disks that can be created from the game itself are not included. </part> </software> + <software name="shooting"> + <!-- + Origin: Private dump (rockleevk) + <rom name="SHOOTING (Track 1).bin" size="20462400" crc="f61249cf" sha1="3b758e2510d94d05ec21c36724b82b60bb77768d"/> + <rom name="SHOOTING (Track 2).bin" size="32673984" crc="b43eb157" sha1="cf28bb9f37763e0d085b1c8fa9871a4fbb546f08"/> + <rom name="SHOOTING (Track 3).bin" size="35750400" crc="1b12759b" sha1="c2d102aeb67c5e3a48a43d01b1e9ff4893bedc34"/> + <rom name="SHOOTING (Track 4).bin" size="40061616" crc="55697b43" sha1="45a7dcf45f5698748e1394bb65b1dc42b94eacb3"/> + <rom name="SHOOTING (Track 5).bin" size="36437184" crc="27377dcb" sha1="050a78132620b8ce2c4b24a969c784088626fb02"/> + <rom name="SHOOTING (Track 6).bin" size="26742240" crc="61d65f10" sha1="ddd14ce28067deaba895e38f9aa7dee3109cf3ec"/> + <rom name="SHOOTING.cue" size="617" crc="199debf6" sha1="ddce20c7149404b97a5557a258f102d08014eb46"/> + --> + <description>Shooting Towns</description> + <year>1990</year> + <publisher>アモルファス (Amorphous)</publisher> + <info name="alt_title" value="シューティングTOWNS" /> + <info name="release" value="199003xx" /> + <part name="cdrom" interface="fmt_cdrom"> + <diskarea name="cdrom"> + <disk name="shooting" sha1="e2671ef122e5c7d4c5c1893208c621251ae462c1" /> + </diskarea> + </part> + </software> + <software name="shounenm"> <!-- Origin: Neo Kobe Collection @@ -10981,7 +11061,7 @@ User/save disks that can be created from the game itself are not included. <rom name="The New Zealand Story.img" size="3528000" crc="1aa9de77" sha1="41ad193cfa00c6a66b16a11a466025bb6b00f4a2"/> <rom name="The New Zealand Story.sub" size="144000" crc="ca7fa012" sha1="c9b7ab8bef81071416697e7a7b764f8beac732dc"/> --> - <description>The New Zealand Story</description> + <description>The New Zealand Story (HMA-213A)</description> <year>1989</year> <publisher>ビング (Ving)</publisher> <info name="alt_title" value="ニュージーランドストーリー" /> @@ -10993,6 +11073,24 @@ User/save disks that can be created from the game itself are not included. </part> </software> + <software name="tnzso" cloneof="tnzs"> + <!-- + Origin: redump.org + <rom name="NewZealand Story, The (Japan).bin" size="3528000" crc="f1245680" sha1="e8c9ea40ce35475707f0dc561917dc9b9ec9dfd0"/> + <rom name="NewZealand Story, The (Japan).cue" size="118" crc="3fd154f7" sha1="a79b9610ec8a2bad92e21982d887b878e87c4910"/> + --> + <description>The New Zealand Story (HMA-213)</description> + <year>1989</year> + <publisher>ビング (Ving)</publisher> + <info name="alt_title" value="ニュージーランドストーリー" /> + <info name="release" value="198908xx" /> + <part name="cdrom" interface="fmt_cdrom"> + <diskarea name="cdrom"> + <disk name="newzealand story, the (japan)" sha1="fffd76294e587755c3753bfbbd71ce3555186701" /> + </diskarea> + </part> + </software> + <!-- Mouse doesn't work, but can be played with a controller --> <software name="tokio" supported="partial"> <!-- diff --git a/hash/gameboy.xml b/hash/gameboy.xml index 4e32bdf05f8..0ab4a9bb7d0 100644 --- a/hash/gameboy.xml +++ b/hash/gameboy.xml @@ -7854,7 +7854,7 @@ <feature name="pcb" value="DMG-A06-01" /> <feature name="u1" value="U1 2M/4M/8M-MROM" /> <feature name="u2" value="U2 MBC-5" /> - <feature name="u3" value="U3 64K-SRAM" /> + <feature name="u3" value="U3 64K-SRAM" /> <feature name="u4" value="U4 MM1134A" /> <feature name="batt" value="Batt CR1616" /> <feature name="slot" value="rom_mbc5" /> @@ -17261,7 +17261,7 @@ </part> </software> - <software name="pokepika"> + <software name="pokepika" cloneof="pokeyell"> <description>Pocket Monsters - Pikachu (Japan, Rev. 3)</description> <year>1998</year> <publisher>Nintendo</publisher> diff --git a/hash/gamegear.xml b/hash/gamegear.xml index 41f1085c233..3a4c36b8dd9 100644 --- a/hash/gamegear.xml +++ b/hash/gamegear.xml @@ -7682,6 +7682,18 @@ a certain item) --> </part> </software> + <software name="sonic2p1" cloneof="sonic2"> + <description>Sonic The Hedgehog 2 (World, final prototype 19920925)</description> + <year>1992</year> + <publisher>Sega</publisher> + <part name="cart" interface="gamegear_cart"> + <dataarea name="rom" size="524288"> + <rom name="gg sonic 2 0 25.9.eprom" size="262144" crc="6fb9e149" sha1="f65d2e8ed1c6548b803c3967e54fce2523e7101d" offset="0x00000"/> + <rom name="gg sonic 2 1 25.9..eprom" size="262144" crc="751fe756" sha1="aa3be441d440f6b49953eaff3bd47ad07252f8df" offset="0x40000"/> + </dataarea> + </part> + </software> + <software name="sonic2d" cloneof="sonic2"> <!-- This predates the final release and contains some different tiles & sprites compared to the final game --> <description>Sonic The Hedgehog 2 (Rolling Demo)</description> diff --git a/hash/gameking.xml b/hash/gameking.xml index 7c0e10d38c7..caeed8150e9 100644 --- a/hash/gameking.xml +++ b/hash/gameking.xml @@ -43,24 +43,24 @@ S2: to VCC (most likely WE) S3: to GND (most likely OE) S1: is on some carts directly connected to VCC - there are multiple cartridge types with different dates stamped on the PCB - - 128KB capacity - - 2007 / APR 02 04 / REV:1.0 - 2007 / APR 28 04 / REV:2.0 - - 512KB capacity - - 2007B / OCT 28 04 / REV:1.0 - 2007D / APR 23 05 / REV:1.0 - - 1024KB capacity - 2007E / JUN 16 05 / REV:1.0 - - the dates are not the release dates for the individual games. - - all GameKing 3 cartridges seen have been the 2007D type + there are multiple cartridge types with different dates stamped on the PCB + + 128KB capacity + + 2007 / APR 02 04 / REV:1.0 + 2007 / APR 28 04 / REV:2.0 + + 512KB capacity + + 2007B / OCT 28 04 / REV:1.0 + 2007D / APR 23 05 / REV:1.0 + + 1024KB capacity + 2007E / JUN 16 05 / REV:1.0 + + the dates are not the release dates for the individual games. + + all GameKing 3 cartridges seen have been the 2007D type --> @@ -262,13 +262,13 @@ S1: is on some carts directly connected to VCC <!-- Multi-game carts --> - <software name="mc_4v01" supported="no"> + <software name="mc_4v01" supported="partial"> <description>4 in 1 - AirWar + DeadShot + Challenge + Speedboat</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="gk_airwar_deadshot_challenge_speedboat.bin" size="0x080000" status="baddump" crc="b366be5d" sha1="66e565640eb86a50c5a0fc8b8c62deea3e99b3a7"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="gk_airwar_deadshot_challenge_speedboat.bin" size="0x100000" crc="bdb6c3b9" sha1="f78310f3e39cc3794c2db17a25746f9f8933e485"/> </dataarea> </part> </software> @@ -306,19 +306,19 @@ S1: is on some carts directly connected to VCC </part> </software> - <software name="mc_4v04" supported="no"> + <software name="mc_4v04" supported="partial"> <description>4 in 1 - Farer + Sortie + PhantomFighter + SeaBed War</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="gk_4in1_farer_sortie_phantomfighter_seabedwar.bin" size="0x080000" status="baddump" crc="bcbfb7d3" sha1="2f37e0e9cca23bb9e06f339030eaa6e357ed17eb"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="gk_4in1_farer_sortie_phantomfighter_seabedwar.bin" size="0x100000" crc="795fa7b0" sha1="8b11f9991c9e232f0b8bd781d85e1f40a1dbb372"/> </dataarea> </part> </software> <software name="mc_4v05" supported="partial"> - <description>4 in 1 - SeaGuard + Whirlybird + Spectask + Captain</description> + <description>4 in 1 - SeaGuard + Whirlybird + Spectask + Captain (set 1)</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> @@ -328,24 +328,46 @@ S1: is on some carts directly connected to VCC </part> </software> + <software name="mc_4v05a" cloneof="mc_4v05" supported="partial"> + <description>4 in 1 - SeaGuard + Whirlybird + Spectask + Captain (set 2)</description> + <year>200?</year> + <publisher>TimeTop</publisher> + <part name="cart" interface="gameking_cart"> + <dataarea name="rom" size="0x080000"> + <rom name="seaguard-whirlybird-spectask-captain.gk" size="0x080000" crc="ab79bd72" sha1="5c364f6c21559bd6e0db3f73da7d6dc6e7fe4b4b"/> + </dataarea> + </part> + </software> + <software name="mc_4v06" supported="partial"> - <description>4 in 1 - Three Battles + Light Sword + Risker + Metal Deform</description> + <description>4 in 1 - Three Battles + Light Sword + Risker + Metal Deform (512KB cartridge)</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> <dataarea name="rom" size="0x080000"> - <rom name="gk_4in1_threebattles_lightswort_metaldefor iv.bin" size="0x080000" crc="eb9399df" sha1="2f698fc716b3006f968d2b89a28424ca75ad2741"/> + <rom name="gk_4in1_threebattles_lightsword_risker_metaldeform_512kb.bin" size="0x080000" crc="eb9399df" sha1="2f698fc716b3006f968d2b89a28424ca75ad2741"/> + </dataarea> + </part> + </software> + + <software name="mc_4v06a" cloneof="mc_4v06" supported="partial"> + <description>4 in 1 - Three Battles + Light Sword + Risker + Metal Deform (1MB cartridge)</description> + <year>200?</year> + <publisher>TimeTop</publisher> + <part name="cart" interface="gameking_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="gk_4in1_threebattles_lightsword_risker_metaldeform_1mb.bin" size="0x100000" crc="ca59c576" sha1="614cbc4bff39b38d0efa0aa4b35ac870c45ca886"/> </dataarea> </part> </software> - <software name="mc_4v07" supported="no"> + <software name="mc_4v07" supported="partial"> <description>4 in 1 - TrojanLegend (Trojan) + HappyBall + Supermotor (Motor) + Lanneret (Hawk)</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="gk_4in1_trojanlegend_happyball_supermotor_lanneret.bin" size="0x080000" status="baddump" crc="cbd8df6a" sha1="63fbda84375a748721c41492610ae5e2f8910f08"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="gk_4in1_trojanlegend_happyball_supermotor_lanneret.bin" size="0x100000" crc="99d8b18a" sha1="3154016d3e57a96f657b533a9d7b0c4bbaf04654"/> </dataarea> </part> </software> @@ -362,25 +384,36 @@ S1: is on some carts directly connected to VCC </part> </software> - <software name="mc_4v09" supported="no"> + <software name="mc_4v09" supported="partial"> <description>4 in 1 Vol. 9 - Duckman + Ares + HappyKiller + Cycloneact</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="gk_4in1_vol9.bin" size="0x080000" status="baddump" crc="02fbc6ef" sha1="84bea568b4c9a50184f15709066e73f3ce09e184"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="gk_4in1_vol9.bin" size="0x100000" crc="f09aa5ac" sha1="81caa4374ae0113d663da7590ae864422d4eda44"/> </dataarea> </part> </software> <software name="mc_4v10" supported="partial"> - <description>4 in 1 Vol. 10 - Soldier + Seatercel + General + Seafight</description> + <description>4 in 1 Vol. 10 - Soldier + Seatercel + General + Seafight (512KB cartridge)</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> <feature name="pcb" value="2007B / OCT 28 04 / REV:1.0"/> <dataarea name="rom" size="0x080000"> - <rom name="4in1no10.bin" size="0x080000" crc="b25b1080" sha1="24bc65a9e49ba6f0ffc19b3b858d6c576a3196f7"/> + <rom name="4in1no10_512kb.bin" size="0x080000" crc="b25b1080" sha1="24bc65a9e49ba6f0ffc19b3b858d6c576a3196f7"/> + </dataarea> + </part> + </software> + + <software name="mc_4v10a" cloneof="mc_4v10" supported="partial"> + <description>4 in 1 Vol. 10 - Soldier + Seatercel + General + Seafight (1MB cartridge)</description> + <year>200?</year> + <publisher>TimeTop</publisher> + <part name="cart" interface="gameking_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="4in1no10_1meg.bin" size="0x100000" crc="cb34960d" sha1="52c27538c8ad91b3b41c3b49236d4f4daa6a80cb"/> </dataarea> </part> </software> @@ -418,58 +451,57 @@ S1: is on some carts directly connected to VCC </part> </software> - - <software name="mc_4v14" supported="no"> + <software name="mc_4v14" supported="partial"> <description>4 in 1 - CS-I + Soldier + Sea War + Thunderbird</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="4in1 - cs-i, soldier, sea war, thunderbird.bin" status="baddump" size="0x080000" crc="8ec18345" sha1="35b53171d6d1fbfd0dfe0879ce0af15b7f3cde84"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="4in1 - cs-i, soldier, sea war, thunderbird.bin" size="0x100000" crc="80f19e56" sha1="e75fb8fbf893881cc30696414c36c88e80656d06"/> </dataarea> </part> </software> - <software name="mc_4v15" supported="no"> + <software name="mc_4v15" supported="partial"> <description>4 in 1 - Elfin + Chariot + Searcher + Peace Havass</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="4in1 - elfin, chariot, searcher, peace havass.bin" status="baddump" size="0x080000" crc="de570f79" sha1="77d6c19f00cbcea5b661b689cff7fac3790032aa"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="4in1 - elfin, chariot, searcher, peace havass.bin" size="0x100000" crc="8239061d" sha1="032de7367525f92fff88ea778f53987eed567838"/> </dataarea> </part> </software> - <software name="mc_4v16" supported="no"> + <software name="mc_4v16" supported="partial"> <description>4 in 1 - Manhunt + Bobby + Tantivy + Racing Car</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="4in1 - manhunt, bobby, tantivy, racing car.bin" status="baddump" size="0x080000" crc="890d9270" sha1="5e4c90885d243d526418a76ee2525a8c2af4e0ae"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="4in1 - manhunt, bobby, tantivy, racing car.bin" size="0x100000" crc="80f1bf46" sha1="e6f496e299589a3974be176d4b4215ad4aa0583c"/> </dataarea> </part> </software> - <software name="mc_4v17" supported="no"> + <software name="mc_4v17" supported="partial"> <description>4 in 1 - Nagual + Revenger + Terminator + Black Jack</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="4in1 - nagual, revenger, terminator, black jack.bin" status="baddump" size="0x080000" crc="3e1c0eeb" sha1="319057078315d982cef9c55eaac5d4c8609a57cc"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="4in1 - nagual, revenger, terminator, black jack.bin" size="0x100000" crc="f930124b" sha1="d81a903dc531d84609e1f017f18a111ec671aa84"/> </dataarea> </part> </software> - <software name="mc_4v18" supported="no"> + <software name="mc_4v18" supported="partial"> <description>4 in 1 - Nobody + Bad Boy + Air Wrestle + MotherLove</description> <year>200?</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="4in1 - nobody, bad boy, air wrestle, motherlove.bin" status="baddump" size="0x080000" crc="13557220" sha1="a6a1aeddac8e95337d1e25051f7730fba28d43e4"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="4in1 - nobody, bad boy, air wrestle, motherlove.bin" size="0x100000" crc="9205aaf8" sha1="bfa52063f1cf3a10368d6bc5793c95624c7287c8"/> </dataarea> </part> </software> @@ -486,13 +518,13 @@ S1: is on some carts directly connected to VCC </part> </software> - <software name="mc_4v19a" cloneof="mc_4v19" supported="no"> + <software name="mc_4v19a" cloneof="mc_4v19" supported="partial"> <description>4 in 1 - Warrior + Cleverhawk + Valiant + MetalDeform (1MB cartridge)</description> <year>2005</year> <publisher>TimeTop</publisher> <part name="cart" interface="gameking_cart"> - <dataarea name="rom" size="0x080000"> - <rom name="4in1 - warrior, cleverhawk, valiant, metaldeform (1mb cart type).bin" status="baddump" size="0x080000" crc="18fe216b" sha1="f9c0215b031120d1868d7e825e3774898e452ba9"/> <!-- half size --> + <dataarea name="rom" size="0x100000"> + <rom name="4in1 - warrior, cleverhawk, valiant, metaldeform (1mb cart type).bin" size="0x100000" crc="c246510d" sha1="d27427b6c9670a12a01e89cc4b39298bc0682748"/> </dataarea> </part> </software> diff --git a/hash/gameking3.xml b/hash/gameking3.xml index 30ec1c308f8..a8ad8312a98 100644 --- a/hash/gameking3.xml +++ b/hash/gameking3.xml @@ -73,7 +73,7 @@ </dataarea> </part> </software> - + <software name="vagrant" supported="partial"> <description>Vagrant</description> <year>200?</year> @@ -83,6 +83,6 @@ <rom name="vagrant.gk3" size="524288" crc="db50e1c9" sha1="80f27ec7973d336e12ee506f090440db35ecf183"/> </dataarea> </part> - </software> + </software> </softwarelist> diff --git a/hash/gmaster.xml b/hash/gmaster.xml index fdb20ca9a63..5386dc784a0 100644 --- a/hash/gmaster.xml +++ b/hash/gmaster.xml @@ -63,6 +63,17 @@ Undumped: </part> </software> + <software name="finitezn"> + <description>Finite Zone</description> + <year>199?</year> + <publisher>Hartung</publisher> + <part name="cart" interface="gmaster_cart"> + <dataarea name="rom" size="16384"> + <rom name="finite_zone.bin" size="16384" crc="35741cd9" sha1="148dc46f748f8b16d2e292400cd5fbe3f4891b91"/> + </dataarea> + </part> + </software> + <software name="fussball" supported ="partial"> <!-- some gfx corruption --> <description>3-on-3 Soccer (Fuss-ball)</description> <year>1990</year> @@ -140,6 +151,17 @@ Undumped: </part> </software> + <software name="swarrior" supported="no"> + <description>Space Warrior</description> + <year>199?</year> + <publisher>Hartung</publisher> + <part name="cart" interface="gmaster_cart"> + <dataarea name="rom" size="32768"> + <rom name="space_warrior.bin" size="32768" crc="af61d552" sha1="7fb7731716013277c42712bfa6c5ab7cc2467349"/> + </dataarea> + </part> + </software> + <software name="tennism" supported="no"> <description>Tennis Master</description> <year>1990</year> diff --git a/hash/ibm5150.xml b/hash/ibm5150.xml index ca92df759c1..181694b6007 100644 --- a/hash/ibm5150.xml +++ b/hash/ibm5150.xml @@ -6477,6 +6477,64 @@ has been replaced with an all-zero block. --> </part> </software> + <software name="ucsdpsys"> + <description>UCSD p-System</description> + <year>1982</year> + <publisher>IBM</publisher> + <!-- software reports version as IV.03 --> + <info name="version" value="IV.0 Release 1" /> + <!-- Origin: BitSavers --> + <part name="flop1" interface="floppy_5_25"> + <feature name="part_id" value="STARTUP:" /> + <dataarea name="flop" size = "145805"> + <rom name="STARTUP.IMD" size="145805" crc="7649f9e8" sha1="f84fe212e83064e574b00e24c412d486d1e89fb0"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <feature name="part_id" value="SYSTEM2:" /> + <dataarea name="flop" size = "148360"> + <rom name="SYSTEM2.IMD" size="148360" crc="917fdc1d" sha1="aa871bc127168c2f17b528811e9bde4a0b75e209"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_5_25"> + <feature name="part_id" value="SYSTEM4:" /> + <dataarea name="flop" size = "150404"> + <rom name="SYSTEM4.IMD" size="150404" crc="84ca430c" sha1="f8886fe4bdd58cb0ea88cfe8bc5d801e2b29ba58"/> + </dataarea> + </part> + <part name="flop4" interface="floppy_5_25"> + <feature name="part_id" value="UTILITY:" /> + <dataarea name="flop" size = "124854"> + <rom name="UTILITY.IMD" size="124854" crc="156f20c1" sha1="47d5f925380295959b16312f3db937607295f8da"/> + </dataarea> + </part> + <part name="flop5" interface="floppy_5_25"> + <feature name="part_id" value="EXTRAS:" /> + <dataarea name="flop" size = "157047"> + <rom name="EXTRAS.IMD" size="157047" crc="8bc772f1" sha1="6f29de1cb08d07944e9a93dd98e749c1d3b5b7ca"/> + </dataarea> + </part> + <part name="flop6" interface="floppy_5_25"> + <feature name="part_id" value="FORTRAN:" /> + <dataarea name="flop" size = "112590"> + <rom name="FORTRAN.IMD" size="112590" crc="192e0a52" sha1="c334ca3c13206dcd4296c90983fa1a67ce5e7654"/> + </dataarea> + </part> + <!-- Origin: z80.eu --> + <part name="flop7" interface="floppy_5_25"> + <feature name="part_id" value="SYSTEM2: (alternate)" /> + <dataarea name="flop" size = "163840"> + <rom name="UCSD_IV_3_SYSTEM2.IMA" size="163840" crc="4c6c6da0" sha1="dfa4c31d143bb99ee6bf3b75f64eb65fa9f681a4"/> + </dataarea> + </part> + <part name="flop8" interface="floppy_5_25"> + <feature name="part_id" value="PASCAL:" /> + <dataarea name="flop" size = "163840"> + <rom name="UCSD_IV_3_PASCAL.IMA" size="163840" crc="bdd699ba" sha1="df3392aa561a53148f193d070e84274f087127cf"/> + </dataarea> + </part> + </software> + <software name="wendin"> <description>Wendin Multiuser DOS 2.11</description> <year>1987</year> @@ -6638,7 +6696,7 @@ has been replaced with an all-zero block. --> </software> <!-- Listed as clone of 2400ad because not sure if different version --> - <software name="2400ad1" cloneof="2400ad" supported="yes"> + <software name="2400ad1" cloneof="2400ad"> <description>2400 A.D. (set 2)</description> <year>1987</year> <publisher>Origin</publisher> @@ -7205,6 +7263,18 @@ has been replaced with an all-zero block. --> </part> </software> + <software name="apgbonus"> + <description>Apogee Software Bonus Disk (Jumpman Lives!, Commander Keen in Invasion of the Vorticons)</description> + <year>1991</year> + <publisher>Apogee Software</publisher> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size = "368640"> + <!-- modified with a config file --> + <rom name="bonus.img" size="368640" crc="854ab346" sha1="1058146ce565871cd6f2cdcbf2758b948b3b9aac" status="baddump"/> + </dataarea> + </part> + </software> + <software name="arcblock"> <description>Arcade Blockbusters! (Ghosts'n Goblins & Sarge)</description> <year>1991</year> @@ -8800,32 +8870,14 @@ has been replaced with an all-zero block. --> </part> </software> - <software name="ironmnso"> - <description>Ivan "Ironman" Stewart's Super Off Road (5.25")</description> + <software name="intkarat"> + <description>International Karate</description> <year>1990</year> - <publisher>Virgin Mastertronic</publisher> - <info name="developer" value="Leland Corporation" /> - <part name="flop1" interface="floppy_5_25"> - <dataarea name="flop" size = "368640"> - <rom name="Ivan Ironman Stewart's Super Off Road [Virgin Games] [1990] [5.25DD] [Disk 1 of 2].img" size="368640" crc="3a0c4afb" sha1="80573c911f579ad3958fd6938fe6946755ba04c6"/> - </dataarea> - </part> - <part name="flop2" interface="floppy_5_25"> - <dataarea name="flop" size = "368640"> - <rom name="Ivan Ironman Stewart's Super Off Road [Virgin Games] [1990] [5.25DD] [Disk 2 of 2].img" size="368640" crc="f47dab95" sha1="e0d663c60a432034d94a1be3c04e888c228a3284"/> - </dataarea> - </part> - </software> - - <software name="ironmnso35" cloneof="ironmnso"> - <description>Ivan "Ironman" Stewart's Super Off Road (16 Blitz release) (3.5")</description> - <year>1992</year> - <publisher>Virgin Games</publisher> - <info name="developer" value="Leland Corporation" /> - <info name="ported by" value="Graftgold" /> + <publisher>System 3 Software</publisher> + <info name="developer" value="System 3 Software" /> <part name="flop1" interface="floppy_3_5"> <dataarea name="flop" size = "737280"> - <rom name="Super Off Road (16 Blitz release) [Virgin Games] [1992] [3.5DD] [Disk 1 of 1].img" size="737280" crc="fce3d276" sha1="16d90ffc29f5422f5003f71f10e304b8454d3a48"/> + <rom name="International Karate (Prism Leisure release) [System 3] [1990] [3.5DD] [Disk 1 of 1].img" size="737280" crc="e8b3d837" sha1="a469f0bb4bdd27b7c72366dbc9223d532f9031de"/> </dataarea> </part> </software> @@ -8843,25 +8895,32 @@ has been replaced with an all-zero block. --> </part> </software> - <software name="intkarat"> - <description>International Karate</description> + <software name="ironmnso"> + <description>Ivan "Ironman" Stewart's Super Off Road (5.25")</description> <year>1990</year> - <publisher>System 3 Software</publisher> - <info name="developer" value="System 3 Software" /> - <part name="flop1" interface="floppy_3_5"> - <dataarea name="flop" size = "737280"> - <rom name="International Karate (Prism Leisure release) [System 3] [1990] [3.5DD] [Disk 1 of 1].img" size="737280" crc="e8b3d837" sha1="a469f0bb4bdd27b7c72366dbc9223d532f9031de"/> + <publisher>Virgin Mastertronic</publisher> + <info name="developer" value="Leland Corporation" /> + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size = "368640"> + <rom name="Ivan Ironman Stewart's Super Off Road [Virgin Games] [1990] [5.25DD] [Disk 1 of 2].img" size="368640" crc="3a0c4afb" sha1="80573c911f579ad3958fd6938fe6946755ba04c6"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_5_25"> + <dataarea name="flop" size = "368640"> + <rom name="Ivan Ironman Stewart's Super Off Road [Virgin Games] [1990] [5.25DD] [Disk 2 of 2].img" size="368640" crc="f47dab95" sha1="e0d663c60a432034d94a1be3c04e888c228a3284"/> </dataarea> </part> </software> - <software name="joeblade"> - <description>Joe Blade (Smash16 release)</description> + <software name="ironmnso35" cloneof="ironmnso"> + <description>Ivan "Ironman" Stewart's Super Off Road (16 Blitz release) (3.5")</description> <year>1992</year> - <publisher>Interceptor Software</publisher> + <publisher>Virgin Games</publisher> + <info name="developer" value="Leland Corporation" /> + <info name="ported by" value="Graftgold" /> <part name="flop1" interface="floppy_3_5"> <dataarea name="flop" size = "737280"> - <rom name="Joe Blade (Smash16 release) [Interceptor Software] [1992] [3.5DD] [Disk 1 of 1].img" size="737280" crc="69a11fc6" sha1="4a5265a03087ad94ee23f15de7896c9e1c069b7f"/> + <rom name="Super Off Road (16 Blitz release) [Virgin Games] [1992] [3.5DD] [Disk 1 of 1].img" size="737280" crc="fce3d276" sha1="16d90ffc29f5422f5003f71f10e304b8454d3a48"/> </dataarea> </part> </software> @@ -8912,6 +8971,17 @@ has been replaced with an all-zero block. --> </part> </software> + <software name="joeblade"> + <description>Joe Blade (Smash16 release)</description> + <year>1992</year> + <publisher>Interceptor Software</publisher> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "737280"> + <rom name="Joe Blade (Smash16 release) [Interceptor Software] [1992] [3.5DD] [Disk 1 of 1].img" size="737280" crc="69a11fc6" sha1="4a5265a03087ad94ee23f15de7896c9e1c069b7f"/> + </dataarea> + </part> + </software> + <software name="madden"> <description>John Madden Football</description> <year>1989</year> @@ -10020,7 +10090,7 @@ has been replaced with an all-zero block. --> </software> <!-- matches dump of 3.5" "International Version" --> - <software name="nova9a" cloneof="nova9" supported="yes"> + <software name="nova9a" cloneof="nova9"> <description>Nova 9: The Return of Gir Draxon (version 1.0)</description> <year>1991</year> <publisher>Sierra</publisher> diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index fe2996b439e..40e5e3ea9ba 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -550,7 +550,7 @@ </part> </software> - <software name="drafix" supported="yes"> + <software name="drafix"> <description>Drafix Windows CAD (Demo)</description> <year>1990</year> <publisher>Fox Data</publisher> @@ -6369,7 +6369,7 @@ </part> </software> - <software name="5250emu" supported="yes"> + <software name="5250emu"> <description>Enhanced 5250 Emulation Program</description> <year>1986</year> <publisher>IBM</publisher> @@ -6874,7 +6874,7 @@ </software> <!-- Bundled with "Mastering Borland C++ 3.1" by Tom Swan. ISBN10: 0-672-30274-8 --> - <software name="brlndcpp" supported="yes"> + <software name="brlndcpp"> <description>Mastering Borland C++ 3.1</description> <year>1992</year> <publisher>Sams Publishing</publisher> @@ -7588,7 +7588,7 @@ </software> <!-- Bundled with "TMS320C5x DSK - Applications Guide" by Texas Instruments. TI ID: BPRA063 --> - <software name="tms320c5x" supported="yes"> + <software name="tms320c5x"> <description>TMS320C5x DSK - Applications Guide - Application Software</description> <year>1997</year> <publisher>Texas Instruments</publisher> @@ -10389,6 +10389,17 @@ </part> </software> + <software name="goal"> + <description>Goal!</description> + <year>1993</year> + <publisher>Virgin Interactive</publisher> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "4252733"> + <rom name="Goal! [Virgin Games] [1993] [3.5''HD] [Disk 1 of 1].mfm" size="4252733" crc="7b3476a9" sha1="6a47b37798f62580b2d68ced87e60944d4dd92ab"/> + </dataarea> + </part> + </software> + <software name="goblins"> <description>Gobliiins (US - VGA release)</description> <year>1992</year> @@ -11771,7 +11782,7 @@ </part> </software> - <software name="nova9_525" supported="yes"> + <software name="nova9_525"> <description>Nova 9 (International Version, 5.25")</description> <year>1991</year> <publisher>Dynamix</publisher> @@ -12292,6 +12303,28 @@ </part> </software> + <software name="sleepwalker"> + <description>Sleepwalker</description> + <year>1993</year> + <publisher>Ocean</publisher> + <info name="developer" value="C.T.A. Developments" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "4215420"> + <rom name="Sleepwalker [Ocean] [1993] [3.5HD] [Disk 1 of 3].mfm" size="4215420" crc="05da623d" sha1="b4ed81efbae60e0bf12fabe25cd60de30e8be821"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_3_5"> + <dataarea name="flop" size = "4192605"> + <rom name="Sleepwalker [Ocean] [1993] [3.5HD] [Disk 2 of 3].mfm" size="4192605" crc="0d5e83aa" sha1="8eefd8df3b23d88be5dfab933b4673a0685aa15b"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_3_5"> + <dataarea name="flop" size = "2159681"> + <rom name="Sleepwalker [Ocean] [1993] [3.5HD] [Disk 3 of 3].mfm" size="2159681" crc="f08d4015" sha1="d7e3919a5d2a51e6e915ffe5d44dd8de07b3ec30"/> + </dataarea> + </part> + </software> + <software name="sq5"> <description>Space Quest V: The Next Mutation (3.5", v1.04)</description> <year>1993</year> @@ -12607,6 +12640,28 @@ </part> </software> + <software name="sf2"> + <description>Street Fighter II</description> + <year>1993</year> + <publisher>US Gold</publisher> + <info name="developer" value="Capcom USA" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Street Fighter II [Capcom USA] [1992] [3.5''HD] [Disk 1 of 3].img" size="1474560" crc="8f19a1ba" sha1="4b8cb0adff1e7df836450738eeac74653de5654e"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Street Fighter II [Capcom USA] [1992] [3.5''HD] [Disk 2 of 3].img" size="1474560" crc="696cccce" sha1="147845702699b98e08a22aa448f0a2d0e522a395"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Street Fighter II [Capcom USA] [1992] [3.5''HD] [Disk 3 of 3].img" size="1474560" crc="6cd1c68e" sha1="33dfd74a8a138d5605cae69f6c17e992612dff81"/> + </dataarea> + </part> + </software> + <software name="strkcomm" supported="no"> <description>Strike Commander</description> <year>1992</year> @@ -12771,6 +12826,27 @@ </part> </software> + <software name="ufoeuita" cloneof="ufoeu"> + <description>UFO - Enemy Unknown (Italy)</description> + <year>1994</year> + <publisher>Microprose</publisher> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Ufo Enemy Unknown (Italy) [Microprose] [1994] [3.5HD] [Disk 1 of 3].img" size="1474560" crc="e6cac594" sha1="ff9e23147c99fa8bf101c556a6727a6261542893"/> + </dataarea> + </part> + <part name="flop2" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Ufo Enemy Unknown (Italy) [Microprose] [1994] [3.5HD] [Disk 2 of 3].img" size="1474560" crc="eff641db" sha1="7a6f9b9b0efa9aa5268d4983c54206505f551495"/> + </dataarea> + </part> + <part name="flop3" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Ufo Enemy Unknown (Italy) [Microprose] [1994] [3.5HD] [Disk 3 of 3].img" size="1474560" crc="bb4c55f2" sha1="fea81ce17b795d33c004ae8fee26b66227a9f6ee"/> + </dataarea> + </part> + </software> + <software name="ultdoom"> <description>The Ultimate DOOM</description> <year>1995</year> @@ -12859,7 +12935,7 @@ </part> </software> - <software name="veildark" supported="yes"> + <software name="veildark"> <description>Veil of Darkness</description> <year>1993</year> <publisher>Strategic Simulations, Inc.</publisher> diff --git a/hash/interpro.xml b/hash/interpro.xml index 59c2ebef159..b069c923f7a 100644 --- a/hash/interpro.xml +++ b/hash/interpro.xml @@ -36,7 +36,7 @@ <part name="disc1" interface="cdrom"> <feature name="part_id" value="System Software Disc I" /> <diskarea name="cdrom"> - <disk name="iss_050599_1" sha1="5d556b4df2dccdc681095fedcf836a5b0a7782a0" writeable="no" /> + <disk name="iss_050599_1" sha1="5d556b4df2dccdc681095fedcf836a5b0a7782a0"/> </diskarea> </part> @@ -44,7 +44,7 @@ <part name="disc2" interface="cdrom"> <feature name="part_id" value="System Software Disc II" /> <diskarea name="cdrom"> - <disk name="iss_050599_2" sha1="3813db83871668eed97b43f2384b7e95a649598a" writeable="no" /> + <disk name="iss_050599_2" sha1="3813db83871668eed97b43f2384b7e95a649598a"/> </diskarea> </part> @@ -52,7 +52,7 @@ <part name="disc3" interface="cdrom"> <feature name="part_id" value="System Software Disc III" /> <diskarea name="cdrom"> - <disk name="iss_050599_3" sha1="c8b08cd45ef1614b3db1cd0fb8e6539e3bcc5725" writeable="no" /> + <disk name="iss_050599_3" sha1="c8b08cd45ef1614b3db1cd0fb8e6539e3bcc5725"/> </diskarea> </part> @@ -60,7 +60,7 @@ <part name="disc4" interface="cdrom"> <feature name="part_id" value="System Software Disc IV" /> <diskarea name="cdrom"> - <disk name="iss_050599_4" sha1="2681b4cd8d355b6abfcfebb1b40a6d8a5ef37fe9" writeable="no" /> + <disk name="iss_050599_4" sha1="2681b4cd8d355b6abfcfebb1b40a6d8a5ef37fe9"/> </diskarea> </part> </software> @@ -76,7 +76,7 @@ <part name="disc1" interface="cdrom"> <feature name="part_id" value="MDEM Software" /> <diskarea name="cdrom"> - <disk name="mech_081797_1" sha1="a03f9a9b08d6220b49f1be8a50a2032323f69fb8" writeable="no" /> + <disk name="mech_081797_1" sha1="a03f9a9b08d6220b49f1be8a50a2032323f69fb8"/> </diskarea> </part> @@ -84,7 +84,7 @@ <part name="disc2" interface="cdrom"> <feature name="part_id" value="MDEM Disc II" /> <diskarea name="cdrom"> - <disk name="mech_081797_2" sha1="a269113a742c8dbf081855bcf2135b70c42738ef" writeable="no" /> + <disk name="mech_081797_2" sha1="a269113a742c8dbf081855bcf2135b70c42738ef"/> </diskarea> </part> </software> diff --git a/hash/iqunlim_cart.xml b/hash/iqunlim_cart.xml new file mode 100644 index 00000000000..cf203d231ff --- /dev/null +++ b/hash/iqunlim_cart.xml @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<!-- + +Cartridge pinout + +01|GND +02|NC +03|D10 +04|D11 +05|D4 +06|D3 +07|D12 +08|D2 +09|D5 +10|D9 +11|D13 +12|D1 +13|D6 +14|D8 +15|D14 +16|D0 +17|D7 +18|OE +19|D15 +20|A4 +21|A0 +22|A16 +23|A1 +24|A15 +25|A2 +26|A14 +27|A3 +28|A13 +29|A12 +30|A11 +31|A10 +32|A9 +33|A5 +34|A8 +35|WE?? +36|A19 +37|A20 +38|->JUMPER R4 +39|NC +40|CE +41|A18 +42|A17 +43|A7 +44|A6 +45|VCC + +--> + +<softwarelist name="iqunlim_cart" description="VTech IQ Unlimited cartridges"> + <!-- upper half of the ROM contains the English for Beginners game (in German) the lower half of the ROM contains Entertainment Trivia (in English) --> + <!-- different carts would have been sold with the upper address line fixed high/low to select the correct game --> + + <software name="efb" supported="no"> + <description>Englisch für Anfänger</description> + <year>200?</year> + <publisher>VTech</publisher> + <part name="cart" interface="iqunlim_cart"> + <dataarea name="rom" size="0x80000"> + <rom name="27-06260-0-0.u2" size="0x80000" crc="dffcaca3" sha1="e513f4b83b067adb965cb4a4ba0c003b747f1dc7" /> + </dataarea> + </part> + </software> + +</softwarelist> + + diff --git a/hash/jaguar.xml b/hash/jaguar.xml index 9fd0c54aebb..7e65188a3dd 100644 --- a/hash/jaguar.xml +++ b/hash/jaguar.xml @@ -272,7 +272,7 @@ Unreleased (possibly no prototypes exist): </software> <!-- boot OK --> - <software name="bubsy" supported="yes"> + <software name="bubsy"> <description>Bubsy in Fractured Furry Tales</description> <year>1994</year> <publisher>Atari</publisher> @@ -285,7 +285,7 @@ Unreleased (possibly no prototypes exist): </software> <!-- boot OK --> - <software name="cfodder" supported="yes"> + <software name="cfodder"> <description>Cannon Fodder</description> <year>1995</year> <publisher>Virgin Interactive</publisher> @@ -760,7 +760,7 @@ Unreleased (possibly no prototypes exist): </software> <!-- boot OK --> - <software name="soccerkd" supported="yes"> + <software name="soccerkd"> <description>Soccer Kid</description> <year>1996</year> <publisher>ReadySoft</publisher> @@ -790,7 +790,7 @@ Unreleased (possibly no prototypes exist): </software> <!-- boot OK --> - <software name="soccerkd1h" cloneof="soccerkd" supported="yes"> + <software name="soccerkd1h" cloneof="soccerkd"> <!-- uses universal header, only way to boot this at moment --> <description>Soccer Kid (Re-release, Hacked)</description> <year>2000</year> @@ -868,7 +868,7 @@ Unreleased (possibly no prototypes exist): </dataarea> </part> </software> - + <!-- throws exception after few seconds on title screen --> <software name="tempst2k" supported="no"> <description>Tempest 2000</description> @@ -1028,7 +1028,7 @@ Unreleased (possibly no prototypes exist): </part> </software> - <!-- boot OK, sound buzz when selecting new game, can eventually black screen or throw an exception --> + <!-- boot OK, sound buzz when selecting new game, can eventually black screen or throw an exception --> <software name="wolfn3d" supported="no"> <description>Wolfenstein 3D</description> <year>1994</year> @@ -1068,7 +1068,7 @@ Unreleased (possibly no prototypes exist): </software> <!-- boot OK, sound metrics menu has glitchy bars (pause menu then press 'B') --> - <software name="zool2" supported="yes"> + <software name="zool2"> <description>Zool 2</description> <year>1994</year> <publisher>Atari</publisher> diff --git a/hash/jakks_gamekey_sw.xml b/hash/jakks_gamekey_sw.xml index 9b1fcc06ba2..5db8d6775ca 100644 --- a/hash/jakks_gamekey_sw.xml +++ b/hash/jakks_gamekey_sw.xml @@ -7,7 +7,7 @@ <!-- There are 4 pads on the PCB labeled A0 A1 A2 and A3. A1 and A2 are connected to VCC. The gamekey PCB had the same silkscreened boxes as the Disney Games, with A1 H and A3 H marked. --> - <software name="tdyoda" supported="yes"> + <software name="tdyoda"> <description>Turret Defense & Yoda's Escape</description> <year>2005</year> <publisher>JAKKS Pacific / Griptonite Games</publisher> diff --git a/hash/jupace_cass.xml b/hash/jupace_cass.xml index d9cd6c3085f..faf63b03cd3 100644 --- a/hash/jupace_cass.xml +++ b/hash/jupace_cass.xml @@ -7,13 +7,19 @@ * update to latest TOSEC (2014-10-31) * add usage instructions * check which games work and which don't and fix the supported flag accordingly + + NOTES: + * It is recommended to run with 32k of ram (-ram 32k) + * Paste the usage string literally, up to but not including the period, then press enter, then start the tape. Note that currently, paste of uppercase is buggy. + --> <softwarelist name="jupace_cass" description="Jupiter Cantab Jupiter Ace cassettes"> - <software name="3dmaze" supported="no"> + <software name="3dmaze"> <description>3D Maze</description> <year>2007</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load 3dmaze 3dmaze" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="4169"> <rom name="3d maze (2007-05)(lopes, ricardo fernandes)(pd)[19k].tap" size="4169" crc="a7d40f66" sha1="0ef5fec603846859c2780399b1d39ff7d9ba9020"/> @@ -21,10 +27,11 @@ </part> </software> - <software name="avoider" supported="no"> + <software name="avoider"> <description>Ace Avoider</description> <year>1984</year> <publisher>Personal Computer World</publisher> + <info name="usage" value="load avoider run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="874"> <rom name="ace avoider (1984-07)(personal computer world)(gb)[3k].tap" size="874" crc="5e9c9468" sha1="aa15ec8a4ef6e698aba63bd876d8b7aa2b7831a8"/> @@ -36,6 +43,7 @@ <description>Ace Case</description> <year>1984</year> <publisher>Personal Computer World</publisher> + <info name="usage" value="load case" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="332"> <rom name="ace case (1984-03)(personal computer world)(gb)[3k].tap" size="332" crc="85ed47c5" sha1="4aaf98b299f7d80ef43c05b36f897451bdcbdddb"/> @@ -48,6 +56,7 @@ <description>Ace Demonstration Tape</description> <year>1983</year> <publisher>Jupiter Cantab</publisher> + <info name="usage" value="load banner" /> <part name="cass1" interface="jupace_cass"> <feature name="part_id" value="Banner"/> <dataarea name="cass" size="993"> @@ -84,6 +93,7 @@ <description>Ace Graphics (large)</description> <year>1983</year> <publisher>Personal Computer World</publisher> + <info name="usage" value="load ?plot" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="93"> <rom name="ace graphics (1983-09)(personal computer world)(gb)[large][3k].tap" size="93" crc="5dc239b1" sha1="7fbb43fa71eac2f177d5fc97ab55b1d1f6898f0c"/> @@ -95,6 +105,7 @@ <description>Ace Graphics (small)</description> <year>1983</year> <publisher>Personal Computer World</publisher> + <info name="usage" value="load ?plot" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="85"> <rom name="ace graphics (1983-09)(personal computer world)(gb)[small][3k].tap" size="85" crc="6764333f" sha1="1b74c30727f1503e312fa43fe82cdcc925c6cf1e"/> @@ -102,10 +113,11 @@ </part> </software> - <software name="aceinvad" supported="no"> + <software name="aceinvad"> <description>Ace Invaders (Hi-Tech Microsoft)</description> <year>1982</year> <publisher>Hi-Tech Microsoft</publisher> + <info name="usage" value="load graphics gr load run run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1141"> <rom name="ace invaders (1982)(hi-tech microsoft)(gb)[3k].tap" size="1141" crc="e5d9c8e1" sha1="f914f71198eb62e7a61ddb3809131b2d5b53e7b4"/> @@ -113,10 +125,11 @@ </part> </software> - <software name="invader1" supported="no"> + <software name="invader1"> <description>Ace Invaders (Forth Dimension)</description> <year>1983</year> <publisher>Forth Dimension</publisher> + <info name="usage" value="load GR load GR load GR load GM load GM load GM z p" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="4689"> <rom name="ace invaders (1983)(forth dimension)[1k].tap" size="4689" crc="f8858cb9" sha1="082f81b8320a6d1d930e028cf88acefb94c4f1e3"/> @@ -124,7 +137,7 @@ </part> </software> - <software name="amce11" supported="no"> + <software name="amce11"> <description>Ace Manual Code Examples - Chapter 11 (mice)</description> <year>2007</year> <publisher>Ricardo Fernandes Lopes</publisher> @@ -247,6 +260,7 @@ <description>Ace Manual Code Examples - Chapter 17 (hex)</description> <year>2007</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load hex" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="51"> <rom name="ace manual code examples - chapter 17 (2007)(lopes, ricardo fernandes)(pd)[hex][3k].tap" size="51" crc="d497883e" sha1="a2c81b7d0b8e499a90a2725f31634e6fd238a194"/> @@ -409,10 +423,11 @@ </part> </software> - <software name="acemines" supported="no"> + <software name="acemines"> <description>Ace Mines</description> <year>2004</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load mines mines" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="3006"> <rom name="ace mines (2004)(lopes, ricardo fernandes)[19k].tap" size="3006" crc="d508f3e5" sha1="d2038a9e0ed23db9a834f0845e06ff132bcc8412"/> @@ -420,10 +435,11 @@ </part> </software> - <software name="acestar" supported="no"> + <software name="acestar"><!-- only levels 1 and 2 are playable --> <description>Ace Star</description> <year>2010</year> <publisher>Jupiter Ace Archive Team</publisher> + <info name="usage" value="0 0 bload astar 16384 call" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="10365"> <rom name="ace star (2010)(jupiter ace archive team)(gb)(pd)[19k].tap" size="10365" crc="01217f3f" sha1="d3c69c182323c3ad45e01601611f36b40970e22d"/> @@ -435,6 +451,7 @@ <description>Ace Vocab Select</description> <year>1983</year> <publisher>Personal Computer World</publisher> + <info name="usage" value="load listv" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="115"> <rom name="ace vocab select (1983-04)(personal computer world)(gb)[3k].tap" size="115" crc="587a7272" sha1="89ca8b51b686a964d3f710669493c61bfafcf2ea"/> @@ -442,10 +459,11 @@ </part> </software> - <software name="acevader" supported="no"> + <software name="acevader"> <description>Acevaders</description> <year>1983</year> <publisher>Micro Marketing</publisher> + <info name="usage" value="load gr load acevaders gr r. Z = left, X = right, M = fire" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1307"> <rom name="acevaders (1983)(micro marketing)(gb)[3k].tap" size="1307" crc="9e8ef6c0" sha1="8ed92d3847e59730d16232426153d10dd53712e9"/> @@ -453,10 +471,11 @@ </part> </software> - <software name="adventa" supported="no"> + <software name="adventa"> <description>Adventure A - Planet of Death</description> <year>1981</year> <publisher>Artic Computing</publisher> + <info name="usage" value="0 0 bload adva 16384 call" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14811"> <rom name="adventure a - planet of death (1981)(artic computing)(pd)[19k].tap" size="14811" crc="be67ed38" sha1="e70ed38c14e2ba34ce8faa42e0c828081d53e4b5"/> @@ -464,10 +483,11 @@ </part> </software> - <software name="aliendef" supported="no"> + <software name="aliendef"> <description>Alien Defender</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load defender g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="2667"> <rom name="alien defender (1984)(boldfield computing)(gb)[19k].tap" size="2667" crc="38259232" sha1="d3078ea35296466da62afc45170d0955af435801"/> @@ -479,6 +499,7 @@ <description>Alien Swarm</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load gr load swarm gr go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1570"> <rom name="alien swarm (1983-01-20)(popular computing weekly)(gb)[3k].tap" size="1570" crc="645fc362" sha1="65a29f0ed18fd7a5269d72c065e2c70b1c2fb61e"/> @@ -486,10 +507,11 @@ </part> </software> - <software name="amazmaze" supported="no"> + <software name="amazmaze"> <description>Amazing Maze</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load maze g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1706"> <rom name="amazing maze (1984)(boldfield computing)(gb)[19k].tap" size="1706" crc="b8eb2dfa" sha1="b5b8a2684d8d81e715a962d697bf2a488ca89ea5"/> @@ -501,6 +523,7 @@ <description>AMI Sound Toolkit</description> <year>2007</year> <publisher>Jupiter Ace Archive Team</publisher> + <info name="usage" value="load amisndkit go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="2103"> <rom name="ami sound toolkit (2007)(jupiter ace archive team)(gb)(pd)[19k].tap" size="2103" crc="20cd6c82" sha1="a9fa23e053b326295b12740445225cef4ef14347"/> @@ -512,6 +535,7 @@ <description>Assembler & Dis-assembler</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load a1" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="13501"> <rom name="assembler & dis-assembler (1984)(boldfield computing)(gb)[19k].tap" size="13501" crc="bd1df519" sha1="acc4f09e4b0849e89d32be9eff677fa96ea08849"/> @@ -519,10 +543,11 @@ </part> </software> - <software name="astrian" supported="no"> + <software name="astrian"> <description>Astrian Descent (Prototype)</description> <year>1983</year> <publisher>Brian Bates</publisher> + <info name="usage" value="load Lander run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="7538"> <rom name="astrian descent (1983-08)(bates, brian)[unreleased][19k].tap" size="7538" crc="ebbe6695" sha1="1316fdf0d33cc0874f8e9addba035361bca6b533"/> @@ -530,10 +555,11 @@ </part> </software> - <software name="aticraid" supported="no"> + <software name="aticraid"> <description>Atic Raid</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load atic go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="16587"> <rom name="atic raid (1984)(boldfield computing)(gb)(pd)[19k].tap" size="16587" crc="fd3fc960" sha1="f6758bf3e34a20260673a62d213021c5251fd419"/> @@ -541,10 +567,11 @@ </part> </software> - <software name="blackisl" supported="no"> + <software name="blackisl"> <description>Black Island Adventure</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load black island" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="67678"> <rom name="black island adventure (1984)(boldfield computing)(gb)[19k].tap" size="67678" crc="ec520816" sha1="68edb835f83ad1588bd7a840fd333cdb5ce9578f"/> @@ -552,10 +579,11 @@ </part> </software> - <software name="bomber" supported="no"> + <software name="bomber"> <description>Bomber</description> <year>1997</year> <publisher>Paul Robson</publisher> + <info name="usage" value="load bomber play" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1649"> <rom name="bomber (1997)(robson, paul)(pd)[3k].tap" size="1649" crc="feb62f38" sha1="95bc411f9d456d4f0a3d0d6a4d009de5cf69bf17"/> @@ -563,10 +591,11 @@ </part> </software> - <software name="breakout" supported="no"> + <software name="breakout"> <description>Breakout</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load breakout b. Left = A, Right = L" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="844"> <rom name="breakout (1983-03-17)(popular computing weekly)(gb)[3k].tap" size="844" crc="1027393d" sha1="7dbe94751150c2b378fe6ea359c55a350f8babad"/> @@ -578,6 +607,7 @@ <description>Calendar</description> <year>2007</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load calendar" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="549"> <rom name="calendar (2007)(lopes, ricardo fernandes)(pd)[3k].tap" size="549" crc="f0952595" sha1="596e02f76327d1a82eb77b2069605781c11465d9"/> @@ -585,10 +615,11 @@ </part> </software> - <software name="callisto" supported="no"> + <software name="callisto"> <description>Callisto</description> <year>1983</year> <publisher>ACS Software</publisher> + <info name="usage" value="8930 0 bload callisto" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="8832"> <rom name="callisto (1983)(acs software)[16k].tap" size="8832" crc="aa6ba879" sha1="4e70e44db33c4197a6d68da3ff17ca82c23cff93"/> @@ -596,10 +627,11 @@ </part> </software> - <software name="cavern" supported="no"> + <software name="cavern"> <description>Cavern Attack</description> <year>1983</year> <publisher>Hi-Tech Microsoft</publisher> + <info name="usage" value="load graphics load run gr run. A = up, Z = down" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1026"> <rom name="cavern attack (1983)(hi-tech microsoft)(gb)[3k].tap" size="1026" crc="1518ca67" sha1="2153980802c9fd92cadcd74b729fa7ae3525142f"/> @@ -607,10 +639,11 @@ </part> </software> - <software name="cenipede" supported="no"> - <description>Cenipede</description> + <software name="cenipede"> + <description>Centipede</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load centipede go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="6361"> <rom name="cenipede (1984)(boldfield computing)(gb)[19k].tap" size="6361" crc="a3280ac0" sha1="32d8d0433ddd7598d03dd4acc74a891c31067a06"/> @@ -622,6 +655,7 @@ <description>Champs de Mines + Casse Briques (Fra)</description> <year>1983</year> <publisher>ERE</publisher> + <info name="usage" value="0 0 bload mines 11272 64 bload g load m 7 jeu" /> <part name="cass1" interface="jupace_cass"> <feature name="part_id" value="Side A (Champs de Mines)"/> <dataarea name="cass" size="1009"> @@ -636,10 +670,11 @@ </part> </software> - <software name="chase" supported="no"> + <software name="chase"> <description>Chase</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load chase chase. Cursor keys to move" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="557"> <rom name="chase (1983-01-27)(popular computing weekly)(gb)[3k].tap" size="557" crc="db067f32" sha1="14c2238920bd984003f500a175ec56c877a164fd"/> @@ -647,10 +682,11 @@ </part> </software> - <software name="chess" supported="no"> + <software name="chess"> <description>Chess</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load chess run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14409"> <rom name="chess (1984)(boldfield computing)(gb)[19k].tap" size="14409" crc="554a759c" sha1="376a638a45c13ba52105bb72cf79332d0cb4bc0f"/> @@ -658,10 +694,23 @@ </part> </software> + <software name="schess2"><!-- looks the same as "chess" above, but the .ace versions have different checksums, so presumably there's something different. --> + <description>Superchess II</description> + <year>1983</year> + <publisher>C.P. Software</publisher> + <info name="usage" value="load chess run" /> + <part name="cass1" interface="jupace_cass"> + <dataarea name="cass" size="7379620"> + <rom name="superchess ii (1983)(cp software)[19k].wav" size="7379620" crc="d8e11db8" sha1="af47d5fdf816f47c5727ffa05252958ba678d0b4"/> + </dataarea> + </part> + </software> + <software name="cygnus" supported="no"> <description>Cygnus</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load cygnus g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="16549"> <rom name="cygnus (1984)(boldfield computing)(gb)[19k].tap" size="16549" crc="d0a31a28" sha1="5b0260200cafde332c514bdf319e7f29e3d312c2"/> @@ -673,6 +722,7 @@ <description>Database</description> <year>1985</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load database" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="7414"> <rom name="database (1985)(boldfield computing)(gb)[19k].tap" size="7414" crc="fd4d1d6b" sha1="5144c48b796a45a1d07318307cfa46f23a72f521"/> @@ -709,10 +759,11 @@ </part> </software> - <software name="dodge" supported="no"> - <description>Dodge (Prototype)</description> + <software name="dodge"> + <description>Dodge the Munch (Prototype)</description> <year>1983</year> <publisher>Brian Bates</publisher> + <info name="usage" value="load Dodger game" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="8496"> <rom name="dodge (1983-07)(bates, brian)[unreleased][19k].tap" size="8496" crc="299438f5" sha1="fcf156fc3f23d8ab256feaed6b8b625abc381ff5"/> @@ -724,6 +775,7 @@ <description>Dot Man</description> <year>1983</year> <publisher>Micro Marketing</publisher> + <info name="usage" value="load s load run s run. Cursor keys to move" /><!-- When all dots are eaten, level does not end --> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1381"> <rom name="dot man (1983)(micro marketing)(gb)[3k].tap" size="1381" crc="ddb81ec6" sha1="6ee455454b1973c45f3766dcb7a181d2665477bd"/> @@ -731,10 +783,11 @@ </part> </software> - <software name="ducksht" supported="no"> + <software name="ducksht"> <description>Duckshoot</description> <year>1983</year> <publisher>Micro Marketing</publisher> + <info name="usage" value="11272 0 bload dchars load duckshoot d. Fire = Enter" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="802"> <rom name="duckshoot (1983)(micro marketing)(gb)[3k].tap" size="802" crc="105055d8" sha1="1286c483d0365acbf258336c89e940d981a1ed13"/> @@ -753,10 +806,11 @@ </part> </software> - <software name="firebird" supported="no"> + <software name="firebird"> <description>Firebird</description> <year>1983</year> <publisher>Voyager Software</publisher> + <info name="usage" value="load FIREBIRD run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="13767"> <rom name="firebird (1983)(voyager software)(gb)[19k].tap" size="13767" crc="a7717297" sha1="7a16edfab50c465fb7232ba57a329a685b127180"/> @@ -826,13 +880,14 @@ </part> </software> - <software name="frogger" supported="no"> + <software name="frogger"> <description>Frogger (Boldfield Computing)</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load frogger go" /> <part name="cass1" interface="jupace_cass"> - <dataarea name="cass" size="8284"> - <rom name="frogger (1984)(boldfield computing)(gb)(pd)[16k].tap" size="8284" crc="ff0f890c" sha1="d921609941c978d364f5cd0055c7618a9fa7d897"/> + <dataarea name="cass" size="1056924"> + <rom name="frogger (1984)(boldfield computing)[16k].wav" size="1056924" crc="6a42d361" sha1="e6860dd3be37b0b8af633c3daaea68a835be4a1a"/> </dataarea> </part> </software> @@ -841,6 +896,7 @@ <description>Frogger (Plasma Software, Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load frogger g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="10966"> <rom name="frogger (1984)(plasma software)(gb)[unreleased][19k].tap" size="10966" crc="6af2e369" sha1="679e668b89894e309f5228e160f2e6b503f00132"/> @@ -848,10 +904,11 @@ </part> </software> - <software name="fungle" supported="no"> - <description>Fungle Monster (Prototype)</description> + <software name="fungle"> + <description>Fungle Monsters (Prototype)</description> <year>1983</year> <publisher>Voyager Software</publisher> + <info name="usage" value="load FU run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="7919"> <rom name="fungle monster (1983)(voyager software)(gb)[unreleased][19k].tap" size="7919" crc="f4bb53ba" sha1="49b215354d243a8a9bae560e0309a4fba8a328e1"/> @@ -902,21 +959,23 @@ </part> </software> - <software name="gobbgook" supported="no"> + <software name="gobbgook"> <description>Gobbledegook</description> <year>1983</year> <publisher>Jupiter Cantab</publisher> + <info name="usage" value="load gobblegook gobblegook" /> <part name="cass1" interface="jupace_cass"> - <dataarea name="cass" size="9369"> - <rom name="gobbledegook (1983)(jupiter cantab)(gb)[19k].tap" size="9369" crc="6f2300c1" sha1="176b5fc9e7e82a7350cd62ad5a118ed76e019ec6"/> + <dataarea name="cass" size="1204556"> + <rom name="gobbledegook (1983)(jupiter cantab)[19k].wav" size="1204556" crc="058a888d" sha1="70fb714a710cfd4cabe9a6ff3d5901114f71c6ac"/> </dataarea> </part> </software> - <software name="grandprx" supported="no"> + <software name="grandprx" supported="no"><!-- Error 7 --> <description>Grandprix (Prototype)</description> <year>1983</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load grandprix g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="9891"> <rom name="grandprix (1983)(plasma software)(gb)(alpha)[unreleased][19k].tap" size="9891" crc="6c9bc237" sha1="d5cc3ff3b07a3709efbd735c9eedb86feba269f6"/> @@ -953,10 +1012,11 @@ </part> </software> - <software name="grexfrog" supported="no"> + <software name="grexfrog"> <description>Green X Frog</description> <year>1982</year> <publisher>Hi-Tech Microsoft</publisher> + <info name="usage" value="load graphics load run grf run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1050"> <rom name="green x frog (1982)(hi-tech microsoft)(gb)[3k].tap" size="1050" crc="4aa7cdfc" sha1="cdeeb7a645e4d08d8af5c866a9f73a9f67aa78ba"/> @@ -964,10 +1024,11 @@ </part> </software> - <software name="guessing" supported="no"> + <software name="guessing"> <description>Guessing Game</description> <year>1983</year> <publisher>Practical Computing</publisher> + <info name="usage" value="load game game" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="557"> <rom name="guessing game (1983-05)(practical computing)(gb)[3k].tap" size="557" crc="23b22442" sha1="46c96e4b48cb13fa2eeeca88119401561152c5d5"/> @@ -979,6 +1040,7 @@ <description>HDRmon</description> <year>2007</year> <publisher>Edwin Blink</publisher> + <info name="usage" value="load HDRMON go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="272"> <rom name="hdrmon (2007)(blink, edwin)(pd)[3k].tap" size="272" crc="d0e2b2fb" sha1="84e2bafdfba36b3c580dde45383425c7d6d9119f"/> @@ -990,6 +1052,7 @@ <description>Invaders (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load invaders g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="11341"> <rom name="invaders (1984)(plasma software)(gb)[unreleased][19k].tap" size="11341" crc="84754081" sha1="0b7d720308d642cbc01c36f9ae440bd8b3d32eec"/> @@ -1001,6 +1064,7 @@ <description>Jumpman</description> <year>1984</year> <publisher>Callisto Software</publisher> + <info name="usage" value="load jumpman start. Start = S, movement keys are Z,X,N,M" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="8735"> <rom name="jumpman (1984)(callisto software)[32k].tap" size="8735" crc="de04b476" sha1="94aea64e9f67bd936028b559a5824f3d6d9322a0"/> @@ -1008,10 +1072,11 @@ </part> </software> - <software name="kkong" supported="no"> + <software name="kkong"> <description>Krazy Kong (Prototype)</description> <year>198?</year> <publisher>Voyager Software</publisher> + <info name="usage" value="load CHARACTERS CHARACTERS load KONG run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="8243"> <rom name="krazy kong (19xx)(voyager software)(gb)[unreleased][19k].tap" size="8243" crc="ddd263b6" sha1="36f9be4b58c76f68791fefa228c610a3db2b2d53"/> @@ -1023,6 +1088,7 @@ <description>Life (Julian Skidmore)</description> <year>2006</year> <publisher>Julian Skidmore</publisher> + <info name="usage" value="load life13 life" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="7597"> <rom name="life (2006)(skidmore, julian)(pd)[19k].tap" size="7597" crc="fd48c670" sha1="1ed3e807aca1d6b58551b5761f6a747fe2f6a0f4"/> @@ -1059,10 +1125,11 @@ </part> </software> - <software name="lightrac" supported="no"> + <software name="lightrac"> <description>Light Racer (Prototype)</description> <year>1983</year> <publisher>Brian Bates</publisher> + <info name="usage" value="load LightRacer run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="7770"> <rom name="light racer (1983-10)(bates, brian)[unreleased][19k].tap" size="7770" crc="24f5efc0" sha1="b7cd8e6fd4c191df907960caf66df1c85e994e33"/> @@ -1074,6 +1141,7 @@ <description>Loader</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load loader" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="212"> <rom name="loader (1983-03-01)(popular computing weekly)(gb)[3k].tap" size="212" crc="89cf2815" sha1="89b7a6d38399e67943ab5c87499e005f47706949"/> @@ -1085,6 +1153,7 @@ <description>Lunar Lander</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load ll ll" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="591"> <rom name="lunar lander (1983-04-21)(popular computing weekly)(gb)[3k].tap" size="591" crc="d2ed39d2" sha1="45ba6c6291df27a4b7be5f1b4aa5312cec0d05a3"/> @@ -1092,10 +1161,11 @@ </part> </software> - <software name="memstars" supported="no"> + <software name="memstars"> <description>Memory Stars</description> <year>1982</year> <publisher>Hi-Tech Microsoft</publisher> + <info name="usage" value="load run run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="819"> <rom name="memory stars (1982)(hi-tech microsoft)(gb)[3k].tap" size="819" crc="a4075ebe" sha1="236cf7ca47a5ee18dd9e871fc6218df9d5b1332f"/> @@ -1103,10 +1173,11 @@ </part> </software> - <software name="meteor" supported="no"> + <software name="meteor"> <description>Meteor</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load gr meteor load meteor game" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="751"> <rom name="meteor (1983-03-24)(popular computing weekly)(gb)[3k].tap" size="751" crc="d468a6bd" sha1="58259d1409c84425009b64084ed1eb7b8cdb49fc"/> @@ -1114,10 +1185,11 @@ </part> </software> - <software name="metracer" supported="no"> + <software name="metracer"> <description>Meteor Racer</description> <year>1983</year> <publisher>Forth Dimension</publisher> + <info name="usage" value="load GR load GR load GR load GM load GM z p" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="3441"> <rom name="meteor racer (1983)(forth dimension)[1k].tap" size="3441" crc="653ceffd" sha1="04518005d92668be718ce60608ccc5664826348c"/> @@ -1125,10 +1197,11 @@ </part> </software> - <software name="meteors" supported="no"> + <software name="meteors"> <description>Meteors (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load asteroids g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="10481"> <rom name="meteors (1984)(plasma software)(gb)[unreleased][19k].tap" size="10481" crc="e4453013" sha1="46e128fe0bd7a8d6a59d4bde99c95747cdc58a05"/> @@ -1136,10 +1209,11 @@ </part> </software> - <software name="micromaz" supported="no"> + <software name="micromaz"> <description>Micro Maze</description> <year>1982</year> <publisher>Hi-Tech Microsoft</publisher> + <info name="usage" value="load graphics load run s run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="2903"> <rom name="micro maze (1982)(hi-tech microsoft)(gb)[3k].tap" size="2903" crc="d19ff48a" sha1="cf21c6fd5bc41819e1ecea67612420457bb90bb3"/> @@ -1147,10 +1221,11 @@ </part> </software> - <software name="minefld" supported="no"> + <software name="minefld"> <description>Minefield</description> <year>1983</year> <publisher>Micro Marketing</publisher> + <info name="usage" value="11272 0 bload mchars load minefield m" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="839"> <rom name="minefield (1983)(micro marketing)(gb)[3k].tap" size="839" crc="dc70bee6" sha1="6245ed5e8c97ef22189c874dfc1c703c36d21922"/> @@ -1220,6 +1295,7 @@ <description>Moon Buggy (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load moonbuggy g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="16986"> <rom name="moon buggy (1984)(plasma software)(gb)[unreleased][19k].tap" size="16986" crc="8a824119" sha1="1673d33bc78223f28ff2cf85a52a9d0f3d4a9f1a"/> @@ -1231,6 +1307,7 @@ <description>Morse Code Tutor</description> <year>198?</year> <publisher><unknown></publisher> + <info name="usage" value="load morse_tuto go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1265"> <rom name="morse code tutor (19xx)(-)[19k].tap" size="1265" crc="e39c1d77" sha1="89ecfb6831c1cfe4d2d96888e9a41cad46f096a3"/> @@ -1260,10 +1337,11 @@ </part> </software> - <software name="othello" supported="no"> + <software name="othello"> <description>Othello</description> <year>1983</year> <publisher>Jupiter Cantab</publisher> + <info name="usage" value="load othello 11272 0 bload pieces go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="2686"> <rom name="othello (1983)(jupiter cantab)(gb)[19k].tap" size="2686" crc="52c4d4a8" sha1="2bf56bb00593c812122e6cdcce30e20ddec620a3"/> @@ -1289,10 +1367,11 @@ </part> </software> - <software name="owler" supported="no"> + <software name="owler"> <description>Owler</description> <year>1984</year> <publisher>Callisto Software</publisher> + <info name="usage" value="load owler loading" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14885"> <rom name="owler (1984)(callisto software)[32k].tap" size="14885" crc="7e93c42f" sha1="893dc5a34ab3a4c260304ade09191a24fc08d33b"/> @@ -1318,10 +1397,11 @@ </part> </software> - <software name="quickdrw" supported="no"> + <software name="quickdrw"> <description>Quick-Draw (Prototype)</description> <year>1983</year> <publisher>Brian Bates</publisher> + <info name="usage" value="load quick-draw go" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14757"> <rom name="quick-draw (1983-11)(bates, brian)[unreleased][19k].tap" size="14757" crc="a7ee7cfe" sha1="dd5c530defde838bdc4a02cdf8b168864d6ad971"/> @@ -1329,10 +1409,11 @@ </part> </software> - <software name="quickdrp" supported="no"> + <software name="quickdrp"> <description>Quick-Draw Practice (Prototype)</description> <year>1983</year> <publisher>Brian Bates</publisher> + <info name="usage" value="load Qdraw run" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="15106"> <rom name="quick-draw practice (1983-11)(bates, brian)[unreleased][19k].tap" size="15106" crc="32b350e4" sha1="5c5e2bc35bf96f226076ef8a5cb9ce735921bb86"/> @@ -1340,10 +1421,11 @@ </part> </software> - <software name="robohnch" supported="no"> + <software name="robohnch"> <description>Robohench (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load robohench g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14200"> <rom name="robohench (1984)(plasma software)(gb)[unreleased][19k].tap" size="14200" crc="77b2fb21" sha1="df8ce9460aa1129cdaa3c479f28496df28b6920e"/> @@ -1351,10 +1433,11 @@ </part> </software> - <software name="robohunt" supported="no"> + <software name="robohunt"> <description>Robohunt (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load robohunt g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="15678"> <rom name="robohunt (1984)(plasma software)(gb)[unreleased][19k].tap" size="15678" crc="e80c6db2" sha1="b5f82d7aa494fda7af6d6a096aac28fa1bfae16e"/> @@ -1362,10 +1445,11 @@ </part> </software> - <software name="sailhorn" supported="no"> + <software name="sailhorn"> <description>Sallors' Hornpipe</description> <year>1982</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load hornpipe hornpipe" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="715"> <rom name="sallors' hornpipe (1982-12-16)(popular computing weekly)(gb)[3k].tap" size="715" crc="770a5f4d" sha1="faca2f968632c04d46c7a46bc412b697f14cc85e"/> @@ -1373,10 +1457,11 @@ </part> </software> - <software name="sambombs" supported="no"> + <software name="sambombs"> <description>Sam and the Time Bombs (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load sam g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="12654"> <rom name="sam and the time bombs (1984)(plasma software)(gb)[unreleased][19k].tap" size="12654" crc="edc5d37a" sha1="65289d38c4f902805edef5750247d231d42ef2ab"/> @@ -1388,6 +1473,7 @@ <description>Scrambler</description> <year>1982</year> <publisher>Electronics & Computing</publisher> + <info name="usage" value="load scrambler" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="729"> <rom name="scrambler (1982-05)(electronics & computing)(gb)[3k].tap" size="729" crc="7a06c3bc" sha1="d0d1082b230633950535de09df4f2da575a38b7c"/> @@ -1417,7 +1503,7 @@ </part> </software> - <software name="m_snake"> <!-- was there a side B? --> + <software name="m_snake" supported="no"> <!-- was there a side B? --> <description>Snake + Superbat</description> <year>1985</year> <publisher>Waylandsoft</publisher> @@ -1435,10 +1521,11 @@ </part> </software> - <software name="sokoace" supported="no"> + <software name="sokoace"> <description>SokoACE</description> <year>2006</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load sokoace play" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14367"> <rom name="sokoace (2006)(lopes, ricardo fernandes)(pd)[19k].tap" size="14367" crc="b02e398d" sha1="fcda8a2a50ca573d972cc635204fe36ed2cc4f4b"/> @@ -1446,10 +1533,11 @@ </part> </software> - <software name="sacemap" supported="no"> + <software name="sacemap"> <description>SokoACE Map Editor</description> <year>2006</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load sokoed ed" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="2160"> <rom name="sokoace map editor (2006)(lopes, ricardo fernandes)(pd)[19k].tap" size="2160" crc="76a356e5" sha1="5f80ea127fd48e4d442cc46061dad30e2e4df1c7"/> @@ -1457,10 +1545,11 @@ </part> </software> - <software name="sbattle" supported="no"> + <software name="sbattle"> <description>Space Battle</description> <year>1982</year> <publisher>Hi-Tech Microsoft</publisher> + <info name="usage" value="load graphics load run gr run. Fire = F" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1224"> <rom name="space battle (1982)(hi-tech microsoft)(gb)[3k].tap" size="1224" crc="1569208e" sha1="b53fedd4b227ab995a15f64b595ba2a124e57062"/> @@ -1472,6 +1561,7 @@ <description>Spreadsheet</description> <year>1984</year> <publisher>Boldfield Computing</publisher> + <info name="usage" value="load s" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="9882"> <rom name="spreadsheet (1984)(boldfield computing)(gb)[19k].tap" size="9882" crc="df789644" sha1="53a4545d04ebadbea98797684bac261a0a5b6b81"/> @@ -1479,10 +1569,11 @@ </part> </software> - <software name="startrek" supported="no"> + <software name="startrek"> <description>Star Trek</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load startrek g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14756"> <rom name="star trek (1984)(plasma software)(gb)[unreleased][19k].tap" size="14756" crc="6d084e74" sha1="53450a452cdf9b7fd70f1ef9539ff1ec581043ea"/> @@ -1490,10 +1581,11 @@ </part> </software> - <software name="sudoku" supported="no"> + <software name="sudoku"> <description>Sudoku</description> <year>2007</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load sudoku sudoku" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="3887"> <rom name="sudoku (2007)(lopes, ricardo fernandes)(pd)[19k].tap" size="3887" crc="a994a6fd" sha1="e1915263651eae3d5a953aa9f8f8cb39b9d31f0c"/> @@ -1501,10 +1593,23 @@ </part> </software> - <software name="tankbatl" supported="no"> + <software name="surround"> + <description>Forth Surround</description> + <year>1983</year> + <publisher>Your Computer</publisher> + <info name="usage" value="load surround go" /> + <part name="cass1" interface="jupace_cass"> + <dataarea name="cass" size="450618"> + <rom name="forth surround (1983-06)(your computer)[3k]" size="450618" crc="11cfef0d" sha1="aece6398f52f8ba159111846a4c6885dd92f4629"/> + </dataarea> + </part> + </software> + + <software name="tankbatl"> <description>Tank Battle (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load tankbattle g" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="14380"> <rom name="tank battle (1984)(plasma software)(gb)[unreleased][19k].tap" size="14380" crc="27b07d5d" sha1="12448adfad4e0ab5abacd0f9c7f8d6852cad567d"/> @@ -1516,6 +1621,7 @@ <description>Teach Yourself Forth on the Jupiter Ace</description> <year>1982</year> <publisher>Viscount</publisher> + <info name="usage" value="load forth" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="18676"> <rom name="teach yourself forth on the jupiter ace (1982)(viscount)[3k].tap" size="18676" crc="85aecda2" sha1="2ef64991e6a961a9942a7442d0d49003741c015a"/> @@ -1523,10 +1629,11 @@ </part> </software> - <software name="tetris" supported="no"> + <software name="tetris"> <description>Tetris</description> <year>2009</year> <publisher>Jupiter Ace Archive Team</publisher> + <info name="usage" value="load tetris tetris" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="1398"> <rom name="tetris (2009)(jupiter ace archive team)(gb)(pd)[19k].tap" size="1398" crc="f4b103d4" sha1="a7f264ec1375cc2befc64203f516ae5861bda40b"/> @@ -1552,10 +1659,11 @@ </part> </software> - <software name="hanoi" supported="no"> + <software name="hanoi"> <description>Towers of Hanoi</description> <year>2006</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load hanoi hanoi" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="835"> <rom name="towers of hanoi (2006)(lopes, ricardo fernandes)(pd)[3k].tap" size="835" crc="43c2ed79" sha1="6be70c75aaf9f6f548e29e8f874208d455d065c7"/> @@ -1587,10 +1695,11 @@ </part> </software> - <software name="turbo" supported="no"> + <software name="turbo"> <description>Turbo (Prototype)</description> <year>1984</year> <publisher>Plasma Software</publisher> + <info name="usage" value="load turbo 0 0 bload track turbo. Left = 5, Right = 6" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="16958"> <rom name="turbo (1984)(plasma software)(gb)[unreleased][19k].tap" size="16958" crc="b1d5aad0" sha1="6f23ddf66bcd4cb6a7bfc0f2b88b6282e7136a2e"/> @@ -1694,6 +1803,7 @@ <description>Valkyr + Life (Prototype)</description> <year>1985</year> <publisher>Colinsoft</publisher> + <info name="usage" value="load valkyr go" /><!-- computer reboots when starting the game, bad dump? --> <part name="cass1" interface="jupace_cass"> <feature name="part_id" value="Tape 1 (Valkyr)"/> <dataarea name="cass" size="12855"> @@ -1712,6 +1822,7 @@ <description>Words</description> <year>1983</year> <publisher>Popular Computing Weekly</publisher> + <info name="usage" value="load words" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="217"> <rom name="words (1983-10-27)(popular computing weekly)(gb)[3k].tap" size="217" crc="26dde89c" sha1="7160df6c1014124467482843f8df4165a083bcab"/> @@ -1723,6 +1834,7 @@ <description>WRD</description> <year>2006</year> <publisher>Ricardo Fernandes Lopes</publisher> + <info name="usage" value="load wrd" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="614"> <rom name="wrd (2006)(lopes, ricardo fernandes)(pd)[3k].tap" size="614" crc="11dfa38f" sha1="ece1603e9e81093092aae91fcf19b7d45b9496cb"/> @@ -1730,10 +1842,11 @@ </part> </software> - <software name="zapem" supported="no"> + <software name="zapem"> <description>Zapem</description> <year>1983</year> <publisher>Micro Marketing</publisher> + <info name="usage" value="11272 0 bload zchars load zapem z. Left = 6, Right = 7, 9 = Thrust, 0 = Fire" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="943"> <rom name="zapem (1983)(micro marketing)(gb)[3k].tap" size="943" crc="f14dcfec" sha1="8f60e73a34ec2f967caffd37e9cc6d2c44b919c8"/> @@ -1741,10 +1854,11 @@ </part> </software> - <software name="zombies" supported="no"> - <description>Zombies & Potholes</description> + <software name="zombies"> + <description>Zombies and Potholes</description> <year>1983</year> <publisher>Jupiter Cantab</publisher> + <info name="usage" value="load zombpot zombpot" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="7961"> <rom name="zombies & potholes (1983)(jupiter cantab)(gb)[19k].tap" size="7961" crc="3a60a598" sha1="bc26562c10583be35e322dbdad666d19b7e27822"/> @@ -1756,6 +1870,7 @@ <description>ZX Printer Driver</description> <year>1983</year> <publisher>Remsoft</publisher> + <info name="usage" value="load zx-printer" /> <part name="cass1" interface="jupace_cass"> <dataarea name="cass" size="2882"> <rom name="zx printer driver (1983)(remsoft)(gb)[tape 11][3k].tap" size="2882" crc="ed237c12" sha1="76f10c96a056edc1151a24f9e87209ec379b73d5"/> diff --git a/hash/jupace_snap.xml b/hash/jupace_snap.xml new file mode 100644 index 00000000000..a63c63a1476 --- /dev/null +++ b/hash/jupace_snap.xml @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<!-- + +Created by Robbbert on 2020-01-14. + +There are many more .ace files, but they duplicate the ones already in jupace_cass.xml + +NOTES: + * It is recommended to run with 32k of ram (-ram 32k) + +--> + +<softwarelist name="jupace_snap" description="Jupiter Cantab Jupiter Ace snapshots"> + <software name="briques"> + <description>Casse Briques</description> + <year>1983</year> + <publisher>ERE</publisher> + <info name="usage" value="Press Enter" /><!-- n jeu, where n = number of lives --> + <part name="snap" interface="jupace_snap"> + <dataarea name="snap" size="2572"> + <rom name="casse briques (1983)(ere)(fr)[3k].ace" size="2572" crc="d2bc5b51" sha1="bcbee732478b8be742996b7af42330c6666472e2"/> + </dataarea> + </part> + </software> + <software name="mines"> + <description>Champs De Mines</description> + <year>1983</year> + <publisher>ERE</publisher> + <info name="usage" value="Press Enter" /><!-- n jeu, where n = number of mines times 10 --> + <part name="snap" interface="jupace_snap"> + <dataarea name="snap" size="2768"> + <rom name="champs de mines (1983)(ere)(fr)[3k].ace" size="2768" crc="f6249f68" sha1="b9fc39c03472d122cd8056fb1716185c4c2f433d"/> + </dataarea> + </part> + </software> + <software name="milliped"> + <description>Millipede</description> + <year>1983</year> + <publisher>Your Computer</publisher> + <info name="usage" value="Type milliped and press Enter" /> + <part name="snap" interface="jupace_snap"> + <dataarea name="snap" size="4166"> + <rom name="millipede (1983-04)(your computer)[3k].ace" size="4166" crc="466ff760" sha1="620674685ecffeae221cc5dc7c4ceb9e7894d0d1"/> + </dataarea> + </part> + </software> + <software name="pacman"> + <description>Pacman</description> + <year>1983</year> + <publisher>Your Computer</publisher> + <info name="usage" value="The playfield shows by itself, type run and press Enter" /> + <part name="snap" interface="jupace_snap"> + <dataarea name="snap" size="3197"> + <rom name="pacman (1983-03)(your computer)[3k].ace" size="3197" crc="68d096a9" sha1="e0b654ebca9fe8c32143335daf23bf4075781e68"/> + </dataarea> + </part> + </software> + <software name="valkyr"> + <description>Valkyr</description> + <year>1985</year> + <publisher>Colinsoft</publisher> + <part name="snap" interface="jupace_snap"> + <dataarea name="snap" size="22763"> + <rom name="valkyr.ace" size="22763" crc="3f1bee9e" sha1="85dec67ffdf542102eb89065b60f396825d5cd73"/> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/leapfrog_leappad_cart.xml b/hash/leapfrog_leappad_cart.xml index 5b68b7a31a6..a31bcd7bec9 100644 --- a/hash/leapfrog_leappad_cart.xml +++ b/hash/leapfrog_leappad_cart.xml @@ -432,6 +432,51 @@ </part> </software> + <software name="wasistdas" supported="no"> + <description>Was ist das? von Richard Scarry (Germany)</description> + <year>1991</year> + <publisher>LeapFrog</publisher> + <info name="serial" value="500-10632 UBL"/> + <part name="cart" interface="leapfrog_leappad_cart"> + <feature name="pcb" value="57000-003-2612"/> + <feature name="pcb_rev" value="REV.01"/> + <feature name="u1" value="Sunplus16m-b"/> <!-- ROM on epoxy blob, but type silkscreened on the PCB --> + <dataarea name="rom" size="2097152"> + <rom name="was ist das von richard scarry.u1" size="2097152" crc="744cd1f4" sha1="797b9856ef6f96c92978303c6604c2f1ae2e9278" /> + </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="47060702" crc="b6a82c67" sha1="ee6dd6a64b8c876298d4d987ec0944b94601a36d" offset="0"/> + <rom name="0 - 0002.png" size="25273650" crc="951c77cf" sha1="901996b902f3954442d76924c3f33930e98cc21c" offset="0"/> + <rom name="0 - 0003.png" size="21119566" crc="85eacf2a" sha1="1bc18385434c23e247024ad950b4cadb87339dba" offset="0"/> + <rom name="0 - 0004.png" size="23684992" crc="2503c7b7" sha1="4320c484aaac5f49806bc1e0b2bd9108f32983c5" offset="0"/> + <rom name="0 - 0005.png" size="16347289" crc="689fea33" sha1="a2ace0a653fb132dc881e3576e51d39815ae6692" offset="0"/> + <rom name="0 - 0006.png" size="20184694" crc="55c2631a" sha1="6112afe98bfffb07281eab4c414926ff5144d903" offset="0"/> + <rom name="0 - 0007.png" size="17069814" crc="d3da8753" sha1="9311060be82ff98510730e2c923553c9fbb8a402" offset="0"/> + <rom name="0 - 0008.png" size="20251214" crc="20d001ea" sha1="d0d842e629157ee9c04c3c5796dac2fb636aaaee" offset="0"/> + <rom name="0 - 0009.png" size="14417135" crc="0c5a396e" sha1="d33624061891bf2b672f1d9f694c2b80ce01c7f4" offset="0"/> + <rom name="0 - 0010.png" size="17065831" crc="6eec4dc4" sha1="e876d9d23966e6e6c158ccffd32e4af3702d8bd1" offset="0"/> + <rom name="0 - 0011.png" size="11769417" crc="01e751b3" sha1="65ed32fffb2c3ab672196276321bd77a1fdfce10" offset="0"/> + <rom name="0 - 0012.png" size="19156970" crc="4e8e9639" sha1="2c69d7604b2aec35792973b858f816d216630b78" offset="0"/> + <rom name="0 - 0013.png" size="13617241" crc="17c4c1b7" sha1="b352a0fdfe39e30b513f2fefbd17b387571fb896" offset="0"/> + <rom name="0 - 0014.png" size="19519693" crc="58d0c36d" sha1="c65c06cf0a43f048d5a655bfd83ef86ccc03e644" offset="0"/> + <rom name="0 - 0015.png" size="13695576" crc="1ea8d254" sha1="fc782a5c28c2d2f11e3ad803c540d0b70f80e7ee" offset="0"/> + <rom name="0 - 0016.png" size="39894997" crc="46baaee6" sha1="4a18348852b6b6c23079ef200841b31ff894c6f1" offset="0"/> + <rom name="0 - 0017.png" size="40640147" crc="fc126222" sha1="1b59abd6e5a149e9bc610faf8bb71d17505429f9" offset="0"/> + <rom name="0 - 0018.png" size="39072330" crc="aab0e703" sha1="0c289ed02b67e2c363ca6739610cce5020514d13" offset="0"/> + <rom name="0 - 0019.png" size="24086990" crc="5de8bd88" sha1="13fa33a7ee5a77376f13ab5bbe4aaeb402c1c1ed" offset="0"/> + <rom name="0 - 0020.png" size="39366368" crc="65733694" sha1="033aac7aa5eb363c0da79fa0c4cc6b5b709b48fc" offset="0"/> + <rom name="0 - 0021.png" size="40358358" crc="811c493f" sha1="73d4a9c0b1b1edd0948982ef10e9e1941df5b119" offset="0"/> + <rom name="0 - 0022.png" size="18932594" crc="c56192cc" sha1="53145f204d60ecb79cdb93adfec34d500bb87047" offset="0"/> + <rom name="0 - 0023.png" size="11137648" crc="6692a2ed" sha1="73db4445496762789924e1d11b5f72feccccf344" offset="0"/> + <rom name="0 - 0024.png" size="20025564" crc="7c353906" sha1="07b77c67cb00fe46c4a0faad9bed8cc0b92fad42" offset="0"/> + <rom name="0 - 0025.png" size="14524148" crc="35cc0d4f" sha1="df7de27fdeb6ba16ad4fce84a488ce9fb3f04625" offset="0"/> + <rom name="0 - 0026.png" size="17479017" crc="c96927ed" sha1="24e7009718d17edf0998513f0f5d9557a543501c" offset="0"/> + <rom name="0 - 0027.png" size="19269004" crc="558a4f8a" sha1="3e437166e81016951c1effbe266b2d740dcc48e4" offset="0"/> + <rom name="0 - 0028.png" size="43628166" crc="d0b6e2da" sha1="d39d77c7965dbe271ad7e15d124fbccf4e04da0b" offset="0"/> + </dataarea> + </part> + </software> + <software name="dinosaurg" cloneof="dinosaur" supported="no"> <description>Leap und die Welt der Dinosaurier (Germany)</description> <year>2004</year> diff --git a/hash/leapfrog_ltleappad_cart.xml b/hash/leapfrog_ltleappad_cart.xml index e1622d9a82d..3f9a239eb73 100644 --- a/hash/leapfrog_ltleappad_cart.xml +++ b/hash/leapfrog_ltleappad_cart.xml @@ -7,7 +7,7 @@ <year>2003</year> <publisher>LeapFrog</publisher> <info name="serial" value="500-10247"/> - <part name="cart" interface="leapfrog_mfleappad_cart"> <!-- change interface to "leapfrog_ltleappad_cart" once the Little Touch BIOS is dumped and added --> + <part name="cart" interface="leapfrog_ltleappad_cart"> <feature name="pcb" value="CT337V0"/> <feature name="pcb_rev" value="1A"/> <feature name="u1" value="Macronix ROM: MX23L3210"/> <!-- ROM on epoxy blob, but type silkscreened on the PCB --> @@ -22,7 +22,7 @@ <year>2004</year> <publisher>LeapFrog</publisher> <info name="serial" value="500-11375"/> - <part name="cart" interface="leapfrog_mfleappad_cart"> <!-- change interface to "leapfrog_ltleappad_cart" once the Little Touch BIOS is dumped and added --> + <part name="cart" interface="leapfrog_ltleappad_cart"> <feature name="pcb" value="CT205V6"/> <feature name="pcb_rev" value="1A"/> <feature name="u1" value="Sunplus 16MBit ROM: SPR1600A"/> <!-- ROM on epoxy blob, but type silkscreened on the PCB --> @@ -37,7 +37,7 @@ <year>2003</year> <publisher>LeapFrog</publisher> <info name="serial" value="500-11468"/> - <part name="cart" interface="leapfrog_mfleappad_cart"> <!-- change interface to "leapfrog_ltleappad_cart" once the Little Touch BIOS is dumped and added --> + <part name="cart" interface="leapfrog_ltleappad_cart"> <feature name="pcb" value="CT316V0"/> <feature name="pcb_rev" value="1A"/> <feature name="u1" value="Sunplus ROM: SPR32100A"/> <!-- ROM on epoxy blob, but type silkscreened on the PCB --> diff --git a/hash/lynx.xml b/hash/lynx.xml index ab05445ba04..5b9df4dff39 100644 --- a/hash/lynx.xml +++ b/hash/lynx.xml @@ -1084,17 +1084,6 @@ Known undumped prototypes: </part> </software> - <software name="dragnet"> - <description>Dragnet Sound Demo</description> - <year>1995</year> - <publisher><unknown></publisher> - <part name="cart" interface="lynx_cart"> - <dataarea name="rom" size="262144"> - <rom name="dragnet (1995).bin" size="262144" crc="5598a4c9" sha1="fc802b8b6a62312e6f68065881d0e4f23a967451" offset="000000" /> - </dataarea> - </part> - </software> - <!-- Quoting the dev: "Zow started as a collection of sound and graphics demos. It was killed when someone who had no right to, released a version to the 'net" --> <software name="conquest"> <description>Conquest of Zow</description> @@ -1108,6 +1097,17 @@ Known undumped prototypes: </part> </software> + <software name="dragnet"> + <description>Dragnet Sound Demo</description> + <year>1995</year> + <publisher><unknown></publisher> + <part name="cart" interface="lynx_cart"> + <dataarea name="rom" size="262144"> + <rom name="dragnet (1995).bin" size="262144" crc="5598a4c9" sha1="fc802b8b6a62312e6f68065881d0e4f23a967451" offset="000000" /> + </dataarea> + </part> + </software> + <software name="lynx2tst"> <description>Lynx II Production Test Program V0.02 (Prototype)</description> <year>19??</year> @@ -1119,6 +1119,17 @@ Known undumped prototypes: </part> </software> + <software name="weltensc"> + <description>Weltenschlächter</description> + <year>2016</year> + <publisher>Luchs Soft</publisher> + <part name="cart" interface="lynx_cart"> + <dataarea name="rom" size="524288"> + <rom name="weltenschlacht.lyx" size="524288" crc="a0c59271" sha1="dbba003684efe249b6f17a070b3b008b09c67d3f" offset="000000" /> + </dataarea> + </part> + </software> + <software name="zaku"> <description>Zaku</description> <year>2009</year> diff --git a/hash/megadriv.xml b/hash/megadriv.xml index c9b2f35f78b..25275af7118 100644 --- a/hash/megadriv.xml +++ b/hash/megadriv.xml @@ -25099,6 +25099,52 @@ Notice that these are not working on real hardware due to bugged code with VDP i </part> </software> + <software name="sonic2p9" cloneof="sonic2"> + <description>Sonic the Hedgehog 2 (World, prototype 19920821)</description> + <year>1992</year> + <publisher>Sega</publisher> + <part name="cart" interface="megadriv_cart"> + <dataarea name="rom" width="16" endianness="big" size="1048576"> + <rom loadflag="load16_byte" name="md sonic 2 0 21.8 alpha.eprom" size="131072" crc="53c60603" sha1="70e3c828a8553d44d9d7713a61a667d492cd059f" offset="0x000001"/> + <rom loadflag="load16_byte" name="md sonic 2 1 21.8 alpha.eprom" size="131072" crc="a63f55a2" sha1="1d490b7de709372fae0444d1ee371fb3bf93e0e4" offset="0x000000"/> + <rom loadflag="load16_byte" name="md sonic 2 2 21.8 alpha.eprom" size="131072" crc="4399cf0a" sha1="c501bcb7b235b5e83d3b21d49e3336332e676690" offset="0x040001"/> + <rom loadflag="load16_byte" name="md sonic 2 3 21.8 alpha.eprom" size="131072" crc="f3af68eb" sha1="5831013831662d2116723ae94250871bc71e7f83" offset="0x040000"/> + <rom loadflag="load16_byte" name="md sonic 2 4 21.8 alpha.eprom" size="131072" crc="457292ef" sha1="074134e9ab0b0848a51a17726e91d69cdb24ecce" offset="0x080001"/> + <rom loadflag="load16_byte" name="md sonic 2 5 21.8 alpha.eprom" size="131072" crc="6f66f6ad" sha1="8a4692be96940a8752a9bcbb97921810927dd62f" offset="0x080000"/> + <rom loadflag="load16_byte" name="md sonic 2 6 21.8 alpha.eprom" size="131072" crc="b83b188c" sha1="e8ba63b92ffcc19c8913d0a7de051972b392f535" offset="0x0c0001"/> + <rom loadflag="load16_byte" name="md sonic 2 7 21.8 alpha.eprom" size="131072" crc="4e40d221" sha1="3a8e66fd5e8408f284c7a687f6a3926a43416f08" offset="0x0c0000"/> + </dataarea> + </part> + </software> + + <software name="sonic2p10" cloneof="sonic2"> + <description>Sonic the Hedgehog 2 (World, prototype 19920914)</description> + <year>1992</year> + <publisher>Sega</publisher> + <part name="cart" interface="megadriv_cart"> + <dataarea name="rom" width="16" endianness="big" size="1048576"> + <rom loadflag="load16_byte" name="md s2 0 14.9. pre beta.eprom" size="262144" crc="d56757fe" sha1="5d48a511ed9f1ba9e2bb99d109ef261e5868f5a5" offset="0x000001"/> + <rom loadflag="load16_byte" name="md s2 1 14.9. pre beta.eprom" size="262144" crc="3b62957a" sha1="cff4baf78c950f1e9960e944af8d79459b777f7d" offset="0x000000"/> + <rom loadflag="load16_byte" name="md s2 2 14.9. pre beta.eprom" size="262144" crc="27415f0f" sha1="ee8c51c84e413b084d07b1a6531ee3572dfc6c2d" offset="0x080001"/> + <rom loadflag="load16_byte" name="md s2 3 14.9. pre beta.eprom" size="262144" crc="36323522" sha1="6c9a7a4712b16fb4f65c34b3ab8551ff173df24f" offset="0x080000"/> + </dataarea> + </part> + </software> + + <software name="sonic2p11" cloneof="sonic2"> + <description>Sonic the Hedgehog 2 (World, final prototype 19921102)</description> + <year>1992</year> + <publisher>Sega</publisher> + <part name="cart" interface="megadriv_cart"> + <dataarea name="rom" width="16" endianness="big" size="1048576"> + <rom name="md sonic2 0 2-11.eprom" size="262144" crc="1f1260f9" sha1="40dd11fb557fc54c0115eb0bf43f090c5b00b200" offset="0x000001" loadflag="load16_byte"/> <!-- MD Sonic2 0 2/11 --> + <rom name="md sonic2 1 2-11.eprom" size="262144" crc="bfa5f8c7" sha1="a54cadff1b49373472a6c2fcd0f7c8c7655a04d7" offset="0x000000" loadflag="load16_byte"/> <!-- MD Sonic2 1 2/11 --> + <rom name="md sonic2 2 2-11.eprom" size="262144" crc="d75b618f" sha1="37276337a7c1516ea3781677e6b2bbe53b27e403" offset="0x080001" loadflag="load16_byte"/> <!-- MD Sonic2 2 2/11 --> + <rom name="md sonic2 3 2-11.eprom" size="262144" crc="c2293c87" sha1="3e467e24c220bd8128c03fb79e45d42d86fcc851" offset="0x080000" loadflag="load16_byte"/> <!-- MD Sonic2 3 2/11 --> + </dataarea> + </part> + </software> + <software name="sonic3pir" cloneof="sonic3"> <description>Sonic the Hedgehog 3 (Pirate)</description> <year>1994?</year> @@ -25149,6 +25195,25 @@ Notice that these are not working on real hardware due to bugged code with VDP i </part> </software> + <software name="sonic3p1" cloneof="sonic3"> + <description>Sonic the Hedgehog 3 (World, prototype 19931103)</description> + <year>1993</year> + <publisher>Sega</publisher> + <part name="cart" interface="megadriv_cart"> + <feature name="slot" value="megadriv_cart"/> + <dataarea name="rom" width="16" endianness="big" size="2097152"> + <rom name="sonic 3 0 md 3-11 2.eprom" size="262144" crc="f1013d40" sha1="dba64a8a12cc8b3a2b92684a4f06df8fc9bbb20e" offset="0x000001" loadflag="load16_byte" /> <!-- Sonic 3 0 MD 3\11 2 --> + <rom name="sonic 3 1 md 3-11 2.eprom" size="262144" crc="87765386" sha1="fb1c803f9a40892a5d4125bfec163f9372357c46" offset="0x000000" loadflag="load16_byte" /> <!-- Sonic 3 1 MD 3\11 2 --> + <rom name="sonic 3 2 md 3-11 2.eprom" size="262144" crc="4e0d637f" sha1="5b8f8048a68b7a41fbaa096742b62eb89a474086" offset="0x080001" loadflag="load16_byte" /> <!-- Sonic 3 2 MD 3\11 2 --> + <rom name="sonic 3 3 md 3-11 2.eprom" size="262144" crc="46546c5b" sha1="f4be05074ee1e883fe99a0a5136989b061f837fd" offset="0x080000" loadflag="load16_byte" /> <!-- Sonic 3 3 MD 3\11 2 --> + <rom name="sonic 3 4 md 3-11 2.eprom" size="262144" crc="4a6f9ad9" sha1="a386d8e7b24d50c4ce6796e240e1595dff1cf1db" offset="0x140001" loadflag="load16_byte" /> <!-- Sonic 3 4 MD 3\11 2 --> + <rom name="sonic 3 5 md 3-11 2.eprom" size="262144" crc="d064c206" sha1="b979be1ce6c7c7accd824146aea50e8cd5ebce5b" offset="0x140000" loadflag="load16_byte" /> <!-- Sonic 3 5 MD 3\11 2 --> + <rom name="sonic 3 6 md 3-11 2.eprom" size="262144" crc="fa68199e" sha1="37104cf987361a1a52edae10a30abdf01c42c129" offset="0x1c0001" loadflag="load16_byte" /> <!-- Sonic 3 6 MD 3\11 2 --> + <rom name="sonic 3 7 md 3-11 2.eprom" size="262144" crc="81987c07" sha1="a5c227ea2b7cd388863b4721ac6989800652dfe7" offset="0x1c0000" loadflag="load16_byte" /> <!-- Sonic 3 7 MD 3\11 2 --> + </dataarea> + </part> + </software> + <software name="sorcerk"> <description>Sorcerer's Kingdom (USA, v1.1)</description> <year>1992</year> @@ -32916,19 +32981,6 @@ This dump is either a bad dump or a wrongly patched one. <dataarea name="rom" width="16" endianness="big" size="0x400000"> <rom name="titan-overdrivemegademo.bin" size="0x3f01be" crc="3deb19a9" sha1="6085182099d6a9ad2c8242eae263507e42269b66"/> </dataarea> - <!-- non-rom extras (should be marked as optional?) --> - <dataarea name="misc" size="0x7af9"> - <rom name="titan-overdrivemegademo.nfo" size="0x7af9" crc="d560530a" sha1="f3a130881878e95a1db6e32268e7b1b001965c1a"/> - </dataarea> - <dataarea name="misc2" size="0x13489c0"> - <rom name="titan-overdrivemegademo_inlay.pdf" size="0x13489c0" crc="ae55e12d" sha1="620fcba1600563b87543b027c42687da7d876b03"/> - </dataarea> - <dataarea name="misc3" size="0xa68cf"> - <rom name="titan-overdrivemegademo_label.pdf" size="0xa68cf" crc="a527c826" sha1="449c945a0ddcbb145c7c92bc01fac543fc1352da"/> - </dataarea> - <dataarea name="misc4" size="0x1c985d"> - <rom name="titan-overdrivemegademo_poster.png" size="0x1c985d" crc="0dfeac10" sha1="cdfd4ff93e199da66cab3ef49d39828f3eb6040c"/> - </dataarea> </part> </software> </softwarelist> diff --git a/hash/mephisto_mm1.xml b/hash/mephisto_mm1.xml index f2455393a5d..b2801768afb 100644 --- a/hash/mephisto_mm1.xml +++ b/hash/mephisto_mm1.xml @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="mephisto_mm1" description="Mephisto MM I Modules"> + <!-- HG 170 module is exclusively used with MM I --> -<softwarelist name="mephisto_mm1" description="Mephisto MM I Modules"> <software name="hg170"> <description>Mephisto HG 170 Opening Library</description> <year>1983</year> @@ -14,4 +15,5 @@ </dataarea> </part> </software> + </softwarelist> diff --git a/hash/mephisto_mm2.xml b/hash/mephisto_mm2.xml index 948b2d09e06..6903a3b0954 100644 --- a/hash/mephisto_mm2.xml +++ b/hash/mephisto_mm2.xml @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="mephisto_mm2" description="Mephisto MM II Modules"> + <!-- HG 240 module is exclusively used with MM II --> -<softwarelist name="mephisto_mm2" description="Mephisto MM II Modules"> <software name="hg240"> <description>Mephisto HG 240 Opening Library</description> <year>1984</year> @@ -14,4 +15,5 @@ </dataarea> </part> </software> + </softwarelist> diff --git a/hash/mephisto_mm4.xml b/hash/mephisto_mm4.xml index 969848881fd..0a84f46ce9c 100644 --- a/hash/mephisto_mm4.xml +++ b/hash/mephisto_mm4.xml @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="mephisto_mm4" description="Mephisto MM IV Modules"> + <!-- HG 440 module is exclusively used with MM IV --> -<softwarelist name="mephisto_mm4" description="Mephisto MM IV Modules"> <software name="hg440"> <description>Mephisto HG 440 Opening Library</description> <year>1987</year> @@ -14,4 +15,5 @@ </dataarea> </part> </software> + </softwarelist> diff --git a/hash/mephisto_mm5.xml b/hash/mephisto_mm5.xml index 1b6b243732f..7223239cbe9 100644 --- a/hash/mephisto_mm5.xml +++ b/hash/mephisto_mm5.xml @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="mephisto_mm5" description="Mephisto MM V Modules"> + <!-- HG 550 module is exclusively used with MM V --> -<softwarelist name="mephisto_mm5" description="Mephisto MM V Modules"> <software name="hg550"> <description>Mephisto HG 550 Opening Library</description> <year>1990</year> @@ -14,4 +15,5 @@ </dataarea> </part> </software> + </softwarelist> diff --git a/hash/smondial2.xml b/hash/mephisto_smondial2.xml index 49ce1ac73ce..170a6e41a70 100644 --- a/hash/smondial2.xml +++ b/hash/mephisto_smondial2.xml @@ -1,15 +1,18 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> -<softwarelist name="smondial2" description="Mephisto Super Mondial II cartridges"> + +<softwarelist name="mephisto_smondial2" description="Mephisto Super Mondial II Modules"> + <software name="college"> <description>College Module</description> - <year>1989</year> + <year>1988</year> <publisher>Hegener + Glaser</publisher> <part name="cart" interface="smondial2_cart"> <dataarea name="rom" size="0x4000"> - <rom name="college_module.bin" size="0x4000" crc="02fbdf33" sha1="7d1c87b446ef00f4a533f5193f33b3e05af9ff33" offset="0" /> + <rom name="college_7.7.88" size="0x4000" crc="02fbdf33" sha1="7d1c87b446ef00f4a533f5193f33b3e05af9ff33" offset="0" /> <!-- TC57256AD-12, first half empty --> <rom size="0x4000" offset="0" loadflag="continue"/> </dataarea> </part> </software> + </softwarelist> diff --git a/hash/n64.xml b/hash/n64.xml index 9366a7673f5..66411b90907 100644 --- a/hash/n64.xml +++ b/hash/n64.xml @@ -130,6 +130,17 @@ Info on N64 chip labels (from The Cart Scan Repository) </part> </software> + <software name="007twinep" cloneof="007twine"> + <description>007 - The World Is Not Enough (prototype, version 21)</description> + <year>2000</year> + <publisher>Electronic Arts</publisher> + <part name="cart" interface="n64_cart"> + <dataarea name="rom" size="33554432"> + <rom name="the world is not enough ver 21.bin" size="33554432" crc="f0b6bf59" sha1="53c6de60383517f38d27e449d47bced319f8e87a" /> + </dataarea> + </part> + </software> + <software name="1080snow"> <description>1080° Snowboarding (Euro)</description> <year>1998</year> diff --git a/hash/neogeo.xml b/hash/neogeo.xml index 85c0c6f76e2..95e266187fe 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -2656,7 +2656,7 @@ </dataarea> <dataarea name="sprites" size="0x400000"> <rom loadflag="load16_byte" name="048-c1.c1" offset="0x000000" size="0x200000" crc="3fa890e9" sha1="e73d2802bacfbc2b2b16fbbedddde17488e4bbde" /> <!-- mask rom TC5316200 --> - <rom loadflag="load16_byte" name="048-c2.c1" offset="0x000001" size="0x200000" crc="59c48ad8" sha1="2630817e735a6d197377558f4324c1442803fe15" /> <!-- mask rom TC5316200 --> + <rom loadflag="load16_byte" name="048-c2.c2" offset="0x000001" size="0x200000" crc="59c48ad8" sha1="2630817e735a6d197377558f4324c1442803fe15" /> <!-- mask rom TC5316200 --> </dataarea> </part> </software> diff --git a/hash/nes.xml b/hash/nes.xml index 1f450a5c028..dffc745fced 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -6336,7 +6336,7 @@ </part> </software> - <software name="chevlzod"> + <software name="chevlzod" cloneof="sseiya"> <description>Les Chevaliers Du Zodiaque - La Legende D'Or (Fra)</description> <year>1992</year> <publisher>Bandai</publisher> @@ -21914,7 +21914,7 @@ </part> </software> - <software name="worldjen"> + <software name="wordjen"> <description>Lost Word of Jenny - Ushinawareta Message (Jpn)</description> <year>1987</year> <publisher>Takara</publisher> @@ -40800,7 +40800,7 @@ <publisher>Sigma Shouji</publisher> <info name="serial" value="SEI-1B"/> <info name="release" value="19891124"/> - <info name="alt_title" value="ベガスコネクション カジノより愛をこめて"/> + <info name="alt_title" value="ベガスコネクション カジノから愛をこめて"/> <part name="cart" interface="nes_cart"> <feature name="slot" value="sxrom" /> <feature name="pcb" value="HVC-SNROM" /> @@ -62588,10 +62588,10 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx <feature name="slot" value="jyc_a" /> <feature name="pcb" value="JYCOMPANY-A" /> <dataarea name="chr" size="262144"> - <rom name="mickey mania 7 (pirate origianl).chr" size="262144" crc="ad8c83c3" sha1="5308a96d5c54fa63398f20c8c703225330cb423c" offset="00000" status="baddump" /> + <rom name="mickey mania 7 (pirate original).chr" size="262144" crc="ad8c83c3" sha1="5308a96d5c54fa63398f20c8c703225330cb423c" offset="00000" status="baddump" /> </dataarea> <dataarea name="prg" size="262144"> - <rom name="mickey mania 7 (pirate origianl).prg" size="262144" crc="60fb492c" sha1="4826b32e22a60985020acaf3a06f2d32e4ca0c8d" offset="00000" status="baddump" /> + <rom name="mickey mania 7 (pirate original).prg" size="262144" crc="60fb492c" sha1="4826b32e22a60985020acaf3a06f2d32e4ca0c8d" offset="00000" status="baddump" /> </dataarea> </part> </software> @@ -69549,7 +69549,7 @@ Also notice that VRAM, WRAM & mirror are probably incorrect for some of these se </part> </software> - <software name="edu18a"> + <software name="edu18a" cloneof="edu18"> <description>Education Games 18 in 1 (Chi, Alt)</description> <year>19??</year> <publisher><pirate></publisher> @@ -69897,7 +69897,7 @@ Also notice that VRAM, WRAM & mirror are probably incorrect for some of these se <feature name="mirroring" value="vertical" /> <feature name="peripheral" value="subor_keyboard" /> <dataarea name="prg" size="1048576"> - <rom name="unknown_arabic_study_cartridge_contain_32_itmes_(unl).prg" size="1048576" crc="c0a76428" sha1="68a826b1f8589015cad42f22e6593a682e56ab25" offset="00000" status="baddump" /> + <rom name="unknown_arabic_study_cartridge_contain_32_items_(unl).prg" size="1048576" crc="c0a76428" sha1="68a826b1f8589015cad42f22e6593a682e56ab25" offset="00000" status="baddump" /> </dataarea> <!-- 8k VRAM on cartridge --> <dataarea name="vram" size="8192"> @@ -81133,7 +81133,7 @@ that the real dumps might surface --> <description>Family Computer Disk System (Jpn)</description> <year>1986</year> <publisher>Nintendo</publisher> - <info name="usage" value="This only is only supported by Famicom"/> + <info name="usage" value="This is only supported by Famicom"/> <part name="cart" interface="nes_cart"> <feature name="slot" value="disksys" /> <!-- This is a fake and unused PRG dataarea to avoid changing the loading routines for the moment--> diff --git a/hash/odyssey2.xml b/hash/odyssey2.xml index 0cb1e958940..503f1255549 100644 --- a/hash/odyssey2.xml +++ b/hash/odyssey2.xml @@ -1794,6 +1794,35 @@ adds 16K RAM and 18K ROM, that plugs into the G7000 needs to be dumped. </part> </software> +<!-- NTSC Cartidge dumped from a 39SF010 flashrom (1MB) and actual data (2KB) data is repeated to fill space and matches publicly posted rom from author --> + <software name="deathrac"> + <description>Death Race (USA)</description> + <year>2014</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Ivan Machado" /> + <sharedfeat name="compatibility" value="NTSC"/> + <part name="cart" interface="odyssey_cart"> + <feature name="slot" value="o2_rom" /> + <dataarea name="rom" size="2048"> + <rom name="DRace_RC04.NTSC.rom" size="2048" crc="91a767de" sha1="26a044c68ff08f574f6649b731b82caca8c0e797" offset="0" /> + </dataarea> + </part> + </software> + + <software name="deathracp"> + <description>Death Race (Euro)</description> + <year>2014</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Ivan Machado" /> + <sharedfeat name="compatibility" value="PAL"/> + <part name="cart" interface="odyssey_cart"> + <feature name="slot" value="o2_rom" /> + <dataarea name="rom" size="2048"> + <rom name="DRace_RC04.PAL.rom" size="2048" crc="0ca8c961" sha1="3918d6c2c324fba55e8b90acc8d38e540e4ec5c6" offset="0" /> + </dataarea> + </part> + </software> + <software name="ktaa"> <description>Kill the Attacking Aliens</description> <year>2003</year> diff --git a/hash/pasogo.xml b/hash/pasogo.xml index b2544669957..c9a30920f33 100644 --- a/hash/pasogo.xml +++ b/hash/pasogo.xml @@ -22,7 +22,7 @@ <info name="serial" value="KS-1001"/> <info name="alt_title" value="対局くん I"/> <part name="cart" interface="pasogo_cart"> - <dataarea name="rom" width="16" endianness="little" size="1048576"> + <dataarea name="rom" width="16" size="1048576"> <rom name="ks-1001.ic4" size="1048576" crc="b6a3f97c" sha1="2de63b05ec93a4ba3ea55ba131c0706927a5bf39" offset="00000000" /> </dataarea> </part> @@ -36,7 +36,7 @@ <info name="serial" value="KS-1002"/> <info name="alt_title" value="楽しい詰碁・第1巻"/> <part name="cart" interface="pasogo_cart"> - <dataarea name="rom" width="16" endianness="little" size="524288"> + <dataarea name="rom" width="16" size="524288"> <rom name="ks-1002.ic4" size="524288" crc="32f9c38a" sha1="1be82afcdf5e2d1a0e873fda4161e663d7a53a85" offset="00000000" /> </dataarea> </part> @@ -50,7 +50,7 @@ <info name="serial" value="KS-1003"/> <info name="alt_title" value="楽しい詰碁・第2巻"/> <part name="cart" interface="pasogo_cart"> - <dataarea name="rom" width="16" endianness="little" size="524288"> + <dataarea name="rom" width="16" size="524288"> <rom name="ks-1003.ic4" size="524288" crc="32f9c38a" sha1="1be82afcdf5e2d1a0e873fda4161e663d7a53a85" offset="00000000" /> </dataarea> </part> @@ -64,7 +64,7 @@ <info name="serial" value="KS-1004"/> <info name="alt_title" value="囲碁名局集・第1巻"/> <part name="cart" interface="pasogo_cart"> - <dataarea name="rom" width="16" endianness="little" size="524288"> + <dataarea name="rom" width="16" size="524288"> <rom name="ks-1004.ic4" size="524288" crc="32f9c38a" sha1="1be82afcdf5e2d1a0e873fda4161e663d7a53a85" offset="00000000" /> </dataarea> </part> @@ -78,7 +78,7 @@ <info name="serial" value="KS-1009"/> <info name="alt_title" value="電子碁盤"/> <part name="cart" interface="pasogo_cart"> - <dataarea name="rom" width="16" endianness="little" size="1048576"> + <dataarea name="rom" width="16" size="1048576"> <rom name="ks-1009.ic4" size="1048576" crc="b6a3f97c" sha1="2de63b05ec93a4ba3ea55ba131c0706927a5bf39" offset="00000000" /> </dataarea> </part> @@ -92,7 +92,7 @@ <info name="serial" value="KS-1010"/> <info name="alt_title" value="強くなる手筋・第1巻"/> <part name="cart" interface="pasogo_cart"> - <dataarea name="rom" width="16" endianness="little" size="524288"> + <dataarea name="rom" width="16" size="524288"> <rom name="ks-1010.ic4" size="524288" crc="3e70fca6" sha1="c46cdc9e01f2f5c66b2523e1d30355e51c839f27" offset="00000000" /> </dataarea> </part> diff --git a/hash/pce.xml b/hash/pce.xml index 5006472e479..853c3e38ef3 100644 --- a/hash/pce.xml +++ b/hash/pce.xml @@ -279,7 +279,7 @@ </software> <software name="benkei1" cloneof="benkei"> - <description>Benkei Gaiden (Alt)</description> + <description>Benkei Gaiden (alt)</description> <year>1989</year> <publisher>Sunsoft</publisher> <info name="serial" value="SS89002"/> @@ -307,7 +307,7 @@ </software> <software name="bikkuri1" cloneof="bikkuri"> - <description>Bikkuriman World (Alt)</description> + <description>Bikkuriman World (alt)</description> <year>1987</year> <publisher>Hudson</publisher> <info name="serial" value="HC62002"/> @@ -550,7 +550,7 @@ </software> <software name="chikuden1" cloneof="chikuden"> - <description>Chikudenya Toubei - Kubikiri Yakata Yori (Alt)</description> + <description>Chikudenya Toubei - Kubikiri Yakata Yori (alt)</description> <year>1990</year> <publisher>Naxat</publisher> <info name="serial" value="NX89004"/> @@ -634,7 +634,7 @@ </software> <software name="coryoon1" cloneof="coryoon"> - <description>Coryoon - Child of Dragon (Alt)</description> + <description>Coryoon - Child of Dragon (alt)</description> <year>1991</year> <publisher>Naxat</publisher> <info name="serial" value="NX91004"/> @@ -910,7 +910,7 @@ </software> <software name="download1" cloneof="download"> - <description>Download (Alt)</description> + <description>Download (alt)</description> <year>1990</year> <publisher>NEC Avenue</publisher> <info name="serial" value="NAPH-1007"/> @@ -952,7 +952,7 @@ </software> <software name="dsaber1" cloneof="dsaber"> - <description>Dragon Saber - After Story of Dragon Spirit (Alt)</description> + <description>Dragon Saber - After Story of Dragon Spirit (alt)</description> <year>1991</year> <publisher>Namcot</publisher> <info name="serial" value="NC91005"/> @@ -994,7 +994,7 @@ </software> <software name="droprock1" cloneof="droprock"> - <description>Drop Rock Hora Hora (Alt)</description> + <description>Drop Rock Hora Hora (alt)</description> <year>1990</year> <publisher>Data East</publisher> <info name="serial" value="DE90005"/> @@ -1106,7 +1106,7 @@ </software> <software name="f1circus1" cloneof="f1circus"> - <description>F1 Circus (Alt)</description> + <description>F1 Circus (alt)</description> <year>1990</year> <publisher>Nihon Bussan</publisher> <info name="serial" value="NB90002"/> @@ -1699,7 +1699,7 @@ </software> <software name="jinmu1" cloneof="jinmu"> - <description>Jinmu Denshou (Alt)</description> + <description>Jinmu Denshou (alt)</description> <year>1989</year> <publisher>Big Club</publisher> <info name="serial" value="BG01003"/> @@ -1727,7 +1727,7 @@ </software> <software name="juuouki1" cloneof="juuouki"> - <description>Juuouki (Alt)</description> + <description>Juuouki (alt)</description> <year>1989</year> <publisher>NEC</publisher> <info name="serial" value="H68G-1006"/> @@ -1956,7 +1956,7 @@ </software> <software name="ladyswrd1" cloneof="ladyswrd"> - <description>Lady Sword (Alt)</description> + <description>Lady Sword (alt)</description> <year>19??</year> <publisher>Game Express</publisher> <part name="cart" interface="pce_cart"> @@ -2051,7 +2051,7 @@ </software> <software name="mjgakmld1" cloneof="mjgakmld"> - <description>Mahjong Gakuen Mild - Touma Soushirou Toujou (Alt)</description> + <description>Mahjong Gakuen Mild - Touma Soushirou Toujou (alt)</description> <year>1990</year> <publisher>Face</publisher> <info name="serial" value="FA02-004"/> @@ -2345,7 +2345,7 @@ </software> <software name="motorod2a" cloneof="motorod2"> - <description>Moto Roader II (Alt)</description> + <description>Moto Roader II (alt)</description> <year>1991</year> <publisher>Masiya</publisher> <info name="serial" value="NCS91002"/> @@ -2373,7 +2373,7 @@ </software> <software name="mrheli1" cloneof="mrheli"> - <description>Mr. Heli no Daibouken (Alt)</description> + <description>Mr. Heli no Daibouken (alt)</description> <year>1989</year> <publisher>Irem</publisher> <info name="serial" value="IC01002"/> @@ -2803,7 +2803,7 @@ </software> <software name="pcdenja" cloneof="pcdenj"> - <description>PC Denjin - Punkic Cyborgs (Alt)</description> + <description>PC Denjin - Punkic Cyborgs (alt)</description> <year>1992</year> <publisher>Hudson</publisher> <info name="serial" value="HC92053"/> @@ -2831,7 +2831,7 @@ </software> <software name="pcgenja" cloneof="pcgenj"> - <description>PC Genjin - Pithecanthropus Computerurus (Alt)</description> + <description>PC Genjin - Pithecanthropus Computerurus (alt)</description> <year>1989</year> <publisher>Hudson</publisher> <info name="serial" value="HC89024"/> @@ -2911,7 +2911,7 @@ </software> <software name="populous1" cloneof="populous"> - <description>Populous (Alt)</description> + <description>Populous (alt)</description> <year>1991</year> <publisher>Hudson</publisher> <info name="serial" value="HC91041"/> @@ -2940,7 +2940,7 @@ </software> <software name="pdrift1" cloneof="pdrift"> - <description>Power Drift (Alt)</description> + <description>Power Drift (alt)</description> <year>1990</year> <publisher>Asmik</publisher> <info name="serial" value="AS02002"/> @@ -3242,8 +3242,8 @@ </software> <!-- later revision, password parser bugfix for passwords with 8 lives --> - <software name="rtypep21" cloneof="rtypep2"> - <description>R-Type Part-2 (Alt)</description> + <software name="rtypep21" cloneof="rtypep2"> + <description>R-Type Part-2 (alt)</description> <year>1988</year> <publisher>Hudson</publisher> <info name="serial" value="HC63009"/> @@ -3839,7 +3839,7 @@ </software> <software name="shingen1" cloneof="shingen"> - <description>Takeda Shingen (Alt)</description> + <description>Takeda Shingen (alt)</description> <year>1989</year> <publisher>Aicom</publisher> <info name="serial" value="AC89002"/> @@ -3867,7 +3867,7 @@ </software> <software name="tatsujinp" cloneof="tatsujin"> - <description>Tatsujin (Prototype)</description> + <description>Tatsujin (prototype)</description> <year>1992</year> <publisher>Taito</publisher> <part name="cart" interface="pce_cart"> diff --git a/hash/pi_storyreader_cart.xml b/hash/pi_storyreader_cart.xml new file mode 100644 index 00000000000..dfa32f9bf37 --- /dev/null +++ b/hash/pi_storyreader_cart.xml @@ -0,0 +1,263 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="pi_storyreader_cart" description="Publications International Ltd. Story Reader cartridges"> + + <software name="srbamltpetp3" supported="no"> + <description>Disney's Bambi / Lady and the Tramp / Peter Pan</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x200000"> + <rom name="storyreaderv1_bambiladyandthetramppeterpan.bin" size="0x200000" crc="68e5c946" sha1="34cce52e203223e6d306a8a568094ea543968ca2" /> + </dataarea> + </part> + </software> + + <software name="srbarney3" supported="no"> + <description>Barney: Barney Cares / Best Manners Show / Let's Work Together</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="30473" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_barneycaresbestmannersshowletsworktogether.bin" size="0x400000" crc="89e6df6a" sha1="f5d598c7f695f4f7e09060c05e58ba14bf8f805c" /> + </dataarea> + </part> + </software> + + <software name="srbluespps" supported="no"> + <description>Blue's Perfect Picnic Spot</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="01465" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_bluesperfectpicnicspot.bin" size="0x100000" crc="88536a08" sha1="a124e5a653bf86e3eb0a00b3eaae068b2a9245b6" /> + </dataarea> + </part> + </software> + + <software name="srcarincmon3" supported="no"> + <description>Disney/Pixar Cars / The Incredibles / Monsters Inc.</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="62823" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_carsincrediblesmonstersinc.bin" size="0x400000" crc="88ba4b2b" sha1="f30d95476d120b1fca1b8fc9004baf7951f7cb67" /> + </dataarea> + </part> + </software> + + <software name="srdoragrdn" supported="no"> + <description>Dora's Garden Adventure</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="01457" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_dorasgardenadventure.bin" size="0x100000" crc="83fe2fcf" sha1="44a4b1fb79f54f49883f37fee448f93972363bfe" /> + </dataarea> + </part> + </software> + + <software name="srdoragrgiar3" supported="no"> + <description>Dora the Explorer: Dora's Garden Adventure / The Gingerbread Boy / Dora's Art Adventure</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="33618" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_dorasgardenadventuregingerbreadboydorasartadventure.bin" size="0x400000" crc="891472a9" sha1="cdc78012a41283032fabe4977e37b330be50d320" /> + </dataarea> + </part> + </software> + + <software name="srfindnemo" supported="no"> + <description>Disney/Pixar Finding Nemo</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="32018" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_findingnemo.bin" size="0x100000" crc="9ad6c87a" sha1="f1b33c3501b2850757eaf7c9a44d148ca9f093c1" /> + </dataarea> + </part> + </software> + + <software name="srlionkng" supported="no"> + <description>Disney's The Lion King</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_lionking.bin" size="0x100000" crc="8d1a63f1" sha1="6596739951a76cb311b7a5dc1db123fa045c5351" /> + </dataarea> + </part> + </software> + + <software name="srlimermaid" supported="no"> + <description>Disney's The Little Mermaid</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_littlemermaid.bin" size="0x100000" crc="bdf625f7" sha1="084864e2ee310f30811e8a0bf1bbaa2885de5ada" /> + </dataarea> + </part> + </software> + + <software name="srnoahark" supported="no"> + <description>Noah's Ark</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="0151-1" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_noahsark.bin" size="0x100000" crc="7d518933" sha1="fa8913d2dfc33af9669cdb1019784ed9085e06e1" /> + </dataarea> + </part> + </software> + + <software name="srpetjetom3" supported="no"> + <description>Petter Rabbit / Jemima Puddle-Duck / Tom Kitten</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="06238" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_peterrabbitjemimapuddleducktomkitten.bin" size="0x400000" crc="1eb175a8" sha1="1ead97956e5d2866dbfe9878ff48522fac8818f9" /> + </dataarea> + </part> + </software> + + <software name="srpitsjb3" supported="no"> + <description>Disney's Pinocchio / Disney/Pixar Toy Story 2 / The Jungle Book</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x200000"> + <rom name="storyreaderv1_pinocchiotoystory2junglebook.bin" size="0x200000" crc="3530ac76" sha1="4722dac345f754ea72d1de082f8f9f401a0b1975" /> + </dataarea> + </part> + </software> + + <software name="srpoohrmbly" supported="no"> + <description>Disney No Rumbly In Pooh's Tumbly</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="0161-9" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_norumblyinpoohstumbly.bin" size="0x100000" crc="78b7ee0a" sha1="257b91be7eb0bfc3b22c3f6a7535a5c8a4269332" /> + </dataarea> + </part> + </software> + + <software name="srpoohwndy" supported="no"> + <description>Disney Pooh Windy Day</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="01597" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_poohswindyday.bin" size="0x100000" crc="fe167f3c" sha1="bb9dcd5cd2231a2f1150ed127dac148b0a7416ff" /> + </dataarea> + </part> + </software> + + <software name="srprinjamupo3" supported="no"> + <description>Disney Princess: Jasmine / Mulan / Pocahontas</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="67224" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_jasminemulanpocahontas.bin" size="0x400000" crc="d0c4b8d9" sha1="affe7f6f13be2e391a430fd602b0069f095bd2fa" /> + </dataarea> + </part> + </software> + + <software name="srprinlmswbb3" supported="no"> + <description>Disney Princess: The Little Mermaid / Snow White / Beauty and the Beast</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x200000"> + <rom name="storyreaderv1_littlemermaidsnowwhitebeautyandthebeast.bin" size="0x200000" crc="3c1623da" sha1="a7b6b7a251aa6d53b47f599ea57663aa096f5206" /> + </dataarea> + </part> + </software> + + <software name="srscoobymgm" supported="no"> + <description>Scooby-Doo! Miniature Golf Mistery</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="01473" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_scoobydoominiaturegolfmystery.bin" size="0x100000" crc="bfed0514" sha1="1fde50f130df60772501d72380a3fdb975fc831e" /> + </dataarea> + </part> + </software> + + <software name="srsesame3" supported="no"> + <description>Sesame Street: Elmo's Colorful Adventure / Grover Stays Up Very Very Late / Me Loves Cookies</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="30481" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_elmoscolorfuladventuregroverstaysupverylatemelovecookies.bin" size="0x400000" crc="54bc8b1f" sha1="f11d90fd2ff032b6a93e50d61e471005fe0c8710" /> + </dataarea> + </part> + </software> + + <software name="srsbobgpw" supported="no"> + <description>Spongebob Squarepants Grand Price Winner!</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="01449" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_grandprizewinner.bin" size="0x100000" crc="da0428ce" sha1="fb0d95ccb2a116d676b386249668b240a7178f2d" /> + </dataarea> + </part> + </software> + + <software name="srsbodobl3" supported="no"> + <description>Spongebob Squarepants Grand Price Winner! / Dora's Garden Adventure / Blue's Perfect Picnic Spot</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="30376" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_grandprizewinnerdorasgardenadventurebluesperfectpicnicspot.bin" size="0x400000" crc="1ea36f2f" sha1="bb63e6988b629f531fca081d3f5c611a8ba3cca0" /> + </dataarea> + </part> + </software> + + <software name="srthomas3" supported="no"> + <description>Thomas & Friends: Cheer up Cranky! / The Big Race / Carnival Capers</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <info name="serial" value="84009" /> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="storyreaderv1_cheerupcrankythebigracecarnivalcapers.bin" size="0x400000" crc="4ddcadbc" sha1="78e8ee67da04111c17039bbbcbfc665ec2729372" /> + </dataarea> + </part> + </software> + + <software name="srtoystry2" supported="no"> + <description>Disney/Pixar Toy Story 2</description> + <year>200?</year> + <publisher>Publications International Ltd. / Disney</publisher> + <part name="cart" interface="pi_storyreader_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv1_toystory2.bin" size="0x100000" crc="496fe7b5" sha1="4a66e1e7ec0fdcfe578d60437fcbaaa19f7ac2d3" /> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/pi_storyreader_v2_cart.xml b/hash/pi_storyreader_v2_cart.xml new file mode 100644 index 00000000000..6f8a8bd78e6 --- /dev/null +++ b/hash/pi_storyreader_v2_cart.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="pi_storyreader_v2_cart" description="Publications International Ltd Story Reader 2.0 cartridges"> + + <software name="ts2" supported="no"> + <description>Toy Story 2</description> + <year>200?</year> + <publisher>Publications International Ltd / Disney</publisher> + <part name="cart" interface="pi_storyreader_v2_cart"> + <dataarea name="rom" size="0x100000"> + <rom name="storyreaderv2_toystory2.bin" size="0x100000" crc="b3b4b613" sha1="0e0bd3a9865ac35a0c8c0dae9cfaac15f5b30a89" /> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/pico.xml b/hash/pico.xml index ec29edf2945..0d8dca2b7a2 100644 --- a/hash/pico.xml +++ b/hash/pico.xml @@ -301,7 +301,7 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) </software> <software name="poohcornsw" cloneof="poohcorn"> - <description>Ett År med Nalle Puh (Swe)</description> + <description>Ett år med Nalle Puh (Swe)</description> <year>1995</year> <publisher>Sega</publisher> <info name="serial" value="MK-49021-24"/> @@ -311,6 +311,9 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) <dataarea name="rom" size="524288"> <rom name="mpr-18576-t.ic1" size="524288" crc="0a48bbb9" sha1="a702d91a72066bea72e7cff9013f1b94f2623761" offset="000000" loadflag="load16_word_swap" /> </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0.png" size="31345139" crc="33fbbbb4" sha1="30534e90d2f0fdb17d66dce66fbaa9e03b2d5295" offset="0"/> + </dataarea> </part> </software> @@ -441,13 +444,22 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) <info name="alt_title" value="アンパンマンピコ わくわくパン工場 ~ Anpanman Pico Wakuwaku Pan Koujou"/> <part name="cart" interface="pico_cart"> <feature name="pcb" value="171-7967" /> - <feature name="ic1" value="9K0-0041A" /> + <feature name="ic1" value="9K0-0041A-RV" /> <feature name="ic2" value="HC32" /> <feature name="ic3" value="HC74" /> <feature name="ic4" value="HC125" /> <dataarea name="rom" size="1048576"> <rom name="9k0-0041a-rv.ic1" size="1048576" crc="a10118a5" sha1="b9fce10b2558f73048d30398410b0e3340e87610" offset="000000" loadflag="load16_word_swap" /> </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="25146736" crc="bb9bf256" sha1="64ee0df89f8995b8cf847b0a3381e624e48ee1a4" offset="0"/> + <rom name="0 - 0002.png" size="26243330" crc="9aabec1a" sha1="044748f6af5becc08650935136749e855258c938" offset="0"/> + <rom name="0 - 0003.png" size="25927952" crc="43fdc28c" sha1="04e7df5119a04940ca5b217cc7814438a1a66852" offset="0"/> + <rom name="0 - 0004.png" size="27207842" crc="291b9b5f" sha1="abcef241c2065d22342f276096590bc01a5082a5" offset="0"/> + <rom name="0 - 0005.png" size="28869718" crc="4a435395" sha1="1748c5aa0f0a5d0a7efaf0e2a9735659d637e255" offset="0"/> + <rom name="0 - 0006.png" size="29680612" crc="1e1287a7" sha1="cc92ef1bb6f20c06ee61287da02eb4e147484f1d" offset="0"/> + <rom name="0 - 0007.png" size="27665504" crc="6562d21c" sha1="f0d66aca4178aa0ac45ad91271c0bd863e117774" offset="0"/> + </dataarea> </part> </software> @@ -683,12 +695,26 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) <description>Cooking Pico (Jpn)</description> <year>1999</year> <publisher>Sega Toys</publisher> + <info name="serial" value="HPC-6076"/> + <info name="alt_title" value="クッキング ピコ みんなといっしょに はじめてクッキング!"/> <part name="cart" interface="pico_cart"> <feature name="pcb" value="171-7967" /> <feature name="ic1" value="9K0-0001A-RV" /> + <feature name="ic2" value="HC32" /> + <feature name="ic3" value="HC74" /> + <feature name="ic4" value="HC125" /> <dataarea name="rom" size="2097152"> <rom name="9k0-0001a-rv.ic1" size="2097152" crc="b94f7d54" sha1="dabeb440adbb7477cc880c51fb0cfc1e5f99d23b" offset="000000" loadflag="load16_word_swap" /> </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="26511733" crc="a1dc0a41" sha1="67ec8a3f88cbe8512b6375cace94cb8ae8cd4686" offset="0"/> + <rom name="0 - 0002.png" size="25239655" crc="e2c78528" sha1="a258003c48def8d6a0005e069795497dcdd92878" offset="0"/> + <rom name="0 - 0003.png" size="28739986" crc="40545907" sha1="89a898e6183e0c4e8399c5713e08adf6775068ac" offset="0"/> + <rom name="0 - 0004.png" size="29404938" crc="5575999c" sha1="b312e3198a16b6d70a55a6dbbd34459cf85e7a33" offset="0"/> + <rom name="0 - 0005.png" size="29654672" crc="d3cfe54c" sha1="b473266eee621a23d825524c65451400a259630d" offset="0"/> + <rom name="0 - 0006.png" size="30111054" crc="d897e4b6" sha1="b00de9e37c4a90f722eb49b203afcb1888033288" offset="0"/> + <rom name="0 - 0007.png" size="28981434" crc="5455c241" sha1="edcdcaed03062095541326184a28ccba1b62f5b2" offset="0"/> + </dataarea> </part> </software> @@ -2607,8 +2633,9 @@ But how do later protos fit with this theory? Maybe the later protos were from t </part> </software> - <software name="lionkingsw" cloneof="lionking" supported="no"> - <description>Lejonkungen Äventyr (Swe)</description> + <!-- The booklet is not translated and is identical to "lionking" --> + <software name="lionkingsw" cloneof="lionking" supported="no"> + <description>Lejonkungen - Äventyr (Swe)</description> <year>19??</year> <publisher>Sega</publisher> <info name="serial" value="MK-49037-24"/> @@ -2635,7 +2662,7 @@ But how do later protos fit with this theory? Maybe the later protos were from t </part> </software> -<!-- This was also released for the Swedish market with serial MK-49026-24, pcb 171-6882A. ROM is marked MPR-17729-T but contents match --> +<!-- This was also released for the Swedish market with serial MK-49026-24, pcb 171-6882A. ROM is marked MPR-17729-T but contents and booklet match --> <software name="magiccra"> <description>Magic Crayons (Euro)</description> <year>1994</year> @@ -3896,7 +3923,7 @@ But how do later protos fit with this theory? Maybe the later protos were from t </software> <software name="profpicos" cloneof="profpico" supported="no"> - <description>El Profesor Pico en el Mundo de los Colores (Spa)</description> + <description>El Profesor Pico en el Mundo de los Colores (Spa)</description> <year>1995</year> <publisher>Sega</publisher> <info name="serial" value="49041-06" /> diff --git a/hash/pockchalw.xml b/hash/pockchalw.xml index 772b70bfc19..1db5e7ac992 100644 --- a/hash/pockchalw.xml +++ b/hash/pockchalw.xml @@ -196,8 +196,8 @@ <feature name="u310" value="LH5168N-10L" /> <feature name="u311" value="74HC139A" /> <feature name="bt301" value="[empty?]" /> - <dataarea name="rom" size="1048576"> - <rom name="n-g1 7bi711 98cj4mb c1d1.u307" size="1048576" crc="efef730e" sha1="6f4906d36fc751cf2c52bf9ff4a388fd19ae51d2" offset="0" /> + <dataarea name="rom" size="4194304"> + <rom name="n-g1 7bi711 98cj4mb c1d1.u307" size="4194304" crc="53c2ff43" sha1="1baba9ecb24b46d9319bf0b13b1d8e5409ff5214" offset="0" /> </dataarea> </part> </software> diff --git a/hash/samcoupe_cass.xml b/hash/samcoupe_cass.xml index 25e50a17d91..051a3a851c3 100644 --- a/hash/samcoupe_cass.xml +++ b/hash/samcoupe_cass.xml @@ -25,7 +25,7 @@ </software> <!-- extracted from covertape of Crash magazine issue 92 (the full game was never released) --> <software name="f16demo"> - <description>F-16 Combat Pilot (Demo)</description> + <description>F-16 Combat Pilot (demo)</description> <year>1991</year> <publisher>Digital Integration</publisher> <part name="cass" interface="samcoupe_cass"> diff --git a/hash/samcoupe_flop.xml b/hash/samcoupe_flop.xml index 1a9bfb99393..addad3124d4 100644 --- a/hash/samcoupe_flop.xml +++ b/hash/samcoupe_flop.xml @@ -3,21 +3,21 @@ <!-- to boot disks type 'BOOT' and press return alternatively press numpad 9 which seems to do the same thing - + disk image formats: .mgt .dsk .sad confusingly there seems to be two types of .dsk image, one is just the same as .mgt in all but the extension, the other is "extended DSK disk image" (sometimes with .edsk extension) which is often used for Amstrad CPC and Spectrum +3 images. .sad seems to be a more advanced format that allows copy-protected images etc. - + currently only .mgt/.dsk is supported in coupedsk.cpp should be trivial to add "extended DSK disk image" support as it's already in Mame. - + most game images have trainers/pokes. all Sam Coupe games will probably need re-dumping at some point as there seems to be very few clean images available. TOSEC and GoodSamC don't have much, mostly hacked, demos, unlicensed/homebrew etc. www.worldofsam.org is a good source of infomation but most commercial games are not available for download. - + SAMDOS disks include the official MGT ZX Spectrum emulator. --> diff --git a/hash/saturn.xml b/hash/saturn.xml index efe068137c2..920264076d9 100644 --- a/hash/saturn.xml +++ b/hash/saturn.xml @@ -2523,7 +2523,7 @@ Olympic Soccer (Fra) T-7904H-09 </software> <!-- --> - <software name="aishogi" supported="yes"> + <software name="aishogi"> <description>AI Shougi (Jpn)</description> <year>1995</year> <publisher>Soft Bank</publisher> @@ -3069,7 +3069,7 @@ Olympic Soccer (Fra) T-7904H-09 </software> <!-- Works including mouse support --> - <software name="catrip" supported="yes"> + <software name="catrip"> <description>Cat the Ripper - 13-ninme no Tanteishi (Jpn)</description> <year>1997</year> <publisher>Tonkin House</publisher> @@ -3555,7 +3555,7 @@ Olympic Soccer (Fra) T-7904H-09 </software> <!-- Works including loading from Save Game Manager CDs --> - <software name="dezaemn2" supported="yes"> + <software name="dezaemn2"> <description>Dezaemon 2 (Jpn)</description> <year>1997</year> <publisher>Athena</publisher> diff --git a/hash/sawatte.xml b/hash/sawatte.xml index dc87089ed1c..cfddc331f6f 100644 --- a/hash/sawatte.xml +++ b/hash/sawatte.xml @@ -27,6 +27,18 @@ <dataarea name="rom" size="524288"> <rom name="mpr-19040.ic1" size="524288" crc="0c9bae2f" sha1="bc5030fab99e8f4b1bcc8ed77c1cc07d8407df93"/> </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="7990102" crc="c3e1abe3" sha1="699019a3edb8e6f8750f1ae171d439e5bb48beef" offset="0"/> + <rom name="0 - 0002.png" size="8126259" crc="9f551c16" sha1="99dd7c3c05ddd173afafabaf629e9fc805ea66f4" offset="0"/> + <rom name="0 - 0003.png" size="8719411" crc="35a6b984" sha1="dfb0eda798efbc7cc9c33b39d9d05d604224a27f" offset="0"/> + <rom name="0 - 0004.png" size="8035124" crc="724e0cc4" sha1="a0b648223564b75e995e6fefa4d890f5510af9d9" offset="0"/> + <rom name="0 - 0005.png" size="7732789" crc="a727b3d6" sha1="39b6c9314ffd59a4f69d68078f8e78a68ee99d85" offset="0"/> + <rom name="0 - 0006.png" size="8105364" crc="66711279" sha1="4c90904c2581657c924a5b68ffbd1033ac88ae01" offset="0"/> + <rom name="0 - 0007.png" size="7953623" crc="ee483049" sha1="3f08f071f558a3d61ae2d124381adda125d7eba1" offset="0"/> + <rom name="0 - 0008.png" size="5667933" crc="771f89d5" sha1="39e991eab0b0b825e8dace0c0d9ebdb0a42b20a5" offset="0"/> + <rom name="0 - 0009.png" size="5420956" crc="33bad398" sha1="3e80900dec29de2998749909d29c3f570b333585" offset="0"/> + <rom name="0 - 0010.png" size="5577261" crc="b62d448b" sha1="fa3522cbe7125582649b9577ae8171384b4e0658" offset="0"/> + </dataarea> </part> </software> @@ -100,6 +112,18 @@ <dataarea name="rom" size="524288"> <rom name="mpr-19041.ic1" size="524288" crc="ec924165" sha1="b25a5637c8cc1f2f6224595853d540195be86ec9"/> </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="7542084" crc="6fd1fdf9" sha1="e4648b1ca06db75682db593950b9ccfaddeeedda" offset="0"/> + <rom name="0 - 0002.png" size="6653961" crc="db5d33fb" sha1="6d9782c1dc4f96629ac3744309631e6ba2f63123" offset="0"/> + <rom name="0 - 0003.png" size="6795708" crc="37e3a3d3" sha1="bd7495438f430ae1aa2715897a13d7aba6b0ef46" offset="0"/> + <rom name="0 - 0004.png" size="7354011" crc="d22ca428" sha1="ab33525b3221fcb8634a866f1ecde503c1baa7e4" offset="0"/> + <rom name="0 - 0005.png" size="6516805" crc="1f78d397" sha1="67ec4c4dca78dcbefccfa22167bd40f7206dcb8f" offset="0"/> + <rom name="0 - 0006.png" size="7667615" crc="ceb8515e" sha1="bcdfef959b327f6ef044a52ac82e7b20468c0fd8" offset="0"/> + <rom name="0 - 0007.png" size="7209365" crc="fa32954b" sha1="77722ec2ec5975ee02efd8bc0418d6b35c34b44a" offset="0"/> + <rom name="0 - 0008.png" size="8179876" crc="a90c6b64" sha1="cee0fb447372dc92b1ed9efb85cc379ef22e90ac" offset="0"/> + <rom name="0 - 0009.png" size="6683838" crc="b0f97114" sha1="d4738f9f8c3d07c6ad83057fadcb26691c71225b" offset="0"/> + <rom name="0 - 0010.png" size="5460093" crc="872830fa" sha1="5296cec65ab3ac74afcbd549965d541d7e19def5" offset="0"/> + </dataarea> </part> </software> @@ -158,6 +182,18 @@ <dataarea name="rom" size="524288"> <rom name="mpr-19828-t.ic1" size="524288" crc="57988dc7" sha1="438a35b2a46ec82b5e31478d9e244928f98891ab"/> </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="8822099" crc="5406451f" sha1="3f996c7e15656a618d7e7e9c4a3baae5f58e5439" offset="0"/> + <rom name="0 - 0002.png" size="8512982" crc="d45517e2" sha1="42634fa530a702366c2285071dbe0ddc998c6357" offset="0"/> + <rom name="0 - 0003.png" size="8416449" crc="40b740a0" sha1="5cc0c58c8b5a0d6d127eb19bfbea9f528a81c005" offset="0"/> + <rom name="0 - 0004.png" size="8684377" crc="39a13064" sha1="80b1c0144b21df782b686ab96147254280bd95b2" offset="0"/> + <rom name="0 - 0005.png" size="8380978" crc="7cce8ef9" sha1="b10a92b8c4d23972b055b140ee769c0823504fa7" offset="0"/> + <rom name="0 - 0006.png" size="8253402" crc="4fd8a1b6" sha1="ac29a4c2b5b9ea51bcb4e5e8327d80f35757a890" offset="0"/> + <rom name="0 - 0007.png" size="8504365" crc="1970e627" sha1="4c195665d22d5a48005977ed6167d0184e1f12ea" offset="0"/> + <rom name="0 - 0008.png" size="8288967" crc="cdddbb28" sha1="a6b7a35a72da55e94bdfd057b322e6fac30d9ae0" offset="0"/> + <rom name="0 - 0009.png" size="7968781" crc="90a60704" sha1="575044f121fe0005f48c4f74749697d695c29cfd" offset="0"/> + <rom name="0 - 0010.png" size="5668176" crc="8ae2a2ae" sha1="2a925b4d54826f5391f5df1b48212aeb9b54b283" offset="0"/> + </dataarea> </part> </software> diff --git a/hash/sdk85.xml b/hash/sdk85.xml new file mode 100644 index 00000000000..dfe1ecc69bd --- /dev/null +++ b/hash/sdk85.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="sdk85" description="SDK-85 expansion ROMs"> + + <software name="ap29" supported="no"> + <!-- Program listed in "Using the Intel 8085 Serial I/O Lines" application note --> + <!-- CRT and cassette tape interfaces require custom SID/SOD hookups --> + <description>AP-29 Serial I/O Routines</description> + <year>1977</year> + <publisher>Intel</publisher> + <info name="author" value="John Wharton"/> + <part name="prom" interface="sdk85_rom"> + <dataarea name="rom" size="2048"> + <rom name="ap29.bin" size="2048" crc="c17c3020" sha1="d96dd85fd47ad4af41366a4df758a421b1c39d49"/> + </dataarea> + </part> + </software> + + <software name="mmind"> + <description>Mastermind</description> + <year>2019</year> + <publisher>hack (Peter Naszvadi)</publisher> + <info name="author" value="Paolo Forlani and Stefano Bodrato"/> + <part name="prom" interface="sdk85_rom"> + <dataarea name="rom" size="2048"> + <rom name="mastermind.a15" size="2048" crc="0538e162" sha1="c351975e2cf515cee29fcaeb04ef47189afe5250"/> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/sega_beena_cart.xml b/hash/sega_beena_cart.xml index 5f7b04368e6..bbb9f8286a4 100644 --- a/hash/sega_beena_cart.xml +++ b/hash/sega_beena_cart.xml @@ -9,21 +9,21 @@ <publisher>Sega Toys</publisher> <part name="cart" interface="sega_beena_cart"> <dataarea name="rom" size="0x800000" width="32" endianness="big"> - <rom loadflag="load16_word_swap" name="S-100008-1000 - Shoku Iku Series 1 Soreike! Anpanman-Sukikirai Nai Ko Genki na Ko!.bin" size="0x00800000" crc="e7d8333d" sha1="7488dddf64cb0c93b17235db93cf6a1bd5c05c0f" offset="0" /> + <rom loadflag="load16_word_swap" name="S-100008-1000 - Shoku Iku Series 1 Soreike! Anpanman-Sukikirai Nai Ko Genki na Ko!.bin" size="0x00800000" crc="e7d8333d" sha1="7488dddf64cb0c93b17235db93cf6a1bd5c05c0f" /> </dataarea> <dataarea name="pages" size="0x2000000"> <!-- book pages --> - <rom name="0 - 0001.png" size="0x01d4aed0" crc="b023d113" sha1="6ac75a2710a140d39276d620638b596735290938" offset="0" /> - <rom name="0 - 0002.png" size="0x01ce8218" crc="ed4180db" sha1="6867123542392c3282fecc40645443bbb5f7aa43" offset="0" /> - <rom name="0 - 0003.png" size="0x01d45080" crc="c4fa1860" sha1="6e9f6c45275eedb1bd8f66239ea31ce37138d006" offset="0" /> - <rom name="0 - 0004.png" size="0x01fca2df" crc="e357a704" sha1="d5c65a085b86c74b03ec5e5a4ac5e5b7a5442c7f" offset="0" /> - <rom name="0 - 0005.png" size="0x01fad4a6" crc="eafa1e83" sha1="4fd2309b32486ba047ec80f8b928a7019300b8bf" offset="0" /> - <rom name="0 - 0006.png" size="0x01d8f1bc" crc="8679d842" sha1="b4c2242b7813b3fdc3c9a863069a6384930349a0" offset="0" /> - <rom name="0 - 0007.png" size="0x01afa23b" crc="bfe7bf50" sha1="ce14030e60e5552a08174fff2e99bbba6aea1d68" offset="0" /> - <rom name="0 - 0008.png" size="0x01debbaf" crc="a6435cf9" sha1="60e48945065a3af2b99db7936c3f0c045f96206b" offset="0" /> - <rom name="0 - 0009.png" size="0x01d3ab11" crc="1407e768" sha1="52ecbfe3a8ce3a5b68a046b4c18221781443b050" offset="0" /> - <rom name="0 - 0010.png" size="0x013b58bc" crc="6afd75f3" sha1="7f77f972a2605cf9e154383a2c3b07f74c06645b" offset="0" /> - <rom name="0 - 0011.png" size="0x015acf2a" crc="3e46f77e" sha1="44ec480201e79ef2d0bdc23fd1b3881cf0de0eb2" offset="0" /> - <rom name="0 - 0012.png" size="0x016d1853" crc="ed4ce2e5" sha1="75302e842a5e09378070866dbd3fb370e464e387" offset="0" /> + <rom name="0 - 0001.png" size="0x01d4aed0" crc="b023d113" sha1="6ac75a2710a140d39276d620638b596735290938" /> + <rom name="0 - 0002.png" size="0x01ce8218" crc="ed4180db" sha1="6867123542392c3282fecc40645443bbb5f7aa43" /> + <rom name="0 - 0003.png" size="0x01d45080" crc="c4fa1860" sha1="6e9f6c45275eedb1bd8f66239ea31ce37138d006" /> + <rom name="0 - 0004.png" size="0x01fca2df" crc="e357a704" sha1="d5c65a085b86c74b03ec5e5a4ac5e5b7a5442c7f" /> + <rom name="0 - 0005.png" size="0x01fad4a6" crc="eafa1e83" sha1="4fd2309b32486ba047ec80f8b928a7019300b8bf" /> + <rom name="0 - 0006.png" size="0x01d8f1bc" crc="8679d842" sha1="b4c2242b7813b3fdc3c9a863069a6384930349a0" /> + <rom name="0 - 0007.png" size="0x01afa23b" crc="bfe7bf50" sha1="ce14030e60e5552a08174fff2e99bbba6aea1d68" /> + <rom name="0 - 0008.png" size="0x01debbaf" crc="a6435cf9" sha1="60e48945065a3af2b99db7936c3f0c045f96206b" /> + <rom name="0 - 0009.png" size="0x01d3ab11" crc="1407e768" sha1="52ecbfe3a8ce3a5b68a046b4c18221781443b050" /> + <rom name="0 - 0010.png" size="0x013b58bc" crc="6afd75f3" sha1="7f77f972a2605cf9e154383a2c3b07f74c06645b" /> + <rom name="0 - 0011.png" size="0x015acf2a" crc="3e46f77e" sha1="44ec480201e79ef2d0bdc23fd1b3881cf0de0eb2" /> + <rom name="0 - 0012.png" size="0x016d1853" crc="ed4ce2e5" sha1="75302e842a5e09378070866dbd3fb370e464e387" /> </dataarea> </part> </software> @@ -34,21 +34,21 @@ <publisher>Bandai</publisher> <part name="cart" interface="sega_beena_cart"> <dataarea name="rom" size="0x800000" width="32" endianness="big"> - <rom loadflag="load16_word_swap" name="beena.bin" size="0x800000" crc="afa3466c" sha1="b49914f97db95f611489487f558d13d7cceb3299" offset="0" /> + <rom loadflag="load16_word_swap" name="beena.bin" size="0x800000" crc="afa3466c" sha1="b49914f97db95f611489487f558d13d7cceb3299" /> </dataarea> <dataarea name="pages" size="0x2000000"> <!-- book pages --> - <rom name="0 - 0001.png" size="0x1ca26ec" crc="d8e18a54" sha1="887a96931bf622cb673f2550323ad3923eff337e" offset="0" /> - <rom name="0 - 0002.png" size="0x1e37a3d" crc="62ae3535" sha1="d8f6c19c466715df5a568ac7cac8dacb53f2e04a" offset="0" /> - <rom name="0 - 0003.png" size="0x1ce4f16" crc="fe6c72d9" sha1="2c4412eb518fbac2e8519c87e53270d960ecab53" offset="0" /> - <rom name="0 - 0004.png" size="0x19a864d" crc="edede3ea" sha1="81914894358c74064aa5f9e980ac37f7140f80c3" offset="0" /> - <rom name="0 - 0005.png" size="0x18998f4" crc="16837cc0" sha1="eb86b2943cf603a63cd5b94faa0d06ee8a3139d6" offset="0" /> - <rom name="0 - 0006.png" size="0x195b7e5" crc="3e307e6d" sha1="23ed9ab2a4122d7cb33d8d6174ca901b88647b4d" offset="0" /> - <rom name="0 - 0007.png" size="0x195df07" crc="efccbb5b" sha1="83de26d52cb6578d8323551a289223c8a305e37d" offset="0" /> - <rom name="0 - 0008.png" size="0x18a9dd8" crc="7455ebb2" sha1="34576eee067534535cda838a9e94794e2cfee585" offset="0" /> - <rom name="0 - 0009.png" size="0x17a5c57" crc="59ead843" sha1="29c4cd7929cfd68f41d65024ee5ca3cc62fa4a8b" offset="0" /> - <rom name="0 - 0010.png" size="0x186546b" crc="6d3d8c91" sha1="9909322c09277ddd306f10f9a04a897b0fe74961" offset="0" /> - <rom name="0 - 0011.png" size="0x179d3a8" crc="c3911254" sha1="2d2932e97a0b20a9b5e5fd78a3bbad0f1e146813" offset="0" /> - <rom name="0 - 0012.png" size="0x187a9df" crc="f1cdc95d" sha1="aa926c9360edcecdaa3a9ce1b5e17ee61048cee4" offset="0" /> + <rom name="0 - 0001.png" size="0x1ca26ec" crc="d8e18a54" sha1="887a96931bf622cb673f2550323ad3923eff337e" /> + <rom name="0 - 0002.png" size="0x1e37a3d" crc="62ae3535" sha1="d8f6c19c466715df5a568ac7cac8dacb53f2e04a" /> + <rom name="0 - 0003.png" size="0x1ce4f16" crc="fe6c72d9" sha1="2c4412eb518fbac2e8519c87e53270d960ecab53" /> + <rom name="0 - 0004.png" size="0x19a864d" crc="edede3ea" sha1="81914894358c74064aa5f9e980ac37f7140f80c3" /> + <rom name="0 - 0005.png" size="0x18998f4" crc="16837cc0" sha1="eb86b2943cf603a63cd5b94faa0d06ee8a3139d6" /> + <rom name="0 - 0006.png" size="0x195b7e5" crc="3e307e6d" sha1="23ed9ab2a4122d7cb33d8d6174ca901b88647b4d" /> + <rom name="0 - 0007.png" size="0x195df07" crc="efccbb5b" sha1="83de26d52cb6578d8323551a289223c8a305e37d" /> + <rom name="0 - 0008.png" size="0x18a9dd8" crc="7455ebb2" sha1="34576eee067534535cda838a9e94794e2cfee585" /> + <rom name="0 - 0009.png" size="0x17a5c57" crc="59ead843" sha1="29c4cd7929cfd68f41d65024ee5ca3cc62fa4a8b" /> + <rom name="0 - 0010.png" size="0x186546b" crc="6d3d8c91" sha1="9909322c09277ddd306f10f9a04a897b0fe74961" /> + <rom name="0 - 0011.png" size="0x179d3a8" crc="c3911254" sha1="2d2932e97a0b20a9b5e5fd78a3bbad0f1e146813" /> + <rom name="0 - 0012.png" size="0x187a9df" crc="f1cdc95d" sha1="aa926c9360edcecdaa3a9ce1b5e17ee61048cee4" /> </dataarea> </part> </software> @@ -59,21 +59,117 @@ <publisher>Sega Toys</publisher> <part name="cart" interface="sega_beena_cart"> <dataarea name="rom" size="0x800000" width="32" endianness="big"> - <rom loadflag="load16_word_swap" name="S-100002-1200 - Soreike! Anpanman Hajimete Kaketa yo! Oboeta yo! Hiragana Katakana - Gojuuon Board Kinou-tsuki.bin" size="0x00800000" crc="b6e038c9" sha1="b12bd91e8ead04f558d32ce9086102a3c99f13eb" offset="0" /> + <rom loadflag="load16_word_swap" name="S-100002-1200 - Soreike! Anpanman Hajimete Kaketa yo! Oboeta yo! Hiragana Katakana - Gojuuon Board Kinou-tsuki.bin" size="0x00800000" crc="b6e038c9" sha1="b12bd91e8ead04f558d32ce9086102a3c99f13eb" /> </dataarea> <dataarea name="pages" size="0x2000000"> <!-- book pages --> - <rom name="0 - 0001.png" size="0x01b8b6ae" crc="e4c3a37a" sha1="de492d61bf91bee346734f62a6db257a6ce74f1c" offset="0" /> - <rom name="0 - 0002.png" size="0x01c3f600" crc="ef0fccc9" sha1="cc014da292163146e08d89672149ba7dc181f1fc" offset="0" /> - <rom name="0 - 0003.png" size="0x01d61a02" crc="84682ff3" sha1="216425eb85d6cc5855e853d0b135a6426fe2c0a0" offset="0" /> - <rom name="0 - 0004.png" size="0x01e10787" crc="d5aa2d56" sha1="42902317bef31b659e9c40f4c51f554aefd610cf" offset="0" /> - <rom name="0 - 0005.png" size="0x01da7955" crc="e4795152" sha1="5bd9bd97721b1b69b1362b4261052b9e3a58b8c6" offset="0" /> - <rom name="0 - 0006.png" size="0x01d3ac0d" crc="1a58e117" sha1="aa8bb93b8157cc0c8dc895f72203d9ed807e164b" offset="0" /> - <rom name="0 - 0007.png" size="0x01ec5159" crc="f354c1d8" sha1="05959842511ce24faaaf16b7beefc1f3cee3a1e3" offset="0" /> - <rom name="0 - 0008.png" size="0x01e66848" crc="95a956fc" sha1="72e116dd2400d321b704e35e1b8d13d2129cae6c" offset="0" /> - <rom name="0 - 0009.png" size="0x01e5551d" crc="42973b09" sha1="182c26df4a2a29893a6a2efe769a4744084e67aa" offset="0" /> - <rom name="0 - 0010.png" size="0x012bc820" crc="05f22b7f" sha1="a87f840b3c84e7f1886eead28ea9879ca3630e79" offset="0" /> - <rom name="0 - 0011.png" size="0x01213cba" crc="e1e8b81a" sha1="4c0a484b4156fd07a4f2b8eb96d7475e8559c6d0" offset="0" /> - <rom name="0 - 0012.png" size="0x01421db2" crc="6b5728a5" sha1="024d1e0deae7bcbdf7f3b6c4483de91b7fd96961" offset="0" /> + <rom name="0 - 0001.png" size="0x01b8b6ae" crc="e4c3a37a" sha1="de492d61bf91bee346734f62a6db257a6ce74f1c" /> + <rom name="0 - 0002.png" size="0x01c3f600" crc="ef0fccc9" sha1="cc014da292163146e08d89672149ba7dc181f1fc" /> + <rom name="0 - 0003.png" size="0x01d61a02" crc="84682ff3" sha1="216425eb85d6cc5855e853d0b135a6426fe2c0a0" /> + <rom name="0 - 0004.png" size="0x01e10787" crc="d5aa2d56" sha1="42902317bef31b659e9c40f4c51f554aefd610cf" /> + <rom name="0 - 0005.png" size="0x01da7955" crc="e4795152" sha1="5bd9bd97721b1b69b1362b4261052b9e3a58b8c6" /> + <rom name="0 - 0006.png" size="0x01d3ac0d" crc="1a58e117" sha1="aa8bb93b8157cc0c8dc895f72203d9ed807e164b" /> + <rom name="0 - 0007.png" size="0x01ec5159" crc="f354c1d8" sha1="05959842511ce24faaaf16b7beefc1f3cee3a1e3" /> + <rom name="0 - 0008.png" size="0x01e66848" crc="95a956fc" sha1="72e116dd2400d321b704e35e1b8d13d2129cae6c" /> + <rom name="0 - 0009.png" size="0x01e5551d" crc="42973b09" sha1="182c26df4a2a29893a6a2efe769a4744084e67aa" /> + <rom name="0 - 0010.png" size="0x012bc820" crc="05f22b7f" sha1="a87f840b3c84e7f1886eead28ea9879ca3630e79" /> + <rom name="0 - 0011.png" size="0x01213cba" crc="e1e8b81a" sha1="4c0a484b4156fd07a4f2b8eb96d7475e8559c6d0" /> + <rom name="0 - 0012.png" size="0x01421db2" crc="6b5728a5" sha1="024d1e0deae7bcbdf7f3b6c4483de91b7fd96961" /> + </dataarea> + </part> + </software> + + <software name="kazokum" supported="no"> + <description>Kazoku Minna no Nouryoku Trainer</description> + <year>2005</year> + <publisher>Sega Toys</publisher> + <part name="cart" interface="sega_beena_cart"> + <dataarea name="rom" size="0x400000" width="32" endianness="big"> + <rom loadflag="load16_word_swap" name="S-100006-1000 - Kazoku Minna no Nouryoku Trainer (Japan).bin" size="0x00400000" crc="8097f3ec" sha1="1e65579b74f141591db2122b34ce293d1d2120ff" /> + </dataarea> + <dataarea name="pages" size="0x2000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="0x01e37832" crc="8de70b0f" sha1="d198caa20060f49774c2e2103fe1ef168f16e13a" /> + <rom name="0 - 0002.png" size="0x01d7eeb6" crc="c8677ffc" sha1="85419e7ae1f6f85659ab848855be4db192b20e21" /> + <rom name="0 - 0003.png" size="0x01e24e0f" crc="ffd4762a" sha1="9a84422272bed23c77392031c1b858c6ec5e2d1a" /> + <rom name="0 - 0004.png" size="0x01d465df" crc="cb60e2d6" sha1="5324a22fdde1e24f8797cba51e9589f3b81d3e41" /> + <rom name="0 - 0005.png" size="0x01b9db20" crc="fabd3a8f" sha1="255574ae14304d9068029189aeb722357a257c5c" /> + <rom name="0 - 0006.png" size="0x01d98d45" crc="f560da1d" sha1="857ba8882146b2cf8c35b17fb66711310741f52d" /> + <rom name="0 - 0007.png" size="0x01a0648c" crc="6b83e144" sha1="b33cd0ba66270ca99661b28eab5892e21ac42b2f" /> + <rom name="0 - 0008.png" size="0x01dfa9e0" crc="3fd345d6" sha1="8ef21ccfa7dd473f269996bf5de8c7b7c320cd88" /> + <rom name="0 - 0009.png" size="0x01124676" crc="b1a8e3cc" sha1="231048de3bc7863e47a8b5da79a8a5bed501d7b6" /> + <rom name="0 - 0010.png" size="0x01e618a8" crc="571593da" sha1="4125714a58e526b74e7c2e60294bb6450c2bdc8c" /> + </dataarea> + </part> + </software> + + <software name="mbubbub" supported="no"> + <description>Meet Bub-Bub to Eigo Tanken</description> + <year>2010</year> + <publisher>Moonshot</publisher> + <part name="cart" interface="sega_beena_cart"> + <dataarea name="rom" size="0x800000" width="32" endianness="big"> + <rom loadflag="load16_word_swap" name="T-160001-1000 - Meet Bub-Bub to Eigo Tanken (Japan).bin" size="0x00800000" crc="283b3c85" sha1="343c27c192da191d91fea43246da924b8f1af6ee" /> + </dataarea> + <dataarea name="pages" size="0x3000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="0x01f47bf2" crc="05abebd9" sha1="3ebe1d84e05630c62b87206c3cb2963164690971" /> + <rom name="0 - 0002.png" size="0x01cfada2" crc="4bb75849" sha1="368b151b3f2028766ca1b4980e7610021b9ba6fa" /> + <rom name="0 - 0003.png" size="0x01e36d07" crc="198755b3" sha1="24d3a83077de597d1b47db5c1ab97913dacbda8d" /> + <rom name="0 - 0004.png" size="0x020d41a2" crc="2c0032fc" sha1="df25c4886d7ea107c1566e9e3576735db47af503" /> + <rom name="0 - 0005.png" size="0x021a5c58" crc="501027f7" sha1="828ee2de3de6d478c57e256c72b37361b38c11c5" /> + <rom name="0 - 0006.png" size="0x01f3b8c8" crc="7eb4cb7e" sha1="150bafd30d89360366a6052117b76bdb22e0cfc3" /> + <rom name="0 - 0007.png" size="0x020a9378" crc="89106788" sha1="0ae76653260ca74e6fa137836eab8724486e116c" /> + <rom name="0 - 0008.png" size="0x02006605" crc="b74b7bb6" sha1="5fdd587235c8228e3aa41a8e9ffd9b2fc970cf26" /> + <rom name="0 - 0009.png" size="0x01e9bba4" crc="25cf2047" sha1="fb63bf3c6927d51ecc5e7e4de4a8a9f40b78d996" /> + <rom name="0 - 0010.png" size="0x01d6ff5c" crc="316c4d0a" sha1="ecdef9b4e1fec98534f8142ec0eca253eb30ea28" /> + </dataarea> + </part> + </software> + + <software name="osharem" supported="no"> + <description>Oshare Majo Love and Berry-Cute ni Oshare</description> + <year>20??</year> + <publisher>Sega Toys</publisher> + <part name="cart" interface="sega_beena_cart"> + <dataarea name="rom" size="0x800000" width="32" endianness="big"> + <rom loadflag="load16_word_swap" name="S-100013-1101 - Oshare Majo Love and Berry-Cute ni Oshare (Japan).bin" size="0x00800000" crc="f5245eea" sha1="2006c3fd2b662f4bb77388bfeefc2c885908fc5f" /> + </dataarea> + <dataarea name="pages" size="0x3000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="0x0198d462" crc="2d538544" sha1="b941ee5a0ab7b10a72fb966084ed7adbc384fa91" /> + <rom name="0 - 0002.png" size="0x01af32a1" crc="f141c0d1" sha1="89c0ff1ca5beff44a1e044f8aae2e55e549105e6" /> + <rom name="0 - 0003.png" size="0x01c30083" crc="87954a64" sha1="d9d84721d283189626d19655235033c654e9813f" /> + <rom name="0 - 0004.png" size="0x01dffa11" crc="3746d018" sha1="937fd82e8882920f3194eb0c97420a68a4a1132b" /> + <rom name="0 - 0005.png" size="0x01f0860b" crc="ee2776b4" sha1="0b2b099030489551f912a90fbce6a38eb0a56229" /> + <rom name="0 - 0006.png" size="0x01acb747" crc="2f595a0c" sha1="7ce02197c82688c48f6bfd8175ee647c01bcef3a" /> + <rom name="0 - 0007.png" size="0x01d60cb6" crc="74a97b09" sha1="cea02a52355ca503d8702aca202017a0971057e9" /> + <rom name="0 - 0008.png" size="0x01983b69" crc="0fb3c5a8" sha1="be5b3831dc5de811eb18b9439511aad9cd22bf86" /> + <rom name="0 - 0009.png" size="0x01d24a30" crc="4d409c74" sha1="fd4c84ac9f3cc922eb1c8fc2dd141594eff1d6a5" /> + <rom name="0 - 0010.png" size="0x01b31796" crc="c3b9cd4a" sha1="165817c2cc83797bfd6015b49205385df9a1290e" /> + <rom name="0 - 0011.png" size="0x01b0a1b4" crc="38abc9e1" sha1="06321f73833d10c9f2fc76ca0d554eee835a7ea1" /> + <rom name="0 - 0012.png" size="0x019ad5a7" crc="5d3cfe64" sha1="b6170feb62793945dc3fab6bd196990542e1f03a" /> + </dataarea> + </part> + </software> + + <software name="pokebw" supported="no"> + <description>Pocket Monsters Best Wishes! Chinou Ikusei Pokémon Daiundoukai</description> + <year>2010</year> + <publisher>Sega Toys</publisher> + <part name="cart" interface="sega_beena_cart"> + <dataarea name="rom" size="0x800000" width="32" endianness="big"> + <rom loadflag="load16_word_swap" name="S-100042-1000 - Pocket Monsters Best Wishes! Chinou Ikusei Pokémon Daiundoukai (Japan).bin" size="0x00800000" crc="a88ec549" sha1="866b56789fcb118e1ac50a8214a630a092aadd2f" /> + </dataarea> + <dataarea name="pages" size="0x3000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="0x00800000" crc="a88ec549" sha1="866b56789fcb118e1ac50a8214a630a092aadd2f" /> + <rom name="0 - 0002.png" size="0x02000723" crc="0b8cc1e4" sha1="c68e79627e0c13ea1165ce11c4a45ab34afa28f3" /> + <rom name="0 - 0003.png" size="0x01f19d2f" crc="eb600fef" sha1="b16c3698d201fc27fbe94065e3b7392971cb9b70" /> + <rom name="0 - 0004.png" size="0x01e2f618" crc="2e154295" sha1="001d44b79abdeb3ec48d1c898cad98a36fc407a0" /> + <rom name="0 - 0005.png" size="0x01e276d7" crc="4136418f" sha1="733c9c80f8614aaa24e9174e9a5f1c524232cd4c" /> + <rom name="0 - 0006.png" size="0x01e2b00c" crc="1dc6ee4e" sha1="a6d96b70759d50b54fbfff91b03e63a7270907d7" /> + <rom name="0 - 0007.png" size="0x01cff872" crc="1a607e99" sha1="16d3a2f2788b38f451e8cbb44e6a31525586ae5f" /> + <rom name="0 - 0008.png" size="0x01ad9529" crc="6701731b" sha1="d2b6718907513239f664e184cfa5d150d6957289" /> + <rom name="0 - 0009.png" size="0x01b85a1c" crc="5670b958" sha1="84576ba7e1155f3155f65b42af757d41aee80934" /> + <rom name="0 - 0010.png" size="0x01c6296e" crc="66df1325" sha1="49778e96652a113785e3d75b0e6de17d4ebce4ef" /> + <rom name="0 - 0011.png" size="0x01d3f5a5" crc="63fe33c2" sha1="130acb3c9317e21f2fee4e524226ade5df85cec2" /> + <rom name="0 - 0012.png" size="0x01c292dc" crc="c47162c8" sha1="0cb2a72e71082f5ded491dac93562977af6fa984" /> </dataarea> </part> </software> @@ -84,21 +180,21 @@ <publisher>Sega Toys</publisher> <part name="cart" interface="sega_beena_cart"> <dataarea name="rom" size="0x800000" width="32" endianness="big"> - <rom loadflag="load16_word_swap" name="S-100039-1100 - Pocket Monsters Diamond and Pearl Pokemon o Sagase! Meiro de Daibouken!.bin" size="0x00800000" crc="7bbf9599" sha1="25aba3628c627c3ed603f14cb50cfe6101816db7" offset="0" /> + <rom loadflag="load16_word_swap" name="S-100039-1100 - Pocket Monsters Diamond and Pearl Pokemon o Sagase! Meiro de Daibouken!.bin" size="0x00800000" crc="7bbf9599" sha1="25aba3628c627c3ed603f14cb50cfe6101816db7" /> </dataarea> <dataarea name="pages" size="0x2000000"> <!-- book pages --> - <rom name="0 - 0001.png" size="0x0204f417" crc="088c3d4c" sha1="d66a27f30374568998cff2ed89e494ac7f449687" offset="0" /> - <rom name="0 - 0002.png" size="0x020d5ff7" crc="3f992374" sha1="b5dd1f438afc18ac6ca78aa2757129bb1f53b54e" offset="0" /> - <rom name="0 - 0003.png" size="0x020912fe" crc="b064c6ea" sha1="a4107dbcdc40713a651da52653b9e639b2d9addc" offset="0" /> - <rom name="0 - 0004.png" size="0x01d4bccc" crc="6e36704b" sha1="8c92b5ea3f0c6b5fe32b38aa6cb4d53643979305" offset="0" /> - <rom name="0 - 0005.png" size="0x01cc6307" crc="3d97eea3" sha1="274e3f8fa546e123737ee8a835dadcb9ab856cb9" offset="0" /> - <rom name="0 - 0006.png" size="0x0213b831" crc="175f961f" sha1="32dd1aec5d9cdc21b7271c3d03fa7fb40efd8e13" offset="0" /> - <rom name="0 - 0007.png" size="0x0218c656" crc="93c42240" sha1="4c28d441a1869c4575606afd6740cee7f643c427" offset="0" /> - <rom name="0 - 0008.png" size="0x01c103b2" crc="776645c5" sha1="6d2d4ab8e0fb414f9adc3cbb8d800a66fabe52ca" offset="0" /> - <rom name="0 - 0009.png" size="0x01d39b58" crc="aaeeba31" sha1="b14cf1b928f6dd776fe07025af57ca3025adc09e" offset="0" /> - <rom name="0 - 0010.png" size="0x01f12421" crc="b15278dc" sha1="676b0ad811e37fccb4752f0c7dea918feaafe30f" offset="0" /> - <rom name="0 - 0011.png" size="0x01f95984" crc="7ab6d5a4" sha1="730c62496f275e2afa8cb541820393a343406065" offset="0" /> - <rom name="0 - 0012.png" size="0x01caf8d8" crc="4bde2da0" sha1="4cd3056b090baea6c31e22033595d6d62642310d" offset="0" /> + <rom name="0 - 0001.png" size="0x0204f417" crc="088c3d4c" sha1="d66a27f30374568998cff2ed89e494ac7f449687" /> + <rom name="0 - 0002.png" size="0x020d5ff7" crc="3f992374" sha1="b5dd1f438afc18ac6ca78aa2757129bb1f53b54e" /> + <rom name="0 - 0003.png" size="0x020912fe" crc="b064c6ea" sha1="a4107dbcdc40713a651da52653b9e639b2d9addc" /> + <rom name="0 - 0004.png" size="0x01d4bccc" crc="6e36704b" sha1="8c92b5ea3f0c6b5fe32b38aa6cb4d53643979305" /> + <rom name="0 - 0005.png" size="0x01cc6307" crc="3d97eea3" sha1="274e3f8fa546e123737ee8a835dadcb9ab856cb9" /> + <rom name="0 - 0006.png" size="0x0213b831" crc="175f961f" sha1="32dd1aec5d9cdc21b7271c3d03fa7fb40efd8e13" /> + <rom name="0 - 0007.png" size="0x0218c656" crc="93c42240" sha1="4c28d441a1869c4575606afd6740cee7f643c427" /> + <rom name="0 - 0008.png" size="0x01c103b2" crc="776645c5" sha1="6d2d4ab8e0fb414f9adc3cbb8d800a66fabe52ca" /> + <rom name="0 - 0009.png" size="0x01d39b58" crc="aaeeba31" sha1="b14cf1b928f6dd776fe07025af57ca3025adc09e" /> + <rom name="0 - 0010.png" size="0x01f12421" crc="b15278dc" sha1="676b0ad811e37fccb4752f0c7dea918feaafe30f" /> + <rom name="0 - 0011.png" size="0x01f95984" crc="7ab6d5a4" sha1="730c62496f275e2afa8cb541820393a343406065" /> + <rom name="0 - 0012.png" size="0x01caf8d8" crc="4bde2da0" sha1="4cd3056b090baea6c31e22033595d6d62642310d" /> </dataarea> </part> </software> @@ -109,21 +205,46 @@ <publisher>Bandai</publisher> <part name="cart" interface="sega_beena_cart"> <dataarea name="rom" size="0x800000" width="32" endianness="big"> - <rom loadflag="load16_word_swap" name="T-110008-1101 - Yes! PreCure 5 Asonde Oboeyou Hiragana!.bin" size="0x00800000" crc="6ae77335" sha1="29650349b117b96105882da7b12cac8fe9a04813" offset="0" /> + <rom loadflag="load16_word_swap" name="T-110008-1101 - Yes! PreCure 5 Asonde Oboeyou Hiragana!.bin" size="0x00800000" crc="6ae77335" sha1="29650349b117b96105882da7b12cac8fe9a04813" /> </dataarea> <dataarea name="pages" size="0x2000000"> <!-- book pages --> - <rom name="0 - 0001.png" size="0x01fd2372" crc="9290ac04" sha1="d106071e01ee790d85d46a2378ce5f638331b67a" offset="0" /> - <rom name="0 - 0002.png" size="0x0200a259" crc="d919d19b" sha1="20444680d29b6a66471cbdb77537ba054753b9d6" offset="0" /> - <rom name="0 - 0003.png" size="0x01fd80c8" crc="97c2ba5e" sha1="128b226187bfc53e4b1abf7be04c068a61c88240" offset="0" /> - <rom name="0 - 0004.png" size="0x01e53520" crc="05504999" sha1="5e0367e18c3b592c14bda31c07ffae9ec11b1c31" offset="0" /> - <rom name="0 - 0005.png" size="0x01d820ff" crc="586f06b0" sha1="89e66342feb2bf31f3137549999c43e1db3cb5e0" offset="0" /> - <rom name="0 - 0006.png" size="0x01f19795" crc="bb34e7ae" sha1="d4cf3a99400876b25101036ffd4eac3fa2294c36" offset="0" /> - <rom name="0 - 0007.png" size="0x01ea5f1a" crc="b3fe0898" sha1="8d8adc11188e72b7a611463aa02f79f594c1ac5f" offset="0" /> - <rom name="0 - 0008.png" size="0x01c861fa" crc="97768994" sha1="c79a1578ad7af9fc26c6f31a1feaeeeac9e50844" offset="0" /> - <rom name="0 - 0009.png" size="0x01b8988d" crc="b0d4350e" sha1="c9286072197320be847c5a06bc548a10316e344c" offset="0" /> - <rom name="0 - 0010.png" size="0x01c6cf67" crc="057776ac" sha1="b4de54d5242557de642828444da7744031555160" offset="0" /> - <rom name="0 - 0011.png" size="0x01cb84db" crc="ab9576a2" sha1="02e90539aed46f6813cca5a15ade32f323927678" offset="0" /> - <rom name="0 - 0012.png" size="0x02068f02" crc="9122ba08" sha1="4989f83caf182b87721ef839eaf35605e0fa3490" offset="0" /> + <rom name="0 - 0001.png" size="0x01fd2372" crc="9290ac04" sha1="d106071e01ee790d85d46a2378ce5f638331b67a" /> + <rom name="0 - 0002.png" size="0x0200a259" crc="d919d19b" sha1="20444680d29b6a66471cbdb77537ba054753b9d6" /> + <rom name="0 - 0003.png" size="0x01fd80c8" crc="97c2ba5e" sha1="128b226187bfc53e4b1abf7be04c068a61c88240" /> + <rom name="0 - 0004.png" size="0x01e53520" crc="05504999" sha1="5e0367e18c3b592c14bda31c07ffae9ec11b1c31" /> + <rom name="0 - 0005.png" size="0x01d820ff" crc="586f06b0" sha1="89e66342feb2bf31f3137549999c43e1db3cb5e0" /> + <rom name="0 - 0006.png" size="0x01f19795" crc="bb34e7ae" sha1="d4cf3a99400876b25101036ffd4eac3fa2294c36" /> + <rom name="0 - 0007.png" size="0x01ea5f1a" crc="b3fe0898" sha1="8d8adc11188e72b7a611463aa02f79f594c1ac5f" /> + <rom name="0 - 0008.png" size="0x01c861fa" crc="97768994" sha1="c79a1578ad7af9fc26c6f31a1feaeeeac9e50844" /> + <rom name="0 - 0009.png" size="0x01b8988d" crc="b0d4350e" sha1="c9286072197320be847c5a06bc548a10316e344c" /> + <rom name="0 - 0010.png" size="0x01c6cf67" crc="057776ac" sha1="b4de54d5242557de642828444da7744031555160" /> + <rom name="0 - 0011.png" size="0x01cb84db" crc="ab9576a2" sha1="02e90539aed46f6813cca5a15ade32f323927678" /> + <rom name="0 - 0012.png" size="0x02068f02" crc="9122ba08" sha1="4989f83caf182b87721ef839eaf35605e0fa3490" /> + </dataarea> + </part> + </software> + + <software name="precurehc" supported="no"> + <description>Oshare ni Henshin HeartCatch PreCure!</description> + <year>2010</year> + <publisher>Bandai</publisher> + <part name="cart" interface="sega_beena_cart"> + <dataarea name="rom" size="0x800000" width="32" endianness="big"> + <rom loadflag="load16_word_swap" name="T-110015-1000 - Oshare ni Henshin HeartCatch PreCure! (Japan).bin" size="0x00800000" crc="e2575324" sha1="500ad94f4dda4b886ff1991ddc4a730d94b37cd6" /> + </dataarea> + <dataarea name="pages" size="0x3000000"> <!-- book pages --> + <rom name="0 - 0001.png" size="0x01e37d48" crc="579e4159" sha1="75fd0eaa077c12507c78711ce099a76878eb532d" /> + <rom name="0 - 0002.png" size="0x01db5256" crc="9f453453" sha1="b51e2ed7a73b0aff4a8b3510fdffff08b65e91ce" /> + <rom name="0 - 0003.png" size="0x01dfb0f8" crc="68311309" sha1="0194118cb242910b0607fd582374e516c146c04d" /> + <rom name="0 - 0004.png" size="0x01d0e912" crc="4aec06f8" sha1="4ec004b883d2049245c195612aff1f5432eee5ee" /> + <rom name="0 - 0005.png" size="0x01daf868" crc="29825290" sha1="3b7f871b42e93f4c5e0628e58e4ac9167b31e742" /> + <rom name="0 - 0006.png" size="0x01c8de2e" crc="1599df83" sha1="24195c85a66abd87088dafad14765965f4bd11ad" /> + <rom name="0 - 0007.png" size="0x01ce0348" crc="4756a0ae" sha1="bc331f2986b1f412286969212954c61202b49374" /> + <rom name="0 - 0008.png" size="0x01f35f14" crc="b1a80b5a" sha1="8e7fc65993db25d11e9f9c7077b40733fd203f62" /> + <rom name="0 - 0009.png" size="0x0203ebe3" crc="4eb371b4" sha1="01fb11361a2eda3dc636281d0cc8670c065f56f8" /> + <rom name="0 - 0010.png" size="0x01bb54b5" crc="70c6cd1f" sha1="24d1b18ff1540c2d23671ab88aaca4e08dbe3865" /> + <rom name="0 - 0011.png" size="0x01c4a92a" crc="37bbe4a9" sha1="cdc876ae65a91384791b689db8024eb2f169a158" /> + <rom name="0 - 0012.png" size="0x01e16773" crc="8f7ec572" sha1="6433b383cdd164fbb07fccdfed5ce4b37bea7476" /> </dataarea> </part> </software> @@ -134,21 +255,21 @@ <publisher>Bandai</publisher> <part name="cart" interface="sega_beena_cart"> <dataarea name="rom" size="0x800000" width="32" endianness="big"> - <rom loadflag="load16_word_swap" name="T-110012-1000 - Samurai Sentai Shinkenger Battle ga Ippai! Iza Mairu!.bin" size="0x00800000" crc="41ed4615" sha1="f0106c4a79f9aff9815318eadc272c7c62a50ec2" offset="0" /> + <rom loadflag="load16_word_swap" name="T-110012-1000 - Samurai Sentai Shinkenger Battle ga Ippai! Iza Mairu!.bin" size="0x00800000" crc="41ed4615" sha1="f0106c4a79f9aff9815318eadc272c7c62a50ec2" /> </dataarea> <dataarea name="pages" size="0x2000000"> <!-- book pages --> - <rom name="0 - 0001.png" size="0x019ac721" crc="2d276d8a" sha1="ff068e3823c692a21c2134b6a34aa4835d6d8ac1" offset="0" /> - <rom name="0 - 0002.png" size="0x019e6a2b" crc="cea0a7a0" sha1="8bba02926c08b1f976ae62221ef03674d807b50c" offset="0" /> - <rom name="0 - 0003.png" size="0x019e2c25" crc="c983678b" sha1="1526f789405ee21ccd1c6ff0dbf131adca6749fa" offset="0" /> - <rom name="0 - 0004.png" size="0x01854a14" crc="1cd4866e" sha1="edafdd7b34fe2baac8374fc692e91c0e62d3c4c5" offset="0" /> - <rom name="0 - 0005.png" size="0x019e157b" crc="ffbfc659" sha1="f0fdd96f2a641671c0e55b64be11d6fa279c3014" offset="0" /> - <rom name="0 - 0006.png" size="0x018ba810" crc="6b904c5a" sha1="46ca949377cd473a2ad3d67c70c8d12f2cbaaead" offset="0" /> - <rom name="0 - 0007.png" size="0x01969cc7" crc="4bb32ec7" sha1="f7a28ce039dd3dc7ada8eae1d617631391135f66" offset="0" /> - <rom name="0 - 0008.png" size="0x0172a1fe" crc="f41e7f36" sha1="52af6f1b1dd31c75c0004b8280ec6e8da3f57cf1" offset="0" /> - <rom name="0 - 0009.png" size="0x01a7a889" crc="9914b734" sha1="b64ab24e3bf41b07310da2cde90aa2088602aaa1" offset="0" /> - <rom name="0 - 0010.png" size="0x01876e20" crc="937ce7ea" sha1="664e8bdb23ff2be1183ea235504fba289f5af279" offset="0" /> - <rom name="0 - 0011.png" size="0x018f0769" crc="aeb76e32" sha1="797ebb767c30496d1caddb15a24c397941b295fd" offset="0" /> - <rom name="0 - 0012.png" size="0x018bfb44" crc="ed48a893" sha1="e0ca297e88dec53c74462a3018c904d41ffde037" offset="0" /> + <rom name="0 - 0001.png" size="0x019ac721" crc="2d276d8a" sha1="ff068e3823c692a21c2134b6a34aa4835d6d8ac1" /> + <rom name="0 - 0002.png" size="0x019e6a2b" crc="cea0a7a0" sha1="8bba02926c08b1f976ae62221ef03674d807b50c" /> + <rom name="0 - 0003.png" size="0x019e2c25" crc="c983678b" sha1="1526f789405ee21ccd1c6ff0dbf131adca6749fa" /> + <rom name="0 - 0004.png" size="0x01854a14" crc="1cd4866e" sha1="edafdd7b34fe2baac8374fc692e91c0e62d3c4c5" /> + <rom name="0 - 0005.png" size="0x019e157b" crc="ffbfc659" sha1="f0fdd96f2a641671c0e55b64be11d6fa279c3014" /> + <rom name="0 - 0006.png" size="0x018ba810" crc="6b904c5a" sha1="46ca949377cd473a2ad3d67c70c8d12f2cbaaead" /> + <rom name="0 - 0007.png" size="0x01969cc7" crc="4bb32ec7" sha1="f7a28ce039dd3dc7ada8eae1d617631391135f66" /> + <rom name="0 - 0008.png" size="0x0172a1fe" crc="f41e7f36" sha1="52af6f1b1dd31c75c0004b8280ec6e8da3f57cf1" /> + <rom name="0 - 0009.png" size="0x01a7a889" crc="9914b734" sha1="b64ab24e3bf41b07310da2cde90aa2088602aaa1" /> + <rom name="0 - 0010.png" size="0x01876e20" crc="937ce7ea" sha1="664e8bdb23ff2be1183ea235504fba289f5af279" /> + <rom name="0 - 0011.png" size="0x018f0769" crc="aeb76e32" sha1="797ebb767c30496d1caddb15a24c397941b295fd" /> + <rom name="0 - 0012.png" size="0x018bfb44" crc="ed48a893" sha1="e0ca297e88dec53c74462a3018c904d41ffde037" /> </dataarea> </part> </software> diff --git a/hash/snes.xml b/hash/snes.xml index 6b13af4d9d2..66c9d39f6cd 100644 --- a/hash/snes.xml +++ b/hash/snes.xml @@ -518,6 +518,30 @@ Beyond that last category are the roms waiting to be classified. </part> </software> + <software name="arcanap" cloneof="arcana"> + <description>Arcana (USA, prototype)</description> + <year>1992</year> + <publisher>HAL America</publisher> + <part name="cart" interface="snes_cart"> + <feature name="pcb" value="SHVC-2P3B-01" /> + <feature name="u1" value="U1 EPROM(J) [TC574000D-150]" /> + <feature name="u2" value="U2 EPROM(J) [TC574000D-150]" /> + <feature name="u3" value="U3 SRAM" /> + <feature name="u4" value="U4 74F139" /> + <feature name="u5" value="U5 CIC" /> + <feature name="lockout" value="D411 (BB)" /> + <feature name="battery" value="BATT CR2032 [empty]" /> + <feature name="cart_model" value="no shell" /> + <feature name="slot" value="lorom" /> + <dataarea name="rom" size="1048576"> + <rom name="arcana 0.u1" size="524288" crc="31e3efd0" sha1="bc5a06260fb2bb69c0edf8008801e669a949f9cd" offset="0x000000" /> + <rom name="arcana 1.u2" size="524288" crc="8014270b" sha1="d41446f59bc55af242f34ee8e660505486afcf2f" offset="0x080000" /> + </dataarea> + <dataarea name="nvram" size="8192"> + </dataarea> + </part> + </software> + <software name="metaljck"> <!-- ruiner9 --> <description>Armored Police Metal Jack (USA, Prototype 19920730)</description> @@ -968,6 +992,78 @@ Beyond that last category are the roms waiting to be classified. </part> </software> + <software name="ejimus" cloneof="ejim"> + <description>Earthworm Jim - GamesMaster Special Edition (USA, prototype 19940804)</description> + <year>1994</year> + <publisher>Playmates Interactive</publisher> + <part name="cart" interface="snes_cart"> + <feature name="pcb" value="SHVC-8PV5B-01" /> + <feature name="u1" value="U1 4/8M EPROM(J)" /> + <feature name="u2" value="U2 4/8M EPROM(J)" /> + <feature name="u3" value="U3 4/8M EPROM(J)" /> + <feature name="u4" value="U4 4/8M EPROM(J)" /> + <feature name="u5" value="U5 4/8M EPROM(J)" /> + <feature name="u6" value="U6 4/8M EPROM(J)" /> + <feature name="u7" value="U7 4/8M EPROM(J)" /> <!-- empty socket --> + <feature name="u8" value="U8 4/8M EPROM(J)" /> <!-- empty socket --> + <feature name="u9" value="U9 16/64/256K SRAM" /> <!-- empty socket --> + <feature name="u10" value="U10 MM1134 [1134B]" /> + <feature name="u11" value="U11 EP330 [EP330-15CN]" /> + <feature name="u12" value="U12 EP330 [EP330-15CN]" /> + <feature name="u13" value="U13 LS157" /> + <feature name="u14" value="U14 CIC" /> + <feature name="lockout" value="D413A" /> + <feature name="dipswitch" value="DSW1" /> <!-- (.''..'..) --> + <feature name="battery" value="BATT1 CR2032" /> + <feature name="cart_model" value="no shell" /> + <feature name="slot" value="hirom" /> + <dataarea name="rom" size="3145728"> + <rom name="ewj-gm 1 04-08-94.u1" size="524288" crc="7461fe8d" sha1="168b03f255e4512f4f2758eadf9c497cf2bc794e" offset="0x000000" /> <!-- EWJ-GM ① 04/08/94 --> + <rom name="ewj-gm 2 04-08-94.u2" size="524288" crc="ef8c7931" sha1="6f4eda60d53957a96f66e5965f1d5db06e6e1cbb" offset="0x080000" /> <!-- EWJ-GM ② 04/08/94 --> + <rom name="ewj-gm 3 04-08-94.u3" size="524288" crc="2e3fbf37" sha1="bbb801d98e0f80e14cccb0e37498485c89c9e5b3" offset="0x100000" /> <!-- EWJ-GM ③ 04/08/94 --> + <rom name="ewj-gm 4 04-08-94.u4" size="524288" crc="0d8ac762" sha1="3ea48fd49b4769d8df5c0e14c69c56708f9d5872" offset="0x180000" /> <!-- EWJ-GM ④ 04/08/94 --> + <rom name="ewj-gm 5 04-08-94.u5" size="524288" crc="c1811921" sha1="583b7003daf67ba15ecaec008abf444c4bcbe0d2" offset="0x200000" /> <!-- EWJ-GM ⑤ 04/08/94 --> + <rom name="ewj-gm 6 04-08-94.u6" size="524288" crc="47e381ff" sha1="8bb418fefe840b22a9ac1f23eda4d075d0d83c2b" offset="0x280000" /> <!-- EWJ-GM ⑥ 04/08/94 --> + </dataarea> + </part> + </software> + + <software name="ejimup" cloneof="ejim"> + <description>Earthworm Jim (USA, prototype 19940819)</description> + <year>1994</year> + <publisher>Playmates Interactive</publisher> + <part name="cart" interface="snes_cart"> + <feature name="pcb" value="SHVC-8PV5B-01" /> + <feature name="u1" value="U1 4/8M EPROM(J)" /> + <feature name="u2" value="U2 4/8M EPROM(J)" /> + <feature name="u3" value="U3 4/8M EPROM(J)" /> + <feature name="u4" value="U4 4/8M EPROM(J)" /> + <feature name="u5" value="U5 4/8M EPROM(J)" /> + <feature name="u6" value="U6 4/8M EPROM(J)" /> + <feature name="u7" value="U7 4/8M EPROM(J)" /> <!-- empty socket --> + <feature name="u8" value="U8 4/8M EPROM(J)" /> <!-- empty socket --> + <feature name="u9" value="U9 16/64/256K SRAM" /> <!-- empty socket --> + <feature name="u10" value="U10 MM1134 [1134B]" /> + <feature name="u11" value="U11 EP330 [EP330-15CN]" /> + <feature name="u12" value="U12 EP330 [EP330-15CN]" /> + <feature name="u13" value="U13 LS157 [SN74LS157N]" /> + <feature name="u14" value="U14 CIC" /> + <feature name="lockout" value="D411A 9243 CA" /> + <feature name="dipswitch" value="DSW1" /> <!-- (.''..'.') --> + <feature name="battery" value="BATT1 CR2032" /> + <feature name="cart_model" value="no shell" /> + <feature name="slot" value="hirom" /> + <dataarea name="rom" size="3145728"> + <rom name="ewj 1 19-8-94.u1" size="524288" crc="72e27fc4" sha1="2e2e10ea6e6f39fbf85adf0c3b3d86f4d4b07714" offset="0x000000" /> <!-- EWJ ① 19/8/94 --> + <rom name="ewj 2 19-8-94.u2" size="524288" crc="ef8c7931" sha1="6f4eda60d53957a96f66e5965f1d5db06e6e1cbb" offset="0x080000" /> <!-- EWJ ② 19/8/94 --> + <rom name="ewj 3 19-8-94.u3" size="524288" crc="61def4d8" sha1="d2e4a958b9a058833d3f18172581cea5e96ed730" offset="0x100000" /> <!-- EWJ ③ 19/8/94 --> + <rom name="ewj 4 19-8-94.u4" size="524288" crc="0c8d03c4" sha1="49cf61885446dc44a79da4942d1e4255839b7fa3" offset="0x180000" /> <!-- EWJ ④ 19/8/94 --> + <rom name="ewj 5 19-8-94.u5" size="524288" crc="1d22c72f" sha1="e2d7844569efadf7f49ca6ccc2a3678615797fca" offset="0x200000" /> <!-- EWJ ⑤ 19/8/94 --> + <rom name="u6" size="524288" crc="03d4d84e" sha1="e18102461fdcbf8dd4fe9e94eba1533fc0070a49" offset="0x280000" /> + </dataarea> + </part> + </software> + <software name="espnspedp" cloneof="espnsped"> <!-- retrogamesuk --> <!-- Notes: There is no sram chip on this prototype board --> @@ -1616,6 +1712,29 @@ Beyond that last category are the roms waiting to be classified. </software> --> + <software name="missile" cloneof="arcadeac"> + <description>Missile Command (prototype 19970210)</description> + <year>1997</year> + <publisher>Atari</publisher> + <part name="cart" interface="snes_cart"> + <feature name="pcb" value="SHVC-2P3B-01" /> + <feature name="u1" value="U1 EPROM(J)" /> + <feature name="u2" value="U2 EPROM(J)" /> <!-- empty socket --> + <feature name="u3" value="U3 SRAM [LH5168FB-10TL]" /> + <feature name="u4" value="U4 74F139" /> + <feature name="u5" value="U5 CIC" /> + <feature name="lockout" value="D411A 9334 BA" /> + <feature name="battery" value="BATT CR2032" /> + <feature name="cart_model" value="no shell" /> + <feature name="slot" value="lorom" /> + <dataarea name="rom" size="524288"> + <rom name="u1 2-10 mc.u1" size="524288" crc="c725c96d" sha1="0580dc6375471c4c88697d65998d09d8d962124f" /> <!-- U1 2/10 MC --> + </dataarea> + <dataarea name="nvram" size="8192"> + </dataarea> + </part> + </software> + <software name="mk3up" cloneof="mk3"> <!-- legrospixel.com --> <description>Mortal Kombat 3 (USA, Prototype 19950713)</description> @@ -2768,6 +2887,31 @@ Beyond that last category are the roms waiting to be classified. </part> </software> + <software name="snovap" cloneof="snova"> + <description>Super Nova (prototype)</description> + <year>1993</year> + <publisher>Taito</publisher> + <part name="cart" interface="snes_cart"> + <feature name="pcb" value="SHVC-4PV5B-01" /> + <feature name="u1" value="U1 EPROM [M2704001-12F1]" /> + <feature name="u2" value="U2 EPROM [M2704001-12F1]" /> + <feature name="u3" value="U3 EPROM" /> <!-- empty socket --> + <feature name="u4" value="U4 EPROM" /> <!-- empty socket --> + <feature name="u5" value="U5 SRAM" /> <!-- empty socket --> + <feature name="u6" value="U6 PLD [EP330-15CN]" /> + <feature name="u7" value="U7 74LS157 [SN74LS157N]" /> + <feature name="u8" value="U8 CIC" /> + <feature name="lockout" value="D411A 9307 BA" /> + <feature name="battery" value="BATT CR2032 [empty]" /> + <feature name="cart_model" value="SNS-006" /> + <feature name="slot" value="lorom" /> + <dataarea name="rom" size="1048576"> + <rom name="dara 0.u1" size="524288" crc="df7d8cf7" sha1="198c0896e7355fb0792a17de21cc61c22e0c3fc9" offset="0x000000" /> <!-- ダラ 0 --> + <rom name="dara 1.u2" size="524288" crc="afbc322c" sha1="e5aa3c37e44d221bb568a6748db6d15c99eef9b0" offset="0x080000" /> <!-- ダラ 1 --> + </dataarea> + </part> + </software> + <!-- <software name="spinbalup" cloneof="spinbal"> <!- - retrogamesuk - -> @@ -9590,7 +9734,7 @@ more investigation needed... <publisher>T&E Soft</publisher> <info name="serial" value="SHVC-AC6J-JPN" /> <info name="release" value="19961220" /> - <info name="alt_title" value="クオンハ SFC" /> + <info name="alt_title" value="クオンパ SFC" /> <sharedfeat name="compatibility" value="NTSC"/> <part name="cart" interface="snes_cart"> <feature name="pcb" value="SHVC-1A3M-30" /> @@ -13531,7 +13675,7 @@ more investigation needed... </part> </software> - <software name="gdleena"> + <software name="gdleena" cloneof="gdleen"> <description>Gdleen (Jpn)</description> <year>1991</year> <publisher>Seta</publisher> @@ -15909,7 +16053,7 @@ more investigation needed... </part> </software> - <software name="kamaita1"> + <software name="kamaita1" cloneof="kamaita"> <description>Kamaitachi no Yoru (Jpn, Alt)</description> <year>1994</year> <publisher>Chunsoft</publisher> @@ -28089,7 +28233,7 @@ Alternate board (XL-1) </part> </software> - <software name="sscope6j" cloneof="sscope6"> + <software name="sscope6j" cloneof="nscope6"> <description>Super Scope 6 (Jpn)</description> <year>1993</year> <publisher>Nintendo</publisher> @@ -31904,7 +32048,7 @@ Alternate board (XL-1) </part> </software> - <software name="yuyua"> + <software name="yuyua" cloneof="yuyu"> <description>Yu Yu Hakusho (Jpn, Alt)</description> <year>1993</year> <publisher>Namco</publisher> @@ -36429,7 +36573,7 @@ List of unclassified roms </part> </software> - <software name="classro2" cloneof="classrod"> + <software name="classro2"> <description>Classic Road II (Jpn)</description> <year>1995</year> <publisher>Victor Entertainment</publisher> @@ -38432,18 +38576,6 @@ List of unclassified roms </part> </software> - <software name="ejimus" cloneof="ejim"> - <description>Earthworm Jim (USA, GamesMaster Special Edition)</description> - <year>1994</year> - <publisher>Playmates Interactive</publisher> - <part name="cart" interface="snes_cart"> - <feature name="slot" value="hirom" /> - <dataarea name="rom" size="3145728"> - <rom name="earthworm jim (usa) (gamesmaster special edition).sfc" size="3145728" crc="b1eaad9e" sha1="681d17432e2d337aaeeab4039117733c35575235" offset="0x000000" /> - </dataarea> - </part> - </software> - <software name="ejim2up" cloneof="ejim2"> <description>Earthworm Jim 2 (USA, Prototype)</description> <year>1995</year> @@ -44504,7 +44636,7 @@ List of unclassified roms </part> </software> - <software name="keiba8sa"> + <software name="keiba8sa" cloneof="keiba8s"> <description>Keiba Eight Special (Jpn)</description> <year>1993</year> <publisher>Misawa Entertainment</publisher> @@ -47246,7 +47378,7 @@ to ensure nothing has been touched in the Retro Quest cart production in 2013/20 <publisher>Shouei System</publisher> <info name="serial" value="SHVC-24" /> <info name="release" value="19940826" /> - <info name="alt_title" value="松村邦洋伝 最強の歴史をぬりかえ ろ!" /> + <info name="alt_title" value="松村邦洋伝 最強の歴史をぬりかえろ!" /> <part name="cart" interface="snes_cart"> <feature name="slot" value="hirom" /> <dataarea name="rom" size="3145728"> @@ -48314,7 +48446,7 @@ to ensure nothing has been touched in the Retro Quest cart production in 2013/20 <part name="cart" interface="snes_cart"> <feature name="slot" value="lorom" /> <dataarea name="rom" size="1572864"> - <rom name="mr. tuff (europe) (en,fr,de,es,it) (proto) (1994-12-05).sfc" size="1572864" crc="78cd52d5" sha1="52e7d817807a2488555e68f4273aa859c07efd87" offset="0x000000" /> + <rom name="mr. tuff (europe) (en,fr,de,es,it) (proto) (1994-12-05).sfc" size="1572864" crc="83f87bb7" sha1="17efa7bf116a462abedd3ea2cb59ddd1b8f9c327" /> </dataarea> </part> </software> @@ -54168,7 +54300,7 @@ to ensure nothing has been touched in the Retro Quest cart production in 2013/20 </part> </software> - <software name="shinstrk"> + <software name="shinstrk" cloneof="stng"> <description>Shin Star Trek - Ooinaru Isan IFD no Nazo o Oe (Jpn)</description> <year>1995</year> <publisher>Takuma Shoten</publisher> @@ -58742,7 +58874,7 @@ to ensure nothing has been touched in the Retro Quest cart production in 2013/20 </part> </software> - <software name="sscope6"> + <software name="sscope6" cloneof="nscope6"> <description>Super Scope 6 (USA)</description> <year>1992</year> <publisher>Nintendo</publisher> diff --git a/hash/spectrum_cass.xml b/hash/spectrum_cass.xml index 10c9d107ef3..b65ca4b6741 100644 --- a/hash/spectrum_cass.xml +++ b/hash/spectrum_cass.xml @@ -4327,7 +4327,7 @@ <publisher>Computer Emuzone</publisher> <part name="cass" interface="spectrum_cass"> <dataarea name="cass" size="60396"> - <rom name="betiled! español.tzx" size="60396" crc="8eabeb69" sha1="d7eeeda47f9b11b65155d95620794e212b8d783f"/> + <rom name="betiled! espanol.tzx" size="60396" crc="8eabeb69" sha1="d7eeeda47f9b11b65155d95620794e212b8d783f"/> </dataarea> </part> </software> @@ -17588,7 +17588,7 @@ <software name="moritz3"> <description>Super Moritz</description> - <year>208</year> + <year>2018</year> <publisher>Sebastian Braunert</publisher> <part name="cass" interface="spectrum_cass"> <dataarea name="cass" size="51661"> @@ -90118,7 +90118,7 @@ </dataarea> </part> </software> - + <software name="lospajar"> <description>Los Pajaros De Bangkok</description> <year>19??</year> diff --git a/hash/spectrum_mgt_flop.xml b/hash/spectrum_mgt_flop.xml index 70a04ebab83..61ce38e3952 100644 --- a/hash/spectrum_mgt_flop.xml +++ b/hash/spectrum_mgt_flop.xml @@ -15,13 +15,13 @@ for disciple, must use matching rom/system disk versions: v2 rom -> system disk/system tape ver 2, 2b, 2c v3 rom -> system disk/system tape ver 3a, 3b or 3d - - for plusd, must use matching rom/system disk versions: + + for plusd, must use matching rom/system disk versions: v1 rom -> system disk/system tape ver 1 v1a rom -> system disk/system tape ver 2a --> -<softwarelist name="spectrum_mgt_flop" description="ZX Spectrum MGT Disciple/Plus D disks"> +<softwarelist name="spectrum_mgt_flop" description="ZX Spectrum MGT DISCiPLE/+D disks"> <software name="plusdsys"> <description>Plus D System Disk v2a</description> <year>1986</year> diff --git a/hash/svision.xml b/hash/svision.xml index d09a3c3a619..2ff017a5c1b 100644 --- a/hash/svision.xml +++ b/hash/svision.xml @@ -186,6 +186,17 @@ </part> </software> + <software name="crsshigh"> + <description>Cross High (Euro, USA)</description> + <year>1991</year> + <publisher>GTC Inc</publisher> + <part name="cart" interface="svision_cart"> + <dataarea name="rom" size="65536"> + <rom name="crsshigh.bin" size="65536" crc="1e6836a2" sha1="efc3a8065d6eefd0f461c0c86ef66197d761f569" offset="000000" /> + </dataarea> + </part> + </software> + <software name="crystbal"> <description>Crystball (Euro, USA)</description> <year>1991</year> @@ -237,7 +248,7 @@ <software name="eaglplan"> <description>Eagle Plan (Euro, USA)</description> <year>1992</year> - <publisher>GTC Inc.</publisher> + <publisher>GTC Inc</publisher> <info name="serial" value="SV10005" /> <part name="cart" interface="svision_cart"> diff --git a/hash/telestory_cart.xml b/hash/telestory_cart.xml new file mode 100644 index 00000000000..a9a4c773286 --- /dev/null +++ b/hash/telestory_cart.xml @@ -0,0 +1,87 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<!-- + +Cart pinout: + +Glob up, edge connector towards you. Odd pins 1-47 on top, right to left. +Even pins 2-48 on bottom, pin 2 under pin 1, pin 48 under pin 47. + +1 GND 2 GND +3 A1 4 A0 +5 A3 6 A2 +7 A5 8 A4 +9 A7 10 A6 +11 A18 12 A17 +13 A20 14 A21 +15 A8 16 A19 +17 A10 18 A9 +19 A12 20 A11 +21 A14 22 A13 +23 A16 24 A15 +25 /OE 26 GND +27 VCC (3.3v) 28 GND +29 N/C 30 N/C +31 D7 32 D15 +33 D6 34 D14 +35 D5 36 D13 +37 D4 38 D12 +39 D3 40 D11 +41 D2 42 D10 +43 D1 44 D9 +45 D0 46 D8 +47 to pin 48 48 to pin 47 + + +Undumped carts: + +-Power Ranger Mystic Force - Whispering Voices / Code Busters (USA) +-Thomas & Friends - Thomas Visits the Toy Shop / Thomas' Milkshake Mix (USA) +-Cinderella - Cinderella / Beauties in Bloom (USA) +-Dora the Explorer - At the Carnival / Dora Goes To School (USA) +-Winnie the Pooh - Bounce, Tigger, Bounce / Pooh's Honey Tree (USA) +-Spongebob SquarePants - Ice-Cream Dreams / Stop the Presses! (USA) +-The Lion King - The Lion King / The Lion King II - Simba's Pride (USA) +-Cenerentola - Cenerentola / Cenerentola Bellezze in Fiore (Italy) +-Il Re Reone - Il Re Leone / Il Re Leone 2: Il Regno di Simba (Italy) +-Winnie the Pooh - Salta Tigro, salta! / Winnie the Pooh l'orsetto goloso (Italy) + +--> + +<softwarelist name="telestory_cart" description="JAKKS Pacific Telestory cartridges"> + + <software name="cinders" supported="no"> + <description>La Cenicienta - Bellezas en Flor / Cinderella - Beauties in Bloom (Spain)</description> + <year>2006</year> + <publisher>JAKKS Pacific / Toymax</publisher> + <part name="cart" interface="telestory_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="telestorycinderellasp.bin" size="0x400000" crc="e1b2fd69" sha1="0f3109f30672dacbf52668d485eeed51829993a9"/> + </dataarea> + </part> + </software> + + <software name="poohs" supported="no"> + <description>Winnie the Pooh - Salta, Tigger, Salta / Winnie the Pooh - Bounce, Tigger, Bounce (Spain)</description> + <year>2006</year> + <publisher>JAKKS Pacific / Toymax</publisher> + <part name="cart" interface="telestory_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="telestorypoohsp.bin" size="0x400000" crc="f0ef00e8" sha1="bc407c127a64f6b5cfcf3239f1af3d7896d5a6c2"/> + </dataarea> + </part> + </software> + + <software name="lionkings" supported="no"> + <description>El Rey León II - El orgullo de Simba / The Lion King II - Simba's Pride (Spain)</description> + <year>2006</year> + <publisher>JAKKS Pacific / Toymax</publisher> + <part name="cart" interface="telestory_cart"> + <dataarea name="rom" size="0x800000"> + <rom name="telestorylionkingsp.bin" size="0x800000" crc="459ed493" sha1="8528d4fd5d4a7ff457935d618527621b8ec2a100"/> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/hash/vbaby_cart.xml b/hash/vbaby_cart.xml new file mode 100644 index 00000000000..00cdf997530 --- /dev/null +++ b/hash/vbaby_cart.xml @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<!-- +Cart info: + +Glob up, edge connector towards you. +Pins 1-10 on top, left to right. Pins 11-20 on bottom, pin 11 under pin 10, pin 20 under pin 1. + +1 VCC (3.3V) 20 cart grounds this to indicate inserted +2 R/B 19 N/C +3 GND 18 /RE +4 /WE 17 ALE +5 GND 16 IO7 +6 IO6 15 IO5 +7 IO4 14 IO3 +8 IO2 13 /CE +9 IO0 12 IO1 +10 CLE 11 GND + +Cart 52-107122-022(SP) "Aventuras en el Zoo" is a ROMless cart that unlocks the console internal bundled game. + +--> + +<softwarelist name="vbaby_cart" description="VTech V.Baby cartridges"> + <!-- note these are NAND parts. + the dump doesn't contain GPNANDNAND strings so probably not booted from? --> + + <software name="eljardin" supported="no"> + <description>El Jardín de los Sueños... (Spain)</description> + <year>2007</year> + <publisher>VTech</publisher> + <info name="serial" value="52-220507(SP)" /> + <part name="cart" interface="vbaby_cart"> <!-- dumped as hy27us08121a, ident returned C2 5A --> + <dataarea name="rom" size="0x4200000"> + <rom name="vbaby_eljardin_as_hy27us08121a.bin" size="0x4200000" crc="b7c946c5" sha1="16d80c914bcc279d131336b8194adb61558b05fa" /> + </dataarea> + </part> + </software> + +</softwarelist> + + diff --git a/hash/vboy.xml b/hash/vboy.xml index 0eb438d1cd5..2d1ef5b522a 100644 --- a/hash/vboy.xml +++ b/hash/vboy.xml @@ -26,7 +26,7 @@ According to Planet Virtual Boy, the following undumped protos exist <feature name="u2" value="U2" /> <feature name="u3" value="U3" /> <feature name="battery" value="BT1" /> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vue-vpbe-0.u1" size="1048576" crc="bb71b522" sha1="5177015a91442e56bd76af39447bca365e06c272" offset="000000" /> </dataarea> </part> @@ -40,7 +40,7 @@ According to Planet Virtual Boy, the following undumped protos exist <publisher>Nintendo</publisher> <info name="serial" value="VUE-VBHE-JPN, VUE-VBHE-USA"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="bound high! (ju).bin" size="2097152" crc="e81a3703" sha1="1196ef8b9a96a0ff2f3634f8eb1c4865c0fb6b01" offset="000000" /> </dataarea> </part> @@ -54,7 +54,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VGPJ-JPN, VUE-VGPJ-USA"/> <info name="release" value="19950701 (JPN), 19950814 (USA)"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="galactic pinball (japan, usa).bin" size="1048576" crc="c9710a36" sha1="93a25abf4f86e71a49c1c3a470140bb40cb693d6" offset="000000" /> </dataarea> </part> @@ -68,10 +68,10 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VVGE-USA"/> <info name="release" value="199511xx"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="golf (usa).bin" size="2097152" crc="2199af41" sha1="23ce3c174789cdd306497d86cb2c4e76ba8b06e5" offset="000000" /> </dataarea> - <dataarea name="sram" size="8192" width="8" endianness="little"> + <dataarea name="sram" size="8192"> </dataarea> </part> </software> @@ -84,7 +84,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VIMJ-JPN"/> <info name="release" value="19951013"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="innsmouth no yakata (japan).bin" size="1048576" crc="83cb6a00" sha1="37e06e53ce2810e870835c48decdd6c72079bfda" offset="000000" /> </dataarea> </part> @@ -100,7 +100,7 @@ According to Planet Virtual Boy, the following undumped protos exist <part name="cart" interface="vboy_cart"> <feature name="pcb" value="VUE-AA-01(K)" /> <feature name="u1" value="U1 PRG" /> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vue-vjbe-0.u1" size="1048576" crc="a44de03c" sha1="0e086d7ef2bd8b97315196943fd0b71da07aa8f1" offset="000000" /> </dataarea> </part> @@ -114,7 +114,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VJBJ-JPN"/> <info name="release" value="19950929"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="jack bros. no meiro de hiihoo! (japan).bin" size="1048576" crc="cab61e8b" sha1="a973406590382ee503037271330d68d2834b79db" offset="000000" /> </dataarea> </part> @@ -130,7 +130,7 @@ According to Planet Virtual Boy, the following undumped protos exist <part name="cart" interface="vboy_cart"> <feature name="pcb" value="VUE-AA-01" /> <feature name="u1" value="U1 PRG" /> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vue-vmcj-0.u1" size="1048576" crc="a47de78c" sha1="7556a778b60490bdb81774bcbaa7413fc84cb985" offset="000000" /> </dataarea> </part> @@ -144,7 +144,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VMTJ-JPN, VUE-VMTJ-USA"/> <info name="release" value="19950721 (JPN), 19950814 (USA)"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="524288" width="32" endianness="little"> + <dataarea name="rom" size="524288" width="32"> <rom name="mario's tennis (japan, usa).bin" size="524288" crc="7ce7460d" sha1="5162f7fa9e3eae4338c53ccba641ba080c768754" offset="000000" /> </dataarea> </part> @@ -160,7 +160,7 @@ According to Planet Virtual Boy, the following undumped protos exist <part name="cart" interface="vboy_cart"> <feature name="pcb" value="VUE-AA-01" /> <feature name="u1" value="U1 PRG" /> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="vue-vnfe-0.u1" size="2097152" crc="df4d56b4" sha1="f4a4c7928f15102cf14c90c5f044e5f7cc7c32f9" offset="000000" /> </dataarea> </part> @@ -172,7 +172,7 @@ According to Planet Virtual Boy, the following undumped protos exist <publisher>Bullet-Proof Software</publisher> <info name="alt_title" value="ニコちゃんバトル"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="nikochan battle (j)(prototype).bin" size="1048576" crc="f3cd40dd" sha1="217ca062f65d4e8b2848085918af5ac4b33b12d4" offset="000000" /> </dataarea> </part> @@ -188,7 +188,7 @@ According to Planet Virtual Boy, the following undumped protos exist <part name="cart" interface="vboy_cart"> <feature name="pcb" value="VUE-AA-01" /> <feature name="u1" value="U1 PRG" /> - <dataarea name="rom" size="524288" width="32" endianness="little"> + <dataarea name="rom" size="524288" width="32"> <rom name="vue-vh2e-0.u1" size="524288" crc="19bb2dfb" sha1="80216b2874cf162f301d571bb8aebc98d80b4f3e" offset="000000" /> </dataarea> </part> @@ -202,7 +202,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VREE-USA"/> <info name="release" value="19950814"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="red alarm (usa).bin" size="1048576" crc="aa10a7b4" sha1="494fa60cb8997880b4e8cd3270b21d6c2768a48a" offset="000000" /> </dataarea> </part> @@ -216,7 +216,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VREJ-JPN"/> <info name="release" value="19950721"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="red alarm (japan).bin" size="1048576" crc="7e85c45d" sha1="f5057fa9bfd9d60b9dcfc004cfdd12aa8eb1cb4a" offset="000000" /> </dataarea> </part> @@ -230,7 +230,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VSDJ-JPN"/> <info name="release" value="19951222"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="sd gundam - dimension war (japan).bin" size="1048576" crc="44788197" sha1="1a67f6bdb45db46e22b8aadea754a68ad379ae29" offset="000000" /> </dataarea> </part> @@ -244,7 +244,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VSPJ-JPN"/> <info name="release" value="19951201"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="524288" width="32" endianness="little"> + <dataarea name="rom" size="524288" width="32"> <rom name="space invaders - virtual collection (japan).bin" size="524288" crc="fa44402d" sha1="16ad904faafd24642dfd056d10a768e81f0d9bfa" offset="000000" /> </dataarea> </part> @@ -255,7 +255,7 @@ According to Planet Virtual Boy, the following undumped protos exist <year>1995</year> <publisher>Nintendo</publisher> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="space pinball prototype (j).bin" size="2097152" crc="44c2b723" sha1="dc182360c7c8d26323db8921f09db76638e81ced" offset="000000" /> </dataarea> </part> @@ -269,7 +269,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VSSJ-JPN"/> <info name="release" value="19950929"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="524288" width="32" endianness="little"> + <dataarea name="rom" size="524288" width="32"> <rom name="space squash (japan).bin" size="524288" crc="60895693" sha1="3f08cae2b6f9e386529949ff954220860db1af64" offset="000000" /> </dataarea> </part> @@ -283,10 +283,10 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VTBJ-JPN, VUE-VTBJ-USA"/> <info name="release" value="19950721 (JPN), 19950814 (USA)"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="teleroboxer (japan, usa).bin" size="1048576" crc="36103000" sha1="c59e020f9674774c5cbc022317ebba0eb1d744f7" offset="000000" /> </dataarea> - <dataarea name="sram" size="8192" width="8" endianness="little"> + <dataarea name="sram" size="8192"> </dataarea> </part> </software> @@ -299,7 +299,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VH2J-JPN"/> <info name="release" value="19950721"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="524288" width="32" endianness="little"> + <dataarea name="rom" size="524288" width="32"> <rom name="tobidase! panibon (japan).bin" size="524288" crc="40498f5e" sha1="b8a12a9677afa5cbce6ed43eb0effb5a02875534" offset="000000" /> </dataarea> </part> @@ -313,7 +313,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VVBJ-JPN"/> <info name="release" value="19951222"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="virtual bowling (japan).bin" size="1048576" crc="20688279" sha1="a5be7654037050f0a781e70efea0191f43d26f06" offset="000000" /> </dataarea> </part> @@ -332,10 +332,10 @@ According to Planet Virtual Boy, the following undumped protos exist <feature name="u2" value="U2 [HY6264ALLJ-10]" /> <feature name="u3" value="U3 [??]" /> <feature name="battery" value="BT1" /> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vue-vvfj-0.u1" size="1048576" crc="526cc969" sha1="583b409b7215159219d08e789db46140062095f2" offset="000000" /> </dataarea> - <dataarea name="sram" size="8192" width="8" endianness="little"> + <dataarea name="sram" size="8192"> </dataarea> </part> </software> @@ -348,7 +348,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VH3E-USA"/> <info name="release" value="19951201"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vertical force (usa).bin" size="1048576" crc="4c32ba5e" sha1="38f9008f60b09deef1151d46b905b090a0338200" offset="000000" /> </dataarea> </part> @@ -362,7 +362,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VH3J-JPN"/> <info name="release" value="19950812"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vertical force (japan).bin" size="1048576" crc="9e9b8b92" sha1="c7204ba5cfe7d26394b5e22badc580c8ed8c0b37" offset="000000" /> </dataarea> </part> @@ -376,10 +376,10 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VVGJ-JPN"/> <info name="release" value="19950811"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="t&e virtual golf (japan).bin" size="2097152" crc="6ba07915" sha1="c595285d42c69f14b2b418c1edfbe4a7f9a624b6" offset="000000" /> </dataarea> - <dataarea name="sram" size="8192" width="8" endianness="little"> + <dataarea name="sram" size="8192"> </dataarea> </part> </software> @@ -394,7 +394,7 @@ According to Planet Virtual Boy, the following undumped protos exist <part name="cart" interface="vboy_cart"> <feature name="pcb" value="VUE-AA-01" /> <feature name="u1" value="U1 PRG" /> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="vue-vjvj-0.u1" size="1048576" crc="8989fe0a" sha1="d96c9f8aac5b4ea012a8fe659bb68fb1159a9c6d" offset="000000" /> </dataarea> </part> @@ -408,7 +408,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VVPE-USA"/> <info name="release" value="19950911"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="virtual league baseball (usa).bin" size="1048576" crc="736b40d6" sha1="266fe615ee3df1160a20b456824699f16810fa28" offset="000000" /> </dataarea> </part> @@ -422,7 +422,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VVPJ-JPN"/> <info name="release" value="19950811"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="1048576" width="32" endianness="little"> + <dataarea name="rom" size="1048576" width="32"> <rom name="virtual pro yakyuu '95 (japan).bin" size="1048576" crc="9ba8bb5e" sha1="ab8fa82b79512eefefccdccea6768078a374c4aa" offset="000000" /> </dataarea> </part> @@ -436,24 +436,24 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VTRJ-JPN"/> <info name="release" value="19950825"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="524288" width="32" endianness="little"> + <dataarea name="rom" size="524288" width="32"> <rom name="v-tetris (japan).bin" size="524288" crc="3ccb67ae" sha1="ff7d4dfc467e6e0d3fe8517102132a65a9d17589" offset="000000" /> </dataarea> </part> </software> <!-- Developers: Nintendo R&D1 --> - <software name="wariolnd" supported="yes"> + <software name="wariolnd"> <description>Virtual Boy Wario Land (USA) ~ Virtual Boy Wario Land - Awazon no Hihou (Jpn)</description> <year>1995</year> <publisher>Nintendo</publisher> <info name="serial" value="VUE-VWCJ-JPN, VUE-VWCJ-USA"/> <info name="release" value="19951201 (JPN), 199511xx (USA)"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="virtual boy wario land (japan, usa).bin" size="2097152" crc="133e9372" sha1="274c328fbd904f20e69172ab826bf8f94ced1bdb" offset="000000" /> </dataarea> - <dataarea name="sram" size="8192" width="8" endianness="little"> + <dataarea name="sram" size="8192"> </dataarea> </part> </software> @@ -466,7 +466,7 @@ According to Planet Virtual Boy, the following undumped protos exist <info name="serial" value="VUE-VWEE-USA"/> <info name="release" value="19951221"/> <part name="cart" interface="vboy_cart"> - <dataarea name="rom" size="2097152" width="32" endianness="little"> + <dataarea name="rom" size="2097152" width="32"> <rom name="waterworld (usa).bin" size="2097152" crc="82a95e51" sha1="dcc46484bd0acab0ac1ea178f425a0f5ccfb8dc2" offset="000000" /> </dataarea> </part> diff --git a/hash/vectrex.xml b/hash/vectrex.xml index 69ff7c689a8..79d6d692d9b 100644 --- a/hash/vectrex.xml +++ b/hash/vectrex.xml @@ -9,6 +9,62 @@ There exists an undumped cart which is a sort-of-proto It had been programmed by the same creator of the arcade Cube Quest and released in 2002 by CGE (Classic Gaming Expo) guys + + +Dumps do not appear to be available for the following homebrew physical cartridge releases: + +3D Sector-X +3D Sector-X Hell's Fury +Alien Hunter +Big Blue +Brecher +Color Clash +Color Clash Slim +Continuum - The Infernal Tetramorph +Continuum - The 7 Pillars of Purgatory +Continuum - Time Warp +Dead of Knight +Debris +Debris Revisited +Eineiig +Flak +Frontier - Dead or Alive +Gravitrex Plus (64K cart) +I, Cyborg +I, Cyborg - Edition X +I, Cyborg - OMEGA +Irrelevant +Logo +Menschenjagd +N.E.L.S. +Obsolet +Omega Chase Deluxe +Protector - Limited Edition +Rockaroids (original) +Royal 21 Christmas +Shifted +Space Frenzy (64K cart) +Spinnerama +Staiga +Star Sling +Stramash Zone +Sundance +Sundance - Dark of the Sun +Sundance - Matrix +Tsunami/Vix +VeCaves/Spike's Spree +Vecmania (64K cart) +Vec Sports Boxing +Vectopia (64K cart) +Vector 21 - A Fistful of Wildcards! +Vector 21 - OMEGA +Vector Pilot +Vectrexians (has a more elaborate title screen than the downloadable version) +Vectrexians Deluxe +War of the Robots - OMEGA +War of the Worlds +War of the Worlds - Time Rift + --> <softwarelist name="vectrex" description="GCE Vectrex cartridges"> @@ -25,6 +81,32 @@ guys </part> </software> + <software name="3dscape" supported="partial"> + <description>3D Scape Demo Collection</description> + <year>2006</year> + <publisher><homebrew></publisher> + <info name="developer" value="Revival Studios" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "32015"> + <rom name="3D Scape Demo Collection (Revival Studios, 2006).bin" size="32015" crc="5b46e44b" sha1="7dcda1acde45ba4f6433466523c7a0cc09b5918d" offset="0"/> + </dataarea> + </part> + </software> + + <software name="agt"> + <description>All Good Things</description> + <year>1996</year> + <publisher><homebrew></publisher> + <info name="programmer" value="John Dondzila" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "16384"> + <rom name="agt.bin" size="16384" crc="e98ab5a2" sha1="85588ca116fe3695f19e1d06dd0853220a5b2f39" offset="0"/> + </dataarea> + </part> + </software> + <software name="animactn"> <description>Animaction</description> <year>1983</year> @@ -109,6 +191,20 @@ guys </part> </software> +<!-- Displays "FREEWARE" on the title screen instead of a serial number as on the actual cartridge release --> + <software name="citybomb"> + <description>City Bomber</description> + <year>2007</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Andrew Coleman" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "1955"> + <rom name="Vectrex City Bomber Freeware Edition.bin" size="1955" crc="8041bd7a" sha1="9b2164d5224252923bbc5e7270f4b84aba7f2f94" offset="0"/> + </dataarea> + </part> + </software> + <software name="cleanswp"> <description>Clean Sweep</description> <year>1982</year> @@ -133,6 +229,19 @@ guys </part> </software> + <software name="continuum"> + <description>Continuum</description> + <year>2010</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "18755"> + <rom name="continuum.bin" size="18755" crc="05f6d6fc" sha1="9871246e05e9f145ff98a7a3c784e45ecd96c094" offset="0"/> + </dataarea> + </part> + </software> + <software name="cchasm"> <description>Cosmic Chasm</description> <year>1982</year> @@ -205,6 +314,19 @@ guys </part> </software> + <software name="hexed"> + <description>Hexed!</description> + <year>2013</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "12140"> + <rom name="hexed.bin" size="12140" crc="8c967871" sha1="e4ffa0df9b24553b62555a39e2b73d98933507ee" offset="0"/> + </dataarea> + </part> + </software> + <software name="hyprchas"> <description>Hyperchase</description> <year>1982</year> @@ -217,6 +339,20 @@ guys </part> </software> +<!-- Displays "FREE" on the title screen instead of a serial number as on the actual cartridge release --> + <software name="lotr"> + <description>Lord of the Robots</description> + <year>2006</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "12922"> + <rom name="lotr.bin" size="12922" crc="22ccd2ba" sha1="6bfc8750d4e10bd5b80f6021b3193f516783a885" offset="0"/> + </dataarea> + </part> + </software> + <software name="mailplan"> <description>Mail Plane (Prototype)</description> <year>1983</year> @@ -278,6 +414,19 @@ guys </part> </software> + <software name="moonland"> + <description>Moon Lander</description> + <year>1997</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Clay Cowgill" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "32768"> + <rom name="moon lander.bin" size="32768" crc="8617c304" sha1="7c0752c24b3645b716337b57fe6f4bc4064e9eb0" offset="0"/> + </dataarea> + </part> + </software> + <software name="narrowes"> <description>Narrow Escape</description> <year>1983</year> @@ -290,6 +439,45 @@ guys </part> </software> + <software name="nebula"> + <description>Nebula Commander</description> + <year>2005</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Craig Aker" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "8192"> + <rom name="nebula.bin" size="8192" crc="a97f6c31" sha1="7fde2967b0a373a1a18462b7416811d127502c15" offset="0"/> + </dataarea> + </part> + </software> + + <software name="patriots"> + <description>Patriots</description> + <year>1996</year> + <publisher><homebrew></publisher> + <info name="programmer" value="John Dondzila" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "8192"> + <rom name="patriots.bin" size="8192" crc="7d709da2" sha1="481aa3b761f34747fe769c8420564e4f37529c26" offset="0"/> + </dataarea> + </part> + </software> + + <software name="perfvx"> + <description>Performance VX</description> + <year>2003</year> + <publisher><homebrew></publisher> + <info name="developer" value="Revival Studios" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "9323"> + <rom name="revival_performancevx.bin" size="9323" crc="675631e7" sha1="91b0cb5ce4cf25878144aee6516c01742890bcb1" offset="0"/> + </dataarea> + </part> + </software> + <software name="ptchduel"> <description>Pitcher's Duel (Prototype)</description> <year>1983</year> @@ -350,6 +538,32 @@ guys </part> </software> + <software name="protyasi"> + <description>Protector and Y*A*S*I</description> + <year>2005</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Alex Herbert" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "32768"> + <rom name="py050712.bin" size="32768" crc="62f062fe" sha1="c84cce8b3c889157718fd7290438ed49f8e38bce" offset="0"/> + </dataarea> + </part> + </software> + + <software name="revector"> + <description>Revector</description> + <year>2004</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Craig Aker" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "16384"> + <rom name="revector.bin" size="16384" crc="69dba2be" sha1="d0db028d166997667fb2bd5363f16ce058dcca5d" offset="0"/> + </dataarea> + </part> + </software> + <software name="ripoff"> <description>Rip-Off</description> <year>1982</year> @@ -362,6 +576,19 @@ guys </part> </software> + <software name="rockremx"> + <description>Rockaroids Remix</description> + <year>1996</year> + <publisher><homebrew></publisher> + <info name="programmer" value="John Dondzila" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "4096"> + <rom name="rocks.bin" size="4096" crc="d1e0268f" sha1="a10ffb6efdf32a63f7c4da8bb0b7f8d5fd6cdb98" offset="0"/> + </dataarea> + </part> + </software> + <software name="rocksled"> <description>Rocket Sledge (Sample)</description> <year>1983</year> @@ -374,6 +601,32 @@ guys </part> </software> + <software name="rgc"> + <description>Ronen's Games Cart</description> + <year>2000</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Ronen Habot" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "15602"> + <rom name="rgc.bin" size="15602" crc="aacf1d20" sha1="5f942034ed8e953361d2c01898b80b81489618f6" offset="0"/> + </dataarea> + </part> + </software> + + <software name="royal21"> + <description>Royal 21</description> + <year>2009</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "11797"> + <rom name="royal21.bin" size="11797" crc="021796db" sha1="ed5d29b9014588c30a1c81d3fc805fc92549b83a" offset="0"/> + </dataarea> + </part> + </software> + <software name="scramble"> <description>Scramble</description> <year>1982</year> @@ -386,6 +639,19 @@ guys </part> </software> + <software name="sectis"> + <description>Sectis</description> + <year>2010</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "32309"> + <rom name="sectis.bin" size="32309" crc="2a9b2fe5" sha1="07f638cdd5e5df8e96ac69b1eba6a663207fff2e" offset="0"/> + </dataarea> + </part> + </software> + <software name="solarq"> <description>Solar Quest</description> <year>1982</year> @@ -422,6 +688,32 @@ guys </part> </software> + <software name="spikehop"> + <description>Spike Hoppin'</description> + <year>1997</year> + <publisher><homebrew></publisher> + <info name="programmer" value="John Dondzila" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "16384"> + <rom name="spikehop.bin" size="16384" crc="1c6b030e" sha1="775d6e5fd438246a256f27a2a5145368ec7d2cbe" offset="0"/> + </dataarea> + </part> + </software> + + <software name="spikewb"> + <description>Spike's Water Balloons - Analog Version</description> + <year>2000</year> + <publisher><homebrew></publisher> + <info name="programmer" value="John Dondzila" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "2980"> + <rom name="swb-ana.bin" size="2980" crc="95188f66" sha1="b83fa76da4e4bbe861be821c4eb78abd8c9657b9" offset="0"/> + </dataarea> + </part> + </software> + <software name="spinball"> <description>Spinball</description> <year>1983</year> @@ -494,6 +786,34 @@ guys </part> </software> + <software name="thrust"> + <description>Thrust (1.2)</description> + <year>2004</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Ville Krumlinde" /> + <info name="version" value="1.2" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "32478"> + <rom name="thrust.bin" size="32478" crc="e6eaf7c4" sha1="f9b4f1504abc78124ac7823ae87f97dcfa1925d3" offset="0"/> + </dataarea> + </part> + </software> + + <software name="thrusta" cloneof="thrust"> + <description>Thrust (Final 1.01)</description> + <year>2004</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Ville Krumlinde" /> + <info name="version" value="1.01" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "32497"> + <rom name="thrusta.bin" size="32497" crc="569b50e7" sha1="451ba51be3f94b3a625627866877239aee61766d" offset="0"/> + </dataarea> + </part> + </software> + <software name="tourfrnc"> <description>Tour de France (Prototype)</description> <year>1983</year> @@ -506,6 +826,87 @@ guys </part> </software> + <software name="vector21" supported="partial"> + <description>Vector 21</description> + <year>2006</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "12289"> + <rom name="vector21.bin" size="12289" crc="9d47924b" sha1="7fdad46384f6a06cfb73a6e908be6b91ad62c526" offset="0"/> + </dataarea> + </part> + </software> + + <software name="vaders"> + <description>Vector Vaders</description> + <year>1996</year> + <publisher><homebrew></publisher> + <info name="programmer" value="John Dondzila" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "8192"> + <rom name="vaders.bin" size="8192" crc="825987e3" sha1="83a6269a9275d8ce48c58b5560fb2d7324eaeea0" offset="0"/> + </dataarea> + </part> + </software> + + <software name="frogger"> + <description>Vectrex Frogger</description> + <year>1998</year> + <publisher><homebrew></publisher> + <info name="programmer" value="Christopher Salomon" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "16384"> + <rom name="frogger.bin" size="16384" crc="9c5410be" sha1="7f014697309efca22f310448acb02c8e5da89c6a" offset="0"/> + </dataarea> + </part> + </software> + +<!-- Uses the unemulated VecVoice or VecVox add-ons --> + <software name="verzerk" supported="partial"> + <description>Verzerk (Berzerk hack)</description> + <year>2002</year> + <publisher><hack></publisher> + <info name="programmer" value="Alex Herbert" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "29218"> + <rom name="verzerk.bin" size="29218" crc="59665f3d" sha1="a118510a934184762a032326bb105e2de084a5c1" offset="0"/> + </dataarea> + </part> + </software> + +<!-- Displays "FREEWARE" on the title screen, likely different from the actual cartridge release --> + <software name="wotr"> + <description>War of the Robots</description> + <year>2003</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "20879"> + <rom name="wotr.bin" size="20879" crc="09b7daeb" sha1="8bd8d9ccecb1fc22d36291383cf3eb23175e4b11" offset="0"/> + </dataarea> + </part> + </software> + +<!-- Displays "FREEWARE" on the title screen, likely different from the actual cartridge release --> + <software name="wotrbttq"> + <description>War of the Robots - Bow to the Queen</description> + <year>2003</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "20920"> + <rom name="bttq.bin" size="20920" crc="5799bfde" sha1="b61a8e84e379489e191395c9ee08bd04399a04c0" offset="0"/> + </dataarea> + </part> + </software> + <software name="webwarp"> <description>Web Warp</description> <year>1983</year> @@ -530,6 +931,18 @@ guys </part> </software> + <software name="zantis"> + <description>Zantis</description> + <year>2011</year> + <publisher><homebrew></publisher> + <info name="developer" value="Fury Unlimited" /> + <part name="cart" interface="vectrex_cart"> + <feature name="slot" value="vec_rom" /> + <dataarea name="rom" size = "7089"> + <rom name="zantis.bin" size="7089" crc="9f623f4d" sha1="865b79702b5f86576f23208e4ae8fd53f4f12f87" offset="0"/> + </dataarea> + </part> + </software> <!-- Are these legit dumps or hacked versions by the guy at ClassicGameCreations.com? --> diff --git a/hash/vgmplay.xml b/hash/vgmplay.xml index 02fe83368bc..3a1118ff2c3 100644 --- a/hash/vgmplay.xml +++ b/hash/vgmplay.xml @@ -6274,53 +6274,59 @@ <description>Chelnov - Atomic Runner (Karnov)</description> <year>1988</year> <publisher>Data East Corporation</publisher> - <info name="cores" value="YM3526"/> + <info name="cores" value="YM2203, YM3526"/> <part name="001" interface="vgm_quik"> - <feature name="part_id" value="01 start.vgz" /> - <dataarea name="quik" size="1826"> - <rom name="01 start.vgz" size="1826" crc="c4b022dd" sha1="77f19ef5130a91ab5ff2c49f896039bbf78435ce" offset="0" /> + <feature name="part_id" value="01 credit.vgz" /> + <dataarea name="quik" size="483"> + <rom name="01 credit.vgz" size="483" crc="a9e8cea9" sha1="6371b2473e33bd989581b85db6167becf8793737" offset="0" /> </dataarea> </part> <part name="002" interface="vgm_quik"> - <feature name="part_id" value="02 map.vgz" /> - <dataarea name="quik" size="1524"> - <rom name="02 map.vgz" size="1524" crc="0ec2bc90" sha1="5de64489a9754ca7edd81bbd73f0282f1cc3c70d" offset="0" /> + <feature name="part_id" value="02 start.vgz" /> + <dataarea name="quik" size="2349"> + <rom name="02 start.vgz" size="2349" crc="48ebc2b4" sha1="8b17479da36166f12ea0e41406addf844f9e65ea" offset="0" /> </dataarea> </part> <part name="003" interface="vgm_quik"> - <feature name="part_id" value="03 chelnov theme.vgz" /> - <dataarea name="quik" size="10558"> - <rom name="03 chelnov theme.vgz" size="10558" crc="dca18009" sha1="2bf296ed79548735154ccc10d0f7752837834e7e" offset="0" /> + <feature name="part_id" value="03 chelnov's theme.vgz" /> + <dataarea name="quik" size="10590"> + <rom name="03 chelnov's theme.vgz" size="10590" crc="96566096" sha1="017f032da7bd36d89543771eb4285bc4086a389e" offset="0" /> </dataarea> </part> <part name="004" interface="vgm_quik"> - <feature name="part_id" value="04 keep running.vgz" /> - <dataarea name="quik" size="11970"> - <rom name="04 keep running.vgz" size="11970" crc="2e07b3f8" sha1="f86aae724a856e3a9d5f9d229f5383d71b270c5e" offset="0" /> + <feature name="part_id" value="04 death lock.vgz" /> + <dataarea name="quik" size="4090"> + <rom name="04 death lock.vgz" size="4090" crc="1b51b36d" sha1="ce7b231d9d8efd04b64f684d911c75779ee2fa6e" offset="0" /> </dataarea> </part> <part name="005" interface="vgm_quik"> - <feature name="part_id" value="05 death lock.vgz" /> - <dataarea name="quik" size="4065"> - <rom name="05 death lock.vgz" size="4065" crc="ff15d543" sha1="f3c6f31f783066a490b3a6f75a325f13ea29f618" offset="0" /> + <feature name="part_id" value="05 map.vgz" /> + <dataarea name="quik" size="2024"> + <rom name="05 map.vgz" size="2024" crc="788c92b1" sha1="ef84304fb984fcaa0ea9290cd95fa69b71b96462" offset="0" /> </dataarea> </part> <part name="006" interface="vgm_quik"> - <feature name="part_id" value="06 ribigal.vgz" /> - <dataarea name="quik" size="7825"> - <rom name="06 ribigal.vgz" size="7825" crc="f18a2a18" sha1="9b4522e0ea5c4997e326d25060ecf1e126f39e39" offset="0" /> + <feature name="part_id" value="06 keep running.vgz" /> + <dataarea name="quik" size="12014"> + <rom name="06 keep running.vgz" size="12014" crc="06c0f18e" sha1="5b4426239c8615ef781e5e590804d2da932083c1" offset="0" /> </dataarea> </part> <part name="007" interface="vgm_quik"> - <feature name="part_id" value="07 name entry.vgz" /> - <dataarea name="quik" size="3908"> - <rom name="07 name entry.vgz" size="3908" crc="28cfd82f" sha1="4b058a3a7110bc1634538f70257d3e4e43e1c78f" offset="0" /> + <feature name="part_id" value="07 ribigaru.vgz" /> + <dataarea name="quik" size="7862"> + <rom name="07 ribigaru.vgz" size="7862" crc="8957d5a6" sha1="4c64e571dbbe13b8ce76e0e5e64089f332cb4981" offset="0" /> </dataarea> </part> <part name="008" interface="vgm_quik"> <feature name="part_id" value="08 ending.vgz" /> - <dataarea name="quik" size="9947"> - <rom name="08 ending.vgz" size="9947" crc="84fa7841" sha1="a44b4bc5dc367cfb706c51943c7b626d7b928cf1" offset="0" /> + <dataarea name="quik" size="12806"> + <rom name="08 ending.vgz" size="12806" crc="20cb9e0c" sha1="ca0ff64c860f539c7b5074c66ee1903ce86b3ef6" offset="0" /> + </dataarea> + </part> + <part name="009" interface="vgm_quik"> + <feature name="part_id" value="09 naming.vgz" /> + <dataarea name="quik" size="5432"> + <rom name="09 naming.vgz" size="5432" crc="eb1b1ffd" sha1="c0b160c5034d572fb20d0d22d6f3977a70002d3a" offset="0" /> </dataarea> </part> </software> @@ -19126,60 +19132,60 @@ <software name="raiden"> <description>Raiden (Arcade)</description> <year>1990</year> - <publisher>Seibu Kaihatsu</publisher> + <publisher>Seibu Kaihatsu (EJ) / Fabtek (U) / IBL Corporation (K) / Liang HWA Electronics (TW)</publisher> <info name="cores" value="YM3812, OKIM6295"/> <part name="001" interface="vgm_quik"> <feature name="part_id" value="01 coin.vgz" /> - <dataarea name="quik" size="1566"> - <rom name="01 coin.vgz" size="1566" crc="7fa02dc8" sha1="97819a276121e514e9d588e2314c11326daaf90c" offset="0" /> + <dataarea name="quik" size="1567"> + <rom name="01 coin.vgz" size="1567" crc="12642207" sha1="264f6593b74a53c41a60fb4d46934632cc047b8d" offset="0" /> </dataarea> </part> <part name="002" interface="vgm_quik"> <feature name="part_id" value="02 gallantry.vgz" /> - <dataarea name="quik" size="10890"> - <rom name="02 gallantry.vgz" size="10890" crc="3d66c215" sha1="794cc61db0325bb57ac20106b7eff8607af930be" offset="0" /> + <dataarea name="quik" size="10979"> + <rom name="02 gallantry.vgz" size="10979" crc="91fc0aa9" sha1="c6da247da361a576ceb2b9885fd5eba97f959f34" offset="0" /> </dataarea> </part> <part name="003" interface="vgm_quik"> <feature name="part_id" value="03 go to blazes!.vgz" /> - <dataarea name="quik" size="7339"> - <rom name="03 go to blazes!.vgz" size="7339" crc="88da38c2" sha1="21ef818832a5154ec4dc63e0284a6c2579046dd9" offset="0" /> + <dataarea name="quik" size="7346"> + <rom name="03 go to blazes!.vgz" size="7346" crc="d5c567a8" sha1="e6dad57692a076974f23e22c03fabd1e329c8c76" offset="0" /> </dataarea> </part> <part name="004" interface="vgm_quik"> <feature name="part_id" value="04 intermission.vgz" /> - <dataarea name="quik" size="1333"> - <rom name="04 intermission.vgz" size="1333" crc="e1ebd334" sha1="f322788bb2808619f610a22c642974b3f3250835" offset="0" /> + <dataarea name="quik" size="1334"> + <rom name="04 intermission.vgz" size="1334" crc="685da798" sha1="9e7d64d9cd1664777fa586e07d7148e91eaab26e" offset="0" /> </dataarea> </part> <part name="005" interface="vgm_quik"> <feature name="part_id" value="05 lightning war.vgz" /> - <dataarea name="quik" size="8873"> - <rom name="05 lightning war.vgz" size="8873" crc="a5bf4538" sha1="b4aaa1b4a824def9e54ca5b7e113968a25b61e80" offset="0" /> + <dataarea name="quik" size="8922"> + <rom name="05 lightning war.vgz" size="8922" crc="e954fef4" sha1="d32a4b40b997ee2f007096f88410e825ce2a8975" offset="0" /> </dataarea> </part> <part name="006" interface="vgm_quik"> <feature name="part_id" value="06 rough and tumble.vgz" /> - <dataarea name="quik" size="13717"> - <rom name="06 rough and tumble.vgz" size="13717" crc="513e73bc" sha1="fd2574a9cd29f5af2fbd14cbe0224000f82657cb" offset="0" /> + <dataarea name="quik" size="13851"> + <rom name="06 rough and tumble.vgz" size="13851" crc="1dda3141" sha1="5b9f3e8dc723595d38c66c855a0526f76a23dae5" offset="0" /> </dataarea> </part> <part name="007" interface="vgm_quik"> <feature name="part_id" value="07 fighting thunder.vgz" /> - <dataarea name="quik" size="11525"> - <rom name="07 fighting thunder.vgz" size="11525" crc="496d04ca" sha1="9976dde5a6bce283315cff097e2421d5b51d67fb" offset="0" /> + <dataarea name="quik" size="11694"> + <rom name="07 fighting thunder.vgz" size="11694" crc="ea5f6593" sha1="0edcfd69cb1bd68dc757e77894c2f5cd088822aa" offset="0" /> </dataarea> </part> <part name="008" interface="vgm_quik"> <feature name="part_id" value="08 name regist.vgz" /> - <dataarea name="quik" size="5416"> - <rom name="08 name regist.vgz" size="5416" crc="5e208b54" sha1="bb420744342f9d7a66a66a3d94197b915d081067" offset="0" /> + <dataarea name="quik" size="5419"> + <rom name="08 name regist.vgz" size="5419" crc="c67a2075" sha1="1c5d01d407179cd1ff7df7450edc2539cf2083c3" offset="0" /> </dataarea> </part> <part name="009" interface="vgm_quik"> <feature name="part_id" value="09 continue.vgz" /> - <dataarea name="quik" size="5489"> - <rom name="09 continue.vgz" size="5489" crc="7cfd3126" sha1="c5a46c617f4488165d8916e1eb715dbbd8b2bb30" offset="0" /> + <dataarea name="quik" size="5487"> + <rom name="09 continue.vgz" size="5487" crc="754588ab" sha1="94ce816828a4bf53e2b94bdc9f3fcf7960130de4" offset="0" /> </dataarea> </part> </software> @@ -80447,50 +80453,50 @@ <info name="cores" value="Game Boy DMG (LR35902)"/> <part name="001" interface="vgm_quik"> <feature name="part_id" value="01 title, stage 1.vgz" /> - <dataarea name="quik" size="1908"> - <rom name="01 title, stage 1.vgz" size="1908" crc="9adde733" sha1="559810149413cbbd9c8c4417a03cad85aff2c553" offset="0" /> + <dataarea name="quik" size="3121"> + <rom name="01 title, stage 1.vgz" size="3121" crc="7ec60990" sha1="cdd2f3ff4e8308b366777584f38011e0b5ea8e0e" offset="0" /> </dataarea> </part> <part name="002" interface="vgm_quik"> <feature name="part_id" value="02 boss theme.vgz" /> - <dataarea name="quik" size="5214"> - <rom name="02 boss theme.vgz" size="5214" crc="2b525ab9" sha1="0f43e7e644b76e950812f9085e1c4d1011ce867c" offset="0" /> + <dataarea name="quik" size="8619"> + <rom name="02 boss theme.vgz" size="8619" crc="56bc26bf" sha1="2a363846164c4a720cf3097b07fae2321bfb2c70" offset="0" /> </dataarea> </part> <part name="003" interface="vgm_quik"> <feature name="part_id" value="03 stage clear.vgz" /> - <dataarea name="quik" size="808"> - <rom name="03 stage clear.vgz" size="808" crc="9557ef26" sha1="afecfce454d4a46e2cedaeb46449d066a114539b" offset="0" /> + <dataarea name="quik" size="1068"> + <rom name="03 stage clear.vgz" size="1068" crc="47288fe6" sha1="06604300fe67fdd633236faea4924b4bec7946ed" offset="0" /> </dataarea> </part> <part name="004" interface="vgm_quik"> <feature name="part_id" value="04 stage 2.vgz" /> - <dataarea name="quik" size="1681"> - <rom name="04 stage 2.vgz" size="1681" crc="f0529bc2" sha1="9768e303852c854e30869c0ecc6a3d23a896f706" offset="0" /> + <dataarea name="quik" size="2344"> + <rom name="04 stage 2.vgz" size="2344" crc="6cbe9e74" sha1="54d85d1d3c77f58f1d093686e75eb3cdf069a3aa" offset="0" /> </dataarea> </part> <part name="005" interface="vgm_quik"> <feature name="part_id" value="05 stage 3.vgz" /> - <dataarea name="quik" size="5212"> - <rom name="05 stage 3.vgz" size="5212" crc="aa65c33a" sha1="fa6c363d52fef561af570f5a471bf26930f61d92" offset="0" /> + <dataarea name="quik" size="7841"> + <rom name="05 stage 3.vgz" size="7841" crc="acd32c0e" sha1="c0b8817f1a88043453e8eb09c6b94601e2d1adb9" offset="0" /> </dataarea> </part> <part name="006" interface="vgm_quik"> <feature name="part_id" value="06 stage 4.vgz" /> - <dataarea name="quik" size="3509"> - <rom name="06 stage 4.vgz" size="3509" crc="94d3f306" sha1="434c7ca663236687f4bcec9b7a76116641c32c3a" offset="0" /> + <dataarea name="quik" size="4370"> + <rom name="06 stage 4.vgz" size="4370" crc="f91f4299" sha1="77dc7f53dd373549c5268f8639fb4e0bebc78948" offset="0" /> </dataarea> </part> <part name="007" interface="vgm_quik"> <feature name="part_id" value="07 credits.vgz" /> - <dataarea name="quik" size="5097"> - <rom name="07 credits.vgz" size="5097" crc="1388f857" sha1="c8c294a20c91ae942d703814e11497db1c21e693" offset="0" /> + <dataarea name="quik" size="7027"> + <rom name="07 credits.vgz" size="7027" crc="f4957ccd" sha1="d6e99c40fb02dc7137c8ab4a18601a07d1d2ff42" offset="0" /> </dataarea> </part> <part name="008" interface="vgm_quik"> <feature name="part_id" value="08 game over.vgz" /> - <dataarea name="quik" size="731"> - <rom name="08 game over.vgz" size="731" crc="0e6b426d" sha1="182a4b6163ac82a73e54781ec040717b8a289690" offset="0" /> + <dataarea name="quik" size="861"> + <rom name="08 game over.vgz" size="861" crc="5ab0a072" sha1="4ad9c3189c6eb305f54cc9962353fe885e7296a1" offset="0" /> </dataarea> </part> </software> @@ -85106,8 +85112,8 @@ </part> <part name="003" interface="vgm_quik"> <feature name="part_id" value="03 toy factory.vgz" /> - <dataarea name="quik" size="18592"> - <rom name="03 toy factory.vgz" size="18592" crc="882c936c" sha1="9b5ceee882470c5c2b9e013183649675eccf360a" offset="0" /> + <dataarea name="quik" size="18711"> + <rom name="03 toy factory.vgz" size="18711" crc="8d9b61a9" sha1="8f36ddb3376a60f435107c9374d9964973d63ced" offset="0" /> </dataarea> </part> <part name="004" interface="vgm_quik"> @@ -85142,8 +85148,8 @@ </part> <part name="009" interface="vgm_quik"> <feature name="part_id" value="09 underground river.vgz" /> - <dataarea name="quik" size="16626"> - <rom name="09 underground river.vgz" size="16626" crc="7d123e1e" sha1="5b57f87b6d869363e16a7d2626107dd736a1c0dd" offset="0" /> + <dataarea name="quik" size="16690"> + <rom name="09 underground river.vgz" size="16690" crc="f781d951" sha1="dbdf430b7adb472c1e3dcd4bb8b706a62f7392cd" offset="0" /> </dataarea> </part> <part name="010" interface="vgm_quik"> @@ -230035,8 +230041,8 @@ </part> <part name="017" interface="vgm_quik"> <feature name="part_id" value="17 star maze.vgz" /> - <dataarea name="quik" size="6539"> - <rom name="17 star maze.vgz" size="6539" crc="a1d62359" sha1="de1ec0787ba64d4dc482af5c9cdc2e5e9a706f95" offset="0" /> + <dataarea name="quik" size="8889"> + <rom name="17 star maze.vgz" size="8889" crc="f6a586f8" sha1="2580cfa617b28b3c78f6f9f87ef1fe7f64c7d0ca" offset="0" /> </dataarea> </part> <part name="018" interface="vgm_quik"> @@ -230148,27 +230154,39 @@ </dataarea> </part> <part name="036" interface="vgm_quik"> - <feature name="part_id" value="36 boss battle (no intro).vgz" /> - <dataarea name="quik" size="3535"> - <rom name="36 boss battle (no intro).vgz" size="3535" crc="95f52065" sha1="159faa12319638774aff8634abe6b254244708f4" offset="0" /> + <feature name="part_id" value="36 golden coin get (open door).vgz" /> + <dataarea name="quik" size="1282"> + <rom name="36 golden coin get (open door).vgz" size="1282" crc="e7fd4419" sha1="d3c0492e3ec9125faf2982a7b94898d0799086b6" offset="0" /> </dataarea> </part> <part name="037" interface="vgm_quik"> - <feature name="part_id" value="37 battle with wario (phase 1) (no intro).vgz" /> - <dataarea name="quik" size="3819"> - <rom name="37 battle with wario (phase 1) (no intro).vgz" size="3819" crc="6829fbd5" sha1="6117a1976fdeba70511b937c0407cb4e73e2f563" offset="0" /> + <feature name="part_id" value="37 totaka's song.vgz" /> + <dataarea name="quik" size="564"> + <rom name="37 totaka's song.vgz" size="564" crc="e50ac0c3" sha1="25400884775b3cbfdbe9226adf39563e013ddeaa" offset="0" /> </dataarea> </part> <part name="038" interface="vgm_quik"> - <feature name="part_id" value="38 battle with wario (phase 2) (no intro).vgz" /> - <dataarea name="quik" size="3887"> - <rom name="38 battle with wario (phase 2) (no intro).vgz" size="3887" crc="e6cafa3b" sha1="a1711b4487ec0789947eae8fc327d672e19db04a" offset="0" /> + <feature name="part_id" value="38 boss battle (no intro).vgz" /> + <dataarea name="quik" size="3535"> + <rom name="38 boss battle (no intro).vgz" size="3535" crc="95f52065" sha1="159faa12319638774aff8634abe6b254244708f4" offset="0" /> </dataarea> </part> <part name="039" interface="vgm_quik"> - <feature name="part_id" value="39 battle with wario (phase 3) (no intro).vgz" /> + <feature name="part_id" value="39 battle with wario (phase 1) (no intro).vgz" /> + <dataarea name="quik" size="3819"> + <rom name="39 battle with wario (phase 1) (no intro).vgz" size="3819" crc="6829fbd5" sha1="6117a1976fdeba70511b937c0407cb4e73e2f563" offset="0" /> + </dataarea> + </part> + <part name="040" interface="vgm_quik"> + <feature name="part_id" value="40 battle with wario (phase 2) (no intro).vgz" /> + <dataarea name="quik" size="3887"> + <rom name="40 battle with wario (phase 2) (no intro).vgz" size="3887" crc="e6cafa3b" sha1="a1711b4487ec0789947eae8fc327d672e19db04a" offset="0" /> + </dataarea> + </part> + <part name="041" interface="vgm_quik"> + <feature name="part_id" value="41 battle with wario (phase 3) (no intro).vgz" /> <dataarea name="quik" size="1012"> - <rom name="39 battle with wario (phase 3) (no intro).vgz" size="1012" crc="cbc7d701" sha1="142993f175d68151aef82749420bd98529feb8b8" offset="0" /> + <rom name="41 battle with wario (phase 3) (no intro).vgz" size="1012" crc="cbc7d701" sha1="142993f175d68151aef82749420bd98529feb8b8" offset="0" /> </dataarea> </part> </software> @@ -231468,164 +231486,164 @@ <info name="cores" value="MSX-MUSIC (YM2413), PSG (AY-3-8910)"/> <part name="001" interface="vgm_quik"> <feature name="part_id" value="01 pikupiku team.vgz" /> - <dataarea name="quik" size="1390"> - <rom name="01 pikupiku team.vgz" size="1390" crc="20409ef2" sha1="637a1dda9dd04a303cf668b0b0070dda6086eed9" offset="0" /> + <dataarea name="quik" size="3464"> + <rom name="01 pikupiku team.vgz" size="3464" crc="f1276732" sha1="44ca270f31d7fa566afa5014615d2461523233dc" offset="0" /> </dataarea> </part> <part name="002" interface="vgm_quik"> <feature name="part_id" value="02 opening 1.vgz" /> - <dataarea name="quik" size="12636"> - <rom name="02 opening 1.vgz" size="12636" crc="c5de6bac" sha1="2780a8eb585e67a41a205891972e3d9ddb4a1c53" offset="0" /> + <dataarea name="quik" size="34952"> + <rom name="02 opening 1.vgz" size="34952" crc="bb7a3ffb" sha1="f40505ab12091b8357515d32ede6dec9d69cd760" offset="0" /> </dataarea> </part> <part name="003" interface="vgm_quik"> <feature name="part_id" value="03 opening 2.vgz" /> - <dataarea name="quik" size="15901"> - <rom name="03 opening 2.vgz" size="15901" crc="c2ec4fde" sha1="ce9281c429ad0698ef12a67980cdb29cb9113a19" offset="0" /> + <dataarea name="quik" size="28930"> + <rom name="03 opening 2.vgz" size="28930" crc="62641c46" sha1="3f36c259c9fbb52ded92c8ec8e7b8c76cc349220" offset="0" /> </dataarea> </part> <part name="004" interface="vgm_quik"> <feature name="part_id" value="04 title-ending.vgz" /> - <dataarea name="quik" size="17002"> - <rom name="04 title-ending.vgz" size="17002" crc="d53d223a" sha1="94e28b079710b4ffbf649758f20c6b00549b0b98" offset="0" /> + <dataarea name="quik" size="27277"> + <rom name="04 title-ending.vgz" size="27277" crc="1903407d" sha1="207543142fd83dda50e375ff162bb574136e9eb2" offset="0" /> </dataarea> </part> <part name="005" interface="vgm_quik"> <feature name="part_id" value="05 fearless town.vgz" /> - <dataarea name="quik" size="11183"> - <rom name="05 fearless town.vgz" size="11183" crc="66eb4338" sha1="464b26876760fb467d599362b47d95f5949ce5d3" offset="0" /> + <dataarea name="quik" size="18157"> + <rom name="05 fearless town.vgz" size="18157" crc="35ea7d0f" sha1="12b293ae1157ce85e58a8da08432329b622fd848" offset="0" /> </dataarea> </part> <part name="006" interface="vgm_quik"> <feature name="part_id" value="06 fearless church.vgz" /> - <dataarea name="quik" size="6848"> - <rom name="06 fearless church.vgz" size="6848" crc="da6582be" sha1="d1d00c6d275544763772e8c49b22fdb7f1fe0538" offset="0" /> + <dataarea name="quik" size="11723"> + <rom name="06 fearless church.vgz" size="11723" crc="521633e5" sha1="ef914540cb290c11199b02f4820f87a3923f6b0c" offset="0" /> </dataarea> </part> <part name="007" interface="vgm_quik"> <feature name="part_id" value="07 running fray [main bgm 1].vgz" /> - <dataarea name="quik" size="21447"> - <rom name="07 running fray [main bgm 1].vgz" size="21447" crc="0a579fd8" sha1="213d5db3f18d30723ba1dba0a6119c07562381c2" offset="0" /> + <dataarea name="quik" size="36468"> + <rom name="07 running fray [main bgm 1].vgz" size="36468" crc="70c2a5ce" sha1="48ef930064acbf0f1e966f08b50426a4ca1dd550" offset="0" /> </dataarea> </part> <part name="008" interface="vgm_quik"> <feature name="part_id" value="08 village-town.vgz" /> - <dataarea name="quik" size="28914"> - <rom name="08 village-town.vgz" size="28914" crc="6aeb7a83" sha1="9894ea77365562f7df024ddef849ec0c4e14f7d3" offset="0" /> + <dataarea name="quik" size="49315"> + <rom name="08 village-town.vgz" size="49315" crc="f7972953" sha1="5466b8b5e2883d3c3184217879355399330e5b3b" offset="0" /> </dataarea> </part> <part name="009" interface="vgm_quik"> <feature name="part_id" value="09 fray's march [main bgm 2].vgz" /> - <dataarea name="quik" size="17948"> - <rom name="09 fray's march [main bgm 2].vgz" size="17948" crc="e6a68f9e" sha1="c058eae9c719bf17303043ca557e98e6a598c959" offset="0" /> + <dataarea name="quik" size="29992"> + <rom name="09 fray's march [main bgm 2].vgz" size="29992" crc="9eb72a34" sha1="bc16f7fde8307fd2247bcc174d2148399c47c8e5" offset="0" /> </dataarea> </part> <part name="010" interface="vgm_quik"> <feature name="part_id" value="10 domiso go [boss].vgz" /> - <dataarea name="quik" size="14975"> - <rom name="10 domiso go [boss].vgz" size="14975" crc="a1b38669" sha1="d496e700bbaec0adad4e1bb95fd1505bc840a34f" offset="0" /> + <dataarea name="quik" size="26491"> + <rom name="10 domiso go [boss].vgz" size="26491" crc="b1669587" sha1="52b99905717e46e9b599b501f7d75b49be3363db" offset="0" /> </dataarea> </part> <part name="011" interface="vgm_quik"> <feature name="part_id" value="11 milly's theme.vgz" /> - <dataarea name="quik" size="13892"> - <rom name="11 milly's theme.vgz" size="13892" crc="d53f5fb0" sha1="1182b2de2196913f6fe7699f0a41be7aa7faaada" offset="0" /> + <dataarea name="quik" size="23639"> + <rom name="11 milly's theme.vgz" size="23639" crc="439ec049" sha1="289d4c3da1ee6a5479634fc77a94516831e77d33" offset="0" /> </dataarea> </part> <part name="012" interface="vgm_quik"> <feature name="part_id" value="12 aerial castle appearance.vgz" /> - <dataarea name="quik" size="2949"> - <rom name="12 aerial castle appearance.vgz" size="2949" crc="3fc712bf" sha1="07ac92f6add6500dc195058ac96d7e84aa3e187a" offset="0" /> + <dataarea name="quik" size="6532"> + <rom name="12 aerial castle appearance.vgz" size="6532" crc="e731d9f0" sha1="7e03f3f35ed4267c9a56386995067a07371db6b4" offset="0" /> </dataarea> </part> <part name="013" interface="vgm_quik"> <feature name="part_id" value="13 shooting scene.vgz" /> - <dataarea name="quik" size="10130"> - <rom name="13 shooting scene.vgz" size="10130" crc="aaf0a5a9" sha1="805a87c76f7710ebce1e22cea28357fd05732c99" offset="0" /> + <dataarea name="quik" size="21012"> + <rom name="13 shooting scene.vgz" size="21012" crc="60afae0f" sha1="ba39a5b4884ab5d7b12ec35c917c076a5e4d6379" offset="0" /> </dataarea> </part> <part name="014" interface="vgm_quik"> <feature name="part_id" value="14 aerial castle kwol.vgz" /> - <dataarea name="quik" size="13533"> - <rom name="14 aerial castle kwol.vgz" size="13533" crc="8f352aff" sha1="e1e76b4343bcb2429f3f1dfa1dfd426cb862071a" offset="0" /> + <dataarea name="quik" size="22129"> + <rom name="14 aerial castle kwol.vgz" size="22129" crc="121ad4d8" sha1="81d394f76c936ccf429bd637db7ee53b36b95c76" offset="0" /> </dataarea> </part> <part name="015" interface="vgm_quik"> <feature name="part_id" value="15 kwol's waltz [kwol labyrinth].vgz" /> - <dataarea name="quik" size="14713"> - <rom name="15 kwol's waltz [kwol labyrinth].vgz" size="14713" crc="5492e402" sha1="179cb6ed9f202b8fca217c45da940520580ecaaf" offset="0" /> + <dataarea name="quik" size="23658"> + <rom name="15 kwol's waltz [kwol labyrinth].vgz" size="23658" crc="00ab6eb1" sha1="e5f881d647ca1d529f160435ffe4d66f01f1cac6" offset="0" /> </dataarea> </part> <part name="016" interface="vgm_quik"> <feature name="part_id" value="16 surf go! go! [surfing scene].vgz" /> - <dataarea name="quik" size="7758"> - <rom name="16 surf go! go! [surfing scene].vgz" size="7758" crc="a655fb79" sha1="2b884d394c3c7c90687cbb5c7aa685360141732a" offset="0" /> + <dataarea name="quik" size="15266"> + <rom name="16 surf go! go! [surfing scene].vgz" size="15266" crc="c51385d6" sha1="272f86874f149fed647e89cfbdeb90531b2409bf" offset="0" /> </dataarea> </part> <part name="017" interface="vgm_quik"> <feature name="part_id" value="17 last scene.vgz" /> - <dataarea name="quik" size="11757"> - <rom name="17 last scene.vgz" size="11757" crc="1bc7998b" sha1="f0dba5b005ce052893d4ba037fcf51220defa57f" offset="0" /> + <dataarea name="quik" size="19639"> + <rom name="17 last scene.vgz" size="19639" crc="98c7fc2f" sha1="3b248ffaadb148c8f2097a08af930da76bc0cfa2" offset="0" /> </dataarea> </part> <part name="018" interface="vgm_quik"> <feature name="part_id" value="18 darkmare.vgz" /> - <dataarea name="quik" size="7820"> - <rom name="18 darkmare.vgz" size="7820" crc="a97c6756" sha1="56415ec1295a1dd86517ea231b0a92e275dc2041" offset="0" /> + <dataarea name="quik" size="20034"> + <rom name="18 darkmare.vgz" size="20034" crc="0e5709bb" sha1="37e1bd85353f3fa114c4d3cd92e1292fc9bc736a" offset="0" /> </dataarea> </part> <part name="019" interface="vgm_quik"> <feature name="part_id" value="19 valua's feast.vgz" /> - <dataarea name="quik" size="17714"> - <rom name="19 valua's feast.vgz" size="17714" crc="d132e925" sha1="c07be0cea7b892fd7b6c34a026e7fa6cd3d7db54" offset="0" /> + <dataarea name="quik" size="32266"> + <rom name="19 valua's feast.vgz" size="32266" crc="2fe7d820" sha1="7402299a3257b80cefd80bdd542b9b8d429a3a14" offset="0" /> </dataarea> </part> <part name="020" interface="vgm_quik"> <feature name="part_id" value="20 epilogue.vgz" /> - <dataarea name="quik" size="9316"> - <rom name="20 epilogue.vgz" size="9316" crc="1502dafc" sha1="2f77e29080f05093876a810566b1fa28b4ce1699" offset="0" /> + <dataarea name="quik" size="25519"> + <rom name="20 epilogue.vgz" size="25519" crc="54f89b8b" sha1="7bdd5a66934dddb4ba6fb37fc6e0114a106b3076" offset="0" /> </dataarea> </part> <part name="021" interface="vgm_quik"> <feature name="part_id" value="21 letter.vgz" /> - <dataarea name="quik" size="25107"> - <rom name="21 letter.vgz" size="25107" crc="e21548c2" sha1="669db2d8a69d3f785eb92ad9bbbcdb9b6abdbc7b" offset="0" /> + <dataarea name="quik" size="46559"> + <rom name="21 letter.vgz" size="46559" crc="d307d659" sha1="f5f82215e650c924a66cb95e3351789181436a5b" offset="0" /> </dataarea> </part> <part name="022" interface="vgm_quik"> <feature name="part_id" value="22 staff roll.vgz" /> - <dataarea name="quik" size="18917"> - <rom name="22 staff roll.vgz" size="18917" crc="385537a1" sha1="cdac0275a02d2e68684dabe4df7e9aa6e63e99e4" offset="0" /> + <dataarea name="quik" size="30787"> + <rom name="22 staff roll.vgz" size="30787" crc="5e277242" sha1="feba3a1668580776a5a8ead48147c183e5a6d3fe" offset="0" /> </dataarea> </part> <part name="023" interface="vgm_quik"> <feature name="part_id" value="23 event.vgz" /> - <dataarea name="quik" size="1649"> - <rom name="23 event.vgz" size="1649" crc="859f2538" sha1="e38d723784a2aa15cb9cdc4b69cfab49ef6595f8" offset="0" /> + <dataarea name="quik" size="2667"> + <rom name="23 event.vgz" size="2667" crc="8dda5050" sha1="870a368737ab2d292798f744000296b440b3001d" offset="0" /> </dataarea> </part> <part name="024" interface="vgm_quik"> <feature name="part_id" value="24 fanfare.vgz" /> - <dataarea name="quik" size="1684"> - <rom name="24 fanfare.vgz" size="1684" crc="a212b160" sha1="35f54a35e569c1488ed47ba676150c479e391926" offset="0" /> + <dataarea name="quik" size="2781"> + <rom name="24 fanfare.vgz" size="2781" crc="4a22a2aa" sha1="27f9a6d847ae364c464ccd6b53a80edfd737bb90" offset="0" /> </dataarea> </part> <part name="025" interface="vgm_quik"> <feature name="part_id" value="25 save.vgz" /> - <dataarea name="quik" size="1168"> - <rom name="25 save.vgz" size="1168" crc="99537ba8" sha1="05549c3552f11ba5286c8f182e2229249779ecf8" offset="0" /> + <dataarea name="quik" size="1886"> + <rom name="25 save.vgz" size="1886" crc="28190237" sha1="e1a996241f9966299126ac7d632822e97a070f07" offset="0" /> </dataarea> </part> <part name="026" interface="vgm_quik"> <feature name="part_id" value="26 shock.vgz" /> - <dataarea name="quik" size="494"> - <rom name="26 shock.vgz" size="494" crc="e648bb03" sha1="ccfc2278125a4268e038272446c66323a4ab5ad2" offset="0" /> + <dataarea name="quik" size="927"> + <rom name="26 shock.vgz" size="927" crc="6458ef16" sha1="deb11ee4ad584e3045cbe70ece46641356e0445f" offset="0" /> </dataarea> </part> <part name="027" interface="vgm_quik"> <feature name="part_id" value="27 unused.vgz" /> - <dataarea name="quik" size="6491"> - <rom name="27 unused.vgz" size="6491" crc="6ad64f1c" sha1="8cad83bcf88482b2c1a03e3d51c7999d0b5d8f87" offset="0" /> + <dataarea name="quik" size="10912"> + <rom name="27 unused.vgz" size="10912" crc="fc699066" sha1="0f366bb7a440667089145556074b40d0891962ab" offset="0" /> </dataarea> </part> </software> @@ -231680,242 +231698,242 @@ <info name="cores" value="MSX-MUSIC (YM2413), PSG (AY-3-8910)"/> <part name="001" interface="vgm_quik"> <feature name="part_id" value="01 thunder.vgz" /> - <dataarea name="quik" size="778"> - <rom name="01 thunder.vgz" size="778" crc="383a1f94" sha1="f2dfd30a45d80df3033ab74b6841fadc05add404" offset="0" /> + <dataarea name="quik" size="1245"> + <rom name="01 thunder.vgz" size="1245" crc="7be91dee" sha1="f04598880e02d0c80c6fb37897ec3b536a28326c" offset="0" /> </dataarea> </part> <part name="002" interface="vgm_quik"> <feature name="part_id" value="02 illusion theme b.vgz" /> - <dataarea name="quik" size="22978"> - <rom name="02 illusion theme b.vgz" size="22978" crc="18db51a9" sha1="104ca142cf0b5e76b18ac5cb2d5d673c352dde1c" offset="0" /> + <dataarea name="quik" size="45230"> + <rom name="02 illusion theme b.vgz" size="45230" crc="a8d6121b" sha1="dbb491de40b0fb6f3878f13b16f5125517f8ea52" offset="0" /> </dataarea> </part> <part name="003" interface="vgm_quik"> <feature name="part_id" value="03 illusion theme a.vgz" /> - <dataarea name="quik" size="21614"> - <rom name="03 illusion theme a.vgz" size="21614" crc="0653e96e" sha1="3f0b8ecdc0a5c614560b50d07a98fbe5ad397d1a" offset="0" /> + <dataarea name="quik" size="43320"> + <rom name="03 illusion theme a.vgz" size="43320" crc="1963c350" sha1="e38b4ed3a4ca98fc4c76f72d22bc59c7918f1746" offset="0" /> </dataarea> </part> <part name="004" interface="vgm_quik"> <feature name="part_id" value="04 home.vgz" /> - <dataarea name="quik" size="19490"> - <rom name="04 home.vgz" size="19490" crc="2b3746c9" sha1="7f20c35bc8f0411084ad94f22e06981f5c923879" offset="0" /> + <dataarea name="quik" size="31173"> + <rom name="04 home.vgz" size="31173" crc="bfe02c56" sha1="198171c3b0aef1dc4c081a9f51bb9792d4681133" offset="0" /> </dataarea> </part> <part name="005" interface="vgm_quik"> <feature name="part_id" value="05 old master's house.vgz" /> - <dataarea name="quik" size="5804"> - <rom name="05 old master's house.vgz" size="5804" crc="e7308cac" sha1="d5ce5fb189d5674756f64ef615588e08295fdf95" offset="0" /> + <dataarea name="quik" size="9848"> + <rom name="05 old master's house.vgz" size="9848" crc="6cdb7214" sha1="a9818459e960938aeca75209444bacf636ec2931" offset="0" /> </dataarea> </part> <part name="006" interface="vgm_quik"> <feature name="part_id" value="06 crisis area.vgz" /> - <dataarea name="quik" size="20641"> - <rom name="06 crisis area.vgz" size="20641" crc="ed6f7cc8" sha1="0b2accc3a522c92237ddac07e66d3d491b70744d" offset="0" /> + <dataarea name="quik" size="40022"> + <rom name="06 crisis area.vgz" size="40022" crc="e3af60ae" sha1="d51f8878a187c33c149728d43d5f4be965b0d725" offset="0" /> </dataarea> </part> <part name="007" interface="vgm_quik"> <feature name="part_id" value="07 indoor combat.vgz" /> - <dataarea name="quik" size="27059"> - <rom name="07 indoor combat.vgz" size="27059" crc="ff6e8337" sha1="84e24abc7c1705e5430c11eeb62a5db430bd2d60" offset="0" /> + <dataarea name="quik" size="46581"> + <rom name="07 indoor combat.vgz" size="46581" crc="2eb6147f" sha1="6f14e345859fd9ee8d2288aaee1b392a010b655c" offset="0" /> </dataarea> </part> <part name="008" interface="vgm_quik"> <feature name="part_id" value="08 hazard area.vgz" /> - <dataarea name="quik" size="21242"> - <rom name="08 hazard area.vgz" size="21242" crc="820e0c6a" sha1="3cc94d4d3f5c7ceb5578f696a3a4915ff4577601" offset="0" /> + <dataarea name="quik" size="35854"> + <rom name="08 hazard area.vgz" size="35854" crc="32ed04f6" sha1="acd392512bf378eb4e56c94f6521c64655b750ec" offset="0" /> </dataarea> </part> <part name="009" interface="vgm_quik"> <feature name="part_id" value="09 shao mei.vgz" /> - <dataarea name="quik" size="21172"> - <rom name="09 shao mei.vgz" size="21172" crc="b880bf9e" sha1="3db9b8ee3d1b2d81462b32a04e3fd5b319b81a58" offset="0" /> + <dataarea name="quik" size="45037"> + <rom name="09 shao mei.vgz" size="45037" crc="c8f7d6de" sha1="4d3cef3001a1fb5ba824b224ea275d90dabe9fea" offset="0" /> </dataarea> </part> <part name="010" interface="vgm_quik"> <feature name="part_id" value="10 metal area.vgz" /> - <dataarea name="quik" size="16230"> - <rom name="10 metal area.vgz" size="16230" crc="a904845e" sha1="ba9adfcbf39cbe5c2af056cdb780ed593a478bf4" offset="0" /> + <dataarea name="quik" size="29486"> + <rom name="10 metal area.vgz" size="29486" crc="25a595c1" sha1="73e4775c177e316ca1daffd2dbfb926356579fde" offset="0" /> </dataarea> </part> <part name="011" interface="vgm_quik"> <feature name="part_id" value="11 network image.vgz" /> - <dataarea name="quik" size="34610"> - <rom name="11 network image.vgz" size="34610" crc="3f77e3d2" sha1="f9fca688f8044810d014a06a7244e798f1c9e244" offset="0" /> + <dataarea name="quik" size="72254"> + <rom name="11 network image.vgz" size="72254" crc="782b63b8" sha1="dc475c3e86cac5741f7109aef408309aeeff9d24" offset="0" /> </dataarea> </part> <part name="012" interface="vgm_quik"> <feature name="part_id" value="12 requiem.vgz" /> - <dataarea name="quik" size="17364"> - <rom name="12 requiem.vgz" size="17364" crc="ba7ce0fe" sha1="559e07621dcdbec1d36f9355230a36cc8f3489d0" offset="0" /> + <dataarea name="quik" size="32670"> + <rom name="12 requiem.vgz" size="32670" crc="e6902fb2" sha1="1140a3207b0acec1f15f10846e55b9706880f38c" offset="0" /> </dataarea> </part> <part name="013" interface="vgm_quik"> <feature name="part_id" value="13 crisis.vgz" /> - <dataarea name="quik" size="17615"> - <rom name="13 crisis.vgz" size="17615" crc="fa4e9162" sha1="647d2fa8a4b7c80e6bd81f8fe9277acb9d765cc2" offset="0" /> + <dataarea name="quik" size="32123"> + <rom name="13 crisis.vgz" size="32123" crc="81c470a5" sha1="9477ee763a2d7fd9d1c5ad75c3b15a49d5d8b839" offset="0" /> </dataarea> </part> <part name="014" interface="vgm_quik"> <feature name="part_id" value="14 victory.vgz" /> - <dataarea name="quik" size="24927"> - <rom name="14 victory.vgz" size="24927" crc="8c02d10c" sha1="fa2e78b89f85b6aacadf1ef8dcd1f25758a802b3" offset="0" /> + <dataarea name="quik" size="39782"> + <rom name="14 victory.vgz" size="39782" crc="a72e59ba" sha1="f73e573afe5c65d1d92560959509f203deee66f4" offset="0" /> </dataarea> </part> <part name="015" interface="vgm_quik"> <feature name="part_id" value="15 magic day.vgz" /> - <dataarea name="quik" size="23813"> - <rom name="15 magic day.vgz" size="23813" crc="5ec5e888" sha1="533c94b6c51346f6ea058ce059d9c23c3b4fef9c" offset="0" /> + <dataarea name="quik" size="43274"> + <rom name="15 magic day.vgz" size="43274" crc="322ec046" sha1="50a855d3ae40b20ff5903e800c06514eefa25bfa" offset="0" /> </dataarea> </part> <part name="016" interface="vgm_quik"> <feature name="part_id" value="16 fetal movement.vgz" /> - <dataarea name="quik" size="29069"> - <rom name="16 fetal movement.vgz" size="29069" crc="4278aa49" sha1="5ebbb051ef9e5092ea936b0e46b2b285f427ba90" offset="0" /> + <dataarea name="quik" size="48803"> + <rom name="16 fetal movement.vgz" size="48803" crc="294d4536" sha1="74e63b09094fe492b2d4a7ae19fe4e94ffaef8eb" offset="0" /> </dataarea> </part> <part name="017" interface="vgm_quik"> <feature name="part_id" value="17 illusion castle.vgz" /> - <dataarea name="quik" size="18443"> - <rom name="17 illusion castle.vgz" size="18443" crc="0be8a48a" sha1="d14daebbd88d059903d638d3967b3c21a3c1d44f" offset="0" /> + <dataarea name="quik" size="38550"> + <rom name="17 illusion castle.vgz" size="38550" crc="b8134cc1" sha1="96b2df51f8269cee7ed42de1d468391fdf40e73a" offset="0" /> </dataarea> </part> <part name="018" interface="vgm_quik"> <feature name="part_id" value="18 rumbling of the city.vgz" /> - <dataarea name="quik" size="24436"> - <rom name="18 rumbling of the city.vgz" size="24436" crc="3bd8ee0f" sha1="af1bb9ee8766883f4abfafa2a5b823ed84c28b65" offset="0" /> + <dataarea name="quik" size="40524"> + <rom name="18 rumbling of the city.vgz" size="40524" crc="bf016bea" sha1="34c501fec5219633291e2663fbf01adf979e202c" offset="0" /> </dataarea> </part> <part name="019" interface="vgm_quik"> <feature name="part_id" value="19 dancing.vgz" /> - <dataarea name="quik" size="40310"> - <rom name="19 dancing.vgz" size="40310" crc="6d41fa02" sha1="f4358e95016cc70c0d5105cd602168152a7f3c42" offset="0" /> + <dataarea name="quik" size="69709"> + <rom name="19 dancing.vgz" size="69709" crc="e1e3caae" sha1="04fc58cf8328344f99a79cb1f02e85bfcc06186d" offset="0" /> </dataarea> </part> <part name="020" interface="vgm_quik"> <feature name="part_id" value="20 vip room.vgz" /> - <dataarea name="quik" size="20309"> - <rom name="20 vip room.vgz" size="20309" crc="14b7df46" sha1="1138e709948f62c4a196bdb9512d0036eeba76eb" offset="0" /> + <dataarea name="quik" size="19314"> + <rom name="20 vip room.vgz" size="19314" crc="494e181c" sha1="34607c7bf3ebc64687ae37795f2ba1204f06c1e2" offset="0" /> </dataarea> </part> <part name="021" interface="vgm_quik"> <feature name="part_id" value="21 shop.vgz" /> - <dataarea name="quik" size="14509"> - <rom name="21 shop.vgz" size="14509" crc="946bcca0" sha1="a50d85be09401f40781ecc31d18a46d8eff11e25" offset="0" /> + <dataarea name="quik" size="24717"> + <rom name="21 shop.vgz" size="24717" crc="fadd881b" sha1="6b80c648badf1d6b275c0ddcd872b5ac0de8b33f" offset="0" /> </dataarea> </part> <part name="022" interface="vgm_quik"> <feature name="part_id" value="22 ceremony.vgz" /> - <dataarea name="quik" size="3834"> - <rom name="22 ceremony.vgz" size="3834" crc="8aa560e2" sha1="85fe97614bde381c4e7a1bd7ac56b4e613b1d581" offset="0" /> + <dataarea name="quik" size="11489"> + <rom name="22 ceremony.vgz" size="11489" crc="78919d1b" sha1="a6f19d5e9dfcd9b2b46f6921d6a21f1fd9f52ea6" offset="0" /> </dataarea> </part> <part name="023" interface="vgm_quik"> <feature name="part_id" value="23 in captivity.vgz" /> - <dataarea name="quik" size="3660"> - <rom name="23 in captivity.vgz" size="3660" crc="ce184ecd" sha1="f24e3f07fdc066a61230c429581d48ebb10836d1" offset="0" /> + <dataarea name="quik" size="8184"> + <rom name="23 in captivity.vgz" size="8184" crc="a335f36f" sha1="0f9afee3f8879606f5e0dd9bc936070d30de96a4" offset="0" /> </dataarea> </part> <part name="024" interface="vgm_quik"> <feature name="part_id" value="24 lovers.vgz" /> - <dataarea name="quik" size="8915"> - <rom name="24 lovers.vgz" size="8915" crc="79717151" sha1="133e855359afe5a7782e5f1b85e69be9764f3f17" offset="0" /> + <dataarea name="quik" size="15596"> + <rom name="24 lovers.vgz" size="15596" crc="33415488" sha1="e5f036e3e5ff3396ed0fc194b2e1632d41415cca" offset="0" /> </dataarea> </part> <part name="025" interface="vgm_quik"> <feature name="part_id" value="25 water pipe.vgz" /> - <dataarea name="quik" size="11531"> - <rom name="25 water pipe.vgz" size="11531" crc="b79abac7" sha1="ec9881ad3e94f81be3373ea008763e33a469c0a9" offset="0" /> + <dataarea name="quik" size="25040"> + <rom name="25 water pipe.vgz" size="25040" crc="95b0e840" sha1="ab2f4a706d2cc52dbe11c6d376fd55d3c4f955ef" offset="0" /> </dataarea> </part> <part name="026" interface="vgm_quik"> <feature name="part_id" value="26 cavern (labyrinth).vgz" /> - <dataarea name="quik" size="18355"> - <rom name="26 cavern (labyrinth).vgz" size="18355" crc="3794650a" sha1="55a343965a50a61ba3d9fe8cb332285eabc43c75" offset="0" /> + <dataarea name="quik" size="29782"> + <rom name="26 cavern (labyrinth).vgz" size="29782" crc="c6fa9339" sha1="cec973af7e48f5053b47617c2bf7d69cf8296256" offset="0" /> </dataarea> </part> <part name="027" interface="vgm_quik"> <feature name="part_id" value="27 moon's madness.vgz" /> - <dataarea name="quik" size="19318"> - <rom name="27 moon's madness.vgz" size="19318" crc="361c8959" sha1="9defc464e6fbe29b474219c4469e74c4ffa2afa6" offset="0" /> + <dataarea name="quik" size="35604"> + <rom name="27 moon's madness.vgz" size="35604" crc="e2a3b78c" sha1="d1cd050185574ccdec503819cec1764d9b5fb770" offset="0" /> </dataarea> </part> <part name="028" interface="vgm_quik"> <feature name="part_id" value="28 battle.vgz" /> - <dataarea name="quik" size="29016"> - <rom name="28 battle.vgz" size="29016" crc="7f5fd5cc" sha1="d67d98457d7a3105d89c5979f29154e41a475eb0" offset="0" /> + <dataarea name="quik" size="45706"> + <rom name="28 battle.vgz" size="45706" crc="9494a4b1" sha1="69bdd735010d4971cb4b9d12ba824906c7c1f006" offset="0" /> </dataarea> </part> <part name="029" interface="vgm_quik"> <feature name="part_id" value="29 party of 8 battle.vgz" /> - <dataarea name="quik" size="44728"> - <rom name="29 party of 8 battle.vgz" size="44728" crc="468fb9b9" sha1="93ea665694b796124a1d77038a51ac3c81239c0b" offset="0" /> + <dataarea name="quik" size="79066"> + <rom name="29 party of 8 battle.vgz" size="79066" crc="9eb137db" sha1="c1b794a15f0207fbe07c520169d7171a9f937114" offset="0" /> </dataarea> </part> <part name="030" interface="vgm_quik"> <feature name="part_id" value="30 heavenly king battle.vgz" /> - <dataarea name="quik" size="24686"> - <rom name="30 heavenly king battle.vgz" size="24686" crc="ddb13c08" sha1="b5fe03a285384bc25a8ca3c1213e8fc6261d203c" offset="0" /> + <dataarea name="quik" size="48543"> + <rom name="30 heavenly king battle.vgz" size="48543" crc="7d071ae0" sha1="124a522f9ce7b187da58a92f45f5eca51378302e" offset="0" /> </dataarea> </part> <part name="031" interface="vgm_quik"> <feature name="part_id" value="31 nightmare.vgz" /> - <dataarea name="quik" size="3907"> - <rom name="31 nightmare.vgz" size="3907" crc="c13bc509" sha1="46fc62103c1fcaafffef9982e4786263e51f347f" offset="0" /> + <dataarea name="quik" size="9143"> + <rom name="31 nightmare.vgz" size="9143" crc="cb972822" sha1="565680c1b506186e164d3fa1b64c7d5dce039808" offset="0" /> </dataarea> </part> <part name="032" interface="vgm_quik"> <feature name="part_id" value="32 final battle.vgz" /> - <dataarea name="quik" size="27676"> - <rom name="32 final battle.vgz" size="27676" crc="bc94b1ea" sha1="bc966b1b1fe47238a1ae2f83338425a25d2dc3c3" offset="0" /> + <dataarea name="quik" size="51588"> + <rom name="32 final battle.vgz" size="51588" crc="c4cc15a0" sha1="f787a4210da7aac3b12683571c9cc85248528b43" offset="0" /> </dataarea> </part> <part name="033" interface="vgm_quik"> <feature name="part_id" value="33 ending.vgz" /> - <dataarea name="quik" size="22699"> - <rom name="33 ending.vgz" size="22699" crc="54a296e1" sha1="91b5e72e2abd6e02dd1dc78d3395c12c9b592d8d" offset="0" /> + <dataarea name="quik" size="42699"> + <rom name="33 ending.vgz" size="42699" crc="3a08b23a" sha1="33eee54e2f3f8cf9439a299a1b5eabca0354f858" offset="0" /> </dataarea> </part> <part name="034" interface="vgm_quik"> <feature name="part_id" value="34 unused 1.vgz" /> - <dataarea name="quik" size="14485"> - <rom name="34 unused 1.vgz" size="14485" crc="2b1d003d" sha1="3f1892457f0874785c343a71e29397cc3b11346d" offset="0" /> + <dataarea name="quik" size="26827"> + <rom name="34 unused 1.vgz" size="26827" crc="09612630" sha1="f444dad65165c984f9b1bd2d424e5c60c4face51" offset="0" /> </dataarea> </part> <part name="035" interface="vgm_quik"> - <feature name="part_id" value="35 unused 2.vgz" /> - <dataarea name="quik" size="3226"> - <rom name="35 unused 2.vgz" size="3226" crc="60a38d50" sha1="2855fbc0f40c12911b5a2678a86614a4547385ee" offset="0" /> + <feature name="part_id" value="35 illusion theme a (alternate version).vgz" /> + <dataarea name="quik" size="42524"> + <rom name="35 illusion theme a (alternate version).vgz" size="42524" crc="eea3ff09" sha1="2a2714c21cc49a5a9d0d6e5b33d139a4fcf40ba8" offset="0" /> </dataarea> </part> <part name="036" interface="vgm_quik"> - <feature name="part_id" value="36 illusion theme a (alternate version).vgz" /> - <dataarea name="quik" size="82656"> - <rom name="36 illusion theme a (alternate version).vgz" size="82656" crc="16a28510" sha1="e434b6cadadcb0e51b86899465d6d5433863ffd7" offset="0" /> + <feature name="part_id" value="36 home (alternate version).vgz" /> + <dataarea name="quik" size="31969"> + <rom name="36 home (alternate version).vgz" size="31969" crc="98970d0d" sha1="bd96bd11ed58418a6dfc4f04a8f99c64a3cdad82" offset="0" /> </dataarea> </part> <part name="037" interface="vgm_quik"> - <feature name="part_id" value="37 home (alternate version).vgz" /> - <dataarea name="quik" size="20627"> - <rom name="37 home (alternate version).vgz" size="20627" crc="e2337170" sha1="aaed9cbf6195c84bb7335ea1ae4770ebbd87bf14" offset="0" /> + <feature name="part_id" value="37 requiem (alternate version).vgz" /> + <dataarea name="quik" size="36158"> + <rom name="37 requiem (alternate version).vgz" size="36158" crc="8e0ae687" sha1="b21ae91ca899f07b838680c8b3366d4798f6018d" offset="0" /> </dataarea> </part> <part name="038" interface="vgm_quik"> - <feature name="part_id" value="38 requiem (alternate version).vgz" /> - <dataarea name="quik" size="19035"> - <rom name="38 requiem (alternate version).vgz" size="19035" crc="5a0ff9a7" sha1="acd77333ab5f824c7736b9b9045997d0da5b49c1" offset="0" /> + <feature name="part_id" value="38 ceremony (alternate version 1).vgz" /> + <dataarea name="quik" size="12717"> + <rom name="38 ceremony (alternate version 1).vgz" size="12717" crc="c04049fe" sha1="ea4eac93d28c5244a1eb507f4a93fbfc2dfd7bf7" offset="0" /> </dataarea> </part> <part name="039" interface="vgm_quik"> - <feature name="part_id" value="39 party of 8 battle (alternate version).vgz" /> - <dataarea name="quik" size="39346"> - <rom name="39 party of 8 battle (alternate version).vgz" size="39346" crc="45cc8f2f" sha1="6a9829ce0d094d95d2a983682ed399274de5911d" offset="0" /> + <feature name="part_id" value="39 ceremony (alternate version 2).vgz" /> + <dataarea name="quik" size="11598"> + <rom name="39 ceremony (alternate version 2).vgz" size="11598" crc="88bfdc4d" sha1="7ade77bd9676f2594a668c79205ef831fb9c5ca7" offset="0" /> </dataarea> </part> <part name="040" interface="vgm_quik"> - <feature name="part_id" value="40 unused 2 (alternate version).vgz" /> - <dataarea name="quik" size="3263"> - <rom name="40 unused 2 (alternate version).vgz" size="3263" crc="ae456318" sha1="cf5036567e543f2fcd206b09d364ba2ce0461d95" offset="0" /> + <feature name="part_id" value="40 party of 8 battle (alternate version).vgz" /> + <dataarea name="quik" size="71942"> + <rom name="40 party of 8 battle (alternate version).vgz" size="71942" crc="294061fa" sha1="7f5760473b24a9e7fc11e08c2a3a307bd4d2db7d" offset="0" /> </dataarea> </part> </software> @@ -233406,6 +233424,10 @@ </part> </software> +<!-- vgmrips.net update - December 31, 2019 - 7 Entries --> +<!-- All are updates to existing sets (no new games) and have been merged with previous --> + + <!-- Project.org 2612 VGM Archives located at http://project2612.org/list.php Also https://archive.org/details/Project2612CompleteArchive20180623681Sets.7z --> diff --git a/hash/vsmile_cart.xml b/hash/vsmile_cart.xml index 3c39c5b2b31..c012f72eea4 100644 --- a/hash/vsmile_cart.xml +++ b/hash/vsmile_cart.xml @@ -574,7 +574,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul <softwarelist name="vsmile_cart" description="VTech V.Smile cartridges"> - <software name="aladdini" supported="yes"> + <software name="aladdini"> <description>Disney Aladdin - Il magico mondo di Aladdin (Italy)</description> <year>2006</year> <publisher>VTech</publisher> @@ -588,7 +588,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="aladdinnl" cloneof="aladdini" supported="yes"> + <software name="aladdinnl" cloneof="aladdini"> <description>Disney's Aladdin - De wonderwereld van Aladdin (Netherlands)</description> <year>2005</year> <publisher>VTech</publisher> @@ -605,7 +605,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="aladding" cloneof="aladdini" supported="yes"> + <software name="aladding" cloneof="aladdini"> <description>Disneys Aladdin - Aladdins Welt der Wunder (Germany)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -622,7 +622,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="aladdins" cloneof="aladdini" supported="yes"> + <software name="aladdins" cloneof="aladdini"> <description>Disney Aladdin - El Maravilloso Mundo de Aladdin (Spain)</description> <year>2005</year> <publisher>VTech</publisher> @@ -639,7 +639,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="redhoodg" supported="yes"> + <software name="redhoodg"> <description>Entdecke die Welt von Rotkäppchen (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -656,7 +656,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprkr101" supported="yes"> + <software name="alphaprkr101"> <description>Alphabet Park Adventure (USA, Rev. 101)</description> <year>200?</year> <publisher>VTech</publisher> @@ -671,7 +671,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprk" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprk" cloneof="alphaprkr101"> <description>Alphabet Park Adventure (USA)</description> <year>200?</year> <publisher>VTech</publisher> @@ -688,7 +688,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprka" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprka" cloneof="alphaprkr101"> <description>Alphabet Park Adventure (USA, alt)</description> <year>200?</year> <publisher>VTech</publisher> @@ -705,7 +705,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprknl" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprknl" cloneof="alphaprkr101"> <description>Alfabet Pretpark (NL)</description> <year>200?</year> <publisher>VTech</publisher> @@ -722,7 +722,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprkg" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprkg" cloneof="alphaprkr101"> <description>Abenteuer im ABC Park (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -739,7 +739,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprkgr3" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprkgr3" cloneof="alphaprkr101"> <description>Abenteuer im ABC Park (Germany, Rev. 3)</description> <year>200?</year> <publisher>VTech</publisher> @@ -756,7 +756,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprkf" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprkf" cloneof="alphaprkr101"> <description>ABC Land Aventure (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -773,7 +773,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="alphaprks" cloneof="alphaprkr101" supported="yes"> + <software name="alphaprks" cloneof="alphaprkr101"> <description>Aventuras en el Parque Alfabeto (Spain)</description> <year>200?</year> <publisher>VTech</publisher> @@ -790,7 +790,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arieluk" supported="yes"> + <software name="arieluk"> <description>Disney's The Little Mermaid - Ariel's Majestic Journey (UK)</description> <year>2004</year> <publisher>VTech</publisher> @@ -804,7 +804,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arielgr3" cloneof="arieluk" supported="yes"> + <software name="arielgr3" cloneof="arieluk"> <description>Disneys Arielle die Meerjungfrau - Arielles aufregendes Abenteuer (Germany, Rev. 3?)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -821,7 +821,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arielg" cloneof="arieluk" supported="yes"> + <software name="arielg" cloneof="arieluk"> <description>Disneys Arielle Die Meerjungfrau - Arielles aufregendes Abenteuer (Germany)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -838,7 +838,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arielf" cloneof="arieluk" supported="yes"> + <software name="arielf" cloneof="arieluk"> <description>Disney La Petite Sirene - Ariel devient une princesse (France)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -855,7 +855,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="ariels" cloneof="arieluk" supported="yes"> + <software name="ariels" cloneof="arieluk"> <description>Disney La Sirenita - El Viaje Fantástico de Ariel (Spain)</description> <year>2004</year> <publisher>VTech</publisher> @@ -872,7 +872,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arieldk" cloneof="arieluk" supported="yes"> + <software name="arieldk" cloneof="arieluk"> <description>Disney Den Lille Havfrue - Ariels majestætiske rejse! (Denmark)</description> <year>200?</year> <publisher>VTech</publisher> @@ -889,7 +889,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arielsw" cloneof="arieluk" supported="yes"> + <software name="arielsw" cloneof="arieluk"> <description>Disneys Den Lilla Sjöjungfrun - Ariels majestätiska resa! (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -906,7 +906,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="arieli" cloneof="arieluk" supported="yes"> + <software name="arieli" cloneof="arieluk"> <description>Disney La sirenetta - Ariel e la crociera magica (Italy)</description> <year>2005</year> <publisher>VTech / Giochi Preziosi</publisher> @@ -918,7 +918,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="backyardigf" supported="yes"> <!-- Will be clone of "backyardig" once found and dumped. --> + <software name="backyardigf"> <!-- Will be clone of "backyardig" once found and dumped. --> <description>Nickelodeon Les Mélodilous - Les explorateurs vikings (France)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -935,7 +935,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="batmanuk" supported="yes"> + <software name="batmanuk"> <description>The Batman - Gotham City Rescue (UK)</description> <year>2005</year> <!-- (s05) --> <publisher>VTech</publisher> @@ -949,7 +949,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="batmans" cloneof="batmanuk" supported="yes"> + <software name="batmans" cloneof="batmanuk"> <description>The Batman - Rescate en Gotham City (Spain)</description> <year>2006</year> <!-- (s06) --> <publisher>VTech</publisher> @@ -965,7 +965,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="batmang" supported="yes"> + <software name="batmang"> <description>The Batman - Rettung von Gotham City (Germany)</description> <year>2006</year> <!-- (s06) --> <publisher>VTech</publisher> @@ -982,7 +982,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="barneyg" supported="yes"> + <software name="barneyg"> <description>Barney - Erlebnis-Reise (Germany)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -999,7 +999,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="blueclue" supported="yes"> + <software name="blueclue"> <description>Nick Jr. Blue's Clues - Collection Day (USA)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1016,7 +1016,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="bobbday" supported="yes"> + <software name="bobbday"> <description>Bob the Builder - Bob's Busy Day (USA)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1048,7 +1048,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="bobbdayg" cloneof="bobbday" supported="yes"> + <software name="bobbdayg" cloneof="bobbday"> <description>Bob der Baumeister - Bobs spannender Arbeitstag (Germany)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1065,7 +1065,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="bobbdaygr104" cloneof="bobbday" supported="yes"> + <software name="bobbdaygr104" cloneof="bobbday"> <description>Bob der Baumeister - Bobs spannender Arbeitstag (Germany, Rev. 104)</description> <year>2008</year> <publisher>VTech</publisher> @@ -1082,7 +1082,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="bobbdays" cloneof="bobbday" supported="yes"> + <software name="bobbdays" cloneof="bobbday"> <description>Bob y sus Amigos - Un Día De Trabajo (Spain)</description> <year>2006</year> <publisher>VTech</publisher> @@ -1099,7 +1099,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="bobbdaydk" cloneof="bobbday" supported="yes"> + <software name="bobbdaydk" cloneof="bobbday"> <description>Byggemand Bob - Bobs travle dag (Denmark)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1116,7 +1116,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="bobbdaysw" cloneof="bobbday" supported="yes"> + <software name="bobbdaysw" cloneof="bobbday"> <description>Byggare Bob - Bobs stressiga dag (Sweden)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1133,7 +1133,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carebears" supported="yes"> <!-- Will be clone of "carebear" once found and dumped. --> + <software name="carebears"> <!-- Will be clone of "carebear" once found and dumped. --> <description>Osos Amorosos - Una Lección de Amor (Spain)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1166,7 +1166,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cars" cloneof="carsr201" supported="yes"> + <software name="cars" cloneof="carsr201"> <description>Disney/Pixar Cars - Rev It Up in Radiator Springs (USA)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1183,7 +1183,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carsuk" cloneof="carsr201" supported="yes"> + <software name="carsuk" cloneof="carsr201"> <description>Disney/Pixar Cars - Rev It Up in Radiator Springs (UK)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1197,7 +1197,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carsg" cloneof="carsr201" supported="yes"> + <software name="carsg" cloneof="carsr201"> <description>Disney/Pixar Cars - Vollgas in Radiator Springs (Germany)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1214,7 +1214,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carsf" cloneof="carsr201" supported="yes"> + <software name="carsf" cloneof="carsr201"> <description>Disney/Pixar Cars - Quatre Roues (France)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1231,7 +1231,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carss" cloneof="carsr201" supported="yes"> + <software name="carss" cloneof="carsr201"> <description>Disney/Pixar Cars - Acelera el Motor en Radiador Springs (Spain)</description> <year>2006</year> <publisher>VTech</publisher> @@ -1248,7 +1248,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carsdk" cloneof="carsr201" supported="yes"> + <software name="carsdk" cloneof="carsr201"> <description>Disney/Pixar Biler - Ræs i Kølerkildekøbing (Denmark)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -1265,7 +1265,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="carssw" cloneof="carsr201" supported="yes"> + <software name="carssw" cloneof="carsr201"> <description>Disney/Pixar Bilar - Kör ikapp i Kylarköping (Sweden)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -1283,7 +1283,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderla" supported="yes"> + <software name="cinderla"> <description>Disney Princess Cinderella - Cinderella's Magic Wishes (USA)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1300,7 +1300,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlaa" cloneof="cinderla" supported="yes"> + <software name="cinderlaa" cloneof="cinderla"> <description>Disney Princess Cinderella - Cinderella's Magic Wishes (USA, alt)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1313,7 +1313,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlai" cloneof="cinderla" supported="yes"> + <software name="cinderlai" cloneof="cinderla"> <description>Disney Cenerentola - I desideri magici di Cenerentola (Italy)</description> <year>2006</year> <publisher>VTech / Giochi Preziosi</publisher> @@ -1326,7 +1326,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlanl" cloneof="cinderla" supported="yes"> + <software name="cinderlanl" cloneof="cinderla"> <description>Walt Disney's Assepoester - De wonderwereld van Assepoester (Netherlands)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1343,7 +1343,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlauk" cloneof="cinderla" supported="yes"> + <software name="cinderlauk" cloneof="cinderla"> <description>Disney's Cinderella - Cinderella's Magic Wishes (UK)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1356,7 +1356,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlaf" cloneof="cinderla" supported="yes"> + <software name="cinderlaf" cloneof="cinderla"> <description>Disney Princesses Cendrillon - Le rêve enchanté de Cendrillon (France)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1373,7 +1373,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlas" cloneof="cinderla" supported="yes"> + <software name="cinderlas" cloneof="cinderla"> <description>Walt Disney La Cenicienta - Los sueños mágicos de Cenicienta (Spain)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1408,7 +1408,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlasr222" cloneof="cinderla" supported="yes"> + <software name="cinderlasr222" cloneof="cinderla"> <description>Walt Disney La Cenicienta - Los sueños mágicos de Cenicienta (Spain, Rev. 222)</description> <year>2008</year> <publisher>VTech</publisher> @@ -1425,7 +1425,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderladk" cloneof="cinderla" supported="yes"> + <software name="cinderladk" cloneof="cinderla"> <description>Disney Princess Cinderella - Askepots magiske ønsker (Denmark)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1442,7 +1442,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlagr204" cloneof="cinderla" supported="yes"> + <software name="cinderlagr204" cloneof="cinderla"> <description>Disney's Princess Cinderella - Lernen im Märchenland (Germany, Rev. 204)</description> <year>2008</year> <publisher>VTech</publisher> @@ -1459,7 +1459,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlagr104" cloneof="cinderla" supported="yes"> + <software name="cinderlagr104" cloneof="cinderla"> <description>Disney's Princess Cinderella - Lernen im Märchenland (Germany, Rev. 104)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -1476,7 +1476,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlag" cloneof="cinderla" supported="yes"> + <software name="cinderlag" cloneof="cinderla"> <description>Disney's Princess Cinderella - Lernen im Märchenland (Germany)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1493,7 +1493,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="cinderlasw" cloneof="cinderla" supported="yes"> + <software name="cinderlasw" cloneof="cinderla"> <description>Disney Princess Cinderella - Askungens magiska önskningar (Sweden)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -1527,7 +1527,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </software> <!-- Same ROM as "80-092283(UK)" --> - <software name="dora" cloneof="dorar201" supported="yes"> + <software name="dora" cloneof="dorar201"> <description>Nick Jr Dora the Explorer - Dora's Fix-it Adventure (USA)</description> <year>2008</year> <publisher>VTech</publisher> @@ -1562,7 +1562,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="doraf" cloneof="dorar201" supported="yes"> + <software name="doraf" cloneof="dorar201"> <description>Dora L'Exploratrice - Les aventures de Dora Apprentie Mécano (France)</description> <year>2008</year> <publisher>VTech</publisher> @@ -1597,7 +1597,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="doragr104" cloneof="dorar201" supported="yes"> + <software name="doragr104" cloneof="dorar201"> <description>Nick Jr Dora - Doras Reparatur-Abenteuer (Germany, Rev. 104)</description> <year>2008</year> <publisher>VTech</publisher> @@ -1614,7 +1614,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="elmo" supported="yes"> + <software name="elmo"> <description>Elmos großes Abenteuer (Germany)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1631,7 +1631,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="elmof" cloneof="elmo" supported="yes"> + <software name="elmof" cloneof="elmo"> <description>Le Monde d'Elmo - Les Grandes Découvertes D'Elmo (France)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1648,7 +1648,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="elmos" cloneof="elmo" supported="yes"> + <software name="elmos" cloneof="elmo"> <description>El Mundo de Elmo - Grandes descubrimientos de Elmo (Spain)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1665,7 +1665,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="findnemo" supported="yes"> + <software name="findnemo"> <description>Disney/Pixar Finding Nemo - Nemo's Ocean Discoveries (USA)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1682,7 +1682,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="findnemog" cloneof="findnemo" supported="yes"> + <software name="findnemog" cloneof="findnemo"> <description>Disney/Pixar Findet Nemo - Nemos Unterwasserabenteuer (Germany)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1699,7 +1699,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="findnemop" cloneof="findnemo" supported="yes"> + <software name="findnemop" cloneof="findnemo"> <description>Disney/Pixar À Procura de Nemo - Nemo À Descoberta do Oceano (Portugal)</description> <year>2006</year> <publisher>VTech</publisher> @@ -1716,7 +1716,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="findnemonl" cloneof="findnemo" supported="yes"> + <software name="findnemonl" cloneof="findnemo"> <description>Disney/Pixar Finding Nemo - De wonderwereld van Nemo (Netherlands)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -1733,7 +1733,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="findnemos" cloneof="findnemo" supported="yes"> + <software name="findnemos" cloneof="findnemo"> <description>Disney/Pixar Buscando a Nemo - Los Descubrimientos de Nemo (Spain)</description> <year>2005</year> <publisher>VTech</publisher> @@ -1750,7 +1750,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="fred" supported="yes"> + <software name="fred"> <description>Freds Zahlen Rallye (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1767,7 +1767,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="fredf" cloneof="fred" supported="yes"> + <software name="fredf" cloneof="fred"> <description>Apprenti' pilote (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1854,7 +1854,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="ltleinstngr3" cloneof="ltleinstnr5" supported="yes"> + <software name="ltleinstngr3" cloneof="ltleinstnr5"> <description>Disney's Kleine Einsteins (Germany, Rev. 3?)</description> <year>2009</year> <publisher>VTech</publisher> @@ -1889,7 +1889,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionking" supported="yes"> + <software name="lionking"> <description>Disney's The Lion King - Simba's Big Adventure (USA)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1906,7 +1906,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </software> <!-- where did the last 2MB in this come from? the cart is confirmed as having a 4MB blob and a 2MB blob --> - <software name="lionkinga" cloneof="lionking" supported="yes"> + <software name="lionkinga" cloneof="lionking"> <description>Disney's The Lion King - Simba's Big Adventure (USA, alt)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1923,7 +1923,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionkinggr2" cloneof="lionking" supported="yes"> + <software name="lionkinggr2" cloneof="lionking"> <description>Der Koenig der Loewen - Simbas großes Abenteuer (Germany, Rev. 2?)</description> <year>2004</year> <publisher>VTech</publisher> @@ -1940,7 +1940,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionkingf" cloneof="lionking" supported="yes"> + <software name="lionkingf" cloneof="lionking"> <description>Le Roi Lion - Simba Découvre la Jungle (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1957,7 +1957,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionkings" cloneof="lionking" supported="yes"> + <software name="lionkings" cloneof="lionking"> <description>Disney El Rey León - La Gran Aventura de Simba (Spain)</description> <year>2004</year> <publisher>VTech</publisher> @@ -1974,7 +1974,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionkingdk" cloneof="lionking" supported="yes"> + <software name="lionkingdk" cloneof="lionking"> <description>Disney Løvernes Konge - Simbas store eventyr (Denmark)</description> <year>200?</year> <publisher>VTech</publisher> @@ -1991,7 +1991,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionkingsw" cloneof="lionking" supported="yes"> + <software name="lionkingsw" cloneof="lionking"> <description>Disney Lejonkungen - Simbas stora äventyr (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2008,7 +2008,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lionkingi" cloneof="lionking" supported="yes"> + <software name="lionkingi" cloneof="lionking"> <description>Disney Il re leone - La grande avventura di Simba (Italy)</description> <year>2005</year> <publisher>VTech / Giochi Preziosi</publisher> @@ -2021,7 +2021,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="kungfupuk" supported="yes"> + <software name="kungfupuk"> <description>Kung Fu Panda - Path of the Panda (UK)</description> <year>2008</year> <publisher>VTech</publisher> @@ -2034,7 +2034,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="kungfupg" cloneof="kungfupuk" supported="yes"> + <software name="kungfupg" cloneof="kungfupuk"> <description>Kung Fu Panda - Der Weg des Panda (Germany)</description> <year>2008</year> <publisher>VTech</publisher> @@ -2069,7 +2069,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="lbratzs" supported="yes"> + <software name="lbratzs"> <description>Lil' Bratz Estrellas De La Moda - Amigos, Moda y Diversión (Spain)</description> <year>2008</year> <publisher>VTech</publisher> @@ -2086,7 +2086,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mannyg" supported="yes"> + <software name="mannyg"> <description>Meister Manny's Werkzeugkiste (Germany)</description> <year>2009?</year> <publisher>VTech</publisher> @@ -2103,7 +2103,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickymag" supported="yes"> + <software name="mickymag"> <description>Disney's Mickey Mouse - Mickey's Magical Adventure (USA)</description> <year>2005</year> <publisher>VTech</publisher> @@ -2116,7 +2116,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickymagi" cloneof="mickymag" supported="yes"> + <software name="mickymagi" cloneof="mickymag"> <description>Disney Topolino - Le Magiche Avventure di Topolino (Italy)</description> <year>2005</year> <publisher>VTech</publisher> @@ -2130,7 +2130,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickymagg" cloneof="mickymag" supported="yes"> + <software name="mickymagg" cloneof="mickymag"> <description>Disneys Micky - Mickys magisches Abenteuer (Germany)</description> <year>2005</year> <publisher>VTech</publisher> @@ -2147,7 +2147,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickymags" cloneof="mickymag" supported="yes"> + <software name="mickymags" cloneof="mickymag"> <description>Disney Mickey - La Aventura Mágica de Mickey (Spain)</description> <year>2004</year> <publisher>VTech</publisher> @@ -2164,7 +2164,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickymagsw" cloneof="mickymag" supported="yes"> + <software name="mickymagsw" cloneof="mickymag"> <description>Disneys Musse Pigg - Musses magiska äventyr (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2181,7 +2181,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickeychgr3" supported="yes"> + <software name="mickeychgr3"> <description>Micky Maus Wunderhaus (Germany, Rev. 3?)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2216,7 +2216,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickeychnl" cloneof="mickeychgr3" supported="yes"> + <software name="mickeychnl" cloneof="mickeychgr3"> <description>Mickey Mouse Clubhouse (Netherlands)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2233,7 +2233,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mickeychsw" cloneof="mickeychgr3" supported="yes"> + <software name="mickeychsw" cloneof="mickeychgr3"> <description>Mickey Mouse Clubhouse (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2250,7 +2250,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="monstalng" supported="yes"> + <software name="monstalng"> <description>DreamWorks Monsters vs Aliens (Germany)</description> <year>2009?</year> <publisher>VTech</publisher> @@ -2285,7 +2285,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mypuppyg" supported="yes"> + <software name="mypuppyg"> <description>Mein erster Hund (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2320,7 +2320,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="mypuppysw" cloneof="mypuppyg" supported="yes"> + <software name="mypuppysw" cloneof="mypuppyg"> <description>Min hundvalp (Sweden)</description> <year>2009?</year> <publisher>VTech</publisher> @@ -2337,7 +2337,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="noddy" supported="yes"> + <software name="noddy"> <description>Noddy - Detective for a Day (USA)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2354,7 +2354,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="noddyuk" cloneof="noddy" supported="yes"> + <software name="noddyuk" cloneof="noddy"> <description>Noddy - Detective for a Day (UK)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2368,7 +2368,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="noddygr104" cloneof="noddy" supported="yes"> + <software name="noddygr104" cloneof="noddy"> <description>Noddy - Detektiv für einen Tag (Germany, Rev. 104)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2385,7 +2385,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="noddyf" cloneof="noddy" supported="yes"> + <software name="noddyf" cloneof="noddy"> <description>Oui-Oui - Détective d'un Jour (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2402,7 +2402,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="noddyp" cloneof="noddy" supported="yes"> + <software name="noddyp" cloneof="noddy"> <description>Noddy - Detective Por um Dia (Portugal)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2436,7 +2436,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </software> <!-- No inputs, uses keyboard and mouse --> - <software name="pcpalisg" cloneof="pcpalisr3" supported="yes"> + <software name="pcpalisg" cloneof="pcpalisr3"> <description>V.Smile Mein erster Mausklick (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2471,7 +2471,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="upgr004" supported="yes"> + <software name="upgr004"> <description>Disney/Pixar Oben (Germany, Rev. 004)</description> <year>2009?</year> <publisher>VTech</publisher> @@ -2488,7 +2488,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="upukr3" cloneof="upgr004" supported="yes"> + <software name="upukr3" cloneof="upgr004"> <description>Disney/Pixar Up (UK, Rev. 003)</description> <year>2009</year> <publisher>VTech</publisher> @@ -2519,7 +2519,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="partyprk" supported="yes"> + <software name="partyprk"> <description>Cranium Partyland Park - A Carnival of Play-and-Learn Fun (USA)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -2572,7 +2572,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="ratati" cloneof="ratatg" supported="yes"> + <software name="ratati" cloneof="ratatg"> <description>Disney/Pixar Ratatouille - Le nuove ricette di Remy (Italy)</description> <year>2007</year> <publisher>VTech</publisher> @@ -2602,7 +2602,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="ratatg" supported="yes"> + <software name="ratatg"> <description>Disney/Pixar Ratatouille - Remys neue Rezepte (Germany)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -2653,7 +2653,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydo" cloneof="scoobydor301" supported="yes"> + <software name="scoobydo" cloneof="scoobydor301"> <description>Scooby-Doo! - Funland Frenzy (USA)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2670,7 +2670,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydoi" cloneof="scoobydor301" supported="yes"> + <software name="scoobydoi" cloneof="scoobydor301"> <description>Scooby-Doo! - Avventura a Funland (Italy)</description> <year>200?</year> <publisher>VTech / Giochi Preziosi</publisher> @@ -2683,7 +2683,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydonl" cloneof="scoobydor301" supported="yes"> + <software name="scoobydonl" cloneof="scoobydor301"> <description>Scooby-Doo! - Griezelen in het Pretpark (Netherlands)</description> <year>2005</year> <!-- (s05) --> <publisher>VTech</publisher> @@ -2728,7 +2728,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydog" cloneof="scoobydor301" supported="yes"> + <software name="scoobydog" cloneof="scoobydor301"> <description>Scooby-Doo! - Im Lernpark (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2745,7 +2745,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydof" cloneof="scoobydor301" supported="yes"> + <software name="scoobydof" cloneof="scoobydor301"> <description>Scooby-Doo - Panique à Funland (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2780,7 +2780,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydostb" cloneof="scoobydor301" supported="yes"> + <software name="scoobydostb" cloneof="scoobydor301"> <description>Scooby-Doo - Misterio En El Parque (Spain, translucent blue cartridge)</description> <year>2004</year> <!-- (s04) --> <publisher>VTech</publisher> @@ -2797,7 +2797,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydodk" cloneof="scoobydor301" supported="yes"> + <software name="scoobydodk" cloneof="scoobydor301"> <description>Scooby-Doo! - Sjov i forlystelsesparken (Denmark)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2814,7 +2814,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="scoobydosw" cloneof="scoobydor301" supported="yes"> + <software name="scoobydosw" cloneof="scoobydor301"> <description>Scooby-Doo! - Tivoli-tokerier (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -2831,7 +2831,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="erniebrt" supported="yes"> + <software name="erniebrt"> <description>Ernies & Berts Fantastisches Abenteuer (Germany)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -2848,7 +2848,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="erniebrts" cloneof="erniebrt" supported="yes"> + <software name="erniebrts" cloneof="erniebrt"> <description>Barrio Sésamo - El Mundo Fantástico de Epi y Blas (Spain)</description> <year>2006</year> <publisher>VTech</publisher> @@ -2865,7 +2865,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shrek3" supported="yes"> + <software name="shrek3"> <description>DreamWorks Shrek the Third - Arthur's School Day Adventure (USA)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -2900,7 +2900,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shrek3g" cloneof="shrek3" supported="yes"> + <software name="shrek3g" cloneof="shrek3"> <description>DreamWorks Shrek der Dritte - Ein Spannender Schultag (Germany)</description> <year>2007</year> <publisher>VTech</publisher> @@ -2917,7 +2917,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shrek3nl" cloneof="shrek3" supported="yes"> + <software name="shrek3nl" cloneof="shrek3"> <description>Shrek De Derde - Arthurs Schooldag Avontuur (Netherlands)</description> <year>2007?</year> <publisher>VTech</publisher> @@ -2949,7 +2949,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shreknl" supported="yes"> + <software name="shreknl"> <description>DreamWorks Shrek - Het Verhaal Van Draakje (Netherlands)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -2963,7 +2963,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shrekg" cloneof="shreknl" supported="yes"> + <software name="shrekg" cloneof="shreknl"> <description>DreamWorks Shrek - Die Geschichte des Drachen (Germany)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -2980,7 +2980,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shrekf" cloneof="shreknl" supported="yes"> + <software name="shrekf" cloneof="shreknl"> <description>DreamWorks Shrek - Le Rhume de Dragonne (France)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -2997,7 +2997,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="shreks" cloneof="shreknl" supported="yes"> + <software name="shreks" cloneof="shreknl"> <description>DreamWorks Shrek - El Cuento de la Dragona (Spain)</description> <year>2006</year> <publisher>VTech</publisher> @@ -3014,7 +3014,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="soccerch" supported="yes"> + <software name="soccerch"> <description>V.Smile Soccer Challenge (USA)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3031,7 +3031,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="soccerchg" cloneof="soccerch" supported="yes"> + <software name="soccerchg" cloneof="soccerch"> <description>V.Smile Fußball Schule (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3048,7 +3048,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="soccerchs" cloneof="soccerch" supported="yes"> + <software name="soccerchs" cloneof="soccerch"> <description>Campeonato de Futbol V.Smile (Spain)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3065,7 +3065,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spiderdocg" supported="yes"> + <software name="spiderdocg"> <description>Spider-Man & Freunde - Wettkampf im Space-Labor (Germany)</description> <year>2006?</year> <publisher>VTech</publisher> @@ -3082,7 +3082,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spiderdocs" cloneof="spiderdocg" supported="yes"> + <software name="spiderdocs" cloneof="spiderdocg"> <description>Spider-Man y Amigos - La Aventura Del Doctor Octopus (Spain)</description> <year>2006</year> <publisher>VTech</publisher> @@ -3117,7 +3117,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spidermisi" cloneof="spidermisr101" supported="yes"> + <software name="spidermisi" cloneof="spidermisr101"> <description>Spider-Man & Friends - Missioni Segrete (Italy)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3131,7 +3131,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spidermisg" cloneof="spidermisr101" supported="yes"> + <software name="spidermisg" cloneof="spidermisr101"> <description>Spider-Man & Freunde - Geheime Missionen (Germany)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3148,7 +3148,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spidermisf" cloneof="spidermisr101" supported="yes"> + <software name="spidermisf" cloneof="spidermisr101"> <description>Marvel Spider-Man & ses amis - Missions secrètes (France)</description> <year>2007</year> <publisher>VTech</publisher> @@ -3165,7 +3165,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spidermiss" cloneof="spidermisr101" supported="yes"> + <software name="spidermiss" cloneof="spidermisr101"> <description>Spider-Man y Amigos - Misiones Secretas (Spain)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3200,7 +3200,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spongeb" supported="yes"> + <software name="spongeb"> <description>Nickelodeon Spongebob Squarepants - A Day in the Life of a Sponge (USA)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -3217,7 +3217,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spongebgr1" cloneof="spongeb" supported="yes"> + <software name="spongebgr1" cloneof="spongeb"> <description>Nickelodeon Spongebob Schwammkopf - Der Tag des Schwamms (Germany, Rev. 1)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -3234,7 +3234,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spongebg1" cloneof="spongeb" supported="yes"> + <software name="spongebg1" cloneof="spongeb"> <description>Nickelodeon Spongebob Schwammkopf - Der Tag des Schwamms (Germany)</description> <year>2005?</year> <publisher>VTech</publisher> @@ -3251,7 +3251,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="spongebs" cloneof="spongeb" supported="yes"> + <software name="spongebs" cloneof="spongeb"> <description>Nickelodeon Bob Esponja - Un día en la vida de una esponja (Spain)</description> <year>2006</year> <publisher>VTech</publisher> @@ -3268,7 +3268,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="superman" supported="yes"> + <software name="superman"> <description>Superman - The Greatest Hero (USA)</description> <year>2006</year> <!-- (s06) --> <publisher>VTech</publisher> @@ -3285,7 +3285,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="supermang" cloneof="superman" supported="yes"> + <software name="supermang" cloneof="superman"> <description>Superman - Der Superheld (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3302,7 +3302,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="supermannl" cloneof="superman" supported="yes"> + <software name="supermannl" cloneof="superman"> <description>Superman - De Grootste Held (Netherlands)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3319,7 +3319,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="supermanf" cloneof="superman" supported="yes"> + <software name="supermanf" cloneof="superman"> <description>Superman - À la rescousse ! (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3336,7 +3336,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="supermans" cloneof="superman" supported="yes"> + <software name="supermans" cloneof="superman"> <description>Superman - El Hombre de Acero (Spain)</description> <year>2006</year> <!-- (s06) --> <publisher>VTech</publisher> @@ -3353,7 +3353,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="thomas" supported="yes"> + <software name="thomas"> <description>Thomas & Friends - Engines Working Together (USA)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3368,7 +3368,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="thomasuk" cloneof="thomas" supported="yes"> + <software name="thomasuk" cloneof="thomas"> <description>Thomas & Friends - Engines Working Together (UK)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3397,7 +3397,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="thomasgr104" cloneof="thomas" supported="yes"> + <software name="thomasgr104" cloneof="thomas"> <description>Thomas & seine Freunde - Freunde Halten Zusammen (Germany, Rev. 104)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3414,7 +3414,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="thomasg" cloneof="thomas" supported="yes"> + <software name="thomasg" cloneof="thomas"> <description>Thomas & seine Freunde - Freunde Halten Zusammen (Germany)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3431,7 +3431,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="thomasf" cloneof="thomas" supported="yes"> + <software name="thomasf" cloneof="thomas"> <description>Thomas et ses Amis - Les locomotives s'entraident (France)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3448,7 +3448,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="thomassw" cloneof="thomas" supported="yes"> + <software name="thomassw" cloneof="thomas"> <description>Thomas & Friends - Tågen hjälps åt (Sweden)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3465,7 +3465,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="tingelng" supported="yes"> + <software name="tingelng"> <description>Tingeling (Sweden)</description> <year>2010?</year> <publisher>VTech</publisher> @@ -3482,7 +3482,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="toystor2" supported="yes"> + <software name="toystor2"> <description>Disney/Pixar Toy Story 2 - Operation: Rescue Woody! (USA)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3495,7 +3495,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="toystor2a" cloneof="toystor2" supported="yes"> + <software name="toystor2a" cloneof="toystor2"> <description>Disney/Pixar Toy Story 2 - Operation: Rescue Woody! (USA, alt)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3511,7 +3511,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="toystor2uk" cloneof="toystor2" supported="yes"> + <software name="toystor2uk" cloneof="toystor2"> <description>Disney/Pixar Toy Story 2 - Operation-Rescue Woody! (UK)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3525,7 +3525,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="toystor2g" cloneof="toystor2" supported="yes"> + <software name="toystor2g" cloneof="toystor2"> <description>Disney/Pixar Toy Story 2 - Woodys Spannende Rettung (Germany)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3542,7 +3542,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="toystor2s" cloneof="toystor2" supported="yes"> + <software name="toystor2s" cloneof="toystor2"> <description>Disney/Pixar Toy Story 2 - El Rescate De Woody (Spain)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3559,7 +3559,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="toystor2sw" cloneof="toystor2" supported="yes"> + <software name="toystor2sw" cloneof="toystor2"> <description>Disney/Pixar Toy Story 2 - Operation: Rädda Woody! (Sweden)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3576,7 +3576,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="walleg" supported="yes"> + <software name="walleg"> <description>Disney/Pixar Wall-E (Germany)</description> <year>2008?</year> <publisher>VTech</publisher> @@ -3611,7 +3611,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="wallesw" cloneof="walleg" supported="yes"> + <software name="wallesw" cloneof="walleg"> <description>Disney/Pixar Wall-E (Sweden)</description> <year>2008?</year> <publisher>VTech</publisher> @@ -3628,7 +3628,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="pooh" supported="yes"> + <software name="pooh"> <description>Disneys Winnie the Pooh - The Honey Hunt (USA)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -3645,7 +3645,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohi" cloneof="pooh" supported="yes"> + <software name="poohi" cloneof="pooh"> <description>Winnie the Pooh e la caccia al miele (Italy)</description> <year>2005</year> <publisher>VTech</publisher> @@ -3677,7 +3677,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohg" cloneof="pooh" supported="yes"> + <software name="poohg" cloneof="pooh"> <description>Disneys Winnie Puuh - Die Honigjagd (Germany)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -3694,7 +3694,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohgr204" cloneof="pooh" supported="yes"> + <software name="poohgr204" cloneof="pooh"> <description>My Friends Tigger & Pooh - Die Honigjagd (Germany, Rev. 204)</description> <year>2008?</year> <publisher>VTech</publisher> @@ -3711,7 +3711,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohf" cloneof="pooh" supported="yes"> + <software name="poohf" cloneof="pooh"> <description>Disney Winnie l'Ourson - La Chasse au miel de Winnie (France)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -3728,7 +3728,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohfr2" cloneof="pooh" supported="yes"> + <software name="poohfr2" cloneof="pooh"> <description>Disney Winnie l'Ourson - La Chasse au miel de Winnie (France, Rev. 2)</description> <year>2004?</year> <publisher>VTech</publisher> @@ -3745,7 +3745,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohs" cloneof="pooh" supported="yes"> + <software name="poohs" cloneof="pooh"> <description>Disney Winnie the Pooh - En Busca de la Miel (Spain)</description> <year>2004</year> <publisher>VTech</publisher> @@ -3782,7 +3782,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohdk" cloneof="pooh" supported="yes"> + <software name="poohdk" cloneof="pooh"> <description>Disney Peter Plys - Honningjagten (Denmark)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3799,7 +3799,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="poohsw" cloneof="pooh" supported="yes"> + <software name="poohsw" cloneof="pooh"> <description>Disney Nalle Puh - Honungsjakten (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3875,7 +3875,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="techartsw" cloneof="techart" supported="yes"> + <software name="techartsw" cloneof="techart"> <description>V.Smile Tecknarstudio (Sweden)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3916,7 +3916,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="wkwheelg" supported="yes"> <!-- Will be clone of "wkwheel" once found and dumped. --> + <software name="wkwheelg"> <!-- Will be clone of "wkwheel" once found and dumped. --> <description>Flitzers Schlaue Städtetour (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3935,7 +3935,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="wkwheels" cloneof="wkwheelg" supported="yes"> <!-- Will be clone of "wkwheel" once found and dumped. --> + <software name="wkwheels" cloneof="wkwheelg"> <!-- Will be clone of "wkwheel" once found and dumped. --> <description>Conducción Divertida (Spain)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3974,7 +3974,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="zayzaear101" supported="yes"> + <software name="zayzaear101"> <description>Zayzoo: An Earth Adventure (USA, Rev. 101)</description> <year>200?</year> <publisher>VTech</publisher> @@ -3991,7 +3991,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="zayzaea" cloneof="zayzaear101" supported="yes"> + <software name="zayzaea" cloneof="zayzaear101"> <description>Zayzoo - My Alien Classmate (USA)</description> <year>200?</year> <publisher>VTech</publisher> @@ -4004,7 +4004,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="zayzaeag" cloneof="zayzaear101" supported="yes"> + <software name="zayzaeag" cloneof="zayzaear101"> <description>Zayzoos Lernall (Germany)</description> <year>200?</year> <publisher>VTech</publisher> @@ -4022,7 +4022,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </software> <!-- Found also with the same ROM as "80-092360-101(US)" --> - <software name="zayzaeaukr103" cloneof="zayzaear101" supported="yes"> + <software name="zayzaeaukr103" cloneof="zayzaear101"> <description>Zayzoo: An Earth Adventure (UK, Rev. 103)</description> <year>200?</year> <publisher>VTech</publisher> @@ -4035,7 +4035,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="zayzaeaf" cloneof="zayzaear101" supported="yes"> + <software name="zayzaeaf" cloneof="zayzaear101"> <description>Zézou - Notre Ami Venu d'Ailleurs (France)</description> <year>200?</year> <publisher>VTech</publisher> @@ -4052,7 +4052,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul </part> </software> - <software name="zayzaeas" cloneof="zayzaear101" supported="yes"> + <software name="zayzaeas" cloneof="zayzaear101"> <description>Zayzoo - Mi Amiga del Espacio (Spain)</description> <year>200?</year> <publisher>VTech</publisher> diff --git a/hash/wswan.xml b/hash/wswan.xml index 58dbc020c78..07f1d3ea637 100644 --- a/hash/wswan.xml +++ b/hash/wswan.xml @@ -1304,7 +1304,7 @@ <!-- The Robot Works cartridge has an integrated infrared port for programming an external robot (the Wonder Borg). - There is an undumped Ver.1.5 cart labeled SWJ-BAN034. + The Wonder Borg itself uses an Elan EM78P451AQ MCU (undumped). --> <software name="robworks"> <description>Wonder Borg Robot Works</description> @@ -1324,11 +1324,16 @@ </part> </software> + <!-- + The Robot Works cartridge has an integrated infrared port for programming an + external robot (the Wonder Borg). + The Wonder Borg itself uses an Elan EM78P451AQ MCU (undumped). + --> <software name="robworks1" cloneof="robworks"> <description>Robot Works (Asia)</description> <year>2000</year> <publisher>Bandai</publisher> - <info name="serial" value="SWJ-BAN033"/> + <info name="serial" value="SWJ-BAN033"/> <!-- Same ROM as cart SWJ-BAN034 (labeled "Ver.1.5") --> <info name="release" value="20000804"/> <info name="alt_title" value="ワンダーボーグ 完"/> <part name="cart" interface="wswan_cart"> @@ -94,7 +94,6 @@ # LTO = 1 # SSE2 = 1 # OPENMP = 1 -# FASTDEBUG = 1 # SEPARATE_BIN = 1 # PYTHON_EXECUTABLE = python3 @@ -810,10 +809,6 @@ ifdef OPENMP PARAMS += --OPENMP='$(OPENMP)' endif -ifdef FASTDEBUG -PARAMS += --FASTDEBUG='$(FASTDEBUG)' -endif - ifdef SEPARATE_BIN PARAMS += --SEPARATE_BIN='$(SEPARATE_BIN)' endif @@ -1704,14 +1699,14 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.216"' > $@ + @echo '#define BARE_BUILD_VERSION "0.217"' > $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char build_version[];' >> $@ @echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@ @echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.216" > $@ + @echo #define BARE_BUILD_VERSION "0.217" > $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char build_version[]; >> $@ @echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@ diff --git a/plugins/cheat/cheat_xml.lua b/plugins/cheat/cheat_xml.lua index 990e5fe64d8..d5cee8ac2a2 100644 --- a/plugins/cheat/cheat_xml.lua +++ b/plugins/cheat/cheat_xml.lua @@ -76,7 +76,12 @@ function xml.conv_cheat(data) local function convert_memref(cpu, phys, space, width, addr, rw) -- debug expressions address spaces by index not by name local function get_space_name(index) - return cpu_spaces[":" .. cpu][index] + local prefix = cpu:sub(1,1) + if prefix == ":" then + return cpu_spaces[cpu][index] + else + return cpu_spaces[":" .. cpu][index] + end end local mod = "" @@ -105,6 +110,12 @@ function xml.conv_cheat(data) elseif width == "q" then width = "u64" end + + local prefix = cpu:sub(1,1) + if prefix == ":" then + cpu = cpu:sub(2,cpu:len()) + end + local cpuname = cpu:gsub(":", "_") if space == "m" then regions[cpuname .. space] = ":" .. cpu diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua index ded3f0e44d2..9bd6ba2276c 100644 --- a/plugins/hiscore/init.lua +++ b/plugins/hiscore/init.lua @@ -46,8 +46,10 @@ function hiscore.startplugin() emu.print_verbose( "hiscore: config found" ); local _conf = {} for line in io.lines(config_path) do - token, value = string.match(line, '([^ ]+) ([^ ]+)'); - _conf[token] = value; + token, spaces, value = string.match(line, '([^ ]+)([ ]+)([^ ]+)'); + if token ~= nil and token ~= '' then + _conf[token] = value; + end end hiscore_path = lfs.env_replace(_conf["hi_path"] or hiscore_path); timed_save = _conf["only_save_at_exit"] ~= "1" diff --git a/regtests/LICENSE b/regtests/LICENSE index fb9f046cc43..9b30d5a81a9 100644 --- a/regtests/LICENSE +++ b/regtests/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019, MAME Development Team +Copyright (c) 2020, MAME Development Team All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/scripts/genie.lua b/scripts/genie.lua index 6aa28173b1d..a0bb95f83a6 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -338,15 +338,6 @@ newoption { } newoption { - trigger = "FASTDEBUG", - description = "Fast DEBUG.", - allowed = { - { "0", "Disabled" }, - { "1", "Enabled" }, - } -} - -newoption { trigger = "SEPARATE_BIN", description = "Use separate bin folders.", allowed = { @@ -620,13 +611,6 @@ configuration { "Debug" } -- "BGFX_CONFIG_DEBUG=1", } -if _OPTIONS["FASTDEBUG"]=="1" then - defines { - "MAME_DEBUG_FAST", - "NDEBUG", - } -end - configuration { } if _OPTIONS["PROFILER"]=="1" then @@ -1082,7 +1066,6 @@ end "-Wno-tautological-compare", "-Wno-unused-value", "-Wno-constant-logical-operand", - "-Wno-missing-braces", -- clang is not as permissive as GCC about std::array initialization "-fdiagnostics-show-note-include-stack", } if (version >= 30500) then @@ -1099,8 +1082,8 @@ end } end else - if (version < 50000) then - print("GCC version 5.0 or later needed") + if (version < 70000) then + print("GCC version 7.0 or later needed") os.exit(-1) end buildoptions { @@ -1335,68 +1318,39 @@ end buildoptions { "/WX", -- Treats all compiler warnings as errors. - "/wd4025", -- warning C4025: 'number' : based pointer passed to function with variable arguments: parameter number + "/w45038", -- warning C5038: data member 'member1' will be initialized after data member 'member2' + } + + buildoptions { "/wd4003", -- warning C4003: not enough actual parameters for macro 'xxx' + "/wd4005", -- warning C4005: The macro identifier is defined twice. The compiler uses the second macro definition "/wd4018", -- warning C4018: 'x' : signed/unsigned mismatch - "/wd4061", -- warning C4061: enumerator 'xxx' in switch of enum 'xxx' is not explicitly handled by a case label + "/wd4060", -- warning C4060: switch statement contains no 'case' or 'default' labels + "/wd4065", -- warning C4065: switch statement contains 'default' but no 'case' labels "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter "/wd4127", -- warning C4127: conditional expression is constant - "/wd4131", -- warning C4131: 'xxx' : uses old-style declarator - "/wd4141", -- warning C4141: 'xxx' : used more than once "/wd4146", -- warning C4146: unary minus operator applied to unsigned type, result still unsigned - "/wd4150", -- warning C4150: deletion of pointer to incomplete type 'xxx'; no destructor called - "/wd4189", -- warning C4189: 'xxx' : local variable is initialized but not referenced - "/wd4191", -- warning C4191: 'type cast' : unsafe conversion from 'xxx' to 'xxx' // 64-bit only "/wd4201", -- warning C4201: nonstandard extension used : nameless struct/union - "/wd4232", -- warning C4232: nonstandard extension used : 'xxx' : address of dllimport 'xxx' is not static, identity not guaranteed - "/wd4242", -- warning C4242: 'x' : conversion from 'xxx' to 'xxx', possible loss of data "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data + "/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch "/wd4250", -- warning C4250: 'xxx' : inherits 'xxx' via dominance - "/wd4255", -- warning C4255: 'xxx' : no function prototype given: converting '()' to '(void)' - "/wd4296", -- warning C4296: 'x' : expression is always false - "/wd4306", -- warning C4306: 'xxx': conversion from 'type1' to 'type2' of greater size // 64-bit only + "/wd4267", -- warning C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data "/wd4310", -- warning C4310: cast truncates constant value - "/wd4312", -- warning C4312: 'type cast' : conversion from 'xxx' to 'xxx' of greater size + "/wd4319", -- warning C4319: 'operator' : zero extending 'type' to 'type' of greater size "/wd4324", -- warning C4324: 'xxx' : structure was padded due to __declspec(align()) - "/wd4347", -- warning C4347: behavior change: 'xxx' is called instead of 'xxx' // obsolete VS2005 - VS2010 only - "/wd4435", -- warning C4435: 'xxx' : Object layout under /vd2 will change due to virtual base 'xxx' - "/wd4510", -- warning C4510: 'xxx' : default constructor could not be generated - "/wd4512", -- warning C4512: 'xxx' : assignment operator could not be generated - "/wd4514", -- warning C4514: 'xxx' : unreferenced inline function has been removed - "/wd4521", -- warning C4521: 'xxx' : multiple copy constructors specified - "/wd4571", -- warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable - "/wd4610", -- warning C4619: #pragma warning : there is no warning number 'xxx' - "/wd4611", -- warning C4571: Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught - "/wd4619", -- warning C4610: struct 'xxx' can never be instantiated - user defined constructor required - "/wd4625", -- warning C4625: 'xxx' : copy constructor could not be generated because a base class copy constructor is inaccessible or deleted - "/wd4626", -- warning C4626: 'xxx' : assignment operator could not be generated because a base class assignment operator is inaccessible or deleted - "/wd4640", -- warning C4640: 'xxx' : construction of local static object is not thread-safe - "/wd4668", -- warning C4668: 'xxx' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + "/wd4334", -- warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) + "/wd4389", -- warning C4389: 'operator' : signed/unsigned mismatch + "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration + "/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter + "/wd4458", -- warning C4458: declaration of 'xxx' hides class member + "/wd4459", -- warning C4459: declaration of 'xxx' hides global declaration "/wd4702", -- warning C4702: unreachable code "/wd4706", -- warning C4706: assignment within conditional expression - "/wd4710", -- warning C4710: 'xxx' : function not inlined - "/wd4711", -- warning C4711: function 'xxx' selected for automatic inline expansion // optimized only + "/wd4804", -- warning C4804: '>>': unsafe use of type 'bool' in operation "/wd4805", -- warning C4805: 'x' : unsafe mix of type 'xxx' and type 'xxx' in operation - "/wd4820", -- warning C4820: 'xxx' : 'x' bytes padding added after data member 'xxx' - "/wd4826", -- warning C4826: Conversion from 'type1 ' to 'type_2' is sign-extended. This may cause unexpected runtime behavior. // 32-bit only - "/wd4365", -- warning C4365: 'action' : conversion from 'type_1' to 'type_2', signed/unsigned mismatch - "/wd4389", -- warning C4389: 'operator' : signed/unsigned mismatch - "/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch - "/wd4388", -- warning C4388: signed/unsigned mismatch - "/wd4267", -- warning C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data - "/wd4005", -- warning C4005: The macro identifier is defined twice. The compiler uses the second macro definition - "/wd4350", -- warning C4350: behavior change: 'member1' called instead of 'member2' "/wd4996", -- warning C4996: 'function': was declared deprecated - "/wd4191", -- warning C4191: 'operator/operation' : unsafe conversion from 'type of expression' to 'type required' - "/wd4060", -- warning C4060: switch statement contains no 'case' or 'default' labels - "/wd4065", -- warning C4065: switch statement contains 'default' but no 'case' labels - "/wd4640", -- warning C4640: 'instance' : construction of local static object is not thread-safe - "/wd4290", -- warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) - "/wd4355", -- warning C4355: 'this' : used in base member initializer list - "/wd4800", -- warning C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) - "/wd4371", -- warning C4371: layout of class may have changed from a previous version of the compiler due to better packing of member 'member' - "/wd4548", -- warning C4548: expression before comma has no effect; expected expression with side-effect } + if _OPTIONS["vs"]=="intel-15" then buildoptions { "/Qwd9", -- remark #9: nested comment is not allowed @@ -1463,20 +1417,6 @@ end includedirs { MAME_DIR .. "3rdparty/dxsdk/Include" } -configuration { "vs201*" } - buildoptions { - "/wd4334", -- warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) - "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration - "/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter - "/wd4458", -- warning C4458: declaration of 'xxx' hides class member - "/wd4459", -- warning C4459: declaration of 'xxx' hides global declaration - "/wd4838", -- warning C4838: conversion from 'xxx' to 'yyy' requires a narrowing conversion - "/wd4091", -- warning C4091: 'typedef ': ignored on left of '' when no variable is declared - "/wd4463", -- warning C4463: overflow; assigning 1 to bit-field that can only hold values from -1 to 0 - "/wd4297", -- warning C4297: 'xxx::~xxx': function assumed not to throw an exception but does - "/wd4319", -- warning C4319: 'operator' : zero extending 'type' to 'type' of greater size - "/wd4592", -- warning C4592: symbol will be dynamically initialized (implementation limitation) - } configuration { "winphone8* or winstore8*" } linkoptions { "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata diff --git a/scripts/minimaws/lib/assets/machine.js b/scripts/minimaws/lib/assets/machine.js index d40dca12be0..b7f600f04d6 100644 --- a/scripts/minimaws/lib/assets/machine.js +++ b/scripts/minimaws/lib/assets/machine.js @@ -4,6 +4,7 @@ var slot_info = Object.create(null); var bios_sets = Object.create(null); var machine_flags = Object.create(null); +var softwarelist_info = Object.create(null); function make_slot_popup_id(name) { return ('select-slot-choice-' + name).replace(/:/g, '-'); } @@ -197,6 +198,47 @@ var fetch_machine_flags = (function () })(); +var fetch_softwarelist_info = (function () + { + var pending = Object.create(null); + return function (device) + { + if (!Object.prototype.hasOwnProperty.call(softwarelist_info, device) && !Object.prototype.hasOwnProperty.call(pending, device)) + { + pending[device] = true; + var req = new XMLHttpRequest(); + req.open('GET', appurl + 'rpc/softwarelists/' + encodeURIComponent(device), true); + req.responseType = 'json'; + req.onload = + function () + { + delete pending[device]; + if (req.status == 200) + { + softwarelist_info[device] = req.response; + var slotslist = document.getElementById('list-slot-options'); + if (slotslist) + { + for (var item = slotslist.firstChild; item; item = item.nextSibling) + { + if ((item.nodeName == 'DT') && (item.getAttribute('data-slotcard') == device)) + { + var slotname = item.getAttribute('data-slotname'); + add_softwarelist_rows( + device, + slotname, + document.getElementById('select-slot-choice-' + slotname.replace(/:/g, '-')).value); + } + } + } + } + }; + req.send(); + } + }; + })(); + + function add_flag_rows(table, device) { var sorted_features = Object.keys(machine_flags[device].features).sort(); @@ -228,6 +270,51 @@ function add_flag_rows(table, device) } +function add_softwarelist_rows(device, slot, card) +{ + var sorted_softwarelists = Object.keys(softwarelist_info[device]).sort(); + var cardtag = slot + ':' + card; + if (sorted_softwarelists.length) + { + var table = document.getElementById('tbl-softwarelists').tBodies[0]; + sorted_softwarelists.forEach( + function (tag) + { + var cell, link; + var info = softwarelist_info[device][tag]; + var href = appurl + 'softwarelist/' + encodeURIComponent(info.shortname); + var row = table.appendChild(document.createElement('tr')); + row.setAttribute('id', 'row-softwarelists-' + (cardtag + tag).replace(/:/g, '-')) + row.appendChild(document.createElement('td')).textContent = cardtag; + link = row.appendChild(document.createElement('td')).appendChild(document.createElement('a')); + link.setAttribute('href', href); + link.textContent = info.shortname; + link = row.appendChild(document.createElement('td')).appendChild(document.createElement('a')); + link.setAttribute('href', href); + link.textContent = info.description; + row.appendChild(document.createElement('td')).textContent = info.status; + total = info.total; + cell = row.appendChild(document.createElement('td')); + cell.textContent = total.toString(10); + cell.style.textAlign = 'right'; + if (!total) + total = 1; + cell = row.appendChild(document.createElement('td')); + cell.textContent = (info.supported * 100.0 / total).toFixed(1) + '%'; + cell.style.textAlign = 'right'; + cell = row.appendChild(document.createElement('td')); + cell.textContent = (info.partiallysupported * 100.0 / total).toFixed(1) + '%'; + cell.style.textAlign = 'right'; + cell = row.appendChild(document.createElement('td')); + cell.textContent = (info.unsupported * 100.0 / total).toFixed(1) + '%'; + cell.style.textAlign = 'right'; + }); + document.getElementById('heading-softwarelists').style.removeProperty('display'); + document.getElementById('tbl-softwarelists').style.removeProperty('display'); + } +} + + function add_bios_row(slot, table, device) { var sorted_sets = Object.keys(bios_sets[device]).sort(); @@ -394,6 +481,16 @@ function make_slot_change_handler(name, slot, defaults, dfltbtn) slotslist.removeChild(next); } + // clear out any software lists from previous selection + var softwarelist_rowid_prefix = 'row-softwarelists-' + prefix.replace(/:/g, '-'); + for (var candidate = document.getElementById('tbl-softwarelists').tBodies[0].rows[0]; candidate; ) + { + var next = candidate.nextSibling; + if ((candidate.nodeName == 'TR') && candidate.getAttribute('id').startsWith(softwarelist_rowid_prefix)) + candidate.parentNode.removeChild(candidate); + candidate = next; + } + if (selection === null) { // no selection, remove the slot card details table @@ -427,6 +524,12 @@ function make_slot_change_handler(name, slot, defaults, dfltbtn) else add_bios_row(slotname, tbl, selection.device); + // if we have software list info, populate now, otherweise fetch asynchronously + if (!Object.prototype.hasOwnProperty.call(softwarelist_info, selection.device)) + fetch_softwarelist_info(selection.device); + else + add_softwarelist_rows(selection.device, slotname, choice); + // drop the details table into the list if (def.firstChild) def.replaceChild(tbl, def.firstChild); diff --git a/scripts/minimaws/lib/assets/romident.js b/scripts/minimaws/lib/assets/romident.js index 9ca2c84f54d..e42daf875cf 100644 --- a/scripts/minimaws/lib/assets/romident.js +++ b/scripts/minimaws/lib/assets/romident.js @@ -454,6 +454,14 @@ function add_name(group, name, crc, sha1) if (group.names.indexOf(name) < 0) { group.names.push(name); + + if (group.hasOwnProperty('issues')) + { + var issues = group.issues; + if (issues !== null) + issues.parentNode.parentNode.insertBefore(document.createElement('dt'), issues.parentNode).textContent = name; + } + if (group.hasOwnProperty('machines')) { var machines = group.machines; @@ -575,8 +583,6 @@ function identify_file(file, trychd, progress) else { crcgrp = sha1grp.crc[crc]; - if (crcgrp.issues !== null) - crcgrp.issues.parentNode.parentNode.insertBefore(document.createElement('dl'), crcgrp.issues.parentNode).textContent = file.name; add_name(crcgrp, file.name, crc, sha1); progress.parentNode.removeChild(progress); } diff --git a/scripts/minimaws/lib/dbaccess.py b/scripts/minimaws/lib/dbaccess.py index cc359bfa65c..7ca5ebf243d 100644 --- a/scripts/minimaws/lib/dbaccess.py +++ b/scripts/minimaws/lib/dbaccess.py @@ -771,6 +771,14 @@ class QueryCursor(object): 'ORDER BY ramoption.size', (machine, )) + def get_machine_softwarelists(self, machine): + return self.dbcurs.execute( + 'SELECT machinesoftwarelist.tag AS tag, machinesoftwareliststatustype.value AS status, softwarelist.shortname AS shortname, softwarelist.description AS description, COUNT(software.id) AS total, COUNT(CASE software.supported WHEN 0 THEN 1 ELSE NULL END) AS supported, COUNT(CASE software.supported WHEN 1 THEN 1 ELSE NULL END) AS partiallysupported, COUNT(CASE software.supported WHEN 2 THEN 1 ELSE NULL END) AS unsupported ' \ + 'FROM machinesoftwarelist LEFT JOIN machinesoftwareliststatustype ON machinesoftwarelist.status = machinesoftwareliststatustype.id LEFT JOIN softwarelist ON machinesoftwarelist.softwarelist = softwarelist.id LEFT JOIN software ON softwarelist.id = software.softwarelist ' \ + 'WHERE machinesoftwarelist.machine = ? ' \ + 'GROUP BY machinesoftwarelist.id', + (machine, )) + def get_softwarelist_id(self, shortname): return (self.dbcurs.execute('SELECT id FROM softwarelist WHERE shortname = ?', (shortname, )).fetchone() or (None, ))[0] @@ -1075,6 +1083,8 @@ class UpdateConnection(object): def prepare_for_load(self): # here be dragons - this is a poor man's DROP ALL TABLES etc. self.dbconn.execute('PRAGMA foreign_keys = OFF') + for query in self.dbconn.execute('SELECT \'DROP VIEW \' || name FROM sqlite_master WHERE type = \'view\'').fetchall(): + self.dbconn.execute(query[0]) for query in self.dbconn.execute('SELECT \'DROP INDEX \' || name FROM sqlite_master WHERE type = \'index\' AND NOT name GLOB \'sqlite_autoindex_*\'').fetchall(): self.dbconn.execute(query[0]) for query in self.dbconn.execute('SELECT \'DROP TABLE \' || name FROM sqlite_master WHERE type = \'table\'').fetchall(): diff --git a/scripts/minimaws/lib/htmltmpl.py b/scripts/minimaws/lib/htmltmpl.py index 185771af6ee..7c9246865b1 100644 --- a/scripts/minimaws/lib/htmltmpl.py +++ b/scripts/minimaws/lib/htmltmpl.py @@ -70,6 +70,47 @@ MACHINE_CLONES_ROW = string.Template( ' <td>${manufacturer}</td>\n' \ ' </tr>\n') +MACHINE_SOFTWARELISTS_TABLE_PROLOGUE = string.Template( + '<h2 id="heading-softwarelists">Software Lists</h2>\n' \ + '<table id="tbl-softwarelists">\n' \ + ' <thead>\n' \ + ' <tr>\n' \ + ' <th>Card</th>\n' \ + ' <th>Short name</th>\n' \ + ' <th>Description</th>\n' \ + ' <th>Status</th>\n' \ + ' <th class="numeric">Total</th>\n' \ + ' <th class="numeric">Supported</th>\n' \ + ' <th class="numeric">Partially supported</th>\n' \ + ' <th class="numeric">Unsupported</th>\n' \ + ' </tr>\n' \ + ' </thead>\n' \ + ' <tbody>\n') + +MACHINE_SOFTWARELISTS_TABLE_ROW = string.Template( + ' <tr id="row-softwarelists-${rowid}">\n' \ + ' <td></td>\n' \ + ' <td><a href="${href}">${shortname}</a></td>\n' \ + ' <td><a href="${href}">${description}</a></td>\n' \ + ' <td>${status}</td>\n' \ + ' <td style="text-align: right">${total}</td>\n' \ + ' <td style="text-align: right">${supported}</td>\n' \ + ' <td style="text-align: right">${partiallysupported}</td>\n' \ + ' <td style="text-align: right">${unsupported}</td>\n' \ + ' </tr>\n') + +MACHINE_SOFTWARELISTS_TABLE_EPILOGUE = string.Template( + ' </tbody>\n' \ + '</table>\n' \ + '<script>\n' \ + ' make_table_sortable(document.getElementById("tbl-softwarelists"));\n' \ + ' if (!document.getElementById("tbl-softwarelists").tBodies[0].rows.length)\n' \ + ' {\n' \ + ' document.getElementById("heading-softwarelists").style.display = "none";\n' \ + ' document.getElementById("tbl-softwarelists").style.display = "none";\n' \ + ' }\n' \ + '</script>\n') + MACHINE_OPTIONS_HEADING = string.Template( '<h2>Options</h2>\n' \ '<p>\n' \ @@ -92,10 +133,14 @@ MACHINE_RAM_PROLOGUE = string.Template( MACHINE_RAM_OPTION = string.Template( ' <option value="${name}" data-isdefault="${isdefault}">${name} (${size})</option>\n') -MACHINE_SLOTS_PLACEHOLDER = string.Template( +MACHINE_SLOTS_PLACEHOLDER_PROLOGUE = string.Template( '<h3>Slots</h3>\n' \ '<p id="para-slots-placeholder">Loading slot information…<p>\n' \ - '<script>fetch_slots("${machine}");</script>\n') + '<script>\n') + +MACHINE_SLOTS_PLACEHOLDER_EPILOGUE = string.Template( + ' populate_slots(${machine});\n' + '</script>\n') MACHINE_ROW = string.Template( ' <tr>\n' \ diff --git a/scripts/minimaws/lib/wsgiserve.py b/scripts/minimaws/lib/wsgiserve.py index 8046785b5f1..e77bb3f637f 100644 --- a/scripts/minimaws/lib/wsgiserve.py +++ b/scripts/minimaws/lib/wsgiserve.py @@ -109,6 +109,80 @@ class QueryPageHandler(HandlerBase): def software_href(self, softwarelist, software): return cgi.escape(urlparse.urljoin(self.application_uri, 'softwarelist/%s/%s' % (urlquote(softwarelist), urlquote(software))), True) + def bios_data(self, machine): + result = { } + for name, description, isdefault in self.dbcurs.get_biossets(machine): + result[name] = { 'description': description, 'isdefault': True if isdefault else False } + return result + + def flags_data(self, machine): + result = { 'features': { } } + for feature, status, overall in self.dbcurs.get_feature_flags(machine): + detail = { } + if status == 1: + detail['status'] = 'imperfect' + elif status > 1: + detail['status'] = 'unemulated' + if overall == 1: + detail['overall'] = 'imperfect' + elif overall > 1: + detail['overall'] = 'unemulated' + result['features'][feature] = detail + return result + + def slot_data(self, machine): + result = { 'defaults': { }, 'slots': { } } + + # get slot options + prev = None + for slot, option, shortname, description in self.dbcurs.get_slot_options(machine): + if slot != prev: + if slot in result['slots']: + options = result['slots'][slot] + else: + options = { } + result['slots'][slot] = options + prev = slot + options[option] = { 'device': shortname, 'description': description } + + # if there are any slots, get defaults + if result['slots']: + for slot, default in self.dbcurs.get_slot_defaults(machine): + result['defaults'][slot] = default + + # remove slots that come from default cards in other slots + for slot in tuple(result['slots'].keys()): + slot += ':' + for candidate in tuple(result['slots'].keys()): + if candidate.startswith(slot): + del result['slots'][candidate] + + return result + + def softwarelist_data(self, machine): + result = { } + + # get software lists referenced by machine + for softwarelist in self.dbcurs.get_machine_softwarelists(machine): + result[softwarelist['tag']] = { + 'status': softwarelist['status'], + 'shortname': softwarelist['shortname'], + 'description': softwarelist['description'], + 'total': softwarelist['total'], + 'supported': softwarelist['supported'], + 'partiallysupported': softwarelist['partiallysupported'], + 'unsupported': softwarelist['unsupported'] } + + # remove software lists that come from default cards in slots + if result: + for slot, default in self.dbcurs.get_slot_defaults(machine): + slot += ':' + for candidate in tuple(result.keys()): + if candidate.startswith(slot): + del result[candidate] + + return result + class MachineRpcHandlerBase(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): @@ -215,6 +289,7 @@ class MachineHandler(QueryPageHandler): tuple(imperfect)).encode('utf-8'); yield '</table>\n'.encode('utf-8') + # make a table of clones first = True for clone, clonedescription, cloneyear, clonemanufacturer in self.dbcurs.get_clones(self.shortname): if first: @@ -229,6 +304,22 @@ class MachineHandler(QueryPageHandler): if not first: yield htmltmpl.SORTABLE_TABLE_EPILOGUE.substitute(id='tbl-clones').encode('utf-8') + # make a table of software lists + yield htmltmpl.MACHINE_SOFTWARELISTS_TABLE_PROLOGUE.substitute().encode('utf-8') + for softwarelist in self.dbcurs.get_machine_softwarelists(id): + total = softwarelist['total'] + yield htmltmpl.MACHINE_SOFTWARELISTS_TABLE_ROW.substitute( + rowid=cgi.escape(softwarelist['tag'].replace(':', '-'), True), + href=self.softwarelist_href(softwarelist['shortname']), + shortname=cgi.escape(softwarelist['shortname']), + description=cgi.escape(softwarelist['description']), + status=cgi.escape(softwarelist['status']), + total=cgi.escape('%d' % (total, )), + supported=cgi.escape('%.1f%%' % (softwarelist['supported'] * 100.0 / (total or 1), )), + partiallysupported=cgi.escape('%.1f%%' % (softwarelist['partiallysupported'] * 100.0 / (total or 1), )), + unsupported=cgi.escape('%.1f%%' % (softwarelist['unsupported'] * 100.0 / (total or 1), ))).encode('utf-8') + yield htmltmpl.MACHINE_SOFTWARELISTS_TABLE_EPILOGUE.substitute().encode('utf-8') + # allow system BIOS selection haveoptions = False for name, desc, isdef in self.dbcurs.get_biossets(id): @@ -264,8 +355,29 @@ class MachineHandler(QueryPageHandler): if not haveoptions: haveoptions = True yield htmltmpl.MACHINE_OPTIONS_HEADING.substitute().encode('utf-8') - yield htmltmpl.MACHINE_SLOTS_PLACEHOLDER.substitute( - machine=self.js_escape(self.shortname)).encode('utf=8') + yield htmltmpl.MACHINE_SLOTS_PLACEHOLDER_PROLOGUE.substitute().encode('utf=8') + pending = set((self.shortname, )) + added = set((self.shortname, )) + haveextra = set() + while pending: + requested = pending.pop() + slots = self.slot_data(self.dbcurs.get_machine_id(requested)) + yield (' slot_info[%s] = %s;\n' % (self.sanitised_json(requested), self.sanitised_json(slots))).encode('utf-8') + for slotname, slot in slots['slots'].items(): + for choice, card in slot.items(): + carddev = card['device'] + if carddev not in added: + pending.add(carddev) + added.add(carddev) + if (carddev not in haveextra) and (slots['defaults'].get(slotname) == choice): + haveextra.add(carddev) + cardid = self.dbcurs.get_machine_id(carddev) + carddev = self.sanitised_json(carddev) + yield ( + ' bios_sets[%s] = %s;\n machine_flags[%s] = %s;\n softwarelist_info[%s] = %s;\n' % + (carddev, self.sanitised_json(self.bios_data(cardid)), carddev, self.sanitised_json(self.flags_data(cardid)), carddev, self.sanitised_json(self.softwarelist_data(cardid)))).encode('utf-8') + yield htmltmpl.MACHINE_SLOTS_PLACEHOLDER_EPILOGUE.substitute( + machine=self.sanitised_json(self.shortname)).encode('utf=8') # list devices referenced by this system/device first = True @@ -332,6 +444,10 @@ class MachineHandler(QueryPageHandler): description=cgi.escape(description or ''), sourcefile=cgi.escape(sourcefile or '')).encode('utf-8') + @staticmethod + def sanitised_json(data): + return json.dumps(data).replace('<', '\\u003c').replace('>', '\\u003e') + class SourceFileHandler(QueryPageHandler): def __init__(self, app, application_uri, environ, start_response, **kwargs): @@ -531,7 +647,13 @@ class SoftwareListHandler(QueryPageHandler): if first: yield htmltmpl.SOFTWARELIST_MACHINE_TABLE_HEADER.substitute().encode('utf-8') first = False - yield self.machine_row(machine_info) + yield htmltmpl.SOFTWARELIST_MACHINE_TABLE_ROW.substitute( + machinehref=self.machine_href(machine_info['shortname']), + shortname=cgi.escape(machine_info['shortname']), + description=cgi.escape(machine_info['description']), + year=cgi.escape(machine_info['year'] or ''), + manufacturer=cgi.escape(machine_info['manufacturer'] or ''), + status=cgi.escape(machine_info['status'])).encode('utf-8') if not first: yield htmltmpl.SORTABLE_TABLE_EPILOGUE.substitute(id='tbl-machines').encode('utf-8') @@ -613,15 +735,6 @@ class SoftwareListHandler(QueryPageHandler): publisher=cgi.escape(clone_info['publisher']), supported=self.format_supported(clone_info['supported'])).encode('utf-8') - def machine_row(self, machine_info): - return htmltmpl.SOFTWARELIST_MACHINE_TABLE_ROW.substitute( - machinehref=self.machine_href(machine_info['shortname']), - shortname=cgi.escape(machine_info['shortname']), - description=cgi.escape(machine_info['description']), - year=cgi.escape(machine_info['year'] or ''), - manufacturer=cgi.escape(machine_info['manufacturer'] or ''), - status=cgi.escape(machine_info['status'])).encode('utf-8') - @staticmethod def format_supported(supported): return 'Yes' if supported == 0 else 'Partial' if supported == 1 else 'No' @@ -659,47 +772,17 @@ class BiosRpcHandler(MachineRpcHandlerBase): class FlagsRpcHandler(MachineRpcHandlerBase): def data_page(self, machine): - result = { 'features': { } } - for feature, status, overall in self.dbcurs.get_feature_flags(machine): - detail = { } - if status == 1: - detail['status'] = 'imperfect' - elif status > 1: - detail['status'] = 'unemulated' - if overall == 1: - detail['overall'] = 'imperfect' - elif overall > 1: - detail['overall'] = 'unemulated' - result['features'][feature] = detail - yield json.dumps(result).encode('utf-8') + yield json.dumps(self.flags_data(machine)).encode('utf-8') class SlotsRpcHandler(MachineRpcHandlerBase): def data_page(self, machine): - result = { 'defaults': { }, 'slots': { } } + yield json.dumps(self.slot_data(machine)).encode('utf-8') - # get defaults and slot options - for slot, default in self.dbcurs.get_slot_defaults(machine): - result['defaults'][slot] = default - prev = None - for slot, option, shortname, description in self.dbcurs.get_slot_options(machine): - if slot != prev: - if slot in result['slots']: - options = result['slots'][slot] - else: - options = { } - result['slots'][slot] = options - prev = slot - options[option] = { 'device': shortname, 'description': description } - - # remove slots that come from default cards in other slots - for slot in tuple(result['slots'].keys()): - slot += ':' - for candidate in tuple(result['slots'].keys()): - if candidate.startswith(slot): - del result['slots'][candidate] - yield json.dumps(result).encode('utf-8') +class SoftwareListsRpcHandler(MachineRpcHandlerBase): + def data_page(self, machine): + yield json.dumps(self.softwarelist_data(machine)).encode('utf-8') class RomDumpsRpcHandler(QueryPageHandler): @@ -817,11 +900,12 @@ class DiskDumpsRpcHandler(QueryPageHandler): class MiniMawsApp(object): JS_ESCAPE = re.compile('([\"\'\\\\])') RPC_SERVICES = { - 'bios': BiosRpcHandler, - 'flags': FlagsRpcHandler, - 'slots': SlotsRpcHandler, - 'romdumps': RomDumpsRpcHandler, - 'diskdumps': DiskDumpsRpcHandler } + 'bios': BiosRpcHandler, + 'flags': FlagsRpcHandler, + 'slots': SlotsRpcHandler, + 'softwarelists': SoftwareListsRpcHandler, + 'romdumps': RomDumpsRpcHandler, + 'diskdumps': DiskDumpsRpcHandler } def __init__(self, dbfile, **kwargs): super(MiniMawsApp, self).__init__(**kwargs) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index db0e89ca862..bec2382971d 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -51,6 +51,7 @@ end "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter "/wd4127", -- warning C4127: conditional expression is constant "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data + "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration } if _OPTIONS["vs"]=="intel-15" then buildoptions { @@ -60,10 +61,6 @@ if _OPTIONS["vs"]=="intel-15" then "/Qwd869", -- remark #869: parameter "xxx" was never referenced } end - configuration { "vs201*" } - buildoptions { - "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration - } configuration { } files { @@ -622,6 +619,7 @@ project "flac" "/wd4127", -- warning C4127: conditional expression is constant "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter + "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration "/wd4702", -- warning C4702: unreachable code } if _OPTIONS["vs"]=="intel-15" then @@ -639,11 +637,6 @@ end "-include stdint.h" } - configuration { "vs201*" } - buildoptions { - "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration - } - configuration { "vsllvm" } buildoptions { "-Wno-unused-function", @@ -727,17 +720,14 @@ project "7z" configuration { "vs*" } buildoptions { "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter + "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration + "/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter } if _OPTIONS["vs"]=="intel-15" then buildoptions { "/Qwd869", -- remark #869: parameter "xxx" was never referenced } end - configuration { "vs201*" } - buildoptions { - "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration - "/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter - } configuration { "winstore*" } forcedincludes { MAME_DIR .. "src/osd/uwp/uwpcompat.h" @@ -1024,6 +1014,7 @@ project "portmidi" "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter "/wd4127", -- warning C4127: conditional expression is constant "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data + "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration "/wd4706", -- warning C4706: assignment within conditional expression } if _OPTIONS["vs"]=="intel-15" then @@ -1035,11 +1026,6 @@ if _OPTIONS["vs"]=="intel-15" then } end - configuration { "vs201*" } - buildoptions { - "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration - } - configuration { "linux*" } defines { "PMALSA=1", @@ -1451,6 +1437,8 @@ project "portaudio" "/wd4389", -- warning C4389: 'operator' : signed/unsigned mismatch "/wd4189", -- warning C4189: 'xxx' : local variable is initialized but not referenced "/wd4127", -- warning C4127: conditional expression is constant + "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration + "/wd4312", -- warning C4312: 'type cast': conversion from 'UINT' to 'HWAVEIN' of greater size } if _OPTIONS["vs"]=="intel-15" then buildoptions { @@ -1460,10 +1448,6 @@ project "portaudio" "/Qwd1879", -- warning #1879: unimplemented pragma ignored } end - configuration { "vs2015*" } - buildoptions { - "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration - } configuration { "vsllvm" } buildoptions { diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index d917a846642..a2155edcea2 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -458,6 +458,21 @@ end --------------------------------------------------- -- +--@src/devices/bus/bbc/modem/modem.h,BUSES["BBC_MODEM"] = true +--------------------------------------------------- + +if (BUSES["BBC_MODEM"]~=null) then + files { + MAME_DIR .. "src/devices/bus/bbc/modem/modem.cpp", + MAME_DIR .. "src/devices/bus/bbc/modem/modem.h", + MAME_DIR .. "src/devices/bus/bbc/modem/scsiaiv.cpp", + MAME_DIR .. "src/devices/bus/bbc/modem/scsiaiv.h", + } +end + + +--------------------------------------------------- +-- --@src/devices/bus/bbc/1mhzbus/1mhzbus.h,BUSES["BBC_1MHZBUS"] = true --------------------------------------------------- @@ -467,10 +482,14 @@ if (BUSES["BBC_1MHZBUS"]~=null) then MAME_DIR .. "src/devices/bus/bbc/1mhzbus/1mhzbus.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/autoprom.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/autoprom.h", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebopl.cpp", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebopl.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/emrmidi.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/emrmidi.h", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ide.cpp", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ide.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ieee488.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ieee488.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/m2000.cpp", @@ -481,6 +500,8 @@ if (BUSES["BBC_1MHZBUS"]~=null) then MAME_DIR .. "src/devices/bus/bbc/1mhzbus/pms64k.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ramdisc.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ramdisc.h", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/scsi.cpp", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/scsi.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/sprite.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/sprite.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp", @@ -2649,6 +2670,20 @@ end --------------------------------------------------- -- +--@src/devices/bus/sdk85/memexp.h,BUSES["SDK85"] = true +--------------------------------------------------- + +if (BUSES["SDK85"]~=null) then + files { + MAME_DIR .. "src/devices/bus/sdk85/memexp.cpp", + MAME_DIR .. "src/devices/bus/sdk85/memexp.h", + MAME_DIR .. "src/devices/bus/sdk85/i8755.cpp", + MAME_DIR .. "src/devices/bus/sdk85/i8755.h", + } +end + +--------------------------------------------------- +-- --@src/devices/bus/snes/snes_slot.h,BUSES["SNES"] = true --------------------------------------------------- @@ -4085,3 +4120,17 @@ if (BUSES["TMC600"]~=null) then MAME_DIR .. "src/devices/bus/tmc600/euro.h", } end + +--------------------------------------------------- +-- +--@src/devices/bus/multibus/multibus.h,BUSES["MULTIBUS"] = true +--------------------------------------------------- + +if (BUSES["MULTIBUS"]~=null) then + files { + MAME_DIR .. "src/devices/bus/multibus/multibus.cpp", + MAME_DIR .. "src/devices/bus/multibus/multibus.h", + MAME_DIR .. "src/devices/bus/multibus/isbc202.cpp", + MAME_DIR .. "src/devices/bus/multibus/isbc202.h", + } +end diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 4c5644c1bf7..9e2607d78eb 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -2982,6 +2982,23 @@ if (CPUS["CR16B"]~=null or _OPTIONS["with-tools"]) then end -------------------------------------------------- +-- Gigatron +--@src/devices/cpu/gigatron/gigatron.h,CPUS["GTRON"] = true +-------------------------------------------------- + +if (CPUS["GTRON"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/gigatron/gigatron.cpp", + MAME_DIR .. "src/devices/cpu/gigatron/gigatron.h", + } +end + +if (CPUS["GTRON"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/gigatron/gigatrondasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/gigatron/gigatrondasm.h") +end + +-------------------------------------------------- -- Motorola DSP56000 --@src/devices/cpu/dsp56000/dsp56000.h,CPUS["DSP56000"] = true -------------------------------------------------- @@ -2997,3 +3014,105 @@ if (CPUS["DSP56000"]~=null or _OPTIONS["with-tools"]) then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/dsp56000/dsp56000d.cpp") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/dsp56000/dsp56000d.h") end + +-------------------------------------------------- +-- DEC VT50/VT52 +--@src/devices/cpu/vt50/vt50.h,CPUS["VT50"] = true +-------------------------------------------------- + +if (CPUS["VT50"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/vt50/vt50.cpp", + MAME_DIR .. "src/devices/cpu/vt50/vt50.h", + } +end + +if (CPUS["VT50"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vt50/vt50dasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vt50/vt50dasm.h") +end + +-------------------------------------------------- +-- DEC VT61 +--@src/devices/cpu/vt61/vt61.h,CPUS["VT61"] = true +-------------------------------------------------- + +if (CPUS["VT61"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/vt61/vt61.cpp", + MAME_DIR .. "src/devices/cpu/vt61/vt61.h", + } +end + +if (CPUS["VT61"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vt61/vt61dasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vt61/vt61dasm.h") +end + +-------------------------------------------------- +-- National Semiconductor PACE/INS8900 +--@src/devices/cpu/pace/pace.h,CPUS["PACE"] = true +-------------------------------------------------- + +if (CPUS["PACE"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/pace/pace.cpp", + MAME_DIR .. "src/devices/cpu/pace/pace.h", + } +end + +if (CPUS["PACE"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/pace/pacedasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/pace/pacedasm.h") +end + +-------------------------------------------------- +-- AT&T WE32000/WE32100/WE32200 +--@src/devices/cpu/we32000/we32100.h,CPUS["WE32000"] = true +-------------------------------------------------- + +if (CPUS["WE32000"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/we32000/we32100.cpp", + MAME_DIR .. "src/devices/cpu/we32000/we32100.h", + } +end + +if (CPUS["WE32000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/we32000/we32100d.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/we32000/we32100d.h") +end + +-------------------------------------------------- +-- DEC RX01 +--@src/devices/cpu/rx01/rx01.h,CPUS["RX01"] = true +-------------------------------------------------- + +if (CPUS["RX01"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/rx01/rx01.cpp", + MAME_DIR .. "src/devices/cpu/rx01/rx01.h", + } +end + +if (CPUS["RX01"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/rx01/rx01dasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/rx01/rx01dasm.h") +end + +-------------------------------------------------- +-- Motorola M88000 +--@src/devices/cpu/m88000/m88000.h,CPUS["M88000"] = true +-------------------------------------------------- + +if (CPUS["M88000"]~=null) then + files { + MAME_DIR .. "src/devices/cpu/m88000/m88000.cpp", + MAME_DIR .. "src/devices/cpu/m88000/m88000.h", + } +end + +if (CPUS["M88000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/m88000/m88000d.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/m88000/m88000d.h") +end diff --git a/scripts/src/formats.lua b/scripts/src/formats.lua index 6bb724e3e40..e09d34c2e33 100644 --- a/scripts/src/formats.lua +++ b/scripts/src/formats.lua @@ -1003,6 +1003,18 @@ end -------------------------------------------------- -- +--@src/lib/formats/img_dsk.h,FORMATS["IMG_DSK"] = true +-------------------------------------------------- + +if (FORMATS["IMG_DSK"]~=null or _OPTIONS["with-tools"]) then + files { + MAME_DIR.. "src/lib/formats/img_dsk.cpp", + MAME_DIR.. "src/lib/formats/img_dsk.h", + } +end + +-------------------------------------------------- +-- --@src/lib/formats/iq151_dsk.h,FORMATS["IQ151_DSK"] = true -------------------------------------------------- diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index ed2dd04bc93..9188507cce4 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -3144,6 +3144,18 @@ end --------------------------------------------------- -- +--@src/devices/machine/vic_pl192.h,MACHINES["VIC_PL192"] = true +--------------------------------------------------- + +if (MACHINES["VIC_PL192"]~=null) then + files { + MAME_DIR .. "src/devices/machine/vic_pl192.cpp", + MAME_DIR .. "src/devices/machine/vic_pl192.h", + } +end + +--------------------------------------------------- +-- --@src/devices/machine/wd_fdc.h,MACHINES["WD_FDC"] = true --------------------------------------------------- @@ -4208,3 +4220,27 @@ if (MACHINES["VRENDER0"]~=null) then MAME_DIR .. "src/devices/machine/vrender0.h", } end + +--------------------------------------------------- +-- +--@src/devices/machine/i3001.h,MACHINES["I3001"] = true +--------------------------------------------------- + +if (MACHINES["I3001"]~=null) then + files { + MAME_DIR .. "src/devices/machine/i3001.cpp", + MAME_DIR .. "src/devices/machine/i3001.h", + } +end + +--------------------------------------------------- +-- +--@src/devices/machine/i3002.h,MACHINES["I3002"] = true +--------------------------------------------------- + +if (MACHINES["I3002"]~=null) then + files { + MAME_DIR .. "src/devices/machine/i3002.cpp", + MAME_DIR .. "src/devices/machine/i3002.h", + } +end diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua index 70ff1f54467..3bc6cb34645 100644 --- a/scripts/src/netlist.lua +++ b/scripts/src/netlist.lua @@ -120,6 +120,8 @@ project "netlist" MAME_DIR .. "src/lib/netlist/devices/nld_2716.h", MAME_DIR .. "src/lib/netlist/devices/nld_tms4800.cpp", MAME_DIR .. "src/lib/netlist/devices/nld_tms4800.h", + MAME_DIR .. "src/lib/netlist/devices/nld_4006.cpp", + MAME_DIR .. "src/lib/netlist/devices/nld_4006.h", MAME_DIR .. "src/lib/netlist/devices/nld_4020.cpp", MAME_DIR .. "src/lib/netlist/devices/nld_4020.h", MAME_DIR .. "src/lib/netlist/devices/nld_4066.cpp", @@ -218,7 +220,6 @@ project "netlist" MAME_DIR .. "src/lib/netlist/devices/nld_system.h", MAME_DIR .. "src/lib/netlist/devices/nlid_truthtable.cpp", MAME_DIR .. "src/lib/netlist/devices/nlid_truthtable.h", - MAME_DIR .. "src/lib/netlist/devices/nlid_cmos.h", MAME_DIR .. "src/lib/netlist/devices/nlid_system.h", MAME_DIR .. "src/lib/netlist/devices/nlid_proxy.cpp", MAME_DIR .. "src/lib/netlist/devices/nlid_proxy.h", diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 4cf82d097a0..7716cea4eeb 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1670,6 +1670,7 @@ files { MAME_DIR .. "src/mame/drivers/exprraid.cpp", MAME_DIR .. "src/mame/includes/exprraid.h", MAME_DIR .. "src/mame/video/exprraid.cpp", + MAME_DIR .. "src/mame/drivers/ffantasy_ms.cpp", MAME_DIR .. "src/mame/drivers/firetrap.cpp", MAME_DIR .. "src/mame/includes/firetrap.h", MAME_DIR .. "src/mame/video/firetrap.cpp", @@ -2417,6 +2418,7 @@ files { MAME_DIR .. "src/mame/video/jailbrek.cpp", MAME_DIR .. "src/mame/drivers/junofrst.cpp", MAME_DIR .. "src/mame/drivers/konamigq.cpp", + MAME_DIR .. "src/mame/drivers/konamigs.cpp", MAME_DIR .. "src/mame/drivers/konamigv.cpp", MAME_DIR .. "src/mame/drivers/konamigx.cpp", MAME_DIR .. "src/mame/includes/konamigx.h", @@ -2669,6 +2671,7 @@ files { MAME_DIR .. "src/mame/drivers/merit.cpp", MAME_DIR .. "src/mame/drivers/merit3xx.cpp", MAME_DIR .. "src/mame/drivers/meritm.cpp", + MAME_DIR .. "src/mame/drivers/merits.cpp", MAME_DIR .. "src/mame/drivers/mtouchxl.cpp", MAME_DIR .. "src/mame/drivers/pubtimed.cpp", MAME_DIR .. "src/mame/machine/at.h", @@ -2819,6 +2822,8 @@ files { MAME_DIR .. "src/mame/audio/galaxian.cpp", MAME_DIR .. "src/mame/audio/galaxian.h", MAME_DIR .. "src/mame/video/galaxian.cpp", + MAME_DIR .. "src/mame/audio/nl_konami.h", + MAME_DIR .. "src/mame/audio/nl_konami.cpp", MAME_DIR .. "src/mame/drivers/galaxold.cpp", MAME_DIR .. "src/mame/includes/galaxold.h", MAME_DIR .. "src/mame/machine/galaxold.cpp", @@ -3401,10 +3406,14 @@ files { MAME_DIR .. "src/mame/machine/naomim2.h", MAME_DIR .. "src/mame/machine/naomim4.cpp", MAME_DIR .. "src/mame/machine/naomim4.h", + MAME_DIR .. "src/mame/machine/gdrom.cpp", + MAME_DIR .. "src/mame/machine/gdrom.h", MAME_DIR .. "src/mame/machine/m3comm.cpp", MAME_DIR .. "src/mame/machine/m3comm.h", MAME_DIR .. "src/mame/machine/315-5881_crypt.cpp", MAME_DIR .. "src/mame/machine/315-5881_crypt.h", + MAME_DIR .. "src/mame/machine/315-6154.cpp", + MAME_DIR .. "src/mame/machine/315-6154.h", MAME_DIR .. "src/mame/machine/awboard.cpp", MAME_DIR .. "src/mame/machine/awboard.h", MAME_DIR .. "src/mame/machine/mie.cpp", @@ -3452,6 +3461,8 @@ files { MAME_DIR .. "src/mame/drivers/segas16b.cpp", MAME_DIR .. "src/mame/includes/segas16b.h", MAME_DIR .. "src/mame/video/segas16b.cpp", + MAME_DIR .. "src/mame/audio/nl_segas16b.cpp", + MAME_DIR .. "src/mame/audio/nl_segas16b.h", MAME_DIR .. "src/mame/drivers/segas18.cpp", MAME_DIR .. "src/mame/includes/segas18.h", MAME_DIR .. "src/mame/video/segas18.cpp", @@ -3760,6 +3771,7 @@ files { createMAMEProjects(_target, _subtarget, "sony") files { MAME_DIR .. "src/mame/drivers/zn.cpp", + MAME_DIR .. "src/mame/includes/zn.h", MAME_DIR .. "src/mame/machine/znmcu.cpp", MAME_DIR .. "src/mame/machine/znmcu.h", MAME_DIR .. "src/mame/machine/cat702.cpp", @@ -3879,6 +3891,7 @@ files { MAME_DIR .. "src/mame/drivers/darius.cpp", MAME_DIR .. "src/mame/includes/darius.h", MAME_DIR .. "src/mame/video/darius.cpp", + MAME_DIR .. "src/mame/drivers/dinoking.cpp", MAME_DIR .. "src/mame/drivers/exzisus.cpp", MAME_DIR .. "src/mame/includes/exzisus.h", MAME_DIR .. "src/mame/video/exzisus.cpp", @@ -4925,6 +4938,7 @@ files { MAME_DIR .. "src/mame/video/shangkid.cpp", MAME_DIR .. "src/mame/drivers/skeetsht.cpp", MAME_DIR .. "src/mame/drivers/skimaxx.cpp", + MAME_DIR .. "src/mame/drivers/skopro.cpp", MAME_DIR .. "src/mame/drivers/skyarmy.cpp", MAME_DIR .. "src/mame/drivers/skylncr.cpp", MAME_DIR .. "src/mame/drivers/sliver.cpp", @@ -4949,6 +4963,7 @@ files { MAME_DIR .. "src/mame/drivers/taxidriv.cpp", MAME_DIR .. "src/mame/includes/taxidriv.h", MAME_DIR .. "src/mame/video/taxidriv.cpp", + MAME_DIR .. "src/mame/drivers/teamjocs.cpp", MAME_DIR .. "src/mame/drivers/thayers.cpp", MAME_DIR .. "src/mame/drivers/thedeep.cpp", MAME_DIR .. "src/mame/includes/thedeep.h", diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index b448b883d7a..7e3e127fc1b 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -148,6 +148,13 @@ CPUS["F2MC16"] = true CPUS["CR16B"] = true CPUS["FR"] = true CPUS["DSP56000"] = true +CPUS["VT50"] = true +CPUS["VT61"] = true +CPUS["PACE"] = true +CPUS["WE32000"] = true +CPUS["RX01"] = true +CPUS["GTRON"] = true +CPUS["M88000"] = true -------------------------------------------------- -- specify available sound cores; some of these are @@ -483,6 +490,8 @@ MACHINES["HP_TACO"] = true MACHINES["1MA6"] = true MACHINES["1MB5"] = true MACHINES["I2CMEM"] = true +MACHINES["I3001"] = true +MACHINES["I3002"] = true MACHINES["I7220"] = true MACHINES["I80130"] = true MACHINES["I8087"] = true @@ -664,6 +673,7 @@ MACHINES["UPD71071"] = true MACHINES["UPD765"] = true MACHINES["FDC_PLL"] = true MACHINES["V3021"] = true +MACHINES["VIC_PL192"] = true MACHINES["WD_FDC"] = true MACHINES["WD1000"] = true MACHINES["WD1010"] = true @@ -761,6 +771,7 @@ BUSES["BBC_CART"] = true BUSES["BBC_EXP"] = true BUSES["BBC_INTERNAL"] = true BUSES["BBC_JOYPORT"] = true +BUSES["BBC_MODEM"] = true BUSES["BBC_1MHZBUS"] = true BUSES["BBC_TUBE"] = true BUSES["BBC_USERPORT"] = true @@ -823,6 +834,7 @@ BUSES["MIDI"] = true BUSES["MEGADRIVE"] = true BUSES["MSX_SLOT"] = true BUSES["MTX"] = true +BUSES["MULTIBUS"] = true BUSES["NASBUS"] = true BUSES["NEOGEO"] = true BUSES["NEOGEO_CTRL"] = true @@ -851,6 +863,7 @@ BUSES["SATURN"] = true BUSES["SBUS"] = true BUSES["SCSI"] = true BUSES["SCV"] = true +BUSES["SDK85"] = true BUSES["SEGA8"] = true BUSES["SG1000_EXP"] = true BUSES["SGIKBD"] = true @@ -973,6 +986,7 @@ FORMATS["HECT_TAP"] = true FORMATS["HTI_TAP"] = true FORMATS["HPI_DSK"] = true FORMATS["HP_IPC_DSK"] = true +FORMATS["IMG_DSK"] = true FORMATS["IQ151_DSK"] = true FORMATS["ITT3030_DSK"] = true FORMATS["JFD_DSK"] = true @@ -1170,6 +1184,7 @@ function linkProjects_mame_mess(_target, _subtarget) "kurzweil", "kyocera", "leapfrog", + "lsi", "luxor", "magnavox", "makerbot", @@ -1437,6 +1452,8 @@ files { MAME_DIR .. "src/mame/machine/naomirom.h", MAME_DIR .. "src/mame/machine/315-5881_crypt.cpp", MAME_DIR .. "src/mame/machine/315-5881_crypt.h", + MAME_DIR .. "src/mame/machine/315-6154.cpp", + MAME_DIR .. "src/mame/machine/315-6154.h", MAME_DIR .. "src/mame/video/powervr2.cpp", MAME_DIR .. "src/mame/video/powervr2.h", MAME_DIR .. "src/mame/drivers/neogeo.cpp", @@ -1751,7 +1768,9 @@ files { createMESSProjects(_target, _subtarget, "att") files { + MAME_DIR .. "src/mame/drivers/att3b2.cpp", MAME_DIR .. "src/mame/drivers/att4425.cpp", + MAME_DIR .. "src/mame/drivers/att610.cpp", MAME_DIR .. "src/mame/drivers/att630.cpp", MAME_DIR .. "src/mame/drivers/unixpc.cpp", } @@ -1783,6 +1802,7 @@ files { MAME_DIR .. "src/mame/machine/wswan.cpp", MAME_DIR .. "src/mame/video/wswan.cpp", MAME_DIR .. "src/mame/video/wswan.h", + MAME_DIR .. "src/mame/drivers/bandai_design_master.cpp", } createMESSProjects(_target, _subtarget, "be") @@ -2064,12 +2084,16 @@ files { MAME_DIR .. "src/mame/machine/decioga.h", MAME_DIR .. "src/mame/drivers/dectalk.cpp", MAME_DIR .. "src/mame/drivers/decwritr.cpp", + MAME_DIR .. "src/mame/machine/dc305.cpp", + MAME_DIR .. "src/mame/machine/dc305.h", MAME_DIR .. "src/mame/drivers/jensen.cpp", MAME_DIR .. "src/mame/includes/jensen.h", MAME_DIR .. "src/mame/drivers/pdp11.cpp", MAME_DIR .. "src/mame/drivers/vax11.cpp", MAME_DIR .. "src/mame/drivers/rainbow.cpp", MAME_DIR .. "src/mame/drivers/vk100.cpp", + MAME_DIR .. "src/mame/drivers/vt52.cpp", + MAME_DIR .. "src/mame/drivers/vt62.cpp", MAME_DIR .. "src/mame/drivers/vt100.cpp", MAME_DIR .. "src/mame/drivers/vt220.cpp", MAME_DIR .. "src/mame/drivers/vt240.cpp", @@ -2364,17 +2388,21 @@ files { createMESSProjects(_target, _subtarget, "hegener") files { + MAME_DIR .. "src/mame/drivers/mephisto_berlin.cpp", MAME_DIR .. "src/mame/drivers/mephisto_brikett.cpp", MAME_DIR .. "src/mame/drivers/mephisto_glasgow.cpp", MAME_DIR .. "src/mame/drivers/mephisto_mm1.cpp", MAME_DIR .. "src/mame/drivers/mephisto_mm2.cpp", MAME_DIR .. "src/mame/drivers/mephisto_modena.cpp", MAME_DIR .. "src/mame/drivers/mephisto_modular.cpp", + MAME_DIR .. "src/mame/drivers/mephisto_modular_tm.cpp", MAME_DIR .. "src/mame/drivers/mephisto_mondial68k.cpp", MAME_DIR .. "src/mame/drivers/mephisto_montec.cpp", MAME_DIR .. "src/mame/drivers/mephisto_polgar.cpp", MAME_DIR .. "src/mame/machine/mmboard.cpp", MAME_DIR .. "src/mame/machine/mmboard.h", + MAME_DIR .. "src/mame/video/mmdisplay2.cpp", + MAME_DIR .. "src/mame/video/mmdisplay2.h", } createMESSProjects(_target, _subtarget, "hitachi") @@ -2558,8 +2586,8 @@ createMESSProjects(_target, _subtarget, "jazz") files { MAME_DIR .. "src/mame/drivers/jazz.cpp", MAME_DIR .. "src/mame/includes/jazz.h", - MAME_DIR .. "src/mame/machine/jazz_mct_adr.cpp", - MAME_DIR .. "src/mame/machine/jazz_mct_adr.h", + MAME_DIR .. "src/mame/machine/mct_adr.cpp", + MAME_DIR .. "src/mame/machine/mct_adr.h", } createMESSProjects(_target, _subtarget, "kaypro") @@ -2600,6 +2628,14 @@ files { MAME_DIR .. "src/mame/drivers/leapfrog_leappad.cpp", } +createMESSProjects(_target, _subtarget, "lsi") +files { + MAME_DIR .. "src/mame/drivers/adm11.cpp", + MAME_DIR .. "src/mame/drivers/adm23.cpp", + MAME_DIR .. "src/mame/drivers/adm31.cpp", + MAME_DIR .. "src/mame/drivers/adm36.cpp", +} + createMESSProjects(_target, _subtarget, "luxor") files { MAME_DIR .. "src/mame/drivers/abc80.cpp", @@ -2788,11 +2824,13 @@ files { createMESSProjects(_target, _subtarget, "natsemi") files { MAME_DIR .. "src/mame/drivers/hh_cop400.cpp", + MAME_DIR .. "src/mame/drivers/ns5652.cpp", } createMESSProjects(_target, _subtarget, "ncd") files { MAME_DIR .. "src/mame/drivers/ncd68k.cpp", + MAME_DIR .. "src/mame/drivers/ncd88k.cpp", MAME_DIR .. "src/mame/drivers/ncdmips.cpp", MAME_DIR .. "src/mame/drivers/ncdppc.cpp", MAME_DIR .. "src/mame/machine/bert.cpp", @@ -2874,6 +2912,7 @@ files { MAME_DIR .. "src/mame/machine/nes.cpp", MAME_DIR .. "src/mame/video/nes.cpp", MAME_DIR .. "src/mame/drivers/nes_vt.cpp", + MAME_DIR .. "src/mame/drivers/nes_boot.cpp", MAME_DIR .. "src/mame/drivers/pokemini.cpp", MAME_DIR .. "src/mame/drivers/snes.cpp", MAME_DIR .. "src/mame/includes/snes.h", @@ -2894,6 +2933,8 @@ files { MAME_DIR .. "src/mame/drivers/vt1682.cpp", MAME_DIR .. "src/mame/machine/vt1682_io.h", MAME_DIR .. "src/mame/machine/vt1682_io.cpp", + MAME_DIR .. "src/mame/machine/vt1682_uio.h", + MAME_DIR .. "src/mame/machine/vt1682_uio.cpp", MAME_DIR .. "src/mame/machine/vt1682_alu.h", MAME_DIR .. "src/mame/machine/vt1682_alu.cpp", MAME_DIR .. "src/mame/machine/vt1682_timer.h", @@ -2926,6 +2967,7 @@ files { MAME_DIR .. "src/mame/drivers/novag_presto.cpp", MAME_DIR .. "src/mame/drivers/novag_savant.cpp", MAME_DIR .. "src/mame/drivers/novag_sexpert.cpp", + MAME_DIR .. "src/mame/drivers/novag_supremo.cpp", } createMESSProjects(_target, _subtarget, "olivetti") @@ -3070,6 +3112,10 @@ createMESSProjects(_target, _subtarget, "psion") files { MAME_DIR .. "src/mame/drivers/psion.cpp", MAME_DIR .. "src/mame/includes/psion.h", + MAME_DIR .. "src/mame/drivers/psion5.cpp", + MAME_DIR .. "src/mame/includes/psion5.h", + MAME_DIR .. "src/mame/machine/etna.cpp", + MAME_DIR .. "src/mame/machine/etna.h", MAME_DIR .. "src/mame/machine/psion_pack.cpp", MAME_DIR .. "src/mame/machine/psion_pack.h", } @@ -3561,6 +3607,7 @@ files { MAME_DIR .. "src/mame/drivers/ts816.cpp", MAME_DIR .. "src/mame/drivers/tv910.cpp", MAME_DIR .. "src/mame/drivers/tv912.cpp", + MAME_DIR .. "src/mame/drivers/tv924.cpp", MAME_DIR .. "src/mame/drivers/tv950.cpp", MAME_DIR .. "src/mame/drivers/tv955.cpp", MAME_DIR .. "src/mame/drivers/tv965.cpp", @@ -3753,7 +3800,22 @@ files { MAME_DIR .. "src/mame/drivers/trkfldch.cpp", MAME_DIR .. "src/mame/drivers/tvgame.cpp", MAME_DIR .. "src/mame/drivers/spg110.cpp", - MAME_DIR .. "src/mame/drivers/vii.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_jakks.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_zone.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_zone_32bit.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_senario.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_senario_poker.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_vii.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_ican.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_playvision.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_shredmjr.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_telestory.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_tvgogo.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_pdc.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_dreamlife.cpp", + MAME_DIR .. "src/mame/drivers/spg2xx_lexibook.cpp", + MAME_DIR .. "src/mame/includes/spg2xx.h", MAME_DIR .. "src/mame/drivers/sunplus_gcm394.cpp", MAME_DIR .. "src/mame/drivers/generalplus_gpl32612.cpp", MAME_DIR .. "src/mame/drivers/xavix.cpp", @@ -3780,6 +3842,8 @@ files { MAME_DIR .. "src/mame/drivers/lexibook_jg7425.cpp", MAME_DIR .. "src/mame/drivers/unkmandd.cpp", MAME_DIR .. "src/mame/drivers/bbl380.cpp", + MAME_DIR .. "src/mame/drivers/actions_atj2279b.cpp", + MAME_DIR .. "src/mame/drivers/pubint_storyreader.cpp", } createMESSProjects(_target, _subtarget, "ultimachine") @@ -4002,9 +4066,7 @@ files { MAME_DIR .. "src/mame/drivers/aaa.cpp", MAME_DIR .. "src/mame/drivers/acd.cpp", MAME_DIR .. "src/mame/drivers/aceex.cpp", - MAME_DIR .. "src/mame/drivers/adm23.cpp", - MAME_DIR .. "src/mame/drivers/adm31.cpp", - MAME_DIR .. "src/mame/drivers/adm36.cpp", + MAME_DIR .. "src/mame/drivers/aid80f.cpp", MAME_DIR .. "src/mame/drivers/akaiax80.cpp", MAME_DIR .. "src/mame/drivers/alcat7100.cpp", MAME_DIR .. "src/mame/drivers/alesis_qs.cpp", @@ -4093,6 +4155,7 @@ files { MAME_DIR .. "src/mame/drivers/fs3216.cpp", MAME_DIR .. "src/mame/drivers/ft68m.cpp", MAME_DIR .. "src/mame/drivers/gameking.cpp", + MAME_DIR .. "src/mame/drivers/gigatron.cpp", MAME_DIR .. "src/mame/drivers/gimix.cpp", MAME_DIR .. "src/mame/drivers/goupil.cpp", MAME_DIR .. "src/mame/drivers/grfd2301.cpp", diff --git a/scripts/target/mame/nl.lua b/scripts/target/mame/nl.lua index 6701256bc56..d2a0958df6e 100644 --- a/scripts/target/mame/nl.lua +++ b/scripts/target/mame/nl.lua @@ -23,10 +23,11 @@ CPUS["M6803"] = true CPUS["M6809"] = true CPUS["MCS48"] = true CPUS["I8085"] = true ---CPUS["MCS51"] = true +CPUS["MCS51"] = true --CPUS["M6800"] = true --CPUS["M6809"] = true --CPUS["M680X0"] = true +CPUS["M680X0"] = true --CPUS["TMS9900"] = true --CPUS["COP400"] = true CPUS["F8"] = true @@ -43,14 +44,18 @@ SOUNDS["AY8910"] = true SOUNDS["MSM5205"] = true --SOUNDS["ASTROCADE"] = true SOUNDS["TMS5220"] = true ---SOUNDS["OKIM6295"] = true +SOUNDS["OKIM6295"] = true +SOUNDS["UPD7759"] = true --SOUNDS["HC55516"] = true --SOUNDS["YM3812"] = true --SOUNDS["CEM3394"] = true --SOUNDS["VOTRAX"] = true +SOUNDS["YM2151"] = true +SOUNDS["YM2413"] = true SOUNDS["BEEP"] = true SOUNDS["VOLT_REG"] = true SOUNDS["SPEAKER"] = true +SOUNDS["DIGITALKER"] = true -------------------------------------------------- -- specify available video cores @@ -80,6 +85,8 @@ MACHINES["6821PIA"] = true MACHINES["I8255"] = true MACHINES["WATCHDOG"] = true MACHINES["EEPROMDEV"] = true +MACHINES["UPD4701"] = true +MACHINES["CXD1095"] = true --MACHINES["TTL74148"] = true --MACHINES["TTL74153"] = true --MACHINES["TTL7474"] = true @@ -149,17 +156,17 @@ files{ MAME_DIR .. "src/mame/includes/1942.h", MAME_DIR .. "src/mame/video/1942.cpp", MAME_DIR .. "src/mame/audio/nl_1942.cpp", - MAME_DIR .. "src/mame/audio/nl_1942.h", + MAME_DIR .. "src/mame/audio/nl_1942.h", MAME_DIR .. "src/mame/drivers/gamemachine.cpp", - MAME_DIR .. "src/mame/audio/nl_gamemachine.h", - MAME_DIR .. "src/mame/audio/nl_gamemachine.cpp", + MAME_DIR .. "src/mame/audio/nl_gamemachine.h", + MAME_DIR .. "src/mame/audio/nl_gamemachine.cpp", MAME_DIR .. "src/mame/drivers/popeye.cpp", MAME_DIR .. "src/mame/includes/popeye.h", MAME_DIR .. "src/mame/video/popeye.cpp", - MAME_DIR .. "src/mame/audio/nl_popeye.cpp", - MAME_DIR .. "src/mame/audio/nl_popeye.h", + MAME_DIR .. "src/mame/audio/nl_popeye.cpp", + MAME_DIR .. "src/mame/audio/nl_popeye.h", MAME_DIR .. "src/mame/drivers/mario.cpp", MAME_DIR .. "src/mame/includes/mario.h", @@ -184,6 +191,17 @@ files{ MAME_DIR .. "src/mame/includes/cheekyms.h", MAME_DIR .. "src/mame/video/cheekyms.cpp", + MAME_DIR .. "src/mame/drivers/galaxian.cpp", + MAME_DIR .. "src/mame/includes/galaxian.h", + MAME_DIR .. "src/mame/audio/galaxian.cpp", + MAME_DIR .. "src/mame/audio/galaxian.h", + MAME_DIR .. "src/mame/video/galaxian.cpp", + MAME_DIR .. "src/mame/audio/nl_konami.h", + MAME_DIR .. "src/mame/audio/nl_konami.cpp", + + MAME_DIR .. "src/mame/audio/cclimber.cpp", + MAME_DIR .. "src/mame/audio/cclimber.h", + MAME_DIR .. "src/mame/audio/nl_zac1b11142.cpp", MAME_DIR .. "src/mame/audio/nl_zacc1b11142.h", MAME_DIR .. "src/mame/audio/zaccaria.cpp", @@ -193,13 +211,35 @@ files{ MAME_DIR .. "src/mame/video/zaccaria.cpp", MAME_DIR .. "src/mame/drivers/cocoloco.cpp", - MAME_DIR .. "src/mame/audio/nl_cocoloco.h", - MAME_DIR .. "src/mame/audio/nl_cocoloco.cpp", + MAME_DIR .. "src/mame/audio/nl_cocoloco.h", + MAME_DIR .. "src/mame/audio/nl_cocoloco.cpp", MAME_DIR .. "src/mame/drivers/palestra.cpp", MAME_DIR .. "src/mame/machine/nl_palestra.cpp", MAME_DIR .. "src/mame/machine/nl_palestra.h", + MAME_DIR .. "src/mame/drivers/segas16b.cpp", + MAME_DIR .. "src/mame/includes/segas16b.h", + MAME_DIR .. "src/mame/video/segas16b.cpp", + MAME_DIR .. "src/mame/audio/nl_segas16b.cpp", + MAME_DIR .. "src/mame/audio/nl_segas16b.h", + MAME_DIR .. "src/mame/machine/315_5195.cpp", + MAME_DIR .. "src/mame/machine/315_5195.h", + MAME_DIR .. "src/mame/machine/fd1089.cpp", + MAME_DIR .. "src/mame/machine/fd1089.h", + MAME_DIR .. "src/mame/machine/fd1094.cpp", + MAME_DIR .. "src/mame/machine/fd1094.h", + MAME_DIR .. "src/mame/machine/segaic16.cpp", + MAME_DIR .. "src/mame/machine/segaic16.h", + MAME_DIR .. "src/mame/video/sega16sp.cpp", + MAME_DIR .. "src/mame/video/sega16sp.h", + MAME_DIR .. "src/mame/machine/mc8123.cpp", + MAME_DIR .. "src/mame/machine/mc8123.h", + MAME_DIR .. "src/mame/video/segaic16.cpp", + MAME_DIR .. "src/mame/video/segaic16.h", + MAME_DIR .. "src/mame/video/segaic16_road.cpp", + MAME_DIR .. "src/mame/video/segaic16_road.h", + MAME_DIR .. "src/mame/drivers/testpat.cpp", MAME_DIR .. "src/mame/machine/nl_tp1983.cpp", MAME_DIR .. "src/mame/machine/nl_tp1983.h", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 79e3f84e17f..45734c11971 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2015 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2020 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause -- diff --git a/src/devices/bus/a2bus/a2hsscsi.h b/src/devices/bus/a2bus/a2hsscsi.h index a660dac5e58..905de8b620d 100644 --- a/src/devices/bus/a2bus/a2hsscsi.h +++ b/src/devices/bus/a2bus/a2hsscsi.h @@ -28,6 +28,8 @@ public: // construction/destruction a2bus_hsscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + static constexpr feature_type unemulated_features() { return feature::DISK; } + DECLARE_WRITE_LINE_MEMBER( drq_w ); protected: diff --git a/src/devices/bus/a2bus/a2thunderclock.cpp b/src/devices/bus/a2bus/a2thunderclock.cpp index 69cc87a07ff..a948a465f5d 100644 --- a/src/devices/bus/a2bus/a2thunderclock.cpp +++ b/src/devices/bus/a2bus/a2thunderclock.cpp @@ -56,7 +56,7 @@ ROM_END void a2bus_thunderclock_device::device_add_mconfig(machine_config &config) { - UPD1990A(config, m_upd1990ac, 1021800); + UPD1990A(config, m_upd1990ac, 32.768_kHz_XTAL); m_upd1990ac->data_callback().set(FUNC(a2bus_thunderclock_device::upd_dataout_w)); } diff --git a/src/devices/bus/a2gameio/paddles.cpp b/src/devices/bus/a2gameio/paddles.cpp index 95d0199a210..95d0199a210 100755..100644 --- a/src/devices/bus/a2gameio/paddles.cpp +++ b/src/devices/bus/a2gameio/paddles.cpp diff --git a/src/devices/bus/a2gameio/paddles.h b/src/devices/bus/a2gameio/paddles.h index 3cff10dd097..3cff10dd097 100755..100644 --- a/src/devices/bus/a2gameio/paddles.h +++ b/src/devices/bus/a2gameio/paddles.h diff --git a/src/devices/bus/abcbus/lux4105.cpp b/src/devices/bus/abcbus/lux4105.cpp index 1d00d071fc8..fbcf1dec72c 100644 --- a/src/devices/bus/abcbus/lux4105.cpp +++ b/src/devices/bus/abcbus/lux4105.cpp @@ -6,6 +6,37 @@ *********************************************************************/ +/* + +PCB Layout +---------- + +DATABOARD 4105-10 + +|-------------------------------------------| +|- LS367 LS74 LS32 LS00 LS38 LED| +|| -| +|| LS367 LS06 LS38 LS14 || +|C C| +|N ALS08 LS08 81LS96 N| +|1 2| +|| 81LS95 74S373 LS273 74S240 || +|| -| +|- SW1 DM8131 LS175 SW2 | +|-------------------------------------------| + +Notes: + All IC's shown. + + DM8131 - National Semiconductor DM8131N 6-Bit Unified Bus Comparator + LED - Power LED + SW1 - Drive settings + SW2 - Card address + CN1 - 2x32 PCB header, ABC 1600 bus + CN2 - 2x25 PCB header, Xebec S1410 + +*/ + #include "emu.h" #include "lux4105.h" #include "bus/scsi/scsihd.h" diff --git a/src/devices/bus/ata/idehd.cpp b/src/devices/bus/ata/idehd.cpp index e442e4475f6..15a079963de 100644 --- a/src/devices/bus/ata/idehd.cpp +++ b/src/devices/bus/ata/idehd.cpp @@ -875,5 +875,5 @@ uint8_t ide_hdd_device::calculate_status() void ide_hdd_device::device_add_mconfig(machine_config &config) { - HARDDISK(config, "image"); + HARDDISK(config, "image", "ide_hdd"); } diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index 50edb6e5506..ca3a5e5f0af 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -112,15 +112,17 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data) //#include "teletext.h" //#include "digitiser.h" #include "emrmidi.h" +#include "ide.h" #include "ieee488.h" #include "m2000.h" //#include "m5000.h" -//#include "scsi.h" +#include "scsi.h" //#include "multiform.h" #include "opus3.h" #include "pms64k.h" #include "ramdisc.h" //#include "graduate.h" +#include "beebopl.h" #include "beebsid.h" //#include "prisma3.h" #include "sprite.h" @@ -132,19 +134,21 @@ void bbc_1mhzbus_devices(device_slot_interface &device) //device.option_add("teletext", BBC_TELETEXT); /* Acorn ANE01 Teletext Adapter */ device.option_add("ieee488", BBC_IEEE488); /* Acorn ANK01 IEEE488 Interface */ //device.option_add("m500", BBC_M500); /* Acorn ANV02 Music 500 */ - //device.option_add("awdd", BBC_AWDD); /* Acorn Winchester 110/130 */ + device.option_add("awhd", BBC_AWHD); /* Acorn Winchester Disc */ device.option_add("autoprom", BBC_AUTOPROM); /* ATPL AutoPrommer */ + device.option_add("beebide", BBC_BEEBIDE); /* Sprow BeebIDE 16-bit */ + device.option_add("ide8", BBC_IDE8); /* RetroClinic BBC 8-bit IDE */ //device.option_add("beebscan", BBC_BEEBSCAN); /* Beeb HandScan */ device.option_add("b488", BBC_B488); /* Aries B488 */ //device.option_add("videodig", BBC_VIDEODIG); /* Video Digitiser (RH Electronics) */ device.option_add("emrmidi", BBC_EMRMIDI); /* EMR Midi Interface */ //device.option_add("procyon", BBC_PROCYON); /* CST Procyon IEEE Interface */ - //device.option_add("twdd", BBC_TWDD); /* Technomatic Winchester (Akhter Host Adaptor + ABD4070 */ //device.option_add("multiform", BBC_MULTIFORM); /* Technomatic Multiform Z80 */ device.option_add("opus3", BBC_OPUS3); /* Opus Challenger 3 */ device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */ device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */ //device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */ + device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */ device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */ //device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */ device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */ @@ -155,12 +159,13 @@ void bbcm_1mhzbus_devices(device_slot_interface &device) //device.option_add("teletext", BBC_TELETEXT); /* Acorn ANE01 Teletext Adapter */ device.option_add("ieee488", BBC_IEEE488); /* Acorn ANK01 IEEE488 Interface */ //device.option_add("m500", BBC_M500); /* Acorn ANV02 Music 500 */ - //device.option_add("awdd", BBC_AWDD); /* Acorn Winchester 110/130 */ + device.option_add("awhd", BBC_AWHD); /* Acorn Winchester Disc */ + device.option_add("beebide", BBC_BEEBIDE); /* Sprow BeebIDE 16-bit */ + device.option_add("ide8", BBC_IDE8); /* RetroClinic BBC 8-bit IDE */ device.option_add("b488", BBC_B488); /* Aries B488 */ //device.option_add("videodig", BBC_VIDEODIG); /* Video Digitiser (RH Electronics) */ device.option_add("emrmidi", BBC_EMRMIDI); /* EMR Midi Interface */ //device.option_add("procyon", BBC_PROCYON); /* CST Procyon IEEE Interface */ - //device.option_add("twdd", BBC_TWDD); /* Technomatic Winchester (Akhter Host Adaptor + ABD4070 */ device.option_add("m2000", BBC_M2000); /* Hybrid Music 2000 Interface */ //device.option_add("m3000", BBC_M3000); /* Hybrid Music 3000 Expander */ //device.option_add("m5000", BBC_M5000); /* Hybrid Music 5000 Synthesiser */ @@ -170,6 +175,7 @@ void bbcm_1mhzbus_devices(device_slot_interface &device) device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */ device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */ //device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */ + device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */ device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */ //device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */ device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */ diff --git a/src/devices/bus/bbc/1mhzbus/beebopl.cpp b/src/devices/bus/bbc/1mhzbus/beebopl.cpp new file mode 100644 index 00000000000..9c3db9ca6ff --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/beebopl.cpp @@ -0,0 +1,95 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + BeebOPL FM Synthesiser emulation + + https://github.com/JudgeBeeb/BeebOPL + +**********************************************************************/ + + +#include "emu.h" +#include "beebopl.h" +#include "speaker.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_BEEBOPL, bbc_beebopl_device, "beebopl", "BeebOPL FM Synthesiser") + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void bbc_beebopl_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "speaker").front_center(); + + YM3812(config, m_ym3812, 3.579_MHz_XTAL); + m_ym3812->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w)); + m_ym3812->add_route(ALL_OUTPUTS, "speaker", 1.0); + + BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr); + m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w)); + m_1mhzbus->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::nmi_w)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_beebopl_device - constructor +//------------------------------------------------- + +bbc_beebopl_device::bbc_beebopl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, BBC_BEEBOPL, tag, owner, clock) + , device_bbc_1mhzbus_interface(mconfig, *this) + , m_1mhzbus(*this, "1mhzbus") + , m_ym3812(*this, "ym3812") +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t bbc_beebopl_device::fred_r(offs_t offset) +{ + uint8_t data = 0xff; + + if ((offset & 0xfe) == 0x04) + { + data = m_ym3812->read(offset); + } + + data &= m_1mhzbus->fred_r(offset); + + return data; +} + +void bbc_beebopl_device::fred_w(offs_t offset, uint8_t data) +{ + if ((offset & 0xfe) == 0x04) + { + m_ym3812->write(offset, data); + } + + m_1mhzbus->fred_w(offset, data); +} + +uint8_t bbc_beebopl_device::jim_r(offs_t offset) +{ + return m_1mhzbus->jim_r(offset); +} + +void bbc_beebopl_device::jim_w(offs_t offset, uint8_t data) +{ + m_1mhzbus->jim_w(offset, data); +} diff --git a/src/devices/bus/bbc/1mhzbus/beebopl.h b/src/devices/bus/bbc/1mhzbus/beebopl.h new file mode 100644 index 00000000000..b3f9fb19fb2 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/beebopl.h @@ -0,0 +1,52 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + BeebOPL FM Synthesiser emulation + +**********************************************************************/ + +#ifndef MAME_BUS_BBC_1MHZBUS_BEEBOPL_H +#define MAME_BUS_BBC_1MHZBUS_BEEBOPL_H + +#include "1mhzbus.h" +#include "sound/3812intf.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> bbc_beebopl_device + +class bbc_beebopl_device : + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + bbc_beebopl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override { } + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + + virtual uint8_t fred_r(offs_t offset) override; + virtual void fred_w(offs_t offset, uint8_t data) override; + virtual uint8_t jim_r(offs_t offset) override; + virtual void jim_w(offs_t offset, uint8_t data) override; + +private: + required_device<bbc_1mhzbus_slot_device> m_1mhzbus; + required_device<ym3812_device> m_ym3812; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_BEEBOPL, bbc_beebopl_device) + + +#endif // MAME_BUS_BBC_1MHZBUS_BEEBOPL_H diff --git a/src/devices/bus/bbc/1mhzbus/ide.cpp b/src/devices/bus/bbc/1mhzbus/ide.cpp new file mode 100644 index 00000000000..0fa7d3ad069 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/ide.cpp @@ -0,0 +1,224 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + RetroClinic BBC 8-bit IDE Interface + + http://www.retroclinic.com/acorn/bbcide/bbcide.htm + http://www.retroclinic.com/acorn/kitide1mhz/kitide1mhz.htm + + Sprow BeebIDE 16-bit IDE Interface for the BBC series + + http://www.sprow.co.uk/bbc/beebide.htm + +**********************************************************************/ + + +#include "emu.h" +#include "ide.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_IDE8, bbc_ide8_device, "bbc_ide8", "RetroClinic BBC 8-bit IDE Interface"); +DEFINE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device, "bbc_beebide", "Sprow BeebIDE 16-bit IDE Interface"); + + +//------------------------------------------------- +// INPUT_PORTS( beebide ) +//------------------------------------------------- + +INPUT_PORTS_START(beebide) + PORT_START("LINKS") + PORT_CONFNAME(0x01, 0x00, "Interrupt Enable") + PORT_CONFSETTING(0x00, DEF_STR(No)) + PORT_CONFSETTING(0x01, DEF_STR(Yes)) + PORT_CONFNAME(0x10, 0x00, "Address Selection") + PORT_CONFSETTING(0x00, "&FC40-&FC4F") + PORT_CONFSETTING(0x10, "&FC50-&FC5F") +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor bbc_beebide_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(beebide); +} + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void bbc_ide8_device::device_add_mconfig(machine_config& config) +{ + ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false); +} + +void bbc_beebide_device::device_add_mconfig(machine_config& config) +{ + ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false); + m_ide->irq_handler().set(FUNC(bbc_beebide_device::irq_w)); + + BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr); + m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w)); + m_1mhzbus->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::nmi_w)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_ide_device - constructor +//------------------------------------------------- + +bbc_ide8_device::bbc_ide8_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : device_t(mconfig, BBC_IDE8, tag, owner, clock) + , device_bbc_1mhzbus_interface(mconfig, *this) + , m_ide(*this, "ide") +{ +} + +bbc_beebide_device::bbc_beebide_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : device_t(mconfig, BBC_BEEBIDE, tag, owner, clock) + , device_bbc_1mhzbus_interface(mconfig, *this) + , m_ide(*this, "ide") + , m_1mhzbus(*this, "1mhzbus") + , m_links(*this, "LINKS") + , m_ide_data(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_beebide_device::device_start() +{ + save_item(NAME(m_ide_data)); +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t bbc_ide8_device::fred_r(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset & 0xf8) + { + case 0x40: + data = m_ide->read_cs0(offset & 0x07, 0xff); + break; + } + + return data; +} + +void bbc_ide8_device::fred_w(offs_t offset, uint8_t data) +{ + switch (offset & 0xf8) + { + case 0x40: + m_ide->write_cs0(offset & 0x07, data, 0xff); + break; + } +} + + +uint8_t bbc_beebide_device::fred_r(offs_t offset) +{ + uint8_t data = 0xff; + + if ((offset & 0x50) == ((m_links->read() & 0x10) | 0x40)) + { + switch (offset & 0xe8) + { + case 0x40: + if (offset & 0x07) + { + data = m_ide->read_cs0(offset & 0x07, 0xff); + } + else + { + m_ide_data = m_ide->read_cs0(offset & 0x07); + data = m_ide_data & 0xff; + } + break; + case 0x48: + if (offset & 0x04) + { + data = m_ide->read_cs1(offset & 0x07, 0xff); + } + else + { + data = m_ide_data >> 8; + } + break; + } + } + + data &= m_1mhzbus->fred_r(offset); + + return data; +} + +void bbc_beebide_device::fred_w(offs_t offset, uint8_t data) +{ + if ((offset & 0x50) == ((m_links->read() & 0x10) | 0x40)) + { + switch (offset & 0xe8) + { + case 0x40: + if (offset & 0x07) + { + m_ide->write_cs0(offset & 0x07, data, 0xff); + } + else + { + m_ide_data = (m_ide_data & 0xff00) | data; + m_ide->write_cs0(offset & 0x07, m_ide_data); + } + break; + case 0x48: + if (offset & 0x04) + { + m_ide->write_cs1(offset & 0x07, data, 0xff); + } + else + { + m_ide_data = data << 8; + } + break; + } + } + + m_1mhzbus->fred_w(offset, data); +} + +uint8_t bbc_beebide_device::jim_r(offs_t offset) +{ + return m_1mhzbus->jim_r(offset); +} + +void bbc_beebide_device::jim_w(offs_t offset, uint8_t data) +{ + m_1mhzbus->jim_w(offset, data); +} + +WRITE_LINE_MEMBER(bbc_beebide_device::irq_w) +{ + if (BIT(m_links->read(), 0)) + { + m_slot->irq_w(state); + } +} diff --git a/src/devices/bus/bbc/1mhzbus/ide.h b/src/devices/bus/bbc/1mhzbus/ide.h new file mode 100644 index 00000000000..d326c199ce9 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/ide.h @@ -0,0 +1,86 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + RetroClinic BBC 8-bit IDE Interface + + http://www.retroclinic.com/acorn/bbcide/bbcide.htm + + Sprow BeebIDE 16-bit IDE Interface for the BBC series + + http://www.sprow.co.uk/bbc/beebide.htm + +**********************************************************************/ + + +#ifndef MAME_BUS_BBC_1MHZBUS_IDE_H +#define MAME_BUS_BBC_1MHZBUS_IDE_H + +#include "1mhzbus.h" +#include "bus/ata/ataintf.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class bbc_ide8_device : + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + bbc_ide8_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override { } + + // optional information overrides + virtual void device_add_mconfig(machine_config& config) override; + + virtual uint8_t fred_r(offs_t offset) override; + virtual void fred_w(offs_t offset, uint8_t data) override; + +private: + required_device<ata_interface_device> m_ide; +}; + + +class bbc_beebide_device : + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + bbc_beebide_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config& config) override; + virtual ioport_constructor device_input_ports() const override; + + virtual uint8_t fred_r(offs_t offset) override; + virtual void fred_w(offs_t offset, uint8_t data) override; + virtual uint8_t jim_r(offs_t offset) override; + virtual void jim_w(offs_t offset, uint8_t data) override; + +private: + DECLARE_WRITE_LINE_MEMBER(irq_w); + + required_device<ata_interface_device> m_ide; + required_device<bbc_1mhzbus_slot_device> m_1mhzbus; + required_ioport m_links; + + uint16_t m_ide_data; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_IDE8, bbc_ide8_device); +DECLARE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device); + + +#endif /* MAME_BUS_BBC_1MHZBUS_IDE_H */ diff --git a/src/devices/bus/bbc/1mhzbus/scsi.cpp b/src/devices/bus/bbc/1mhzbus/scsi.cpp new file mode 100644 index 00000000000..26c640467b3 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/scsi.cpp @@ -0,0 +1,201 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn SCSI Host Adaptor + + Known SCSI controller boards used: + Adaptec ACB-4000A + + Known SCSI devices using adaptor: + SCSI ID 0 - Acorn Winchester 110: Seagate ST412 + Adaptec ACB-4000A + Acorn Winchester 120: NEC D5126 + Adaptec ACB-4000A + Acorn Winchester 130: Rodime R0203E + Adaptec ACB-4000A + SCSI ID 1 - Digistore Tape Streamer: Archive 2060S + + Compatible 3rd party Winchesters using Akhter Host Adaptor: + Technomatic 20MB: Seagate ST225 + Adaptec ACB-4070 + Technomatic 30MB: + Technomatic 40MB: + + Additional notes: + The Digistore used a modified Acorn Host Adaptor, it re-mapped + the device to &FC44-47, from &FC40-43. This allows both the + Digistore and Winchester to co-exist. + + Useful CHD parameters: + 10MB -chs 306,4,33 -ss=256 + 20MB -chs 612,4,33 -ss=256 + 30MB -chs 640,6,33 -ss=256 + 512MB -chs 3971,16,33 -ss 256 + + TODO: + - test formatting, may require specific ACB-4000A commands. + +**********************************************************************/ + +#include "emu.h" +#include "scsi.h" +#include "machine/nscsi_bus.h" +#include "bus/nscsi/devices.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_SCSI, bbc_scsi_device, "bbc_scsi", "Acorn SCSI Host Adaptor"); +DEFINE_DEVICE_TYPE(BBC_AWHD, bbc_awhd_device, "bbc_awhd", "Acorn Winchester Disc"); + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void bbc_scsi_device::device_add_mconfig(machine_config& config) +{ + NSCSI_BUS(config, "scsi"); + NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:1", default_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:7", default_scsi_devices, "scsicb", true) + .option_add_internal("scsicb", NSCSI_CB) + .machine_config([this](device_t* device) { + downcast<nscsi_callback_device&>(*device).bsy_callback().set(*this, FUNC(bbc_scsi_device::bsy_w)); + downcast<nscsi_callback_device&>(*device).req_callback().set(*this, FUNC(bbc_scsi_device::req_w)); + }); +} + +void bbc_awhd_device::device_add_mconfig(machine_config &config) +{ + bbc_scsi_device::device_add_mconfig(config); + + /* Adaptec ACB-4000A */ + subdevice<nscsi_connector>("scsi:0")->set_default_option("harddisk"); + subdevice<nscsi_connector>("scsi:0")->set_fixed(true); + + BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr); + m_1mhzbus->irq_handler().set(m_1mhzbus, FUNC(bbc_1mhzbus_slot_device::irq_w)); + m_1mhzbus->nmi_handler().set(m_1mhzbus, FUNC(bbc_1mhzbus_slot_device::nmi_w)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_scsi_device - constructor +//------------------------------------------------- + +bbc_scsi_device::bbc_scsi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_bbc_1mhzbus_interface(mconfig, *this) + , m_scsi(*this, "scsi:7:scsicb") +{ +} + +bbc_scsi_device::bbc_scsi_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : bbc_scsi_device(mconfig, BBC_SCSI, tag, owner, clock) +{ +} + +bbc_awhd_device::bbc_awhd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bbc_scsi_device(mconfig, BBC_AWHD, tag, owner, clock) + , m_1mhzbus(*this, "1mhzbus") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_scsi_device::device_start() +{ + /* register for save states */ + save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_state)); +} + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t bbc_scsi_device::fred_r(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset) + { + case 0x40: + data = m_scsi->read(); + m_scsi->ack_w(1); + break; + case 0x41: + data = (m_scsi->msg_r() << 0) + | (m_scsi->bsy_r() << 1) + | (m_irq_state << 4) + | (m_scsi->req_r() << 5) + | (m_scsi->io_r() << 6) + | (m_scsi->cd_r() << 7); + break; + } + + return data; +} + +void bbc_scsi_device::fred_w(offs_t offset, uint8_t data) +{ + switch (offset) + { + case 0x40: + m_scsi->write(data); + m_scsi->ack_w(1); + break; + case 0x42: + m_scsi->sel_w(1); + break; + case 0x43: + m_irq_enable = BIT(data, 0); + break; + } +} + +WRITE_LINE_MEMBER(bbc_scsi_device::bsy_w) +{ + m_scsi->sel_w(0); +} + +WRITE_LINE_MEMBER(bbc_scsi_device::req_w) +{ + m_scsi->ack_w(0); + + m_irq_state = (m_irq_enable && !state) ? 0 : 1; + m_slot->irq_w(m_irq_state ? CLEAR_LINE : ASSERT_LINE); +} + + +uint8_t bbc_awhd_device::fred_r(offs_t offset) +{ + uint8_t data = 0xff; + + data &= bbc_scsi_device::fred_r(offset); + data &= m_1mhzbus->fred_r(offset); + + return data; +} + +void bbc_awhd_device::fred_w(offs_t offset, uint8_t data) +{ + bbc_scsi_device::fred_w(offset, data); + m_1mhzbus->fred_w(offset, data); +} + +uint8_t bbc_awhd_device::jim_r(offs_t offset) +{ + return m_1mhzbus->jim_r(offset); +} + +void bbc_awhd_device::jim_w(offs_t offset, uint8_t data) +{ + m_1mhzbus->jim_w(offset, data); +} diff --git a/src/devices/bus/bbc/1mhzbus/scsi.h b/src/devices/bus/bbc/1mhzbus/scsi.h new file mode 100644 index 00000000000..8a4dabbe113 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/scsi.h @@ -0,0 +1,81 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn SCSI Host Adaptor + +**********************************************************************/ + + +#ifndef MAME_BUS_BBC_1MHZBUS_SCSI_H +#define MAME_BUS_BBC_1MHZBUS_SCSI_H + +#include "1mhzbus.h" +#include "machine/nscsi_cb.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class bbc_scsi_device: + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + bbc_scsi_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock); + + DECLARE_WRITE_LINE_MEMBER(bsy_w); + DECLARE_WRITE_LINE_MEMBER(req_w); + +protected: + bbc_scsi_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock); + + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config& config) override; + + virtual uint8_t fred_r(offs_t offset) override; + virtual void fred_w(offs_t offset, uint8_t data) override; + +private: + required_device<nscsi_callback_device> m_scsi; + + int m_irq_enable; + int m_irq_state; +}; + + +// ======================> bbc_awhd_device + +class bbc_awhd_device : public bbc_scsi_device +{ +public: + static constexpr feature_type imperfect_features() { return feature::DISK; } + + // construction/destruction + bbc_awhd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + + virtual uint8_t fred_r(offs_t offset) override; + virtual void fred_w(offs_t offset, uint8_t data) override; + virtual uint8_t jim_r(offs_t offset) override; + virtual void jim_w(offs_t offset, uint8_t data) override; + +private: + required_device<bbc_1mhzbus_slot_device> m_1mhzbus; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_SCSI, bbc_scsi_device); +DECLARE_DEVICE_TYPE(BBC_AWHD, bbc_awhd_device); + + +#endif /* MAME_BUS_BBC_1MHZBUS_SCSI_H */ diff --git a/src/devices/bus/bbc/modem/modem.cpp b/src/devices/bus/bbc/modem/modem.cpp new file mode 100644 index 00000000000..1d5eff6e85c --- /dev/null +++ b/src/devices/bus/bbc/modem/modem.cpp @@ -0,0 +1,102 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + BBC Master Internal Modem port + +**********************************************************************/ + +#include "emu.h" +#include "modem.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_MODEM_SLOT, bbc_modem_slot_device, "bbc_modem_slot", "BBC Master Internal Modem port") + + + +//************************************************************************** +// DEVICE BBC_MODEM PORT INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_bbc_modem_interface - constructor +//------------------------------------------------- + +device_bbc_modem_interface::device_bbc_modem_interface(const machine_config &mconfig, device_t &device) : + device_interface(device, "bbcmodem") +{ + m_slot = dynamic_cast<bbc_modem_slot_device *>(device.owner()); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_modem_slot_device - constructor +//------------------------------------------------- + +bbc_modem_slot_device::bbc_modem_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, BBC_MODEM_SLOT, tag, owner, clock) + , device_single_card_slot_interface<device_bbc_modem_interface>(mconfig, *this) + , m_card(nullptr) + , m_irq_handler(*this) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_modem_slot_device::device_start() +{ + m_card = get_card_device(); + + // resolve callbacks + m_irq_handler.resolve_safe(); +} + + +//------------------------------------------------- +// read +//------------------------------------------------- + +uint8_t bbc_modem_slot_device::read(offs_t offset) +{ + if (m_card) + return m_card->read(offset & 0x0f); + else + return 0xfe; +} + +//------------------------------------------------- +// write +//------------------------------------------------- + +void bbc_modem_slot_device::write(offs_t offset, uint8_t data) +{ + if (m_card) + m_card->write(offset & 0x0f, data); +} + +//------------------------------------------------- +// SLOT_INTERFACE( bbcm_modem_devices ) +//------------------------------------------------- + + +// slot devices +#include "scsiaiv.h" + + +void bbcm_modem_devices(device_slot_interface &device) +{ + //device.option_add("modem", BBC_MODEM); /* Beebug Master Modem */ + device.option_add("scsiaiv", BBC_SCSIAIV); /* Acorn AIV SCSI Host Adaptor */ + //device.option_add("vp415", BBC_VP415); /* Philips VP415 */ +} diff --git a/src/devices/bus/bbc/modem/modem.h b/src/devices/bus/bbc/modem/modem.h new file mode 100644 index 00000000000..6c1e7840637 --- /dev/null +++ b/src/devices/bus/bbc/modem/modem.h @@ -0,0 +1,105 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + BBC Master Internal Modem port + +********************************************************************** + + Pinout: + + 1 NIRQ + 2 NRST + 3 BD0 + 4 BD1 + 5 BD2 + 6 BD3 + 7 BD4 + 8 BD5 + 9 BD6 + 10 BD7 + 11 MODEM + 12 A0 + 13 A1 + 14 A2 + 15 A3 + 16 1MHzE + 17 R/W + 18 +5V + 19 -5V + 20 0V + +**********************************************************************/ + +#ifndef MAME_BUS_BBC_MODEM_MODEM_H +#define MAME_BUS_BBC_MODEM_MODEM_H + +#pragma once + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> bbc_modem_slot_device + +class device_bbc_modem_interface; + +class bbc_modem_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_modem_interface> +{ +public: + // construction/destruction + template <typename T> + bbc_modem_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&slot_options, const char *default_option) + : bbc_modem_slot_device(mconfig, tag, owner, clock) + { + option_reset(); + slot_options(*this); + set_default_option(default_option); + set_fixed(false); + } + + bbc_modem_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); + + // callbacks + auto irq_handler() { return m_irq_handler.bind(); } + + virtual uint8_t read(offs_t offset); + virtual void write(offs_t offset, uint8_t data); + + DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); } + +protected: + // device-level overrides + virtual void device_start() override; + + device_bbc_modem_interface *m_card; + +private: + devcb_write_line m_irq_handler; +}; + + +// ======================> device_bbc_modem_interface + +class device_bbc_modem_interface : public device_interface +{ +public: + virtual uint8_t read(offs_t offset) { return 0xff; } + virtual void write(offs_t offset, uint8_t data) { } + +protected: + device_bbc_modem_interface(const machine_config &mconfig, device_t &device); + + bbc_modem_slot_device *m_slot; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_MODEM_SLOT, bbc_modem_slot_device) + +void bbcm_modem_devices(device_slot_interface &device); + + +#endif // MAME_BUS_BBC_MODEM_MODEM_H diff --git a/src/devices/bus/bbc/modem/scsiaiv.cpp b/src/devices/bus/bbc/modem/scsiaiv.cpp new file mode 100644 index 00000000000..603b36c9a8a --- /dev/null +++ b/src/devices/bus/bbc/modem/scsiaiv.cpp @@ -0,0 +1,142 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AIV SCSI Host Adaptor + +**********************************************************************/ + +#include "emu.h" +#include "scsiaiv.h" +#include "machine/nscsi_bus.h" +#include "bus/nscsi/devices.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_SCSIAIV, bbc_scsiaiv_device, "bbc_scsiaiv", "Acorn AIV SCSI Host Adaptor"); +//DEFINE_DEVICE_TYPE(BBC_VP415, bbc_vp415_device, "bbc_vp415", "BBC Philips VP415"); + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void bbc_scsiaiv_device::device_add_mconfig(machine_config& config) +{ + NSCSI_BUS(config, "scsi"); + NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:7", default_scsi_devices, "scsicb", true) + .option_add_internal("scsicb", NSCSI_CB) + .machine_config([this](device_t* device) { + downcast<nscsi_callback_device&>(*device).bsy_callback().set(*this, FUNC(bbc_scsiaiv_device::bsy_w)); + downcast<nscsi_callback_device&>(*device).req_callback().set(*this, FUNC(bbc_scsiaiv_device::req_w)); + }); +} + +//void bbc_vp415_device::device_add_mconfig(machine_config& config) +//{ +// bbc_scsiaiv_device::device_add_mconfig(config); +// +// /* Philips VP415 */ +// subdevice<nscsi_connector>("scsi:0")->set_default_option("vp415"); +// subdevice<nscsi_connector>("scsi:0")->set_fixed(true); +//} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_scsiaiv_device - constructor +//------------------------------------------------- + +bbc_scsiaiv_device::bbc_scsiaiv_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_bbc_modem_interface(mconfig, *this) + , m_scsi(*this, "scsi:7:scsicb") +{ +} + +bbc_scsiaiv_device::bbc_scsiaiv_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : bbc_scsiaiv_device(mconfig, BBC_SCSIAIV, tag, owner, clock) +{ +} + +//bbc_vp415_device::bbc_vp415_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) +// : bbc_scsiaiv_device(mconfig, BBC_VP415, tag, owner, clock) +//{ +//} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_scsiaiv_device::device_start() +{ + /* register for save states */ + save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_state)); +} + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t bbc_scsiaiv_device::read(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset & 0x07) + { + case 0x00: + data = m_scsi->read(); + m_scsi->ack_w(1); + break; + case 0x01: + data = (m_scsi->msg_r() << 0) + | (m_scsi->bsy_r() << 1) + | (m_scsi->rst_r() << 2) + | (!m_irq_state << 4) + | (m_scsi->req_r() << 5) + | (m_scsi->io_r() << 6) + | (m_scsi->cd_r() << 7); + break; + } + + return data; +} + +void bbc_scsiaiv_device::write(offs_t offset, uint8_t data) +{ + switch (offset & 0x07) + { + case 0x00: + m_scsi->write(~data); + m_scsi->ack_w(1); + break; + case 0x02: + m_scsi->sel_w(1); + break; + case 0x03: + m_irq_enable = BIT(data, 0); + break; + } +} + +WRITE_LINE_MEMBER(bbc_scsiaiv_device::bsy_w) +{ + m_scsi->sel_w(0); +} + +WRITE_LINE_MEMBER(bbc_scsiaiv_device::req_w) +{ + m_scsi->ack_w(0); + + m_irq_state = (m_irq_enable && !state) ? 0 : 1; + m_slot->irq_w(m_irq_state ? CLEAR_LINE : ASSERT_LINE); +} diff --git a/src/devices/bus/bbc/modem/scsiaiv.h b/src/devices/bus/bbc/modem/scsiaiv.h new file mode 100644 index 00000000000..0b244bb71e3 --- /dev/null +++ b/src/devices/bus/bbc/modem/scsiaiv.h @@ -0,0 +1,71 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AIV SCSI Host Adaptor + +**********************************************************************/ + + +#ifndef MAME_BUS_BBC_1MHZBUS_SCSIAIV_H +#define MAME_BUS_BBC_1MHZBUS_SCSIAIV_H + +#include "modem.h" +#include "machine/nscsi_cb.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class bbc_scsiaiv_device: + public device_t, + public device_bbc_modem_interface +{ +public: + // construction/destruction + bbc_scsiaiv_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock); + + DECLARE_WRITE_LINE_MEMBER(bsy_w); + DECLARE_WRITE_LINE_MEMBER(req_w); + +protected: + bbc_scsiaiv_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock); + + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config& config) override; + + virtual uint8_t read(offs_t offset) override; + virtual void write(offs_t offset, uint8_t data) override; + +private: + required_device<nscsi_callback_device> m_scsi; + + int m_irq_enable; + int m_irq_state; +}; + + +// ======================> bbc_vp415_device + +//class bbc_vp415_device : public bbc_scsiaiv_device +//{ +//public: +// // construction/destruction +// bbc_vp415_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock); +// +//protected: +// // optional information overrides +// virtual void device_add_mconfig(machine_config& config) override; +//}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_SCSIAIV, bbc_scsiaiv_device); +//DECLARE_DEVICE_TYPE(BBC_VP415, bbc_vp415_device); + + +#endif /* MAME_BUS_BBC_1MHZBUS_SCSIAIV_H */ diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp index e6672ff776c..ed7012900ee 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -57,7 +57,7 @@ void pc9801_86_device::pc9801_86_config(machine_config &config) // OPL4 YMF278 + YRW801 (U21 + U22) // TC55257CFL-10 (U15) // unknown chip (most likely surface scratched) U3) - + SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); YM2608(config, m_opna, 7.987_MHz_XTAL); // actually YM2608B diff --git a/src/devices/bus/coco/coco_dwsock.cpp b/src/devices/bus/coco/coco_dwsock.cpp index 049b3e658ca..252f701cebd 100644 --- a/src/devices/bus/coco/coco_dwsock.cpp +++ b/src/devices/bus/coco/coco_dwsock.cpp @@ -3,8 +3,8 @@ #include "emu.h" #include "coco_dwsock.h" -#include <stdio.h> -#include <stdlib.h> +#include <cstdio> +#include <cstdlib> #ifdef __GNUC__ #include <unistd.h> #endif diff --git a/src/devices/bus/hexbus/hexbus.cpp b/src/devices/bus/hexbus/hexbus.cpp index 768910752a2..0b8d7821cb6 100644 --- a/src/devices/bus/hexbus/hexbus.cpp +++ b/src/devices/bus/hexbus/hexbus.cpp @@ -150,7 +150,8 @@ // Devices #include "hx5102.h" -#define LOG_WRITE (1U<<1) // Write operation +#define LOG_LINES (1U<<1) // Line changes +#define LOG_ENABLED (1U<<2) // Enabled #define VERBOSE ( LOG_GENERAL ) @@ -222,10 +223,11 @@ uint8_t hexbus_device::read(int dir) hexbus_chained_device::hexbus_chained_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock): device_t(mconfig, type, tag, owner, clock), - device_hexbus_interface(mconfig, *this) + device_hexbus_interface(mconfig, *this), + m_enabled(false), + m_myvalue(0xff) { m_hexbus_inbound = dynamic_cast<hexbus_device *>(owner); - m_myvalue = 0xff; } void hexbus_chained_device::device_start() @@ -242,21 +244,31 @@ void hexbus_chained_device::device_start() */ void hexbus_chained_device::hexbus_write(uint8_t data) { + uint8_t oldvalue = m_myvalue; m_myvalue = data; + set_communication_enabled(true); uint8_t otherval = hexbus_get_levels(); - // LOGMASKED(LOG_WRITE, ".. otherval=%02x\n", otherval); - // What is the new bus level? // The data lines are not supposed to be set by multiple devices // We assume that sending data overrides all data line levels. // This is emulated by pulling the data lines to ones. uint8_t newvalue = (otherval | 0xc3) & m_myvalue; + if (hsk_line(oldvalue)==ASSERT_LINE && own_hsk_level()==CLEAR_LINE) + LOGMASKED(LOG_LINES, "Release HSK*\n"); + + bool hsk_changed = (hsk_line(newvalue) != hsk_line(m_current_bus_value)); + bool bav_changed = (bav_line(newvalue) != bav_line(m_current_bus_value)); + // If it changed (with respect to HSK* or BAV*), propagate to both directions. - if ((newvalue & (HEXBUS_LINE_HSK | HEXBUS_LINE_BAV)) != (m_current_bus_value & (HEXBUS_LINE_HSK | HEXBUS_LINE_BAV))) + if (hsk_changed || bav_changed) { - LOGMASKED(LOG_WRITE, "Trying to write %02x, actually: %02x (current=%02x)\n", data, newvalue, m_current_bus_value); + if (hsk_changed && own_hsk_level()==ASSERT_LINE) + LOGMASKED(LOG_LINES, "Pull down HSK*, send data=%x\n", data_lines(m_myvalue)); + + if (bav_changed) + LOGMASKED(LOG_LINES, "%s BAV*\n", (own_bav_level()==ASSERT_LINE)? "Pull down" : "Release"); m_current_bus_value = newvalue; @@ -265,9 +277,38 @@ void hexbus_chained_device::hexbus_write(uint8_t data) if (m_hexbus_outbound != nullptr) m_hexbus_outbound->write(OUTBOUND, m_current_bus_value); - } - else LOGMASKED(LOG_WRITE, "No change on hexbus\n"); +} + +/* + Assert or release the HSK* line. +*/ +void hexbus_chained_device::set_hsk_line(line_state level) +{ + if (level==ASSERT_LINE) + hexbus_write(m_myvalue & ~HEXBUS_LINE_HSK); + else + hexbus_write(m_myvalue | HEXBUS_LINE_HSK); +} + +/* + Assert or release the BAV* line. +*/ +void hexbus_chained_device::set_bav_line(line_state level) +{ + if (level==ASSERT_LINE) + hexbus_write(m_myvalue & ~HEXBUS_LINE_BAV); + else + hexbus_write(m_myvalue | HEXBUS_LINE_BAV); +} + +void hexbus_chained_device::set_data_latch(int value, int pos) +{ + const uint8_t hexbval[4] = { 0x01, 0x02, 0x40, 0x80 }; + if (value==0) + m_myvalue &= ~hexbval[pos]; + else + m_myvalue |= hexbval[pos]; } /* @@ -325,17 +366,45 @@ void hexbus_chained_device::bus_write(int dir, uint8_t data) uint8_t oldvalue = m_current_bus_value; m_current_bus_value = data; + // When disabled, just propagate, and then return + if (!m_enabled) return; + + bool hsk_changed = (hsk_line(data) != hsk_line(oldvalue)); + // Notify device // Caution: Calling hexbus_value_changed may cause further activities that change the bus again // Data changes alone shall not trigger the callback - if ((data & (HEXBUS_LINE_HSK | HEXBUS_LINE_BAV)) != (oldvalue & (HEXBUS_LINE_HSK | HEXBUS_LINE_BAV))) + if (hsk_changed || (bav_line(data) != bav_line(oldvalue))) { - LOGMASKED(LOG_WRITE, "Hexbus value changed: %02x -> %02x\n", oldvalue, data); + if (hsk_changed) + { + if (hsk_line(data)==ASSERT_LINE) LOGMASKED(LOG_LINES, "Sense HSK*=0, got data=%x\n", data_lines(data)); + else + { + LOGMASKED(LOG_LINES, "Sense HSK*=1\n"); + // According to [1], HSK* going high writes ones into the data latch + m_myvalue |= 0xc3; + } + } + else LOGMASKED(LOG_LINES, "Sense BAV*=%d\n", bav_line(data)==CLEAR_LINE? 1:0); + hexbus_value_changed(data); } } /* + Enable or disable this component. +*/ +void hexbus_chained_device::set_communication_enabled(bool set) +{ + if (m_enabled != set) + LOGMASKED(LOG_ENABLED, "Hexbus listen %s\n", set? "enabled" : "disabled"); + m_enabled = set; + + if (!m_enabled) m_myvalue = 0xff; +} + +/* Convenience function to calculate the bus value. Used by subclasses. */ uint8_t hexbus_chained_device::to_line_state(uint8_t data, bool bav, bool hsk) @@ -346,6 +415,15 @@ uint8_t hexbus_chained_device::to_line_state(uint8_t data, bool bav, bool hsk) return lines; } +/* + Convenience function to get a data bit. +*/ +int hexbus_chained_device::data_bit(int n) +{ + const uint8_t testbit[4] = { 0x01, 0x02, 0x40, 0x80 }; + return (m_current_bus_value & testbit[n&3])? 1:0; +} + // ------------------------------------------------------------------------ } } // end namespace bus::hexbus diff --git a/src/devices/bus/hexbus/hexbus.h b/src/devices/bus/hexbus/hexbus.h index 3db73cdb8ea..76092c0f16f 100644 --- a/src/devices/bus/hexbus/hexbus.h +++ b/src/devices/bus/hexbus/hexbus.h @@ -27,9 +27,7 @@ enum enum { HEXBUS_LINE_HSK = 0x10, - HEXBUS_LINE_BAV = 0x04, - HEXBUS_LINE_BIT32 = 0xc0, - HEXBUS_LINE_BIT10 = 0x03 + HEXBUS_LINE_BAV = 0x04 }; class hexbus_device; @@ -91,11 +89,47 @@ protected: // Callback for changes on the hexbus virtual void hexbus_value_changed(uint8_t data) { } + // Enable or disable the Hexbus component + bool m_enabled; + void set_communication_enabled(bool set); + // Levels of the lines at this device. 0 means pull down, 1 means release. uint8_t m_myvalue; - // Utility method to create a Hexbus line state - uint8_t to_line_state(uint8_t data, bool bav, bool hsk); + // Set or release the HSK* and BAV* lines + void set_hsk_line(line_state level); + void set_bav_line(line_state level); + + // Set the data latch for upcoming transmission + void set_data_latch(int value, int pos); + + // Convenience method to create a Hexbus line state + static uint8_t to_line_state(uint8_t data, bool bav, bool hsk); + + // Latch HSK*=0 + void latch_hsk() { m_myvalue &= ~HEXBUS_LINE_HSK; } + + // Convenience function to check HSK/BAV lines on given values + static line_state hsk_line(uint8_t lines) { return (lines & HEXBUS_LINE_HSK)? CLEAR_LINE : ASSERT_LINE; } + static line_state bav_line(uint8_t lines) { return (lines & HEXBUS_LINE_BAV)? CLEAR_LINE : ASSERT_LINE; } + + // Return the HSK* level on the bus + line_state bus_hsk_level() { return hsk_line(m_current_bus_value); } + + // Return the BAV* level on the bus + line_state bus_bav_level() { return bav_line(m_current_bus_value); } + + // Return the HSK* level from this device + line_state own_hsk_level() { return hsk_line(m_myvalue); } + + // Return the BAV* level from this device + line_state own_bav_level() { return bav_line(m_myvalue); } + + // Data lines + static int data_lines(uint8_t lines) { return (((lines & 0xc0) >> 4) | (lines & 0x03)); } + + // Return the selected data bit (0-3) + int data_bit(int n); }; // ------------------------------------------------------------------------ diff --git a/src/devices/bus/hexbus/hx5102.cpp b/src/devices/bus/hexbus/hx5102.cpp index 0cfd70c7dac..6730c5dd453 100644 --- a/src/devices/bus/hexbus/hx5102.cpp +++ b/src/devices/bus/hexbus/hx5102.cpp @@ -432,7 +432,7 @@ WRITE8_MEMBER(hx5102_device::ibc_write) WRITE8_MEMBER(hx5102_device::hexbus_out) { - LOGMASKED(LOG_HEXBUS, "hexbus out: %02x\n", data); + LOGMASKED(LOG_HEXBUS, "Write to hexbus: BAV*=%d, HSK*=%d, data=%x\n", bav_line(data)==ASSERT_LINE? 0:1, hsk_line(data)==ASSERT_LINE? 0:1, data_lines(data)); // Get the other levels and set our own states uint8_t newlevel = hexbus_get_levels() & data; diff --git a/src/devices/bus/hexbus/tp0370.cpp b/src/devices/bus/hexbus/tp0370.cpp index 5c620a47bd3..f3c1d027f5b 100644 --- a/src/devices/bus/hexbus/tp0370.cpp +++ b/src/devices/bus/hexbus/tp0370.cpp @@ -177,7 +177,11 @@ READ8_MEMBER( ibc_device::read ) if (m_bav) status |= 0x20; if (m_hsk) status |= 0x10; - LOGMASKED(LOG_STATUS, "Status -> %02x\n", status); + if (status != m_last_status) + { + LOGMASKED(LOG_STATUS, "Status -> %02x\n", status); + m_last_status = status; + } // Reset flag m_message_started = false; @@ -246,7 +250,7 @@ void ibc_device::set_lines(bool bav, bool hsk) uint8_t val = (m_transmit & 0xc0)|((m_transmit & 0x30)>>4); if (!bav) val |= 0x04; if (!hsk) val |= 0x10; - if (m_transmit != 0xff) LOGMASKED(LOG_LINES, "Data = %01x\n", m_transmit>>4); + if (hsk) LOGMASKED(LOG_LINES, "Data = %01x\n", m_transmit>>4); m_hexout(val); } diff --git a/src/devices/bus/hexbus/tp0370.h b/src/devices/bus/hexbus/tp0370.h index 385059c7fa3..b17c2f997d4 100644 --- a/src/devices/bus/hexbus/tp0370.h +++ b/src/devices/bus/hexbus/tp0370.h @@ -63,6 +63,8 @@ private: uint8_t m_data; uint8_t m_transmit; + uint8_t m_last_status; + void set_disable_inhibit(bool dis, bool inh); void set_lines(bool bav, bool hsk); }; diff --git a/src/devices/bus/intv/voice.cpp b/src/devices/bus/intv/voice.cpp index b8b07d84d34..8f5e542b0e2 100644 --- a/src/devices/bus/intv/voice.cpp +++ b/src/devices/bus/intv/voice.cpp @@ -98,7 +98,7 @@ const tiny_rom_entry *intv_voice_device::device_rom_region() const uint16_t intv_voice_device::read_speech(offs_t offset) { - return 0xff00 | m_speech->spb640_r(offset); + return m_speech->spb640_r(offset); } /*------------------------------------------------- @@ -107,7 +107,7 @@ uint16_t intv_voice_device::read_speech(offs_t offset) void intv_voice_device::write_speech(offs_t offset, uint16_t data) { - m_speech->spb640_w(offset, data & 0x00ff); + m_speech->spb640_w(offset, data); } diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp index 5d56e949380..df21453268f 100644 --- a/src/devices/bus/isa/isa.cpp +++ b/src/devices/bus/isa/isa.cpp @@ -125,6 +125,7 @@ isa8_device::isa8_device(const machine_config &mconfig, device_type type, const m_out_drq1_cb(*this), m_out_drq2_cb(*this), m_out_drq3_cb(*this), + m_write_iochrdy(*this), m_write_iochck(*this) { std::fill(std::begin(m_dma_device), std::end(m_dma_device), nullptr); @@ -223,6 +224,7 @@ void isa8_device::device_config_complete() void isa8_device::device_resolve_objects() { // resolve callbacks + m_write_iochrdy.resolve_safe(); m_write_iochck.resolve_safe(); m_out_irq2_cb.resolve_safe(); @@ -407,6 +409,11 @@ void isa8_device::eop_w(int channel, int state) m_dma_device[channel]->eop_w(state); } +void isa8_device::set_ready(int state) +{ + m_write_iochrdy(state); +} + void isa8_device::nmi() { // active low pulse diff --git a/src/devices/bus/isa/isa.h b/src/devices/bus/isa/isa.h index 7994f4c892a..4eefa1ff548 100644 --- a/src/devices/bus/isa/isa.h +++ b/src/devices/bus/isa/isa.h @@ -125,6 +125,7 @@ public: // inline configuration template <typename T> void set_memspace(T &&tag, int spacenum) { m_memspace.set_tag(std::forward<T>(tag), spacenum); } template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); } + auto iochrdy_callback() { return m_write_iochrdy.bind(); } auto iochck_callback() { return m_write_iochck.bind(); } auto irq2_callback() { return m_out_irq2_cb.bind(); } auto irq3_callback() { return m_out_irq3_cb.bind(); } @@ -181,6 +182,7 @@ public: void dack_line_w(int line, int state); void eop_w(int channels, int state); + void set_ready(int state); void nmi(); virtual void set_dma_channel(uint8_t channel, device_isa8_card_interface *dev, bool do_eop); @@ -222,6 +224,7 @@ protected: std::forward_list<device_slot_interface *> m_slot_list; private: + devcb_write_line m_write_iochrdy; devcb_write_line m_write_iochck; }; diff --git a/src/devices/bus/isa/mc1502_fdc.cpp b/src/devices/bus/isa/mc1502_fdc.cpp index 1760f602115..e533b82626a 100644 --- a/src/devices/bus/isa/mc1502_fdc.cpp +++ b/src/devices/bus/isa/mc1502_fdc.cpp @@ -86,7 +86,8 @@ void mc1502_fdc_device::mc1502_wd17xx_aux_w(uint8_t data) floppy_image_device *floppy = ((data & 0x10) ? floppy1 : floppy0); // master reset - if ((data & 1) == 0) m_fdc->reset(); + if ((data & 1) == 0) + m_fdc->reset(); m_fdc->set_floppy(floppy); @@ -109,13 +110,11 @@ void mc1502_fdc_device::mc1502_wd17xx_aux_w(uint8_t data) */ uint8_t mc1502_fdc_device::mc1502_wd17xx_drq_r() { - cpu_device *maincpu = machine().device<cpu_device>("maincpu"); - if (!m_fdc->drq_r() && !m_fdc->intrq_r()) { // fake cpu wait by resetting PC one insn back - maincpu->set_state_int(I8086_IP, maincpu->state_int(I8086_IP) - 1); - maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_cpu->set_state_int(I8086_IP, m_cpu->state_int(I8086_IP) - 1); + m_isa->set_ready(ASSERT_LINE); // assert I/O CH RDY } return m_fdc->drq_r(); @@ -128,9 +127,8 @@ uint8_t mc1502_fdc_device::mc1502_wd17xx_motor_r() WRITE_LINE_MEMBER(mc1502_fdc_device::mc1502_fdc_irq_drq) { - cpu_device *maincpu = machine().device<cpu_device>("maincpu"); - - if (state) maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + if (state) + m_isa->set_ready(CLEAR_LINE); // deassert I/O CH RDY } READ8_MEMBER(mc1502_fdc_device::mc1502_fdc_r) @@ -193,6 +191,7 @@ mc1502_fdc_device::mc1502_fdc_device(const machine_config &mconfig, const char * , m_fdc(*this, "fdc") , motor_on(0) , motor_timer(nullptr) + , m_cpu(*this, finder_base::DUMMY_TAG) { } diff --git a/src/devices/bus/isa/mc1502_fdc.h b/src/devices/bus/isa/mc1502_fdc.h index 57edc2d3a9c..5689409e63e 100644 --- a/src/devices/bus/isa/mc1502_fdc.h +++ b/src/devices/bus/isa/mc1502_fdc.h @@ -27,6 +27,8 @@ public: // construction/destruction mc1502_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <typename T> + void set_cpu(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); } TIMER_CALLBACK_MEMBER(motor_callback); @@ -50,6 +52,7 @@ private: required_device<fd1793_device> m_fdc; int motor_on; emu_timer *motor_timer; + required_device<cpu_device> m_cpu; public: void mc1502_wd17xx_aux_w(uint8_t data); diff --git a/src/devices/bus/isa/p1_fdc.cpp b/src/devices/bus/isa/p1_fdc.cpp index 5d3b25b3d5a..822a14f1e27 100644 --- a/src/devices/bus/isa/p1_fdc.cpp +++ b/src/devices/bus/isa/p1_fdc.cpp @@ -81,13 +81,11 @@ uint8_t p1_fdc_device::p1_wd17xx_motor_r() uint8_t p1_fdc_device::p1_wd17xx_aux_r() { - cpu_device *maincpu = machine().device<cpu_device>("maincpu"); - if (!m_fdc->drq_r() && !m_fdc->intrq_r()) { // fake cpu wait by resetting PC one insn back - maincpu->set_state_int(I8086_IP, maincpu->state_int(I8086_IP) - 2); - maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_cpu->set_state_int(I8086_IP, m_cpu->state_int(I8086_IP) - 2); + m_isa->set_ready(ASSERT_LINE); // assert I/O CH RDY } return m_fdc->drq_r(); @@ -109,7 +107,8 @@ void p1_fdc_device::p1_wd17xx_aux_w(int data) floppy_image_device *floppy1 = m_fdc->subdevice<floppy_connector>("1")->get_device(); floppy_image_device *floppy = ((data & 2) ? floppy1 : floppy0); - if (!BIT(data, 6)) m_fdc->reset(); + if (!BIT(data, 6)) + m_fdc->reset(); m_fdc->set_floppy(floppy); @@ -122,9 +121,8 @@ void p1_fdc_device::p1_wd17xx_aux_w(int data) WRITE_LINE_MEMBER(p1_fdc_device::p1_fdc_irq_drq) { - cpu_device *maincpu = machine().device<cpu_device>("maincpu"); - - if (state) maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + if (state) + m_isa->set_ready(CLEAR_LINE); // deassert I/O CH RDY } READ8_MEMBER(p1_fdc_device::p1_fdc_r) @@ -162,6 +160,7 @@ p1_fdc_device::p1_fdc_device(const machine_config &mconfig, const char *tag, dev : device_t(mconfig, P1_FDC, tag, owner, clock) , device_isa8_card_interface(mconfig, *this) , m_fdc(*this, "fdc") + , m_cpu(*this, finder_base::DUMMY_TAG) { } diff --git a/src/devices/bus/isa/p1_fdc.h b/src/devices/bus/isa/p1_fdc.h index 58a4532b96d..d2c5e4605e7 100644 --- a/src/devices/bus/isa/p1_fdc.h +++ b/src/devices/bus/isa/p1_fdc.h @@ -27,6 +27,9 @@ public: // construction/destruction p1_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <typename T> + void set_cpu(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); } + DECLARE_READ8_MEMBER(p1_fdc_r); DECLARE_WRITE8_MEMBER(p1_fdc_w); @@ -45,6 +48,7 @@ private: DECLARE_WRITE_LINE_MEMBER(p1_fdc_irq_drq); required_device<fd1793_device> m_fdc; + required_device<cpu_device> m_cpu; public: void p1_wd17xx_aux_w(int data); diff --git a/src/devices/bus/isa/s3virge.cpp b/src/devices/bus/isa/s3virge.cpp index 959e9a2e79f..d24e0893fb0 100644 --- a/src/devices/bus/isa/s3virge.cpp +++ b/src/devices/bus/isa/s3virge.cpp @@ -85,10 +85,19 @@ void s3virge_vga_device::device_start() save_pointer(vga.attribute.data,"Attribute Registers", 0x15); m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this)); + m_draw_timer = timer_alloc(TIMER_DRAW_STEP); memset(&s3, 0, sizeof(s3)); memset(&s3virge, 0, sizeof(s3virge)); s3virge.linear_address = 0x70000000; + s3virge.s3d.cmd_fifo_slots_free = 16; + save_pointer(s3virge.s3d.pattern,"S3D Pattern Data", 0xc0); + save_pointer(s3virge.s3d.reg[0],"S3D Registers: BitBLT",0x100); + save_pointer(s3virge.s3d.reg[1],"S3D Registers: 2D Line",0x100); + save_pointer(s3virge.s3d.reg[2],"S3D Registers: 2D Polygon",0x100); + save_pointer(s3virge.s3d.reg[3],"S3D Registers: 3D Line",0x100); + save_pointer(s3virge.s3d.reg[4],"S3D Registers: 3D Triangle",0x100); + // Initialise hardware graphics cursor colours, Windows 95 doesn't touch the registers for some reason for(x=0;x<4;x++) { @@ -149,6 +158,13 @@ void s3virgedx_rev1_vga_device::device_reset() s3.strapping = 0x0aff0912; } +uint16_t s3virge_vga_device::offset() +{ + if(svga.rgb24_en) + return vga.crtc.offset * 6; // special handling for 24bpp packed mode + return s3_vga_device::offset(); +} + uint8_t s3virge_vga_device::s3_crtc_reg_read(uint8_t index) { uint8_t res; @@ -315,13 +331,13 @@ void s3virge_vga_device::s3_define_video_mode() svga.rgb8_en = 0; svga.rgb15_en = 0; svga.rgb16_en = 0; - svga.rgb32_en = 0; + svga.rgb24_en = 0; switch((s3.ext_misc_ctrl_2) >> 4) { case 0x01: svga.rgb8_en = 1; break; case 0x03: svga.rgb15_en = 1; divisor = 2; break; case 0x05: svga.rgb16_en = 1; divisor = 2; break; - case 0x0d: svga.rgb32_en = 1; divisor = 1; break; + case 0x0d: svga.rgb24_en = 1; divisor = 1; break; default: fatalerror("TODO: s3 video mode not implemented %02x\n",((s3.ext_misc_ctrl_2) >> 4)); } } @@ -330,9 +346,9 @@ void s3virge_vga_device::s3_define_video_mode() svga.rgb8_en = (s3.cr3a & 0x10) >> 4; svga.rgb15_en = 0; svga.rgb16_en = 0; - svga.rgb32_en = 0; + svga.rgb24_en = 0; } - if(s3.cr43 & 0x80) // Horizontal clock doubling (techincally, doubles horizontal CRT parameters) + if(s3.cr43 & 0x80) // Horizontal clock doubling (technically, doubles horizontal CRT parameters) divisor *= 2; recompute_params_clock(divisor, xtal.value()); } @@ -394,10 +410,10 @@ void s3virge_vga_device::s3_crtc_reg_write(uint8_t index, uint8_t data) case 0x43: s3.cr43 = data; // bit 2 = bit 8 of offset register, but only if bits 4-5 of CR51 are 00h. if((s3.cr51 & 0x30) == 0) - { vga.crtc.offset = (vga.crtc.offset & 0x00ff) | ((data & 0x04) << 6); - s3_define_video_mode(); - } + else + vga.crtc.offset = (vga.crtc.offset & 0x00ff) | ((s3.cr51 & 0x30) << 4); + s3_define_video_mode(); break; /* 3d4h index 45h (R/W): CR45 Hardware Graphics Cursor Mode @@ -502,11 +518,13 @@ bit 0-9 (911,924) HCS_STADR. Hardware Graphics Cursor Storage Start Address (801/5,928) For Hi/True color modes use the Horizontal Stretch bits (3d4h index 45h bits 2 and 3). */ - case 0x4c: + case 0x4c: s3.cursor_start_addr = (s3.cursor_start_addr & 0x00ff) | (data << 8); + LOGREG("HW Cursor Address: %08x\n",s3.cursor_start_addr); break; case 0x4d: s3.cursor_start_addr = (s3.cursor_start_addr & 0xff00) | data; + LOGREG("HW Cursor Address: %08x\n",s3.cursor_start_addr); break; /* 3d4h index 4Eh (R/W): CR4E HGC Pattern Disp Start X-Pixel Position @@ -782,7 +800,7 @@ WRITE8_MEMBER(s3virge_vga_device::port_03d0_w) READ8_MEMBER(s3virge_vga_device::mem_r) { - if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en) + if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb24_en || svga.rgb32_en) { uint8_t data; if(offset & 0x10000) @@ -864,6 +882,502 @@ WRITE8_MEMBER(s3virge_vga_device::fb_w) vga.memory[offset % vga.svga_intf.vram_size] = data; } +void s3virge_vga_device::add_command(int cmd_type) +{ + // add command to S3D FIFO + if(s3virge.s3d.cmd_fifo_slots_free == 0) + { + LOGMMIO("Attempt to add command when all command slots are full\n"); + return; + } + memcpy(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_next_ptr].reg,s3virge.s3d.reg[cmd_type],256*4); + s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_next_ptr].op_type = cmd_type; + LOGMMIO("Added command type %i cmd %08x ptr %u\n",s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_next_ptr].op_type,s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_next_ptr].reg[S3D_REG_COMMAND],s3virge.s3d.cmd_fifo_next_ptr); + s3virge.s3d.cmd_fifo_next_ptr++; + if(s3virge.s3d.cmd_fifo_next_ptr >= 16) + s3virge.s3d.cmd_fifo_next_ptr = 0; + if(s3virge.s3d.cmd_fifo_slots_free == 16) // if all slots are free, start command now + command_start(); + s3virge.s3d.cmd_fifo_slots_free--; + // TODO: handle full FIFO +} + +void s3virge_vga_device::command_start() +{ + // start next command in FIFO + int cmd_type = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].op_type; + + switch(cmd_type) + { + case OP_BITBLT: + s3virge.s3d.state = S3D_STATE_BITBLT; + s3virge.s3d.busy = true; + s3virge.s3d.bitblt_x_src = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_RSRC_XY] & 0x07ff0000) >> 16; + s3virge.s3d.bitblt_y_src = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_RSRC_XY] & 0x000007ff); + s3virge.s3d.bitblt_x_dst = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_RDEST_XY] & 0x07ff0000) >> 16; + s3virge.s3d.bitblt_y_dst = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_RDEST_XY] & 0x000007ff); + s3virge.s3d.bitblt_width = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_RWIDTH_HEIGHT] & 0xffff0000) >> 16; + s3virge.s3d.bitblt_height = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_RWIDTH_HEIGHT] & 0x0000ffff); + s3virge.s3d.bitblt_x_current = s3virge.s3d.bitblt_x_dst; + s3virge.s3d.bitblt_x_src_current = s3virge.s3d.bitblt_x_src; + s3virge.s3d.bitblt_y_current = s3virge.s3d.bitblt_y_dst; + s3virge.s3d.bitblt_y_src_current = s3virge.s3d.bitblt_y_src; + s3virge.s3d.bitblt_pat_x = s3virge.s3d.bitblt_x_current % 8; + s3virge.s3d.bitblt_pat_y = s3virge.s3d.bitblt_y_current % 8; + s3virge.s3d.clip_r = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_CLIP_L_R] & 0x000007ff; + s3virge.s3d.clip_l = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_CLIP_L_R] & 0x07ff0000) >> 16; + s3virge.s3d.clip_b = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_CLIP_T_B] & 0x000007ff; + s3virge.s3d.clip_t = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_CLIP_T_B] & 0x07ff0000) >> 16; + if(!(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000080)) + m_draw_timer->adjust(attotime::from_nsec(250),0,attotime::from_nsec(250)); + s3virge.s3d.bitblt_step_count = 0; + s3virge.s3d.bitblt_mono_pattern = + s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_0] | (uint64_t)(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_1]) << 32; + s3virge.s3d.bitblt_current_pixel = 0; + s3virge.s3d.bitblt_pixel_pos = 0; + s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR] = 0xffffffff; // win31 never sets this? + LOGMMIO("Started BitBLT command [%u]\n", s3virge.s3d.cmd_fifo_current_ptr); + //if(((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x01fe0000) >> 17) == 0xf0) machine().debug_break(); + break; + } +} + +void s3virge_vga_device::command_finish() +{ + s3virge.s3d.state = S3D_STATE_IDLE; + s3virge.s3d.cmd_fifo_current_ptr++; + if(s3virge.s3d.cmd_fifo_current_ptr >= 16) + s3virge.s3d.cmd_fifo_current_ptr = 0; + s3virge.s3d.cmd_fifo_slots_free++; + if(s3virge.s3d.cmd_fifo_slots_free > 16) + s3virge.s3d.cmd_fifo_slots_free = 16; + m_draw_timer->adjust(attotime::never); + + // check if there is another command in the FIFO + if(s3virge.s3d.cmd_fifo_slots_free < 16) + command_start(); + else + s3virge.s3d.busy = false; + //machine().debug_break(); + LOGMMIO("Command finished [%u] (%u slots free)\n",s3virge.s3d.cmd_fifo_current_ptr,s3virge.s3d.cmd_fifo_slots_free); +} + +uint32_t s3virge_vga_device::GetROP(uint8_t rop, uint32_t src, uint32_t dst, uint32_t pat) +{ + uint32_t ret = 0; + + switch(rop) + { + case 0x00: // 0 + ret = 0; + break; + case 0x55: // Dn + ret = ~dst; + break; + case 0x5a: // DPx + ret = dst ^ pat; + break; + case 0x66: // DSx + ret = dst ^ src; + break; + case 0x88: // DSa + ret = dst & src; + break; + case 0xb8: // PSDPxax + ret = ((dst ^ pat) & src) ^ pat; +// machine().debug_break(); + break; + case 0xcc: + ret = src; + break; + case 0xf0: + ret = pat; + break; + case 0xff: // 1 + ret = 0xffffffff; + break; + default: + popmessage("Unimplemented ROP 0x%02x",rop); + } + + return ret; +} + +bool s3virge_vga_device::advance_pixel() +{ + bool xpos, ypos; + int16_t top, left, right, bottom; + // advance src/dst and pattern location + xpos = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x02000000; // X Positive + ypos = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x04000000; // Y Positive + if(xpos) + { + left = s3virge.s3d.bitblt_x_dst; + right = s3virge.s3d.bitblt_x_dst + s3virge.s3d.bitblt_width + 1; + s3virge.s3d.bitblt_x_current++; + s3virge.s3d.bitblt_x_src_current++; + s3virge.s3d.bitblt_pat_x++; + } + else + { + left = s3virge.s3d.bitblt_x_dst - s3virge.s3d.bitblt_width - 1; + right = s3virge.s3d.bitblt_x_dst; + s3virge.s3d.bitblt_x_current--; + s3virge.s3d.bitblt_x_src_current--; + s3virge.s3d.bitblt_pat_x--; +// machine().debug_break(); + } + if(ypos) + { + top = s3virge.s3d.bitblt_y_dst; + bottom = s3virge.s3d.bitblt_y_dst + s3virge.s3d.bitblt_height; + } + else + { + top = s3virge.s3d.bitblt_y_dst - s3virge.s3d.bitblt_height; + bottom = s3virge.s3d.bitblt_y_dst; + } + if(s3virge.s3d.bitblt_pat_x < 0 || s3virge.s3d.bitblt_pat_x >= 8) + s3virge.s3d.bitblt_pat_x = s3virge.s3d.bitblt_x_current % 8; + if((s3virge.s3d.bitblt_x_current >= right) || (s3virge.s3d.bitblt_x_current <= left)) + { + s3virge.s3d.bitblt_x_current = s3virge.s3d.bitblt_x_dst; + s3virge.s3d.bitblt_x_src_current = s3virge.s3d.bitblt_x_src; + if(ypos) + { + s3virge.s3d.bitblt_y_current++; + s3virge.s3d.bitblt_y_src_current++; + s3virge.s3d.bitblt_pat_y++; + } + else + { + s3virge.s3d.bitblt_y_current--; + s3virge.s3d.bitblt_y_src_current--; + s3virge.s3d.bitblt_pat_y--; + } + s3virge.s3d.bitblt_pat_x = s3virge.s3d.bitblt_x_current % 8; + if(s3virge.s3d.bitblt_pat_y >= 8 || s3virge.s3d.bitblt_pat_y < 0) + s3virge.s3d.bitblt_pat_y = s3virge.s3d.bitblt_y_current % 8; + logerror("SRC: %i,%i DST: %i,%i PAT: %i,%i Bounds: %i,%i,%i,%i\n", + s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,s3virge.s3d.bitblt_pat_x,s3virge.s3d.bitblt_pat_y, + left,right,top,bottom); + if((s3virge.s3d.bitblt_y_current >= bottom) || (s3virge.s3d.bitblt_y_current <= top)) + return true; + } + return false; +} + +void s3virge_vga_device::bitblt_step() +{ + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x40)) + bitblt_monosrc_step(); + else + bitblt_colour_step(); +} + +void s3virge_vga_device::bitblt_colour_step() +{ + // progress current BitBLT operation + // get source and destination addresses + uint32_t src_base = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_BASE] & 0x003ffff8; + uint32_t dst_base = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_BASE] & 0x003ffff8; + uint8_t pixel_size = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x0000001c) >> 2; + uint8_t rop = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x01fe0000) >> 17; + uint32_t src = 0; + uint32_t dst = 0; + uint32_t pat = 0; + int align = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x000000c00) >> 10; + int x; + bool done = false; + + switch(pixel_size) + { + case 0: // 8bpp + for(x=0;x<4;x++) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + src = s3virge.s3d.image_xfer >> (x*8); + else + src = read_pixel8(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x100) + { + pat = (s3virge.s3d.bitblt_mono_pattern & (1 << ((s3virge.s3d.bitblt_pat_y*8) + (7-s3virge.s3d.bitblt_pat_x))) + ? s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_FG_CLR] : s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR]); + } + else + pat = (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*8) + s3virge.s3d.bitblt_pat_x]) << 8; + dst = read_pixel8(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + write_pixel8(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, src, dst, pat) & 0xff); + done = advance_pixel(); + if(done) + { + command_finish(); + break; + } + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) && s3virge.s3d.bitblt_x_current == s3virge.s3d.bitblt_x_dst) + { + if(align == 2) // doubleword aligned, end here + break; + if(align == 1) // word aligned, move to next word + { + if(x < 2) + x = 2; + else + break; + } + } + } + break; + case 1: // 16bpp + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + src = s3virge.s3d.image_xfer; + else + src = read_pixel16(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + dst = read_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x100) + { + pat = (s3virge.s3d.bitblt_mono_pattern & (1 << ((s3virge.s3d.bitblt_pat_y*8) + (7-s3virge.s3d.bitblt_pat_x))) + ? s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_FG_CLR] : s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR]); + } + else + pat = s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*16) + (s3virge.s3d.bitblt_pat_x*2)] | (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*16) + (s3virge.s3d.bitblt_pat_x*2) + 1]) << 8; + write_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, src, dst, pat) & 0xffff); + done = advance_pixel(); + if(done) + { + command_finish(); + break; + } + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) && s3virge.s3d.bitblt_x_current == s3virge.s3d.bitblt_x_dst && align == 2) + break; // if a new line of an image transfer, and is dword aligned, stop here + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + src = s3virge.s3d.image_xfer >> 16; + else + src = read_pixel16(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + dst = read_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x100) + { + pat = (s3virge.s3d.bitblt_mono_pattern & (1 << ((s3virge.s3d.bitblt_pat_y*8) + (7-s3virge.s3d.bitblt_pat_x))) + ? s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_FG_CLR] : s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR]); + } + else + pat = s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*16) + (s3virge.s3d.bitblt_pat_x*2)] | (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*16) + (s3virge.s3d.bitblt_pat_x*2) + 1]) << 8; + write_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, src, dst, pat) & 0xffff); + if(advance_pixel()) + command_finish(); + break; + case 2: // 24bpp + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + { + src = s3virge.s3d.image_xfer; + for(x=0;x<4;x++) + { + s3virge.s3d.bitblt_current_pixel |= ((s3virge.s3d.image_xfer >> (x*8)) & 0xff) << s3virge.s3d.bitblt_pixel_pos*8; + s3virge.s3d.bitblt_pixel_pos++; + if(s3virge.s3d.bitblt_pixel_pos > 2) + { + s3virge.s3d.bitblt_pixel_pos = 0; + dst = read_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x100) + { + pat = (s3virge.s3d.bitblt_mono_pattern & (1 << ((s3virge.s3d.bitblt_pat_y*8) + (7-s3virge.s3d.bitblt_pat_x))) + ? s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_FG_CLR] : s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR]); + } + else + pat = s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*24) + (s3virge.s3d.bitblt_pat_x*3)] | (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*24) + (s3virge.s3d.bitblt_pat_x*3) + 1]) << 8 + | (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*24) + (s3virge.s3d.bitblt_pat_x*3) + 2]) << 16; + write_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.bitblt_current_pixel, dst, pat)); + s3virge.s3d.bitblt_current_pixel = 0; + done = advance_pixel(); + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) && s3virge.s3d.bitblt_x_current == s3virge.s3d.bitblt_x_dst) + { + if(align == 2) // doubleword aligned, end here + x = 4; + if(align == 1) // word aligned, move to next word + { + if(x < 2) + x = 2; + else + x = 4; + } + } + if(done) + command_finish(); + } + } + break; + } + else + { + src = read_pixel24(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + dst = read_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x100) + { + pat = (s3virge.s3d.bitblt_mono_pattern & (1 << ((s3virge.s3d.bitblt_pat_y*8) + (7-s3virge.s3d.bitblt_pat_x))) + ? s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_FG_CLR] : s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR]); + } + else + pat = s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*24) + (s3virge.s3d.bitblt_pat_x*3)] | (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*24) + (s3virge.s3d.bitblt_pat_x*3) + 1]) << 8 + | (s3virge.s3d.pattern[(s3virge.s3d.bitblt_pat_y*24) + (s3virge.s3d.bitblt_pat_x*3) + 2]) << 16; + } + write_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, src, dst, pat)); + if(advance_pixel()) + command_finish(); + break; + } + + s3virge.s3d.bitblt_step_count++; +} + +void s3virge_vga_device::bitblt_monosrc_step() +{ + // progress current monochrome source BitBLT operation + uint32_t src_base = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_BASE] & 0x003ffff8; + uint32_t dst_base = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_BASE] & 0x003ffff8; + uint8_t pixel_size = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x0000001c) >> 2; + uint8_t rop = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x01fe0000) >> 17; + uint32_t src = 0; + uint32_t dst = 0; + uint32_t pat = 0; + int align = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x000000c00) >> 10; + int x; + bool done = false; + + switch(pixel_size) + { + case 0: // 8bpp + for(x=31;x>=0;x--) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + src = bitswap<32>(s3virge.s3d.image_xfer,7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24); + else + src = read_pixel8(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + dst = read_pixel8(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + + if(src & (1 << x)) + write_pixel8(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_FG_CLR], dst, pat) & 0xff); + else if(!(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x200)) // only draw background colour if transparency is not set + write_pixel8(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_BG_CLR], dst, pat) & 0xff); + //printf("Pixel write(%i): X: %i Y: %i SRC: %04x DST: %04x PAT: %04x ROP: %02x\n",x,s3virge.s3d.bitblt_x_current, s3virge.s3d.bitblt_y_current, src, dst, pat, rop); + done = advance_pixel(); + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) && s3virge.s3d.bitblt_x_current == s3virge.s3d.bitblt_x_dst) + { + switch(align) + { + case 0: + x &= ~7; + break; + case 1: + x &= ~15; + break; + case 2: + x = -1; + break; + } + if(done) + { + command_finish(); + break; + } + } + } + break; + case 1: // 16bpp + for(x=31;x>=0;x--) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + src = bitswap<32>(s3virge.s3d.image_xfer,7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24); + else + src = read_pixel16(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + dst = read_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + + if(src & (1 << x)) + write_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_FG_CLR], dst, pat) & 0xffff); + else if(!(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x200)) // only draw background colour if transparency is not set + write_pixel16(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_BG_CLR], dst, pat) & 0xffff); + //printf("Pixel write(%i): X: %i Y: %i SRC: %04x DST: %04x PAT: %04x ROP: %02x\n",x,s3virge.s3d.bitblt_x_current, s3virge.s3d.bitblt_y_current, src, dst, pat, rop); + done = advance_pixel(); + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) && s3virge.s3d.bitblt_x_current == s3virge.s3d.bitblt_x_dst) + { + switch(align) + { + case 0: + x &= ~7; + break; + case 1: + x &= ~15; + break; + case 2: + x = -1; + break; + } + if(done) + { + command_finish(); + break; + } + } + } + break; + case 2: // 24bpp + for(x=31;x>=0;x--) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) + src = bitswap<32>(s3virge.s3d.image_xfer,7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24); + else + src = read_pixel24(src_base,s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current); + dst = read_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current); + + if(src & (1 << x)) + write_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_FG_CLR], dst, pat)); + else if(!(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x200)) // only draw background colour if transparency is not set + write_pixel24(dst_base,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,GetROP(rop, s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_SRC_BG_CLR], dst, pat)); + //printf("Pixel write(%i): X: %i Y: %i SRC: %04x DST: %04x PAT: %04x ROP: %02x\n",x,s3virge.s3d.bitblt_x_current, s3virge.s3d.bitblt_y_current, src, dst, pat, rop); + done = advance_pixel(); + if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x80) && s3virge.s3d.bitblt_x_current == s3virge.s3d.bitblt_x_dst) + { + switch(align) + { + case 0: + x &= ~7; + break; + case 1: + x &= ~15; + break; + case 2: + x = -1; + break; + } + if(done) + { + command_finish(); + break; + } + } + } + break; + } + + s3virge.s3d.bitblt_step_count++; +} + +void s3virge_vga_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + // TODO: S3D state timing + if(id == TIMER_DRAW_STEP) + { + switch(s3virge.s3d.state) + { + case S3D_STATE_IDLE: + m_draw_timer->adjust(attotime::zero); + break; + case S3D_STATE_BITBLT: + bitblt_step(); + break; + } + } +} + // 2D command register format - A500 (BitBLT), A900 (2D line), AD00 (2D Polygon) // bit 0 - Autoexecute, if set command is executed when the highest relevant register is written to (A50C / A97C / AD7C) // bit 1 - Enable hardware clipping @@ -885,7 +1399,16 @@ WRITE8_MEMBER(s3virge_vga_device::fb_w) READ32_MEMBER(s3virge_vga_device::s3d_sub_status_r) { - return 0x00003000; // S3D engine idle, all FIFO slots free + uint32_t res = 0x00000000; + + if(!s3virge.s3d.busy) + res |= 0x00002000; // S3d engine is idle + + //res |= (s3virge.s3d.cmd_fifo_slots_free << 8); + if(s3virge.s3d.cmd_fifo_slots_free == 16) + res |= 0x1f00; + + return res; } WRITE32_MEMBER(s3virge_vga_device::s3d_sub_control_w) @@ -895,99 +1418,68 @@ WRITE32_MEMBER(s3virge_vga_device::s3d_sub_control_w) LOGMMIO("Sub control = %08x\n", data); } +READ32_MEMBER(s3virge_vga_device::s3d_func_ctrl_r) +{ + uint32_t ret = 0; + + ret |= (s3virge.s3d.cmd_fifo_slots_free << 6); + return ret; +} + READ32_MEMBER(s3virge_vga_device::s3d_register_r) { uint32_t res = 0; - int op_type = (((offset*4) & 0x0f00) / 4) - 1; + int op_type = (((offset*4) & 0x1c00) >> 10) - 1; - switch(offset) - { - case 0x4d4/4: - case 0x8d4/4: - case 0xcd4/4: - res = s3virge.s3d.src_base[op_type]; - break; - case 0xad8/4: - case 0x8d8/4: - case 0xcd8/4: - res = s3virge.s3d.dest_base[op_type]; - break; - case 0x500/4: - case 0x900/4: - case 0xd00/4: - res = s3virge.s3d.command[op_type]; - break; - case 0x504/4: - res = s3virge.s3d.rect_height[op_type]; - res |= (s3virge.s3d.rect_width[op_type] << 16); - break; - case 0x508/4: - res = s3virge.s3d.source_y[op_type]; - res |= (s3virge.s3d.source_x[op_type] << 16); - break; - case 0x50c/4: - res = s3virge.s3d.dest_y[op_type]; - res |= (s3virge.s3d.dest_x[op_type] << 16); - break; - default: - res = 0xffffffff; - LOGMMIO("MMIO unknown/unused register read MM%04X\n", (offset*4)+0xa000); - } + // unused registers + if(offset < 0x100/4) + return 0; + if(offset >= 0x1c0/4 && offset < 0x400/4) + return 0; + + // handle BitBLT pattern registers + if((offset >= 0x100/4) && (offset < 0x1c0/4)) + return s3virge.s3d.pattern[offset - (0x100/4)]; + + res = s3virge.s3d.reg[op_type][((offset*4) & 0x03ff) / 4]; + LOGMMIO("MM%04X returning %08x\n", (offset*4)+0xa000, res); return res; } WRITE32_MEMBER(s3virge_vga_device::s3d_register_w) { - int op_type = (((offset*4) & 0x0f00) / 4) - 1; + int op_type = (((offset*4) & 0x1c00) >> 10) - 1; + + // unused registers + if(offset < 0x100/4) + return; + if(offset >= 0x1c0/4 && offset < 0x400/4) + return; + // handle BitBLT pattern registers + if((offset >= 0x100/4) && (offset < 0x1c0/4)) + { + //COMBINE_DATA(&s3virge.s3d.pattern[(offset*4) - (0x100/4)]); + s3virge.s3d.pattern[((offset - 0x100/4)*4)+3] = (data & 0xff000000) >> 24; + s3virge.s3d.pattern[((offset - 0x100/4)*4)+2] = (data & 0x00ff0000) >> 16; + s3virge.s3d.pattern[((offset - 0x100/4)*4)+1] = (data & 0x0000ff00) >> 8; + s3virge.s3d.pattern[((offset - 0x100/4)*4)] = (data & 0x000000ff); + return; + } + + s3virge.s3d.reg[op_type][((offset*4) & 0x03ff) / 4] = data; + LOGMMIO("MM%04X = %08x\n", (offset*4)+0xa000, data); switch(offset) { - case 0x4d4/4: - case 0x8d4/4: - case 0xcd4/4: - s3virge.s3d.src_base[op_type] = data; - LOGMMIO("MM%04X: Source Base = %08x\n", (offset*4)+0xa000, data); - break; - case 0xad8/4: - case 0x8d8/4: - case 0xcd8/4: - s3virge.s3d.dest_base[op_type] = data; - LOGMMIO("MM%04X: Destination base address = %08x\n", (offset*4)+0xa000, data); - break; case 0x500/4: - s3virge.s3d.command[OP_BITBLT] = data; - // TODO:if bit 0 is reset, then execute now - LOGMMIO("MM%04X: Command [BitBLT/FilledRect] = %08x\n", (offset*4)+0xa000, data); - break; - case 0x900/4: - s3virge.s3d.command[OP_2DLINE] = data; - // TODO:if bit 0 is reset, then execute now - LOGMMIO("MM%04X: Command [2D Line] = %08x\n", (offset*4)+0xa000, data); - break; - case 0xd00/4: - s3virge.s3d.command[OP_2DPOLY] = data; - // TODO:if bit 0 is reset, then execute now - LOGMMIO("MM%04X: Command [2D Polygon] = %08x\n", (offset*4)+0xa000, data); - break; - case 0x504/4: - s3virge.s3d.rect_height[OP_BITBLT] = data & 0x000003ff; - s3virge.s3d.rect_width[OP_BITBLT] = (data & 0x03ff0000) >> 16; - LOGMMIO("MM%04X: Rectangle Width/Height = %08x (%ix%i)\n", (offset*4)+0xa000, data, s3virge.s3d.rect_width[OP_BITBLT], s3virge.s3d.rect_height[OP_BITBLT]); - break; - case 0x508/4: - s3virge.s3d.source_y[OP_BITBLT] = data & 0x000003ff; - s3virge.s3d.source_x[OP_BITBLT] = (data & 0x03ff0000) >> 16; - LOGMMIO("MM%04X: Rectangle Source X/Y = %08x (%i, %i)\n",(offset*4)+0xa000, data, s3virge.s3d.source_x[OP_BITBLT], s3virge.s3d.source_y[OP_BITBLT]); + if(!(data & 0x00000001)) + add_command(op_type); break; case 0x50c/4: - s3virge.s3d.dest_y[OP_BITBLT] = data & 0x000003ff; - s3virge.s3d.dest_x[OP_BITBLT] = (data & 0x03ff0000) >> 16; - // TODO:if previous command has bit 0 set, then execute here - LOGMMIO("MM%04X: Rectangle Destination X/Y = %08x (%i, %i)\n", (offset*4)+0xa000, data, s3virge.s3d.dest_x[OP_BITBLT], s3virge.s3d.dest_y[OP_BITBLT]); + if(s3virge.s3d.reg[op_type][S3D_REG_COMMAND] & 0x00000001) // autoexecute enabled + add_command(op_type); break; - default: - LOGMMIO("MMIO unknown/unused register write MM%04X = %08x\n", (offset*4)+0xa000, data); } } diff --git a/src/devices/bus/isa/s3virge.h b/src/devices/bus/isa/s3virge.h index daa7607ef0c..997377fcd38 100644 --- a/src/devices/bus/isa/s3virge.h +++ b/src/devices/bus/isa/s3virge.h @@ -35,25 +35,55 @@ public: DECLARE_WRITE8_MEMBER(fb_w); DECLARE_READ32_MEMBER(s3d_sub_status_r); DECLARE_WRITE32_MEMBER(s3d_sub_control_w); + DECLARE_READ32_MEMBER(s3d_func_ctrl_r); DECLARE_READ32_MEMBER(s3d_register_r); DECLARE_WRITE32_MEMBER(s3d_register_w); + DECLARE_WRITE32_MEMBER(image_xfer) + { +// if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000080) + { +// logerror("IMG Xfer:(%u):%08x X:%u(%u) Y:%u(%u)\n",s3virge.s3d.bitblt_step_count,data,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_width,s3virge.s3d.bitblt_y_current,s3virge.s3d.bitblt_height); + s3virge.s3d.image_xfer = data; + bitblt_step(); + } + } + uint16_t get_crtc_port() { return (vga.miscellaneous_output&1)?0x3d0:0x3b0; } uint32_t get_linear_address() { return s3virge.linear_address; } void set_linear_address(uint32_t addr) { s3virge.linear_address = addr; } uint8_t get_linear_address_size() { return s3virge.linear_address_size; } bool is_linear_address_active() { return s3virge.linear_address_enable; } bool is_new_mmio_active() { return s3.cr53 & 0x08; } + uint16_t dest_stride() + { +// if((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x0000001c) == 0x08) +// { +// popmessage("Stride=%08x",(((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_SRC_STR] >> 16) & 0xfff8) / 3) +// + ((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_SRC_STR] >> 16) & 0xfff8)); +// return (((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_SRC_STR] >> 16) & 0xfff8) / 3) +// + ((s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_SRC_STR] >> 16) & 0xfff8); +// } +// else + return (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_DEST_SRC_STR] >> 16) & 0xfff8; + } ibm8514a_device* get_8514() { fatalerror("s3virge requested non-existent 8514/A device\n"); return nullptr; } + enum + { + TIMER_DRAW_STEP = 10 + }; + + protected: s3virge_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; virtual void device_reset() override; + virtual uint16_t offset() override; enum { @@ -63,6 +93,7 @@ protected: LAW_4MB }; + // register groups enum { OP_BITBLT = 0, @@ -72,6 +103,35 @@ protected: OP_3DTRI }; + enum + { + S3D_STATE_IDLE = 0, + S3D_STATE_BITBLT, + S3D_STATE_2DLINE, + S3D_STATE_2DPOLY, + S3D_STATE_3DLINE, + S3D_STATE_3DPOLY + }; + + enum + { + S3D_REG_SRC_BASE = 0xd4/4, + S3D_REG_DEST_BASE = 0xd8/4, + S3D_REG_CLIP_L_R = 0xdc/4, + S3D_REG_CLIP_T_B = 0xe0/4, + S3D_REG_DEST_SRC_STR = 0xe4/4, + S3D_REG_MONO_PAT_0 = 0xe8/4, + S3D_REG_MONO_PAT_1 = 0xec/4, + S3D_REG_PAT_BG_CLR = 0xf0/4, + S3D_REG_PAT_FG_CLR = 0xf4/4, + S3D_REG_SRC_BG_CLR = 0xf8/4, + S3D_REG_SRC_FG_CLR = 0xfc/4, + S3D_REG_COMMAND = 0x100/4, + S3D_REG_RWIDTH_HEIGHT = 0x104/4, + S3D_REG_RSRC_XY = 0x108/4, + S3D_REG_RDEST_XY = 0x10c/4 + }; + struct { uint32_t linear_address; @@ -82,19 +142,109 @@ protected: struct { - uint32_t src_base[5]; - uint32_t dest_base[5]; - uint32_t command[5]; - uint16_t source_x[5]; - uint16_t source_y[5]; - uint16_t dest_x[5]; - uint16_t dest_y[5]; - uint16_t rect_width[5]; - uint16_t rect_height[5]; + int state; + bool busy; + struct + { + uint32_t reg[256]; + int op_type; + } cmd_fifo[16]; + int cmd_fifo_next_ptr; // command added here in FIFO + int cmd_fifo_current_ptr; // command currently being processed in FIFO + int cmd_fifo_slots_free; + + uint8_t pattern[0xc0]; + uint32_t reg[5][256]; + + // BitBLT command state + uint16_t bitblt_x_src; + uint16_t bitblt_y_src; + uint16_t bitblt_x_dst; + uint16_t bitblt_y_dst; + int16_t bitblt_x_current; + int16_t bitblt_y_current; + int16_t bitblt_x_src_current; + int16_t bitblt_y_src_current; + int8_t bitblt_pat_x; + int8_t bitblt_pat_y; + uint16_t bitblt_height; + uint16_t bitblt_width; + uint32_t bitblt_step_count; + uint64_t bitblt_mono_pattern; + uint32_t bitblt_current_pixel; + uint32_t bitblt_pixel_pos; // current position in a pixel (for packed 24bpp colour image transfers) + uint32_t image_xfer; // source data via image transfer ports + uint16_t clip_l; + uint16_t clip_r; + uint16_t clip_t; + uint16_t clip_b; } s3d; } s3virge; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void write_pixel32(uint32_t base, uint16_t x, uint16_t y, uint32_t val) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000002) + if(x < s3virge.s3d.clip_l || x > s3virge.s3d.clip_r || y < s3virge.s3d.clip_t || y > s3virge.s3d.clip_b) + return; + vga.memory[(base + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] = val & 0xff; + vga.memory[(base + 1 + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] = (val >> 8) & 0xff; + vga.memory[(base + 2 + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] = (val >> 16) & 0xff; + vga.memory[(base + 3 + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] = (val >> 24) & 0xff; + } + void write_pixel24(uint32_t base, uint16_t x, uint16_t y, uint32_t val) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000002) + if(x < s3virge.s3d.clip_l || x > s3virge.s3d.clip_r || y < s3virge.s3d.clip_t || y > s3virge.s3d.clip_b) + return; + vga.memory[(base + (x*3) + (y*dest_stride())) % vga.svga_intf.vram_size] = val & 0xff; + vga.memory[(base + 1 + (x*3) + (y*dest_stride())) % vga.svga_intf.vram_size] = (val >> 8) & 0xff; + vga.memory[(base + 2 + (x*3) + (y*dest_stride())) % vga.svga_intf.vram_size] = (val >> 16) & 0xff; + } + void write_pixel16(uint32_t base, uint16_t x, uint16_t y, uint16_t val) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000002) + if(x < s3virge.s3d.clip_l || x > s3virge.s3d.clip_r || y < s3virge.s3d.clip_t || y > s3virge.s3d.clip_b) + return; + vga.memory[(base + (x*2) + (y*dest_stride())) % vga.svga_intf.vram_size] = val & 0xff; + vga.memory[(base + 1 + (x*2) + (y*dest_stride())) % vga.svga_intf.vram_size] = (val >> 8) & 0xff; + } + void write_pixel8(uint32_t base, uint16_t x, uint16_t y, uint8_t val) + { + if(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000002) + if(x < s3virge.s3d.clip_l || x > s3virge.s3d.clip_r || y < s3virge.s3d.clip_t || y > s3virge.s3d.clip_b) + return; + vga.memory[(base + x + (y*dest_stride())) % vga.svga_intf.vram_size] = val; + } + uint32_t read_pixel32(uint32_t base, uint16_t x, uint16_t y) + { + return (vga.memory[(base + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] << 24) | (vga.memory[(base + 1 + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] << 16) + | (vga.memory[(base + 2 + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size] << 8) | vga.memory[(base + 3 + (x*4) + (y*dest_stride())) % vga.svga_intf.vram_size]; + } + uint32_t read_pixel24(uint32_t base, uint16_t x, uint16_t y) + { + return (vga.memory[(base + (x*3) + (y*dest_stride())) % vga.svga_intf.vram_size]) | (vga.memory[(base + 1 + (x*3) + (y*dest_stride())) % vga.svga_intf.vram_size] << 8) + | (vga.memory[(base + 2 + (x*3) + (y*dest_stride())) % vga.svga_intf.vram_size] << 16); + } + uint16_t read_pixel16(uint32_t base, uint16_t x, uint16_t y) + { + return (vga.memory[(base + (x*2) + (y*dest_stride()) % vga.svga_intf.vram_size)]) | (vga.memory[(base + 1 + (x*2) + (y*dest_stride())) % vga.svga_intf.vram_size] << 8); + } + uint8_t read_pixel8(uint32_t base, uint16_t x, uint16_t y) + { + return vga.memory[(base + x + (y*dest_stride())) % vga.svga_intf.vram_size]; + } + uint32_t GetROP(uint8_t rop, uint32_t src, uint32_t dst, uint32_t pat); + bool advance_pixel(); private: + emu_timer* m_draw_timer; + void bitblt_step(); + void bitblt_colour_step(); + void bitblt_monosrc_step(); + void add_command(int cmd_type); + void command_start(); + void command_finish(); + virtual uint8_t s3_crtc_reg_read(uint8_t index); virtual void s3_define_video_mode(void); virtual void s3_crtc_reg_write(uint8_t index, uint8_t data); diff --git a/src/devices/bus/lpci/cirrus.cpp b/src/devices/bus/lpci/cirrus.cpp index ddfe9d81330..ad0e32149a0 100644 --- a/src/devices/bus/lpci/cirrus.cpp +++ b/src/devices/bus/lpci/cirrus.cpp @@ -64,8 +64,8 @@ ***************************************************************************/ #include "emu.h" -#include "cirrus.h" #include "video/pc_vga.h" +#include "cirrus.h" #define LOG_PCIACCESS 0 @@ -85,7 +85,8 @@ DEFINE_DEVICE_TYPE(PCI_CIRRUS_SVGA, pci_cirrus_svga_device, "pci_cirrus_svga", " pci_cirrus_svga_device::pci_cirrus_svga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_CIRRUS_SVGA, tag, owner, clock) - , pci_device_interface( mconfig, *this ) + , pci_device_interface(mconfig, *this) + , m_vga(*this, "vga") { } @@ -160,5 +161,5 @@ void pci_cirrus_svga_device::pci_write(pci_bus_device *pcibus, int function, int WRITE8_MEMBER( pci_cirrus_svga_device::cirrus_42E8_w ) { if (data & 0x80) - machine().device("vga")->reset(); + m_vga->reset(); } diff --git a/src/devices/bus/lpci/cirrus.h b/src/devices/bus/lpci/cirrus.h index 22eabaff906..91e512c3023 100644 --- a/src/devices/bus/lpci/cirrus.h +++ b/src/devices/bus/lpci/cirrus.h @@ -20,8 +20,10 @@ class pci_cirrus_svga_device : public device_t, public pci_device_interface { public: - // construction/destruction + // construction/destruction pci_cirrus_svga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <typename T> + void set_vga(T &&tag) { m_vga.set_tag(std::forward<T>(tag)); } virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; @@ -32,6 +34,8 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + + required_device<vga_device> m_vga; }; diff --git a/src/devices/bus/lpci/i82371sb.cpp b/src/devices/bus/lpci/i82371sb.cpp index 5e2160088ff..4437aa849d6 100644 --- a/src/devices/bus/lpci/i82371sb.cpp +++ b/src/devices/bus/lpci/i82371sb.cpp @@ -38,6 +38,7 @@ i82371sb_device::i82371sb_device(const machine_config &mconfig, const char *tag, , m_apmc(0) , m_apms(0) , m_base(0) + , m_cpu(*this, finder_base::DUMMY_TAG) { } @@ -249,7 +250,7 @@ void i82371sb_device::remap(int space_id, offs_t start, offs_t end) void i82371sb_device::device_start() { - address_space& spaceio = machine().device(":maincpu")->memory().space(AS_IO); + address_space& spaceio = m_cpu->space(AS_IO); southbridge_device::device_start(); m_ide_io_ports_enabled = false; diff --git a/src/devices/bus/lpci/i82371sb.h b/src/devices/bus/lpci/i82371sb.h index 7411a6ebea2..9b38c0876d0 100644 --- a/src/devices/bus/lpci/i82371sb.h +++ b/src/devices/bus/lpci/i82371sb.h @@ -24,6 +24,9 @@ public: // construction/destruction i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <typename T> + void set_cpu(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); } + auto smi() { return m_smi_callback.bind(); } auto boot_state_hook() { return m_boot_state_hook.bind(); } @@ -61,6 +64,7 @@ private: int m_apmc; int m_apms; uint32_t m_base; + required_device<cpu_device> m_cpu; }; // device type definition diff --git a/src/devices/bus/lpci/i82439tx.cpp b/src/devices/bus/lpci/i82439tx.cpp index 1fe0e22717f..be768007a0c 100644 --- a/src/devices/bus/lpci/i82439tx.cpp +++ b/src/devices/bus/lpci/i82439tx.cpp @@ -21,7 +21,6 @@ DEFINE_DEVICE_TYPE(I82439TX_LEGACY, i82439tx_device, "i82439tx_legacy", "Intel 8 i82439tx_device::i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : northbridge_device(mconfig, I82439TX_LEGACY, tag, owner, clock), pci_device_interface(mconfig, *this), - m_cpu_tag(nullptr), m_region_tag(nullptr), m_space(nullptr), m_rom(nullptr) @@ -442,10 +441,7 @@ void i82439tx_device::device_start() { northbridge_device::device_start(); // get address space we are working on - device_t *cpu = machine().device(m_cpu_tag); - assert(cpu != nullptr); - - m_space = &cpu->memory().space(AS_PROGRAM); + m_space = &m_cpu->space(AS_PROGRAM); // get rom region m_rom = machine().root_device().memregion(m_region_tag)->base(); diff --git a/src/devices/bus/lpci/i82439tx.h b/src/devices/bus/lpci/i82439tx.h index 3bb2671ecb7..af5a0dcf757 100644 --- a/src/devices/bus/lpci/i82439tx.h +++ b/src/devices/bus/lpci/i82439tx.h @@ -24,7 +24,6 @@ public: // construction/destruction i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_cpu(const char *tag) { m_cpu_tag = tag; } void set_region(const char *tag) { m_region_tag = tag; } virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; @@ -41,7 +40,6 @@ protected: void update_smram_mappings(); private: - const char *m_cpu_tag; const char *m_region_tag; address_space *m_space; diff --git a/src/devices/bus/lpci/mpc105.cpp b/src/devices/bus/lpci/mpc105.cpp index 5816153f134..de6eee2dcce 100644 --- a/src/devices/bus/lpci/mpc105.cpp +++ b/src/devices/bus/lpci/mpc105.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "mpc105.h" -#include "machine/ram.h" #define LOG_MPC105 0 @@ -35,7 +34,8 @@ mpc105_device::mpc105_device(const machine_config &mconfig, const char *tag, dev m_bank_base_default(0), m_bank_base(0), m_bank_enable(0), - m_maincpu(*this, finder_base::DUMMY_TAG) + m_maincpu(*this, finder_base::DUMMY_TAG), + m_ram(*this, ":" RAM_TAG) { } @@ -67,6 +67,7 @@ void mpc105_device::update_memory() int bank; offs_t begin, end; char bank_str[10]; + u32 ram_size = m_ram->size(); if (LOG_MPC105) logerror("mpc105_update_memory(machine): Updating memory (bank enable=0x%02X)\n", m_bank_enable); @@ -91,17 +92,17 @@ void mpc105_device::update_memory() | (((m_bank_registers[(bank / 4) + 6] >> (bank % 4) * 8)) & 0x03) << 28 | 0x000FFFFF; - end = std::min(end, begin + machine().device<ram_device>(RAM_TAG)->size() - 1); + end = std::min(end, begin + ram_size - 1); if ((begin + 0x100000) <= end) { if (LOG_MPC105) - logerror("\tbank #%d [%02d]: 0x%08X - 0x%08X [%p-%p]\n", bank, bank + m_bank_base, begin, end, machine().device<ram_device>(RAM_TAG)->pointer(), machine().device<ram_device>(RAM_TAG)->pointer() + (end - begin)); + logerror("\tbank #%d [%02d]: 0x%08X - 0x%08X [%p-%p]\n", bank, bank + m_bank_base, begin, end, m_ram->pointer(), m_ram->pointer() + (end - begin)); if (m_bank_base > 0) { sprintf(bank_str,"bank%d",uint8_t(bank + m_bank_base)); - membank(bank_str)->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); + membank(bank_str)->set_base(m_ram->pointer()); } } } diff --git a/src/devices/bus/lpci/mpc105.h b/src/devices/bus/lpci/mpc105.h index 94f9181a2d7..e469168189d 100644 --- a/src/devices/bus/lpci/mpc105.h +++ b/src/devices/bus/lpci/mpc105.h @@ -14,6 +14,7 @@ #pragma once #include "pci.h" +#include "machine/ram.h" #define MPC105_MEMORYBANK_COUNT 8 @@ -47,6 +48,7 @@ private: uint32_t m_bank_registers[8]; required_device<cpu_device> m_maincpu; + required_device<ram_device> m_ram; }; diff --git a/src/devices/bus/lpci/northbridge.cpp b/src/devices/bus/lpci/northbridge.cpp index e07220bb005..57c802a9e20 100644 --- a/src/devices/bus/lpci/northbridge.cpp +++ b/src/devices/bus/lpci/northbridge.cpp @@ -13,9 +13,9 @@ // GLOBAL VARIABLES //************************************************************************** -northbridge_device::northbridge_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +northbridge_device::northbridge_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_maincpu(*this, ":maincpu"), + m_cpu(*this, finder_base::DUMMY_TAG), m_ram(*this, ":" RAM_TAG) { } @@ -26,7 +26,7 @@ northbridge_device::northbridge_device(const machine_config &mconfig, device_typ void northbridge_device::device_start() { - address_space& space = machine().device(":maincpu")->memory().space(AS_PROGRAM); + address_space &space = m_cpu->space(AS_PROGRAM); machine().root_device().membank("bank10")->set_base(m_ram->pointer()); diff --git a/src/devices/bus/lpci/northbridge.h b/src/devices/bus/lpci/northbridge.h index dd557427f16..36282d93a9c 100644 --- a/src/devices/bus/lpci/northbridge.h +++ b/src/devices/bus/lpci/northbridge.h @@ -16,6 +16,10 @@ class northbridge_device : public device_t { +public: + template <typename T> + void set_cpu(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); } + protected: // construction/destruction northbridge_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -24,7 +28,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; - required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_cpu; required_device<ram_device> m_ram; }; diff --git a/src/devices/bus/lpci/pci.cpp b/src/devices/bus/lpci/pci.cpp index 3c2f6b2a990..41591758c7d 100644 --- a/src/devices/bus/lpci/pci.cpp +++ b/src/devices/bus/lpci/pci.cpp @@ -91,7 +91,8 @@ DEFINE_DEVICE_TYPE(PCI_BUS, pci_bus_device, "pci_bus", "PCI Bus") //------------------------------------------------- pci_bus_device::pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_BUS, tag, owner, clock), m_busnum(0), - m_father(nullptr), m_address(0), m_devicenum(0), m_busnumber(0), m_busnumaddr(nullptr) + m_address(0), m_devicenum(0), m_busnumber(0), m_busnumaddr(nullptr), + m_father(*this, finder_base::DUMMY_TAG) { for (auto & elem : m_devtag) { elem= nullptr; @@ -284,11 +285,8 @@ void pci_bus_device::device_start() m_device[i] = nullptr; } - if (m_father != nullptr) { - pci_bus_device *father = machine().device<pci_bus_device>(m_father); - if (father) - father->add_sibling(this, m_busnum); - } + if (m_father.found()) + m_father->add_sibling(this, m_busnum); /* register pci states */ save_item(NAME(m_address)); diff --git a/src/devices/bus/lpci/pci.h b/src/devices/bus/lpci/pci.h index db14beec790..83606aec5da 100644 --- a/src/devices/bus/lpci/pci.h +++ b/src/devices/bus/lpci/pci.h @@ -79,9 +79,9 @@ public: DECLARE_WRITE64_MEMBER( write_64be ); void set_busnum(int busnum) { m_busnum = busnum; } - void set_father(const char *father) { m_father = father; } - void set_device(int num, const char *tag) { - m_devtag[num] = tag; } + template <typename T> + void set_father(T &&tag) { m_father.set_tag(std::forward<T>(tag)); } + void set_device(int num, const char *tag) { m_devtag[num] = tag; } pci_bus_device *pci_search_bustree(int busnum, int devicenum, pci_bus_device *pcibus); void add_sibling(pci_bus_device *sibling, int busnum); @@ -100,7 +100,6 @@ private: const char * m_devtag[32]; pci_device_interface *m_device[32]; - const char * m_father; pci_bus_device * m_siblings[8]; uint8_t m_siblings_busnum[8]; int m_siblings_count; @@ -109,6 +108,8 @@ private: int8_t m_devicenum; // device number we are addressing int8_t m_busnumber; // pci bus number we are addressing pci_bus_device * m_busnumaddr; // pci bus we are addressing + + optional_device<pci_bus_device> m_father; }; // device type definition diff --git a/src/devices/bus/multibus/isbc202.cpp b/src/devices/bus/multibus/isbc202.cpp new file mode 100644 index 00000000000..864856eca8c --- /dev/null +++ b/src/devices/bus/multibus/isbc202.cpp @@ -0,0 +1,1195 @@ +// license:BSD-3-Clause +// copyright-holders: F. Ulivi +/********************************************************************* + + isbc202.cpp + + Intel iSBC-202 SSDD 8" floppy disk controller + + This controller interfaces a standard 8/16-bit Multibus system + with up to 4 8" SSDD floppy drives. It was typically used to + expand a MDS-II system with double-density drives. + The ISIS-II OS identifies the drives as :F0: :F1: :F2: :F3: + The iSBC-202 controller is based on two boards: a "channel" + board with the actual controller and an "interface" board. + The latter handles the low-level aspects of the disks, especially + the encoding and decoding of MMFM modulated bits. This board + interfaces directly with standard Shugart SA-800-1 drives. + The drives are housed, two at time, in a (big) external box + that also holds their power supply. + The channel board is implemented with a 3000-series bit slice + processor. Microcode is stored on 4 512x8 bipolar PROMs. + The channel board is bus mastering, i.e. it can issue memory + read/write cycles to the main processor RAM. + Format of data on disk is entirely Intel proprietary. + Intel also designed a similar controller (iSBC-201) for FM + IBM-standard disks. AFAIK, this board shares the channel board + with iSBC-202 (but not the microcode) and has a different + interface board. + This table summarizes the main characteristics of the disks. + + | Bit cell size | 2 µs | + | Modulation | MMFM | + | Bit order | MS first | + | Sides | 1 | + | Tracks | 77 | + | Sectors/track | 52 | + | Sector size | 128 bytes| + | Formatted size | 500.5 kB | + | Rotation speed | 360 RPM | + + Special thanks to Eric Smith for dumping the microcode PROMs. + Without his work this driver wouldn't exist at all. + + Reference manuals. + - Intellec series II MDS double-density diskette subsystem + (schematic drawings) - Intel 1980 - 9800425-02 Rev. B + - Intellec double-density diskette operating system hardware + reference manual - Intel 1977 - 9800422A + - SBC 202 double-density diskette controller hardware reference + manual - Intel 1977 - 9800420A + + What follows is a list of things that I left out. They could be + implemented at a later time just for completeness sake as ISIS-II + doesn't rely on them at all. + - The STOP signal (it seems to be used in iSBC-201 only) + - Interrupt to CPU + - Head load/unload commands (MAME doesn't emulate head loading) + +*********************************************************************/ + +#include "emu.h" +#include "isbc202.h" +#include "formats/img_dsk.h" + +// Debugging +#include "logmacro.h" +#define LOG_BUS_MASK (LOG_GENERAL << 1) +#define LOG_BUS(...) LOGMASKED(LOG_BUS_MASK, __VA_ARGS__) +#define LOG_RD_MASK (LOG_BUS_MASK << 1) +#define LOG_RD(...) LOGMASKED(LOG_RD_MASK, __VA_ARGS__) +#define LOG_WR_MASK (LOG_RD_MASK << 1) +#define LOG_WR(...) LOGMASKED(LOG_WR_MASK, __VA_ARGS__) +#define LOG_DR_MASK (LOG_WR_MASK << 1) +#define LOG_DR(...) LOGMASKED(LOG_DR_MASK, __VA_ARGS__) +#undef VERBOSE +//#define VERBOSE (LOG_GENERAL|LOG_BUS_MASK|LOG_RD_MASK|LOG_WR_MASK|LOG_DR_MASK) +#define VERBOSE LOG_GENERAL + +// Bit manipulation +namespace { + template<typename T> constexpr T BIT_MASK(unsigned n) + { + return (T)1U << n; + } + + template<typename T> void BIT_CLR(T& w , unsigned n) + { + w &= ~BIT_MASK<T>(n); + } + + template<typename T> void BIT_SET(T& w , unsigned n) + { + w |= BIT_MASK<T>(n); + } +} + +// Constants +constexpr unsigned TIMEOUT_MS = 10; // "timeout" timer: 10 ms +constexpr unsigned HALF_BIT_CELL_US = 1;// Half bit cell duration in µs +constexpr unsigned BIT_FREQUENCY = 500000; // Frequency of bit cells in Hz +constexpr uint16_t CRC_POLY = 0x1021; // CRC-CCITT + +// Timers +enum { + TIMEOUT_TMR_ID, + BYTE_TMR_ID, + F_TMR_ID +}; + +// device type definition +DEFINE_DEVICE_TYPE(ISBC202, isbc202_device, "isbc202", "iSBC-202 floppy controller") + +// Microcode disassembler +class isbc202_disassembler : public util::disasm_interface +{ +public: + isbc202_disassembler(); + virtual ~isbc202_disassembler() = default; + + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; +}; + +isbc202_disassembler::isbc202_disassembler() +{ +} + +u32 isbc202_disassembler::opcode_alignment() const +{ + return 1; +} + +offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + uint32_t microcode = opcodes.r32(pc); + + // Decode address control instruction + uint8_t ac = (uint8_t)(microcode >> 25); + + if ((ac & 0b1100000) == 0b0000000) { + // JCC + util::stream_format(stream , "JCC $%03x" , (((uint16_t)ac & 0b11111) << 4) | (pc & 0xf)); + } else if ((ac & 0b1110000) == 0b0100000) { + // JZR + util::stream_format(stream , "JZR $00%x" , ac & 0b1111); + } else if ((ac & 0b1110000) == 0b0110000) { + // JCR + util::stream_format(stream , "JCR $%03x" , (pc & 0b111110000) | (ac & 0b1111)); + } else if ((ac & 0b1111000) == 0b1110000) { + // JCE + util::stream_format(stream , "JCE $%03x" , (pc & 0b110001111) | ((ac & 0b111) << 4)); + } else if ((ac & 0b1110000) == 0b1000000) { + // JFL + util::stream_format(stream , "JFL $%03x" , (pc & 0b100001000) | ((ac & 0b1111) << 4) | 0b10); + } else if ((ac & 0b1111000) == 0b1010000) { + // JCF + util::stream_format(stream , "JCF $%03x" , (pc & 0b110001000) | ((ac & 0b111) << 4) | 0b10); + } else if ((ac & 0b1111000) == 0b1011000) { + // JZF + util::stream_format(stream , "JZF $%03x" , (pc & 0b110001000) | ((ac & 0b111) << 4) | 0b10); + } else if ((ac & 0b1111000) == 0b1100000) { + // JPR + util::stream_format(stream , "JPR $%02xx" , ((pc >> 4) & 0b11000) | (ac & 0b111)); + } else if ((ac & 0b1111000) == 0b1101000) { + // JLL + util::stream_format(stream , "JLL $%03x" , (pc & 0b110000000) | ((ac & 0b111) << 4) | 0b100); + } else if ((ac & 0b1111100) == 0b1111100) { + // JRL + util::stream_format(stream , "JRL $%03x" , (pc & 0b110000000) | ((ac & 0b11) << 4) | 0b001001100); + } else { + // JPX + util::stream_format(stream , "JPX $%02xx" , ((pc >> 4) & 0b11100) | (ac & 0b11)); + } + + // Decode input multiplexer + uint8_t in = (uint8_t)((microcode >> 13) & 7); + util::stream_format(stream , " I=%u" , in); + + // Decode function code + uint8_t fc = (uint8_t)((microcode >> 18) & 0x7f); + uint8_t fg; + uint8_t rg; + unsigned reg; + i3002_device::decode_fc(fc , fg , rg , reg); + util::stream_format(stream , " CPE=%u%u/%2s" , fg , rg + 1 , i3002_device::reg_name(reg)); + + // Decode flag control + stream << (BIT(microcode , 17) ? " FF1" : " FF0"); + stream << (BIT(microcode , 16) ? " HCZ" : " SCZ"); + + // Decode K + uint8_t slk = (uint8_t)((microcode >> 8) & 3); + uint8_t mask = (uint8_t)microcode; + uint8_t kbus; + if (!BIT(slk , 0)) { + kbus = mask; + } else if (slk == 1) { + kbus = 0xff; + } else { + kbus = 0; + } + util::stream_format(stream , " K=$%02x" , kbus); + + // Decode OUT + util::stream_format(stream , " S=%u M=$%02x" , slk , mask); + if (BIT(slk , 0) && !BIT(mask , 7)) { + uint8_t out = (uint8_t)((microcode >> 10) & 7); + util::stream_format(stream , " O=%u" , out); + } + + return 1 | SUPPORTED; +} + +// isbc202_device +isbc202_device::isbc202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig , ISBC202 , tag , owner , multibus_slot_device::BUS_CLOCK / 4) + , device_multibus_interface(mconfig , *this) + , m_mcu(*this , "mcu") + , m_cpes(*this , "cpe%u" , 0) + , m_drives(*this , "floppy%u" , 0) + , m_program_config("microprogram" , ENDIANNESS_BIG , 32 , 9 , -2) + , m_cache(nullptr) + , m_mem_space(nullptr) +{ +} + +isbc202_device::~isbc202_device() +{ +} + +void isbc202_device::install_io_rw(address_space& space) +{ + space.install_readwrite_handler(0x78 , 0x7f , read8_delegate(*this , FUNC(isbc202_device::io_r)) , write8_delegate(*this , FUNC(isbc202_device::io_w))); +} + +void isbc202_device::install_mem_rw(address_space& space) +{ + m_mem_space = &space; +} + +READ8_MEMBER(isbc202_device::io_r) +{ + uint8_t res = 0; + + switch (offset) { + case 0: + // Read drive status & INT (auto XACK) + // Bit What + // 7 0 + // 6 Drive 3 ready + // 5 Drive 2 ready + // 4 1 + // 3 1 + // 2 Int pending + // 1 Drive 1 ready + // 0 Drive 0 ready + { + uint8_t ready = m_ready_in & m_ready_ff; + if (BIT(ready , 3)) { + BIT_SET(res , 6); + } + if (BIT(ready , 2)) { + BIT_SET(res , 5); + } + BIT_SET(res , 4); + BIT_SET(res , 3); + if (m_irq) { + BIT_SET(res , 2); + } + if (BIT(ready , 1)) { + BIT_SET(res , 1); + } + if (BIT(ready , 0)) { + BIT_SET(res , 0); + } + } + break; + + case 1: + // Read result type (auto XACK) + m_irq = false; + res = m_data_low_out; + break; + + case 3: + // Read result byte (no auto XACK) + if (m_cpu == nullptr) { + m_cpu = dynamic_cast<cpu_device*>(&space.device()); + set_start(3 , true); + } else { + m_cpu = nullptr; + res = m_data_low_out; + } + break; + + default: + LOG("RD from unknown reg!\n"); + break; + } + + LOG_BUS("IO R @%u=%02x\n" , offset , res); + return res; +} + +WRITE8_MEMBER(isbc202_device::io_w) +{ + LOG_BUS("IO W @%u=%02x\n" , offset , data); + + switch (offset) { + case 0: + case 1: + // Write LSB address + case 2: + // Write MSB address & start op + case 4: + case 5: + case 6: + if (m_cpu != nullptr) { + LOG("CPU != NULL!\n"); + } + m_cpu = dynamic_cast<cpu_device*>(&space.device()); + m_cpu_data = data; + set_start(offset , false); + break; + + case 7: + // Reset + pulse_input_line(INPUT_LINE_RESET , attotime::zero); + break; + + default: + LOG("WR to unknown reg!\n"); + break; + } +} + +WRITE_LINE_MEMBER(isbc202_device::co_w) +{ + m_inputs[ IN_SEL_CO ] = state; + m_mcu->fi_w(state); + m_cpes[ 3 ]->li_w(state); +} + +READ8_MEMBER(isbc202_device::px_r) +{ + if (BIT(m_px_s1s0 , 0)) { + return m_cmd & 7; + } else if (BIT(m_px_s1s0 , 1)) { + return (m_op_us & 7) | 8; + } else { + return 0; + } +} + +void isbc202_device::device_start() +{ + state_add(STATE_GENPC , "GENPC" , m_microcode_addr).noshow(); + state_add(STATE_GENPCBASE , "CURPC" , m_microcode_addr).noshow(); + state_add(STATE_GENFLAGS , "FLAGS" , m_flags).noshow().callimport().callexport().formatstr("%9s"); + + for (int i = 0; i < i3002_device::REG_COUNT; ++i) { + state_add(i , i3002_device::reg_name(i) , m_regs[ i ]).callimport().callexport(); + } + + save_item(NAME(m_flags)); + save_item(NAME(m_regs)); + save_item(NAME(m_microcode_addr)); + save_item(NAME(m_code_word)); + save_item(NAME(m_ac)); + save_item(NAME(m_fc)); + save_item(NAME(m_fc32)); + save_item(NAME(m_fc10)); + save_item(NAME(m_in_sel)); + save_item(NAME(m_out_sel)); + save_item(NAME(m_slk)); + save_item(NAME(m_mask)); + save_item(NAME(m_kbus)); + save_item(NAME(m_inputs)); + save_item(NAME(m_op_us)); + save_item(NAME(m_px_s1s0)); + save_item(NAME(m_cmd)); + save_item(NAME(m_cpu_rd)); + save_item(NAME(m_ready_in)); + save_item(NAME(m_ready_ff)); + save_item(NAME(m_gate_lower)); + save_item(NAME(m_irq)); + save_item(NAME(m_data_low_out)); + save_item(NAME(m_data_low_in)); + save_item(NAME(m_cpu_data)); + save_item(NAME(m_addr_low_out)); + save_item(NAME(m_mem_wrt)); + save_item(NAME(m_wrt_inh)); + save_item(NAME(m_direction)); + save_item(NAME(m_ibus_cached)); + save_item(NAME(m_ibus)); + save_item(NAME(m_crc)); + save_item(NAME(m_crc_enabled)); + save_item(NAME(m_crc_out)); + save_item(NAME(m_reading)); + save_item(NAME(m_writing)); + save_item(NAME(m_data_sr)); + save_item(NAME(m_last_data_bit)); + save_item(NAME(m_clock_sr)); + save_item(NAME(m_last_f_time)); + save_item(NAME(m_clock_gate)); + save_item(NAME(m_amwrt)); + save_item(NAME(m_dlyd_amwrt)); + + m_cache = space(AS_PROGRAM).cache<2 , -2 , ENDIANNESS_BIG>(); + set_icountptr(m_icount); + space(AS_PROGRAM).install_rom(0 , 0x1ff , memregion("microcode")->base()); + + for (auto& d : m_drives) { + d->get_device()->setup_ready_cb(floppy_image_device::ready_cb(&isbc202_device::floppy_ready_cb , this)); + d->get_device()->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(&isbc202_device::floppy_index_cb , this)); + } + + m_timeout_timer = timer_alloc(TIMEOUT_TMR_ID); + m_byte_timer = timer_alloc(BYTE_TMR_ID); + m_f_timer = timer_alloc(F_TMR_ID); +} + +void isbc202_device::device_reset() +{ + // Set start address + m_mcu->addr_w(0); + // Select drive #0 + m_op_us = 0; + m_current_drive = m_drives[ 0 ]->get_device(); + + // XFERREQ is always 1 because R/W in CPU memory is instantaneous + m_inputs[ IN_SEL_XFERQ ] = true; + + m_inputs[ IN_SEL_TIMEOUT ] = true; + m_inputs[ IN_SEL_F ] = false; + + m_cpu = nullptr; + + m_irq = false; + + m_reading = false; + m_writing = false; + + m_timeout_timer->reset(); + m_byte_timer->reset(); + m_f_timer->reset(); +} + +void isbc202_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch (id) { + case TIMEOUT_TMR_ID: + m_inputs[ IN_SEL_TIMEOUT ] = true; + break; + + case BYTE_TMR_ID: + m_inputs[ IN_SEL_F ] = true; + m_f_timer->adjust(attotime::from_usec(HALF_BIT_CELL_US * 2)); + m_dlyd_amwrt = m_amwrt; + if (m_reading) { + m_last_f_time = machine().time(); + rd_bits(8); + m_byte_timer->adjust(m_pll.ctime - machine().time()); + // Updating of AZ flag actually happens when F goes low + m_inputs[ IN_SEL_AZ ] = m_crc == 0; + } + break; + + case F_TMR_ID: + m_inputs[ IN_SEL_F ] = false; + if (m_writing) { + write_byte(); + m_data_sr = dbus_r(); + m_byte_timer->adjust(attotime::from_usec(HALF_BIT_CELL_US * 14)); + } + break; + + default: + break; + } +} + +ROM_START(isbc202) + ROM_REGION(0x800 , "microcode" , ROMREGION_32BIT | ROMREGION_BE) + ROM_LOAD32_BYTE("sbc202-a10-0230.bin" , 0x000 , 0x200 , CRC(e8fa3893) SHA1(88fab74b0466e8aac36eee46cd7536ed1b32a2c9)) + ROM_LOAD32_BYTE("sbc202-a11-0261.bin" , 0x001 , 0x200 , CRC(3ad01769) SHA1(4c22b8fc3ea599dd49684ff4dcafc29ec3425c4c)) + ROM_LOAD32_BYTE("sbc202-a12-0233.bin" , 0x002 , 0x200 , CRC(61496232) SHA1(b0473217944b2f6e966d97e97cf5ad8d883a09e4)) + ROM_LOAD32_BYTE("sbc202-a13-0232.bin" , 0x003 , 0x200 , CRC(c369ab86) SHA1(fc3b7f9c3e71ea1442827c51247a9944c6d40b37)) +ROM_END + +const tiny_rom_entry *isbc202_device::device_rom_region() const +{ + return ROM_NAME(isbc202); +} + +static void isbc202_floppies(device_slot_interface &device) +{ + device.option_add("8ssdd" , FLOPPY_8_SSDD); +} + +static const floppy_format_type isbc202_floppy_formats[] = { + FLOPPY_MFI_FORMAT, + FLOPPY_IMG_FORMAT, + nullptr +}; + +void isbc202_device::device_add_mconfig(machine_config &config) +{ + I3001(config , m_mcu , 0); + + // Allocation of the bit-slices: + // m_cpes[ 0 ] Bits 0..1 + // m_cpes[ 1 ] Bits 2..3 + // m_cpes[ 2 ] Bits 4..5 + // m_cpes[ 3 ] Bits 6..7 + for (auto& finder : m_cpes) { + I3002(config , finder , 0); + } + + // Connect CO/CI signals + m_mcu->fo_w().set(m_cpes[ 0 ] , FUNC(i3002_device::ci_w)); + m_cpes[ 0 ]->co_w().set(m_cpes[ 1 ] , FUNC(i3002_device::ci_w)); + m_cpes[ 1 ]->co_w().set(m_cpes[ 2 ] , FUNC(i3002_device::ci_w)); + m_cpes[ 2 ]->co_w().set(m_cpes[ 3 ] , FUNC(i3002_device::ci_w)); + m_cpes[ 3 ]->co_w().set(FUNC(isbc202_device::co_w)); + + // Connect RO/LI signals + m_cpes[ 0 ]->ro_w().set(FUNC(isbc202_device::co_w)); + m_cpes[ 1 ]->ro_w().set(m_cpes[ 0 ] , FUNC(i3002_device::li_w)); + m_cpes[ 2 ]->ro_w().set(m_cpes[ 1 ] , FUNC(i3002_device::li_w)); + m_cpes[ 3 ]->ro_w().set(m_cpes[ 2 ] , FUNC(i3002_device::li_w)); + + // Connect M-bus + m_cpes[ 0 ]->mbus_r().set([this]() { return mbus_r(); }); + m_cpes[ 1 ]->mbus_r().set([this]() { return mbus_r() >> 2; }); + m_cpes[ 2 ]->mbus_r().set([this]() { return mbus_r() >> 4; }); + m_cpes[ 3 ]->mbus_r().set([this]() { return mbus_r() >> 6; }); + + // Connect I-bus + m_cpes[ 0 ]->ibus_r().set([this]() { return ibus_r(); }); + m_cpes[ 1 ]->ibus_r().set([this]() { return ibus_r() >> 2; }); + m_cpes[ 2 ]->ibus_r().set([this]() { return ibus_r() >> 4; }); + m_cpes[ 3 ]->ibus_r().set([this]() { return ibus_r() >> 6; }); + + // Connect SX input + m_mcu->sx_r().set([this]() { return m_microcode_addr & 0xf; }); + // Connect PX input + m_mcu->px_r().set(FUNC(isbc202_device::px_r)); + + // Drives + for (auto& finder : m_drives) { + FLOPPY_CONNECTOR(config , finder , isbc202_floppies , "8ssdd" , isbc202_floppy_formats).set_fixed(true); + } +} + +void isbc202_device::execute_run() +{ + do { + m_microcode_addr = m_mcu->addr_r(); + debugger_instruction_hook(m_microcode_addr); + m_code_word = m_cache->read_dword(m_microcode_addr); + + // Unpack microcode into fields + // Bits Field + //================ + // 31..25 Address Control + // 24..18 Function Code + // 17 Flag Control bits 3 & 2 + // 16 Flag Control bits 1 & 0 + // 15..13 Input multiplexer selection + // 12..10 Output control + // 9..8 SLK field + // 7..0 Mask field + m_ac = (uint8_t)(m_code_word >> 25); + m_fc = (uint8_t)((m_code_word >> 18) & 0x7f); + m_fc32 = BIT(m_code_word , 17); + m_fc10 = BIT(m_code_word , 16); + m_in_sel = (uint8_t)((m_code_word >> 13) & 7); + m_out_sel = (uint8_t)((m_code_word >> 10) & 7); + m_slk = (uint8_t)((m_code_word >> 8) & 3); + m_mask = (uint8_t)m_code_word; + + m_mcu->fc_w((m_fc32 ? 0b1100 : 0b0000) | (m_fc10 ? 0b0011 : 0b0000)); + + // Set outputs + if (BIT(m_slk , 0) && !BIT(m_mask , 7)) { + set_output(); + } + + // Compute K-bus + if (!BIT(m_slk , 0)) { + m_kbus = m_mask; + } else if (m_slk == 1) { + m_kbus = 0xff; + } else { + m_kbus = 0; + } + + m_ibus_cached = false; + + // Update CPEs + m_cpes[ 0 ]->fc_kbus_w(m_fc , m_kbus); + m_cpes[ 1 ]->fc_kbus_w(m_fc , m_kbus >> 2); + m_cpes[ 2 ]->fc_kbus_w(m_fc , m_kbus >> 4); + m_cpes[ 3 ]->fc_kbus_w(m_fc , m_kbus >> 6); + if (m_cpes[ 0 ]->update_ro()) { + // Data propagate to right (right-shift op) + m_cpes[ 3 ]->clk_w(1); + m_cpes[ 2 ]->clk_w(1); + m_cpes[ 1 ]->clk_w(1); + m_cpes[ 0 ]->clk_w(1); + } else { + // Data propagate to left (every op but right-shift) + m_cpes[ 0 ]->clk_w(1); + m_cpes[ 1 ]->clk_w(1); + m_cpes[ 2 ]->clk_w(1); + m_cpes[ 3 ]->clk_w(1); + } + + // Update MCU + if (m_in_sel == IN_SEL_AC0) { + m_mcu->ac_w(m_ac); + } else { + m_mcu->ac_w((m_ac & 0b1111110) | m_inputs[ m_in_sel ]); + } + m_mcu->clk_w(1); + + m_icount--; + } while (m_icount > 0); +} + +device_memory_interface::space_config_vector isbc202_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(AS_PROGRAM , &m_program_config) + }; +} + +std::unique_ptr<util::disasm_interface> isbc202_device::create_disassembler() +{ + return std::make_unique<isbc202_disassembler>(); +} + +void isbc202_device::state_import(const device_state_entry &entry) +{ + switch (entry.index()) { + case i3002_device::REG_R0: + case i3002_device::REG_R1: + case i3002_device::REG_R2: + case i3002_device::REG_R3: + case i3002_device::REG_R4: + case i3002_device::REG_R5: + case i3002_device::REG_R6: + case i3002_device::REG_R7: + case i3002_device::REG_R8: + case i3002_device::REG_R9: + case i3002_device::REG_T: + case i3002_device::REG_AC: + case i3002_device::REG_MAR: + m_cpes[ 0 ]->get_reg(entry.index()) = m_regs[ entry.index() ] & i3002_device::WORD_MASK; + m_cpes[ 1 ]->get_reg(entry.index()) = (m_regs[ entry.index() ] >> 2) & i3002_device::WORD_MASK; + m_cpes[ 2 ]->get_reg(entry.index()) = (m_regs[ entry.index() ] >> 4) & i3002_device::WORD_MASK; + m_cpes[ 3 ]->get_reg(entry.index()) = (m_regs[ entry.index() ] >> 6) & i3002_device::WORD_MASK; + break; + + default: + break; + } +} + +void isbc202_device::state_export(const device_state_entry &entry) +{ + switch (entry.index()) { + case STATE_GENFLAGS: + m_flags = 0; + if (m_inputs[ IN_SEL_CO ]) { + BIT_SET(m_flags , 0); + } + if (m_mcu->fo_r()) { + BIT_SET(m_flags , 1); + } + if (m_mcu->carry_r()) { + BIT_SET(m_flags , 2); + } + if (m_mcu->zero_r()) { + BIT_SET(m_flags , 3); + } + break; + + case i3002_device::REG_R0: + case i3002_device::REG_R1: + case i3002_device::REG_R2: + case i3002_device::REG_R3: + case i3002_device::REG_R4: + case i3002_device::REG_R5: + case i3002_device::REG_R6: + case i3002_device::REG_R7: + case i3002_device::REG_R8: + case i3002_device::REG_R9: + case i3002_device::REG_T: + case i3002_device::REG_AC: + case i3002_device::REG_MAR: + m_regs[ entry.index() ] = m_cpes[ 3 ]->get_reg(entry.index()); + m_regs[ entry.index() ] <<= 2; + m_regs[ entry.index() ] |= m_cpes[ 2 ]->get_reg(entry.index()); + m_regs[ entry.index() ] <<= 2; + m_regs[ entry.index() ] |= m_cpes[ 1 ]->get_reg(entry.index()); + m_regs[ entry.index() ] <<= 2; + m_regs[ entry.index() ] |= m_cpes[ 0 ]->get_reg(entry.index()); + break; + + default: + break; + } +} + +void isbc202_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) { + case STATE_GENFLAGS: + str = string_format("%c %c %s %s" , + BIT(m_flags , 3) ? 'Z' : '-' , + BIT(m_flags , 2) ? 'C' : '-' , + BIT(m_flags , 1) ? "FO" : "--" , + BIT(m_flags , 0) ? "FI" : "--"); + break; + + default: + break; + } +} + +void isbc202_device::set_output() +{ + switch (m_out_sel) { + case 0: + // Bit What + // 6..3 - + // 2 Head load + // 1 Start timeout + // 0 Step pulse + if (BIT(m_mask , 1)) { + m_inputs[ IN_SEL_TIMEOUT ] = false; + m_timeout_timer->adjust(attotime::from_msec(TIMEOUT_MS)); + } + if (BIT(m_mask , 0) && (!m_direction || m_current_drive->trk00_r())) { + LOG_DR("Step %s\n" , m_direction ? "OUT" : "IN"); + m_current_drive->dir_w(m_direction); + m_current_drive->stp_w(0); + m_current_drive->stp_w(1); + } + break; + + case 1: + // Bit What + // 6 Reset data overrun + // 5 Set XACK + // 4 Set write inhibit + // 3 Clear write inhibit + // 2 - + // 1 Reset RDY latches (0) + // 0 - + if (BIT(m_mask , 5)) { + if (m_cpu != nullptr) { + // Release CPU from wait state + LOG_BUS("CPU out of wait state\n"); + m_cpu->trigger(1); + if (!m_cpu_rd) { + m_cpu = nullptr; + } + // Ensure the MCU executes a few instruction before the CPU + machine().scheduler().boost_interleave(attotime::from_usec(1) , attotime::from_usec(5)); + } else { + LOG("No CPU to wake up?\n"); + } + m_inputs[ IN_SEL_START ] = false; + } + if (BIT(m_mask , 4)) { + m_wrt_inh = true; + } + if (BIT(m_mask , 3)) { + m_wrt_inh = false; + } + if (!BIT(m_mask , 1)) { + m_ready_ff = 0xf; + } + break; + + case 2: + // Bit What + // 6..2 - + // 1..0 s1:s0 for PX input selection + m_px_s1s0 = m_mask & 3; + break; + + case 3: + // Bit What + // 6 Z2 + // 5 SR OUT (0 = DATA, 1 = CRC) + // 4 Write gate (0) + // 3 - + // 2 Z1 + // 1..0 - + m_crc_out = BIT(m_mask , 5); + set_rd_wr(m_reading, !BIT(m_mask , 4)); + break; + + case 4: + // Bit What + // 6 Stepping direction (1 = out, 0 = in) + // 5 CRC enable (0) + // 4..0 - + m_direction = BIT(m_mask , 6); + m_crc_enabled = !BIT(m_mask , 5); + break; + + case 5: + // Bit What + // 6..5 - + // 4 Mem write (0) + // 3 GATE LOWER (0) + // 2 - + // 1 INOP RESET (0) + // 0 AMWRT + m_mem_wrt = !BIT(m_mask , 4); + m_gate_lower = BIT(m_mask , 3); + m_amwrt = BIT(m_mask , 0); + break; + + case 6: + // Bit What + // 6 Latch data bus into A24/A25 + // 5 Set INT FF + // 4 Set Track > 43 + // 3 Latch D into A[7..0] + // 2 Latch D into D[7..0] + // 1 Latch D into D[F..8] + // 0 Set XFER REQ + if (BIT(m_mask , 6)) { + m_data_low_in = m_cpu_data; + } + if (BIT(m_mask , 5)) { + m_irq = true; + } + if (BIT(m_mask , 3)) { + m_addr_low_out = dbus_r(); + } + if (BIT(m_mask , 2)) { + m_data_low_out = dbus_r(); + } + if (BIT(m_mask , 0)) { + if (m_mem_wrt) { + if (!m_wrt_inh) { + // CPU memory write + uint16_t addr = m_addr_low_out | ((uint16_t)abus_r() << 8); + if (m_mem_space) { + LOG_BUS("MEM W %04x=%02x\n" , addr , m_data_low_out); + m_mem_space->write_byte(addr , m_data_low_out); + } else { + LOG("CPU AS not set!\n"); + } + } + } else { + // CPU memory read + uint16_t addr = m_addr_low_out | ((uint16_t)abus_r() << 8); + if (m_mem_space) { + m_data_low_in = m_mem_space->read_byte(addr); + LOG_BUS("MEM R %04x=%02x\n" , addr , m_data_low_in); + } else { + LOG("CPU AS not set!\n"); + } + } + } + break; + + case 7: + // Bit What + // 6 Latch OP & US + // 5 Reset INDEX + // 4 Set Track <= 43 + // 3 Clear START/STOP + // 2 Unload head + // 1 Set RESET READ + // 0 Clear RESET READ + if (BIT(m_mask , 6)) { + m_op_us = dbus_r() & 0x3f; + m_current_drive = m_drives[ selected_drive() ]->get_device(); + } + if (BIT(m_mask , 5)) { + m_inputs[ IN_SEL_INDEX ] = false; + } + if (BIT(m_mask , 3)) { + m_cmd = 0; + LOG_BUS("CLR ST\n"); + // TODO: more + } + if (BIT(m_mask , 1)) { + set_rd_wr(false, m_writing); + } + if (BIT(m_mask , 0)) { + set_rd_wr(true, m_writing); + } + break; + } +} + +unsigned isbc202_device::selected_drive() const +{ + return (m_op_us >> 4) & 3; +} + +unsigned isbc202_device::drive_idx(floppy_image_device *drive) +{ + for (unsigned i = 0; i < 4; ++i) { + if (drive == m_drives[ i ]->get_device()) { + return i; + } + } + LOG("Unknown drive!\n"); + return 0; +} + +void isbc202_device::floppy_ready_cb(floppy_image_device *floppy , int state) +{ + unsigned idx = drive_idx(floppy); + + uint8_t old_state = m_ready_in; + + if (!state) { + BIT_SET(m_ready_in , idx); + } else { + BIT_CLR(m_ready_in , idx); + } + + uint8_t gone_not_ready = ~m_ready_in & old_state; + + BIT_CLR(gone_not_ready, selected_drive()); + + m_ready_ff &= ~gone_not_ready; +} + +void isbc202_device::floppy_index_cb(floppy_image_device *floppy , int state) +{ + if (state && floppy == m_current_drive) { + LOG_DR("Index @%.6f\n" , machine().time().as_double()); + m_inputs[ IN_SEL_INDEX ] = true; + } +} + +uint8_t isbc202_device::dbus_r() const +{ + return m_cpes[ 0 ]->dbus_r() | + (m_cpes[ 1 ]->dbus_r() << 2) | + (m_cpes[ 2 ]->dbus_r() << 4) | + (m_cpes[ 3 ]->dbus_r() << 6); +} + +uint8_t isbc202_device::mbus_r() const +{ + return m_gate_lower ? 0 : m_data_low_in; +} + +uint8_t isbc202_device::ibus_r() +{ + if (!m_ibus_cached) { + m_ibus_cached = true; + m_ibus = 0xff; + if (BIT(m_slk , 0) && BIT(m_mask , 7)) { + if (BIT(m_mask , 5)) { + // Bit What + // 7 Drive 3/1 ready + // 6 Drive 2/0 ready + // 5 Track 0 + // 4 STOP + // 3..0 1 + m_ibus = 0x0f; + uint8_t ready = m_ready_in & m_ready_ff; + if (m_gate_lower) { + ready >>= 2; + } + if (BIT(ready , 1)) { + BIT_SET(m_ibus, 7); + } + if (BIT(ready , 0)) { + BIT_SET(m_ibus, 6); + } + if (!m_current_drive->trk00_r()) { + BIT_SET(m_ibus, 5); + } + // TODO: STOP bit + } else if (BIT(m_mask , 6)) { + // Bit What + // 7 Selected drive not ready + // 6 Write fault + // 5 Write protection + // 4 Data overrun + // 3..0 1 + m_ibus = 0x0f; + if (!BIT(m_ready_in , selected_drive())) { + BIT_SET(m_ibus, 7); + } + if (m_current_drive->wpt_r()) { + BIT_SET(m_ibus, 5); + } + } else if (BIT(m_mask , 3)) { + // Read clock SR + m_ibus = aligned_rd_data(m_clock_sr); + } else if (BIT(m_mask , 4)) { + // Read data SR + m_ibus = aligned_rd_data(m_data_sr); + } + } + } + + return m_ibus; +} + +uint8_t isbc202_device::abus_r() const +{ + return m_cpes[ 0 ]->abus_r() | + (m_cpes[ 1 ]->abus_r() << 2) | + (m_cpes[ 2 ]->abus_r() << 4) | + (m_cpes[ 3 ]->abus_r() << 6); +} + +void isbc202_device::set_start(uint8_t off , bool read) +{ + m_cmd = off; + m_inputs[ IN_SEL_START ] = true; + // Put CPU in wait state + m_cpu->spin_until_trigger(1); + m_cpu_rd = read; + LOG_BUS("CPU in wait state (rd=%d)\n" , read); + if (read) { + // If CPU is suspended when reading, rewind PC so that the + // "IN" instruction is repeated when CPU is released + m_cpu->set_pc(m_cpu->pc() - 2); + } +} + +void isbc202_device::set_rd_wr(bool new_rd , bool new_wr) +{ + if (!m_reading && new_rd) { + // Start reading + LOG_RD("Start RD @%.6f\n" , machine().time().as_double()); + m_pll.set_clock(attotime::from_usec(HALF_BIT_CELL_US)); + m_pll.read_reset(machine().time()); + + // Search for next SYNC (16x 1 and a 0) + m_byte_timer->reset(); + m_f_timer->reset(); + unsigned cnt_trans = 0; + attotime rot_period = attotime::from_hz(6); + while ((m_pll.ctime - machine().time()) < rot_period) { + attotime edge = m_current_drive->get_next_transition(m_pll.ctime); + if (edge.is_never()) { + break; + } + attotime tm; + bool bit = m_pll.feed_read_data(tm , edge , attotime::never); + if (cnt_trans < 32) { + if (!(BIT(cnt_trans , 0) ^ bit)) { + cnt_trans++; + } else { + cnt_trans = 0; + } + } else if (cnt_trans == 32) { + if (!bit) { + cnt_trans++; + } else { + cnt_trans = 0; + } + } else { + if (!bit) { + LOG_RD("SYNC found @%.6f\n" , m_pll.ctime.as_double()); + // GOT SYNC! + if (m_crc_enabled) { + // CRC shouldn't be enabled here or register won't get cleared + LOG("Huh? CRC enabled during SYNC scan?\n"); + } + m_crc = 0; + // Load the "0" bit into data/clock SR + m_data_sr = 0; + m_clock_sr = 0; + // Read 7 more bits to make a full byte + rd_bits(7); + // Timer to go off at end of 8th bit of AM byte (when F signal goes high) + m_byte_timer->adjust(m_pll.ctime - machine().time()); + break; + } else { + cnt_trans = 32; + } + } + } + } else if (m_reading && !new_rd) { + // Stop reading + LOG_RD("Stop RD\n"); + m_byte_timer->reset(); + m_f_timer->reset(); + m_inputs[ IN_SEL_F ] = false; + } + m_reading = new_rd; + + if (!m_writing && new_wr) { + // Start writing + LOG_WR("Start WR\n"); + m_pll.set_clock(attotime::from_usec(HALF_BIT_CELL_US)); + m_pll.start_writing(machine().time()); + m_pll.ctime = machine().time(); + m_last_data_bit = false; + m_byte_timer->adjust(attotime::from_usec(HALF_BIT_CELL_US * 14)); + } else if (m_writing && !new_wr) { + // Stop writing + LOG_WR("Stop WR\n"); + m_pll.stop_writing(m_current_drive , machine().time()); + m_byte_timer->reset(); + m_f_timer->reset(); + m_inputs[ IN_SEL_F ] = false; + } + m_writing = new_wr; +} + +uint8_t isbc202_device::aligned_rd_data(uint16_t sr) +{ + attotime tmp{ machine().time() - m_last_f_time }; + + // Compute how many bit cells have gone by since the last time F went high + unsigned bits = tmp.as_ticks(BIT_FREQUENCY); + if (bits) { + LOG_RD("Aligning by %u bits\n" , bits); + sr <<= bits; + } + return (uint8_t)(sr >> 8); +} + +void isbc202_device::rd_bits(unsigned n) +{ + while (n--) { + attotime edge = m_current_drive->get_next_transition(m_pll.ctime); + if (edge.is_never()) { + break; + } + attotime tm; + bool clock_bit = m_pll.feed_read_data(tm , edge , attotime::never); + edge = m_current_drive->get_next_transition(m_pll.ctime); + if (edge.is_never()) { + break; + } + bool data_bit = m_pll.feed_read_data(tm , edge , attotime::never); + + m_clock_sr = (m_clock_sr << 1) | clock_bit; + bool crc_bit = BIT(m_data_sr , 15); + m_data_sr = (m_data_sr << 1) | data_bit; + update_crc(crc_bit); + } + LOG_RD("CLK %04x DT %04x CRC %04x\n" , m_clock_sr , m_data_sr , m_crc); +} + +void isbc202_device::write_byte() +{ + LOG_WR("WR DT %02x CRC %04x CE %d CO %d AW %d @%.6f\n" , m_data_sr & 0xff , m_crc , m_crc_enabled , m_crc_out , m_dlyd_amwrt , machine().time().as_double()); + + for (unsigned i = 0; i < 8; i++) { + bool sr_bit = BIT(m_data_sr , 7); + bool crc_bit = update_crc(sr_bit); + bool data_bit = m_crc_out ? crc_bit : sr_bit; + bool clock_bit = m_clock_gate && !data_bit && !m_last_data_bit; + if (i <= 3 && m_dlyd_amwrt) { + m_clock_gate = true; + } else { + m_clock_gate = !data_bit && !clock_bit; + } + attotime dummy; + + m_pll.write_next_bit(clock_bit , dummy , nullptr , attotime::never); + m_pll.write_next_bit(data_bit , dummy , nullptr , attotime::never); + m_data_sr <<= 1; + m_last_data_bit = data_bit; + } + m_pll.commit(m_current_drive , machine().time()); + m_pll.ctime = machine().time(); +} + +bool isbc202_device::update_crc(bool bit) +{ + bool out = BIT(m_crc , 15); + + if (m_crc_enabled && (out ^ bit)) { + m_crc = (m_crc << 1) ^ CRC_POLY; + } else { + m_crc <<= 1; + } + + return out; +} diff --git a/src/devices/bus/multibus/isbc202.h b/src/devices/bus/multibus/isbc202.h new file mode 100644 index 00000000000..b72e860b9fc --- /dev/null +++ b/src/devices/bus/multibus/isbc202.h @@ -0,0 +1,160 @@ +// license:BSD-3-Clause +// copyright-holders: F. Ulivi +/********************************************************************* + + isbc202.h + + Intel iSBC-202 SSDD 8" floppy disk controller + +*********************************************************************/ + +#ifndef MAME_BUS_MULTIBUS_ISBC202_H +#define MAME_BUS_MULTIBUS_ISBC202_H + +#pragma once + +#include "multibus.h" +#include "machine/i3001.h" +#include "machine/i3002.h" +#include "machine/fdc_pll.h" +#include "imagedev/floppy.h" + +class isbc202_device : public cpu_device, + public device_multibus_interface +{ +public: + // Construction/destruction + isbc202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual ~isbc202_device(); + + // device_multibus_interface overrides + virtual void install_io_rw(address_space& space) override; + virtual void install_mem_rw(address_space& space) override; + + // Access to I/O space by CPU + DECLARE_READ8_MEMBER(io_r); + DECLARE_WRITE8_MEMBER(io_w); + + DECLARE_WRITE_LINE_MEMBER(co_w); + + DECLARE_READ8_MEMBER(px_r); + +protected: + // device_t overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + // device_execute_interface overrides + virtual uint32_t execute_min_cycles() const noexcept override { return 1; } + virtual void execute_run() override; + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + // device_state_interface overrides + virtual void state_import(const device_state_entry &entry) override; + virtual void state_export(const device_state_entry &entry) override; + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + +private: + required_device<i3001_device> m_mcu; + required_device_array<i3002_device , 4> m_cpes; + required_device_array<floppy_connector , 4> m_drives; + + address_space_config m_program_config; + memory_access_cache<2 , -2 , ENDIANNESS_BIG> *m_cache; + + address_space *m_mem_space; + + int m_icount; + uint8_t m_flags; + uint8_t m_regs[ i3002_device::REG_COUNT ]; + uint16_t m_microcode_addr; + uint32_t m_code_word; + uint8_t m_ac; + uint8_t m_fc; + bool m_fc32; + bool m_fc10; + enum { // m_in_sel Input on AC[0] + IN_SEL_AC0, // 0 AC[0] + IN_SEL_CO, // 1 CO + IN_SEL_START, // 2 START + IN_SEL_F, // 3 F + IN_SEL_AZ, // 4 AZ + IN_SEL_INDEX, // 5 INDEX + IN_SEL_XFERQ, // 6 XFERREQ + IN_SEL_TIMEOUT,//7 TIMEOUT + IN_SEL_COUNT + }; + uint8_t m_in_sel; + uint8_t m_out_sel; + uint8_t m_slk; + uint8_t m_mask; + uint8_t m_kbus; + bool m_inputs[ IN_SEL_COUNT ]; + // IC identifiers have this form: x-Ayy + // where x is either C (for channel board) or I (for interface board) + // and yy is the numeric IC ID. + uint8_t m_op_us; // C-A44 + floppy_image_device *m_current_drive; + uint8_t m_px_s1s0; // C-A16-11 & C-A16-13 + uint8_t m_cmd; // C-A8 + cpu_device *m_cpu; // When != nullptr: CPU is suspended in wait state + bool m_cpu_rd; + uint8_t m_ready_in; + uint8_t m_ready_ff; // I-A44 & I-A43 + bool m_gate_lower; // I-A58-9 + bool m_irq; // C-A37-9 + uint8_t m_data_low_out; // C-A43 + uint8_t m_data_low_in; // C-A25 + uint8_t m_cpu_data; + uint8_t m_addr_low_out; // C-A41 + bool m_mem_wrt; // I-A58-4 + bool m_wrt_inh; // I-A46-13 + bool m_direction; // I-A58-11 + bool m_ibus_cached; + uint8_t m_ibus; + uint16_t m_crc; // I-A62 + bool m_crc_enabled; // I-A58-13 + bool m_crc_out; // C-A16-2 + bool m_reading; // I-A46-9 + bool m_writing; // C-A16-4 + uint16_t m_data_sr; // C-A36 & C-A29 (MSB), next byte in LSB + bool m_last_data_bit; // I-A48-6 + uint16_t m_clock_sr; // C-A34 & C-A27 (MSB), next byte in LSB + attotime m_last_f_time; + bool m_clock_gate; // I-A10-8 + bool m_amwrt; // I-A58-6 + bool m_dlyd_amwrt; + + // PLL + fdc_pll_t m_pll; + + // Timers + emu_timer *m_timeout_timer; + emu_timer *m_byte_timer; + emu_timer *m_f_timer; + + void set_output(); + unsigned selected_drive() const; + unsigned drive_idx(floppy_image_device *drive); + void floppy_ready_cb(floppy_image_device *floppy , int state); + void floppy_index_cb(floppy_image_device *floppy , int state); + uint8_t dbus_r() const; + uint8_t mbus_r() const; + uint8_t abus_r() const; + uint8_t ibus_r(); + void set_start(uint8_t off , bool read); + void set_rd_wr(bool new_rd , bool new_wr); + uint8_t aligned_rd_data(uint16_t sr); + void rd_bits(unsigned n); + void write_byte(); + bool update_crc(bool bit); +}; + +// device type declaration +DECLARE_DEVICE_TYPE(ISBC202, isbc202_device) + +#endif /* MAME_BUS_MULTIBUS_ISBC202_H */ diff --git a/src/devices/bus/multibus/multibus.cpp b/src/devices/bus/multibus/multibus.cpp new file mode 100644 index 00000000000..11ee4e7fb0d --- /dev/null +++ b/src/devices/bus/multibus/multibus.cpp @@ -0,0 +1,59 @@ +// license:BSD-3-Clause +// copyright-holders: F. Ulivi +/********************************************************************* + + multibus.cpp + + Intel Multibus + +*********************************************************************/ + +#include "emu.h" +#include "multibus.h" +#include "isbc202.h" + +// device type definition +DEFINE_DEVICE_TYPE(MULTIBUS_SLOT, multibus_slot_device, "multibus_slot", "Intel Multibus slot") + +multibus_slot_device::multibus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig , MULTIBUS_SLOT , tag , owner , clock) + , device_single_card_slot_interface<device_multibus_interface>(mconfig , *this) +{ + option_reset(); + option_add("isbc202" , ISBC202); + set_default_option(nullptr); + set_fixed(false); +} + +multibus_slot_device::~multibus_slot_device() +{ +} + +void multibus_slot_device::install_io_rw(address_space& space) +{ + device_multibus_interface *card = get_card_device(); + if (card) { + card->install_io_rw(space); + } +} + +void multibus_slot_device::install_mem_rw(address_space& space) +{ + device_multibus_interface *card = get_card_device(); + if (card) { + card->install_mem_rw(space); + } +} + +void multibus_slot_device::device_start() +{ +} + +device_multibus_interface::device_multibus_interface(const machine_config &mconfig , device_t &device) + : device_interface(device , "multibus") +{ +} + +device_multibus_interface::~device_multibus_interface() +{ +} diff --git a/src/devices/bus/multibus/multibus.h b/src/devices/bus/multibus/multibus.h new file mode 100644 index 00000000000..f45a486a516 --- /dev/null +++ b/src/devices/bus/multibus/multibus.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders: F. Ulivi +/********************************************************************* + + multibus.h + + Intel Multibus + +*********************************************************************/ + +#ifndef MAME_BUS_MULTIBUS_MULTIBUS_H +#define MAME_BUS_MULTIBUS_MULTIBUS_H + +#pragma once + +class device_multibus_interface; + +class multibus_slot_device : public device_t, + public device_single_card_slot_interface<device_multibus_interface> +{ +public: + multibus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~multibus_slot_device(); + + static constexpr unsigned BUS_CLOCK = 9830400; + + // Install r/w functions in I/O space + void install_io_rw(address_space& space); + + // Set memory space + void install_mem_rw(address_space& space); + +protected: + virtual void device_start() override; +}; + +class device_multibus_interface : public device_interface +{ +public: + // Install r/w functions in I/O space + virtual void install_io_rw(address_space& space) = 0; + + // Set CPU memory space + virtual void install_mem_rw(address_space& space) = 0; + +protected: + device_multibus_interface(const machine_config &mconfig , device_t &device); + virtual ~device_multibus_interface(); +}; + +// device type declaration +DECLARE_DEVICE_TYPE(MULTIBUS_SLOT, multibus_slot_device) + +#endif /* MAME_BUS_MULTIBUS_MULTIBUS_H */ diff --git a/src/devices/bus/rs232/pty.cpp b/src/devices/bus/rs232/pty.cpp index 4c8c9f6bbf7..dec296006be 100644 --- a/src/devices/bus/rs232/pty.cpp +++ b/src/devices/bus/rs232/pty.cpp @@ -4,7 +4,7 @@ #include "emu.h" #include "pty.h" -#include <stdio.h> +#include <cstdio> static constexpr int TIMER_POLL = 1; diff --git a/src/devices/bus/sdk85/i8755.cpp b/src/devices/bus/sdk85/i8755.cpp new file mode 100644 index 00000000000..8c1d7a79fbf --- /dev/null +++ b/src/devices/bus/sdk85/i8755.cpp @@ -0,0 +1,65 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#include "emu.h" +#include "i8755.h" + +// device type definition +DEFINE_DEVICE_TYPE(SDK85_I8755, sdk85exp_i8755_device, "sdk85exp_i8755", "SDK-85 PROM I/O Expansion (Intel 8755)") + +sdk85exp_i8755_device::sdk85exp_i8755_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, SDK85_I8755, tag, owner, clock) + , device_sdk85_romexp_card_interface(mconfig, *this) + , m_i8755(*this, "i8755") +{ +} + +void sdk85exp_i8755_device::device_start() +{ +} + +u8 sdk85exp_i8755_device::read_memory(offs_t offset) +{ + return m_i8755->memory_r(offset); +} + +void sdk85exp_i8755_device::write_memory(offs_t offset, u8 data) +{ + logerror("Writing %02Xh to base + %03Xh\n", data, offset); + m_i8755->io_w(offset & 3, data); +} + +u8 sdk85exp_i8755_device::read_io(offs_t offset) +{ + return m_i8755->io_r(offset & 3); +} + +void sdk85exp_i8755_device::write_io(offs_t offset, u8 data) +{ + m_i8755->io_w(offset & 3, data); +} + +void sdk85exp_i8755_device::device_add_mconfig(machine_config &config) +{ + I8355(config, m_i8755, DERIVED_CLOCK(1, 1)); +} + +u8 *sdk85exp_i8755_device::get_rom_base(u32 size) +{ + if (size != 0x800) + { + osd_printf_error("sdk85exp_i8755: Data length must be 2,048 bytes\n"); + return nullptr; + } + + return memregion("i8755")->base(); +} + +ROM_START(sdk85exp_i8755) + ROM_REGION(0x800, "i8755", ROMREGION_ERASE00) +ROM_END + +const tiny_rom_entry *sdk85exp_i8755_device::device_rom_region() const +{ + return ROM_NAME(sdk85exp_i8755); +} diff --git a/src/devices/bus/sdk85/i8755.h b/src/devices/bus/sdk85/i8755.h new file mode 100644 index 00000000000..2960be386e7 --- /dev/null +++ b/src/devices/bus/sdk85/i8755.h @@ -0,0 +1,40 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_BUS_SDK85_I8755_H +#define MAME_BUS_SDK85_I8755_H + +#pragma once + +#include "memexp.h" +#include "machine/i8355.h" + +// ======================> sdk85exp_i8755_device + +class sdk85exp_i8755_device : public device_t, public device_sdk85_romexp_card_interface +{ +public: + // construction/destruction + sdk85exp_i8755_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_sdk85_romexp_card_interface overrides + virtual u8 read_memory(offs_t offset) override; + virtual void write_memory(offs_t offset, u8 data) override; + virtual u8 read_io(offs_t offset) override; + virtual void write_io(offs_t offset, u8 data) override; + virtual u8 *get_rom_base(u32 size) override; + +private: + required_device<i8355_device> m_i8755; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(SDK85_I8755, sdk85exp_i8755_device) + +#endif // MAME_BUS_SDK85_I8755_H diff --git a/src/devices/bus/sdk85/memexp.cpp b/src/devices/bus/sdk85/memexp.cpp new file mode 100644 index 00000000000..ba7f402ca68 --- /dev/null +++ b/src/devices/bus/sdk85/memexp.cpp @@ -0,0 +1,94 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + SDK-85 memory expansion (ALE-multiplexed) + +***************************************************************************/ + +#include "emu.h" +#include "memexp.h" + +#include "i8755.h" + +// device type definition +DEFINE_DEVICE_TYPE(SDK85_ROMEXP, sdk85_romexp_device, "sdk85_romexp", "SDK-85 expansion ROM socket") + +sdk85_romexp_device::sdk85_romexp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, SDK85_ROMEXP, tag, owner, clock) + , device_image_interface(mconfig, *this) + , device_single_card_slot_interface<device_sdk85_romexp_card_interface>(mconfig, *this) + , m_dev(nullptr) +{ +} + +image_init_result sdk85_romexp_device::call_load() +{ + if (get_card_device() != nullptr) + { + u32 size = loaded_through_softlist() ? get_software_region_length("rom") : length(); + u8 *base = get_card_device()->get_rom_base(size); + if (base == nullptr) + return image_init_result::FAIL; + + if (loaded_through_softlist()) + memcpy(base, get_software_region("rom"), size); + else + fread(base, size); + } + + return image_init_result::PASS; +} + +std::string sdk85_romexp_device::get_default_card_software(get_default_card_software_hook &hook) const +{ + return software_get_default_slot("i8755"); +} + +void sdk85_romexp_device::device_start() +{ + m_dev = get_card_device(); +} + +u8 sdk85_romexp_device::memory_r(offs_t offset) +{ + if (m_dev != nullptr) + return m_dev->read_memory(offset); + else + return 0xff; +} + +void sdk85_romexp_device::memory_w(offs_t offset, u8 data) +{ + if (m_dev != nullptr) + m_dev->write_memory(offset, data); +} + +u8 sdk85_romexp_device::io_r(offs_t offset) +{ + if (m_dev != nullptr) + return m_dev->read_io(offset); + else + return 0xff; +} + +void sdk85_romexp_device::io_w(offs_t offset, u8 data) +{ + if (m_dev != nullptr) + m_dev->write_io(offset, data); +} + +void sdk85_romexp_device::rom_options(device_slot_interface &slot) +{ + slot.option_add_internal("i8755", SDK85_I8755); +} + +device_sdk85_romexp_card_interface::device_sdk85_romexp_card_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "sdk85_romexp") +{ +} + +u8 *device_sdk85_romexp_card_interface::get_rom_base(u32 size) +{ + return nullptr; +} diff --git a/src/devices/bus/sdk85/memexp.h b/src/devices/bus/sdk85/memexp.h new file mode 100644 index 00000000000..3023ea584bf --- /dev/null +++ b/src/devices/bus/sdk85/memexp.h @@ -0,0 +1,83 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_BUS_SDK85_MEMEXP_H +#define MAME_BUS_SDK85_MEMEXP_H + +#pragma once + +#include "softlist_dev.h" + +// ======================> device_sdk85_romexp_card_interface + +class device_sdk85_romexp_card_interface : public device_interface +{ + friend class sdk85_romexp_device; + +protected: + device_sdk85_romexp_card_interface(const machine_config &mconfig, device_t &device); + + virtual u8 read_memory(offs_t offset) = 0; + virtual void write_memory(offs_t offset, u8 data) = 0; + virtual u8 read_io(offs_t offset) = 0; + virtual void write_io(offs_t offset, u8 data) = 0; + + virtual u8 *get_rom_base(u32 size); +}; + +// ======================> sdk85_romexp_device + +class sdk85_romexp_device : public device_t, + public device_image_interface, + public device_single_card_slot_interface<device_sdk85_romexp_card_interface> +{ +public: + // construction/destruction + sdk85_romexp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + template <typename T> + sdk85_romexp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&opts, const char *dflt) + : sdk85_romexp_device(mconfig, tag, owner, clock) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + + static void rom_options(device_slot_interface &device); + + u8 memory_r(offs_t offset); + void memory_w(offs_t offset, u8 data); + u8 io_r(offs_t offset); + void io_w(offs_t offset, u8 data); + +protected: + // device-level overrides + virtual void device_start() override; + + // image-level overrides + virtual image_init_result call_load() override; + virtual void call_unload() override { } + + virtual iodevice_t image_type() const noexcept override { return IO_ROM; } + virtual bool is_readable() const noexcept override { return true; } + virtual bool is_writeable() const noexcept override { return false; } + virtual bool is_creatable() const noexcept override { return false; } + virtual bool must_be_loaded() const noexcept override { return false; } + virtual bool is_reset_on_load() const noexcept override { return true; } + virtual const char *image_interface() const noexcept override { return "sdk85_rom"; } + virtual const char *file_extensions() const noexcept override { return "bin"; } + + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } + + // slot interface overrides + virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; + +private: + device_sdk85_romexp_card_interface *m_dev; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(SDK85_ROMEXP, sdk85_romexp_device) + +#endif // MAME_BUS_SDK85_MEMEXP_H diff --git a/src/devices/bus/spectrum/mgt.cpp b/src/devices/bus/spectrum/mgt.cpp index 0b244b30034..142e3ef1997 100644 --- a/src/devices/bus/spectrum/mgt.cpp +++ b/src/devices/bus/spectrum/mgt.cpp @@ -103,16 +103,16 @@ v3 rom: use system disk/system tape ver 3a, 3b or 3d +D G+DOS versions: - The rom/system disk versions must match, + The rom/system disk versions must match, v1 rom: system disk/system tape ver 1 v1a rom: system disk/system tape ver 2a - - +D only curiosities: - The earliest v1.0 unit has a very crude pcb (no solder resist or silkscreen markings), - has various rework modifications (cut tracks, flying wires, piggy-backed chips etc.), - the PAL is a 16L6 rather than a 20L8 used in later version (only known dump is bruteforced and converted to gal20v8 target.) - details here: https://web.archive.org/web/20171118171054/http://trastero.speccy.org/cosas/JL/PlusD/PlusD-v1-0.html - + + +D only curiosities: + The earliest v1.0 unit has a very crude pcb (no solder resist or silkscreen markings), + has various rework modifications (cut tracks, flying wires, piggy-backed chips etc.), + the PAL is a 16L6 rather than a 20L8 used in later version (only known dump is bruteforced and converted to gal20v8 target.) + details here: https://web.archive.org/web/20171118171054/http://trastero.speccy.org/cosas/JL/PlusD/PlusD-v1-0.html + from "pick-poke-it" user manual (reguarding v1.0 unit): "A few PLUS D users are still using Version 1 of the ROM which was used in PLUS D's sold in December 1987-January 1988. ... check the serial number on the bottom of your PLUS D. If it's a 4-figure number commencing with 1, @@ -240,7 +240,7 @@ ROM_START(plusd) ROM_SYSTEM_BIOS(1, "unidos", "UNI-DOS v2") ROMX_LOAD("plusd_uni.rom", 0x0000, 0x2000, CRC(60920496) SHA1(399c8c7c8335bc59849a2182c32347603fd0288a), ROM_BIOS(1)) - + ROM_SYSTEM_BIOS(2, "gdos1", "G+DOS v1") ROMX_LOAD("plusd_g1.rom", 0x0000, 0x2000, CRC(e29c0d41) SHA1(fd7e4557d0080a3532200ce72211eb1b185d7d0a), ROM_BIOS(2)) diff --git a/src/devices/bus/ss50/dc5.cpp b/src/devices/bus/ss50/dc5.cpp index 14f47896fe6..2c351f11f75 100644 --- a/src/devices/bus/ss50/dc5.cpp +++ b/src/devices/bus/ss50/dc5.cpp @@ -47,6 +47,7 @@ public: , m_interrupt_select(*this, "INTERRUPT_SELECT") , m_address_mode(*this, "ADDRESS_MODE") , m_two_control_regs(*this, "TWO_CONTROL_REGS") + , m_force_ready(*this, "FORCE_READY") , m_ctrl_reg_bit7_side_select(*this, "CTRL_REG_BIT7_SIDE_SELECT") , m_expected_clock(*this, "EXPECTED_CLOCK") , m_expected_density(*this, "EXPECTED_DENSITY") @@ -55,6 +56,7 @@ public: { } + DECLARE_INPUT_CHANGED_MEMBER(force_ready_change); DECLARE_INPUT_CHANGED_MEMBER(ctrl_reg_bit7_side_select_change); DECLARE_INPUT_CHANGED_MEMBER(expected_clock_change); @@ -99,6 +101,7 @@ private: required_ioport m_interrupt_select; required_ioport m_address_mode; required_ioport m_two_control_regs; + required_ioport m_force_ready; required_ioport m_ctrl_reg_bit7_side_select; required_ioport m_expected_clock; required_ioport m_expected_density; @@ -109,21 +112,32 @@ private: static INPUT_PORTS_START( dc5 ) PORT_START("INTERRUPT_SELECT") - PORT_DIPNAME(0xf, 0, "Interrupt select") + PORT_DIPNAME(0x3, 0, "Interrupt select") PORT_DIPSETTING(0, "N/C") PORT_DIPSETTING(1, "IRQ") PORT_DIPSETTING(2, "NMI/FIRQ") PORT_START("ADDRESS_MODE") - PORT_DIPNAME(0xf, 1, "Address mode") + PORT_DIPNAME(0x1, 1, "Address mode") PORT_DIPSETTING(0, "4 address") PORT_DIPSETTING(1, "16 address") PORT_START("TWO_CONTROL_REGS") - PORT_DIPNAME(0xf, 0, "Two control registers") + PORT_DIPNAME(0x1, 0, "Two control registers") PORT_DIPSETTING(0, "No, DC4 compatible") PORT_DIPSETTING(1, "Yes, DC5 extension") + // The DC5 has two modes for controlling the FDC 'ready' input. One + // mode forces the 'ready' line for a period triggered by the chip + // select, along with the motors. The other mode detects index pulses + // from the disk to control the 'ready' line. Flex2 for the 6800 + // generally needs the 'ready' line forced and Flex9 can use the index + // pulse detection to determine if disks are present. + PORT_START("FORCE_READY") + PORT_CONFNAME(0x1, 0, "Force ready") PORT_CHANGED_MEMBER(DEVICE_SELF, ss50_dc5_device, force_ready_change, 0) + PORT_CONFSETTING(0, DEF_STR(No)) + PORT_CONFSETTING(1, DEF_STR(Yes)) + // This config setting allows checking of the FDC clock rate and // overriding it to assist driver development. The DC5 supports // programming of the clock rate via the second control register, and @@ -149,7 +163,7 @@ static INPUT_PORTS_START( dc5 ) // drive selection. These drivers need to be corrected, but this // option helps identify this issue and work around it. PORT_START("CTRL_REG_BIT7_SIDE_SELECT") - PORT_CONFNAME(0x01, 0, "Control register bit 7") PORT_CHANGED_MEMBER(DEVICE_SELF, ss50_dc5_device, ctrl_reg_bit7_side_select_change, 0) + PORT_CONFNAME(0x1, 0, "Control register bit 7") PORT_CHANGED_MEMBER(DEVICE_SELF, ss50_dc5_device, ctrl_reg_bit7_side_select_change, 0) PORT_CONFSETTING(0, "Inhibits drive selection") PORT_CONFSETTING(1, "Erroneous side select") @@ -159,7 +173,7 @@ static INPUT_PORTS_START( dc5 ) // support for that. This setting is an aid to report unexpected // usage, and it attempts to correct that. PORT_START("EXPECTED_DENSITY") - PORT_CONFNAME(0xff, 0, "Expected density") + PORT_CONFNAME(0x3, 0, "Expected density") PORT_CONFSETTING(0, "-") PORT_CONFSETTING(1, "single density") // Purely single density. PORT_CONFSETTING(2, "double density, with single density track zero") // The default FLEX double density format. @@ -270,6 +284,7 @@ void ss50_dc5_device::device_start() m_fdc_side = 0; m_floppy_motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ss50_dc5_device::floppy_motor_callback),this)); m_motor_timer_out = 0; + m_fdc->set_force_ready(0); m_fdc_prog_clock_div = 12; save_item(NAME(m_fdc_status)); @@ -281,6 +296,11 @@ void ss50_dc5_device::device_start() } +INPUT_CHANGED_MEMBER(ss50_dc5_device::force_ready_change) +{ + control_register_update(); +} + INPUT_CHANGED_MEMBER(ss50_dc5_device::ctrl_reg_bit7_side_select_change) { control_register_update(); @@ -588,6 +608,10 @@ void ss50_dc5_device::control_register_update() floppy->ss_w(side); m_fdc_side = side; } + + // Force the FDC 'ready' line on if the motor line is asserted, but + // only when this forced mode is enabled. + m_fdc->set_force_ready(m_motor_timer_out && m_force_ready->read()); } diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp index 071526016f2..fcb5d904a68 100644 --- a/src/devices/bus/ti99/internal/992board.cpp +++ b/src/devices/bus/ti99/internal/992board.cpp @@ -20,7 +20,7 @@ #define LOG_BANK (1U<<5) // Change ROM banks #define LOG_KEYBOARD (1U<<6) // Keyboard operation -#define VERBOSE ( LOG_WARN ) +#define VERBOSE ( LOG_GENERAL | LOG_WARN ) #include "logmacro.h" #include "992board.h" @@ -344,6 +344,8 @@ void video992_device::device_reset() E80E: Cassette [3] I/O Controller CF40051, Preliminary specification, Texas Instruments + + TODO: Loading still unstable; often failing */ io992_device::io992_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) @@ -354,10 +356,7 @@ io992_device::io992_device(const machine_config &mconfig, device_type type, cons m_keyboard(*this, "LINE%u", 0U), m_set_rom_bank(*this), m_key_row(0), - m_latch_out(0xd7), - m_latch_in(0xd7), - m_communication_disable(true), - m_response_phase(false) + m_hsk_released(true) { } @@ -459,42 +458,42 @@ void io992_device::device_start() uint8_t io992_device::cruread(offs_t offset) { int address = offset << 1; - uint8_t value = 0x7f; // All Hexbus lines high double inp = 0; - int i; - uint8_t bit = 1; - switch (address & 0xf800) + // CRU E000-E7fE: Keyboard + // Read: 1110 0*** **** xxx0 (mirror 07f0) + if ((address & 0xf800)==0xe000) + return BIT(m_keyboard[m_key_row]->read(), offset & 7); + + // CRU E800-EFFE: Hexbus and other functions + // Read: 1110 1*** **** xxx0 (mirror 007f0) + switch (address & 0xf80e) { - case 0xe000: - // CRU E000-E7fE: Keyboard - // Read: 0000 1110 0*** **** (mirror 007f) - value = m_keyboard[m_key_row]->read(); - break; + // Hexbus case 0xe800: - // CRU E800-EFFE: Hexbus and other functions - // Read: 0000 1110 1*** **** (mirror 007f) - for (i=0; i < 6; i++) - { - if ((m_latch_in & m_hexbval[i])==0) value &= ~bit; - bit <<= 1; - } - // e80c (bit 6) seems to be a latch for the response phase - if (!m_response_phase) - value &= ~0x40; + case 0xe802: + case 0xe804: + case 0xe806: + return data_bit(offset&3); + case 0xe808: + return (bus_hsk_level()==ASSERT_LINE)? 0:1; + case 0xe80a: + return (bus_bav_level()==ASSERT_LINE)? 0:1; + + case 0xe80c: + // e80c (bit 6) seems to indicate that the HSK* line has been released + // and is now asserted again + return (m_hsk_released && (bus_hsk_level()==ASSERT_LINE))? 1:0; + case 0xe80e: inp = m_cassette->input(); - if (inp > 0) - value |= 0x80; LOGMASKED(LOG_CASSETTE, "value=%f\n", inp); - break; + return (inp > 0)? 1:0; + default: - LOGMASKED(LOG_CRU, "Unknown access to %04x\n", address); + LOGMASKED(LOG_CRU, "Invalid CRU access to %04x\n", address); } - - LOGMASKED(LOG_CRU, "CRU %04x -> %02x\n", address, value); - - return BIT(value, offset & 7); + return 0; } void io992_device::cruwrite(offs_t offset, uint8_t data) @@ -503,8 +502,6 @@ void io992_device::cruwrite(offs_t offset, uint8_t data) LOGMASKED(LOG_CRU, "CRU %04x <- %1x\n", address, data); - uint8_t olddata = m_latch_out; - switch (address) { // Select the current keyboard row. Also, bit 0 is used to switch the @@ -539,46 +536,22 @@ void io992_device::cruwrite(offs_t offset, uint8_t data) case 0xe802: // ID1 case 0xe804: // ID2 case 0xe806: // ID3 - if (data != 0) m_latch_out |= m_hexbval[offset & 0x07]; - else m_latch_out &= ~m_hexbval[offset & 0x07]; - LOGMASKED(LOG_HEXBUS, "Hexbus latch out = %02x\n", m_latch_out); + set_data_latch(data, offset & 0x03); break; + case 0xe80a: // BAV - // Undocumented, but makes sense according to the ROM - if (data==0) - m_response_phase = false; - // no break - case 0xe808: // HSK - if (data != 0) m_latch_out |= m_hexbval[offset & 0x07]; - else m_latch_out &= ~m_hexbval[offset & 0x07]; + set_bav_line(data!=0? CLEAR_LINE : ASSERT_LINE); + break; - if (m_latch_out != olddata) - { - LOGMASKED(LOG_HEXBUS, "%s %s\n", (address==0xe808)? "HSK*" : "BAV*", (data==0)? "assert" : "clear"); - if (m_communication_disable) - { - // This is not explicitly stated in the specs, but since they - // also claim that communication is disabled on power-up, - // we must turn it on here; the ROM fails to do it. - LOGMASKED(LOG_HEXBUS, "Enabling Hexbus\n"); - m_communication_disable = false; - } - LOGMASKED(LOG_HEXBUS, "Writing to Hexbus: BAV*=%d, HSK*=%d, DATA=%01x\n", (m_latch_out&0x04)!=0, (m_latch_out&0x10)!=0, ((m_latch_out>>4)&0x0c)|(m_latch_out&0x03)); - hexbus_write(m_latch_out); - // Check how the bus has changed. This depends on the states of all - // connected peripherals - m_latch_in = hexbus_read(); - } + case 0xe808: // HSK + set_hsk_line(data!=0? CLEAR_LINE : ASSERT_LINE); + m_hsk_released = (bus_hsk_level()==CLEAR_LINE); break; + case 0xe80c: - LOGMASKED(LOG_HEXBUS, "Hexbus inhibit = %d\n", data); - if (data == 1) - { - m_latch_in = 0xd7; - m_communication_disable = true; - } - else m_communication_disable = false; + set_communication_enabled(data == 0); break; + case 0xe80e: LOGMASKED(LOG_CRU, "Cassette output = %d\n", data); // Tape output. See also ti99_4x.cpp. @@ -601,29 +574,23 @@ void io992_device::hexbus_value_changed(uint8_t data) { // Only latch the incoming data when BAV* is asserted and the Hexbus // is not inhibited - bool bav_asserted = ((m_latch_out & bus::hexbus::HEXBUS_LINE_BAV)==0); - if (!m_communication_disable && bav_asserted) + if (own_bav_level()==ASSERT_LINE) { - LOGMASKED(LOG_HEXBUS, "Hexbus changed and latched: %02x\n", data); - m_latch_in = data; - - if ((data & bus::hexbus::HEXBUS_LINE_HSK)==0) + if (bus_hsk_level()==ASSERT_LINE) { - // If HSK* is lowered and we as the host have it up, this indicates - // the response phase. - if (!m_response_phase && (m_myvalue & bus::hexbus::HEXBUS_LINE_HSK)!=0) - { - LOGMASKED(LOG_HEXBUS, "Incoming response\n"); - m_response_phase = true; - } - // We cannot wait for the CPU explicitly latching HSK* - // as designed, because this implies a true parallel execution - LOGMASKED(LOG_HEXBUS, "Latching HSK*\n"); - m_myvalue &= ~bus::hexbus::HEXBUS_LINE_HSK; + // According to the Hexbus spec, the incoming HSK must be latched + // by hardware + LOGMASKED(LOG_HEXBUS, "Latching HSK*; got data %01x\n", (data>>4)|(data&3)); + latch_hsk(); + } + else + { + LOGMASKED(LOG_HEXBUS, "HSK* released\n"); + m_hsk_released = true; } } else - LOGMASKED(LOG_HEXBUS, "Ignoring Hexbus change (to %02x), latch=%s, BAV*=%d\n", data, m_communication_disable? "inhibit":"enabled", bav_asserted? 0:1); + LOGMASKED(LOG_HEXBUS, "Ignoring Hexbus change (to %02x), BAV*=%d\n", data, (own_bav_level()==ASSERT_LINE)? 0:1); } ioport_constructor io992_device::device_input_ports() const diff --git a/src/devices/bus/ti99/internal/992board.h b/src/devices/bus/ti99/internal/992board.h index dff4f570d79..3b27462b323 100644 --- a/src/devices/bus/ti99/internal/992board.h +++ b/src/devices/bus/ti99/internal/992board.h @@ -116,8 +116,6 @@ protected: void hexbus_value_changed(uint8_t data) override; private: - const uint8_t m_hexbval[6] = { 0x01, 0x02, 0x40, 0x80, 0x10, 0x04 }; - required_device<hexbus::hexbus_device> m_hexbus; required_device<cassette_image_device> m_cassette; required_device<video992_device> m_videoctrl; @@ -129,18 +127,8 @@ private: // Keyboard row int m_key_row; - // Hexbus outgoing signal latch. Should be set to D7 when idle. - // (see hexbus.cpp) - uint8_t m_latch_out; - - // Hexbus incoming signal latch. Should be set to D7 when idle. - uint8_t m_latch_in; - - // Hexbus inhibit. This prevents the incoming latches to store the data. - bool m_communication_disable; - - // Bit 6. It is not documented, but likely to indicate the response phase. - bool m_response_phase; + // HSK* released flag. This is queried as CRU bit 6 (with the current HSK* level). + bool m_hsk_released; }; diff --git a/src/devices/bus/ti99/internal/998board.cpp b/src/devices/bus/ti99/internal/998board.cpp index 77c8470a85e..0199742329a 100644 --- a/src/devices/bus/ti99/internal/998board.cpp +++ b/src/devices/bus/ti99/internal/998board.cpp @@ -2669,12 +2669,10 @@ void oso_device::update_hexbus() // Check how the bus has changed. This depends on the states of all // connected peripherals - uint8_t value1 = hexbus_read(); - // if (value1 != value) LOGMASKED(LOG_OSO, "actually: %02x (BAV*=%d, HSK*=%d, data=%01x)\n", value1, (value1 & 0x04)? 1:0, (value1 & 0x10)? 1:0, ((value1>>4)&0x0c) | (value1&0x03)); // Update the state of BAV and HSK - m_bav = ((value1 & bus::hexbus::HEXBUS_LINE_BAV)==0); - m_hsk = ((value1 & bus::hexbus::HEXBUS_LINE_HSK)==0); + m_bav = (bus_bav_level()==ASSERT_LINE); + m_hsk = (bus_hsk_level()==ASSERT_LINE); // Sometimes, Oso does not have a chance to advance its state after the // last byte was read. In that case, a change of rdsetin would not be @@ -2682,7 +2680,7 @@ void oso_device::update_hexbus() // has happened. if (m_hsk==false) m_rdsetold = false; - m_oldvalue = value1; + m_oldvalue = m_current_bus_value; } /* @@ -2691,8 +2689,8 @@ void oso_device::update_hexbus() void oso_device::hexbus_value_changed(uint8_t data) { // LOGMASKED(LOG_OSO, "Hexbus value changed to %02x\n", data); - bool bav = (data & bus::hexbus::HEXBUS_LINE_BAV)==0; - bool hsk = (data & bus::hexbus::HEXBUS_LINE_HSK)==0; + bool bav = (bus_bav_level()==ASSERT_LINE); + bool hsk = (bus_hsk_level()==ASSERT_LINE); if ((bav != m_bav) || (hsk != m_hsk)) { @@ -2700,7 +2698,7 @@ void oso_device::hexbus_value_changed(uint8_t data) m_hsk = hsk; LOGMASKED(LOG_HEXBUS, "BAV*=%d, HSK*=%d\n", m_bav? 0:1, m_hsk? 0:1); - int nibble = ((data & bus::hexbus::HEXBUS_LINE_BIT32)>>4) | (data & bus::hexbus::HEXBUS_LINE_BIT10); + int nibble = data_lines(data); // The real devices are driven at a similar clock rate like the 99/8. // The designers assumed that there is a clock tick of Oso between diff --git a/src/devices/bus/ti99/internal/datamux.cpp b/src/devices/bus/ti99/internal/datamux.cpp index d0e7d05a6c1..91265ab6d5c 100644 --- a/src/devices/bus/ti99/internal/datamux.cpp +++ b/src/devices/bus/ti99/internal/datamux.cpp @@ -123,31 +123,25 @@ datamux_device::datamux_device(const machine_config &mconfig, const char *tag, d void datamux_device::read_all(uint16_t addr, uint8_t *value) { - // Valid access - bool validaccess = ((addr & 0x0400)==0); - - if (validaccess) + // GROM access + if ((addr & 0xfc01)==0x9800) { - // GROM access - if ((addr & 0xf801)==0x9800) + if (m_console_groms_present) { - if (m_console_groms_present) - { - m_grom0->readz(value); - m_grom1->readz(value); - m_grom2->readz(value); - } - // GROMport (GROMs) - m_gromport->readz(addr, value); - m_grom_idle = false; + m_grom0->readz(value); + m_grom1->readz(value); + m_grom2->readz(value); } + // GROMport (GROMs) + m_gromport->readz(addr, value); + m_grom_idle = false; + } - // Video - if ((addr & 0xf801)==0x8800) - { - // Forward to VDP unless we have an EVPC - if (m_video != nullptr) *value = m_video->read(addr>>1); // A14 determines data or register read - } + // Video + if ((addr & 0xfc01)==0x8800) + { + // Forward to VDP unless we have an EVPC + if (m_video != nullptr) *value = m_video->read((addr>>1)&1); // A14 determines data or register read } // GROMport (ROMs) @@ -185,10 +179,10 @@ void datamux_device::write_all(uint16_t addr, uint8_t value) } // Video - if ((addr & 0xf801)==0x8800) + if ((addr & 0xfc01)==0x8c00) { // Forward to VDP unless we have an EVPC - if (m_video != nullptr) m_video->write(addr>>1, value); // A14 determines data or register write + if (m_video != nullptr) m_video->write((addr>>1)&1, value); // A14 determines data or register write } // I/O port gets all accesses diff --git a/src/devices/bus/ti99/internal/genboard.cpp b/src/devices/bus/ti99/internal/genboard.cpp index 773aa0ef217..2864d23d834 100644 --- a/src/devices/bus/ti99/internal/genboard.cpp +++ b/src/devices/bus/ti99/internal/genboard.cpp @@ -1,14 +1,13 @@ // license:LGPL-2.1+ // copyright-holders:Michael Zapf /*************************************************************************** - Geneve 9640 Gate Array and more components + Geneve 9640 Gate Array, PAL, and Genmod daughterboard This file contains the emulation of the gate array and of the PAL chip that is used to control wait state generation. Pins of the Gate Array: - - in: AMC, AMB, AMA, A0..A15: Address bus + in: A0..A15: Address bus in: CLKOUT in: IAQ/HOLDA in?: NMI* @@ -36,7 +35,8 @@ out: RAMENX*: SRAM expansion out: RAMEN*: SRAM out: ROMEN*: EPROM - out: AB0, AB1, AB2: Mapped address bits + out: AB0, AB1, AB2: Mapped address bits (2^15, 2^14, 2^13) + out: AMC, AMB, AMA: Higher address bits (2^18, 2^17, 2^16) in: DBIN* ? : ABUS* / HOLDA out: DBIN @@ -48,88 +48,219 @@ out: WE* / CRUCLK out: PhiCLK: System clock for 9901 - Onboard SRAM configuration: - There is an adjustable SRAM configuration on board, representing the - various enhancements by users. - - The standard memory configuration as reported by chkdsk (32 KiB): - 557056 bytes of total memory + Onboard SRAM configuration + ========================== - With 64 KiB SRAM: - 589824 bytes of total memory + Earlier versions of this emulation allowed for up to 384 KiB of SRAM. + However, this did not reflect the technical options of the real device. + In fact, there are only two select lines (RAMEN*, RAMEN-X*) that each + select one SRAM chip of 32 KiB capacity. Accordingly, we now only offer + the optional 32K expansion. + + Measurements on the real system proved that the zero waitstate access + is only available for the banks of stock and expansion SRAM, not for + the other areas (including the EPROM). + + The later operating systems of the Geneve (starting with 2.50s) + assume the 32K expansion to be available. For this reason, this option is + selected by default. + + Higher amounts of SRAM require extensive changes to the hardware (also + with respect to the wait state generation). + + Geneve mapper + ============ + + In the Gate Array, a set of 8 map registers is used to expand the logical + address to a physical address of 21 bits length. This is done by defining + frames of 8 KiB size (13 bits); the most significant 3 bits select the + map register, and its 8 bits are then prepended to the offset. + + Logical address: + fffx xxxx xxxx xxxx + \|/ + | Map registers + +--> 000: pppp pppp ---> Physical address (21 bits): + 001: pppp pppp p pppp pppx xxxx xxxx xxxx + 010: pppp pppp + ... + 111: pppp pppp = 000000 ... 1FFFFF (2 MiB space) + + The map registers are memory-mapped into the logical address space + (Geneve mode: F110..F117, TI mode: 8000..8007) and set by writing the + bytes into them. + + AMA/B/C decoding + ================ + + Since TI decided, for some obscure reason, to order the address bits in the + direction from MSB to LSB, the highest address bit is called A0. This + raises the problem that higher address bits lack a proper number (you + don't want to use negative numbers for sure). The Peripheral Expansion Box + already has three additional address lines: AMA (for the 2^16 position), + AMB (2^17), AMC (2^18). + + The Flex Cable Interface (the card that allows the TI-99/4A console to + be connected to the Peribox) sets these bits to 1. The Geneve, however, + may use these lines to expand the usual 64K address space. + + The classic Peribox cards check ABA/B/C for being set to 1. Since all + addresses starting with 00 or 01 are routed to the Geneve main board + itself, and the 11 prefix is reserved for SRAM and the Boot EPROM, the + 64K address range of the Peribox cards is on map values 10 111 xxx, which + means pages b8..bf. As the DSR (Device Service Routine, the card firmware) + is expected on logical addresses 4000-5FFF, this corresponds to the page 0xba. + + A problem occurs with some 3rd party expansion cards which do not check + AMA/B/C=1. In a normal TI system, this would have no effect anyway, but + with the Geneve this leads to mirroring. The usual DSR space at 4000-5fff + which would be reachable via page 0xba is then mirrored on a number of + other pages: - With 384 KiB SRAM: - 917504 bytes of total memory + 10 xxx 010x = 82, 8a, 92, 9a, a2, aa, b2, ba - The original 32 KiB SRAM memory needs to be expanded to 64 KiB for - MDOS 2.50s and higher, or the system will lock up. Therefore the emulation - default is 64 KiB. + Another block to take care of is 0xbc which covers 8000-9fff since this + area contains the speech synthesizer port at 9000/9400. - The ultimate expansion is a 512 KiB SRAM circuit wired to the gate array - to provide 48 pages of fast static RAM. This also requires to build an - adapter for a larger socket. From the 512 KiB, only 384 KiB will be - accessed, since the higher pages are hidden behind the EPROM pages. + Address map + =========== - === Address map === p,q = page value bit (q = AMC, AMB, AMA) c = address offset within 8 KiB page p pqqq pppc cccc cccc cccc - 0 0... .... .... .... .... on-board dram 512 KiB - + 0 .... .... .... .... .... on-board bus (external drivers inactive) + 0 0... .... .... .... .... on-board DRAM 512 KiB 0 1... .... .... .... .... on-board future expansion 512 KiB or Memex with Genmod - 1 00.. .... .... .... .... p-box AMA=0 (256 KiB) - 1 010. .... .... .... .... p-box AMA=1 AMB=0 (128 KiB) - 1 0110 .... .... .... .... p-box AMA=1 AMB=1 AMC=0 (64 KiB) + 1 0... .... .... .... .... external bus (p-box) + 1 0111 .... .... .... .... p-box (AMA/B/C=1) + 1 0111 000. .... .... .... address block 0xxx + 1 0111 001. .... .... .... address block 2xxx + 1 0111 010. .... .... .... address block 4xxx (DSR) + 1 0111 011. .... .... .... address block 6xxx + 1 0111 100. .... .... .... address block 8xxx (Speech at 0x9000) + 1 0111 101. .... .... .... address block axxx + 1 0111 110. .... .... .... address block cxxx + 1 0111 111. .... .... .... address block exxx - 1 0111 00.. .... .... .... p-box address block 0xxx, 2xxx - 1 0111 010. .... .... .... p-box address block 4xxx (DSR) - 1 0111 011. .... .... .... p-box address block 6xxx - 1 0111 100. .... .... .... p-box address block 8xxx (Speech at 0x9000) - 1 0111 101. .... .... .... p-box address block axxx - 1 0111 11.. .... .... .... p-box address block cxxx, exxx + 1 1... .... .... .... .... on-board bus or external bus (unclear) + 1 10.. .... .... .... .... Future expansion + 1 1100 .... .... .... .... Future expansion - 1 100. .... .... .... .... on-board sram (128K) -\ - 1 101. .... .... .... .... on-board sram (128K) --+- maximum SRAM expansion - 1 1100 .... .... .... .... on-board sram (64K) --/ - 1 1101 0... .... .... .... on-board sram (32K) - additional 32 KiB required for MDOS 2.50s and higher - 1 1101 1... .... .... .... on-board sram (32K) - standard setup + 1 1101 0... .... .... .... on-board sram (32K) - Optional 32 KiB expansion, 0 WS + 1 1101 1... .... .... .... on-board sram (32K) - stock 32 KiB SRAM, 0 WS 1 111. ..0. .... .... .... on-board boot1 1 111. ..1. .... .... .... on-board boot2 - The TI console (or more precise, the Flex Cable Interface) sets the AMA/B/C - lines to 1. Most cards actually check for AMA/B/C=1. However, this decoding - was forgotten in third party cards which cause the card address space - to be mirrored. The usual DSR space at 4000-5fff which would be reachable - via page 0xba is then mirrored on a number of other pages: - 10 xxx 010x = 82, 8a, 92, 9a, a2, aa, b2, ba + Address operation + ================= - Another block to take care of is 0xbc which covers 8000-9fff since this - area contains the speech synthesizer port at 9000/9400. + For DRAM access, a separate address bus between the Gate Array and the + DRAM circuits is used. The address bus has a width of 9 bits, which makes + it 18 bit for the whole address (row/column). Also, two CAS* lines are + used, selecting one set of DRAMs. + + For SRAM access, the least significant two map value bits (AB1, AB2) + are prepended to the 13 bits of the offset from the logical address. + The next bit (AB0) controls the RAMEN* / RAMENX* lines. + + For the EPROM access, the least significant bit of the map value is + prepended to the 13 bits of the offset from the logical address. This + yields a boot ROM size of 16K, mirrored on pages f0, f2, ..., fe, and + f1, f3, ..., ff. Bigger EPROMs (or flash memory, see PFM) require to use + the remaining bits AB1, AB0, and AMA. + + The external bus is selected by the two most significant map bits 10. + + + GROM emulation and cartridge ROM space + ====================================== + + The Gate Array emulates a 64K GROM space in order to allow TI-99/4A + cartridge images to be run on the Geneve in TI mode. Also, two 8K ROM + pages are reserved to allow for emulating Extended Basic type cartridges. + + In TI mode, pages 38 to 3f constitute the 64K GROM space. Pages 36 and 37 + are the two 8K ROM banks. All are located in DRAM with 1 WS. Page 36 + (or page 37) is mapped to logical space 6000-7FFF, regardless of the + mapper value at 8003 (can be set to any value without effect). - For the standard Geneve, only prefix 10 is routed to the P-Box. The Genmod - modification wires these address lines to pins 8 and 9 in the P-Box as AMD and - AME. This requires all cards to be equipped with an additional selection logic - to detect AMD=0, AME=1. Otherwise these cards, although completely decoding the - 19-bit address, would reappear at 512 KiB distances. + CRU address >1EF8 determines the ROM size (1 or 2 banks): + 0 = 1 bank (page 36, fixed) + 1 = 2 banks (page 36 when writing a byte to 6000, 6004, ..., + page 37 when writing a byte to 6002, 6006, ...) + + CRU address >1EFA write-protects 6000-6FFF when set to 0. + CRU address >1EFC write-protects 7000-7FFF when set to 0. + Both do not apply for 2-bank settings. + + As with every page, the GROM pages may be mapped to any other memory + area as well so that they may be randomly accessed. + + Unlike the real GROM, the GROM emulation allows free access to the whole + 8K of its page. Also, the emulation allows writing, so we essentially + have a GRAM emulation. + + The Gate Array contains a 16-bit counter that represents the current + GROM address. It wraps at 8K boundaries (>3FFE->3FFF->2000->2001). Reading + from the GROM read port delivers the byte at the current address and + increases the counter. Writing to the GROM port stores the byte at that + address, respectively, and then increases the counter. + + Reading the address counter delivers first the MSB, then on every + following access, the LSB. The counter itself contains the LSB in both + bytes after the first read operation. Thus, its value must be restored + after reading. + + Setting the address counter copies its LSB to the MSB and then writes + the new byte into the LSB. After the second write (without intermediate + data transfer), the counter is increased by one. + + + Genmod expansion + ================ + + The objective of the Genmod is to allow the Geneve to access the full + 2 MiB physical address space, in conjunction with the MEMEX card that + must be plugged into the p-box. There are actually two lines in the box + that are unused; those are now defined as AMD and AME. They are located + on the p-box bus on pins 8 and 9. + + Since the Gate Array does not output the first two address bits, they have + to be reconstructed by two GAL chips on a daughterboard that must be + soldered to the backside of the Gate Array. + + When ROMEN is active, the on-board EPROM is accessed, and the external + bus is inactive. + + The MEMEX card allows for using 0 waitstate accesses. This means that + the wait state generation for box accesses must be inhibited; this is + done by cutting the trace from the Gate Array pin READY to the PAL. + + Some peripheral cards must now be modified to check for AMD and AME + as well, or they will be mirrored into other memory areas. + This GenMod feature is automatically applied to all peripheral cards in + this emulation. + + The only remaining issue is that GROM access in the TI mode is under + full control of the Gate Array; it will always activate one of the DRAM + banks. To change this, the GA would need to be fully replaced. Instead, + the real GenMod contains a small box with two switches, which is also + emulation here: - Genmod's double switch box is also emulated. There are two switches: - Turbo mode: Activates or deactivates the wait state logic on the Geneve board. This switch may be changed at any time. - TI mode: Selects between the on-board memory, which is required - for the GPL interpreter, and the external Memex memory. This switch + for the GROM access, and the external Memex memory. This switch triggers a reset when changed. - =================== - Mapping - =================== - - Logical address space: 64 KiB + Logical address space layout + ============================ Geneve mode ----------- @@ -154,13 +285,13 @@ Mapper: 8000 - 8007 1000 0000 0000 0xxx Keyboard: 8008 - 800F 1000 0000 0000 1... Clock: 8010 - 801F 1000 0000 0001 xxxx + Sound: 8400 - 87FE 1000 01.. .... ...0 Speech: 9000 / 9400 1001 0w.. .... ...0 Grom: 9800 / 9802 1001 1w.. .... ..x0 9c00 / 9c02 - Physical address space - ---------------------- - Address space size = 2 MiB + Physical address space layout + ----------------------------- Start End Phys.pages 000000 - 07FFFF 00-3F 512 KiB DRAM on-board @@ -169,7 +300,9 @@ 080000 - 0FFFFF 40-7F 512 KiB on-board expansion (never used) 100000 - 16FFFF 80-B7 448 KiB P-Box space (special cards, like MEMEX) 170000 - 17FFFF B8-BF 64 KiB P-Box space (current cards) - 180000 - 1DFFFF C0-EF 384 KiB SRAM space on-board; stock Geneve comes with 32 KiB + 180000 - 1CFFFF C0-E7 Future expansion + 1D0000 - 1D7FFF E8-EB 32 KiB SRAM expansion + 1D8000 - 1DFFFF EC-EF 32 KiB stock SRAM 1E0000 - 1FFFFF F0-FF 128 KiB EPROM space; 16 KiB actually used, 8 mirrors @@ -187,7 +320,7 @@ 1E0000 - 1FFFFF F0-FF 128 KiB EPROM space; 16 KiB actually used, 8 mirrors Waitstate handling - ------------------ + ================== Waitstates are caused by a cleared READY line of the TMS9995 processor during an external memory cycle. That means that waitstates have no effect for operations within the on-chip memory, and only when an access to the @@ -197,54 +330,83 @@ and the PAL 16R4, both lacking proper documentation. All of the following numbers have been determined by experiments with the real machine. - Waitstates are generated for: - - memory-mapped devices (mapper, clock, keyboard): 1 WS - - accesses to the peripheral expansion box: 1 WS - - accesses to on-board DRAM: 1 WS - - accesses to video: 15 WS - - accesses to SRAM: 0 WS + Waitstates are generated for all accesses except for the SRAM in pages + E8..EF. Video accesses produce 15 waitstates, created by the counter + in the PAL. However, these video wait states are effective after the video + access has been completed. Wait states are not effective when the + execution is running in on-chip RAM. + Without additional wait states, the video access takes the usual 1 or 2 WS. Additional waitstates are created when one of the CRU bits is set. In that case, all delays are extended to 2 WS (including SRAM). - Sound waitstates are somewhat unpredictable. It seems as if they depend - on the clock of the sound chip; the READY line is pulled down until the - next clock pulse, which may take some value between 18 CPU cycles and - 30 CPU cycles. - - The gate array is able to create wait states for video accesses. However, - these wait states are effective after the video access has been completed. - Wait states are not effective when the execution is running in on-chip - RAM. Additional wait states are requested by m_video_waitstates = true. - Without additional wait states, the video access takes the usual 1 or 2 WS. - - Waitstate behavior (Nov 2013) - Almost perfect. Only video read access from code in DRAM is too fast - by one WS - - ========================== - PFM expansion - ========================== - - The "Programmable Flash Memory expansion" is a replacement for the boot - EPROM. - - PFM: Original version, 128 KiB - PFM+: Expansion of the original version, piggybacked, adds another 128KiB - PFM512: Using an AT29C040 (not A), 512 KiB - - The PFM is visible as four banks in memory pages 0xF0 - 0xFF. - - Bank switching is done by four 9901 pins: - - 0028: LSB of bank number - 003A: MSB of bank number - - Bank 0 is the boot code, while banks 1-3 can be used as flash drives + Sound waitstates depend on the clock of the sound chip; the READY line is + pulled down until the next clock pulse. + + + CRU map + ======= + ---- TMS 9901 ---- + 0000: flag Clock mode + 0002: int INTA* (pbox pin 17) + 0004: int Video interrupt + 0006: in Joystick button + 0008: in left + 000A: in right + 000C: in down + 000E: in up + 0010: int Keyboard scancode available + 0012: in (mirror of 003A) + 0014: in Left mouse button + 0016: in Real-time clock interrupt + 0018: in INTB* (pbox pin 18) + 001A: in (reflects 0032) + 001C: - + 001E: in (reflects 002E) + 0020: out Pbox reset + 0022: out Video reset + 0024: out Joystick select (0=Joystick 1, 1=Joystick 2) + 0026: - + 0028: out PFM bank switch LSB + 002A: out PFM output enable + 002C: out Keyboard reset + 002E: out System clock speed (external memory cycles) + 0030: - + 0032: out Video wait state enable + 0034: in (mirror of 0018) + 0036: in (mirror of 0016) + 0038: in (mirror of 0014) + 003A: out PFM bank switch MSB + 003C: in (mirror of 0010) + 003E: in (mirror of 000E) + + ----Gate Array---- + 13C0 - 13FE: Single step execution (not implemented, not available for most systems) + + ----TMS9995-internal flag registers---- + The values are all latched inside the CPU, but output values are visible + on the bus outside the CPU + 1EE0-1EE8, 1FDA: see tms9995.cpp + 1EEA: PAL/NTSC flag + 1EEC: (unused) + 1EEE: CapsLock flag + 1EF0: Keyboard clock + 1EF2: Keyboard shift register enable + 1EF4: Operation mode (native, GPL) + 1EF6: Memory mode (unmapped, mapped) + 1EF8: Cartridge size (0: 16 KiB, 1: 8 KiB) + 1EFA: Protect 6xxx + 1EFC: Protect 7xxx + 1EFE: Additional wait state per memory access + + ------------------------------------------------------------------------- Michael Zapf, October 2011 February 2012: rewritten as class, restructured Aug 2015: PFM added + Nov 2019: Extensive rewrite to provide a true emulation of the Gate Array + and the PAL, and also to allow for different kinds of external + keyboards. ***************************************************************************/ #include "emu.h" @@ -255,252 +417,122 @@ #define LOG_WRITE (1U<<4) #define LOG_KEYBOARD (1U<<5) #define LOG_CLOCK (1U<<6) -#define LOG_LINES (1U<<7) +#define LOG_READY (1U<<7) #define LOG_SETTING (1U<<8) -#define LOG_VIDEOWS (1U<<9) -#define LOG_PFM (1U<<10) +#define LOG_CRU (1U<<9) +#define LOG_CRUKEY (1U<<10) #define LOG_DECODE (1U<<11) -#define LOG_INVADDR (1U<<12) +#define LOG_ADDRESS (1U<<12) +#define LOG_LINES (1U<<13) +#define LOG_WAIT (1U<<14) +#define LOG_GROM (1U<<15) +#define LOG_MAPPER (1U<<16) -// Minimum log should be settings and warnings -#define VERBOSE ( LOG_SETTING | LOG_WARN ) +// Minimum log should be warnings +#define VERBOSE ( LOG_GENERAL | LOG_SETTING | LOG_WARN ) #include "genboard.h" #include "logmacro.h" DEFINE_DEVICE_TYPE_NS(GENEVE_GATE_ARRAY, bus::ti99::internal, geneve_gate_array_device, "geneve_gate_array", "Geneve Gate Array") -DEFINE_DEVICE_TYPE_NS(GENMOD_GATE_ARRAY, bus::ti99::internal, genmod_gate_array_device, "genmod_gate_array", "Geneve Mod Gate Array") +DEFINE_DEVICE_TYPE_NS(GENMOD_DECODER, bus::ti99::internal, genmod_decoder_device, "genmod_decoder", "GenMod decoder circuit") +DEFINE_DEVICE_TYPE_NS(GENEVE_PAL, bus::ti99::internal, geneve_pal_device, "geneve_pal", "Geneve PAL circuit") namespace bus { namespace ti99 { namespace internal { geneve_gate_array_device::geneve_gate_array_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_boot_rom(0), - m_gromwaddr_LSB(false), - m_gromraddr_LSB(false), + m_have_waitstate(false), + m_have_extra_waitstate(false), + m_enable_extra_waitstates(false), + m_extready(true), + m_sndready(true), + m_grom_address(0), - m_video_waitstates(false), - m_extra_waitstates(false), - m_ready_asserted(false), - m_read_mode(false), - m_debug_no_ws(false), - m_geneve_mode(false), - m_direct_mode(false), - m_cartridge_size(0), + m_cartridge_banked(false), m_cartridge_secondpage(false), m_cartridge6_writable(false), m_cartridge7_writable(false), - m_pfm_bank(0), - m_pfm_output_enable(false), - m_sram_mask(0), - m_sram_val(0), - m_ready(*this), + m_load_lsb(false), + + m_geneve_mode(false), + m_direct_mode(false), + m_keyint(*this), - m_waitcount(0), - m_video_waitcount(0), m_keyboard_shift_reg(0), m_keyboard_last_clock(CLEAR_LINE), m_keyboard_data_in(CLEAR_LINE), m_shift_reg_enabled(false), - m_cpu(*owner, "maincpu"), - m_sound(*owner, TI_SOUNDCHIP_TAG), - m_video(*owner, TI_VDP_TAG), - m_rtc(*owner, GENEVE_CLOCK_TAG), - m_sram(*this, GENEVE_SRAM_PAR_TAG), - m_dram(*this, GENEVE_DRAM_PAR_TAG), + + m_pal(*owner, GENEVE_PAL_TAG), m_peribox(*owner, TI_PERIBOX_TAG), - m_pfm512(*owner, GENEVE_PFM512_TAG), - m_pfm512a(*owner, GENEVE_PFM512A_TAG), - m_keyb_conn(*owner, GENEVE_KEYBOARD_CONN_TAG) + m_keyb_conn(*owner, GENEVE_KEYBOARD_CONN_TAG), + + m_debug(false) { } geneve_gate_array_device::geneve_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : geneve_gate_array_device(mconfig, GENEVE_GATE_ARRAY, tag, owner, clock) { - m_eprom = nullptr; - m_pbox_prefix = 0x070000; -} - -genmod_gate_array_device::genmod_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : geneve_gate_array_device(mconfig, GENMOD_GATE_ARRAY, tag, owner, clock), - m_gm_timode(false), - m_turbo(false) -{ - m_eprom = nullptr; - m_pbox_prefix = 0x170000; } -INPUT_CHANGED_MEMBER( geneve_gate_array_device::settings_changed ) +WRITE8_MEMBER( geneve_gate_array_device::cru_sstep_write ) { - // Used when switching the boot ROMs during runtime, especially the PFM - m_boot_rom = newval; + // Single step + // 13c0 - 13fe: 0001 0011 11xx xxx0 (offset << 1) + LOGMASKED(LOG_WARN, "Single step not implemented; bit %d set to %d\n", offset & 0x001f, data); } -INPUT_CHANGED_MEMBER( genmod_gate_array_device::setgm_changed ) +WRITE8_MEMBER( geneve_gate_array_device::cru_ctrl_write ) { - int number = int(param&0x03); - int value = newval; - - switch (number) + // This is just mirroring the internal flags of the 9995 + int bit = (offset & 0x000f); + switch (bit) { - case 1: - // Turbo switch. May be changed at any time. - LOGMASKED(LOG_SETTING, "Setting turbo flag to %d\n", value); - m_turbo = (value!=0); + case 5: + // Unknown effect + LOGMASKED(LOG_CRU, "Set PAL flag = %02x\n", data); + // m_palvideo = (data!=0); + break; + case 7: + // Capslock flag; just to keep track of the current state break; - case 2: - // TIMode switch. Causes reset when changed. - LOGMASKED(LOG_SETTING, "Setting timode flag to %d\n", value); - m_gm_timode = (value!=0); - machine().schedule_hard_reset(); + case 8: + LOGMASKED(LOG_CRUKEY, "Set keyboard clock = %02x\n", data); + set_keyboard_clock(data); break; - case 3: - // Used when switching the boot ROMs during runtime, especially the PFM - m_boot_rom = value; + case 9: + LOGMASKED(LOG_CRUKEY, "Enable keyboard shift reg = %02x\n", data); + enable_shift_register(data); + break; + case 10: + LOGMASKED(LOG_CRU, "Operation mode = %s\n", (data!=0)? "native" : "GPL"); + m_geneve_mode = (data!=0); + break; + case 11: + LOGMASKED(LOG_CRU, "Addressing mode = %s\n", (data!=0)? "unmapped" : "mapped"); + m_direct_mode = (data!=0); + break; + case 12: + LOGMASKED(LOG_CRU, "Cartridge ROM: %s\n", (data==0)? "banked" : "unbanked"); + m_cartridge_banked = (data==0); + break; + case 13: + LOGMASKED(LOG_CRU, "Cartridge ROM 6000-6fff %s\n", (data!=0)? "writable" : "protected"); + m_cartridge6_writable = (data!=0); + break; + case 14: + LOGMASKED(LOG_CRU, "Cartridge ROM 7000-7fff %s\n", (data!=0)? "writable" : "protected"); + m_cartridge7_writable = (data!=0); + break; + case 15: + LOGMASKED(LOG_SETTING, "Extra wait states %s\n", (data==0)? "enabled" : "disabled"); + m_enable_extra_waitstates = (data==0); break; default: - LOGMASKED(LOG_WARN, "Unknown setting %d ignored\n", number); - } -} - -/**************************************************************************** - GROM simulation. The Geneve board simulated GROM circuits within its gate - array. -*****************************************************************************/ - -/* - Simulates GROM. The real Geneve does not use GROMs but simulates them - within the gate array. Unlike with real GROMs, no address wrapping occurs, - and the complete 64K space is available. -*/ -uint8_t geneve_gate_array_device::read_grom(offs_t offset) -{ - uint8_t reply; - if (offset & 0x0002) - { - // GROM address handling - m_gromwaddr_LSB = false; - - if (m_gromraddr_LSB) - { - reply = m_grom_address & 0xff; - m_gromraddr_LSB = false; - } - else - { - reply = (m_grom_address >> 8) & 0xff; - m_gromraddr_LSB = true; - } - } - else - { - // GROM data handling - // GROMs are stored in pages 38..3f - int physpage = 0x38; - reply = m_dram->pointer()[(physpage<<13) + m_grom_address]; - m_grom_address = (m_grom_address + 1) & 0xffff; - m_gromraddr_LSB = m_gromwaddr_LSB = false; - } - return reply; -} - -/* - Simulates GROM. The real Geneve does not use GROMs but simulates them - within the gate array. -*/ -void geneve_gate_array_device::write_grom(offs_t offset, uint8_t data) -{ - if (offset & 0x0002) - { - // set address - m_gromraddr_LSB = false; - if (m_gromwaddr_LSB) - { - m_grom_address = (m_grom_address & 0xff00) | data; - m_grom_address = (m_grom_address + 1) & 0xffff; - m_gromwaddr_LSB = false; - } - else - { - m_grom_address = (m_grom_address & 0x00ff) | ((uint16_t)data<<8); - m_gromwaddr_LSB = true; - } - } - else - { // write GPL data - // The Geneve GROM simulator allows for GROM writing (verified with a real system) - int physpage = 0x38; - m_dram->pointer()[(physpage<<13) + m_grom_address] = data; - - m_grom_address = (m_grom_address + 1) & 0xffff; - m_gromraddr_LSB = m_gromwaddr_LSB = false; - } -} - -void geneve_gate_array_device::set_wait(int min) -{ - if (m_extra_waitstates && min < 2) min = 2; - - // if we still have video wait states, do not set this counter - // (or it will assert READY when expiring) - if (m_video_waitcount > min) return; - - // need one more pass so that READY will be asserted again - m_waitcount = min + 1; - if (m_waitcount > 1) - { - LOGMASKED(LOG_LINES, "Pulling down READY line for %d cycles\n", min); - m_ready(CLEAR_LINE); - m_ready_asserted = false; - } -} - -void geneve_gate_array_device::set_video_waitcount(int min) -{ - if (m_debug_no_ws) return; - m_video_waitcount = min; -} - -void geneve_gate_array_device::set_geneve_mode(bool geneve) -{ - LOGMASKED(LOG_SETTING, "Setting Geneve mode = %d\n", geneve); - m_geneve_mode = geneve; -} - -void geneve_gate_array_device::set_direct_mode(bool direct) -{ - LOGMASKED(LOG_SETTING, "Setting direct mode = %d\n", direct); - m_direct_mode = direct; -} - -void geneve_gate_array_device::set_cartridge_size(int size) -{ - LOGMASKED(LOG_SETTING, "Setting cartridge size to %d\n", size); - m_cartridge_size = size; -} - -void geneve_gate_array_device::set_cartridge_writable(int base, bool write) -{ - LOGMASKED(LOG_SETTING, "Cartridge %04x space writable = %d\n", base, write); - if (base==0x6000) m_cartridge6_writable = write; - else m_cartridge7_writable = write; -} - -void geneve_gate_array_device::set_video_waitstates(bool wait) -{ - // Tends to be called repeatedly - if (m_video_waitstates != wait) - { - LOGMASKED(LOG_SETTING, "Setting video waitstates = %d\n", wait); + break; } - m_video_waitstates = wait; -} - -void geneve_gate_array_device::set_extra_waitstates(bool wait) -{ - LOGMASKED(LOG_SETTING, "Setting extra waitstates = %d\n", wait); - m_extra_waitstates = wait; } /****************************************************************** @@ -597,468 +629,238 @@ WRITE_LINE_MEMBER( geneve_gate_array_device::kbddata ) m_keyboard_data_in = (line_state)state; } -/************************************************************************ - Called by the address map -************************************************************************/ - -/* - Read a byte via the data bus. The decoding has already been done in the - SETADDRESS method, and we re-use the values stored there to quickly - access the appropriate component. -*/ -uint8_t geneve_gate_array_device::readm(offs_t offset) -{ - uint8_t value = 0; - - decdata *dec; - decdata debug; - - // For the debugger, do the decoding here with no wait states - if (machine().side_effects_disabled()) - { - if (m_cpu->is_onchip(offset)) return m_cpu->debug_read_onchip_memory(offset&0xff); - dec = &debug; - m_debug_no_ws = true; - dec->offset = offset; - decode_logical(true, dec); - if (dec->function == MUNDEF) - { - map_address(m_read_mode, dec); - decode_physical(dec); - decode_mod(dec); - } - if (dec->function == MBOX) - { - m_peribox->memen_in(ASSERT_LINE); - m_peribox->setaddress_dbin(dec->physaddr, true); - } - } - else - { - // Use the values found in the setaddress phase - dec = &m_decoded; - m_debug_no_ws = false; - } - - // Logical space - - switch (dec->function) - { - case MLVIDEO: - if (!machine().side_effects_disabled()) - { - value = m_video->read(dec->offset>>1); - LOGMASKED(LOG_READ, "Read video %04x -> %02x\n", dec->offset, value); - // Video wait states are created *after* the access - // Accordingly, they have no effect when execution is in onchip RAM - if (m_video_waitstates) set_video_waitcount(15); - } - break; - - case MLMAPPER: - // mapper - value = m_map[dec->offset & 0x0007]; - LOGMASKED(LOG_READ, "Read mapper %04x -> %02x\n", dec->offset, value); - break; - - case MLKEY: - // key - value = m_keyboard_shift_reg>>1; - LOGMASKED(LOG_KEYBOARD, "Read keyboard -> %02x\n", value); - break; - - case MLCLOCK: - // clock - // Tests on the real machine showed that the upper nibble is 0xf - // (probably because of the location at f130-f13f?) - // In TI mode, however, the upper nibble is 1, unless we read 801f, - // in which case the nibble is 2. Here the location is 8010-801f. - // Needs more investigation. We might as well ignore this, - // as the high nibble is obviously undefined and takes some past - // value floating around. - value = m_rtc->read(dec->offset & 0x000f); - if (m_geneve_mode) value |= 0xf0; - else value |= ((dec->offset & 0x000f)==0x000f)? 0x20 : 0x10; - LOGMASKED(LOG_READ, "Read clock %04x -> %02x\n", dec->offset, value); - break; - - case MLGROM: - // grom simulation - // ++++ ++-- ---- ---+ - // 1001 1000 0000 00x0 - if (!machine().side_effects_disabled()) value = read_grom(dec->offset); - LOGMASKED(LOG_READ, "Read GROM %04x -> %02x\n", dec->offset, value); - break; - - case MLSOUND: - value = 0; - break; - - case MPDRAM: - // DRAM. One wait state. - value = m_dram->pointer()[dec->physaddr]; - LOGMASKED(LOG_READ, "Read DRAM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value); - break; - - case MPEXP: - // On-board memory expansion for standard Geneve (never used) - LOGMASKED(LOG_READ, "Read on-board expansion (not available) %06x -> 00\n", dec->physaddr); - value = 0; - break; - - case MPEPROM: - // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K) - // mirrored for f0, f2, f4, ...; f1, f3, f5, ... - value = boot_rom(dec->physaddr); - break; - - case MPSRAM: - if ((dec->physaddr & m_sram_mask)==m_sram_val) - { - value = m_sram->pointer()[dec->physaddr & ~m_sram_mask]; - LOGMASKED(LOG_READ, "Read SRAM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value); - } - else - { - LOGMASKED(LOG_INVADDR, "Decoded as SRAM read, but no SRAM at %06x\n", dec->physaddr); - value = 0; - } - // Return in any case - break; - - case MBOX: - // Route everything else to the P-Box - // 0x000000-0x07ffff for the stock Geneve (AMC,AMB,AMA,A0 ...,A15) - // 0x000000-0x1fffff for the GenMod.(AME,AMD,AMC,AMB,AMA,A0 ...,A15) - - m_peribox->readz(dec->physaddr, &value); - m_peribox->memen_in(CLEAR_LINE); - LOGMASKED(LOG_READ, "Read P-Box %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value); - break; - - default: - LOGMASKED(LOG_WARN, "Unknown decoding result type: %d\n", dec->function); - break; - } - return value; -} - -void geneve_gate_array_device::writem(offs_t offset, uint8_t data) -{ - decdata *dec; - decdata debug; - - // For the debugger, do the decoding here with no wait states - if (machine().side_effects_disabled()) - { - // TODO: add debug_write_onchip_memory - dec = &debug; - m_debug_no_ws = true; - dec->offset = offset; - decode_logical(false, dec); - if (dec->function == MUNDEF) - { - map_address(m_read_mode, dec); - decode_physical(dec); - decode_mod(dec); - } - if (dec->function == MBOX) - { - m_peribox->memen_in(ASSERT_LINE); - m_peribox->setaddress_dbin(dec->physaddr, false); - } - } - else - { - // Use the values found in the setaddress phase - dec = &m_decoded; - m_debug_no_ws = false; - } - - - // Logical space - - switch (dec->function) - { - case MLVIDEO: - // video - // ++++ ++++ ++++ ---+ - // 1111 0001 0000 .cc0 - // Initialize waitstate timer - - if (!machine().side_effects_disabled()) - { - m_video->write(dec->offset>>1, data); - LOGMASKED(LOG_WRITE, "Write video %04x <- %02x\n", offset, data); - // See above - if (m_video_waitstates) set_video_waitcount(15); - } - break; - - case MLMAPPER: - // mapper - m_map[dec->offset & 0x0007] = data; - LOGMASKED(LOG_WRITE, "Write mapper %04x <- %02x\n", offset, data); - break; - - case MLCLOCK: - // clock - // ++++ ++++ ++++ ---- - m_rtc->write(dec->offset & 0x000f, data); - LOGMASKED(LOG_WRITE, "Write clock %04x <- %02x\n", offset, data); - break; - - case MLSOUND: - // sound - // ++++ ++++ ++++ ---+ - m_sound->write(data); - LOGMASKED(LOG_WRITE, "Write sound <- %02x\n", data); - break; - - case MLGROM: - // The GROM simulator is only available in TI Mode - write_grom(dec->offset, data); - LOGMASKED(LOG_WRITE, "Write GROM %04x <- %02x\n", offset, data); - break; - - // Physical space - case MPDRAM: - // DRAM write - m_dram->pointer()[dec->physaddr] = data; - LOGMASKED(LOG_WRITE, "Write DRAM %04x (%06x) <- %02x\n", offset, dec->physaddr, data); - break; - - case MPEXP: - // On-board memory expansion for standard Geneve - // Actually never built, so we show it as unmapped - LOGMASKED(LOG_WRITE, "Write on-board expansion (not available) %06x <- %02x\n", dec->physaddr, data); - break; +// sysspeed has no effect for vwait/speed - case MPEPROM: - // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K) - // mirrored for f0, f2, f4, ...; f1, f3, f5, ... - // Ignore EPROM write (unless PFM) - if (m_boot_rom != GENEVE_EPROM) write_to_pfm(dec->physaddr, data); - else - LOGMASKED(LOG_INVADDR, "Write EPROM %04x (%06x) <- %02x, ignored\n", offset, dec->physaddr, data); - break; +// TODO: Video write timing - case MPSRAM: - if ((dec->physaddr & m_sram_mask)==m_sram_val) - { - m_sram->pointer()[dec->physaddr & ~m_sram_mask] = data; - LOGMASKED(LOG_WRITE, "Write SRAM %04x (%06x) <- %02x\n", offset, dec->physaddr, data); - } - else - { - LOGMASKED(LOG_INVADDR, "Decoded as SRAM write, but no SRAM at %06x\n", dec->physaddr); - } - break; - - case MBOX: - // Route everything else to the P-Box - LOGMASKED(LOG_WRITE, "Write P-Box %04x (%06x) <- %02x\n", offset, dec->physaddr, data); - m_peribox->write(dec->physaddr, data); - m_peribox->memen_in(CLEAR_LINE); - break; - - default: - LOGMASKED(LOG_WARN, "Unknown decoding result type: %d\n", dec->function); - break; - } -} +/***************************************************************** + Decoding functions +******************************************************************/ -const geneve_gate_array_device::logentry_t geneve_gate_array_device::s_logmap[7] = +const geneve_gate_array_device::logentry_t geneve_gate_array_device::s_logmap[10] = { { 0xf100, 0x000e, 0x8800, 0x03fe, 0x0400, MLVIDEO, "video" }, { 0xf110, 0x0007, 0x8000, 0x0007, 0x0000, MLMAPPER, "mapper" }, { 0xf118, 0x0007, 0x8008, 0x0007, 0x0000, MLKEY, "keyboard" }, - { 0xf120, 0x000e, 0x8400, 0x03fe, 0x0000, MLSOUND, "sound" }, + { 0xf120, 0x000e, 0x8400, 0x01ff, 0x0000, MLSOUND, "sound" }, + { 0x0000, 0x0000, 0x8600, 0x01ff, 0x0000, MLEXT, "external bus" }, { 0xf130, 0x000f, 0x8010, 0x000f, 0x0000, MLCLOCK, "clock" }, - { 0x0000, 0x0000, 0x9000, 0x03fe, 0x0400, MBOX, "speech (in P-Box)" }, - { 0x0000, 0x0000, 0x9800, 0x03fe, 0x0400, MLGROM, "GROM" }, + { 0x0000, 0x0000, 0x9000, 0x03fe, 0x0400, MLEXT, "speech (ext. bus)" }, + { 0x0000, 0x0000, 0x9800, 0x03fc, 0x0400, MLGROM, "GROM data" }, + { 0x0000, 0x0000, 0x9802, 0x03fc, 0x0400, MLGROMAD, "GROM address" }, + { 0x0000, 0x0000, 0x6000, 0x1fff, 0x0000, MLCARTROM, "Cartridge ROM" } }; -void geneve_gate_array_device::decode_logical(bool reading, geneve_gate_array_device::decdata* dec) +void geneve_gate_array_device::decode_logical(geneve_gate_array_device::decdata* dec) { dec->function = MUNDEF; - dec->physaddr = m_pbox_prefix | dec->offset; - dec->wait = 1; + int index = -1; - int i = 0; - while (i < 7) + for (int i = 0; (i < 10) && (index == -1); i++) { if (m_geneve_mode) { // Skip when genbase is 0 if ((s_logmap[i].genbase != 0) && ((dec->offset & ~s_logmap[i].genmask) == s_logmap[i].genbase)) - break; + index = i; } else { - if (reading) + if (dec->read) { if ((dec->offset & ~s_logmap[i].timask) == s_logmap[i].tibase) - break; + index = i; } else { if ((dec->offset & ~s_logmap[i].timask) == (s_logmap[i].tibase | s_logmap[i].writeoff)) - break; + index = i; } } - i++; } - if (i != 7) + + if (index != -1) { - LOGMASKED(LOG_DECODE, "Decoded as %s: %04x\n", s_logmap[i].description, dec->offset); - dec->function = s_logmap[i].function; + LOGMASKED(LOG_DECODE, "Decoded as %s: %04x\n", s_logmap[index].description, dec->offset); + dec->function = s_logmap[index].function; + } + + // Handle write operations to the cartridge ROM + if (dec->function == MLCARTROM && !dec->read) + { + if (m_cartridge_banked) dec->function = MLCARTBANK; + else + { + if ((((dec->offset & 0x1000)==0) && !m_cartridge6_writable) + || (((dec->offset & 0x1000)!=0) && !m_cartridge7_writable)) + { + dec->function = CARTPROT; + LOGMASKED(LOG_WARN, "Writing to protected cartridge space %04x ignored\n", dec->offset); + } + } } } -void geneve_gate_array_device::map_address(bool reading, geneve_gate_array_device::decdata* dec) +/* + Look up the mapper value (page) for the given logical address. + Cartridges need special handling. +*/ +void geneve_gate_array_device::get_page(geneve_gate_array_device::decdata* dec) { int logpage = (dec->offset & 0xe000) >> 13; - int physpage = 0; + dec->physpage = 0; // Determine physical address - if (m_direct_mode) physpage = 0xf8; // points to boot eprom + if (m_direct_mode) dec->physpage = 0xf8; // points to boot eprom else { - // TI mode, accessing logical addresses 6000-7fff - if (!m_geneve_mode && logpage==3) + if (dec->function == MLCARTROM) + dec->physpage = (m_cartridge_banked && m_cartridge_secondpage)? 0x37 : 0x36; + else { - if (reading) - { - physpage = (m_cartridge_size==0x4000 && m_cartridge_secondpage)? 0x37 : 0x36; - } + if (dec->function == MLGROM) + dec->physpage = ((m_grom_address >> 13) & 0x07) | 0x38; else { - // Emulate the cartridge bank switch feature of Extended Basic - // TODO: Is this the right place? Or writem()? - if (m_cartridge_size==0x4000) + if (dec->function == MLEXT) { - m_cartridge_secondpage = ((dec->offset & 0x0002)!=0); - LOGMASKED(LOG_WRITE, "Set cartridge page %02x\n", m_cartridge_secondpage); + dec->physpage = 0xb8 | logpage; } else - { - // writing into cartridge rom space (no bank switching) - if ((((dec->offset & 0x1000)==0x0000) && !m_cartridge6_writable) - || (((dec->offset & 0x1000)==0x1000) && !m_cartridge7_writable)) - { - LOGMASKED(LOG_WARN, "Writing to protected cartridge space %04x ignored\n", dec->offset); - } - else - // TODO: Check whether secondpage is really ignored - physpage = 0x36; - } + dec->physpage = m_map[logpage]; } } - else - physpage = m_map[logpage]; } - dec->physaddr = ((physpage << 13) | (dec->offset & 0x1fff)) & 0x1fffff; } -const geneve_gate_array_device::physentry_t geneve_gate_array_device::s_physmap[4] = +const geneve_gate_array_device::physentry_t geneve_gate_array_device::s_physmap[7] = { - { 0x000000, 0x07ffff, MPDRAM, 1, "DRAM" }, - { 0x080000, 0x07ffff, MPEXP, 1, "on-board expansion" }, - { 0x1e0000, 0x01ffff, MPEPROM, 0, "EPROM" }, - { 0x180000, 0x07ffff, MPSRAM, 0, "SRAM" } + { 0x00, 0x3f, MPDRAM, "DRAM" }, + { 0x40, 0x3f, MPEXP, "Future exp (on-board)" }, + { 0xe8, 0x03, MPSRAMX, "SRAM exp" }, + { 0xec, 0x03, MPSRAM, "SRAM" }, + { 0xf0, 0x0f, MPEPROM, "Boot ROM/PFM" }, + { 0x80, 0x7f, MBOX, "external" } // catch-all }; +/* + Try to decode the physical address. +*/ void geneve_gate_array_device::decode_physical(geneve_gate_array_device::decdata* dec) { - dec->function = MUNDEF; - - int i = 0; - while (i < 4) - { - if ((dec->physaddr & ~s_physmap[i].mask) == s_physmap[i].base) - break; - i++; - } - if (i != 4) + // Search the map + if (dec->function == MUNDEF || dec->function == MLCARTROM || dec->function == MLGROM) { - LOGMASKED(LOG_DECODE, "Decoded as %s: %06x\n", s_physmap[i].description, dec->physaddr); - dec->function = s_physmap[i].function; - dec->wait = s_physmap[i].wait; - } - else - { - // Route everything else to the P-Box - dec->function = MBOX; - dec->wait = 1; + if (dec->function == MLGROM) + { + // If map byte 6 is not set to 03, ignore the access + // This seems to be a safety feature, or a glitch in the design + // of the Gate array. + if (m_map[6] != 0x03) + { + dec->function = MUNDEF; + return; + } + + // GROM is actually DRAM; substitute the address and update the address counter + // The page has already been set in get_page + LOGMASKED(LOG_GROM, "GROM address = %04x\n", m_grom_address); + dec->offset = m_grom_address; // Do not wipe the GROM number + // Auto-increment here (not in clock_in, as we have two clock cycles by wait states) + increase_grom_address(); + return; + } + + // Search for the matching page interval. Cartridge space will be decoded as DRAM. + bool found = false; + for (int i = 0; (i < 6) && !found; i++) + { + if ((dec->physpage & ~s_physmap[i].mask) == s_physmap[i].base) + { + dec->function = s_physmap[i].function; + LOGMASKED(LOG_DECODE, "Decoded as %s, page %02x\n", s_physmap[i].description, dec->physpage); + found = true; + } + } + + if (!found) + LOGMASKED(LOG_DECODE, "Unmapped address %06x\n", (get_prefix(0xff) | (dec->offset & 0x1fff)) & 0x1fffff); } } -void genmod_gate_array_device::decode_mod(geneve_gate_array_device::decdata* dec) +void geneve_gate_array_device::increase_grom_address() { - // GenMod mode - // The TI Mode switch activates the DRAM on the board (1 WS) - // for the first 512K (000000-07ffff) - if (((dec->function == MPDRAM) && !m_gm_timode) || dec->function==MPSRAM || dec->function==MPEXP) + if (!m_debug) { - dec->function = MBOX; + m_grom_address = ((m_grom_address + 1) & 0x1fff) | (m_grom_address & 0xe000); + m_load_lsb = false; } - - if ((dec->function != MPDRAM) && m_turbo) - dec->wait = 0; } /* - Boot ROM handling, from EPROM or PFM. + Are we addressing DRAM? */ -uint8_t geneve_gate_array_device::boot_rom(offs_t offset) +bool geneve_gate_array_device::accessing_dram() { - uint8_t value; - int pfmaddress = (offset & 0x01ffff) | (m_pfm_bank<<17); + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return accessing_dram_s(dec->function); +} - switch (m_boot_rom) - { - case GENEVE_EPROM: - value = m_eprom[offset & 0x003fff]; - LOGMASKED(LOG_READ, "Read EPROM %04x -> %02x\n", offset & 0x003fff, value); - return value; - case GENEVE_PFM512: - value = m_pfm512->read(pfmaddress); - break; - case GENEVE_PFM512A: - value = m_pfm512a->read(pfmaddress); - break; - default: - LOGMASKED(LOG_WARN, "Illegal mode for reading boot ROM: %d\n", m_boot_rom); - value = 0; - } +bool geneve_gate_array_device::accessing_dram_s(int function) +{ + return (function == MPDRAM) || (function == MLGROM) || (function == MLCARTROM); +} + +bool geneve_gate_array_device::accessing_sram_s(int function) +{ + return (function == MPSRAM) || (function == MPSRAMX); +} - if (!m_pfm_output_enable) value = 0; - LOGMASKED(LOG_PFM, "Reading from PFM at address %05x -> %02x\n", pfmaddress, value); - return value; +bool geneve_gate_array_device::accessing_devs_s(int function) +{ + return (function == MLMAPPER) || (function == MLKEY) || (function == MLCLOCK) || (function == MLGROMAD); } -void geneve_gate_array_device::write_to_pfm(offs_t offset, uint8_t data) +bool geneve_gate_array_device::accessing_grom() { - // Nota bene: The PFM must be write protected on startup, or the RESET - // of the 9995 will attempt to write the return vector into the flash EEPROM - int address = (offset & 0x01ffff) | (m_pfm_bank<<17); - LOGMASKED(LOG_PFM, "Writing to PFM at address %05x <- %02x\n", address, data); + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MLGROM); +} - switch (m_boot_rom) +bool geneve_gate_array_device::accessing_box_s(int function, bool genmod) +{ + return (function == MLEXT) || (function == MBOX) || (genmod && function == MPEXP); +} + +/* + The Gate Array has a private address bus to the DRAM. +*/ +offs_t geneve_gate_array_device::get_dram_address() +{ + offs_t physaddr = 0; + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + int addr13 = dec->offset & 0x1fff; + + // Cartridge access is also done in DRAM; the pages are fixed to + // 36, 37 (ROM), 38...3f (GROM), regardless of the mapper. + + if (dec->function == MLGROM) { - case GENEVE_PFM512: - m_pfm512->write(address, data); - break; - case GENEVE_PFM512A: - m_pfm512a->write(address, data); - break; - default: - LOGMASKED(LOG_WARN, "Illegal mode for writing to PFM: %d\n", m_boot_rom); + physaddr = (0x38 << 13) | dec->offset; + // The GROM address counter is updated in decode_physical } + else + { + if (dec->function == MPDRAM || dec->function == MLCARTROM) + { + physaddr = (get_prefix(0x3f) | addr13) & 0x7ffff; + } + else + LOGMASKED(LOG_WARN, "Unknown decoding %d for DRAM\n", dec->function); + } + return physaddr; } - /* Accept the address passed over the address bus and decode it appropriately. This decoding will later be used in the READ/WRITE member functions. Also, @@ -1066,116 +868,211 @@ void geneve_gate_array_device::write_to_pfm(offs_t offset, uint8_t data) */ void geneve_gate_array_device::setaddress(offs_t address, uint8_t busctrl) { - LOGMASKED(LOG_DETAIL, "setaddress = %04x\n", address); - m_debug_no_ws = false; - m_decoded.offset = address; + LOGMASKED(LOG_ADDRESS, "setaddress = %04x%s\n", address, m_debug? " (debug)" : ""); + decdata& dec = (m_debug)? m_decdebug : m_decoded; - m_read_mode = ((busctrl & TMS99xx_BUS_DBIN)!=0); + dec.offset = address; + dec.read = ((busctrl & TMS99xx_BUS_DBIN)!=0); - decode_logical(m_read_mode, &m_decoded); - if (m_decoded.function == MUNDEF) - { - map_address(m_read_mode, &m_decoded); - decode_physical(&m_decoded); - decode_mod(&m_decoded); - } - - set_wait(m_decoded.wait); + decode_logical(&dec); + get_page(&dec); + decode_physical(&dec); - if (m_decoded.function == MBOX) + if (!m_debug) { - m_peribox->memen_in(ASSERT_LINE); - m_peribox->setaddress_dbin(m_decoded.physaddr, m_read_mode); + m_have_extra_waitstate = m_enable_extra_waitstates; + m_have_waitstate = (dec.function != MPSRAM && dec.function != MPSRAMX) || m_have_extra_waitstate; } } /* - The mapper is connected to the clock line in order to operate - the wait state counter. - The wait counter is decremented on each rising clock edge; when 0, the - READY line is asserted. However, there is a second counter which is used for - video wait states. - The READY line must be asserted when the wait counter reaches 0, but must be - cleared immediately again if the video counter has not reached 0. - (See comments at the file header: The additional video wait states do not - affect the video access itself but become effective after the access; if - the code runs on the chip, these wait states are ignored.) + The Gate Array uses the clock to operate the wait state flags. The actual + wait state generation is up to the PAL chip. */ WRITE_LINE_MEMBER( geneve_gate_array_device::clock_in ) { - if (state==ASSERT_LINE) + // Falling CLK + if (state == CLEAR_LINE) { - // Rising edge - if (!m_ready_asserted) - { - if (m_waitcount > 0) - { - m_waitcount--; - if (m_waitcount == 0) - { - LOGMASKED(LOG_CLOCK, "clock, READY asserted\n"); - m_ready(ASSERT_LINE); - m_ready_asserted = true; - } - else - { - LOGMASKED(LOG_CLOCK, "clock\n"); - } - } - else - { - if (m_video_waitcount > 0) - { - m_video_waitcount--; - if (m_video_waitcount == 0) - { - LOGMASKED(LOG_CLOCK, "clock, READY asserted after video\n"); - m_ready(ASSERT_LINE); - m_ready_asserted = true; - } - else - { - LOGMASKED(LOG_CLOCK, "vclock, ew=%d\n", m_video_waitcount); - } - } - } - } + if (!m_have_extra_waitstate) + m_have_waitstate = false; + else + m_have_extra_waitstate = false; } - else +} + +/* + READY line from the peribox. Together with the sndready and the READY output + of the Gate Array itself, this forms a wired AND. +*/ +WRITE_LINE_MEMBER( geneve_gate_array_device::extready_in ) +{ + LOGMASKED(LOG_READY, "External READY = %d\n", state); + m_extready = (state==ASSERT_LINE); +} + +WRITE_LINE_MEMBER( geneve_gate_array_device::sndready_in ) +{ + LOGMASKED(LOG_READY, "Sound READY = %d\n", state); + m_sndready = (state==ASSERT_LINE); +} + +READ_LINE_MEMBER(geneve_gate_array_device::csw_out) +{ + // Do not access a port-based device in debugger mode + if (m_debug) return CLEAR_LINE; + return ((m_decoded.function == MLVIDEO) && !m_decoded.read)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::csr_out) +{ + // Do not access a port-based device in debugger mode + if (m_debug) return CLEAR_LINE; + return ((m_decoded.function == MLVIDEO) && m_decoded.read)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::romen_out) +{ + // Do not restrict to read-only, as we could have a PFM here + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MPEPROM)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::ramen_out) +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MPSRAM)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::ramenx_out) +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MPSRAMX)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::rtcen_out) +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MLCLOCK)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::snden_out) +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return ((dec->function == MLSOUND) && !dec->read)? ASSERT_LINE : CLEAR_LINE; +} + +READ_LINE_MEMBER(geneve_gate_array_device::dben_out) +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return accessing_box_s(dec->function, false)? ASSERT_LINE : CLEAR_LINE; +} + +// After setaddress, pull down READY if +// - we have an extra waitstate OR +// - we do not access SRAM(X) OR +// - extready = 0 + +// In Genmod, pull down READY if +// - we have an extra waitstate OR +// - we access the box and have turbo==0 OR +// - we access DRAM and have timode==1 OR +// - extready = 0 + +READ_LINE_MEMBER(geneve_gate_array_device::gaready_out) +{ + if (m_debug) return ASSERT_LINE; // Always READY when debugging + // Return true (READY=1) when we are accessing SRAM/SRAMX and when we do not have extra waitstates + // return ((m_decoded.function == MPSRAM || m_decoded.function == MPSRAMX) && !m_have_extra_waitstate)? ASSERT_LINE : CLEAR_LINE; + return (m_have_waitstate || m_have_extra_waitstate || !m_extready || !m_sndready)? CLEAR_LINE : ASSERT_LINE; +} + + +/********************************************************** + Gate Array-internal functions +***********************************************************/ + +/* + Changes the value of the parameter if one of the functions applies. +*/ +void geneve_gate_array_device::readz(uint8_t& value) +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + uint8_t lsb = 0; + + switch (dec->function) { - // Falling edge - // Do we have video wait states? In that case, clear the line again - if ((m_waitcount == 0) && (m_video_waitcount > 0) && m_ready_asserted) + case MLMAPPER: + value = m_map[dec->offset & 0x0007]; + LOGMASKED(LOG_READ, "Read mapper %04x -> %02x\n", dec->offset, value); + break; + case MLKEY: + value = m_keyboard_shift_reg>>1; + LOGMASKED(LOG_READ, "Read keyboard %04x -> %02x\n", dec->offset, value); + break; + case MLGROMAD: + if (!m_debug) // don't let the debugger mess with the address counter { - LOGMASKED(LOG_CLOCK, "clock, READY cleared for video\n"); - m_ready(CLEAR_LINE); - m_ready_asserted = false; + value = (m_grom_address & 0xff00)>>8; + lsb = (m_grom_address & 0xff); + m_grom_address = lsb << 8 | lsb; + m_load_lsb = false; + LOGMASKED(LOG_READ, "Read GROM address %04x -> %02x\n", dec->offset, value); } + break; + case MLCARTBANK: + break; + default: + break; } } /* - PFM expansion: Setting the bank. + Internal functions of the Gate Array. Returns without changes if none + of the function applies. */ -WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_select_lsb ) +void geneve_gate_array_device::write(uint8_t data) { - if (state==ASSERT_LINE) m_pfm_bank |= 1; - else m_pfm_bank &= 0xfe; - LOGMASKED(LOG_PFM, "Setting bank (l) = %d\n", m_pfm_bank); -} + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; -WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_select_msb ) -{ - if (state==ASSERT_LINE) m_pfm_bank |= 2; - else m_pfm_bank &= 0xfd; - LOGMASKED(LOG_PFM, "Setting bank (u) = %d\n", m_pfm_bank); + switch (dec->function) + { + case MLMAPPER: + m_map[dec->offset & 0x0007] = data; + // LOGMASKED(LOG_MAPPER, "Write mapper %04x <- %02x\n", dec->offset, data); + LOGMASKED(LOG_MAPPER, "Set %04x mapper[%02x %02x %02x %02x %02x %02x %02x %02x]\n", + dec->offset, m_map[0], m_map[1], m_map[2], m_map[3], m_map[4], m_map[5], m_map[6], m_map[7]); + break; + case MLGROMAD: + if (!m_debug) // don't let the debugger mess with the address counter + { + m_grom_address = (m_grom_address << 8 | data) & 0xffff; + if (m_load_lsb) increase_grom_address(); + else m_load_lsb = true; + LOGMASKED(LOG_GROM, "Write GROM address %04x <- %02x\n", dec->offset, data); + } + break; + case MLCARTBANK: + m_cartridge_secondpage = ((dec->offset & 0x0002)!=0); + LOGMASKED(LOG_WRITE, "Set cartridge bank %04x <- %02x\n", dec->offset, data); + break; + case MLKEY: + LOGMASKED(LOG_WRITE, "Write to keyboard ignored\n"); + break; + default: + break; + } } -WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_output_enable ) +/* + Address lines that the Gate Array offers. They reflect the 8 bits of + the mapper byte. AME and AMD are only used by GenMod. + (AME, AMD,) AMC, AMB, AMA, AB0, AB1, AB2 +*/ +int geneve_gate_array_device::get_prefix(int lines) { - // Negative logic - m_pfm_output_enable = (state==CLEAR_LINE); - LOGMASKED(LOG_PFM, "PFM output %s\n", m_pfm_output_enable? "enable" : "disable"); + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->physpage & lines) << 13; } //==================================================================== @@ -1184,109 +1081,444 @@ WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_output_enable ) void geneve_gate_array_device::device_start() { - m_ready.resolve_safe(); m_keyint.resolve_safe(); m_geneve_mode = false; m_direct_mode = true; // State registration - save_item(NAME(m_gromwaddr_LSB)); - save_item(NAME(m_gromraddr_LSB)); + save_item(NAME(m_have_extra_waitstate)); + save_item(NAME(m_enable_extra_waitstates)); + save_item(NAME(m_extready)); + save_item(NAME(m_sndready)); + save_item(NAME(m_grom_address)); - save_item(NAME(m_video_waitstates)); - save_item(NAME(m_extra_waitstates)); - save_item(NAME(m_ready_asserted)); - save_item(NAME(m_read_mode)); - save_item(NAME(m_debug_no_ws)); - save_item(NAME(m_geneve_mode)); - save_item(NAME(m_direct_mode)); - save_item(NAME(m_cartridge_size)); + save_item(NAME(m_cartridge_banked)); save_item(NAME(m_cartridge_secondpage)); save_item(NAME(m_cartridge6_writable)); save_item(NAME(m_cartridge7_writable)); + save_item(NAME(m_load_lsb)); + + save_item(NAME(m_geneve_mode)); + save_item(NAME(m_direct_mode)); + save_pointer(NAME(m_map), 8); + + save_item(NAME(m_decoded.read)); save_item(NAME(m_decoded.function)); save_item(NAME(m_decoded.offset)); - save_item(NAME(m_decoded.physaddr)); - save_item(NAME(m_boot_rom)); - save_item(NAME(m_pfm_bank)); - save_item(NAME(m_pfm_output_enable)); - save_item(NAME(m_sram_mask)); - save_item(NAME(m_sram_val)); - save_item(NAME(m_waitcount)); - save_item(NAME(m_video_waitcount)); + save_item(NAME(m_decoded.physpage)); + + save_item(NAME(m_keyboard_shift_reg)); + save_item(NAME(m_shift_reg_enabled)); } void geneve_gate_array_device::common_reset() { - m_extra_waitstates = false; - m_video_waitstates = true; - m_read_mode = false; - m_waitcount = 0; - m_video_waitcount = 0; - m_ready_asserted = true; + m_have_extra_waitstate = false; + m_enable_extra_waitstates = false; - m_geneve_mode =false; - m_direct_mode = true; - m_cartridge_size = 0x4000; + m_grom_address = 0; + m_cartridge_banked = false; m_cartridge_secondpage = false; m_cartridge6_writable = false; m_cartridge7_writable = false; - m_grom_address = 0; - m_pfm_bank = 0; - m_pfm_output_enable = true; + + m_geneve_mode =false; + m_direct_mode = true; // Clear map for (auto & elem : m_map) elem = 0; - - // Check which boot EPROM we are using (or PFM) - m_boot_rom = machine().root_device().ioport("BOOTROM")->read(); - m_eprom = machine().root_device().memregion("maincpu")->base(); - - // Allow for configuring the VRAM size - uint32_t videoram = (machine().root_device().ioport("VRAM")->read()!=0)? 0x30000 : 0x20000; - downcast<v99x8_device &>(*m_video.target()).set_vram_size(videoram); - LOGMASKED(LOG_SETTING, "Video RAM set to %d KiB\n", videoram / 1024); } void geneve_gate_array_device::device_reset() { common_reset(); +} + +/* ======================================================================== + + The PAL circuit on the Geneve main board. It is the actual waitstate + generator, and its task is to control the READY line depending on the + accessed device, and to control the outgoing MEMEN* and WE* lines into + the peribox. + + The chip is a PAL16R4ACN + + Pin Dir Meaning + --------------------- + 1 in CLK (assert=H) + 2 in WE* (write) + 3 in READYIN (from Gate Array and sound chip) + 4 in CSR* (Video read) + 5 in CRU bit 23 (>002E) ("System clock speed") + 6 in MEMEN* (memory access) + 7 in DBEN* (external data bus enable) + 8 in (Gate Array bit 36) + 9 in CSW* (video write) + 10 GND + 11 in OE*, hardwired to H + 12 out WE* + 13 out MEMEN* + 14 (output of FF1, disabled by pin 11) + 15 (output of FF2, disabled by pin 11) + 16 (output of FF3, disabled by pin 11) + 17 (output of FF4, disabled by pin 11) + 18 out READYOUT + 19 in VDPWAITEN + 20 Vcc + + ======================================================================== */ + +geneve_pal_device::geneve_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, GENEVE_PAL, tag, owner, clock), + m_pin3(true), + m_pin4(true), + m_pin5(true), + m_pin9(true), + m_pin19(false), + m_pin14d(false),m_pin14q(false), + m_pin15d(false),m_pin15q(false), + m_pin16d(false),m_pin16q(false), + m_pin17d(false),m_pin17q(false), + m_prev_ready(CLEAR_LINE), + m_peribox(*owner, TI_PERIBOX_TAG), + m_ready(*this) +{ +} - // SRAM is only separately handled for the standard Geneve; Genmod uses - // the Memex instead - switch (machine().root_device().ioport("SRAM")->read()) +/* + READY input from the Gate Array. +*/ +WRITE_LINE_MEMBER(geneve_pal_device::gaready_in) +{ + bool prev = m_pin3; + m_pin3 = (state==ASSERT_LINE); + if (prev != m_pin3) { -/* 1 100. .... .... .... .... on-board sram (128K) -+ - 1 101. .... .... .... .... on-board sram (128K) -+-- maximum SRAM expansion - 1 1100 .... .... .... .... on-board sram (64K) --+ - 1 1101 0... .... .... .... on-board sram (32K) - additional 32 KiB required for MDOS 2.50s and higher - 1 1101 1... .... .... .... on-board sram (32K) - standard setup + LOGMASKED(LOG_LINES, "READY(ga) <- %d\n", state); + // When GAREADY=L, the video lines have immediate effect on the ready line + set_ready(); + } +} + +/* + Video read (ASSERT=low). */ - case 0: // 32 KiB - m_sram_mask = 0x1f8000; - m_sram_val = 0x1d8000; - break; - case 1: // 64 KiB - m_sram_mask = 0x1f0000; - m_sram_val = 0x1d0000; - break; - case 2: // 384 KiB (actually 512 KiB, but the EPROM masks the upper 128 KiB) - m_sram_mask = 0x180000; - m_sram_val = 0x180000; - break; +WRITE_LINE_MEMBER(geneve_pal_device::csr_in) +{ + bool prev = m_pin4; + m_pin4 = (state==CLEAR_LINE); + if (prev != m_pin4) + { + LOGMASKED(LOG_LINES, "CSR <- %d\n", state); + set_ready(); } } -void genmod_gate_array_device::device_reset() +/* + Video write (ASSERT=low). +*/ +WRITE_LINE_MEMBER(geneve_pal_device::csw_in) { - common_reset(); - LOGMASKED(LOG_SETTING, "Using GenMod modification\n"); - m_turbo = ((machine().root_device().ioport("GENMODDIPS")->read() & GENEVE_GM_TURBO)!=0); - m_gm_timode = ((machine().root_device().ioport("GENMODDIPS")->read() & GENEVE_GM_TIM)!=0); + bool prev = m_pin9; + m_pin9 = (state==CLEAR_LINE); + if (prev != m_pin9) + { + LOGMASKED(LOG_LINES, "CSW <- %d\n", state); + set_ready(); + } +} + +/* + Memory enable (ASSERT=low); pass through +*/ +WRITE_LINE_MEMBER(geneve_pal_device::memen) +{ + LOGMASKED(LOG_LINES, "MEMEN -> %d\n", state); + m_peribox->memen_in(state); +} + +/* + Write external mem cycles (0=long, 1=short) + System clock speed (PAL pin 5). (ASSERT=high) + The function from the equations could not be verified on a real machine. + This function seems to have no effect. So either the equations are + wrong, or something else is going on. +*/ +WRITE_LINE_MEMBER(geneve_pal_device::sysspeed) +{ + bool prev = m_pin5; + m_pin5 = (state == ASSERT_LINE); + if (prev != m_pin5) + { + LOGMASKED(LOG_SETTING, "System clock speed set to %d\n", state); + set_ready(); + } } +/* + Write vdp wait cycles (1=add 14 cycles, 0=add none) + see above for waitstate handling +*/ +WRITE_LINE_MEMBER(geneve_pal_device::vwaiten) +{ + bool prev = m_pin19; + m_pin19 = (state==ASSERT_LINE); + if (prev != m_pin19) + { + LOGMASKED(LOG_SETTING, "Video wait states %s\n", (state!=0)? "enabled" : "disabled"); + set_ready(); + } +} + +/* + Clock input. This controls the state of the waitstate counter. +*/ +WRITE_LINE_MEMBER(geneve_pal_device::clock_in) +{ + LOGMASKED(LOG_CLOCK, "CLK%s\n", state? "?" : "?"); + // Set the FF + if (state==ASSERT_LINE) + { + m_pin14q = m_pin14d; + m_pin15q = m_pin15d; + m_pin16q = m_pin16d; + m_pin17q = m_pin17d; + set_ready(); + } +} + +/* + Called from clock_in and input pin functions. Set the state of the + READY line. Since this is the only source for the state, we always have + 0 or 1, but no Z state. + + FIXME: The video write wait state handling is still not correct. Unfortunately, + the equations of the PAL did not help, in contrast, the problem got worse. + Problem: After initiating a video write (CSW*=0), the READY line must + remain high for the next falling clock edge so that the CPU can complete + the command cycle. By these equations, the READY line immediately goes + low when the clock line rises, and thus on the falling edge, a wait state + is produced. + The effect is that in the real machine, if all code runs in on-chip memory, + a video write does not cause any wait state, while in this emulation, it + always causes the full 14 cycles of wait states. In rare situations, this + may heavily slow down the processing. +*/ +void geneve_pal_device::set_ready() +{ + line_state ready_line; + + // Original equations from the PAL +/* + ready_line = ((!m_pin4 && !m_pin3) || + (!m_pin9 && !m_pin3) || + (m_pin9 && m_pin4 && !m_pin14q) || + (m_pin5 && m_pin4 && !m_pin15q) || + (m_pin5 && m_pin4 && !m_pin16q) || + (m_pin9 && m_pin4 && !m_pin17q))? CLEAR_LINE : ASSERT_LINE; + + m_pin17d = (m_pin9 && m_pin4 && !m_pin17q && !m_pin14q) || + (m_pin9 && m_pin4 && !m_pin17q && !m_pin15q) || + (m_pin9 && m_pin4 && !m_pin17q && !m_pin16q) || + (m_pin9 && m_pin4 && m_pin3 && m_pin16q && m_pin15q && m_pin14q) || + (!m_pin19 && !m_pin17q && !m_pin14q) || + (!m_pin19 && !m_pin17q && !m_pin15q) || + (!m_pin19 && !m_pin17q && !m_pin16q) || + (m_pin3 && !m_pin19 && m_pin16q && m_pin15q && m_pin14q); + + m_pin16d = (m_pin9 && m_pin4 && m_pin17q && !m_pin16q) || + (m_pin9 && m_pin4 && !m_pin17q && m_pin16q) || + (m_pin9 && m_pin4 && m_pin16q && m_pin15q && m_pin14q) || + !m_pin19; + + m_pin15d = (m_pin9 && m_pin4 && m_pin15q && m_pin14q) || + (m_pin9 && m_pin4 && !m_pin16q && m_pin15q) || + (m_pin9 && m_pin4 && !m_pin17q && m_pin15q) || + (m_pin9 && m_pin4 && m_pin17q && m_pin16q && !m_pin15q) || + !m_pin19; + + m_pin14d = (m_pin9 && m_pin4 && m_pin14q) || + (m_pin9 && m_pin4 && m_pin17q && m_pin16q && m_pin15q) || + !m_pin19; +*/ + + // Simplified equations for better performance + + bool pin4_9 = m_pin9 && m_pin4; + + ready_line = ((!m_pin3 && !pin4_9) || + (pin4_9 && (!m_pin14q || !m_pin17q)) || + (m_pin5 && m_pin4 && (!m_pin15q || !m_pin16q)))? CLEAR_LINE : ASSERT_LINE; + + m_pin17d = (pin4_9 && !m_pin17q && (!m_pin14q || !m_pin15q || !m_pin16q)) || + (((pin4_9 && m_pin3) || (m_pin3 && !m_pin19)) && m_pin16q && m_pin15q && m_pin14q) || + (!m_pin19 && !m_pin17q && (!m_pin14q || !m_pin15q || !m_pin16q)); + + m_pin16d = (pin4_9 && m_pin17q && !m_pin16q) || + (pin4_9 && !m_pin17q && m_pin16q) || + (pin4_9 && m_pin16q && m_pin15q && m_pin14q) || + !m_pin19; + + m_pin15d = (pin4_9 && m_pin15q && (m_pin14q || !m_pin16q || !m_pin17q)) || + (pin4_9 && m_pin17q && m_pin16q && !m_pin15q) || + !m_pin19; + + m_pin14d = (pin4_9 && m_pin14q) || + (pin4_9 && m_pin17q && m_pin16q && m_pin15q) || + !m_pin19; + + if (m_prev_ready != ready_line) LOGMASKED(LOG_WAIT, "READY = %d (%d %d %d %d, %d %d %d, %d %d)\n", ready_line, m_pin14d, m_pin15d, m_pin16d, m_pin17d, m_pin3, m_pin4, m_pin9, m_pin5, m_pin19 ); m_prev_ready = ready_line; + m_ready(ready_line); +} + +void geneve_pal_device::device_start() +{ + m_ready.resolve_safe(); + + save_item(NAME(m_pin3)); + save_item(NAME(m_pin4)); + save_item(NAME(m_pin5)); + save_item(NAME(m_pin9)); + save_item(NAME(m_pin19)); + save_item(NAME(m_pin17q)); + save_item(NAME(m_pin16q)); + save_item(NAME(m_pin15q)); + save_item(NAME(m_pin14q)); +} + +/******************************************************************** + Genmod daughterboard, soldered to the back of the Gate Array + The main task of the Genmod is to route all memory accesses to the + Memex card in the peripheral box. + + Also, the Genmod may inhibit wait states by flipping on the TURBO switch. + + The TIMODE switch blocks the box access for the DRAM space (pages + 00-3F) so that the GROM emulator remains functional. Without this GROM + emulation (which is hardwired to the board DRAM), the TI-99/4A + software cannot run. + +********************************************************************/ + +genmod_decoder_device::genmod_decoder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, GENMOD_DECODER, tag, owner, clock), + m_debug(false), + m_turbo(false), + m_timode(false), + m_function(0), + m_function_debug(0), + m_page(0), + m_page_debug(0), + m_gaready(0), + m_extready(ASSERT_LINE), + m_sndready(ASSERT_LINE) +{ +} + +void genmod_decoder_device::set_function(int func, int page) +{ + if (m_debug) + { + m_function_debug = func; + m_page_debug = page; + } + else + { + m_function = func; // values from logical map or physical map + m_page = page; + } +} + +WRITE_LINE_MEMBER(genmod_decoder_device::gaready_in) +{ + m_gaready = state; +} + +/* + READY line from the box. Do not ignore this line, as it is important + for device operation. +*/ +WRITE_LINE_MEMBER(genmod_decoder_device::extready_in) +{ + m_extready = state; +} + +/* + READY line from the sound chip. +*/ +WRITE_LINE_MEMBER(genmod_decoder_device::sndready_in) +{ + m_sndready = state; +} + +/* + Wait state generation + The Genmod board does not look inside the Gate Array. The call we are using + is just a shorthand for evaluating the states of the select lines. +*/ +READ_LINE_MEMBER(genmod_decoder_device::gaready_out) +{ + int func = m_debug? m_function_debug : m_function; + int page = m_debug? m_page_debug : m_page; + + // External or sound READY must always be respected + if (m_extready==CLEAR_LINE || m_sndready==CLEAR_LINE) return CLEAR_LINE; + + // When TURBO is off, pass through + if (!m_turbo) return m_gaready; + + // When accessing internal devices, pass through + if (geneve_gate_array_device::accessing_devs_s(func)) return m_gaready; + + // In TURBO mode: + // When TIMODE is active, and we access the DRAM area, pass through + if (m_timode && ((page & 0xc0)==0)) return m_gaready; + + // When accessing SRAM, SRAMX, EPROM, or page BA, pass through + if ((((page & 0xf0)==0xf0) || ((page&0xf8)==0xe8) || page == 0xba)) return m_gaready; + + // else no wait states + return ASSERT_LINE; +} + +/* + Genmod accesses the box also for the DRAM range, but only if timode==0. + (This includes GROM and cartridge ROM access.) + Note: It is not sufficient to check for the page area; we need to check + the select lines (via the static functions). +*/ +READ_LINE_MEMBER(genmod_decoder_device::dben_out) +{ + int func = m_debug? m_function_debug : m_function; + + if (geneve_gate_array_device::accessing_box_s(func, true)) + return ASSERT_LINE; + + if (!m_timode && geneve_gate_array_device::accessing_dram_s(func)) + return ASSERT_LINE; + + // This needs to be verified with a real device. + if (geneve_gate_array_device::accessing_sram_s(func)) + return ASSERT_LINE; + + return CLEAR_LINE; +} + +void genmod_decoder_device::device_start() +{ + save_item(NAME(m_debug)); + save_item(NAME(m_turbo)); + save_item(NAME(m_timode)); + save_item(NAME(m_function)); + save_item(NAME(m_function_debug)); + save_item(NAME(m_page)); + save_item(NAME(m_page_debug)); + save_item(NAME(m_gaready)); + save_item(NAME(m_extready)); + save_item(NAME(m_sndready)); +} } } } // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/genboard.h b/src/devices/bus/ti99/internal/genboard.h index 3e927ab70df..ef1e4402c44 100644 --- a/src/devices/bus/ti99/internal/genboard.h +++ b/src/devices/bus/ti99/internal/genboard.h @@ -39,60 +39,98 @@ enum }; #define GENEVE_GATE_ARRAY_TAG "gatearray" +#define GENMOD_DECODER_TAG "genmod" +#define GENEVE_PAL_TAG "pal" #define GENEVE_MOUSE_TAG "gmouse" -#define GENEVE_CLOCK_TAG "mm58274c" #define GENEVE_PFM512_TAG "pfm512" #define GENEVE_PFM512A_TAG "pfm512a" #define GENEVE_KEYBOARD_CONN_TAG "keybconn" -#define GENEVE_SRAM_TAG "sram" -#define GENEVE_DRAM_TAG "dram" -#define GENEVE_SRAM_PAR_TAG ":sram" -#define GENEVE_DRAM_PAR_TAG ":dram" - namespace bus { namespace ti99 { namespace internal { /*****************************************************************************/ +class geneve_pal_device; +class genmod_decoder_device; + class geneve_gate_array_device : public device_t { + // friend class genmod_decoder_device; + public: geneve_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_geneve_mode(bool geneve); - void set_direct_mode(bool direct); - void set_cartridge_size(int size); - void set_cartridge_writable(int base, bool write); - void set_video_waitstates(bool wait); - void set_extra_waitstates(bool wait); - - uint8_t readm(offs_t offset); - void writem(offs_t offset, uint8_t data); + // Set the internal state and output lines according to the address void setaddress(offs_t offset, uint8_t busctrl); - DECLARE_INPUT_CHANGED_MEMBER( settings_changed ); + // Access to Gate Array-internal registers. Depends on the previous + // call of setaddress + // - Mapper + // - Keyboard + // - Grom address counter + // - Cartridge bank switch + void readz(uint8_t& value); + void write(uint8_t data); + // Inputs DECLARE_WRITE_LINE_MEMBER( clock_in ); DECLARE_WRITE_LINE_MEMBER( dbin_in ); + DECLARE_WRITE_LINE_MEMBER( extready_in ); + DECLARE_WRITE_LINE_MEMBER( sndready_in ); + DECLARE_WRITE8_MEMBER( cru_sstep_write ); + DECLARE_WRITE8_MEMBER( cru_ctrl_write ); + + // Outputs + DECLARE_READ_LINE_MEMBER( csr_out ); + DECLARE_READ_LINE_MEMBER( csw_out ); + DECLARE_READ_LINE_MEMBER( rtcen_out ); + DECLARE_READ_LINE_MEMBER( romen_out ); + DECLARE_READ_LINE_MEMBER( ramen_out ); + DECLARE_READ_LINE_MEMBER( ramenx_out ); + DECLARE_READ_LINE_MEMBER( snden_out ); + DECLARE_READ_LINE_MEMBER( dben_out ); + DECLARE_READ_LINE_MEMBER( gaready_out ); + + int get_prefix(int lines); + bool accessing_dram(); + static bool accessing_dram_s(int function); + static bool accessing_sram_s(int function); + static bool accessing_box_s(int function, bool genmod); + static bool accessing_devs_s(int function); + + bool accessing_grom(); + offs_t get_dram_address(); // Keyboard support DECLARE_WRITE_LINE_MEMBER( set_keyboard_clock ); DECLARE_WRITE_LINE_MEMBER( enable_shift_register ); DECLARE_WRITE_LINE_MEMBER( kbdclk ); DECLARE_WRITE_LINE_MEMBER( kbddata ); - - // PFM support - DECLARE_WRITE_LINE_MEMBER( pfm_select_lsb ); - DECLARE_WRITE_LINE_MEMBER( pfm_select_msb ); - DECLARE_WRITE_LINE_MEMBER( pfm_output_enable ); - - auto ready_cb() { return m_ready.bind(); } auto kbdint_cb() { return m_keyint.bind(); } -protected: + // Miscellaneous + void set_debug(bool deb) { m_debug = deb; } + bool geneve_mode() { return m_geneve_mode; } + int get_function() { return m_debug? m_decdebug.function : m_decoded.function; } + +private: geneve_gate_array_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); void common_reset(); + // Mapper function + typedef struct + { + bool read; // Reading + int function; // must be a fundamental type to be saveable + offs_t offset; // Logical address + int physpage; // Physical page + } decdata; + + // Functions + void decode_logical(decdata* dec); + void get_page(decdata* dec); + void decode_physical(decdata* dec); + /* Constants for mapper decoding. Naming scheme: M=Mapper, L=Logical space; P=Physical space @@ -106,60 +144,54 @@ protected: MLKEY, MLSOUND, MLCLOCK, + MLEXT, MLGROM, + MLGROMAD, + MLCARTROM, + MLCARTBANK, MPDRAM, MPEXP, MPEPROM, MPSRAM, + MPSRAMX, + MBOX, - MBOX - } decfunct_t; + CARTPROT - // Mapper function - typedef struct - { - int function; // must be a fundamental type to be saveable - offs_t offset; // Logical address - offs_t physaddr; // Physical address - int wait; // Wait states - } decdata; - - uint8_t* m_eprom; - int m_pbox_prefix; - int m_boot_rom; + } decfunct_t; -private: void device_start() override; virtual void device_reset() override; - // GROM simulation - bool m_gromwaddr_LSB; - bool m_gromraddr_LSB; - int m_grom_address; - uint8_t read_grom(offs_t offset); - void write_grom(offs_t offset, uint8_t data); - - // wait states - void set_wait(int min); - void set_video_waitcount(int min); - bool m_video_waitstates; - bool m_extra_waitstates; - bool m_ready_asserted; + // Wait state creation + bool m_have_waitstate; + bool m_have_extra_waitstate; + bool m_enable_extra_waitstates; + bool m_extready; + bool m_sndready; - bool m_read_mode; - - bool m_debug_no_ws; - bool m_geneve_mode; - bool m_direct_mode; - int m_cartridge_size; + // Cartridge and GROM support + int m_grom_address; + bool m_cartridge_banked; bool m_cartridge_secondpage; bool m_cartridge6_writable; bool m_cartridge7_writable; + bool m_load_lsb; + void increase_grom_address(); + + // Global modes + bool m_geneve_mode; + bool m_direct_mode; + + // Mapper file int m_map[8]; // The result of decoding decdata m_decoded; + decdata m_decdebug; + + // ====== Decoding ============ // Static decoder entry for the logical space // Not all entries apply for native mode, e.g. there is no GROM in native @@ -181,82 +213,116 @@ private: // There are no differences between native mode and TI mode. typedef struct { - offs_t base; // Base address + offs_t base; // Base page int mask; // Bits that also match this entry decfunct_t function; // Decoded function - int wait; // Wait states const char* description; // Good for logging } physentry_t; + // Tables static const geneve_gate_array_device::logentry_t s_logmap[]; static const geneve_gate_array_device::physentry_t s_physmap[]; - void decode_logical(bool reading, decdata* dec); - void map_address(bool reading, decdata* dec); - void decode_physical(decdata* dec); - // This is the hook for Genmod. The normal Geneve just does nothing here. - virtual void decode_mod(decdata* dec) { }; + // Keyboard support + devcb_write_line m_keyint; + uint16_t m_keyboard_shift_reg; + line_state m_keyboard_last_clock; + line_state m_keyboard_data_in; + bool m_shift_reg_enabled; + void shift_reg_changed(); - // PFM mod (0 = none, 1 = AT29C040, 2 = AT29C040A) - uint8_t boot_rom(offs_t offset); - void write_to_pfm(offs_t offset, uint8_t data); - int m_pfm_bank; - bool m_pfm_output_enable; + // Devices + required_device<geneve_pal_device> m_pal; + required_device<bus::ti99::peb::peribox_device> m_peribox; + required_device<pc_kbdc_device> m_keyb_conn; - // SRAM access - int m_sram_mask; - int m_sram_val; + // Emulation-specific: Is the debugger active? + bool m_debug; +}; - // Ready line to the CPU - devcb_write_line m_ready; +/*****************************************************************************/ - // Keyboard interrupt - devcb_write_line m_keyint; +/* + PAL circuit, controlling the READY line to the CPU and MEMEN/WE + to the peribox +*/ - // Counter for the wait states. - int m_waitcount; - int m_video_waitcount; +class geneve_pal_device : public device_t +{ +public: + geneve_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + DECLARE_WRITE_LINE_MEMBER( gaready_in ); + DECLARE_WRITE_LINE_MEMBER( csw_in ); + DECLARE_WRITE_LINE_MEMBER( csr_in ); + DECLARE_WRITE_LINE_MEMBER( memen ); + DECLARE_WRITE_LINE_MEMBER( vwaiten ); // pin 19 + DECLARE_WRITE_LINE_MEMBER( sysspeed ); // pin 5 + DECLARE_WRITE_LINE_MEMBER( clock_in ); - // Keyboard support - uint16_t m_keyboard_shift_reg; - line_state m_keyboard_last_clock; - line_state m_keyboard_data_in; - bool m_shift_reg_enabled; - void shift_reg_changed(); + auto ready_cb() { return m_ready.bind(); } - // Devices - required_device<tms9995_device> m_cpu; - required_device<sn76496_base_device> m_sound; - required_device<v9938_device> m_video; - required_device<mm58274c_device> m_rtc; - required_device<ram_device> m_sram; - required_device<ram_device> m_dram; +private: + void device_start() override; + void set_ready(); + + // Pins + bool m_pin3; + bool m_pin4; + bool m_pin5; + bool m_pin9; + bool m_pin19; + bool m_pin14d,m_pin14q; + bool m_pin15d,m_pin15q; + bool m_pin16d,m_pin16q; + bool m_pin17d,m_pin17q; + + // Debugging + int m_prev_ready; required_device<bus::ti99::peb::peribox_device> m_peribox; - required_device<at29c040_device> m_pfm512; - required_device<at29c040a_device> m_pfm512a; - - required_device<pc_kbdc_device> m_keyb_conn; + // Ready line to the CPU + devcb_write_line m_ready; }; -class genmod_gate_array_device : public geneve_gate_array_device +class genmod_decoder_device : public device_t { public: - genmod_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void decode_mod(decdata* dec) override; - void device_reset() override; - DECLARE_INPUT_CHANGED_MEMBER( setgm_changed ); + genmod_decoder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // Set the internal state and output lines according to the address + void set_function(int func, int page); + void set_debug(bool deb) { m_debug = deb; } + void set_turbo(bool turbo) { m_turbo = turbo; } + void set_timode(bool timode) { m_timode = timode; } + + DECLARE_READ_LINE_MEMBER( gaready_out ); + DECLARE_READ_LINE_MEMBER( dben_out ); + DECLARE_WRITE_LINE_MEMBER( gaready_in ); + DECLARE_WRITE_LINE_MEMBER( extready_in ); + DECLARE_WRITE_LINE_MEMBER( sndready_in ); private: - // Genmod modifications - bool m_gm_timode; + void device_start() override; + + // Emulation-specific: Is the debugger active? + bool m_debug; bool m_turbo; + bool m_timode; + int m_function; + int m_function_debug; + int m_page; + int m_page_debug; + int m_gaready; + int m_extready; + int m_sndready; }; } } } // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(GENEVE_GATE_ARRAY, bus::ti99::internal, geneve_gate_array_device) -DECLARE_DEVICE_TYPE_NS(GENMOD_GATE_ARRAY, bus::ti99::internal, genmod_gate_array_device) +DECLARE_DEVICE_TYPE_NS(GENEVE_PAL, bus::ti99::internal, geneve_pal_device) +DECLARE_DEVICE_TYPE_NS(GENMOD_DECODER, bus::ti99::internal, genmod_decoder_device) #endif // MAME_BUS_TI99_INTERNAL_GENBOARD_H diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index a855fd3bf41..5faaee0a9a6 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -141,6 +141,12 @@ WRITE_LINE_MEMBER(ioport_device::clock_in) m_connected->clock_in(state); } +WRITE_LINE_MEMBER(ioport_device::reset_in) +{ + if (m_connected != nullptr) + m_connected->reset_in(state); +} + void ioport_device::device_start() { m_console_extint.resolve(); diff --git a/src/devices/bus/ti99/internal/ioport.h b/src/devices/bus/ti99/internal/ioport.h index 6b468007eda..75033c467bb 100644 --- a/src/devices/bus/ti99/internal/ioport.h +++ b/src/devices/bus/ti99/internal/ioport.h @@ -37,6 +37,7 @@ public: virtual DECLARE_WRITE_LINE_MEMBER( memen_in ) { } virtual DECLARE_WRITE_LINE_MEMBER( msast_in ) { } virtual DECLARE_WRITE_LINE_MEMBER( clock_in ) { } + virtual DECLARE_WRITE_LINE_MEMBER( reset_in ) { } void set_ioport(ioport_device* ioport) { m_ioport = ioport; } @@ -78,6 +79,7 @@ public: DECLARE_WRITE_LINE_MEMBER( memen_in ); DECLARE_WRITE_LINE_MEMBER( msast_in ); DECLARE_WRITE_LINE_MEMBER( clock_in ); + DECLARE_WRITE_LINE_MEMBER( reset_in ); // Callbacks auto extint_cb() { return m_console_extint.bind(); } diff --git a/src/devices/bus/ti99/peb/bwg.cpp b/src/devices/bus/ti99/peb/bwg.cpp index d6e738f90eb..1a18ac66918 100644 --- a/src/devices/bus/ti99/peb/bwg.cpp +++ b/src/devices/bus/ti99/peb/bwg.cpp @@ -150,7 +150,7 @@ SETADDRESS_DBIN_MEMBER( snug_bwg_device::setaddress_dbin ) // Is the card being selected? m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); + m_inDsrArea = in_dsr_space(m_address, true); if (!m_inDsrArea) return; @@ -196,7 +196,7 @@ SETADDRESS_DBIN_MEMBER( snug_bwg_device::setaddress_dbin ) */ void snug_bwg_device::debug_read(offs_t offset, uint8_t* value) { - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if ((offset & 0x1c00)==0x1c00) { @@ -210,7 +210,7 @@ void snug_bwg_device::debug_read(offs_t offset, uint8_t* value) void snug_bwg_device::debug_write(offs_t offset, uint8_t data) { - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if (((offset & 0x1c00)==0x1c00) && ((offset & 0x1fe0)!=0x1fe0)) m_buffer_ram->pointer()[(m_crulatch8_15->q5_r()<<10) | (m_address & 0x03ff)] = data; @@ -527,17 +527,6 @@ void snug_bwg_device::device_start() void snug_bwg_device::device_reset() { - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } - m_DRQ = CLEAR_LINE; m_IRQ = CLEAR_LINE; m_MOTOR_ON = CLEAR_LINE; diff --git a/src/devices/bus/ti99/peb/evpc.cpp b/src/devices/bus/ti99/peb/evpc.cpp index 6e532ae11ea..3c97a282fd5 100644 --- a/src/devices/bus/ti99/peb/evpc.cpp +++ b/src/devices/bus/ti99/peb/evpc.cpp @@ -86,10 +86,10 @@ SETADDRESS_DBIN_MEMBER( snug_enhanced_video_device::setaddress_dbin ) m_address = offset; bool reading = (state==ASSERT_LINE); - int offbase = (m_address & 0xfc01); + int offbase = (m_address & 0x7fc01); // The 7 represents the AMA/B/C lines // Sound - m_sound_accessed = ((m_address & 0xff01)==0x8400) && !reading; + m_sound_accessed = ((m_address & 0x7ff01)==0x78400) && !reading; // Video space // 8800 / 8802 / 8804 / 8806 @@ -97,15 +97,15 @@ SETADDRESS_DBIN_MEMBER( snug_enhanced_video_device::setaddress_dbin ) // // Bits 1000 1w00 0000 0xx0 // Mask 1111 1000 0000 0001 - m_video_accessed = ((offbase==0x8800) && reading) || ((offbase==0x8c00) && !reading); + m_video_accessed = ((offbase==0x78800) && reading) || ((offbase==0x78c00) && !reading); // Read a byte in evpc DSR space // 0x4000 - 0x5eff DSR (paged) // 0x5f00 - 0x5fef NOVRAM // 0x5ff0 - 0x5fff Palette - m_inDsrArea = ((m_address & 0xe000)==0x4000); - m_novram_accessed = ((m_address & 0xff00)==0x5f00); - m_palette_accessed = ((m_address & 0xfff0)==0x5ff0); + m_inDsrArea = in_dsr_space(m_address, true); + m_novram_accessed = ((m_address & 0x7ff00)==0x75f00); + m_palette_accessed = ((m_address & 0x7fff0)==0x75ff0); // Note that we check the selection in reverse order so that the overlap is avoided } @@ -413,8 +413,6 @@ void snug_enhanced_video_device::device_start() void snug_enhanced_video_device::device_reset() { - m_select_mask = 0x7e000; - m_select_value = 0x74000; m_dsr_page = 0; m_RAMEN = false; m_selected = false; diff --git a/src/devices/bus/ti99/peb/hfdc.cpp b/src/devices/bus/ti99/peb/hfdc.cpp index 6a9a89726b2..ac418f30256 100644 --- a/src/devices/bus/ti99/peb/hfdc.cpp +++ b/src/devices/bus/ti99/peb/hfdc.cpp @@ -124,7 +124,7 @@ SETADDRESS_DBIN_MEMBER( myarc_hfdc_device::setaddress_dbin ) // 010x xxxx xxxx xxxx m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); + m_inDsrArea = in_dsr_space(m_address, true); if (!m_inDsrArea) return; @@ -161,7 +161,7 @@ SETADDRESS_DBIN_MEMBER( myarc_hfdc_device::setaddress_dbin ) */ void myarc_hfdc_device::debug_read(offs_t offset, uint8_t* value) { - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if ((offset & 0x1000)==RAM_ADDR) { @@ -180,7 +180,7 @@ void myarc_hfdc_device::debug_read(offs_t offset, uint8_t* value) void myarc_hfdc_device::debug_write(offs_t offset, uint8_t data) { - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if ((offset & 0x1000)==RAM_ADDR) { @@ -880,10 +880,7 @@ void myarc_hfdc_device::device_start() save_item(NAME(m_senila)); save_item(NAME(m_senilb)); save_item(NAME(m_selected)); - save_item(NAME(m_genmod)); save_item(NAME(m_cru_base)); - save_item(NAME(m_select_mask)); - save_item(NAME(m_select_value)); // Own members save_item(NAME(m_see_switches)); @@ -911,18 +908,6 @@ void myarc_hfdc_device::device_start() void myarc_hfdc_device::device_reset() { - // The GenMOD mod; our implementation automagically adapts all cards - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } - m_cru_base = ioport("CRUHFDC")->read(); m_wait_for_hd1 = ioport("WAITHD1")->read(); diff --git a/src/devices/bus/ti99/peb/horizon.cpp b/src/devices/bus/ti99/peb/horizon.cpp index 89383125cbb..0ed6d0fff03 100644 --- a/src/devices/bus/ti99/peb/horizon.cpp +++ b/src/devices/bus/ti99/peb/horizon.cpp @@ -48,6 +48,11 @@ less than 2 MiB onboard. As the community is still alive we can hope for a fix for this problem; so we make the size configurable. + According to the Genmod setup instructions, the Horizon Ramdisks do not + decode the AMA/AMB/AMC lines, so it is important to modify them when + running with the Genmod system. This can be done with the configuration + setting "Genmod fix". + *****************************************************************************/ #include "emu.h" @@ -81,8 +86,6 @@ horizon_ramdisk_device::horizon_ramdisk_device(const machine_config &mconfig, co m_ram(*this, RAMREGION), m_nvram(*this, NVRAMREGION), m_ros(*this, ROSREGION), - m_select6_value(0), - m_select_all(0), m_page(0), m_cru_horizon(0), m_cru_phoenix(0), @@ -91,7 +94,8 @@ horizon_ramdisk_device::horizon_ramdisk_device(const machine_config &mconfig, co m_split_mode(false), m_rambo_mode(false), m_hideswitch(false), - m_use_rambo(false) + m_use_rambo(false), + m_genmod_fix(false) { } @@ -185,7 +189,7 @@ READ8Z_MEMBER(horizon_ramdisk_device::readz) if (!m_rambo_mode) { - if ((offset & m_select_mask) == m_select_value) + if (in_dsr_space(offset, m_genmod_fix)) { if ((offset & 0x1800) == 0x1800) { @@ -203,12 +207,12 @@ READ8Z_MEMBER(horizon_ramdisk_device::readz) } else { - if ((offset & m_select_mask)==m_select_value) + if (in_dsr_space(offset, m_genmod_fix)) { *value = m_ros->pointer()[offset & 0x1fff]; LOGMASKED(LOG_READ, "offset=%04x (Rambo) -> %02x\n", offset&0xffff, *value); } - if ((offset & m_select_mask)==m_select6_value) + if (in_cart_space(offset, m_genmod_fix)) { // In RAMBO mode the page numbers are multiples of 4 // (encompassing 4 Horizon pages) @@ -251,7 +255,7 @@ void horizon_ramdisk_device::write(offs_t offset, uint8_t data) if (!m_rambo_mode) { - if ((offset & m_select_mask) == m_select_value) + if (in_dsr_space(offset, m_genmod_fix)) { if ((offset & 0x1800) == 0x1800) { @@ -269,12 +273,12 @@ void horizon_ramdisk_device::write(offs_t offset, uint8_t data) } else { - if ((offset & m_select_mask)==m_select_value) + if (in_dsr_space(offset, m_genmod_fix)) { m_ros->pointer()[offset & 0x1fff] = data; LOGMASKED(LOG_WRITE, "offset=%04x (Rambo) <- %02x\n", offset&0xffff, data); } - if ((offset & m_select_mask)==m_select6_value) + if (in_cart_space(offset, m_genmod_fix)) { // In RAMBO mode the page numbers are multiples of 4 // (encompassing 4 Horizon pages) @@ -376,8 +380,6 @@ void horizon_ramdisk_device::device_start(void) m_cru_horizon = 0; m_cru_phoenix = 0; - save_item(NAME(m_select6_value)); - save_item(NAME(m_select_all)); save_item(NAME(m_page)); save_item(NAME(m_cru_horizon)); save_item(NAME(m_cru_phoenix)); @@ -391,21 +393,6 @@ void horizon_ramdisk_device::device_start(void) void horizon_ramdisk_device::device_reset(void) { - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - m_select6_value = 0x176000; - m_select_all = 0x170000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - m_select6_value = 0x76000; - m_select_all = 0x70000; - } - m_cru_horizon = ioport("CRUHOR")->read(); m_cru_phoenix = ioport("CRUPHOE")->read(); @@ -419,6 +406,8 @@ void horizon_ramdisk_device::device_reset(void) m_use_rambo = (ioport("RAMBO")->read()!=0); + m_genmod_fix = (ioport("GENMODFIX")->read()!=0); + m_page = 0; m_selected = false; } @@ -477,6 +466,11 @@ INPUT_PORTS_START( horizon ) PORT_CONFSETTING( 0x02, "8 MiB") PORT_CONFSETTING( 0x03, "16 MiB") + PORT_START( "GENMODFIX" ) + PORT_CONFNAME( 0x01, 0x00, "Horizon Genmod fix" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off )) + PORT_CONFSETTING( 0x01, DEF_STR( On )) + INPUT_PORTS_END void horizon_ramdisk_device::device_add_mconfig(machine_config &config) diff --git a/src/devices/bus/ti99/peb/horizon.h b/src/devices/bus/ti99/peb/horizon.h index f72e9f109fc..234dd68028a 100644 --- a/src/devices/bus/ti99/peb/horizon.h +++ b/src/devices/bus/ti99/peb/horizon.h @@ -51,9 +51,6 @@ private: required_device<ram_device> m_nvram; required_device<ram_device> m_ros; - int m_select6_value; - int m_select_all; - int m_page; int m_cru_horizon; @@ -64,6 +61,7 @@ private: bool m_rambo_mode; bool m_hideswitch; bool m_use_rambo; + bool m_genmod_fix; }; } } } // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/memex.cpp b/src/devices/bus/ti99/peb/memex.cpp index 3a3116d262d..49d41bba4ec 100644 --- a/src/devices/bus/ti99/peb/memex.cpp +++ b/src/devices/bus/ti99/peb/memex.cpp @@ -15,8 +15,12 @@ #include "emu.h" #include "memex.h" -#define LOG_WARN (1U<<1) // Warnings -#define LOG_CONFIG (1U<<2) // Configuration +#define LOG_WARN (1U<<1) +#define LOG_CONFIG (1U<<2) +#define LOG_READ (1U<<3) +#define LOG_WRITE (1U<<4) +#define LOG_BLOCK (1U<<5) + #define VERBOSE ( LOG_CONFIG | LOG_WARN ) #include "logmacro.h" @@ -56,12 +60,19 @@ bool geneve_memex_device::access_enabled(offs_t offset) // we may have to lock out those areas int page = (offset >> 13)&0xff; + // All mirrors of page ba via AMD/AME are blocked. + // These are 3a, 7a, ba, and fa. + if ((page & 0x3f)==0x3a) + { + LOGMASKED(LOG_BLOCK, "memex blocks page %02x\n", page); + return false; + } + // SW2: 10xxx010 locked when SW2=off // 10111010 locked when SW2=on - if (page == 0xba) return false; if ((page & 0xc7)==0x82 && ((m_switches & MDIP2)==0)) { - LOGMASKED(LOG_CONFIG, "memex blocks page %02x; dip2=%d\n", page, (m_switches & MDIP2)!=0); + LOGMASKED(LOG_BLOCK, "memex blocks page %02x; dip2=%d\n", page, (m_switches & MDIP2)!=0); return false; } @@ -91,11 +102,14 @@ bool geneve_memex_device::access_enabled(offs_t offset) READ8Z_MEMBER( geneve_memex_device::readz ) { /* If not Genmod, add the upper two address bits 10 */ - if (!m_genmod) offset |= 0x100000; +// if (!m_genmod) offset |= 0x100000; // The card is accessed for all addresses in the address space if (access_enabled(offset)) + { *value = m_ram->pointer()[offset]; + LOGMASKED(LOG_READ, "%06x -> %02x\n", offset, *value); + } } /* @@ -104,11 +118,14 @@ READ8Z_MEMBER( geneve_memex_device::readz ) void geneve_memex_device::write(offs_t offset, uint8_t data) { /* If not Genmod, add the upper two address bits 10 */ - if (!m_genmod) offset |= 0x100000; +// if (!m_genmod) offset |= 0x100000; // The card is accessed for all addresses in the address space if (access_enabled(offset)) + { + LOGMASKED(LOG_WRITE, "%06x <- %02x\n", offset, data); m_ram->pointer()[offset] = data; + } } /**************************************************************************/ diff --git a/src/devices/bus/ti99/peb/pcode.cpp b/src/devices/bus/ti99/peb/pcode.cpp index 9b711c6bfc6..3cd03205be7 100644 --- a/src/devices/bus/ti99/peb/pcode.cpp +++ b/src/devices/bus/ti99/peb/pcode.cpp @@ -118,7 +118,7 @@ ti_pcode_card_device::ti_pcode_card_device(const machine_config &mconfig, const SETADDRESS_DBIN_MEMBER( ti_pcode_card_device::setaddress_dbin ) { m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); + m_inDsrArea = in_dsr_space(offset, true); line_state a14 = ((m_address & 2)!=0)? ASSERT_LINE : CLEAR_LINE; @@ -145,7 +145,7 @@ SETADDRESS_DBIN_MEMBER( ti_pcode_card_device::setaddress_dbin ) void ti_pcode_card_device::debugger_read(uint16_t offset, uint8_t& value) { // The debuger does not call setaddress - if (m_active && ((offset & m_select_mask)==m_select_value)) + if (m_active && in_dsr_space(offset, true)) { bool isrom0 = ((offset & 0xf000)==0x4000); bool isrom12 = ((offset & 0xf000)==0x5000); @@ -287,16 +287,6 @@ void ti_pcode_card_device::device_start() void ti_pcode_card_device::device_reset() { - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } m_bank_select = 1; m_selected = false; m_clock_count = 0; diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index 3c93f44e536..ae7ec8ab0dd 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -264,8 +264,10 @@ peribox_device::peribox_device(const machine_config &mconfig, device_type type, peribox_device::peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_device(mconfig, TI99_PERIBOX, tag, owner, clock) { + // The address prefix represents a set of pull-up resistors for the + // additional address lines AMA, AMB, AMC. They are contained in the + // Flex Cable Interface. m_address_prefix = 0x70000; - m_genmod = false; } READ8Z_MEMBER(peribox_device::readz) @@ -312,6 +314,17 @@ void peribox_device::cruwrite(offs_t offset, uint8_t data) } /* + RESET line from the console. +*/ +WRITE_LINE_MEMBER(peribox_device::reset_in) +{ + for (int i=2; i <= 8; i++) + { + if (m_slot[i]!=nullptr) m_slot[i]->reset_in(state); + } +} + +/* And here are finally the two mythical lines SENILA* and SENILB*; mythical since there is no report of any software that ever used them. */ @@ -428,8 +441,6 @@ void peribox_device::ready_join(int slot, int state) void peribox_device::set_slot_loaded(int slot, peribox_slot_device* slotdev) { m_slot[slot] = slotdev; - if (slotdev != nullptr) - slotdev->set_genmod(m_genmod); } void peribox_device::device_start() @@ -500,7 +511,6 @@ peribox_ev_device::peribox_ev_device(const machine_config &mconfig, const char * : peribox_device(mconfig, TI99_PERIBOX_EV, tag, owner, clock) { m_address_prefix = 0x70000; - m_genmod = false; } void ti99_peribox_slot_evpc(device_slot_interface &device) @@ -548,13 +558,11 @@ peribox_gen_device::peribox_gen_device(const machine_config &mconfig, device_typ peribox_gen_device::peribox_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_gen_device(mconfig, TI99_PERIBOX_GEN, tag, owner, clock) { - m_genmod = false; } peribox_genmod_device::peribox_genmod_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_gen_device(mconfig, TI99_PERIBOX_GENMOD, tag, owner, clock) { - m_genmod = true; } // The BwG controller will not run with the Geneve due to its wait state @@ -601,8 +609,9 @@ void peribox_genmod_device::device_add_mconfig(machine_config &config) peribox_sg_device::peribox_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_device(mconfig, TI99_PERIBOX_SG, tag, owner, clock) { + // The SGCPU card contains pull-up registers for the AMA/AMB/AMC lines + // like the Flex Cable Interface m_address_prefix = 0x70000; - m_genmod = false; } void ti99_peribox_slot_sgcpu(device_slot_interface &device) @@ -685,12 +694,9 @@ WRITE_LINE_MEMBER( peribox_slot_device::clock_in ) m_card->clock_in(state); } -/* - Genmod support -*/ -void peribox_slot_device::set_genmod(bool set) +WRITE_LINE_MEMBER( peribox_slot_device::reset_in ) { - m_card->m_genmod = set; + m_card->reset_in(state); } void peribox_slot_device::device_start() @@ -738,13 +744,10 @@ WRITE_LINE_MEMBER( peribox_slot_device::set_ready ) device_ti99_peribox_card_interface::device_ti99_peribox_card_interface(const machine_config &mconfig, device_t &device): device_interface(device, "ti99peb"), m_selected(false), - m_cru_base(0), - m_select_mask(0), - m_select_value(0) + m_cru_base(0) { m_senila = CLEAR_LINE; m_senilb = CLEAR_LINE; - m_genmod = false; } void device_ti99_peribox_card_interface::interface_config_complete() @@ -752,4 +755,20 @@ void device_ti99_peribox_card_interface::interface_config_complete() m_slot = dynamic_cast<peribox_slot_device*>(device().owner()); } +bool device_ti99_peribox_card_interface::in_dsr_space(offs_t offset, bool amadec) +{ + if (amadec) + return (offset & 0x7e000)==0x74000; + else + return (offset & 0x0e000)==0x04000; +} + +bool device_ti99_peribox_card_interface::in_cart_space(offs_t offset, bool amadec) +{ + if (amadec) + return (offset & 0x7e000)==0x76000; + else + return (offset & 0x0e000)==0x06000; +} + } } } // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h index 7444745f3d9..dc294a8778c 100644 --- a/src/devices/bus/ti99/peb/peribox.h +++ b/src/devices/bus/ti99/peb/peribox.h @@ -49,6 +49,7 @@ public: DECLARE_WRITE_LINE_MEMBER( msast_in ) override; DECLARE_WRITE_LINE_MEMBER( clock_in ) override; + DECLARE_WRITE_LINE_MEMBER( reset_in ) override; // Part of configuration void set_prefix(int prefix) { m_address_prefix = prefix; } @@ -107,9 +108,6 @@ protected: // Configured as a slot device (of the ioport) bool m_ioport_connected; - - // Used for Genmod - bool m_genmod; }; /************************************************************************ @@ -182,6 +180,8 @@ public: virtual DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin) { }; virtual DECLARE_WRITE_LINE_MEMBER(clock_in) { } + virtual DECLARE_WRITE_LINE_MEMBER(reset_in) { } + void set_senila(int state) { m_senila = state; } void set_senilb(int state) { m_senilb = state; } @@ -196,15 +196,13 @@ protected: // When true, card is accessible. Indicated by a LED. bool m_selected; - // When true, GenMod is selected. Modified by peribox_slot_device. - bool m_genmod; - // CRU base. Used to configure the address by which a card is selected. int m_cru_base; - // Used to decide whether this card has been selected. - int m_select_mask; - int m_select_value; + // Methods to decide whether we are acccessing the 4000-5fff region (DSR) + // or the cartridge region + static bool in_dsr_space(offs_t offset, bool amadec); + static bool in_cart_space(offs_t offset, bool amadec); }; /***************************************************************************** @@ -236,6 +234,7 @@ public: DECLARE_WRITE_LINE_MEMBER(senila); DECLARE_WRITE_LINE_MEMBER(senilb); DECLARE_WRITE_LINE_MEMBER(clock_in); + DECLARE_WRITE_LINE_MEMBER(reset_in); // Called from the card (direction to box) DECLARE_WRITE_LINE_MEMBER( set_inta ); @@ -247,7 +246,6 @@ public: void cruwrite(offs_t offset, uint8_t data); // called from the box itself - void set_genmod(bool set); void set_number(int number) { m_slotnumber = number; } protected: diff --git a/src/devices/bus/ti99/peb/samsmem.cpp b/src/devices/bus/ti99/peb/samsmem.cpp index dff96b57198..61b668bb46e 100644 --- a/src/devices/bus/ti99/peb/samsmem.cpp +++ b/src/devices/bus/ti99/peb/samsmem.cpp @@ -19,6 +19,8 @@ called the Super AMS. Any documentation and software containing a reference to the AEMS are applicable to either AMS or SAMS. + The SAMS does not decode AMA/AMB/AMC. + Michael Zapf *****************************************************************************/ @@ -50,7 +52,7 @@ READ8Z_MEMBER(sams_memory_expansion_device::readz) { int base; - if (m_access_mapper && ((offset & 0xe000)==0x4000)) + if (m_access_mapper && in_dsr_space(offset, false)) { *value = m_mapper[(offset>>1)&0x000f]; } @@ -74,7 +76,7 @@ void sams_memory_expansion_device::write(offs_t offset, uint8_t data) { int base; - if (m_access_mapper && ((offset & 0xe000)==0x4000)) + if (m_access_mapper && in_dsr_space(offset, false)) { m_mapper[(offset>>1)&0x000f] = data; } diff --git a/src/devices/bus/ti99/peb/spchsyn.cpp b/src/devices/bus/ti99/peb/spchsyn.cpp index 73e6d37e682..4d9f5cbd259 100644 --- a/src/devices/bus/ti99/peb/spchsyn.cpp +++ b/src/devices/bus/ti99/peb/spchsyn.cpp @@ -47,7 +47,8 @@ ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config device_ti99_peribox_card_interface(mconfig, *this), m_vsp(*this, "vsp"), m_reading(false), - m_sbe(false) + m_sbe(false), + m_dec_high(false) { } @@ -95,7 +96,11 @@ SETADDRESS_DBIN_MEMBER( ti_speech_synthesizer_device::setaddress_dbin ) m_reading = (state==ASSERT_LINE); bool valid = (((offset & 0x0400)==0) == m_reading); - m_sbe = ((offset & m_select_mask)==m_select_value) && valid; + + if (m_dec_high) + m_sbe = ((offset & 0x7f801)==0x79000) && valid; + else + m_sbe = ((offset & 0x0f801)==0x09000) && valid; if (m_sbe) { @@ -136,19 +141,9 @@ void ti_speech_synthesizer_device::device_start() void ti_speech_synthesizer_device::device_reset() { - if (m_genmod) - { - m_select_mask = 0x1ff801; - m_select_value = 0x179000; - } - else - { - m_select_mask = 0x7f801; - m_select_value = 0x79000; - } - m_reading = false; m_sbe = false; + m_dec_high = (ioport("AMADECODE")->read()!=0); } ROM_START( ti99_speech ) @@ -177,6 +172,18 @@ void ti_speech_synthesizer_device::device_add_mconfig(machine_config& config) */ } +INPUT_PORTS_START( ti99_speech ) + PORT_START( "AMADECODE" ) + PORT_CONFNAME( 0x01, 0x01, "Decode AMA/AMB/AMC lines" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off )) + PORT_CONFSETTING( 0x01, DEF_STR( On )) +INPUT_PORTS_END + +ioport_constructor ti_speech_synthesizer_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(ti99_speech); +} + const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const { return ROM_NAME( ti99_speech ); diff --git a/src/devices/bus/ti99/peb/spchsyn.h b/src/devices/bus/ti99/peb/spchsyn.h index 8efee71aed7..9b6a464e519 100644 --- a/src/devices/bus/ti99/peb/spchsyn.h +++ b/src/devices/bus/ti99/peb/spchsyn.h @@ -37,13 +37,15 @@ protected: virtual void device_reset() override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; private: DECLARE_WRITE_LINE_MEMBER( speech_ready ); required_device<cd2501e_device> m_vsp; - bool m_reading; - bool m_sbe; // Signal "Speech block enable" + bool m_reading; + bool m_sbe; // Signal "Speech block enable" + bool m_dec_high; // Decode the AMA/AMB/ABC address lines }; } } } // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/ti_fdc.cpp b/src/devices/bus/ti99/peb/ti_fdc.cpp index 0e293c41401..1ad839ac537 100644 --- a/src/devices/bus/ti99/peb/ti_fdc.cpp +++ b/src/devices/bus/ti99/peb/ti_fdc.cpp @@ -105,7 +105,7 @@ SETADDRESS_DBIN_MEMBER( ti_fdc_device::setaddress_dbin ) // Is the card being selected? m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); + m_inDsrArea = in_dsr_space(offset, true); if (!m_inDsrArea || !m_selected) return; @@ -124,7 +124,7 @@ SETADDRESS_DBIN_MEMBER( ti_fdc_device::setaddress_dbin ) */ void ti_fdc_device::debug_read(offs_t offset, uint8_t* value) { - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if ((offset & 0x1ff1)!=0x1ff0) *value = m_dsrrom[offset & 0x1fff]; @@ -349,16 +349,6 @@ void ti_fdc_device::device_start() void ti_fdc_device::device_reset() { - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } m_DRQ = CLEAR_LINE; m_IRQ = CLEAR_LINE; m_DVENA = CLEAR_LINE; diff --git a/src/devices/bus/ti99/peb/ti_rs232.cpp b/src/devices/bus/ti99/peb/ti_rs232.cpp index 1ebae489d3a..ffb1d38c980 100644 --- a/src/devices/bus/ti99/peb/ti_rs232.cpp +++ b/src/devices/bus/ti99/peb/ti_rs232.cpp @@ -387,7 +387,7 @@ READ8Z_MEMBER( ti_rs232_pio_device::readz ) // use of it m_ila = 0; } - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if ((offset & 0x1000)==0x0000) { @@ -405,7 +405,7 @@ READ8Z_MEMBER( ti_rs232_pio_device::readz ) */ void ti_rs232_pio_device::write(offs_t offset, uint8_t data) { - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if ((offset & 0x1001)==0x1000) { @@ -1061,17 +1061,6 @@ void ti_rs232_pio_device::device_reset() m_bufpos[0] = m_bufpos[1] = m_buflen[0] = m_buflen[1] = 0; - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } - m_selected = false; m_cru_base = (ioport("CRURS232")->read()==0)? 0x1300 : 0x1500; diff --git a/src/devices/bus/ti99/peb/tn_ide.cpp b/src/devices/bus/ti99/peb/tn_ide.cpp index 4654a926791..5feb284f5bc 100644 --- a/src/devices/bus/ti99/peb/tn_ide.cpp +++ b/src/devices/bus/ti99/peb/tn_ide.cpp @@ -133,7 +133,7 @@ READ8Z_MEMBER(nouspikel_ide_interface_device::readz) uint8_t reply = 0; if (machine().side_effects_disabled()) return; - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { int addr = offset & 0x1fff; @@ -199,7 +199,7 @@ void nouspikel_ide_interface_device::write(offs_t offset, uint8_t data) { if (machine().side_effects_disabled()) return; - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if (m_cru_register & cru_reg_page_switching) { @@ -326,16 +326,6 @@ void nouspikel_ide_interface_device::device_reset() m_sram_enable = false; m_cru_register = 0; - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } m_selected = false; m_cru_base = ioport("CRUIDE")->read(); diff --git a/src/devices/bus/ti99/peb/tn_usbsm.cpp b/src/devices/bus/ti99/peb/tn_usbsm.cpp index 77f933667e9..8f6a9064c7e 100644 --- a/src/devices/bus/ti99/peb/tn_usbsm.cpp +++ b/src/devices/bus/ti99/peb/tn_usbsm.cpp @@ -192,7 +192,7 @@ READ8Z_MEMBER(nouspikel_usb_smartmedia_device::readz) { if (machine().side_effects_disabled()) return; - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { if (m_tms9995_mode ? (!(offset & 1)) : (offset & 1)) { @@ -243,7 +243,7 @@ void nouspikel_usb_smartmedia_device::write(offs_t offset, uint8_t data) { if (machine().side_effects_disabled()) return; - if (((offset & m_select_mask)==m_select_value) && m_selected) + if (in_dsr_space(offset, true) && m_selected) { /* latch write */ if (offset & 1) @@ -325,16 +325,6 @@ void nouspikel_usb_smartmedia_device::device_reset() m_enable_sm = false; m_write_flash = false; - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } m_selected = false; m_cru_base = ioport("CRUUSBSM")->read(); diff --git a/src/devices/cpu/alph8201/8201dasm.cpp b/src/devices/cpu/alph8201/8201dasm.cpp index 76a1d0d98a8..cf24aff16b3 100644 --- a/src/devices/cpu/alph8201/8201dasm.cpp +++ b/src/devices/cpu/alph8201/8201dasm.cpp @@ -22,7 +22,7 @@ cpu/alph8201/ will be removed when the alpha 8304 has been dumped. #include "emu.h" #include "8201dasm.h" -#include <ctype.h> +#include <cctype> #include <stdexcept> diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp index 4cf3b5fe351..0637c42ddc4 100644 --- a/src/devices/cpu/arm7/arm7.cpp +++ b/src/devices/cpu/arm7/arm7.cpp @@ -35,6 +35,17 @@ TODO: #include "arm7core.h" //include arm7 core #include "arm7help.h" +#define LOG_MMU (1 << 0) +#define LOG_DSP (1 << 1) +#define LOG_COPRO_READS (1 << 2) +#define LOG_COPRO_WRITES (1 << 3) +#define LOG_COPRO_UNKNOWN (1 << 4) +#define LOG_COPRO_RESERVED (1 << 5) + +#define VERBOSE (0) //(LOG_MMU | LOG_COPRO_READS | LOG_COPRO_WRITES) +#include "logmacro.h" + +#define PRINT_HAPYFSH2 (0) /* prototypes of coprocessor functions */ void arm7_dt_r_callback(arm_state *arm, uint32_t insn, uint32_t *prn, uint32_t (*read32)(arm_state *arm, uint32_t addr)); @@ -48,6 +59,7 @@ void (*arm7_coproc_dt_w_callback)(arm_state *arm, uint32_t insn, uint32_t *prn, DEFINE_DEVICE_TYPE(ARM7, arm7_cpu_device, "arm7_le", "ARM7 (little)") DEFINE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device, "arm7_be", "ARM7 (big)") DEFINE_DEVICE_TYPE(ARM710A, arm710a_cpu_device, "arm710a", "ARM710a") +DEFINE_DEVICE_TYPE(ARM710T, arm710t_cpu_device, "arm710t", "ARM710T") DEFINE_DEVICE_TYPE(ARM7500, arm7500_cpu_device, "arm7500", "ARM7500") DEFINE_DEVICE_TYPE(ARM9, arm9_cpu_device, "arm9", "ARM9") DEFINE_DEVICE_TYPE(ARM920T, arm920t_cpu_device, "arm920t", "ARM920T") @@ -106,6 +118,15 @@ arm710a_cpu_device::arm710a_cpu_device(const machine_config &mconfig, const char } +arm710t_cpu_device::arm710t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : arm7_cpu_device(mconfig, ARM710T, tag, owner, clock, 4, ARCHFLAG_MODE26, ENDIANNESS_LITTLE) +{ + m_copro_id = ARM9_COPRO_ID_MFR_ARM + | ARM9_COPRO_ID_PART_ARM710 + | 0x00800000; +} + + arm7500_cpu_device::arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, ARM7500, tag, owner, clock, 4, ARCHFLAG_MODE26, ENDIANNESS_LITTLE) { @@ -320,7 +341,7 @@ uint32_t arm7_cpu_device::arm7_tlb_get_second_level_descriptor( uint32_t granula break; default: // We shouldn't be here - LOG( ( "ARM7: Attempting to get second-level TLB descriptor of invalid granularity (%d)\n", granularity ) ); + LOGMASKED(LOG_MMU, "ARM7: Attempting to get second-level TLB descriptor of invalid granularity (%d)\n", granularity); break; } @@ -416,7 +437,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except #if ARM7_MMU_ENABLE_HACK if ((m_r[eR15] == (m_mmu_enable_addr + 4)) || (m_r[eR15] == (m_mmu_enable_addr + 8))) { - LOG( ( "ARM7: fetch flat, PC = %08x, vaddr = %08x\n", m_r[eR15], addr ) ); + LOGMASKED(LOG_MMU, "ARM7: fetch flat, PC = %08x, vaddr = %08x\n", m_r[eR15], addr); return true; } else @@ -442,18 +463,18 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except if (flags & ARM7_TLB_ABORT_D) { uint8_t domain = (desc_lvl1 >> 5) & 0xF; - LOG( ( "ARM7: Section Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15] ) ); + LOGMASKED(LOG_MMU, "ARM7: Section Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15]); m_faultStatus[0] = ((fault == FAULT_DOMAIN) ? (9 << 0) : (13 << 0)) | (domain << 4); // 9 = section domain fault, 13 = section permission fault m_faultAddress = addr; m_pendingAbtD = true; update_irq_state(); - LOG( ( "vaddr %08X desc_lvl1 %08X domain %d permission %d ap %d s %d r %d mode %d read %d write %d\n", + LOGMASKED(LOG_MMU, "vaddr %08X desc_lvl1 %08X domain %d permission %d ap %d s %d r %d mode %d read %d write %d\n", addr, desc_lvl1, domain, (m_domainAccessControl >> ((desc_lvl1 >> 4) & 0x1e)) & 3, (desc_lvl1 >> 10) & 3, (m_control & COPRO_CTRL_SYSTEM) ? 1 : 0, (m_control & COPRO_CTRL_ROM) ? 1 : 0, - m_r[eCPSR] & MODE_FLAG, flags & ARM7_TLB_READ ? 1 : 0, flags & ARM7_TLB_WRITE ? 1 : 0) ); + m_r[eCPSR] & MODE_FLAG, flags & ARM7_TLB_READ ? 1 : 0, flags & ARM7_TLB_WRITE ? 1 : 0); } else if (flags & ARM7_TLB_ABORT_P) { - LOG( ( "ARM7: Section Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15] ) ); + LOGMASKED(LOG_MMU, "ARM7: Section Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15]); m_pendingAbtP = true; update_irq_state(); } @@ -468,7 +489,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except // Unmapped, generate a translation fault if (flags & ARM7_TLB_ABORT_D) { - LOG( ( "ARM7: Translation fault on unmapped virtual address, PC = %08x, vaddr = %08x\n", m_r[eR15], addr ) ); + LOGMASKED(LOG_MMU, "ARM7: Translation fault on unmapped virtual address, PC = %08x, vaddr = %08x\n", m_r[eR15], addr); m_faultStatus[0] = (5 << 0); // 5 = section translation fault m_faultAddress = addr; m_pendingAbtD = true; @@ -476,7 +497,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except } else if (flags & ARM7_TLB_ABORT_P) { - LOG( ( "ARM7: Translation fault on unmapped virtual address, PC = %08x, vaddr = %08x\n", m_r[eR15], addr ) ); + LOGMASKED(LOG_MMU, "ARM7: Translation fault on unmapped virtual address, PC = %08x, vaddr = %08x\n", m_r[eR15], addr); m_pendingAbtP = true; update_irq_state(); } @@ -503,7 +524,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except if (flags & ARM7_TLB_ABORT_D) { uint8_t domain = (desc_lvl1 >> 5) & 0xF; - LOG( ( "ARM7: Translation fault on unmapped virtual address, vaddr = %08x, PC %08X\n", addr, m_r[eR15] ) ); + LOGMASKED(LOG_MMU, "ARM7: Translation fault on unmapped virtual address, vaddr = %08x, PC %08X\n", addr, m_r[eR15]); m_faultStatus[0] = (7 << 0) | (domain << 4); // 7 = page translation fault m_faultAddress = addr; m_pendingAbtD = true; @@ -511,7 +532,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except } else if (flags & ARM7_TLB_ABORT_P) { - LOG( ( "ARM7: Translation fault on unmapped virtual address, vaddr = %08x, PC %08X\n", addr, m_r[eR15] ) ); + LOGMASKED(LOG_MMU, "ARM7: Translation fault on unmapped virtual address, vaddr = %08x, PC %08X\n", addr, m_r[eR15]); m_pendingAbtP = true; update_irq_state(); } @@ -539,18 +560,18 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except { uint8_t domain = (desc_lvl1 >> 5) & 0xF; // hapyfish expects a data abort when something tries to write to a read-only memory location from user mode - LOG( ( "ARM7: Page Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15] ) ); + LOGMASKED(LOG_MMU, "ARM7: Page Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15]); m_faultStatus[0] = ((fault == FAULT_DOMAIN) ? (11 << 0) : (15 << 0)) | (domain << 4); // 11 = page domain fault, 15 = page permission fault m_faultAddress = addr; m_pendingAbtD = true; update_irq_state(); - LOG( ( "vaddr %08X desc_lvl2 %08X domain %d permission %d ap %d s %d r %d mode %d read %d write %d\n", + LOGMASKED(LOG_MMU, "vaddr %08X desc_lvl2 %08X domain %d permission %d ap %d s %d r %d mode %d read %d write %d\n", addr, desc_lvl2, domain, permission, ap, (m_control & COPRO_CTRL_SYSTEM) ? 1 : 0, (m_control & COPRO_CTRL_ROM) ? 1 : 0, - m_r[eCPSR] & MODE_FLAG, flags & ARM7_TLB_READ ? 1 : 0, flags & ARM7_TLB_WRITE ? 1 : 0) ); + m_r[eCPSR] & MODE_FLAG, flags & ARM7_TLB_READ ? 1 : 0, flags & ARM7_TLB_WRITE ? 1 : 0); } else if (flags & ARM7_TLB_ABORT_P) { - LOG( ( "ARM7: Page Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15] ) ); + LOGMASKED(LOG_MMU, "ARM7: Page Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15]); m_pendingAbtP = true; update_irq_state(); } @@ -562,7 +583,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags, bool no_except // Tiny page descriptor if( ( desc_lvl1 & 3 ) == 1 ) { - LOG( ( "ARM7: It would appear that we're looking up a tiny page from a coarse TLB lookup. This is bad. vaddr = %08x\n", addr ) ); + LOGMASKED(LOG_MMU, "ARM7: It would appear that we're looking up a tiny page from a coarse TLB lookup. This is bad. vaddr = %08x\n", addr); } addr = ( desc_lvl2 & COPRO_TLB_TINY_PAGE_MASK ) | ( addr & ~COPRO_TLB_TINY_PAGE_MASK ); break; @@ -705,7 +726,6 @@ void arm946es_cpu_device::device_start() save_item(NAME(DTCM)); } - void arm7_cpu_device::state_export(const device_state_entry &entry) { switch (entry.index()) @@ -766,6 +786,11 @@ void arm7_cpu_device::device_reset() m_impstate.cache_dirty = true; } +void arm1176jzf_s_cpu_device::device_reset() +{ + arm7_cpu_device::device_reset(); + m_control = 0x00050078; +} #define UNEXECUTED() \ m_r[eR15] += 4; \ @@ -846,6 +871,198 @@ void arm7_cpu_device::execute_run() { uint32_t pc = GET_PC; +#if PRINT_HAPYFSH2 + if (pc == 0xC0047374) + { + char substr_buf[4096]; + uint16_t substr_idx = 0; + bool zero_prepend = false; + uint8_t digit_count = 0; + uint32_t string_addr = (m_r[eR0] & 0x0fffffff) | 0x30000000; + uint8_t charval = 0; + uint32_t reg_idx = eR1; + do + { + charval = m_program->read_byte(string_addr); + string_addr++; + if (charval >= 0x20 && charval < 0x7f) + { + if (charval == '%') + { + bool still_processing = true; + uint8_t nextval = m_program->read_byte(string_addr); + string_addr++; + switch (nextval) + { + case 0: + printf("%%"); + charval = 0; + still_processing = false; + break; + case '%': + printf("%%"); + still_processing = false; + break; + case '0': + zero_prepend = true; + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + digit_count = nextval - '0'; + break; + case 'd': + printf("%d", (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]); + still_processing = false; + reg_idx++; + break; + case 'l': + case 'u': + printf("%u", (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]); + still_processing = false; + reg_idx++; + break; + case 'x': + case 'p': + printf("%x", (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]); + still_processing = false; + reg_idx++; + break; + case 'o': + printf("%o", (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]); + still_processing = false; + reg_idx++; + break; + case 's': + { + uint32_t val = (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]; + uint32_t substring_addr = (val & 0x0fffffff) | 0x30000000; + reg_idx++; + bool end_found = false; + while (!end_found) + { + substr_buf[substr_idx] = m_program->read_byte(substring_addr); + if (substr_buf[substr_idx] == 0) + { + end_found = true; + } + substring_addr++; + substr_idx++; + } + substr_idx = 0; + printf("%s", substr_buf); + still_processing = false; + break; + } + } + while (still_processing) + { + uint8_t nextval2 = m_program->read_byte(string_addr); + string_addr++; + if (nextval2 == 0) + { + printf("%c%c", (char)charval, (char)nextval); + charval = 0; + break; + } + else if (nextval2 >= '1' && nextval2 <= '9') + { + digit_count = nextval2 - '0'; + } + else if (nextval2 == 'd') + { + uint32_t val = (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]; + switch (digit_count) + { + case 1: if (zero_prepend) { printf("%01d", val); } else { printf("%1d", val); } break; + case 2: if (zero_prepend) { printf("%02d", val); } else { printf("%2d", val); } break; + case 3: if (zero_prepend) { printf("%03d", val); } else { printf("%3d", val); } break; + case 4: if (zero_prepend) { printf("%04d", val); } else { printf("%4d", val); } break; + case 5: if (zero_prepend) { printf("%05d", val); } else { printf("%5d", val); } break; + case 6: if (zero_prepend) { printf("%06d", val); } else { printf("%6d", val); } break; + case 7: if (zero_prepend) { printf("%07d", val); } else { printf("%7d", val); } break; + case 8: if (zero_prepend) { printf("%08d", val); } else { printf("%8d", val); } break; + case 9: if (zero_prepend) { printf("%09d", val); } else { printf("%9d", val); } break; + } + reg_idx++; + still_processing = false; + } + else if (nextval2 == 'u' || nextval2 == 'l') + { + uint32_t val = (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]; + switch (digit_count) + { + case 1: if (zero_prepend) { printf("%01u", val); } else { printf("%1u", val); } break; + case 2: if (zero_prepend) { printf("%02u", val); } else { printf("%2u", val); } break; + case 3: if (zero_prepend) { printf("%03u", val); } else { printf("%3u", val); } break; + case 4: if (zero_prepend) { printf("%04u", val); } else { printf("%4u", val); } break; + case 5: if (zero_prepend) { printf("%05u", val); } else { printf("%5u", val); } break; + case 6: if (zero_prepend) { printf("%06u", val); } else { printf("%6u", val); } break; + case 7: if (zero_prepend) { printf("%07u", val); } else { printf("%7u", val); } break; + case 8: if (zero_prepend) { printf("%08u", val); } else { printf("%8u", val); } break; + case 9: if (zero_prepend) { printf("%09u", val); } else { printf("%9u", val); } break; + } + reg_idx++; + still_processing = false; + } + else if (nextval2 == 'x') + { + uint32_t val = (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]; + switch (digit_count) + { + case 1: if (zero_prepend) { printf("%01x", val); } else { printf("%1x", val); } break; + case 2: if (zero_prepend) { printf("%02x", val); } else { printf("%2x", val); } break; + case 3: if (zero_prepend) { printf("%03x", val); } else { printf("%3x", val); } break; + case 4: if (zero_prepend) { printf("%04x", val); } else { printf("%4x", val); } break; + case 5: if (zero_prepend) { printf("%05x", val); } else { printf("%5x", val); } break; + case 6: if (zero_prepend) { printf("%06x", val); } else { printf("%6x", val); } break; + case 7: if (zero_prepend) { printf("%07x", val); } else { printf("%7x", val); } break; + case 8: if (zero_prepend) { printf("%08x", val); } else { printf("%8x", val); } break; + case 9: if (zero_prepend) { printf("%09x", val); } else { printf("%9x", val); } break; + } + reg_idx++; + still_processing = false; + } + else if (nextval2 == 'o') + { + uint32_t val = (reg_idx >= eR4) ? m_program->read_dword(((m_r[eR13_SVC] & 0x0fffffff) | 0x30000000) + (reg_idx - eR4)) : m_r[reg_idx]; + switch (digit_count) + { + case 1: if (zero_prepend) { printf("%01o", val); } else { printf("%1o", val); } break; + case 2: if (zero_prepend) { printf("%02o", val); } else { printf("%2o", val); } break; + case 3: if (zero_prepend) { printf("%03o", val); } else { printf("%3o", val); } break; + case 4: if (zero_prepend) { printf("%04o", val); } else { printf("%4o", val); } break; + case 5: if (zero_prepend) { printf("%05o", val); } else { printf("%5o", val); } break; + case 6: if (zero_prepend) { printf("%06o", val); } else { printf("%6o", val); } break; + case 7: if (zero_prepend) { printf("%07o", val); } else { printf("%7o", val); } break; + case 8: if (zero_prepend) { printf("%08o", val); } else { printf("%8o", val); } break; + case 9: if (zero_prepend) { printf("%09o", val); } else { printf("%9o", val); } break; + } + reg_idx++; + still_processing = false; + } + else + { + printf("%c%c", (char)charval, (char)nextval); + still_processing = false; + } + } + } + else + { + printf("%c", (char)charval); + } + } + } while (charval != 0); + printf("\n"); + } +#endif update_insn_prefetch(pc); debugger_instruction_hook(pc); @@ -1072,7 +1289,7 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) } else { - LOG( ("ARM7: Unhandled coprocessor %d (archFlags %x)\n", cpnum, m_archFlags) ); + LOGMASKED(LOG_COPRO_UNKNOWN, "ARM7: Unhandled coprocessor %d (archFlags %x)\n", cpnum, m_archFlags); m_pendingUnd = true; update_irq_state(); return 0; @@ -1089,7 +1306,7 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) case 11: case 12: // RESERVED - LOG( ( "arm7_rt_r_callback CR%d, RESERVED\n", cReg ) ); + LOGMASKED(LOG_COPRO_RESERVED, "arm7_rt_r_callback CR%d, RESERVED\n", cReg); break; case 0: // ID switch(op2) @@ -1111,7 +1328,7 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) data = 0; break; } - LOG( ( "arm7_rt_r_callback, ID %02x (%02x) -> %08x (PC=%08x)\n",op2,m_archRev,data,GET_PC ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, ID %02x (%02x) -> %08x (PC=%08x)\n",op2,m_archRev,data,GET_PC); break; case 1: // Control data = COPRO_CTRL | 0x70; // bits 4-6 always read back as "1" (bit 3 too in XScale) @@ -1120,11 +1337,11 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) data = COPRO_TLB_BASE; break; case 3: // Domain Access Control - LOG( ( "arm7_rt_r_callback, Domain Access Control\n" ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, Domain Access Control\n"); data = COPRO_DOMAIN_ACCESS_CONTROL; break; case 5: // Fault Status - LOG( ( "arm7_rt_r_callback, Fault Status\n" ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, Fault Status\n"); switch (op3) { case 0: data = COPRO_FAULT_STATUS_D; break; @@ -1132,18 +1349,18 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) } break; case 6: // Fault Address - LOG( ( "arm7_rt_r_callback, Fault Address\n" ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, Fault Address\n"); data = COPRO_FAULT_ADDRESS; break; case 13: // Read Process ID (PID) - LOG( ( "arm7_rt_r_callback, Read PID\n" ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, Read PID\n"); data = COPRO_FCSE_PID; break; case 14: // Read Breakpoint - LOG( ( "arm7_rt_r_callback, Read Breakpoint\n" ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, Read Breakpoint\n"); break; case 15: // Test, Clock, Idle - LOG( ( "arm7_rt_r_callback, Test / Clock / Idle \n" ) ); + LOGMASKED(LOG_COPRO_READS, "arm7_rt_r_callback, Test / Clock / Idle \n"); break; } @@ -1163,19 +1380,19 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) { if (cpnum == 14) { - LOG( ("arm7_rt_w_callback: write %x to XScale CP14 reg %d\n", data, cReg) ); + LOGMASKED(LOG_COPRO_UNKNOWN, "arm7_rt_w_callback: write %x to XScale CP14 reg %d\n", data, cReg); return; } else { - LOG( ("ARM7: Unhandled coprocessor %d\n", cpnum) ); + LOGMASKED(LOG_COPRO_UNKNOWN, "ARM7: Unhandled coprocessor %d\n", cpnum); m_pendingUnd = true; update_irq_state(); return; } } - switch( cReg ) + switch (cReg) { case 0: case 4: @@ -1183,24 +1400,24 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) case 11: case 12: // RESERVED - LOG( ( "arm7_rt_w_callback CR%d, RESERVED = %08x\n", cReg, data) ); + LOGMASKED(LOG_COPRO_RESERVED, "arm7_rt_w_callback CR%d, RESERVED = %08x\n", cReg, data); break; case 1: // Control - LOG( ( "arm7_rt_w_callback Control = %08x (%d) (%d)\n", data, op2, op3 ) ); - LOG( ( " MMU:%d, Address Fault:%d, Data Cache:%d, Write Buffer:%d\n", + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Control = %08x (%d) (%d)\n", data, op2, op3); + LOGMASKED(LOG_COPRO_WRITES, " MMU:%d, Address Fault:%d, Data Cache:%d, Write Buffer:%d\n", data & COPRO_CTRL_MMU_EN, ( data & COPRO_CTRL_ADDRFAULT_EN ) >> COPRO_CTRL_ADDRFAULT_EN_SHIFT, ( data & COPRO_CTRL_DCACHE_EN ) >> COPRO_CTRL_DCACHE_EN_SHIFT, - ( data & COPRO_CTRL_WRITEBUF_EN ) >> COPRO_CTRL_WRITEBUF_EN_SHIFT ) ); - LOG( ( " Endianness:%d, System:%d, ROM:%d, Instruction Cache:%d\n", + ( data & COPRO_CTRL_WRITEBUF_EN ) >> COPRO_CTRL_WRITEBUF_EN_SHIFT); + LOGMASKED(LOG_COPRO_WRITES, " Endianness:%d, System:%d, ROM:%d, Instruction Cache:%d\n", ( data & COPRO_CTRL_ENDIAN ) >> COPRO_CTRL_ENDIAN_SHIFT, ( data & COPRO_CTRL_SYSTEM ) >> COPRO_CTRL_SYSTEM_SHIFT, ( data & COPRO_CTRL_ROM ) >> COPRO_CTRL_ROM_SHIFT, - ( data & COPRO_CTRL_ICACHE_EN ) >> COPRO_CTRL_ICACHE_EN_SHIFT ) ); - LOG( ( " Int Vector Adjust:%d\n", ( data & COPRO_CTRL_INTVEC_ADJUST ) >> COPRO_CTRL_INTVEC_ADJUST_SHIFT ) ); + ( data & COPRO_CTRL_ICACHE_EN ) >> COPRO_CTRL_ICACHE_EN_SHIFT); + LOGMASKED(LOG_COPRO_WRITES, " Int Vector Adjust:%d\n", ( data & COPRO_CTRL_INTVEC_ADJUST ) >> COPRO_CTRL_INTVEC_ADJUST_SHIFT); #if ARM7_MMU_ENABLE_HACK if (((data & COPRO_CTRL_MMU_EN) != 0) && ((COPRO_CTRL & COPRO_CTRL_MMU_EN) == 0)) { - >m_mmu_enable_addr = R15; + m_mmu_enable_addr = R15; } if (((data & COPRO_CTRL_MMU_EN) == 0) && ((COPRO_CTRL & COPRO_CTRL_MMU_EN) != 0)) { @@ -1213,12 +1430,12 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) COPRO_CTRL = data & COPRO_CTRL_MASK; break; case 2: // Translation Table Base - LOG( ( "arm7_rt_w_callback TLB Base = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback TLB Base = %08x (%d) (%d)\n", data, op2, op3); COPRO_TLB_BASE = data; m_tlb_base_mask = data & COPRO_TLB_BASE_MASK; break; case 3: // Domain Access Control - LOG( ( "arm7_rt_w_callback Domain Access Control = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Domain Access Control = %08x (%d) (%d)\n", data, op2, op3); COPRO_DOMAIN_ACCESS_CONTROL = data; for (int i = 0; i < 32; i += 2) { @@ -1226,7 +1443,7 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) } break; case 5: // Fault Status - LOG( ( "arm7_rt_w_callback Fault Status = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Fault Status = %08x (%d) (%d)\n", data, op2, op3); switch (op3) { case 0: COPRO_FAULT_STATUS_D = data; break; @@ -1234,28 +1451,28 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) } break; case 6: // Fault Address - LOG( ( "arm7_rt_w_callback Fault Address = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Fault Address = %08x (%d) (%d)\n", data, op2, op3); COPRO_FAULT_ADDRESS = data; break; case 7: // Cache Operations -// LOG( ( "arm7_rt_w_callback Cache Ops = %08x (%d) (%d)\n", data, op2, op3 ) ); +// LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Cache Ops = %08x (%d) (%d)\n", data, op2, op3); break; case 8: // TLB Operations - LOG( ( "arm7_rt_w_callback TLB Ops = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback TLB Ops = %08x (%d) (%d)\n", data, op2, op3); break; case 9: // Read Buffer Operations - LOG( ( "arm7_rt_w_callback Read Buffer Ops = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Read Buffer Ops = %08x (%d) (%d)\n", data, op2, op3); break; case 13: // Write Process ID (PID) - LOG( ( "arm7_rt_w_callback Write PID = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Write PID = %08x (%d) (%d)\n", data, op2, op3); COPRO_FCSE_PID = data; m_pid_offset = (((COPRO_FCSE_PID >> 25) & 0x7F)) * 0x2000000; break; case 14: // Write Breakpoint - LOG( ( "arm7_rt_w_callback Write Breakpoint = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Write Breakpoint = %08x (%d) (%d)\n", data, op2, op3); break; case 15: // Test, Clock, Idle - LOG( ( "arm7_rt_w_callback Test / Clock / Idle = %08x (%d) (%d)\n", data, op2, op3 ) ); + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback Test / Clock / Idle = %08x (%d) (%d)\n", data, op2, op3); break; } } @@ -1541,7 +1758,7 @@ void arm7_cpu_device::arm7_dt_r_callback(uint32_t insn, uint32_t *prn) uint8_t cpn = (insn >> 8) & 0xF; if ((m_archFlags & ARCHFLAG_XSCALE) && (cpn == 0)) { - LOG( ( "arm7_dt_r_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC ) ); + LOGMASKED(LOG_DSP, "arm7_dt_r_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC); } else { @@ -1556,7 +1773,7 @@ void arm7_cpu_device::arm7_dt_w_callback(uint32_t insn, uint32_t *prn) uint8_t cpn = (insn >> 8) & 0xF; if ((m_archFlags & ARCHFLAG_XSCALE) && (cpn == 0)) { - LOG( ( "arm7_dt_w_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC ) ); + LOGMASKED(LOG_DSP, "arm7_dt_w_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC); } else { @@ -1565,6 +1782,44 @@ void arm7_cpu_device::arm7_dt_w_callback(uint32_t insn, uint32_t *prn) } } +READ32_MEMBER( arm1176jzf_s_cpu_device::arm7_rt_r_callback ) +{ + uint32_t opcode = offset; + uint8_t crn = (opcode & INSN_COPRO_CREG) >> INSN_COPRO_CREG_SHIFT; + uint8_t op1 = (opcode & INSN_COPRO_OP1) >> INSN_COPRO_OP1_SHIFT; + uint8_t op2 = (opcode & INSN_COPRO_OP2) >> INSN_COPRO_OP2_SHIFT; + uint8_t crm = opcode & INSN_COPRO_OP3; + uint8_t cpnum = (opcode & INSN_COPRO_CPNUM) >> INSN_COPRO_CPNUM_SHIFT; + uint32_t data = 0; + +// printf("arm7946: copro %d write %x to cReg %d op2 %d op3 %d (mask %08x)\n", cpnum, data, cReg, op2, op3, mem_mask); + + if (cpnum == 15) + { + if(crn == 0 && op1 == 0 && crm == 0 && op2 == 0) data = 0x410FB767; //ARM1176JZF-S Main ID. + if(crn == 1 && op1 == 0 && crm == 0 && op2 == 0) data = m_control; + } + + return data; +} + +WRITE32_MEMBER( arm1176jzf_s_cpu_device::arm7_rt_w_callback ) +{ + uint32_t opcode = offset; + uint8_t crn = (opcode & INSN_COPRO_CREG) >> INSN_COPRO_CREG_SHIFT; + uint8_t op1 = (opcode & INSN_COPRO_OP1) >> INSN_COPRO_OP1_SHIFT; + uint8_t op2 = (opcode & INSN_COPRO_OP2) >> INSN_COPRO_OP2_SHIFT; + uint8_t crm = opcode & INSN_COPRO_OP3; + uint8_t cpnum = (opcode & INSN_COPRO_CPNUM) >> INSN_COPRO_CPNUM_SHIFT; + +// printf("arm7946: copro %d write %x to cReg %d op2 %d op3 %d (mask %08x)\n", cpnum, data, cReg, op2, op3, mem_mask); + + if (cpnum == 15) + { + LOGMASKED(LOG_COPRO_WRITES, "arm7_rt_w_callback: CP15 CRn %02x Op1 %02x CRm %02x Op2 %02x data %08x\n", crn, op1, crm, op2, data); + if(crn == 1 && op1 == 0 && crm == 0 && op2 == 0) m_control = data; + } +} /*************************************************************************** * Default Memory Handlers diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h index fa88ff1cd4c..5a7ca665b6f 100644 --- a/src/devices/cpu/arm7/arm7.h +++ b/src/devices/cpu/arm7/arm7.h @@ -179,7 +179,7 @@ protected: uint32_t m_domainAccessControl; uint8_t m_decoded_access_control[16]; - uint8_t m_archRev; // ARM architecture revision (3, 4, and 5 are valid) + uint8_t m_archRev; // ARM architecture revision (3, 4, 5, and 6 are valid) uint32_t m_archFlags; // architecture flags uint32_t m_vectorbase; @@ -602,6 +602,13 @@ public: arm710a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; +class arm710t_cpu_device : public arm7_cpu_device +{ +public: + // construction/destruction + arm710t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; + class arm9_cpu_device : public arm7_cpu_device { public: @@ -667,6 +674,12 @@ class arm1176jzf_s_cpu_device : public arm11_cpu_device public: // construction/destruction arm1176jzf_s_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual DECLARE_READ32_MEMBER( arm7_rt_r_callback ) override; + virtual DECLARE_WRITE32_MEMBER( arm7_rt_w_callback ) override; + +protected: + virtual void device_reset() override; }; class igs036_cpu_device : public arm946es_cpu_device @@ -694,6 +707,7 @@ public: DECLARE_DEVICE_TYPE(ARM7, arm7_cpu_device) DECLARE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device) DECLARE_DEVICE_TYPE(ARM710A, arm710a_cpu_device) +DECLARE_DEVICE_TYPE(ARM710T, arm710t_cpu_device) DECLARE_DEVICE_TYPE(ARM7500, arm7500_cpu_device) DECLARE_DEVICE_TYPE(ARM9, arm9_cpu_device) DECLARE_DEVICE_TYPE(ARM920T, arm920t_cpu_device) diff --git a/src/devices/cpu/arm7/arm7core.h b/src/devices/cpu/arm7/arm7core.h index a6a7838bed4..320638ce626 100644 --- a/src/devices/cpu/arm7/arm7core.h +++ b/src/devices/cpu/arm7/arm7core.h @@ -356,12 +356,14 @@ static const int sRegisterTable[ARM7_NUM_MODES][18] = #define INSN_RD_SHIFT 12 #define INSN_COND_SHIFT 28 +#define INSN_COPRO_OP1 ((uint32_t) 0x00e00000u) #define INSN_COPRO_N ((uint32_t) 0x00100000u) #define INSN_COPRO_CREG ((uint32_t) 0x000f0000u) #define INSN_COPRO_AREG ((uint32_t) 0x0000f000u) #define INSN_COPRO_CPNUM ((uint32_t) 0x00000f00u) #define INSN_COPRO_OP2 ((uint32_t) 0x000000e0u) #define INSN_COPRO_OP3 ((uint32_t) 0x0000000fu) +#define INSN_COPRO_OP1_SHIFT 21 #define INSN_COPRO_N_SHIFT 20 #define INSN_COPRO_CREG_SHIFT 16 #define INSN_COPRO_AREG_SHIFT 12 diff --git a/src/devices/cpu/arm7/arm7help.h b/src/devices/cpu/arm7/arm7help.h index c006bfbf1af..a62722accfa 100644 --- a/src/devices/cpu/arm7/arm7help.h +++ b/src/devices/cpu/arm7/arm7help.h @@ -7,12 +7,6 @@ #define ARM7_ICOUNT m_icount -#if 0 -#define LOG(x) osd_printf_debug x -#else -#define LOG(x) logerror x -#endif - /*************** * helper funcs ***************/ diff --git a/src/devices/cpu/arm7/arm7ops.cpp b/src/devices/cpu/arm7/arm7ops.cpp index ab5bd9243aa..5bea4bbe5bd 100644 --- a/src/devices/cpu/arm7/arm7ops.cpp +++ b/src/devices/cpu/arm7/arm7ops.cpp @@ -5,6 +5,11 @@ #include "arm7core.h" #include "arm7help.h" +#define LOG_OPS (1 << 0) + +#define VERBOSE (0) +#include "logmacro.h" + int64_t arm7_cpu_device::saturate_qbit_overflow(int64_t res) { if (res > 2147483647) // INT32_MAX @@ -61,17 +66,17 @@ uint32_t arm7_cpu_device::decodeShift(uint32_t insn, uint32_t *pCarry) /* All shift types ending in 1 are Rk, not #k */ if (t & 1) { -// LOG(("%08x: RegShift %02x %02x\n", R15, k >> 1, GetRegister(k >> 1))); +// LOGMASKED(LOG_OPS, "%08x: RegShift %02x %02x\n", R15, k >> 1, GetRegister(k >> 1)); #if ARM7_DEBUG_CORE if ((insn & 0x80) == 0x80) - LOG(("%08x: RegShift ERROR (p36)\n", R15)); + LOGMASKED(LOG_OPS, "%08x: RegShift ERROR (p36)\n", R15); #endif // Keep only the bottom 8 bits for a Register Shift k = GetRegister(k >> 1) & 0xff; if (k == 0) /* Register shift by 0 is a no-op */ { -// LOG(("%08x: NO-OP Regshift\n", R15)); +// LOGMASKED(LOG_OPS, "%08x: NO-OP Regshift\n", R15); if (pCarry) *pCarry = GET_CPSR & C_MASK; return rm; @@ -162,7 +167,7 @@ uint32_t arm7_cpu_device::decodeShift(uint32_t insn, uint32_t *pCarry) } } - LOG(("%08x: Decodeshift error\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Decodeshift error\n", R15); return 0; } /* decodeShift */ @@ -252,7 +257,7 @@ int arm7_cpu_device::storeInc(uint32_t pat, uint32_t rbv, int mode) { #if ARM7_DEBUG_CORE if (i == 15) /* R15 is plus 12 from address of STM */ - LOG(("%08x: StoreInc on R15\n", R15)); + LOGMASKED(LOG_OPS, "%08x: StoreInc on R15\n", R15); #endif WRITE32(rbv += 4, GetModeRegister(mode, i)); result++; @@ -276,7 +281,7 @@ int arm7_cpu_device::storeDec(uint32_t pat, uint32_t rbv, int mode) { #if ARM7_DEBUG_CORE if (i == 15) /* R15 is plus 12 from address of STM */ - LOG(("%08x: StoreDec on R15\n", R15)); + LOGMASKED(LOG_OPS, "%08x: StoreDec on R15\n", R15); #endif WRITE32(rbv, GetModeRegister(mode, i)); rbv += 4; @@ -340,7 +345,7 @@ void arm7_cpu_device::HandleCoProcDT(uint32_t insn) #if ARM7_DEBUG_CORE if (((insn >> 16) & 0xf) == 15 && (insn & 0x200000)) - LOG(("%08x: Illegal use of R15 as base for write back value!\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Illegal use of R15 as base for write back value!\n", R15); #endif // Pre-Increment base address (IF POST INCREMENT - CALL BACK FUNCTION MUST DO IT) @@ -513,8 +518,8 @@ void arm7_cpu_device::HandleMemSingle(uint32_t insn) if (insn & INSN_SDT_B) { #if ARM7_DEBUG_CORE - if (rd == eR15) - LOG(("Wrote R15 in byte mode\n")); + if (rd == eR15) + LOGMASKED(LOG_OPS, "Wrote R15 in byte mode\n"); #endif WRITE8(rnv, (uint8_t) GetRegister(rd) & 0xffu); @@ -522,8 +527,8 @@ void arm7_cpu_device::HandleMemSingle(uint32_t insn) else { #if ARM7_DEBUG_CORE - if (rd == eR15) - LOG(("Wrote R15 in 32bit mode\n")); + if (rd == eR15) + LOGMASKED(LOG_OPS, "Wrote R15 in 32bit mode\n"); #endif //WRITE32(rnv, rd == eR15 ? R15 + 8 : GetRegister(rd)); @@ -555,7 +560,7 @@ void arm7_cpu_device::HandleMemSingle(uint32_t insn) } else { if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackIncrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); + LOGMASKED(LOG_OPS, "%08x: RegisterWritebackIncrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0); SetRegister(rn, (rnv + off)); } @@ -571,7 +576,7 @@ void arm7_cpu_device::HandleMemSingle(uint32_t insn) SetRegister(rn, (rnv - off)); if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackDecrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); + LOGMASKED(LOG_OPS, "%08x: RegisterWritebackDecrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0); } } } @@ -768,7 +773,7 @@ void arm7_cpu_device::HandleHalfWordDT(uint32_t insn) } else { if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackIncrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); + LOGMASKED(LOG_OPS, "%08x: RegisterWritebackIncrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0); SetRegister(rn, (rnv + off)); } @@ -784,7 +789,7 @@ void arm7_cpu_device::HandleHalfWordDT(uint32_t insn) SetRegister(rn, (rnv - off)); if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackDecrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); + LOGMASKED(LOG_OPS, "%08x: RegisterWritebackDecrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0); } } } @@ -803,7 +808,7 @@ void arm7_cpu_device::HandleSwap(uint32_t insn) #if ARM7_DEBUG_CORE if (rn == 15 || rm == 15 || rd == 15) - LOG(("%08x: Illegal use of R15 in Swap Instruction\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Illegal use of R15 in Swap Instruction\n", R15); #endif // can be byte or word @@ -981,7 +986,7 @@ void arm7_cpu_device::HandleALU(uint32_t insn) if ((rn = (insn & INSN_RN) >> INSN_RN_SHIFT) == eR15) { #if ARM7_DEBUG_CORE - LOG(("%08x: Pipelined R15 (Shift %d)\n", R15, (insn & INSN_I ? 8 : insn & 0x10u ? 12 : 12))); + LOGMASKED(LOG_OPS, "%08x: Pipelined R15 (Shift %d)\n", R15, (insn & INSN_I ? 8 : insn & 0x10u ? 12 : 12)); #endif if (MODE32) rn = R15 + 8; @@ -1119,7 +1124,7 @@ void arm7_cpu_device::HandleALU(uint32_t insn) { if (insn & INSN_S) { #if ARM7_DEBUG_CORE - LOG(("%08x: TST class on R15 s bit set\n", R15)); + LOGMASKED(LOG_OPS, "%08x: TST class on R15 s bit set\n", R15); #endif if (MODE32) R15 = rd; @@ -1138,7 +1143,7 @@ void arm7_cpu_device::HandleALU(uint32_t insn) else { #if ARM7_DEBUG_CORE - LOG(("%08x: TST class on R15 no s bit set\n", R15)); + LOGMASKED(LOG_OPS, "%08x: TST class on R15 no s bit set\n", R15); #endif } // extra cycles (PC written) @@ -1169,7 +1174,7 @@ void arm7_cpu_device::HandleMul(uint32_t insn) if ((insn & INSN_MUL_RM) == 0xf || ((insn & INSN_MUL_RS) >> INSN_MUL_RS_SHIFT) == 0xf || ((insn & INSN_MUL_RN) >> INSN_MUL_RN_SHIFT) == 0xf) - LOG(("%08x: R15 used in mult\n", R15)); + LOGMASKED(LOG_OPS, "%08x: R15 used in mult\n", R15); #endif /* Add on Rn if this is a MLA */ @@ -1216,7 +1221,7 @@ void arm7_cpu_device::HandleSMulLong(uint32_t insn) #if ARM7_DEBUG_CORE if ((insn & 0xf) == 15 || ((insn >> 8) & 0xf) == 15 || ((insn >> 16) & 0xf) == 15 || ((insn >> 12) & 0xf) == 15) - LOG(("%08x: Illegal use of PC as a register in SMULL opcode\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Illegal use of PC as a register in SMULL opcode\n", R15); #endif /* Perform the multiplication */ @@ -1268,7 +1273,7 @@ void arm7_cpu_device::HandleUMulLong(uint32_t insn) #if ARM7_DEBUG_CORE if (((insn & 0xf) == 15) || (((insn >> 8) & 0xf) == 15) || (((insn >> 16) & 0xf) == 15) || (((insn >> 12) & 0xf) == 15)) - LOG(("%08x: Illegal use of PC as a register in SMULL opcode\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Illegal use of PC as a register in SMULL opcode\n", R15); #endif /* Perform the multiplication */ @@ -1309,7 +1314,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) #if ARM7_DEBUG_CORE if (rbp & 3) - LOG(("%08x: Unaligned Mem Transfer @ %08x\n", R15, rbp)); + LOGMASKED(LOG_OPS, "%08x: Unaligned Mem Transfer @ %08x\n", R15, rbp); #endif // Normal LDM instructions take nS + 1N + 1I and LDM PC takes (n+1)S + 2N + 1I @@ -1335,7 +1340,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) // set to user mode - then do the transfer, and set back //int curmode = GET_MODE; //SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); + LOGMASKED(LOG_OPS, "%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15); result = loadInc(insn & 0xffff, rbp, insn & INSN_BDT_S, eARM7_MODE_USER); // todo - not sure if Writeback occurs on User registers also.. //SwitchMode(curmode); @@ -1346,8 +1351,8 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) if ((insn & INSN_BDT_W) && !m_pendingAbtD) { #if ARM7_DEBUG_CORE - if (rb == 15) - LOG(("%08x: Illegal LDRM writeback to r15\n", R15)); + if (rb == 15) + LOGMASKED(LOG_OPS, "%08x: Illegal LDRM writeback to r15\n", R15); #endif // "A LDM will always overwrite the updated base if the base is in the list." (also for a user bank transfer?) // GBA "V-Rally 3" expects R0 not to be overwritten with the updated base value [BP 8077B0C] @@ -1372,7 +1377,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) else { uint32_t temp; -// LOG(("LDM + S | R15 %08X CPSR %08X\n", R15, GET_CPSR)); +// LOGMASKED(LOG_OPS, "LDM + S | R15 %08X CPSR %08X\n", R15, GET_CPSR); temp = (GET_CPSR & 0x0FFFFF20) | (R15 & 0xF0000000) /* N Z C V */ | ((R15 & 0x0C000000) >> (26 - 6)) /* I F */ | (R15 & 0x00000003) /* M1 M0 */; set_cpsr( temp); SwitchMode(temp & 3); @@ -1402,7 +1407,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) // set to user mode - then do the transfer, and set back //int curmode = GET_MODE; //SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); + LOGMASKED(LOG_OPS, "%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15); result = loadDec(insn & 0xffff, rbp, insn & INSN_BDT_S, eARM7_MODE_USER); // todo - not sure if Writeback occurs on User registers also.. //SwitchMode(curmode); @@ -1413,7 +1418,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) if ((insn & INSN_BDT_W) && !m_pendingAbtD) { if (rb == 0xf) - LOG(("%08x: Illegal LDRM writeback to r15\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Illegal LDRM writeback to r15\n", R15); // "A LDM will always overwrite the updated base if the base is in the list." (also for a user bank transfer?) if (((insn >> rb) & 1) == 0) { @@ -1435,7 +1440,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) else { uint32_t temp; -// LOG(("LDM + S | R15 %08X CPSR %08X\n", R15, GET_CPSR)); +// LOGMASKED(LOG_OPS, "LDM + S | R15 %08X CPSR %08X\n", R15, GET_CPSR); temp = (GET_CPSR & 0x0FFFFF20) /* N Z C V I F M4 M3 M2 M1 M0 */ | (R15 & 0xF0000000) /* N Z C V */ | ((R15 & 0x0C000000) >> (26 - 6)) /* I F */ | (R15 & 0x00000003) /* M1 M0 */; set_cpsr(temp); SwitchMode(temp & 3); @@ -1460,7 +1465,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) if (insn & (1 << eR15)) { #if ARM7_DEBUG_CORE - LOG(("%08x: Writing R15 in strm\n", R15)); + LOGMASKED(LOG_OPS, "%08x: Writing R15 in strm\n", R15); #endif /* special case handling if writing to PC */ R15 += 12; @@ -1481,7 +1486,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) // set to user mode - then do the transfer, and set back //int curmode = GET_MODE; //SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); + LOGMASKED(LOG_OPS, "%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15); result = storeInc(insn & 0xffff, rbp, eARM7_MODE_USER); // todo - not sure if Writeback occurs on User registers also.. //SwitchMode(curmode); @@ -1508,7 +1513,7 @@ void arm7_cpu_device::HandleMemBlock(uint32_t insn) // set to user mode - then do the transfer, and set back //int curmode = GET_MODE; //SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); + LOGMASKED(LOG_OPS, "%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15); result = storeDec(insn & 0xffff, rbp, eARM7_MODE_USER); // todo - not sure if Writeback occurs on User registers also.. //SwitchMode(curmode); @@ -1549,7 +1554,7 @@ const arm7_cpu_device::arm7ops_ophandler arm7_cpu_device::ops_handler[0x20] = void arm7_cpu_device::arm9ops_undef(uint32_t insn) { // unsupported instruction - LOG(("ARM7: Instruction %08X unsupported\n", insn)); + LOGMASKED(LOG_OPS, "ARM7: Instruction %08X unsupported\n", insn); } void arm7_cpu_device::arm9ops_1(uint32_t insn) diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index 499b0e40ff7..aa1860ba089 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -166,7 +166,7 @@ ***************************************************************************/ -#include <stddef.h> +#include <cstddef> #include "emu.h" #include "debugger.h" #include "emuopts.h" diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp index f1a39068ee1..8a43a1863c5 100644 --- a/src/devices/cpu/drcbex86.cpp +++ b/src/devices/cpu/drcbex86.cpp @@ -82,7 +82,7 @@ **************************************************************************/ -#include <stddef.h> +#include <cstddef> #include "emu.h" #include "debugger.h" #include "emuopts.h" diff --git a/src/devices/cpu/drccache.cpp b/src/devices/cpu/drccache.cpp index 5906a641fee..fc86fd37cc6 100644 --- a/src/devices/cpu/drccache.cpp +++ b/src/devices/cpu/drccache.cpp @@ -245,7 +245,7 @@ void drc_cache::request_oob_codegen(drc_oob_delegate callback, void *param1, voi new (oob) oob_handler(); // fill it in - oob->m_callback = callback; + oob->m_callback = std::move(callback); oob->m_param1 = param1; oob->m_param2 = param2; diff --git a/src/devices/cpu/dsp56156/opcode.cpp b/src/devices/cpu/dsp56156/opcode.cpp index 15b305fa09e..005b9d9a6d6 100644 --- a/src/devices/cpu/dsp56156/opcode.cpp +++ b/src/devices/cpu/dsp56156/opcode.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner #include "emu.h" -#include <stdio.h> +#include <cstdio> #include "opcode.h" diff --git a/src/devices/cpu/dsp56156/tables.cpp b/src/devices/cpu/dsp56156/tables.cpp index 93f591b3a5c..cccc22c8842 100644 --- a/src/devices/cpu/dsp56156/tables.cpp +++ b/src/devices/cpu/dsp56156/tables.cpp @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner #include "emu.h" -#include <stdio.h> -#include <string.h> -#include <stdlib.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> #include "tables.h" #include "dsp56def.h" diff --git a/src/devices/cpu/dsp56156/tables.h b/src/devices/cpu/dsp56156/tables.h index 9ef1dc76b32..b6fe4fbe815 100644 --- a/src/devices/cpu/dsp56156/tables.h +++ b/src/devices/cpu/dsp56156/tables.h @@ -3,8 +3,8 @@ #ifndef DSP56156_TABLES_H #define DSP56156_TABLES_H -#include <stdio.h> -#include <stdlib.h> +#include <cstdio> +#include <cstdlib> #include "dsp56156.h" diff --git a/src/devices/cpu/g65816/g65816cm.h b/src/devices/cpu/g65816/g65816cm.h index 7956eda871c..c31b43fb5e6 100644 --- a/src/devices/cpu/g65816/g65816cm.h +++ b/src/devices/cpu/g65816/g65816cm.h @@ -25,7 +25,7 @@ /* ================================ INCLUDES ============================== */ /* ======================================================================== */ -#include <limits.h> +#include <climits> /* ======================================================================== */ diff --git a/src/devices/cpu/gigatron/gigatron.cpp b/src/devices/cpu/gigatron/gigatron.cpp new file mode 100644 index 00000000000..3e687baa930 --- /dev/null +++ b/src/devices/cpu/gigatron/gigatron.cpp @@ -0,0 +1,341 @@ +// license:BSD-2-Clause +// copyright-holders:Sterophonick, Phil Thomas +/***************************************************************************** + * + * Skeleton device for Gigatron CPU Core + * + *****************************************************************************/ + + //https://github.com/PhilThomas/gigatron/blob/master/src/gigatron.js + +#include "emu.h" +#include "gigatron.h" +#include "gigatrondasm.h" + + +DEFINE_DEVICE_TYPE(GTRON, gigatron_cpu_device, "gigatron_cpu", "Gigatron") + + +/* FLAGS */ +#if 0 +#define S 0x80 +#define Z 0x40 +#define OV 0x20 +#define C 0x10 +#endif + + +#define gigatron_readop(A) m_program->read_word(A) +#define gigatron_readmem16(A) m_data->read_dword(A) +#define gigatron_readmem8(A) m_data->read_byte(A) +#define gigatron_writemem16(A,B) m_data->write_dword((A),B) +#define gigatron_writemem8(A,B) m_data->write_byte((A),B) + + +/*********************************** + * illegal opcodes + ***********************************/ +void gigatron_cpu_device::gigatron_illegal() +{ + logerror("gigatron illegal opcode at 0x%04x\n", m_ppc); + m_icount -= 1; +} + +/* Execute cycles */ +void gigatron_cpu_device::execute_run() +{ + uint16_t opcode; + + do + { + m_ppc = m_pc; + debugger_instruction_hook(m_pc); + + opcode = gigatron_readop(m_pc); + m_pc = m_npc++; + + uint8_t op = (opcode >> 13) & 0x0007; + uint8_t mode = (opcode >> 10) & 0x0007; + uint8_t bus = (opcode >> 8) & 0x0003; + uint8_t d = (opcode >> 0) & 0x00ff; + + switch( op) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + aluOp(op, mode, bus, d); + break; + case 6: + storeOp(op, mode, bus, d); + break; + case 7: + branchOp(op, mode, bus, d); + break; + default: + gigatron_illegal(); + break; + } + m_icount--; + } while( m_icount > 0 ); +} + + +void gigatron_cpu_device::device_start() +{ + m_program = &space(AS_PROGRAM); + m_data = &space(AS_DATA); + + init(); +} + +void gigatron_cpu_device::init() +{ + m_ac = 0; + m_x = 0; + m_y = 0; + m_pc = 0; + m_npc = (m_pc + 1); + m_ppc = 0; + m_inReg = 0xFF; + + state_add(GTRON_PC, "PC", m_pc); + state_add(GTRON_NPC, "NPC", m_npc); + state_add(STATE_GENPC, "GENPC", m_pc).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_ppc).noshow(); + state_add(GTRON_AC, "AC", m_ac); + state_add(GTRON_X, "X", m_x); + state_add(GTRON_Y, "Y", m_y); + + set_icountptr(m_icount); + + save_item(NAME(m_ac)); + save_item(NAME(m_x)); + save_item(NAME(m_y)); + save_item(NAME(m_npc)); + save_item(NAME(m_ppc)); + save_item(NAME(m_inReg)); + save_item(NAME(m_pc)); +} + +void gigatron_cpu_device::branchOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d) +{ + const uint8_t ZERO = 0x80; + bool c = false; + uint8_t ac2 = m_ac ^ ZERO; + uint16_t base = m_pc & 0xff00; + switch (mode) { + case 0: + c = true; + base = m_y << 8; + break; + case 1: + c = (ac2 > ZERO); + break; + case 2: + c = (ac2 < ZERO); + break; + case 3: + c = (ac2 != ZERO); + break; + case 4: + c = (ac2 == ZERO); + break; + case 5: + c = (ac2 >= ZERO); + break; + case 6: + c = (ac2 <= ZERO); + break; + case 7: + c = true; + break; + } + + if (c) { + uint8_t b = offset(bus, d); + m_npc = base | b; + } +} + +void gigatron_cpu_device::aluOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d) +{ + uint8_t b = 0; + switch(bus) { + case 0: + b = d; + break; + case 1: + b = gigatron_readmem8((uint16_t)(addr(mode, d) & m_ramMask)); + break; + case 2: + b = m_ac; + break; + case 3: + b = m_inReg; + break; + } + switch(op) { + case 1: + b = (m_ac & b); + break; + case 2: + b = (m_ac | b); + break; + case 3: + b = (m_ac ^ b); + break; + case 4: + b = (m_ac + b); + break; + case 5: + b = (m_ac - b); + break; + } + switch (mode) { + case 0: + case 1: + case 2: + case 3: + m_ac = b; + break; + case 4: + m_x = b; + break; + case 5: + m_y = b; + break; + case 6: + case 7: + uint16_t rising = ~(m_out & b); + if (rising & 0x40) { + m_outx = m_ac; + } + break; + + } +} + +uint16_t gigatron_cpu_device::addr(uint8_t mode, uint8_t d) +{ + switch (mode) { + case 0: + case 4: + case 5: + case 6: + return d; + case 1: + return m_x; + case 2: + return (m_y << 8) | d; + case 3: + return (m_y << 8) | m_x; + case 7: + uint16_t addr2 = (m_y << 8) | m_x; + m_x = (m_x + 1) & 0xff; + return addr2; + } + return 0; +} + +uint8_t gigatron_cpu_device::offset(uint8_t bus, uint8_t d) +{ + switch (bus) { + case 0: + return d; + case 1: + return gigatron_readmem8(d); + case 2: + return m_ac; + case 3: + return m_inReg; + } + return 0; +} + +void gigatron_cpu_device::storeOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d) +{ + uint8_t b = 0; + switch (bus) { + case 0: + b = d; + break; + case 2: + b = m_ac; + break; + case 3: + b = m_inReg; + break; + } + + u16 address = addr(mode, d); + if (bus == 1) + logerror("%04x: ctrl = 0x%04x\n", m_ppc, address); + else + gigatron_writemem8(address & m_ramMask, b); + + switch (mode) { + case 4: + m_x = b; + break; + case 5: + m_y = b; + break; + } +} + +void gigatron_cpu_device::device_reset() +{ +} + +void gigatron_cpu_device::execute_set_input(int irqline, int state) +{ +#if 0 + switch(irqline) + { + default: + break; + } +#endif +} + +gigatron_cpu_device::gigatron_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : cpu_device(mconfig, GTRON, tag, owner, clock) + , m_ramMask(0x7fff) + , m_program_config("program", ENDIANNESS_BIG, 16, 14, -1) + , m_data_config("data", ENDIANNESS_BIG, 8, 15, 0) +{ +} + + +void gigatron_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = util::string_format("%c%c%c%c", + m_flags & 0x80 ? 'S':'.', + m_flags & 0x40 ? 'Z':'.', + m_flags & 0x20 ? 'V':'.', + m_flags & 0x10 ? 'C':'.'); + break; + } +} + + +std::unique_ptr<util::disasm_interface> gigatron_cpu_device::create_disassembler() +{ + return std::make_unique<gigatron_disassembler>(); +} + + +device_memory_interface::space_config_vector gigatron_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_DATA, &m_data_config) + }; +} diff --git a/src/devices/cpu/gigatron/gigatron.h b/src/devices/cpu/gigatron/gigatron.h new file mode 100644 index 00000000000..7ef0b9018b7 --- /dev/null +++ b/src/devices/cpu/gigatron/gigatron.h @@ -0,0 +1,87 @@ +// license:BSD-2-Clause +// copyright-holders:Sterophonick, Phil Thomas +/***************************************************************************** + * + * Skeleton device for Gigatron CPU Core + * + *****************************************************************************/ + + //https://github.com/PhilThomas/gigatron/blob/master/src/gigatron.js + +#ifndef MAME_CPU_GTRON_H +#define MAME_CPU_GTRON_H + +#pragma once + +enum +{ + GTRON_PC, GTRON_NPC, + GTRON_AC, GTRON_X, GTRON_Y +}; + + +class gigatron_cpu_device : public cpu_device +{ +public: + // construction/destruction + gigatron_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual uint32_t execute_min_cycles() const noexcept override { return 1; } + virtual uint32_t execute_max_cycles() const noexcept override { return 7; } + virtual uint32_t execute_input_lines() const noexcept override { return 0; } + virtual void execute_run() override; + virtual void execute_set_input(int inputnum, int state) override; + + // device_state_interface overrides + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + void branchOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d); + void aluOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d); + void storeOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d); + uint8_t offset(uint8_t bus, uint8_t d); + uint16_t addr(uint8_t mode, uint8_t d); + + uint8_t m_ac; + uint8_t m_x; + uint8_t m_y; + uint16_t m_npc; + uint16_t m_ppc; + uint8_t m_inReg; + uint16_t m_ramMask; + uint16_t m_out; + uint16_t m_outx; + + virtual void init(); + +private: + address_space_config m_program_config; + address_space_config m_data_config; + + uint16_t m_pc; /* registers */ + uint8_t m_flags; /* flags */ + address_space *m_program; + address_space *m_data; + int m_icount; + + void gigatron_illegal(); +}; + + +DECLARE_DEVICE_TYPE(GTRON, gigatron_cpu_device) + + + +#endif // MAME_CPU_GTRON_H + diff --git a/src/devices/cpu/gigatron/gigatrondasm.cpp b/src/devices/cpu/gigatron/gigatrondasm.cpp new file mode 100644 index 00000000000..e18ec7b9b59 --- /dev/null +++ b/src/devices/cpu/gigatron/gigatrondasm.cpp @@ -0,0 +1,161 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Gigatron disassembler + +***************************************************************************/ + +#include "emu.h" +#include "gigatrondasm.h" + +gigatron_disassembler::gigatron_disassembler() + : util::disasm_interface() +{ +} + +const char *const gigatron_disassembler::s_ops[7] = { + "ld", + "anda", + "ora", + "xora", + "adda", + "suba", + "st" +}; + +const char *const gigatron_disassembler::s_jumps[8] = { + "jmp", + "bgt", + "blt", + "bne", + "beq", + "bge", + "ble", + "bra" +}; + +u32 gigatron_disassembler::opcode_alignment() const +{ + return 1; +} + +offs_t gigatron_disassembler::disassemble(std::ostream &stream, offs_t pc, const gigatron_disassembler::data_buffer &opcodes, const gigatron_disassembler::data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc); + u32 flags = 0; + + if (inst >= 0xe000) + { + // Jump instructions use special format + util::stream_format(stream, "%-5s", s_jumps[(inst & 0x1c00) >> 10]); + if ((inst & 0x1c00) == 0) + stream << "y,"; + + switch (inst & 0x0300) + { + case 0x0000: + if ((inst & 0x1c00) == 0) + util::stream_format(stream, "$%02x", inst & 0x00ff); + else + util::stream_format(stream, "$%04x", ((pc + 1) & 0x3f00) | (inst & 0x00ff)); + break; + + case 0x0100: + util::stream_format(stream, "[$%02x]", inst & 0x00ff); + break; + + case 0x0200: + stream << "ac"; + break; + + case 0x0300: + stream << "in"; + break; + } + + flags = STEP_OVER | step_over_extra(1); + } + else if ((inst & 0xf300) == 0x0200) + stream << "nop"; + else + { + if ((inst & 0xe300) == 0xc100) + { + // This was originally an undefined store mode + util::stream_format(stream, "%-5s", "ctrl"); + } + else + { + util::stream_format(stream, "%-5s", s_ops[(inst & 0xe000) >> 13]); + + // Bus data + switch (inst & 0x0300) + { + case 0x0000: + util::stream_format(stream, "$%02x", inst & 0x00ff); + if (inst >= 0xc000) + stream << ","; + break; + + case 0x0100: + break; + + case 0x0200: + if (inst < 0xc000) + stream << "ac"; // implicit for store instruction + break; + + case 0x0300: + stream << "in"; + if (inst >= 0xc000) + stream << ","; + break; + } + } + + // RAM source or store destination + if (inst >= 0xc000 || (inst & 0x0300) == 0x0100) + { + if ((inst & 0xe300) != 0xc100) + stream << "["; + + switch (inst & 0x1c00) + { + case 0x0000: case 0x1000: case 0x1400: case 0x1800: + util::stream_format(stream, "$%02x", inst & 0x00ff); + break; + + case 0x0400: + stream << "x"; + break; + + case 0x0800: + util::stream_format(stream, "y,$%02x", inst & 0x00ff); + break; + + case 0x0c00: + stream << "y,x"; + break; + + case 0x1c00: + stream << "y,x++"; + break; + } + + if ((inst & 0xe300) != 0xc100) + stream << "]"; + } + + // Non-accumulator destinations + if (BIT(inst, 12)) + { + if (!BIT(inst, 11)) + util::stream_format(stream, ",%c", "xy"[BIT(inst, 10)]); + else if (inst < 0xc000) + stream << ",out"; + } + } + + return 1 | flags | SUPPORTED; +} diff --git a/src/devices/cpu/gigatron/gigatrondasm.h b/src/devices/cpu/gigatron/gigatrondasm.h new file mode 100644 index 00000000000..1c8c976b41a --- /dev/null +++ b/src/devices/cpu/gigatron/gigatrondasm.h @@ -0,0 +1,26 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_GIGATRON_GIGATRONDASM_H +#define MAME_CPU_GIGATRON_GIGATRONDASM_H + +#pragma once + +class gigatron_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + gigatron_disassembler(); + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + // tables + static const char *const s_ops[7]; + static const char *const s_jumps[8]; +}; + +#endif // MAME_CPU_GIGATRON_GIGATRONDASM_H diff --git a/src/devices/cpu/hpc/hpcdasm.cpp b/src/devices/cpu/hpc/hpcdasm.cpp index bbfa77b8eca..9773ab8f444 100644 --- a/src/devices/cpu/hpc/hpcdasm.cpp +++ b/src/devices/cpu/hpc/hpcdasm.cpp @@ -15,7 +15,7 @@ #include "hpcdasm.h" #include "util/strformat.h" -#include <ctype.h> +#include <cctype> using osd::u32; using util::BIT; diff --git a/src/devices/cpu/i386/athlon.cpp b/src/devices/cpu/i386/athlon.cpp index a391a476e96..e47f99a2af6 100644 --- a/src/devices/cpu/i386/athlon.cpp +++ b/src/devices/cpu/i386/athlon.cpp @@ -477,7 +477,7 @@ uint64_t athlonxp_device::READ64PL(uint32_t ea, uint8_t privilege) case 0: default: value = READ32PL(ea, privilege); - value |= uint64_t(READ32PL(ea + 2, privilege)) << 32; + value |= uint64_t(READ32PL(ea + 4, privilege)) << 32; break; case 1: @@ -610,7 +610,7 @@ void athlonxp_device::WRITE64PL(uint32_t ea, uint8_t privilege, uint64_t value) { case 0: WRITE32PL(ea, privilege, value & 0xffffffff); - WRITE32PL(ea + 2, privilege, (value >> 32) & 0xffffffff); + WRITE32PL(ea + 4, privilege, (value >> 32) & 0xffffffff); break; case 1: diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp index 701b4257265..1778084b8a6 100644 --- a/src/devices/cpu/i386/i386.cpp +++ b/src/devices/cpu/i386/i386.cpp @@ -481,7 +481,7 @@ uint64_t i386_device::READ64PL(uint32_t ea, uint8_t privilege) case 0: default: value = READ32PL(ea, privilege); - value |= uint64_t(READ32PL(ea + 2, privilege)) << 32; + value |= uint64_t(READ32PL(ea + 4, privilege)) << 32; break; case 1: @@ -676,7 +676,7 @@ void i386_device::WRITE64PL(uint32_t ea, uint8_t privilege, uint64_t value) { case 0: WRITE32PL(ea, privilege, value & 0xffffffff); - WRITE32PL(ea + 2, privilege, (value >> 32) & 0xffffffff); + WRITE32PL(ea + 4, privilege, (value >> 32) & 0xffffffff); break; case 1: diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h index f10cfee4a04..e6fda6278bc 100644 --- a/src/devices/cpu/i386/i386.h +++ b/src/devices/cpu/i386/i386.h @@ -324,8 +324,10 @@ protected: uint16_t m_x87_cw; uint16_t m_x87_sw; uint16_t m_x87_tw; - uint64_t m_x87_data_ptr; - uint64_t m_x87_inst_ptr; + uint16_t m_x87_ds; + uint32_t m_x87_data_ptr; + uint16_t m_x87_cs; + uint32_t m_x87_inst_ptr; uint16_t m_x87_opcode; i386_modrm_func m_opcode_table_x87_d8[256]; @@ -466,6 +468,7 @@ protected: void modrm_to_EA(uint8_t mod_rm, uint32_t* out_ea, uint8_t* out_segment); uint32_t GetNonTranslatedEA(uint8_t modrm,uint8_t *seg); uint32_t GetEA(uint8_t modrm, int rwn); + uint32_t Getx87EA(uint8_t modrm, int rwn); void i386_check_sreg_validity(int reg); int i386_limit_check(int seg, uint32_t offset); void i386_sreg_load(uint16_t selector, uint8_t reg, bool *fault); @@ -638,6 +641,7 @@ protected: void i386_aam(); void i386_clts(); void i386_wait(); + void i486_wait(); void i386_lock(); void i386_mov_r32_tr(); void i386_mov_tr_r32(); @@ -1353,7 +1357,8 @@ protected: inline void x87_set_stack_overflow(); int x87_inc_stack(); int x87_dec_stack(); - int x87_check_exceptions(); + int x87_check_exceptions(bool store = false); + int x87_mf_fault(); inline void x87_write_cw(uint16_t cw); void x87_reset(); floatx80 x87_add(floatx80 a, floatx80 b); @@ -1479,8 +1484,6 @@ protected: void x87_fincstp(uint8_t modrm); void x87_fclex(uint8_t modrm); void x87_ffree(uint8_t modrm); - void x87_fdisi(uint8_t modrm); - void x87_feni(uint8_t modrm); void x87_finit(uint8_t modrm); void x87_fldcw(uint8_t modrm); void x87_fstcw(uint8_t modrm); diff --git a/src/devices/cpu/i386/i386ops.h b/src/devices/cpu/i386/i386ops.h index cf5b3c588aa..79fc30fa5c4 100644 --- a/src/devices/cpu/i386/i386ops.h +++ b/src/devices/cpu/i386/i386ops.h @@ -160,6 +160,7 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0x99, OP_I386, &i386_device::i386_cwd, &i386_device::i386_cdq, false}, { 0x9A, OP_I386, &i386_device::i386_call_abs16, &i386_device::i386_call_abs32, false}, { 0x9B, OP_I386, &i386_device::i386_wait, &i386_device::i386_wait, false}, + { 0x9B, OP_I486, &i386_device::i486_wait, &i386_device::i486_wait, false}, { 0x9C, OP_I386, &i386_device::i386_pushf, &i386_device::i386_pushfd, false}, { 0x9D, OP_I386, &i386_device::i386_popf, &i386_device::i386_popfd, false}, { 0x9E, OP_I386, &i386_device::i386_sahf, &i386_device::i386_sahf, false}, @@ -429,13 +430,13 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0xB4, OP_2BYTE|OP_I386, &i386_device::i386_lfs16, &i386_device::i386_lfs32, false}, { 0xB5, OP_2BYTE|OP_I386, &i386_device::i386_lgs16, &i386_device::i386_lgs32, false}, { 0xB6, OP_2BYTE|OP_I386, &i386_device::i386_movzx_r16_rm8, &i386_device::i386_movzx_r32_rm8, false}, - { 0xB7, OP_2BYTE|OP_I386, &i386_device::i386_invalid, &i386_device::i386_movzx_r32_rm16, false}, + { 0xB7, OP_2BYTE|OP_I386, &i386_device::i386_mov_r16_rm16, &i386_device::i386_movzx_r32_rm16, false}, { 0xBA, OP_2BYTE|OP_I386, &i386_device::i386_group0FBA_16, &i386_device::i386_group0FBA_32, true }, { 0xBB, OP_2BYTE|OP_I386, &i386_device::i386_btc_rm16_r16, &i386_device::i386_btc_rm32_r32, true }, { 0xBC, OP_2BYTE|OP_I386, &i386_device::i386_bsf_r16_rm16, &i386_device::i386_bsf_r32_rm32, false}, { 0xBD, OP_2BYTE|OP_I386, &i386_device::i386_bsr_r16_rm16, &i386_device::i386_bsr_r32_rm32, false}, { 0xBE, OP_2BYTE|OP_I386, &i386_device::i386_movsx_r16_rm8, &i386_device::i386_movsx_r32_rm8, false}, - { 0xBF, OP_2BYTE|OP_I386, &i386_device::i386_invalid, &i386_device::i386_movsx_r32_rm16, false}, + { 0xBF, OP_2BYTE|OP_I386, &i386_device::i386_mov_r16_rm16, &i386_device::i386_movsx_r32_rm16, false}, { 0xC0, OP_2BYTE|OP_I486, &i386_device::i486_xadd_rm8_r8, &i386_device::i486_xadd_rm8_r8, true }, { 0xC1, OP_2BYTE|OP_I486, &i386_device::i486_xadd_rm16_r16, &i386_device::i486_xadd_rm32_r32, true }, { 0xC2, OP_2BYTE|OP_SSE, &i386_device::sse_cmpps_r128_rm128_i8, &i386_device::sse_cmpps_r128_rm128_i8, false}, diff --git a/src/devices/cpu/i386/i486ops.hxx b/src/devices/cpu/i386/i486ops.hxx index 6946e463796..f06add430c3 100644 --- a/src/devices/cpu/i386/i486ops.hxx +++ b/src/devices/cpu/i386/i486ops.hxx @@ -533,3 +533,8 @@ void i386_device::i486_mov_cr_r32() // Opcode 0x0f 22 } m_cr[cr] = data; } + +void i386_device::i486_wait() +{ + x87_mf_fault(); +} diff --git a/src/devices/cpu/i386/x87ops.hxx b/src/devices/cpu/i386/x87ops.hxx index 5fd4bbc0614..1f2bdc4564a 100644 --- a/src/devices/cpu/i386/x87ops.hxx +++ b/src/devices/cpu/i386/x87ops.hxx @@ -19,8 +19,6 @@ Corrections and Additions [8-December-2017 Andrey Merkulov) FXAM, FPREM - fixed FINCSTP, FDECSTP - tags and exceptions corrected - Interrupt handling for 8087 added - FENI, FDISI opcodes added ***************************************************************************/ @@ -126,8 +124,40 @@ int i386_device::x87_dec_stack() * *************************************/ -int i386_device::x87_check_exceptions() +int i386_device::x87_mf_fault() { + if ((m_x87_sw & X87_SW_ES) && (m_cr[0] & 0x20)) // FIXME: 486 and up only + { + m_ext = 1; + i386_trap(FAULT_MF, 0, 0); + return 1; + } + return 0; +} + +uint32_t i386_device::Getx87EA(uint8_t modrm, int rwn) +{ + uint8_t segment; + uint32_t ea; + modrm_to_EA(modrm, &ea, &segment); + uint32_t ret = i386_translate(segment, ea, rwn); + m_x87_ds = m_sreg[segment].selector; + if (PROTECTED_MODE && !V8086_MODE) + m_x87_data_ptr = ea; + else + m_x87_data_ptr = ea + (segment << 4); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + return ret; +} + +int i386_device::x87_check_exceptions(bool store) +{ + m_x87_cs = m_sreg[CS].selector; + if (PROTECTED_MODE && !V8086_MODE) + m_x87_inst_ptr = m_prev_eip; + else + m_x87_inst_ptr = m_prev_eip + (m_x87_cs << 4); + /* Update the exceptions from SoftFloat */ if (float_exception_flags & float_flag_invalid) { @@ -149,20 +179,22 @@ int i386_device::x87_check_exceptions() m_x87_sw |= X87_SW_PE; float_exception_flags &= ~float_flag_inexact; } + if (float_exception_flags & float_flag_divbyzero) + { + m_x87_sw |= X87_SW_ZE; + float_exception_flags &= ~float_flag_divbyzero; + } + uint16_t unmasked = (m_x87_sw & ~m_x87_cw) & 0x3f; if ((m_x87_sw & ~m_x87_cw) & 0x3f) { // m_device->execute().set_input_line(INPUT_LINE_FERR, RAISE_LINE); logerror("Unmasked x87 exception (CW:%.4x, SW:%.4x)\n", m_x87_cw, m_x87_sw); // interrupt handler - if (!(m_x87_cw & X87_CW_IEM)) { m_x87_sw |= X87_SW_ES; m_ferr_handler(1); } - - if (m_cr[0] & 0x20) // FIXME: 486 and up only - { - m_ext = 1; - i386_trap(FAULT_MF, 0, 0); - } - return 0; + m_x87_sw |= X87_SW_ES; + m_ferr_handler(1); + if (store || !(unmasked & (X87_SW_OE | X87_SW_UE))) + return 0; } return 1; @@ -334,7 +366,9 @@ void i386_device::x87_fadd_m32real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -369,7 +403,9 @@ void i386_device::x87_fadd_m64real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -405,6 +441,8 @@ void i386_device::x87_fadd_st_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -429,6 +467,9 @@ void i386_device::x87_fadd_st_sti(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -438,6 +479,8 @@ void i386_device::x87_fadd_sti_st(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -462,6 +505,9 @@ void i386_device::x87_fadd_sti_st(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(i, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -471,6 +517,8 @@ void i386_device::x87_faddp(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -498,6 +546,9 @@ void i386_device::x87_faddp(uint8_t modrm) x87_write_stack(i, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -506,7 +557,9 @@ void i386_device::x87_fiadd_m32int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -541,7 +594,9 @@ void i386_device::x87_fiadd_m16int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -583,7 +638,9 @@ void i386_device::x87_fsub_m32real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -618,7 +675,9 @@ void i386_device::x87_fsub_m64real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -654,6 +713,8 @@ void i386_device::x87_fsub_st_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -678,6 +739,9 @@ void i386_device::x87_fsub_st_sti(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -687,6 +751,8 @@ void i386_device::x87_fsub_sti_st(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -711,6 +777,9 @@ void i386_device::x87_fsub_sti_st(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(i, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -720,6 +789,8 @@ void i386_device::x87_fsubp(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -747,6 +818,9 @@ void i386_device::x87_fsubp(uint8_t modrm) x87_write_stack(i, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -755,7 +829,9 @@ void i386_device::x87_fisub_m32int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -790,7 +866,9 @@ void i386_device::x87_fisub_m16int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -832,7 +910,9 @@ void i386_device::x87_fsubr_m32real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -867,7 +947,9 @@ void i386_device::x87_fsubr_m64real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -903,6 +985,8 @@ void i386_device::x87_fsubr_st_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -927,6 +1011,9 @@ void i386_device::x87_fsubr_st_sti(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -936,6 +1023,8 @@ void i386_device::x87_fsubr_sti_st(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -960,6 +1049,9 @@ void i386_device::x87_fsubr_sti_st(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(i, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -969,6 +1061,8 @@ void i386_device::x87_fsubrp(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -996,6 +1090,9 @@ void i386_device::x87_fsubrp(uint8_t modrm) x87_write_stack(i, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -1004,7 +1101,9 @@ void i386_device::x87_fisubr_m32int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1039,7 +1138,9 @@ void i386_device::x87_fisubr_m16int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1081,7 +1182,9 @@ void i386_device::x87_fdiv_m32real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1116,7 +1219,9 @@ void i386_device::x87_fdiv_m64real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1152,6 +1257,8 @@ void i386_device::x87_fdiv_st_sti(uint8_t modrm) int i = modrm & 7; floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1177,6 +1284,9 @@ void i386_device::x87_fdiv_st_sti(uint8_t modrm) { x87_write_stack(0, result, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; // 73, 62, 35 CYCLES(73); @@ -1187,6 +1297,8 @@ void i386_device::x87_fdiv_sti_st(uint8_t modrm) int i = modrm & 7; floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1212,6 +1324,9 @@ void i386_device::x87_fdiv_sti_st(uint8_t modrm) { x87_write_stack(i, result, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; // 73, 62, 35 CYCLES(73); @@ -1222,6 +1337,8 @@ void i386_device::x87_fdivp(uint8_t modrm) int i = modrm & 7; floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1248,6 +1365,9 @@ void i386_device::x87_fdivp(uint8_t modrm) x87_write_stack(i, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; // 73, 62, 35 CYCLES(73); @@ -1257,7 +1377,9 @@ void i386_device::x87_fidiv_m32int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1292,7 +1414,9 @@ void i386_device::x87_fidiv_m16int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1334,7 +1458,9 @@ void i386_device::x87_fdivr_m32real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1369,7 +1495,9 @@ void i386_device::x87_fdivr_m64real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1405,6 +1533,8 @@ void i386_device::x87_fdivr_st_sti(uint8_t modrm) int i = modrm & 7; floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1430,6 +1560,9 @@ void i386_device::x87_fdivr_st_sti(uint8_t modrm) { x87_write_stack(0, result, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; // 73, 62, 35 CYCLES(73); @@ -1440,6 +1573,8 @@ void i386_device::x87_fdivr_sti_st(uint8_t modrm) int i = modrm & 7; floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1465,6 +1600,9 @@ void i386_device::x87_fdivr_sti_st(uint8_t modrm) { x87_write_stack(i, result, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; // 73, 62, 35 CYCLES(73); @@ -1475,6 +1613,8 @@ void i386_device::x87_fdivrp(uint8_t modrm) int i = modrm & 7; floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1501,6 +1641,9 @@ void i386_device::x87_fdivrp(uint8_t modrm) x87_write_stack(i, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; // 73, 62, 35 CYCLES(73); @@ -1511,7 +1654,9 @@ void i386_device::x87_fidivr_m32int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1546,7 +1691,9 @@ void i386_device::x87_fidivr_m16int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1588,7 +1735,9 @@ void i386_device::x87_fmul_m32real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1622,7 +1771,9 @@ void i386_device::x87_fmul_m64real(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1657,6 +1808,8 @@ void i386_device::x87_fmul_st_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1680,6 +1833,9 @@ void i386_device::x87_fmul_st_sti(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(16); } @@ -1689,6 +1845,8 @@ void i386_device::x87_fmul_sti_st(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1712,6 +1870,9 @@ void i386_device::x87_fmul_sti_st(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(i, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(16); } @@ -1721,6 +1882,8 @@ void i386_device::x87_fmulp(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -1747,6 +1910,9 @@ void i386_device::x87_fmulp(uint8_t modrm) x87_write_stack(i, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(16); } @@ -1755,7 +1921,9 @@ void i386_device::x87_fimul_m32int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1789,7 +1957,9 @@ void i386_device::x87_fimul_m16int(uint8_t modrm) { floatx80 result; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1830,6 +2000,8 @@ void i386_device::x87_fcmovb_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (m_CF == 1) { if (X87_IS_ST_EMPTY(i)) @@ -1845,6 +2017,9 @@ void i386_device::x87_fcmovb_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1854,6 +2029,8 @@ void i386_device::x87_fcmove_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (m_ZF == 1) { if (X87_IS_ST_EMPTY(i)) @@ -1869,6 +2046,9 @@ void i386_device::x87_fcmove_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1878,6 +2058,8 @@ void i386_device::x87_fcmovbe_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if ((m_CF | m_ZF) == 1) { if (X87_IS_ST_EMPTY(i)) @@ -1893,6 +2075,9 @@ void i386_device::x87_fcmovbe_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1902,6 +2087,8 @@ void i386_device::x87_fcmovu_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (m_PF == 1) { if (X87_IS_ST_EMPTY(i)) @@ -1917,6 +2104,9 @@ void i386_device::x87_fcmovu_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1926,6 +2116,8 @@ void i386_device::x87_fcmovnb_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (m_CF == 0) { if (X87_IS_ST_EMPTY(i)) @@ -1941,6 +2133,9 @@ void i386_device::x87_fcmovnb_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1950,6 +2145,8 @@ void i386_device::x87_fcmovne_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (m_ZF == 0) { if (X87_IS_ST_EMPTY(i)) @@ -1965,6 +2162,9 @@ void i386_device::x87_fcmovne_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1974,6 +2174,8 @@ void i386_device::x87_fcmovnbe_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if ((m_CF == 0) && (m_ZF == 0)) { if (X87_IS_ST_EMPTY(i)) @@ -1989,6 +2191,9 @@ void i386_device::x87_fcmovnbe_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -1998,6 +2203,8 @@ void i386_device::x87_fcmovnu_sti(uint8_t modrm) floatx80 result; int i = modrm & 7; + if (x87_mf_fault()) + return; if (m_PF == 0) { if (X87_IS_ST_EMPTY(i)) @@ -2013,6 +2220,9 @@ void i386_device::x87_fcmovnu_sti(uint8_t modrm) ST(0) = result; } } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -2027,6 +2237,8 @@ void i386_device::x87_fprem(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -2076,6 +2288,9 @@ void i386_device::x87_fprem(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(84); } @@ -2084,6 +2299,8 @@ void i386_device::x87_fprem1(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -2102,6 +2319,9 @@ void i386_device::x87_fprem1(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(94); } @@ -2110,6 +2330,8 @@ void i386_device::x87_fsqrt(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2133,6 +2355,9 @@ void i386_device::x87_fsqrt(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -2147,6 +2372,8 @@ void i386_device::x87_f2xm1(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2164,6 +2391,9 @@ void i386_device::x87_f2xm1(uint8_t modrm) { x87_write_stack(0, result, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(242); } @@ -2172,6 +2402,8 @@ void i386_device::x87_fyl2x(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -2201,6 +2433,9 @@ void i386_device::x87_fyl2x(uint8_t modrm) x87_write_stack(1, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(250); } @@ -2209,6 +2444,8 @@ void i386_device::x87_fyl2xp1(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -2230,6 +2467,9 @@ void i386_device::x87_fyl2xp1(uint8_t modrm) x87_write_stack(1, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(313); } @@ -2238,6 +2478,8 @@ void i386_device::x87_fptan(uint8_t modrm) { floatx80 result1, result2; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2275,6 +2517,9 @@ void i386_device::x87_fptan(uint8_t modrm) x87_dec_stack(); x87_write_stack(0, result2, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(244); } @@ -2283,6 +2528,8 @@ void i386_device::x87_fpatan(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2300,6 +2547,9 @@ void i386_device::x87_fpatan(uint8_t modrm) x87_write_stack(1, result, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(289); } @@ -2308,6 +2558,8 @@ void i386_device::x87_fsin(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2334,6 +2586,9 @@ void i386_device::x87_fsin(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(241); } @@ -2342,6 +2597,8 @@ void i386_device::x87_fcos(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2367,6 +2624,9 @@ void i386_device::x87_fcos(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, result, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(241); } @@ -2375,6 +2635,8 @@ void i386_device::x87_fsincos(uint8_t modrm) { floatx80 s_result, c_result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2415,6 +2677,9 @@ void i386_device::x87_fsincos(uint8_t modrm) x87_dec_stack(); x87_write_stack(0, c_result, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(291); } @@ -2430,7 +2695,9 @@ void i386_device::x87_fld_m32real(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (x87_dec_stack()) { uint32_t m32real = READ32(ea); @@ -2460,7 +2727,9 @@ void i386_device::x87_fld_m64real(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (x87_dec_stack()) { uint64_t m64real = READ64(ea); @@ -2490,7 +2759,9 @@ void i386_device::x87_fld_m80real(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (x87_dec_stack()) { m_x87_sw &= ~X87_SW_C1; @@ -2511,6 +2782,8 @@ void i386_device::x87_fld_sti(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { m_x87_sw &= ~X87_SW_C1; @@ -2523,6 +2796,9 @@ void i386_device::x87_fld_sti(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, value, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -2531,7 +2807,9 @@ void i386_device::x87_fild_m16int(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2554,7 +2832,9 @@ void i386_device::x87_fild_m32int(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2577,7 +2857,9 @@ void i386_device::x87_fild_m64int(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2600,7 +2882,9 @@ void i386_device::x87_fbld(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2645,7 +2929,9 @@ void i386_device::x87_fst_m32real(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 1); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 1); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2657,11 +2943,9 @@ void i386_device::x87_fst_m32real(uint8_t modrm) value = ST(0); } - if (x87_check_exceptions()) - { - uint32_t m32real = floatx80_to_float32(value); + uint32_t m32real = floatx80_to_float32(value); + if (x87_check_exceptions(true)) WRITE32(ea, m32real); - } CYCLES(7); } @@ -2670,7 +2954,9 @@ void i386_device::x87_fst_m64real(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 1); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 1); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2682,11 +2968,9 @@ void i386_device::x87_fst_m64real(uint8_t modrm) value = ST(0); } - if (x87_check_exceptions()) - { - uint64_t m64real = floatx80_to_float64(value); + uint64_t m64real = floatx80_to_float64(value); + if (x87_check_exceptions(true)) WRITE64(ea, m64real); - } CYCLES(8); } @@ -2696,6 +2980,8 @@ void i386_device::x87_fst_sti(uint8_t modrm) int i = modrm & 7; floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2709,6 +2995,9 @@ void i386_device::x87_fst_sti(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(i, value, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(3); } @@ -2717,7 +3006,9 @@ void i386_device::x87_fstp_m32real(uint8_t modrm) { floatx80 value; - uint32_t ea = GetEA(modrm, 1); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 1); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2729,9 +3020,9 @@ void i386_device::x87_fstp_m32real(uint8_t modrm) value = ST(0); } - if (x87_check_exceptions()) + uint32_t m32real = floatx80_to_float32(value); + if (x87_check_exceptions(true)) { - uint32_t m32real = floatx80_to_float32(value); WRITE32(ea, m32real); x87_inc_stack(); } @@ -2743,6 +3034,8 @@ void i386_device::x87_fstp_m64real(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2755,10 +3048,10 @@ void i386_device::x87_fstp_m64real(uint8_t modrm) } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + uint64_t m64real = floatx80_to_float64(value); + if (x87_check_exceptions(true)) { - uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); x87_inc_stack(); } @@ -2770,6 +3063,8 @@ void i386_device::x87_fstp_m80real(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2781,8 +3076,8 @@ void i386_device::x87_fstp_m80real(uint8_t modrm) value = ST(0); } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE80(ea, value); x87_inc_stack(); @@ -2796,6 +3091,8 @@ void i386_device::x87_fstp_sti(uint8_t modrm) int i = modrm & 7; floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2812,6 +3109,9 @@ void i386_device::x87_fstp_sti(uint8_t modrm) x87_write_stack(i, value, true); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(3); } @@ -2820,6 +3120,8 @@ void i386_device::x87_fist_m16int(uint8_t modrm) { int16_t m16int; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2840,8 +3142,8 @@ void i386_device::x87_fist_m16int(uint8_t modrm) m16int = -32768; } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE16(ea, m16int); } @@ -2853,6 +3155,8 @@ void i386_device::x87_fist_m32int(uint8_t modrm) { int32_t m32int; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2873,8 +3177,8 @@ void i386_device::x87_fist_m32int(uint8_t modrm) m32int = 0x80000000; } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE32(ea, m32int); } @@ -2886,7 +3190,9 @@ void i386_device::x87_fistp_m16int(uint8_t modrm) { int16_t m16int; - if (X87_IS_ST_EMPTY(0)) + if (x87_mf_fault()) + return; +if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); m16int = (uint16_t)0x8000; @@ -2906,8 +3212,8 @@ void i386_device::x87_fistp_m16int(uint8_t modrm) m16int = (uint16_t)0x8000; } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE16(ea, m16int); x87_inc_stack(); @@ -2920,6 +3226,8 @@ void i386_device::x87_fistp_m32int(uint8_t modrm) { int32_t m32int; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2940,8 +3248,8 @@ void i386_device::x87_fistp_m32int(uint8_t modrm) m32int = 0x80000000; } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE32(ea, m32int); x87_inc_stack(); @@ -2954,6 +3262,8 @@ void i386_device::x87_fistp_m64int(uint8_t modrm) { int64_t m64int; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2974,8 +3284,8 @@ void i386_device::x87_fistp_m64int(uint8_t modrm) m64int = 0x8000000000000000U; } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE64(ea, m64int); x87_inc_stack(); @@ -2988,6 +3298,8 @@ void i386_device::x87_fbstp(uint8_t modrm) { floatx80 result; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3009,8 +3321,8 @@ void i386_device::x87_fbstp(uint8_t modrm) result.high |= ST(0).high & 0x8000; } - uint32_t ea = GetEA(modrm, 1); - if (x87_check_exceptions()) + uint32_t ea = Getx87EA(modrm, 1); + if (x87_check_exceptions(true)) { WRITE80(ea, result); x87_inc_stack(); @@ -3031,6 +3343,8 @@ void i386_device::x87_fld1(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { m_x87_sw &= ~X87_SW_C1; @@ -3048,6 +3362,9 @@ void i386_device::x87_fld1(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -3057,6 +3374,8 @@ void i386_device::x87_fldl2t(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { tag = X87_TW_VALID; @@ -3080,6 +3399,9 @@ void i386_device::x87_fldl2t(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -3089,6 +3411,8 @@ void i386_device::x87_fldl2e(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { int rc = X87_RC; @@ -3113,6 +3437,9 @@ void i386_device::x87_fldl2e(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -3122,6 +3449,8 @@ void i386_device::x87_fldpi(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { int rc = X87_RC; @@ -3146,6 +3475,9 @@ void i386_device::x87_fldpi(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -3155,6 +3487,8 @@ void i386_device::x87_fldlg2(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { int rc = X87_RC; @@ -3179,6 +3513,9 @@ void i386_device::x87_fldlg2(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -3188,6 +3525,8 @@ void i386_device::x87_fldln2(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { int rc = X87_RC; @@ -3212,6 +3551,9 @@ void i386_device::x87_fldln2(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(8); } @@ -3221,6 +3563,8 @@ void i386_device::x87_fldz(uint8_t modrm) floatx80 value; int tag; + if (x87_mf_fault()) + return; if (x87_dec_stack()) { value = fx80_zero; @@ -3238,6 +3582,9 @@ void i386_device::x87_fldz(uint8_t modrm) x87_set_tag(ST_TO_PHYS(0), tag); x87_write_stack(0, value, false); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -3251,6 +3598,7 @@ void i386_device::x87_fldz(uint8_t modrm) void i386_device::x87_fnop(uint8_t modrm) { + x87_mf_fault(); CYCLES(3); } @@ -3258,6 +3606,8 @@ void i386_device::x87_fchs(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3273,6 +3623,9 @@ void i386_device::x87_fchs(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, value, false); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(6); } @@ -3281,6 +3634,8 @@ void i386_device::x87_fabs(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3296,6 +3651,9 @@ void i386_device::x87_fabs(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, value, false); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(6); } @@ -3304,6 +3662,8 @@ void i386_device::x87_fscale(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -3317,6 +3677,9 @@ void i386_device::x87_fscale(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, value, false); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(31); } @@ -3325,6 +3688,8 @@ void i386_device::x87_frndint(uint8_t modrm) { floatx80 value; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3339,6 +3704,9 @@ void i386_device::x87_frndint(uint8_t modrm) if (x87_check_exceptions()) x87_write_stack(0, value, true); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(21); } @@ -3347,6 +3715,8 @@ void i386_device::x87_fxtract(uint8_t modrm) { floatx80 sig80, exp80; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3386,6 +3756,9 @@ void i386_device::x87_fxtract(uint8_t modrm) x87_dec_stack(); x87_write_stack(0, sig80, true); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(21); } @@ -3398,6 +3771,8 @@ void i386_device::x87_fxtract(uint8_t modrm) void i386_device::x87_ftst(uint8_t modrm) { + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3423,6 +3798,9 @@ void i386_device::x87_ftst(uint8_t modrm) } x87_check_exceptions(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -3431,6 +3809,8 @@ void i386_device::x87_fxam(uint8_t modrm) { floatx80 value = ST(0); + if (x87_mf_fault()) + return; m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); // TODO: Unsupported and denormal values @@ -3463,7 +3843,9 @@ void i386_device::x87_fxam(uint8_t modrm) void i386_device::x87_ficom_m16int(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3500,7 +3882,9 @@ void i386_device::x87_ficom_m16int(uint8_t modrm) void i386_device::x87_ficom_m32int(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3537,7 +3921,9 @@ void i386_device::x87_ficom_m32int(uint8_t modrm) void i386_device::x87_ficomp_m16int(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3575,7 +3961,9 @@ void i386_device::x87_ficomp_m16int(uint8_t modrm) void i386_device::x87_ficomp_m32int(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3614,7 +4002,9 @@ void i386_device::x87_ficomp_m32int(uint8_t modrm) void i386_device::x87_fcom_m32real(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3651,7 +4041,9 @@ void i386_device::x87_fcom_m32real(uint8_t modrm) void i386_device::x87_fcom_m64real(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3690,6 +4082,8 @@ void i386_device::x87_fcom_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -3718,13 +4112,18 @@ void i386_device::x87_fcom_sti(uint8_t modrm) } x87_check_exceptions(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } void i386_device::x87_fcomp_m32real(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3762,7 +4161,9 @@ void i386_device::x87_fcomp_m32real(uint8_t modrm) void i386_device::x87_fcomp_m64real(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3802,6 +4203,8 @@ void i386_device::x87_fcomp_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -3831,6 +4234,9 @@ void i386_device::x87_fcomp_sti(uint8_t modrm) if (x87_check_exceptions()) x87_inc_stack(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -3839,6 +4245,8 @@ void i386_device::x87_fcomi_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -3875,6 +4283,9 @@ void i386_device::x87_fcomi_sti(uint8_t modrm) } x87_check_exceptions(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); // TODO: correct cycle count } @@ -3883,6 +4294,8 @@ void i386_device::x87_fcomip_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -3920,6 +4333,9 @@ void i386_device::x87_fcomip_sti(uint8_t modrm) if (x87_check_exceptions()) x87_inc_stack(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); // TODO: correct cycle count } @@ -3928,6 +4344,8 @@ void i386_device::x87_fucomi_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -3970,6 +4388,9 @@ void i386_device::x87_fucomi_sti(uint8_t modrm) } x87_check_exceptions(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); // TODO: correct cycle count } @@ -3978,6 +4399,8 @@ void i386_device::x87_fucomip_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -4021,12 +4444,17 @@ void i386_device::x87_fucomip_sti(uint8_t modrm) if (x87_check_exceptions()) x87_inc_stack(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); // TODO: correct cycle count } void i386_device::x87_fcompp(uint8_t modrm) { + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -4059,6 +4487,9 @@ void i386_device::x87_fcompp(uint8_t modrm) x87_inc_stack(); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(5); } @@ -4074,6 +4505,8 @@ void i386_device::x87_fucom_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -4104,6 +4537,9 @@ void i386_device::x87_fucom_sti(uint8_t modrm) } x87_check_exceptions(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -4112,6 +4548,8 @@ void i386_device::x87_fucomp_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(i)) { x87_set_stack_underflow(); @@ -4143,12 +4581,17 @@ void i386_device::x87_fucomp_sti(uint8_t modrm) if (x87_check_exceptions()) x87_inc_stack(); + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } void i386_device::x87_fucompp(uint8_t modrm) { + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { x87_set_stack_underflow(); @@ -4183,6 +4626,9 @@ void i386_device::x87_fucompp(uint8_t modrm) x87_inc_stack(); x87_inc_stack(); } + m_x87_opcode = ((m_opcode << 8) | modrm) & 0x7ff; + m_x87_data_ptr = 0; + m_x87_ds = 0; CYCLES(4); } @@ -4196,6 +4642,8 @@ void i386_device::x87_fucompp(uint8_t modrm) void i386_device::x87_fdecstp(uint8_t modrm) { + if (x87_mf_fault()) + return; m_x87_sw &= ~X87_SW_C1; x87_set_stack_top(ST_TO_PHYS(7)); @@ -4205,6 +4653,8 @@ void i386_device::x87_fdecstp(uint8_t modrm) void i386_device::x87_fincstp(uint8_t modrm) { + if (x87_mf_fault()) + return; m_x87_sw &= ~X87_SW_C1; x87_set_stack_top(ST_TO_PHYS(1)); @@ -4221,26 +4671,13 @@ void i386_device::x87_fclex(uint8_t modrm) void i386_device::x87_ffree(uint8_t modrm) { + if (x87_mf_fault()) + return; x87_set_tag(ST_TO_PHYS(modrm & 7), X87_TW_EMPTY); CYCLES(3); } -void i386_device::x87_feni(uint8_t modrm) -{ - m_x87_cw &= ~X87_CW_IEM; - x87_check_exceptions(); - - CYCLES(5); -} - -void i386_device::x87_fdisi(uint8_t modrm) -{ - m_x87_cw |= X87_CW_IEM; - - CYCLES(5); -} - void i386_device::x87_finit(uint8_t modrm) { x87_reset(); @@ -4250,7 +4687,9 @@ void i386_device::x87_finit(uint8_t modrm) void i386_device::x87_fldcw(uint8_t modrm) { - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); uint16_t cw = READ16(ea); x87_write_cw(cw); @@ -4270,22 +4709,62 @@ void i386_device::x87_fstcw(uint8_t modrm) void i386_device::x87_fldenv(uint8_t modrm) { - // TODO: Pointers and selectors - uint32_t ea = GetEA(modrm, 0); + if (x87_mf_fault()) + return; + uint32_t ea = Getx87EA(modrm, 0); + uint32_t temp; - if (m_operand_size) + switch(((PROTECTED_MODE && !V8086_MODE) ? 1 : 0) | (m_operand_size & 1)<<1) { - // 32-bit real/protected mode - x87_write_cw(READ16(ea)); - m_x87_sw = READ16(ea + 4); - m_x87_tw = READ16(ea + 8); - } - else - { - // 16-bit real/protected mode - x87_write_cw(READ16(ea)); - m_x87_sw = READ16(ea + 2); - m_x87_tw = READ16(ea + 4); + case 0: // 16-bit real mode + x87_write_cw(READ16(ea)); + m_x87_sw = READ16(ea + 2); + m_x87_tw = READ16(ea + 4); + m_x87_inst_ptr = READ16(ea + 6); + temp = READ16(ea + 8); + m_x87_opcode = temp & 0x7ff; + m_x87_inst_ptr |= ((temp & 0xf000) << 4); + m_x87_data_ptr = READ16(ea + 10) | ((READ16(ea + 12) & 0xf000) << 4); + m_x87_cs = 0; + m_x87_ds = 0; + ea += 14; + break; + case 1: // 16-bit protected mode + x87_write_cw(READ16(ea)); + m_x87_sw = READ16(ea + 2); + m_x87_tw = READ16(ea + 4); + m_x87_inst_ptr = READ16(ea + 6); + m_x87_opcode = 0; + m_x87_cs = READ16(ea + 8); + m_x87_data_ptr = READ16(ea + 10); + m_x87_ds = READ16(ea + 12); + ea += 14; + break; + case 2: // 32-bit real mode + x87_write_cw(READ16(ea)); + m_x87_sw = READ16(ea + 4); + m_x87_tw = READ16(ea + 8); + m_x87_inst_ptr = READ16(ea + 12); + temp = READ32(ea + 16); + m_x87_opcode = temp & 0x7ff; + m_x87_inst_ptr |= ((temp & 0xffff000) << 4); + m_x87_data_ptr = READ16(ea + 20) | ((READ32(ea + 24) & 0xffff000) << 4); + m_x87_cs = 0; + m_x87_ds = 0; + ea += 28; + break; + case 3: // 32-bit protected mode + x87_write_cw(READ16(ea)); + m_x87_sw = READ16(ea + 4); + m_x87_tw = READ16(ea + 8); + m_x87_inst_ptr = READ32(ea + 12); + temp = READ32(ea + 16); + m_x87_opcode = (temp >> 16) & 0x7ff; + m_x87_cs = temp & 0xffff; + m_x87_data_ptr = READ32(ea + 20); + m_x87_ds = READ16(ea + 24); + ea += 28; + break; } x87_check_exceptions(); @@ -4297,45 +4776,43 @@ void i386_device::x87_fstenv(uint8_t modrm) { uint32_t ea = GetEA(modrm, 1); - // TODO: Pointers and selectors - switch((m_cr[0] & 1)|(m_operand_size & 1)<<1) + switch(((PROTECTED_MODE && !V8086_MODE) ? 1 : 0) | (m_operand_size & 1)<<1) { case 0: // 16-bit real mode WRITE16(ea + 0, m_x87_cw); WRITE16(ea + 2, m_x87_sw); WRITE16(ea + 4, m_x87_tw); -// WRITE16(ea + 6, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 10, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, (m_fpu_inst_ptr & 0x0f0000) >> 4); + WRITE16(ea + 6, m_x87_inst_ptr & 0xffff); + WRITE16(ea + 8, (m_x87_opcode & 0x07ff) | ((m_x87_inst_ptr & 0x0f0000) >> 4)); + WRITE16(ea + 10, m_x87_data_ptr & 0xffff); + WRITE16(ea + 12, (m_x87_data_ptr & 0x0f0000) >> 4); break; case 1: // 16-bit protected mode WRITE16(ea + 0, m_x87_cw); WRITE16(ea + 2, m_x87_sw); WRITE16(ea + 4, m_x87_tw); -// WRITE16(ea + 6, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 10, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, (m_fpu_inst_ptr & 0x0f0000) >> 4); + WRITE16(ea + 6, m_x87_inst_ptr & 0xffff); + WRITE16(ea + 8, m_x87_cs); + WRITE16(ea + 10, m_x87_data_ptr & 0xffff); + WRITE16(ea + 12, m_x87_ds); break; case 2: // 32-bit real mode - WRITE16(ea + 0, m_x87_cw); - WRITE16(ea + 4, m_x87_sw); - WRITE16(ea + 8, m_x87_tw); -// WRITE16(ea + 12, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 20, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE32(ea + 24, (m_fpu_data_ptr >> 16) << 12); + WRITE32(ea + 0, 0xffff0000 | m_x87_cw); + WRITE32(ea + 4, 0xffff0000 | m_x87_sw); + WRITE32(ea + 8, 0xffff0000 | m_x87_tw); + WRITE32(ea + 12, 0xffff0000 | (m_x87_inst_ptr & 0xffff)); + WRITE32(ea + 16, (m_x87_opcode & 0x07ff) | ((m_x87_inst_ptr & 0xffff0000) >> 4)); + WRITE32(ea + 20, 0xffff0000 | (m_x87_data_ptr & 0xffff)); + WRITE32(ea + 24, (m_x87_data_ptr & 0xffff0000) >> 4); break; case 3: // 32-bit protected mode - WRITE16(ea + 0, m_x87_cw); - WRITE16(ea + 4, m_x87_sw); - WRITE16(ea + 8, m_x87_tw); -// WRITE32(ea + 12, m_fpu_inst_ptr); -// WRITE32(ea + 16, m_fpu_opcode); -// WRITE32(ea + 20, m_fpu_data_ptr); -// WRITE32(ea + 24, m_fpu_inst_ptr); + WRITE32(ea + 0, 0xffff0000 | m_x87_cw); + WRITE32(ea + 4, 0xffff0000 | m_x87_sw); + WRITE32(ea + 8, 0xffff0000 | m_x87_tw); + WRITE32(ea + 12, m_x87_inst_ptr); + WRITE32(ea + 16, (m_x87_opcode << 16) | m_x87_cs); + WRITE32(ea + 20, m_x87_data_ptr); + WRITE32(ea + 24, 0xffff0000 | m_x87_ds); break; } m_x87_cw |= 0x3f; // set all masks @@ -4347,48 +4824,46 @@ void i386_device::x87_fsave(uint8_t modrm) { uint32_t ea = GetEA(modrm, 1); - // TODO: Pointers and selectors - switch((m_cr[0] & 1)|(m_operand_size & 1)<<1) + switch(((PROTECTED_MODE && !V8086_MODE) ? 1 : 0) | (m_operand_size & 1)<<1) { case 0: // 16-bit real mode WRITE16(ea + 0, m_x87_cw); WRITE16(ea + 2, m_x87_sw); WRITE16(ea + 4, m_x87_tw); -// WRITE16(ea + 6, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 10, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, (m_fpu_inst_ptr & 0x0f0000) >> 4); + WRITE16(ea + 6, m_x87_inst_ptr & 0xffff); + WRITE16(ea + 8, (m_x87_opcode & 0x07ff) | ((m_x87_inst_ptr & 0x0f0000) >> 4)); + WRITE16(ea + 10, m_x87_data_ptr & 0xffff); + WRITE16(ea + 12, (m_x87_data_ptr & 0x0f0000) >> 4); ea += 14; break; case 1: // 16-bit protected mode WRITE16(ea + 0, m_x87_cw); WRITE16(ea + 2, m_x87_sw); WRITE16(ea + 4, m_x87_tw); -// WRITE16(ea + 6, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 10, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, (m_fpu_inst_ptr & 0x0f0000) >> 4); + WRITE16(ea + 6, m_x87_inst_ptr & 0xffff); + WRITE16(ea + 8, m_x87_cs); + WRITE16(ea + 10, m_x87_data_ptr & 0xffff); + WRITE16(ea + 12, m_x87_ds); ea += 14; break; case 2: // 32-bit real mode - WRITE16(ea + 0, m_x87_cw); - WRITE16(ea + 4, m_x87_sw); - WRITE16(ea + 8, m_x87_tw); -// WRITE16(ea + 12, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 20, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE32(ea + 24, (m_fpu_data_ptr >> 16) << 12); + WRITE32(ea + 0, 0xffff0000 | m_x87_cw); + WRITE32(ea + 4, 0xffff0000 | m_x87_sw); + WRITE32(ea + 8, 0xffff0000 | m_x87_tw); + WRITE32(ea + 12, 0xffff0000 | (m_x87_inst_ptr & 0xffff)); + WRITE32(ea + 16, (m_x87_opcode & 0x07ff) | ((m_x87_inst_ptr & 0xffff0000) >> 4)); + WRITE32(ea + 20, 0xffff0000 | (m_x87_data_ptr & 0xffff)); + WRITE32(ea + 24, (m_x87_data_ptr & 0xffff0000) >> 4); ea += 28; break; case 3: // 32-bit protected mode - WRITE16(ea + 0, m_x87_cw); - WRITE16(ea + 4, m_x87_sw); - WRITE16(ea + 8, m_x87_tw); -// WRITE32(ea + 12, m_fpu_inst_ptr); -// WRITE32(ea + 16, m_fpu_opcode); -// WRITE32(ea + 20, m_fpu_data_ptr); -// WRITE32(ea + 24, m_fpu_inst_ptr); + WRITE32(ea + 0, 0xffff0000 | m_x87_cw); + WRITE32(ea + 4, 0xffff0000 | m_x87_sw); + WRITE32(ea + 8, 0xffff0000 | m_x87_tw); + WRITE32(ea + 12, m_x87_inst_ptr); + WRITE32(ea + 16, (m_x87_opcode << 16) | m_x87_cs); + WRITE32(ea + 20, m_x87_data_ptr); + WRITE32(ea + 24, 0xffff0000 | m_x87_ds); ea += 28; break; } @@ -4401,50 +4876,60 @@ void i386_device::x87_fsave(uint8_t modrm) void i386_device::x87_frstor(uint8_t modrm) { + if (x87_mf_fault()) + return; uint32_t ea = GetEA(modrm, 0); + uint32_t temp; - // TODO: Pointers and selectors - switch((m_cr[0] & 1)|(m_operand_size & 1)<<1) + switch(((PROTECTED_MODE && !V8086_MODE) ? 1 : 0) | (m_operand_size & 1)<<1) { case 0: // 16-bit real mode x87_write_cw(READ16(ea)); m_x87_sw = READ16(ea + 2); m_x87_tw = READ16(ea + 4); -// WRITE16(ea + 6, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 10, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, (m_fpu_inst_ptr & 0x0f0000) >> 4); + m_x87_inst_ptr = READ16(ea + 6); + temp = READ16(ea + 8); + m_x87_opcode = temp & 0x7ff; + m_x87_inst_ptr |= ((temp & 0xf000) << 4); + m_x87_data_ptr = READ16(ea + 10) | ((READ16(ea + 12) & 0xf000) << 4); + m_x87_cs = 0; + m_x87_ds = 0; ea += 14; break; case 1: // 16-bit protected mode x87_write_cw(READ16(ea)); m_x87_sw = READ16(ea + 2); m_x87_tw = READ16(ea + 4); -// WRITE16(ea + 6, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 10, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, (m_fpu_inst_ptr & 0x0f0000) >> 4); + m_x87_inst_ptr = READ16(ea + 6); + m_x87_opcode = 0; + m_x87_cs = READ16(ea + 8); + m_x87_data_ptr = READ16(ea + 10); + m_x87_ds = READ16(ea + 12); ea += 14; break; case 2: // 32-bit real mode x87_write_cw(READ16(ea)); m_x87_sw = READ16(ea + 4); m_x87_tw = READ16(ea + 8); -// WRITE16(ea + 12, m_fpu_inst_ptr & 0xffff); -// WRITE16(ea + 8, (m_fpu_opcode & 0x07ff) | ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(ea + 20, m_fpu_data_ptr & 0xffff); -// WRITE16(ea + 12, ((m_fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE32(ea + 24, (m_fpu_data_ptr >> 16) << 12); + m_x87_inst_ptr = READ16(ea + 12); + temp = READ32(ea + 16); + m_x87_opcode = temp & 0x7ff; + m_x87_inst_ptr |= ((temp & 0xffff000) << 4); + m_x87_data_ptr = READ16(ea + 20) | ((READ32(ea + 24) & 0xffff000) << 4); + m_x87_cs = 0; + m_x87_ds = 0; ea += 28; break; case 3: // 32-bit protected mode x87_write_cw(READ16(ea)); m_x87_sw = READ16(ea + 4); m_x87_tw = READ16(ea + 8); -// WRITE32(ea + 12, m_fpu_inst_ptr); -// WRITE32(ea + 16, m_fpu_opcode); -// WRITE32(ea + 20, m_fpu_data_ptr); -// WRITE32(ea + 24, m_fpu_inst_ptr); + m_x87_inst_ptr = READ32(ea + 12); + temp = READ32(ea + 16); + m_x87_opcode = (temp >> 16) & 0x7ff; + m_x87_cs = temp & 0xffff; + m_x87_data_ptr = READ32(ea + 20); + m_x87_ds = READ16(ea + 24); ea += 28; break; } @@ -4457,6 +4942,8 @@ void i386_device::x87_frstor(uint8_t modrm) void i386_device::x87_fxch(uint8_t modrm) { + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) x87_set_stack_underflow(); @@ -4479,6 +4966,8 @@ void i386_device::x87_fxch_sti(uint8_t modrm) { int i = modrm & 7; + if (x87_mf_fault()) + return; if (X87_IS_ST_EMPTY(0)) { ST(0) = fx80_inan; @@ -4779,8 +5268,8 @@ void i386_device::build_x87_opcode_table_db() case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: ptr = &i386_device::x87_fcmovne_sti; break; case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: ptr = &i386_device::x87_fcmovnbe_sti; break; case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: ptr = &i386_device::x87_fcmovnu_sti; break; - case 0xe0: ptr = &i386_device::x87_feni; break; /* FENI */ - case 0xe1: ptr = &i386_device::x87_fdisi; break; /* FDISI */ + case 0xe0: ptr = &i386_device::x87_fnop; break; /* FENI */ + case 0xe1: ptr = &i386_device::x87_fnop; break; /* FDISI */ case 0xe2: ptr = &i386_device::x87_fclex; break; case 0xe3: ptr = &i386_device::x87_finit; break; case 0xe4: ptr = &i386_device::x87_fnop; break; /* FSETPM */ diff --git a/src/devices/cpu/i386/x87priv.h b/src/devices/cpu/i386/x87priv.h index 67cf067a15f..1d2c227b292 100644 --- a/src/devices/cpu/i386/x87priv.h +++ b/src/devices/cpu/i386/x87priv.h @@ -5,7 +5,7 @@ #ifndef __X87PRIV_H__ #define __X87PRIV_H__ -#include <math.h> +#include <cmath> /************************************* @@ -36,7 +36,6 @@ #define X87_CW_OM 0x0008 #define X87_CW_UM 0x0010 #define X87_CW_PM 0x0020 -#define X87_CW_IEM 0x0080 #define X87_CW_PC_SHIFT 8 #define X87_CW_PC_MASK 3 #define X87_CW_PC_SINGLE 0 diff --git a/src/devices/cpu/i8089/i8089_dasm.cpp b/src/devices/cpu/i8089/i8089_dasm.cpp index 8e45053b1ba..ad8b9d5705e 100644 --- a/src/devices/cpu/i8089/i8089_dasm.cpp +++ b/src/devices/cpu/i8089/i8089_dasm.cpp @@ -60,7 +60,7 @@ std::string i8089_disassembler::invalid() } // to register or memory from immediate -std::string i8089_disassembler::from_i(std::string instr8, std::string instr16, std::string target) +std::string i8089_disassembler::from_i(const std::string &instr8, const std::string &instr16, const std::string &target) { if (m_w == 0 && m_wb == 1) return util::string_format("%s %s, %02x", instr8, target, fetch_immediate()); @@ -71,7 +71,7 @@ std::string i8089_disassembler::from_i(std::string instr8, std::string instr16, } // register, immediate -std::string i8089_disassembler::inst_ri(std::string instr8, std::string instr16) +std::string i8089_disassembler::inst_ri(const std::string &instr8, const std::string &instr16) { if (m_mm == 0) return from_i(instr8, instr16, m_reg[m_brp]); @@ -80,7 +80,7 @@ std::string i8089_disassembler::inst_ri(std::string instr8, std::string instr16) } // register -std::string i8089_disassembler::inst_r(std::string instr) +std::string i8089_disassembler::inst_r(const std::string &instr) { if (m_mm == 0 && m_w == 0 && m_aa == 0 && m_wb == 0) return util::string_format("%s %s", instr, m_reg[m_brp]); @@ -89,7 +89,7 @@ std::string i8089_disassembler::inst_r(std::string instr) } // jump register -std::string i8089_disassembler::inst_jr(std::string instr8, std::string instr16) +std::string i8089_disassembler::inst_jr(const std::string &instr8, const std::string &instr16) { uint16_t i = fetch_immediate(); if (m_mm == 0 && m_w == 0 && m_wb == 1) @@ -101,14 +101,14 @@ std::string i8089_disassembler::inst_jr(std::string instr8, std::string instr16) } // memory immediate -std::string i8089_disassembler::inst_mi(std::string instr8, std::string instr16) +std::string i8089_disassembler::inst_mi(const std::string &instr8, const std::string &instr16) { std::string off = offset(); return from_i(instr8, instr16, off); } // register memory -std::string i8089_disassembler::inst_rm(std::string instr8, std::string instr16) +std::string i8089_disassembler::inst_rm(const std::string &instr8, const std::string &instr16) { std::string off = offset(); if (m_w == 0 && m_wb == 0) @@ -120,7 +120,7 @@ std::string i8089_disassembler::inst_rm(std::string instr8, std::string instr16) } // jump memory -std::string i8089_disassembler::inst_jm(std::string jump8short, std::string jump8long) +std::string i8089_disassembler::inst_jm(const std::string &jump8short, const std::string &jump8long) { std::string off = offset(); uint16_t i = fetch_immediate(); @@ -133,7 +133,7 @@ std::string i8089_disassembler::inst_jm(std::string jump8short, std::string jump } // jump memory bit -std::string i8089_disassembler::inst_jmb(std::string jump8short, std::string jump8long) +std::string i8089_disassembler::inst_jmb(const std::string &jump8short, const std::string &jump8long) { std::string off = offset(); uint16_t i = fetch_immediate(); @@ -146,7 +146,7 @@ std::string i8089_disassembler::inst_jmb(std::string jump8short, std::string jum } // memory register -std::string i8089_disassembler::inst_mr(std::string instr8, std::string instr16) +std::string i8089_disassembler::inst_mr(const std::string &instr8, const std::string &instr16) { std::string off = offset(); if (m_w == 0 && m_wb == 0) @@ -158,7 +158,7 @@ std::string i8089_disassembler::inst_mr(std::string instr8, std::string instr16) } // pointer memory -std::string i8089_disassembler::inst_pm(std::string instr16) +std::string i8089_disassembler::inst_pm(const std::string &instr16) { std::string off = offset(); if (m_w == 1 && m_wb == 0) @@ -168,7 +168,7 @@ std::string i8089_disassembler::inst_pm(std::string instr16) } // memory pointer -std::string i8089_disassembler::inst_mp(std::string instr16) +std::string i8089_disassembler::inst_mp(const std::string &instr16) { std::string off = offset(); if (m_w == 1 && m_wb == 0) @@ -178,7 +178,7 @@ std::string i8089_disassembler::inst_mp(std::string instr16) } // jump memory -std::string i8089_disassembler::inst_j16(std::string jump8short, std::string jump16short, std::string jump8long, std::string jump16long) +std::string i8089_disassembler::inst_j16(const std::string &jump8short, const std::string &jump16short, const std::string &jump8long, const std::string &jump16long) { std::string off = offset(); uint16_t i = fetch_immediate(); @@ -195,7 +195,7 @@ std::string i8089_disassembler::inst_j16(std::string jump8short, std::string jum } // memory -std::string i8089_disassembler::inst_m(std::string instr8, std::string instr16) +std::string i8089_disassembler::inst_m(const std::string &instr8, const std::string &instr16) { std::string off = offset(); if (m_w == 0 && m_wb == 0) @@ -207,7 +207,7 @@ std::string i8089_disassembler::inst_m(std::string instr8, std::string instr16) } // memory bit -std::string i8089_disassembler::inst_b(std::string instr) +std::string i8089_disassembler::inst_b(const std::string &instr) { std::string off = offset(); if (m_w == 0 && m_wb == 0) diff --git a/src/devices/cpu/i8089/i8089_dasm.h b/src/devices/cpu/i8089/i8089_dasm.h index cf59d4b483c..a8a7c2115a5 100644 --- a/src/devices/cpu/i8089/i8089_dasm.h +++ b/src/devices/cpu/i8089/i8089_dasm.h @@ -49,20 +49,20 @@ private: std::string offset(); std::string invalid(); - std::string from_i(std::string instr8, std::string instr16, std::string target); - std::string inst_ri(std::string instr8, std::string instr16); - std::string inst_r(std::string instr); - std::string inst_jr(std::string instr8, std::string instr16); - std::string inst_mi(std::string instr8, std::string instr16); - std::string inst_rm(std::string instr8, std::string instr16); - std::string inst_jm(std::string jump8short, std::string jump8long); - std::string inst_jmb(std::string jump8short, std::string jump8long); - std::string inst_mr(std::string instr8, std::string instr16); - std::string inst_pm(std::string instr16); - std::string inst_mp(std::string instr16); - std::string inst_j16(std::string jump8short, std::string jump16short, std::string jump8long, std::string jump16long); - std::string inst_m(std::string instr8, std::string instr16); - std::string inst_b(std::string instr); + std::string from_i(const std::string &instr8, const std::string &instr16, const std::string &target); + std::string inst_ri(const std::string &instr8, const std::string &instr16); + std::string inst_r(const std::string &instr); + std::string inst_jr(const std::string &instr8, const std::string &instr16); + std::string inst_mi(const std::string &instr8, const std::string &instr16); + std::string inst_rm(const std::string &instr8, const std::string &instr16); + std::string inst_jm(const std::string &jump8short, const std::string &jump8long); + std::string inst_jmb(const std::string &jump8short, const std::string &jump8long); + std::string inst_mr(const std::string &instr8, const std::string &instr16); + std::string inst_pm(const std::string &instr16); + std::string inst_mp(const std::string &instr16); + std::string inst_j16(const std::string &jump8short, const std::string &jump16short, const std::string &jump8long, const std::string &jump16long); + std::string inst_m(const std::string &instr8, const std::string &instr16); + std::string inst_b(const std::string &instr); std::string do_disassemble(); void load_instruction(); diff --git a/src/devices/cpu/i860/i860dec.hxx b/src/devices/cpu/i860/i860dec.hxx index 923a30b0935..b3a6e0c00b4 100644 --- a/src/devices/cpu/i860/i860dec.hxx +++ b/src/devices/cpu/i860/i860dec.hxx @@ -36,7 +36,7 @@ * */ #include "i860.h" -#include <math.h> +#include <cmath> #undef HOST_MSB diff --git a/src/devices/cpu/i960/i960.cpp b/src/devices/cpu/i960/i960.cpp index 6c53cac452f..10409923b15 100644 --- a/src/devices/cpu/i960/i960.cpp +++ b/src/devices/cpu/i960/i960.cpp @@ -7,7 +7,7 @@ #ifdef _MSC_VER /* logb prototype is different for MS Visual C */ -#include <float.h> +#include <cfloat> #define logb _logb #endif diff --git a/src/devices/cpu/i960/i960dis.cpp b/src/devices/cpu/i960/i960dis.cpp index a54e5390fe1..6f207494124 100644 --- a/src/devices/cpu/i960/i960dis.cpp +++ b/src/devices/cpu/i960/i960dis.cpp @@ -199,7 +199,7 @@ offs_t i960_disassembler::disassemble(std::ostream &stream, offs_t pc, const dat util::stream_format(stream, "%-8s%s,(%s)",NEM,REG_DST, REG_ABASE); break; case 3: - util::stream_format(stream, "%-8s%s,(%s)[%s*%ld]",NEM,REG_DST, REG_ABASE,REG_REG2,(iCode>>7)&0x7); + util::stream_format(stream, "%-8s%s,(%s)[%s*%ld]",NEM,REG_DST, REG_ABASE,REG_REG2,1<<((iCode>>7)&0x7)); break; default: util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); @@ -221,11 +221,11 @@ offs_t i960_disassembler::disassemble(std::ostream &stream, offs_t pc, const dat IPinc = 8; break; case 2: - util::stream_format(stream, "%-8s%s,0x%x[%s*%ld]",NEM,REG_DST, opcodes.r32(IP + 4),REG_REG2,(iCode>>7)&0x7); + util::stream_format(stream, "%-8s%s,0x%x[%s*%ld]",NEM,REG_DST, opcodes.r32(IP + 4),REG_REG2,1<<((iCode>>7)&0x7)); IPinc = 8; break; case 3: - util::stream_format(stream, "%-8s%s,0x%x(%s)[%s*%ld]",NEM,REG_DST, opcodes.r32(IP + 4),REG_ABASE,REG_REG2,(iCode>>7)&0x7); + util::stream_format(stream, "%-8s%s,0x%x(%s)[%s*%ld]",NEM,REG_DST, opcodes.r32(IP + 4),REG_ABASE,REG_REG2,1<<((iCode>>7)&0x7)); IPinc = 8; break; default: diff --git a/src/devices/cpu/lh5801/lh5801.h b/src/devices/cpu/lh5801/lh5801.h index ee8e54c04d2..904369a35bf 100644 --- a/src/devices/cpu/lh5801/lh5801.h +++ b/src/devices/cpu/lh5801/lh5801.h @@ -75,6 +75,8 @@ protected: virtual void device_reset() override; // device_execute_interface overrides + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } virtual uint32_t execute_min_cycles() const noexcept override { return 2; } virtual uint32_t execute_max_cycles() const noexcept override { return 19; } virtual uint32_t execute_input_lines() const noexcept override { return 2; } diff --git a/src/devices/cpu/m37710/m37710cm.h b/src/devices/cpu/m37710/m37710cm.h index 716c3cda445..8f5bd029d14 100644 --- a/src/devices/cpu/m37710/m37710cm.h +++ b/src/devices/cpu/m37710/m37710cm.h @@ -10,7 +10,7 @@ /* ================================ INCLUDES ============================== */ /* ======================================================================== */ -#include <limits.h> +#include <climits> #include "m37710.h" diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index b685391ba7c..d26711528db 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -729,6 +729,8 @@ void m68000_base_device::set_irq_line(int irqline, int state) /* A transition from < 7 to 7 always interrupts (NMI) */ /* Note: Level 7 can also level trigger like a normal IRQ */ + // FIXME: This may cause unintended level 7 interrupts if one or two IPL lines are asserted + // immediately before others are cleared. The actual 68000 imposes an input hold time. if(old_level != 0x0700 && m_int_level == 0x0700) m_nmi_pending = true; } diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h index 0326c0f4bd1..c712a861585 100644 --- a/src/devices/cpu/m68000/m68kcpu.h +++ b/src/devices/cpu/m68000/m68kcpu.h @@ -21,7 +21,7 @@ #undef REG_SP #undef REG_PC #else -#include <limits.h> +#include <climits> #endif /* ======================================================================== */ diff --git a/src/devices/cpu/m68000/m68kmmu.h b/src/devices/cpu/m68000/m68kmmu.h index 3e55f51ec39..f9cdf880358 100644 --- a/src/devices/cpu/m68000/m68kmmu.h +++ b/src/devices/cpu/m68000/m68kmmu.h @@ -229,7 +229,7 @@ void pmmu_atc_flush_fc_ea(const u16 modes) { if ((e & M68K_MMU_ATC_VALID) && (((e >> 24) & fcmask) == fc) && -// (((e >> ps) << (ps - 8)) == ((ea >> ps) << (ps - 8)))) +// (((e >> ps) << (ps - 8)) == ((ea >> ps) << (ps - 8)))) ( (e << ps) == (ea >> 8 << ps) )) { MMULOG("flushing entry %08x\n", e); diff --git a/src/devices/cpu/m88000/m88000.cpp b/src/devices/cpu/m88000/m88000.cpp new file mode 100644 index 00000000000..cb25ff35a38 --- /dev/null +++ b/src/devices/cpu/m88000/m88000.cpp @@ -0,0 +1,80 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Motorola M88000 RISC microprocessors + + Currently this device is just a stub with no actual execution core. + +***************************************************************************/ + +#include "emu.h" +#include "m88000.h" +#include "m88000d.h" + +// device type definitions +DEFINE_DEVICE_TYPE(MC88100, mc88100_device, "mc88100", "Motorola MC88100") + +mc88100_device::mc88100_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig, MC88100, tag, owner, clock) + , m_code_config("code", ENDIANNESS_BIG, 32, 32, 0) + , m_data_config("data", ENDIANNESS_BIG, 32, 32, 0) + , m_inst_cache(nullptr) + , m_data_space(nullptr) + , m_pc(0) + , m_r{0} + , m_cr{0} + , m_icount(0) +{ + m_cr[0] = 0x00000001; +} + +std::unique_ptr<util::disasm_interface> mc88100_device::create_disassembler() +{ + return std::make_unique<mc88100_disassembler>(); +} + +device_memory_interface::space_config_vector mc88100_device::memory_space_config() const +{ + // MC88100 has physically separate code and data buses + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_code_config), + std::make_pair(AS_DATA, &m_data_config) + }; +} + +void mc88100_device::device_start() +{ + m_inst_cache = space(AS_PROGRAM).cache<2, 0, ENDIANNESS_BIG>(); + m_data_space = &space(AS_DATA); + + set_icountptr(m_icount); + + state_add(M88000_PC, "PC", m_pc); + state_add(STATE_GENPC, "GENPC", m_pc).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow(); + state_add(STATE_GENFLAGS, "CURFLAGS", m_cr[1]).mask(0xf00003ff).noshow(); + for (int i = 1; i < 32; i++) + state_add(M88000_R1 + i - 1, string_format("r%d", i).c_str(), m_r[i]); + state_add(M88000_PSR, "PSR", m_cr[1]).mask(0xf00003ff); + state_add(M88000_VBR, "VBR", m_cr[7]).mask(0xfffff000); +} + +void mc88100_device::device_reset() +{ + m_pc = 0; + m_cr[1] = 0x800003fb; + m_cr[7] = 0; +} + +void mc88100_device::execute_run() +{ + debugger_instruction_hook(m_pc); + + m_icount = 0; +} + +void mc88100_device::execute_set_input(int inputnum, int state) +{ + // TODO +} diff --git a/src/devices/cpu/m88000/m88000.h b/src/devices/cpu/m88000/m88000.h new file mode 100644 index 00000000000..1e277099718 --- /dev/null +++ b/src/devices/cpu/m88000/m88000.h @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Motorola M88000 RISC microprocessors + +***************************************************************************/ + +#ifndef MAME_CPU_M88000_M88000_H +#define MAME_CPU_M88000_M88000_H + +#pragma once + +class mc88100_device : public cpu_device +{ +public: + enum { + M88000_PC, + M88000_R1, M88000_R2, M88000_R3, + M88000_R4, M88000_R5, M88000_R6, M88000_R7, + M88000_R8, M88000_R9, M88000_R10, M88000_R11, + M88000_R12, M88000_R13, M88000_R14, M88000_R15, + M88000_R16, M88000_R17, M88000_R18, M88000_R19, + M88000_R20, M88000_R21, M88000_R22, M88000_R23, + M88000_R24, M88000_R25, M88000_R26, M88000_R27, + M88000_R28, M88000_R29, M88000_R30, M88000_R31, + M88000_PSR, M88000_VBR + }; + + // construction/destruction + mc88100_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual void execute_run() override; + virtual void execute_set_input(int inputnum, int state) override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + +private: + // address spaces + address_space_config m_code_config; + address_space_config m_data_config; + memory_access_cache<2, 0, ENDIANNESS_BIG> *m_inst_cache; + address_space *m_data_space; + + // register storage + u32 m_pc; + u32 m_r[32]; + u32 m_cr[21]; + + s32 m_icount; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(MC88100, mc88100_device) + +#endif // MAME_CPU_M88000_M88000_H diff --git a/src/devices/cpu/m88000/m88000d.cpp b/src/devices/cpu/m88000/m88000d.cpp new file mode 100644 index 00000000000..26ba54afc2a --- /dev/null +++ b/src/devices/cpu/m88000/m88000d.cpp @@ -0,0 +1,1271 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + M88000 family disassembler + + The first (MC88100) and second (MC88110) generations of this RISC + architecture differ in several ways. Though the MC88110 instruction + set is a mostly backward-compatible extension to that of the MC88100, + it deletes some load/store instruction forms (mostly to make way for + extended register file support). The D, S1 and/or S2 fields are also + not decoded on the MC88100 for instructions that don't use them, but + the MC88110 documentation makes no such guarantees; the MC88110 + disassembler has been made accordingly stricter. + + Of the 32 registers in the general-purpose register file, two have + hardware-defined properties: r0 always contains zero (no matter what + data is written to it) and r1 stores the subroutine return pointer + for bsr and jsr. r30 may be used as a frame pointer and r31 may be + used as a stack pointer, but this is merely a calling convention. + + Though data memory accesses can be configured to use little-endian + byte ordering by setting bit 30 of PSR, this has no effect on + instruction decoding. + + The MC88100 executes integer multiplication instructions by using the + floating-point multiply pipeline. This is not the case on the MC88110. + + The extended register file added to the MC88110 is used mainly for + floating-point operations. Numbers of any precision can be stored in + any of these 80-bit registers except x0, which is fixed to contain + (positive) zero. The 80-bit double-extended-precision values are + padded out to 128 bits when stored in memory. + +***************************************************************************/ + +#include "emu.h" +#include "m88000d.h" + +m88000_disassembler::m88000_disassembler(const std::map<u32, const m88000_disassembler::instruction> &ops) + : util::disasm_interface() + , m_ops(ops) +{ +} + +mc88100_disassembler::mc88100_disassembler() + : m88000_disassembler(s_ops) +{ +} + +mc88110_disassembler::mc88110_disassembler() + : m88000_disassembler(s_ops) +{ +} + +const std::map<u32, const mc88100_disassembler::instruction> mc88100_disassembler::s_ops = +{ + { 0x00000000, { 0xfc000000, "xmem.bu", mc88100_disassembler::addressing::IMM16 }}, + { 0x04000000, { 0xfc000000, "xmem", mc88100_disassembler::addressing::IMM16 }}, + { 0x08000000, { 0xfc000000, "ld.hu", mc88100_disassembler::addressing::IMM16 }}, + { 0x0c000000, { 0xfc000000, "ld.bu", mc88100_disassembler::addressing::IMM16 }}, + { 0x10000000, { 0xfc000000, "ld.d", mc88100_disassembler::addressing::IMM16 }}, + { 0x14000000, { 0xfc000000, "ld", mc88100_disassembler::addressing::IMM16 }}, + { 0x18000000, { 0xfc000000, "ld.h", mc88100_disassembler::addressing::IMM16 }}, + { 0x1c000000, { 0xfc000000, "ld.b", mc88100_disassembler::addressing::IMM16 }}, + { 0x20000000, { 0xfc000000, "st.d", mc88100_disassembler::addressing::IMM16 }}, + { 0x24000000, { 0xfc000000, "st", mc88100_disassembler::addressing::IMM16 }}, + { 0x28000000, { 0xfc000000, "st.h", mc88100_disassembler::addressing::IMM16 }}, + { 0x2c000000, { 0xfc000000, "st.b", mc88100_disassembler::addressing::IMM16 }}, + { 0x30000000, { 0xfc000000, "lda.d", mc88100_disassembler::addressing::IMM16 }}, + { 0x34000000, { 0xfc000000, "lda", mc88100_disassembler::addressing::IMM16 }}, + { 0x38000000, { 0xfc000000, "lda.h", mc88100_disassembler::addressing::IMM16 }}, + { 0x3c000000, { 0xfc000000, "lda.b", mc88100_disassembler::addressing::IMM16 }}, + { 0x40000000, { 0xfc000000, "and", mc88100_disassembler::addressing::IMM16 }}, + { 0x44000000, { 0xfc000000, "and.u", mc88100_disassembler::addressing::IMM16 }}, + { 0x48000000, { 0xfc000000, "mask", mc88100_disassembler::addressing::IMM16 }}, + { 0x4c000000, { 0xfc000000, "mask.u", mc88100_disassembler::addressing::IMM16 }}, + { 0x50000000, { 0xfc000000, "xor", mc88100_disassembler::addressing::IMM16 }}, + { 0x54000000, { 0xfc000000, "xor.u", mc88100_disassembler::addressing::IMM16 }}, + { 0x58000000, { 0xfc000000, "or", mc88100_disassembler::addressing::IMM16 }}, + { 0x5c000000, { 0xfc000000, "or.u", mc88100_disassembler::addressing::IMM16 }}, + { 0x60000000, { 0xfc000000, "addu", mc88100_disassembler::addressing::IMM16 }}, + { 0x64000000, { 0xfc000000, "subu", mc88100_disassembler::addressing::IMM16 }}, + { 0x68000000, { 0xfc000000, "divu", mc88100_disassembler::addressing::IMM16 }}, + { 0x6c000000, { 0xfc000000, "mul", mc88100_disassembler::addressing::IMM16 }}, + { 0x70000000, { 0xfc000000, "add", mc88100_disassembler::addressing::SIMM16 }}, + { 0x74000000, { 0xfc000000, "sub", mc88100_disassembler::addressing::SIMM16 }}, + { 0x78000000, { 0xfc000000, "div", mc88100_disassembler::addressing::SIMM16 }}, + { 0x7c000000, { 0xfc000000, "cmp", mc88100_disassembler::addressing::SIMM16 }}, + { 0x80004000, { 0xfc00f800, "ldcr", mc88100_disassembler::addressing::CR }}, // privileged; S1, S2 not used + { 0x80004800, { 0xfc00f800, "fldcr", mc88100_disassembler::addressing::CR }}, // S1, S2 not used + { 0x80008000, { 0xfc00f800, "stcr", mc88100_disassembler::addressing::CR }}, // privileged; D not used + { 0x80008800, { 0xfc00f800, "fstcr", mc88100_disassembler::addressing::CR }}, // D not used + { 0x8000c000, { 0xfc00f800, "xcr", mc88100_disassembler::addressing::CR }}, // privileged + { 0x8000c800, { 0xfc00f800, "fxcr", mc88100_disassembler::addressing::CR }}, + { 0x84000000, { 0xfc00ffe0, "fmul.sss", mc88100_disassembler::addressing::FP }}, + { 0x84000020, { 0xfc00ffe0, "fmul.dss", mc88100_disassembler::addressing::FP }}, + { 0x84000080, { 0xfc00ffe0, "fmul.ssd", mc88100_disassembler::addressing::FP }}, + { 0x840000a0, { 0xfc00ffe0, "fmul.dsd", mc88100_disassembler::addressing::FP }}, + { 0x84000200, { 0xfc00ffe0, "fmul.sds", mc88100_disassembler::addressing::FP }}, + { 0x84000220, { 0xfc00ffe0, "fmul.dds", mc88100_disassembler::addressing::FP }}, + { 0x84000280, { 0xfc00ffe0, "fmul.sdd", mc88100_disassembler::addressing::FP }}, + { 0x840002a0, { 0xfc00ffe0, "fmul.ddd", mc88100_disassembler::addressing::FP }}, + { 0x84002000, { 0xfc1fffe0, "flt.ss", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84002020, { 0xfc1fffe0, "flt.ds", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84002800, { 0xfc00ffe0, "fadd.sss", mc88100_disassembler::addressing::FP }}, + { 0x84002820, { 0xfc00ffe0, "fadd.dss", mc88100_disassembler::addressing::FP }}, + { 0x84002880, { 0xfc00ffe0, "fadd.ssd", mc88100_disassembler::addressing::FP }}, + { 0x840028a0, { 0xfc00ffe0, "fadd.dsd", mc88100_disassembler::addressing::FP }}, + { 0x84002a00, { 0xfc00ffe0, "fadd.sds", mc88100_disassembler::addressing::FP }}, + { 0x84002a20, { 0xfc00ffe0, "fadd.dds", mc88100_disassembler::addressing::FP }}, + { 0x84002a80, { 0xfc00ffe0, "fadd.sdd", mc88100_disassembler::addressing::FP }}, + { 0x84002aa0, { 0xfc00ffe0, "fadd.ddd", mc88100_disassembler::addressing::FP }}, + { 0x84003000, { 0xfc00ffe0, "fsub.sss", mc88100_disassembler::addressing::FP }}, + { 0x84003020, { 0xfc00ffe0, "fsub.dss", mc88100_disassembler::addressing::FP }}, + { 0x84003080, { 0xfc00ffe0, "fsub.ssd", mc88100_disassembler::addressing::FP }}, + { 0x840030a0, { 0xfc00ffe0, "fsub.dsd", mc88100_disassembler::addressing::FP }}, + { 0x84003200, { 0xfc00ffe0, "fsub.sds", mc88100_disassembler::addressing::FP }}, + { 0x84003220, { 0xfc00ffe0, "fsub.dds", mc88100_disassembler::addressing::FP }}, + { 0x84003280, { 0xfc00ffe0, "fsub.sdd", mc88100_disassembler::addressing::FP }}, + { 0x840032a0, { 0xfc00ffe0, "fsub.ddd", mc88100_disassembler::addressing::FP }}, + { 0x84003800, { 0xfc00ffe0, "fcmp.sss", mc88100_disassembler::addressing::FP }}, + { 0x84003880, { 0xfc00ffe0, "fcmp.ssd", mc88100_disassembler::addressing::FP }}, + { 0x84003a00, { 0xfc00ffe0, "fcmp.sds", mc88100_disassembler::addressing::FP }}, + { 0x84003a80, { 0xfc00ffe0, "fcmp.sdd", mc88100_disassembler::addressing::FP }}, + { 0x84004800, { 0xfc1fffe0, "int.ss", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84004880, { 0xfc1fffe0, "int.sd", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84005000, { 0xfc1fffe0, "nint.ss", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84005080, { 0xfc1fffe0, "nint.sd", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84005800, { 0xfc1fffe0, "trnc.ss", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84005880, { 0xfc1fffe0, "trnc.sd", mc88100_disassembler::addressing::FP }}, // S1 not used + { 0x84007000, { 0xfc00ffe0, "fdiv.sss", mc88100_disassembler::addressing::FP }}, + { 0x84007020, { 0xfc00ffe0, "fdiv.dss", mc88100_disassembler::addressing::FP }}, + { 0x84007080, { 0xfc00ffe0, "fdiv.ssd", mc88100_disassembler::addressing::FP }}, + { 0x840070a0, { 0xfc00ffe0, "fdiv.dsd", mc88100_disassembler::addressing::FP }}, + { 0x84007200, { 0xfc00ffe0, "fdiv.sds", mc88100_disassembler::addressing::FP }}, + { 0x84007220, { 0xfc00ffe0, "fdiv.dds", mc88100_disassembler::addressing::FP }}, + { 0x84007280, { 0xfc00ffe0, "fdiv.sdd", mc88100_disassembler::addressing::FP }}, + { 0x840072a0, { 0xfc00ffe0, "fdiv.ddd", mc88100_disassembler::addressing::FP }}, + { 0xc0000000, { 0xfc000000, "br", mc88100_disassembler::addressing::D26 }}, + { 0xc4000000, { 0xfc000000, "br.n", mc88100_disassembler::addressing::D26 }}, + { 0xc8000000, { 0xfc000000, "bsr", mc88100_disassembler::addressing::D26 }}, + { 0xcc000000, { 0xfc000000, "bsr.n", mc88100_disassembler::addressing::D26 }}, + { 0xd0000000, { 0xfc000000, "bb0", mc88100_disassembler::addressing::D16 }}, // bit test + { 0xd4000000, { 0xfc000000, "bb0.n", mc88100_disassembler::addressing::D16 }}, // bit test + { 0xd8000000, { 0xfc000000, "bb1", mc88100_disassembler::addressing::D16 }}, // bit test + { 0xdc000000, { 0xfc000000, "bb1.n", mc88100_disassembler::addressing::D16 }}, // bit test + { 0xe8000000, { 0xfc000000, "bcnd", mc88100_disassembler::addressing::D16 }}, // conditional test + { 0xec000000, { 0xfc000000, "bcnd.n", mc88100_disassembler::addressing::D16 }}, // conditional test + { 0xf0008000, { 0xfc00fc00, "clr", mc88100_disassembler::addressing::BITFIELD }}, + { 0xf0008800, { 0xfc00fc00, "set", mc88100_disassembler::addressing::BITFIELD }}, + { 0xf0009000, { 0xfc00fc00, "ext", mc88100_disassembler::addressing::BITFIELD }}, + { 0xf0009800, { 0xfc00fc00, "extu", mc88100_disassembler::addressing::BITFIELD }}, + { 0xf000a000, { 0xfc00fc00, "mak", mc88100_disassembler::addressing::BITFIELD }}, + { 0xf000a800, { 0xfc00fc00, "rot", mc88100_disassembler::addressing::BITFIELD }}, // W5 not used + { 0xf000d000, { 0xfc00fe00, "tb0", mc88100_disassembler::addressing::VEC9 }}, // bit test + { 0xf000d800, { 0xfc00fe00, "tb1", mc88100_disassembler::addressing::VEC9 }}, // bit test + { 0xf000e800, { 0xfc00fe00, "tcnd", mc88100_disassembler::addressing::VEC9 }}, // conditional test + { 0xf4000000, { 0xfc00ffe0, "xmem.bu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4000100, { 0xfc00ffe0, "xmem.bu.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4000200, { 0xfc00ffe0, "xmem.bu", mc88100_disassembler::addressing::SCALED }}, + { 0xf4000300, { 0xfc00ffe0, "xmem.bu.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4000400, { 0xfc00ffe0, "xmem", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4000500, { 0xfc00ffe0, "xmem.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4000600, { 0xfc00ffe0, "xmem", mc88100_disassembler::addressing::SCALED }}, + { 0xf4000700, { 0xfc00ffe0, "xmem.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4000800, { 0xfc00ffe0, "ld.hu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4000900, { 0xfc00ffe0, "ld.hu.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4000a00, { 0xfc00ffe0, "ld.hu", mc88100_disassembler::addressing::SCALED }}, + { 0xf4000b00, { 0xfc00ffe0, "ld.hu.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4000c00, { 0xfc00ffe0, "ld.bu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4000d00, { 0xfc00ffe0, "ld.bu.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4000e00, { 0xfc00ffe0, "ld.bu", mc88100_disassembler::addressing::SCALED }}, + { 0xf4000f00, { 0xfc00ffe0, "ld.bu.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4001000, { 0xfc00ffe0, "ld.d", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4001100, { 0xfc00ffe0, "ld.d.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4001200, { 0xfc00ffe0, "ld.d", mc88100_disassembler::addressing::SCALED }}, + { 0xf4001300, { 0xfc00ffe0, "ld.d.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4001400, { 0xfc00ffe0, "ld", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4001500, { 0xfc00ffe0, "ld.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4001600, { 0xfc00ffe0, "ld", mc88100_disassembler::addressing::SCALED }}, + { 0xf4001700, { 0xfc00ffe0, "ld.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4001800, { 0xfc00ffe0, "ld.h", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4001900, { 0xfc00ffe0, "ld.h.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4001a00, { 0xfc00ffe0, "ld.h", mc88100_disassembler::addressing::SCALED }}, + { 0xf4001b00, { 0xfc00ffe0, "ld.h.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4001c00, { 0xfc00ffe0, "ld.b", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4001d00, { 0xfc00ffe0, "ld.b.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4001e00, { 0xfc00ffe0, "ld.b", mc88100_disassembler::addressing::SCALED }}, + { 0xf4001f00, { 0xfc00ffe0, "ld.b.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4002000, { 0xfc00ffe0, "st.d", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4002100, { 0xfc00ffe0, "st.d.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4002200, { 0xfc00ffe0, "st.d", mc88100_disassembler::addressing::SCALED }}, + { 0xf4002300, { 0xfc00ffe0, "st.d.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4002400, { 0xfc00ffe0, "st", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4002500, { 0xfc00ffe0, "st.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4002600, { 0xfc00ffe0, "st", mc88100_disassembler::addressing::SCALED }}, + { 0xf4002700, { 0xfc00ffe0, "st.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4002800, { 0xfc00ffe0, "st.h", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4002900, { 0xfc00ffe0, "st.h.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4002a00, { 0xfc00ffe0, "st.h", mc88100_disassembler::addressing::SCALED }}, + { 0xf4002b00, { 0xfc00ffe0, "st.h.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4002c00, { 0xfc00ffe0, "st.b", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4002d00, { 0xfc00ffe0, "st.b.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4002e00, { 0xfc00ffe0, "st.b", mc88100_disassembler::addressing::SCALED }}, + { 0xf4002f00, { 0xfc00ffe0, "st.b.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4003000, { 0xfc00ffe0, "lda.d", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4003100, { 0xfc00ffe0, "lda.d.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4003200, { 0xfc00ffe0, "lda.d", mc88100_disassembler::addressing::SCALED }}, + { 0xf4003300, { 0xfc00ffe0, "lda.d.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4003400, { 0xfc00ffe0, "lda", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4003500, { 0xfc00ffe0, "lda.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4003600, { 0xfc00ffe0, "lda", mc88100_disassembler::addressing::SCALED }}, + { 0xf4003700, { 0xfc00ffe0, "lda.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4003800, { 0xfc00ffe0, "lda.h", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4003900, { 0xfc00ffe0, "lda.h.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4003a00, { 0xfc00ffe0, "lda.h", mc88100_disassembler::addressing::SCALED }}, + { 0xf4003b00, { 0xfc00ffe0, "lda.h.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4003c00, { 0xfc00ffe0, "lda.b", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4003d00, { 0xfc00ffe0, "lda.b.usr", mc88100_disassembler::addressing::TRIADIC }}, // privileged + { 0xf4003e00, { 0xfc00ffe0, "lda.b", mc88100_disassembler::addressing::SCALED }}, + { 0xf4003f00, { 0xfc00ffe0, "lda.b.usr", mc88100_disassembler::addressing::SCALED }}, // privileged + { 0xf4004000, { 0xfc00ffe0, "and", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4004400, { 0xfc00ffe0, "and.c", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4005000, { 0xfc00ffe0, "xor", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4005400, { 0xfc00ffe0, "xor.c", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4005800, { 0xfc00ffe0, "or", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4005c00, { 0xfc00ffe0, "or.c", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006000, { 0xfc00ffe0, "addu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006100, { 0xfc00ffe0, "addu.co", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006200, { 0xfc00ffe0, "addu.ci", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006300, { 0xfc00ffe0, "addu.cio", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006400, { 0xfc00ffe0, "subu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006500, { 0xfc00ffe0, "subu.co", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006600, { 0xfc00ffe0, "subu.ci", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006700, { 0xfc00ffe0, "subu.cio", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006800, { 0xfc00fce0, "divu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4006c00, { 0xfc00fce0, "mul", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007000, { 0xfc00ffe0, "add", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007100, { 0xfc00ffe0, "add.co", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007200, { 0xfc00ffe0, "add.ci", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007300, { 0xfc00ffe0, "add.cio", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007400, { 0xfc00ffe0, "sub", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007500, { 0xfc00ffe0, "sub.co", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007600, { 0xfc00ffe0, "sub.ci", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007700, { 0xfc00ffe0, "sub.cio", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007800, { 0xfc00fce0, "div", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4007c00, { 0xfc00fce0, "cmp", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4008000, { 0xfc00ffe0, "clr", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4008800, { 0xfc00ffe0, "set", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4009000, { 0xfc00ffe0, "ext", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf4009800, { 0xfc00ffe0, "extu", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf400a000, { 0xfc00ffe0, "mak", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf400a800, { 0xfc00ffe0, "rot", mc88100_disassembler::addressing::TRIADIC }}, + { 0xf400c000, { 0xfc00ffe0, "jmp", mc88100_disassembler::addressing::JUMP }}, + { 0xf400c400, { 0xfc00ffe0, "jmp.n", mc88100_disassembler::addressing::JUMP }}, + { 0xf400c800, { 0xfc00ffe0, "jsr", mc88100_disassembler::addressing::JUMP }}, + { 0xf400cc00, { 0xfc00ffe0, "jsr.n", mc88100_disassembler::addressing::JUMP }}, + { 0xf400e000, { 0xfc00ffe0, "ff1", mc88100_disassembler::addressing::TRIADIC }}, // S1 not used + { 0xf400e800, { 0xfc00ffe0, "ff0", mc88100_disassembler::addressing::TRIADIC }}, // S1 not used + { 0xf400f800, { 0xfc00ffe0, "tbnd", mc88100_disassembler::addressing::TRIADIC }}, // D not used + { 0xf400fc00, { 0xfc00ffe0, "rte", mc88100_disassembler::addressing::NONE }}, // privileged + { 0xf8000000, { 0xfc000000, "tbnd", mc88100_disassembler::addressing::IMM16 }} // D not used +}; + +const std::map<u32, const mc88110_disassembler::instruction> mc88110_disassembler::s_ops = +{ + { 0x00000000, { 0xfc000000, "ld.d", mc88110_disassembler::addressing::SI16_XRF }}, + { 0x04000000, { 0xfc000000, "ld", mc88110_disassembler::addressing::SI16_XRF }}, + { 0x08000000, { 0xfc000000, "ld.hu", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x0c000000, { 0xfc000000, "ld.bu", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x10000000, { 0xfc000000, "ld.d", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x14000000, { 0xfc000000, "ld", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x18000000, { 0xfc000000, "ld.h", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x1c000000, { 0xfc000000, "ld.b", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x20000000, { 0xfc000000, "st.d", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x24000000, { 0xfc000000, "st", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x28000000, { 0xfc000000, "st.h", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x2c000000, { 0xfc000000, "st.b", mc88110_disassembler::addressing::SI16_GRF }}, + { 0x30000000, { 0xfc000000, "st.d", mc88110_disassembler::addressing::SI16_XRF }}, + { 0x34000000, { 0xfc000000, "st", mc88110_disassembler::addressing::SI16_XRF }}, + { 0x38000000, { 0xfc000000, "st.x", mc88110_disassembler::addressing::SI16_XRF }}, + { 0x3c000000, { 0xfc000000, "ld.x", mc88110_disassembler::addressing::SI16_XRF }}, + { 0x40000000, { 0xfc000000, "and", mc88110_disassembler::addressing::IMM16 }}, + { 0x44000000, { 0xfc000000, "and.u", mc88110_disassembler::addressing::IMM16 }}, + { 0x48000000, { 0xfc000000, "mask", mc88110_disassembler::addressing::IMM16 }}, + { 0x4c000000, { 0xfc000000, "mask.u", mc88110_disassembler::addressing::IMM16 }}, + { 0x50000000, { 0xfc000000, "xor", mc88110_disassembler::addressing::IMM16 }}, + { 0x54000000, { 0xfc000000, "xor.u", mc88110_disassembler::addressing::IMM16 }}, + { 0x58000000, { 0xfc000000, "or", mc88110_disassembler::addressing::IMM16 }}, + { 0x5c000000, { 0xfc000000, "or.u", mc88110_disassembler::addressing::IMM16 }}, + { 0x60000000, { 0xfc000000, "addu", mc88110_disassembler::addressing::IMM16 }}, + { 0x64000000, { 0xfc000000, "subu", mc88110_disassembler::addressing::IMM16 }}, + { 0x68000000, { 0xfc000000, "divu", mc88110_disassembler::addressing::IMM16 }}, + { 0x6c000000, { 0xfc000000, "mulu", mc88110_disassembler::addressing::IMM16 }}, + { 0x70000000, { 0xfc000000, "add", mc88110_disassembler::addressing::SIMM16 }}, + { 0x74000000, { 0xfc000000, "sub", mc88110_disassembler::addressing::SIMM16 }}, + { 0x78000000, { 0xfc000000, "divs", mc88110_disassembler::addressing::SIMM16 }}, + { 0x7c000000, { 0xfc000000, "cmp", mc88110_disassembler::addressing::SIMM16 }}, + { 0x80004000, { 0xfc1ff81f, "ldcr", mc88110_disassembler::addressing::CR }}, + { 0x80004800, { 0xfc1ff81f, "fldcr", mc88110_disassembler::addressing::CR }}, + { 0x80008000, { 0xffe0f800, "stcr", mc88110_disassembler::addressing::CR }}, + { 0x80008800, { 0xffe0f800, "fstcr", mc88110_disassembler::addressing::CR }}, + { 0x8000c000, { 0xfc00f800, "xcr", mc88110_disassembler::addressing::CR }}, + { 0x8000c800, { 0xfc00f800, "fxcr", mc88110_disassembler::addressing::CR }}, + { 0x84000000, { 0xfc007fe0, "fmul.sss", mc88110_disassembler::addressing::FP }}, + { 0x84000020, { 0xfc007fe0, "fmul.dss", mc88110_disassembler::addressing::FP }}, + { 0x84000080, { 0xfc007fe0, "fmul.ssd", mc88110_disassembler::addressing::FP }}, + { 0x840000a0, { 0xfc007fe0, "fmul.dsd", mc88110_disassembler::addressing::FP }}, + { 0x84000200, { 0xfc007fe0, "fmul.sds", mc88110_disassembler::addressing::FP }}, + { 0x84000220, { 0xfc007fe0, "fmul.dds", mc88110_disassembler::addressing::FP }}, + { 0x84000280, { 0xfc007fe0, "fmul.sdd", mc88110_disassembler::addressing::FP }}, + { 0x840002a0, { 0xfc007fe0, "fmul.ddd", mc88110_disassembler::addressing::FP }}, + { 0x84000820, { 0xfc1f7fe0, "fcvt.ds", mc88110_disassembler::addressing::FP }}, + { 0x84000880, { 0xfc1f7fe0, "fcvt.sd", mc88110_disassembler::addressing::FP }}, + { 0x84002000, { 0xfc1f7fe0, "flt.ss", mc88110_disassembler::addressing::FP }}, + { 0x84002020, { 0xfc1f7fe0, "flt.ds", mc88110_disassembler::addressing::FP }}, + { 0x84002800, { 0xfc007fe0, "fadd.sss", mc88110_disassembler::addressing::FP }}, + { 0x84002820, { 0xfc007fe0, "fadd.dss", mc88110_disassembler::addressing::FP }}, + { 0x84002880, { 0xfc007fe0, "fadd.ssd", mc88110_disassembler::addressing::FP }}, + { 0x840028a0, { 0xfc007fe0, "fadd.dsd", mc88110_disassembler::addressing::FP }}, + { 0x84002a00, { 0xfc007fe0, "fadd.sds", mc88110_disassembler::addressing::FP }}, + { 0x84002a20, { 0xfc007fe0, "fadd.dds", mc88110_disassembler::addressing::FP }}, + { 0x84002a80, { 0xfc007fe0, "fadd.sdd", mc88110_disassembler::addressing::FP }}, + { 0x84002aa0, { 0xfc007fe0, "fadd.ddd", mc88110_disassembler::addressing::FP }}, + { 0x84003000, { 0xfc007fe0, "fsub.sss", mc88110_disassembler::addressing::FP }}, + { 0x84003020, { 0xfc007fe0, "fsub.dss", mc88110_disassembler::addressing::FP }}, + { 0x84003080, { 0xfc007fe0, "fsub.ssd", mc88110_disassembler::addressing::FP }}, + { 0x840030a0, { 0xfc007fe0, "fsub.dsd", mc88110_disassembler::addressing::FP }}, + { 0x84003200, { 0xfc007fe0, "fsub.sds", mc88110_disassembler::addressing::FP }}, + { 0x84003220, { 0xfc007fe0, "fsub.dds", mc88110_disassembler::addressing::FP }}, + { 0x84003280, { 0xfc007fe0, "fsub.sdd", mc88110_disassembler::addressing::FP }}, + { 0x840032a0, { 0xfc007fe0, "fsub.ddd", mc88110_disassembler::addressing::FP }}, + { 0x84003800, { 0xfc007fe0, "fcmp.sss", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84003820, { 0xfc007fe0, "fcmpu.sss", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84003880, { 0xfc007fe0, "fcmp.ssd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x840038a0, { 0xfc007fe0, "fcmpu.ssd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84003a00, { 0xfc007fe0, "fcmp.sds", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84003a20, { 0xfc007fe0, "fcmpu.sds", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84003a80, { 0xfc007fe0, "fcmp.sdd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84003aa0, { 0xfc007fe0, "fcmpu.sdd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84004200, { 0xfc1fffe0, "mov.s", mc88110_disassembler::addressing::FP }}, // GRF to XRF + { 0x84004280, { 0xfc1fffe0, "mov.d", mc88110_disassembler::addressing::FP }}, // GRF to XRF + { 0x84004800, { 0xfc1f7fe0, "int.ss", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84004880, { 0xfc1f7fe0, "int.sd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84005000, { 0xfc1f7fe0, "nint.ss", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84005080, { 0xfc1f7fe0, "nint.sd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84005800, { 0xfc1f7fe0, "trnc.ss", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84005880, { 0xfc1f7fe0, "trnc.sd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x84007000, { 0xfc007fe0, "fdiv.sss", mc88110_disassembler::addressing::FP }}, + { 0x84007020, { 0xfc007fe0, "fdiv.dss", mc88110_disassembler::addressing::FP }}, + { 0x84007080, { 0xfc007fe0, "fdiv.ssd", mc88110_disassembler::addressing::FP }}, + { 0x840070a0, { 0xfc007fe0, "fdiv.dsd", mc88110_disassembler::addressing::FP }}, + { 0x84007200, { 0xfc007fe0, "fdiv.sds", mc88110_disassembler::addressing::FP }}, + { 0x84007220, { 0xfc007fe0, "fdiv.dds", mc88110_disassembler::addressing::FP }}, + { 0x84007280, { 0xfc007fe0, "fdiv.sdd", mc88110_disassembler::addressing::FP }}, + { 0x840072a0, { 0xfc007fe0, "fdiv.ddd", mc88110_disassembler::addressing::FP }}, + { 0x84007800, { 0xfc1f7fe0, "fsqrt.ss", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x84007820, { 0xfc1f7fe0, "fsqrt.ds", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x84007880, { 0xfc1f7fe0, "fsqrt.sd", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x840078a0, { 0xfc1f7fe0, "fsqrt.dd", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x840080c0, { 0xfc00ffe0, "fmul.xsd", mc88110_disassembler::addressing::FP }}, + { 0x84008100, { 0xfc00ffe0, "fmul.ssx", mc88110_disassembler::addressing::FP }}, + { 0x84008120, { 0xfc00ffe0, "fmul.dsx", mc88110_disassembler::addressing::FP }}, + { 0x84008140, { 0xfc00ffe0, "fmul.xsx", mc88110_disassembler::addressing::FP }}, + { 0x84008240, { 0xfc00ffe0, "fmul.xds", mc88110_disassembler::addressing::FP }}, + { 0x840082c0, { 0xfc00ffe0, "fmul.xdd", mc88110_disassembler::addressing::FP }}, + { 0x84008400, { 0xfc00ffe0, "fmul.sxs", mc88110_disassembler::addressing::FP }}, + { 0x84008420, { 0xfc00ffe0, "fmul.dxs", mc88110_disassembler::addressing::FP }}, + { 0x84008440, { 0xfc00ffe0, "fmul.xxs", mc88110_disassembler::addressing::FP }}, + { 0x84008480, { 0xfc00ffe0, "fmul.sxd", mc88110_disassembler::addressing::FP }}, + { 0x840084a0, { 0xfc00ffe0, "fmul.dxd", mc88110_disassembler::addressing::FP }}, + { 0x840084c0, { 0xfc00ffe0, "fmul.xxd", mc88110_disassembler::addressing::FP }}, + { 0x84008500, { 0xfc00ffe0, "fmul.sxx", mc88110_disassembler::addressing::FP }}, + { 0x84008520, { 0xfc00ffe0, "fmul.dxx", mc88110_disassembler::addressing::FP }}, + { 0x84008540, { 0xfc00ffe0, "fmul.xxx", mc88110_disassembler::addressing::FP }}, + { 0x84008840, { 0xfc1fffe0, "fcvt.xs", mc88110_disassembler::addressing::FP }}, + { 0x840088c0, { 0xfc1fffe0, "fcvt.xd", mc88110_disassembler::addressing::FP }}, + { 0x84008900, { 0xfc1fffe0, "fcvt.sx", mc88110_disassembler::addressing::FP }}, + { 0x84008920, { 0xfc1fffe0, "fcvt.dx", mc88110_disassembler::addressing::FP }}, + { 0x8400a040, { 0xfc1fffe0, "flt.xs", mc88110_disassembler::addressing::FP }}, + { 0x8400a840, { 0xfc00ffe0, "fadd.xss", mc88110_disassembler::addressing::FP }}, + { 0x8400a8c0, { 0xfc00ffe0, "fadd.xsd", mc88110_disassembler::addressing::FP }}, + { 0x8400a900, { 0xfc00ffe0, "fadd.ssx", mc88110_disassembler::addressing::FP }}, + { 0x8400a920, { 0xfc00ffe0, "fadd.dsx", mc88110_disassembler::addressing::FP }}, + { 0x8400a940, { 0xfc00ffe0, "fadd.xsx", mc88110_disassembler::addressing::FP }}, + { 0x8400aa40, { 0xfc00ffe0, "fadd.xds", mc88110_disassembler::addressing::FP }}, + { 0x8400aac0, { 0xfc00ffe0, "fadd.xdd", mc88110_disassembler::addressing::FP }}, + { 0x8400ac00, { 0xfc00ffe0, "fadd.sxs", mc88110_disassembler::addressing::FP }}, + { 0x8400ac20, { 0xfc00ffe0, "fadd.dxs", mc88110_disassembler::addressing::FP }}, + { 0x8400ac40, { 0xfc00ffe0, "fadd.xxs", mc88110_disassembler::addressing::FP }}, + { 0x8400ac80, { 0xfc00ffe0, "fadd.sxd", mc88110_disassembler::addressing::FP }}, + { 0x8400aca0, { 0xfc00ffe0, "fadd.dxd", mc88110_disassembler::addressing::FP }}, + { 0x8400acc0, { 0xfc00ffe0, "fadd.xxd", mc88110_disassembler::addressing::FP }}, + { 0x8400ad00, { 0xfc00ffe0, "fadd.sxx", mc88110_disassembler::addressing::FP }}, + { 0x8400ad20, { 0xfc00ffe0, "fadd.dxx", mc88110_disassembler::addressing::FP }}, + { 0x8400ad40, { 0xfc00ffe0, "fadd.xxx", mc88110_disassembler::addressing::FP }}, + { 0x8400b040, { 0xfc00ffe0, "fsub.xss", mc88110_disassembler::addressing::FP }}, + { 0x8400b0c0, { 0xfc00ffe0, "fsub.xsd", mc88110_disassembler::addressing::FP }}, + { 0x8400b100, { 0xfc00ffe0, "fsub.ssx", mc88110_disassembler::addressing::FP }}, + { 0x8400b120, { 0xfc00ffe0, "fsub.dsx", mc88110_disassembler::addressing::FP }}, + { 0x8400b140, { 0xfc00ffe0, "fsub.xsx", mc88110_disassembler::addressing::FP }}, + { 0x8400b240, { 0xfc00ffe0, "fsub.xds", mc88110_disassembler::addressing::FP }}, + { 0x8400b2c0, { 0xfc00ffe0, "fsub.xdd", mc88110_disassembler::addressing::FP }}, + { 0x8400b400, { 0xfc00ffe0, "fsub.sxs", mc88110_disassembler::addressing::FP }}, + { 0x8400b420, { 0xfc00ffe0, "fsub.dxs", mc88110_disassembler::addressing::FP }}, + { 0x8400b440, { 0xfc00ffe0, "fsub.xxs", mc88110_disassembler::addressing::FP }}, + { 0x8400b480, { 0xfc00ffe0, "fsub.sxd", mc88110_disassembler::addressing::FP }}, + { 0x8400b4a0, { 0xfc00ffe0, "fsub.dxd", mc88110_disassembler::addressing::FP }}, + { 0x8400b4c0, { 0xfc00ffe0, "fsub.xxd", mc88110_disassembler::addressing::FP }}, + { 0x8400b500, { 0xfc00ffe0, "fsub.sxx", mc88110_disassembler::addressing::FP }}, + { 0x8400b520, { 0xfc00ffe0, "fsub.dxx", mc88110_disassembler::addressing::FP }}, + { 0x8400b540, { 0xfc00ffe0, "fsub.xxx", mc88110_disassembler::addressing::FP }}, + { 0x8400b900, { 0xfc00ffe0, "fcmp.ssx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400b920, { 0xfc00ffe0, "fcmpu.ssx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bb00, { 0xfc00ffe0, "fcmp.sdx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bb20, { 0xfc00ffe0, "fcmpu.sdx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bc00, { 0xfc00ffe0, "fcmp.sxs", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bc20, { 0xfc00ffe0, "fcmpu.sxs", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bc80, { 0xfc00ffe0, "fcmp.sxd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bca0, { 0xfc00ffe0, "fcmpu.sxd", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bd00, { 0xfc00ffe0, "fcmp.sxx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400bd20, { 0xfc00ffe0, "fcmpu.sxx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400c000, { 0xfc1fffe0, "mov.s", mc88110_disassembler::addressing::FP }}, // XRF to GRF + { 0x8400c080, { 0xfc1fffe0, "mov.d", mc88110_disassembler::addressing::FP }}, // XRF to GRF + { 0x8400c300, { 0xfc1fffe0, "mov", mc88110_disassembler::addressing::FP }}, // XRF to XRF + { 0x8400c900, { 0xfc1fffe0, "int.sx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400d100, { 0xfc1fffe0, "nint.sx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400d900, { 0xfc1fffe0, "trnc.sx", mc88110_disassembler::addressing::FP }}, // destination in GRF + { 0x8400f040, { 0xfc00ffe0, "fdiv.xss", mc88110_disassembler::addressing::FP }}, + { 0x8400f0c0, { 0xfc00ffe0, "fdiv.xsd", mc88110_disassembler::addressing::FP }}, + { 0x8400f100, { 0xfc00ffe0, "fdiv.ssx", mc88110_disassembler::addressing::FP }}, + { 0x8400f120, { 0xfc00ffe0, "fdiv.dsx", mc88110_disassembler::addressing::FP }}, + { 0x8400f140, { 0xfc00ffe0, "fdiv.xsx", mc88110_disassembler::addressing::FP }}, + { 0x8400f240, { 0xfc00ffe0, "fdiv.xds", mc88110_disassembler::addressing::FP }}, + { 0x8400f2c0, { 0xfc00ffe0, "fdiv.xdd", mc88110_disassembler::addressing::FP }}, + { 0x8400f400, { 0xfc00ffe0, "fdiv.sxs", mc88110_disassembler::addressing::FP }}, + { 0x8400f420, { 0xfc00ffe0, "fdiv.dxs", mc88110_disassembler::addressing::FP }}, + { 0x8400f440, { 0xfc00ffe0, "fdiv.xxs", mc88110_disassembler::addressing::FP }}, + { 0x8400f480, { 0xfc00ffe0, "fdiv.sxd", mc88110_disassembler::addressing::FP }}, + { 0x8400f4a0, { 0xfc00ffe0, "fdiv.dxd", mc88110_disassembler::addressing::FP }}, + { 0x8400f4c0, { 0xfc00ffe0, "fdiv.xxd", mc88110_disassembler::addressing::FP }}, + { 0x8400f500, { 0xfc00ffe0, "fdiv.sxx", mc88110_disassembler::addressing::FP }}, + { 0x8400f520, { 0xfc00ffe0, "fdiv.dxx", mc88110_disassembler::addressing::FP }}, + { 0x8400f540, { 0xfc00ffe0, "fdiv.xxx", mc88110_disassembler::addressing::FP }}, + { 0x8400f840, { 0xfc1fffe0, "fsqrt.xs", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x8400f8c0, { 0xfc1fffe0, "fsqrt.xd", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x8400f900, { 0xfc1fffe0, "fsqrt.sx", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x8400f920, { 0xfc1fffe0, "fsqrt.dx", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x8400f940, { 0xfc1fffe0, "fsqrt.xx", mc88110_disassembler::addressing::FP }}, // not implemented in hardware + { 0x88000000, { 0xfc00ffe0, "pmul", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88002020, { 0xfc00ffe0, "padd.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88002040, { 0xfc00ffe0, "padd.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88002060, { 0xfc00ffe0, "padd", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880020a0, { 0xfc00ffe0, "padds.u.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880020c0, { 0xfc00ffe0, "padds.u.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880020e0, { 0xfc00ffe0, "padds.u", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88002120, { 0xfc00ffe0, "padds.us.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88002140, { 0xfc00ffe0, "padds.us.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88002160, { 0xfc00ffe0, "padds.us", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880021a0, { 0xfc00ffe0, "padds.s.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880021c0, { 0xfc00ffe0, "padds.s.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880021e0, { 0xfc00ffe0, "padds.s", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003020, { 0xfc00ffe0, "psub.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003040, { 0xfc00ffe0, "psub.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003060, { 0xfc00ffe0, "psub", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003080, { 0xfc00ffe0, "psubs.u.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880030c0, { 0xfc00ffe0, "psubs.u.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880030e0, { 0xfc00ffe0, "psubs.u", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003120, { 0xfc00ffe0, "psubs.us.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003140, { 0xfc00ffe0, "psubs.us.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003160, { 0xfc00ffe0, "psubs.us", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880031a0, { 0xfc00ffe0, "psubs.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880031c0, { 0xfc00ffe0, "psubs.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x880031e0, { 0xfc00ffe0, "psubs", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88003860, { 0xfc00ffe0, "pcmp", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006160, { 0xfc00ffe0, "ppack.8", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006240, { 0xfc00ffe0, "ppack.16.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006260, { 0xfc00ffe0, "ppack.16", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006420, { 0xfc00ffe0, "ppack.32.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006440, { 0xfc00ffe0, "ppack.32.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006460, { 0xfc00ffe0, "ppack.32", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006800, { 0xfc00ffff, "punpk.n", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006820, { 0xfc00ffff, "punpk.b", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88006840, { 0xfc00ffff, "punpk.h", mc88110_disassembler::addressing::TRIADIC }}, + { 0x88007000, { 0xfc00f87f, "prot", mc88110_disassembler::addressing::IMM6 }}, + { 0x88007800, { 0xfc00ffe0, "prot", mc88110_disassembler::addressing::TRIADIC }}, + { 0xc0000000, { 0xfc000000, "br", mc88110_disassembler::addressing::D26 }}, + { 0xc4000000, { 0xfc000000, "br.n", mc88110_disassembler::addressing::D26 }}, + { 0xc8000000, { 0xfc000000, "bsr", mc88110_disassembler::addressing::D26 }}, + { 0xcc000000, { 0xfc000000, "bsr.n", mc88110_disassembler::addressing::D26 }}, + { 0xd0000000, { 0xfc000000, "bb0", mc88110_disassembler::addressing::D16 }}, + { 0xd4000000, { 0xfc000000, "bb0.n", mc88110_disassembler::addressing::D16 }}, + { 0xd8000000, { 0xfc000000, "bb1", mc88110_disassembler::addressing::D16 }}, + { 0xdc000000, { 0xfc000000, "bb1.n", mc88110_disassembler::addressing::D16 }}, + { 0xe8000000, { 0xfc000000, "bcnd", mc88110_disassembler::addressing::D16 }}, + { 0xec000000, { 0xfc000000, "bcnd.n", mc88110_disassembler::addressing::D16 }}, + { 0xf0001000, { 0xf800ffe0, "ld.d", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0001100, { 0xf800ffe0, "ld.d.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0001200, { 0xf800ffe0, "ld.d", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0001300, { 0xf800ffe0, "ld.d.usr", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0001400, { 0xf800ffe0, "ld", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0001500, { 0xf800ffe0, "ld.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0001600, { 0xf800ffe0, "ld", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0001700, { 0xf800ffe0, "ld.usr", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0001800, { 0xfc00ffe0, "ld.x", mc88110_disassembler::addressing::TRIADIC }}, // XRF only + { 0xf0001900, { 0xfc00ffe0, "ld.x.usr", mc88110_disassembler::addressing::TRIADIC }}, // XRF only + { 0xf0001a00, { 0xfc00ffe0, "ld.x", mc88110_disassembler::addressing::SCALED }}, // XRF only + { 0xf0001b00, { 0xfc00ffe0, "ld.x.usr", mc88110_disassembler::addressing::SCALED }}, // XRF only + { 0xf0002000, { 0xf800ffe0, "st.d", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002080, { 0xf800ffe0, "st.d.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002100, { 0xf800ffe0, "st.d.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002180, { 0xf800ffe0, "st.d.usr.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002200, { 0xf800ffe0, "st.d", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002280, { 0xf800ffe0, "st.d.wt", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002300, { 0xf800ffe0, "st.d.usr", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002380, { 0xf800ffe0, "st.d.usr.wt", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002400, { 0xf800ffe0, "st", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002480, { 0xf800ffe0, "st.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002500, { 0xf800ffe0, "st.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002580, { 0xf800ffe0, "st.usr.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF or XRF + { 0xf0002600, { 0xf800ffe0, "st", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002680, { 0xf800ffe0, "st.wt", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002700, { 0xf800ffe0, "st.usr", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002780, { 0xf800ffe0, "st.usr.wt", mc88110_disassembler::addressing::SCALED }}, // GRF or XRF + { 0xf0002800, { 0xfc00ffe0, "st.x", mc88110_disassembler::addressing::TRIADIC }}, // XRF only + { 0xf0002880, { 0xfc00ffe0, "st.x.wt", mc88110_disassembler::addressing::TRIADIC }}, // XRF only + { 0xf0002900, { 0xfc00ffe0, "st.x.usr", mc88110_disassembler::addressing::TRIADIC }}, // XRF only + { 0xf0002980, { 0xfc00ffe0, "st.x.usr.wt", mc88110_disassembler::addressing::TRIADIC }}, // XRF only + { 0xf0002a00, { 0xfc00ffe0, "st.x", mc88110_disassembler::addressing::SCALED }}, // XRF only + { 0xf0002a80, { 0xfc00ffe0, "st.x.wt", mc88110_disassembler::addressing::SCALED }}, // XRF only + { 0xf0002b00, { 0xfc00ffe0, "st.x.usr", mc88110_disassembler::addressing::SCALED }}, // XRF only + { 0xf0002b80, { 0xfc00ffe0, "st.x.usr.wt", mc88110_disassembler::addressing::SCALED }}, // XRF only + { 0xf0008000, { 0xfc00fc00, "clr", mc88110_disassembler::addressing::BITFIELD }}, + { 0xf0008800, { 0xfc00fc00, "set", mc88110_disassembler::addressing::BITFIELD }}, + { 0xf0009000, { 0xfc00fc00, "ext", mc88110_disassembler::addressing::BITFIELD }}, + { 0xf0009800, { 0xfc00fc00, "extu", mc88110_disassembler::addressing::BITFIELD }}, + { 0xf000a000, { 0xfc00fc00, "mak", mc88110_disassembler::addressing::BITFIELD }}, + { 0xf000a800, { 0xfc00ffe0, "rot", mc88110_disassembler::addressing::BITFIELD }}, + { 0xf000d000, { 0xfc00fe00, "tb0", mc88100_disassembler::addressing::VEC9 }}, + { 0xf000d800, { 0xfc00fe00, "tb1", mc88100_disassembler::addressing::VEC9 }}, + { 0xf000e800, { 0xfc00fe00, "tcnd", mc88100_disassembler::addressing::VEC9 }}, + { 0xf4000000, { 0xfc00ffe0, "xmem.bu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000100, { 0xfc00ffe0, "xmem.bu.usr", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000200, { 0xfc00ffe0, "xmem.bu", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000300, { 0xfc00ffe0, "xmem.bu.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000400, { 0xfc00ffe0, "xmem", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000500, { 0xfc00ffe0, "xmem.usr", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000600, { 0xfc00ffe0, "xmem", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000700, { 0xfc00ffe0, "xmem.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000800, { 0xfc00ffe0, "ld.hu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000900, { 0xfc00ffe0, "ld.hu.usr", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000a00, { 0xfc00ffe0, "ld.hu", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000b00, { 0xfc00ffe0, "ld.hu.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000c00, { 0xfc00ffe0, "ld.bu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000d00, { 0xfc00ffe0, "ld.bu.usr", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4000e00, { 0xfc00ffe0, "ld.bu", mc88110_disassembler::addressing::SCALED }}, + { 0xf4000f00, { 0xfc00ffe0, "ld.bu.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4001800, { 0xfc00ffe0, "ld.h", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4001900, { 0xfc00ffe0, "ld.h.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4001a00, { 0xfc00ffe0, "ld.h", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4001b00, { 0xfc00ffe0, "ld.h.usr", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4001c00, { 0xfc00ffe0, "ld.b", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4001d00, { 0xfc00ffe0, "ld.b.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4001e00, { 0xfc00ffe0, "ld.b", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4001f00, { 0xfc00ffe0, "ld.b.usr", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002800, { 0xfc00ffe0, "st.h", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002880, { 0xfc00ffe0, "st.h.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002900, { 0xfc00ffe0, "st.h.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002980, { 0xfc00ffe0, "st.h.usr.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002a00, { 0xfc00ffe0, "st.h", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002a80, { 0xfc00ffe0, "st.h.wt", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002b00, { 0xfc00ffe0, "st.h.usr", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002b80, { 0xfc00ffe0, "st.h.usr.wt", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002c00, { 0xfc00ffe0, "st.b", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002c80, { 0xfc00ffe0, "st.b.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002d00, { 0xfc00ffe0, "st.b.usr", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002d80, { 0xfc00ffe0, "st.b.usr.wt", mc88110_disassembler::addressing::TRIADIC }}, // GRF only + { 0xf4002e00, { 0xfc00ffe0, "st.b", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002e80, { 0xfc00ffe0, "st.b.wt", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002f00, { 0xfc00ffe0, "st.b.usr", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4002f80, { 0xfc00ffe0, "st.b.usr.wt", mc88110_disassembler::addressing::SCALED }}, // GRF only + { 0xf4003200, { 0xfc00ffe0, "lda.d", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003300, { 0xfc00ffe0, "lda.d.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003600, { 0xfc00ffe0, "lda", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003700, { 0xfc00ffe0, "lda.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003a00, { 0xfc00ffe0, "lda.h", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003b00, { 0xfc00ffe0, "lda.h.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003e00, { 0xfc00ffe0, "lda.x", mc88110_disassembler::addressing::SCALED }}, + { 0xf4003f00, { 0xfc00ffe0, "lda.x.usr", mc88110_disassembler::addressing::SCALED }}, + { 0xf4004000, { 0xfc00ffe0, "and", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4004400, { 0xfc00ffe0, "and.c", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4005000, { 0xfc00ffe0, "xor", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4005400, { 0xfc00ffe0, "xor.c", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4005800, { 0xfc00ffe0, "or", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4005c00, { 0xfc00ffe0, "or.c", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006000, { 0xfc00ffe0, "addu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006100, { 0xfc00ffe0, "addu.co", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006200, { 0xfc00ffe0, "addu.ci", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006300, { 0xfc00ffe0, "addu.cio", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006400, { 0xfc00ffe0, "subu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006500, { 0xfc00ffe0, "subu.co", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006600, { 0xfc00ffe0, "subu.ci", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006700, { 0xfc00ffe0, "subu.cio", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006800, { 0xfc00ffe0, "divu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006900, { 0xfc00ffe0, "divu.d", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006c00, { 0xfc00ffe0, "mulu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006d00, { 0xfc00ffe0, "mulu.d", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4006e00, { 0xfc00ffe0, "muls", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007000, { 0xfc00ffe0, "add", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007100, { 0xfc00ffe0, "add.co", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007200, { 0xfc00ffe0, "add.ci", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007300, { 0xfc00ffe0, "add.cio", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007400, { 0xfc00ffe0, "sub", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007500, { 0xfc00ffe0, "sub.co", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007600, { 0xfc00ffe0, "sub.ci", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007700, { 0xfc00ffe0, "sub.cio", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007800, { 0xfc00ffe0, "divs", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4007c00, { 0xfc00ffe0, "cmp", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4008000, { 0xfc00ffe0, "clr", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4008800, { 0xfc00ffe0, "set", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4009000, { 0xfc00ffe0, "ext", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf4009800, { 0xfc00ffe0, "extu", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf400a000, { 0xfc00ffe0, "mak", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf400a800, { 0xfc00ffe0, "rot", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf400c000, { 0xffffffe0, "jmp", mc88110_disassembler::addressing::JUMP }}, + { 0xf400c400, { 0xffffffe0, "jmp.n", mc88110_disassembler::addressing::JUMP }}, + { 0xf400c800, { 0xffffffe0, "jsr", mc88110_disassembler::addressing::JUMP }}, + { 0xf400cc00, { 0xffffffe0, "jsr.n", mc88110_disassembler::addressing::JUMP }}, + { 0xf400e000, { 0xfc1fffe0, "ff1", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf400e800, { 0xfc1fffe0, "ff0", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf400f800, { 0xffe0ffe0, "tbnd", mc88110_disassembler::addressing::TRIADIC }}, + { 0xf400fc00, { 0xffffffff, "rte", mc88110_disassembler::addressing::NONE }}, + { 0xf400fc01, { 0xffffffff, "illop1", mc88110_disassembler::addressing::NONE }}, + { 0xf400fc02, { 0xffffffff, "illop2", mc88110_disassembler::addressing::NONE }}, + { 0xf400fc03, { 0xffffffff, "illop3", mc88110_disassembler::addressing::NONE }}, + { 0xf8000000, { 0xffe00000, "tbnd", mc88110_disassembler::addressing::IMM16 }} +}; + +u32 m88000_disassembler::opcode_alignment() const +{ + return 4; +} + +void mc88100_disassembler::format_gcr(std::ostream &stream, u8 cr) +{ + switch (cr) + { + case 0: + // Processor identification register + stream << "pid"; + break; + + case 1: + // Processor status register + stream << "psr"; + break; + + case 2: + // Exception time processor status register + stream << "epsr"; + break; + + case 3: + // Shadow scoreboard register + stream << "ssbr"; + break; + + case 4: + // Shadow execute instruction pointer + stream << "sxip"; + break; + + case 5: + // Shadow next instruction pointer + stream << "snip"; + break; + + case 6: + // Shadow fetched instruction pointer + stream << "sfip"; + break; + + case 7: + // Vector base register + stream << "vbr"; + break; + + case 8: case 11: case 14: + // Transaction registers 0–2 + util::stream_format(stream, "dmt%d", (cr - 8) / 3); + break; + + case 9: case 12: case 15: + // Data registers 0–2 + util::stream_format(stream, "dmd%d", (cr - 9) / 3); + break; + + case 10: case 13: case 16: + // Address registers 0–2 + util::stream_format(stream, "dma%d", (cr - 9) / 3); + break; + + case 17: case 18: case 19: case 20: + // Supervisor storage registers 0–3 + util::stream_format(stream, "sr%d", cr - 17); + break; + + default: + util::stream_format(stream, "cr%d", cr); + break; + } +} + +void mc88110_disassembler::format_gcr(std::ostream &stream, u8 cr) +{ + switch (cr) + { + case 0: + // Processor identification + stream << "pid"; + break; + + case 1: + // Processor status register + stream << "psr"; + break; + + case 2: + // Exception processor status register + stream << "epsr"; + break; + + case 4: + // Exception executing instruction pointer + stream << "exip"; + break; + + case 5: + // Exception next instruction pointer + stream << "enip"; + break; + + case 7: + // Vector base register + stream << "vbr"; + break; + + case 16: case 17: case 18: case 19: case 20: + // Storage registers 0–4 + util::stream_format(stream, "sr%d", cr - 16); + break; + + case 25: + // Instruction MMU/cache/TIC command + stream << "icmd"; + break; + + case 26: + // Instruction MMU/cache control + stream << "ictl"; + break; + + case 27: + // Instruction system address + stream << "isar"; + break; + + case 28: + // Instruction MMU supervisor address pointer + stream << "isap"; + break; + + case 29: + // Instruction MMU user area pointer + stream << "iuap"; + break; + + case 30: + // Instruction MMU ATC index register + stream << "iir"; + break; + + case 31: + // Instruction MMU BATC R/W port + stream << "ibp"; + break; + + case 32: + // Instruction MMU PATC R/W port (upper) + stream << "ippu"; + break; + + case 33: + // Instruction MMU PATC R/W port (lower) + stream << "ippl"; + break; + + case 34: + // Instruction access status register + stream << "isr"; + break; + + case 35: + // Instruction access logical address + stream << "ilar"; + break; + + case 36: + // Instruction access physical address + stream << "ipar"; + break; + + case 40: + // Data MMU/cache command + stream << "dcmd"; + break; + + case 41: + // Data MMU/cache control + stream << "dctl"; + break; + + case 42: + // Data system address register + stream << "dsar"; + break; + + case 43: + // Data MMU supervisor area pointer + stream << "dsap"; + break; + + case 44: + // Data MMU user area pointer + stream << "duap"; + break; + + case 45: + // Data MMU ATC index register + stream << "dir"; + break; + + case 46: + // Data MMU BATC R/W port + stream << "dbp"; + break; + + case 47: + // Data MMU PATC R/W port (upper) + stream << "dppu"; + break; + + case 48: + // Data MMU PATC R/W port (lower) + stream << "dppl"; + break; + + case 49: + // Data access status register + stream << "dsr"; + break; + + case 50: + // Data access logical address + stream << "dlar"; + break; + + case 51: + // Data access physical address + stream << "dpar"; + break; + + default: + util::stream_format(stream, "cr%d", cr); + break; + } +} + +void mc88100_disassembler::format_fcr(std::ostream &stream, u8 cr) +{ + switch (cr) + { + case 0: + // Floating-point exception cause register (privileged) + stream << "fpecr"; + break; + + case 1: case 3: + // Floating-point source 1/2 operand high register (privileged) + util::stream_format(stream, "fphs%d", (cr - 1) / 2); + break; + + case 2: case 4: + // Floating-point source 1/2 operand low register (privileged) + util::stream_format(stream, "fpls%d", (cr - 2) / 2); + break; + + case 5: + // Floating-point precise operation type register (privileged) + stream << "fppt"; + break; + + case 6: + // Floating-point result high register (privileged) + stream << "fprh"; + break; + + case 7: + // Floating-point result low register (privileged) + stream << "fprl"; + break; + + case 8: + // Floating-point precise operation type register (privileged) + stream << "fpit"; + break; + + case 62: + // Floating-point user status register + stream << "fpsr"; + break; + + case 63: + // Floating-point user control register + stream << "fpcr"; + break; + + default: + util::stream_format(stream, "fcr%d", cr); + break; + } +} + +void mc88110_disassembler::format_fcr(std::ostream &stream, u8 cr) +{ + switch (cr) + { + case 0: + // Floating-point exception cause register (privileged) + stream << "fpecr"; + break; + + case 62: + // Floating-point status register + stream << "fpsr"; + break; + + case 63: + // Floating-point control register + stream << "fpcr"; + break; + + default: + util::stream_format(stream, "fcr%d", cr); + break; + } +} + +void m88000_disassembler::format_condition(std::ostream &stream, u8 cnd) +{ + switch (cnd) + { + case 0x01: + stream << "gt0"; + break; + + case 0x02: + stream << "eq0"; + break; + + case 0x03: + stream << "ge0"; + break; + + case 0x0c: + stream << "lt0"; + break; + + case 0x0d: + stream << "ne0"; + break; + + case 0x0e: + stream << "le0"; + break; + + default: + util::stream_format(stream, "$%02x", cnd); + break; + } +} + +offs_t m88000_disassembler::dasm_triadic(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Triadic register addressing + util::stream_format(stream, "%-12s", mnemonic); + if ((inst & 0xf800f800) != 0xf000f800) + util::stream_format(stream, "%c%d,", BIT(inst, 26) ? 'r' : 'x', (inst & 0x03e00000) >> 21); + if ((inst & 0xf800f000) != 0xf000e000) + { + util::stream_format(stream, "r%d", (inst & 0x001f0000) >> 16); + if ((inst & 0xfc00f800) != 0x88006800) + stream << ","; + } + if ((inst & 0xfc00f800) != 0x88006800) + util::stream_format(stream, "r%d", inst & 0x0000001f); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_fp(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Triadic register addressing (floating-point instructions) + if ((inst & 0xfc006000) == 0x84004000) + { + util::stream_format(stream, "%-12s%c%d,", mnemonic, + (inst & 0xfc007e00) == 0x84004200 ? 'x' : 'r', + (inst & 0x03e00000) >> 21); + } + else + { + util::stream_format(stream, "%-12s%c%d,", mnemonic, + BIT(inst, 15) && (inst & 0xfc007800) != 0x84003800 ? 'x' : 'r', + (inst & 0x03e00000) >> 21); + if ((inst & 0xfc007800) != 0x84000800 && (inst & 0xfc007800) != 0x84002000 && (inst & 0xfc007800) != 0x84007800) + util::stream_format(stream, "%c%d,", BIT(inst, 15) ? 'x' : 'r', (inst & 0x001f0000) >> 16); + } + util::stream_format(stream, "%c%d,", BIT(inst, 15) ? 'x' : 'r', inst & 0x0000001f); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_imm6(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Register with 6-bit immediate addressing + util::stream_format(stream, "%-12sr%d,r%d,<%d>", + BIT(inst, 26) ? 'r' : 'x', + (inst & 0x03e00000) >> 21, + (inst & 0x001f0000) >> 16, + (inst & 0x000007e0) >> 5); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_bitfield(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Register with 10-bit immediate addressing + util::stream_format(stream, "%-12sr%d,r%d,", mnemonic, + (inst & 0x03e00000) >> 21, + (inst & 0x001f0000) >> 16); + if ((inst & 0xfc00fc00) != 0xf000a800 && (inst & 0x000003e0) != 0) + util::stream_format(stream, "%d", (inst & 0x000003e0) >> 5); + util::stream_format(stream, "<%d>", inst & 0x0000001f); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_simm16(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Register with 16-bit signed immediate addressing + util::stream_format(stream, "%-12sr%d,r%d,", mnemonic, + (inst & 0x03e00000) >> 21, + (inst & 0x001f0000) >> 16); + if (BIT(inst, 15)) + util::stream_format(stream, "-$%x", 0x10000 - (inst & 0x0000ffff)); + else + util::stream_format(stream, "$%x", inst & 0x0000ffff); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_imm16(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Register with 16-bit unsigned immediate addressing + util::stream_format(stream, "%-12s", mnemonic); + if ((inst & 0xfc000000) != 0xf8000000) + util::stream_format(stream, "r%d,", (inst & 0x03e00000) >> 21); + util::stream_format(stream, "r%d,", (inst & 0x001f0000) >> 16); + if (inst >= 0x40000000) + util::stream_format(stream, "$%04x", inst & 0x0000ffff); + else + util::stream_format(stream, "$%x", inst & 0x0000ffff); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_cr(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Control register addressing + util::stream_format(stream, "%-12s", mnemonic); + if (BIT(inst, 14)) + util::stream_format(stream, "r%d,", (inst & 0x03e00000) >> 21); + if (BIT(inst, 15)) + { + // S1 and S2 must be the same + if ((inst & 0x001f0000) >> 16 != (inst & 0x0000001f)) + stream << "r<mismatch>,"; + else + util::stream_format(stream, "r%d,", inst & 0x0000001f); + } + + switch ((inst & 0x00003800) >> 11) + { + case 0: + format_gcr(stream, (inst & 0x000007e0) >> 5); + break; + + case 1: + format_fcr(stream, (inst & 0x000007e0) >> 5); + break; + + default: + util::stream_format(stream, "SFU%d_cr%d", (inst & 0x00003800) >> 11, (inst & 0x000007e0) >> 5); + break; + } + + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_si16(std::ostream &stream, const char *mnemonic, u32 inst, bool xrf) +{ + // Register indirect with extended immediate index + util::stream_format(stream, "%-12s%c%d,r%d,", mnemonic, + xrf ? 'x' : 'r', + (inst & 0x03e00000) >> 21, + (inst & 0x001f0000) >> 16); + if (BIT(inst, 15)) + util::stream_format(stream, "-$%x", 0x10000 - (inst & 0x0000ffff)); + else + util::stream_format(stream, "$%x", inst & 0x0000ffff); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_scaled(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Register indirect with scaled index + util::stream_format(stream, "%-12s%c%d,r%d[r%d]", mnemonic, + BIT(inst, 26) ? 'r' : 'x', + (inst & 0x03e00000) >> 21, + (inst & 0x001f0000) >> 16, + inst & 0x0000001f); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_jump(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Triadic register addressing (jump instructions) + util::stream_format(stream, "%-12sr%d", mnemonic, inst & 0x0000001f); + + // Set flags for jump to subroutine, return to r1 and/or optional delay slot + return 4 | SUPPORTED | + ((inst & 0x0000081f) == 0x00000001 ? STEP_OUT : 0) | + (BIT(inst, 11) ? STEP_OVER : 0) | + (BIT(inst, 10) ? STEP_OVER | step_over_extra(1) : 0); +} + +offs_t m88000_disassembler::dasm_vec9(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // Register with 9-bit vector table index + util::stream_format(stream, "%-12s", mnemonic); + if (BIT(inst, 12)) + util::stream_format(stream, "%d", (inst & 0x03e00000) >> 21); + else + format_condition(stream, (inst & 0x03e00000) >> 21); + util::stream_format(stream, ",r%d,$%03x", (inst & 0x001f0000) >> 16, inst & 0x000001ff); + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::dasm_d16(std::ostream &stream, const char *mnemonic, u32 inst, offs_t pc) +{ + // Register with 16-bit displacement + s32 disp = s16(inst & 0x0000ffff) * 4; + util::stream_format(stream, "%-12s", mnemonic); + if (BIT(inst, 28)) + util::stream_format(stream, "%d", (inst & 0x03e00000) >> 21); + else + format_condition(stream, (inst & 0x03e00000) >> 21); + util::stream_format(stream, ",r%d,$%08x", (inst & 0x001f0000) >> 16, pc + disp); + + // Set flags for optional delay slot + return 4 | SUPPORTED | (BIT(inst, 26) ? STEP_OVER | step_over_extra(1) : 0); +} + +offs_t m88000_disassembler::dasm_d26(std::ostream &stream, const char *mnemonic, u32 inst, offs_t pc) +{ + // 26-bit branch displacement + s32 disp = (inst & 0x03ffffff) * 4 - (BIT(inst, 25) ? 0x10000000 : 0); + util::stream_format(stream, "%-12s$%08x", mnemonic, pc + disp); + + // Set flags for branch to subroutine and/or optional delay slot + return 4 | SUPPORTED | + (BIT(inst, 27) ? STEP_OVER : 0) | + (BIT(inst, 26) ? STEP_OVER | step_over_extra(1) : 0); +} + +offs_t m88000_disassembler::dasm_none(std::ostream &stream, const char *mnemonic, u32 inst) +{ + // No operands indicated + stream << mnemonic; + + // Set flags for return-from-exception instruction + return 4 | SUPPORTED | ((inst & 0xfc00ffe0) == 0xf400fc00 ? STEP_OUT : 0); +} + +offs_t m88000_disassembler::dasm_illop(std::ostream &stream, u32 inst) +{ + // Illegal operation (at least probably illegal) + util::stream_format(stream, "%-12s$%08x", "illop", inst); + + // SFU-specific + if ((inst & 0xe0000000) == 0x80000000) + util::stream_format(stream, " ; SFU%d unimplemented", (inst & 0x1c000000) >> 26); + + return 4 | SUPPORTED; +} + +offs_t m88000_disassembler::disassemble(std::ostream &stream, offs_t pc, const m88000_disassembler::data_buffer &opcodes, const m88000_disassembler::data_buffer ¶ms) +{ + u32 inst = opcodes.r32(pc); + auto j = m_ops.upper_bound(inst); + for (auto i = m_ops.lower_bound(inst & 0xf8000000); i != j; ++i) + { + if ((inst & i->second.mask) == i->first) + { + switch (i->second.mode) + { + case addressing::TRIADIC: + return dasm_triadic(stream, i->second.mnemonic, inst); + + case addressing::FP: + return dasm_fp(stream, i->second.mnemonic, inst); + + case addressing::IMM6: + return dasm_imm6(stream, i->second.mnemonic, inst); + + case addressing::BITFIELD: + return dasm_bitfield(stream, i->second.mnemonic, inst); + + case addressing::SIMM16: + return dasm_simm16(stream, i->second.mnemonic, inst); + + case addressing::IMM16: + return dasm_imm16(stream, i->second.mnemonic, inst); + + case addressing::CR: + return dasm_cr(stream, i->second.mnemonic, inst); + + case addressing::SI16_GRF: + return dasm_si16(stream, i->second.mnemonic, inst, false); + + case addressing::SI16_XRF: + return dasm_si16(stream, i->second.mnemonic, inst, true); + + case addressing::SCALED: + return dasm_scaled(stream, i->second.mnemonic, inst); + + case addressing::JUMP: + return dasm_jump(stream, i->second.mnemonic, inst); + + case addressing::VEC9: + return dasm_vec9(stream, i->second.mnemonic, inst); + + case addressing::D16: + return dasm_d16(stream, i->second.mnemonic, inst, pc); + + case addressing::D26: + return dasm_d26(stream, i->second.mnemonic, inst, pc); + + case addressing::NONE: + return dasm_none(stream, i->second.mnemonic, inst); + } + } + } + + return dasm_illop(stream, inst); +} diff --git a/src/devices/cpu/m88000/m88000d.h b/src/devices/cpu/m88000/m88000d.h new file mode 100644 index 00000000000..8bf421fa97c --- /dev/null +++ b/src/devices/cpu/m88000/m88000d.h @@ -0,0 +1,106 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_M88000_M88000D_H +#define MAME_CPU_M88000_M88000D_H + +#pragma once + +#include <map> + +class m88000_disassembler : public util::disasm_interface +{ +protected: + enum class addressing + { + TRIADIC, + FP, + IMM6, + BITFIELD, + SIMM16, + IMM16, + CR, + SI16_GRF, + SI16_XRF, + SCALED, + JUMP, + VEC9, + D16, + D26, + NONE + }; + + struct instruction + { + u32 mask; + const char *mnemonic; + addressing mode; + }; + + // construction/destruction + m88000_disassembler(const std::map<u32, const m88000_disassembler::instruction> &ops); + + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + + // control register helpers + virtual void format_gcr(std::ostream &stream, u8 cr) = 0; + virtual void format_fcr(std::ostream &stream, u8 cr) = 0; + +private: + void format_condition(std::ostream &stream, u8 cnd); + + // disassembly helpers + offs_t dasm_triadic(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_fp(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_imm6(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_bitfield(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_simm16(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_imm16(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_cr(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_si16(std::ostream &stream, const char *mnemonic, u32 inst, bool xrf); + offs_t dasm_scaled(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_jump(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_vec9(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_d16(std::ostream &stream, const char *mnemonic, u32 inst, offs_t pc); + offs_t dasm_d26(std::ostream &stream, const char *mnemonic, u32 inst, offs_t pc); + offs_t dasm_none(std::ostream &stream, const char *mnemonic, u32 inst); + offs_t dasm_illop(std::ostream &stream, u32 inst); + + const std::map<u32, const instruction> &m_ops; +}; + +class mc88100_disassembler : public m88000_disassembler +{ +public: + // construction/destruction + mc88100_disassembler(); + +protected: + // control register helpers + virtual void format_gcr(std::ostream &stream, u8 cr) override; + virtual void format_fcr(std::ostream &stream, u8 cr) override; + +private: + // decode map + static const std::map<u32, const instruction> s_ops; +}; + +class mc88110_disassembler : public m88000_disassembler +{ +public: + // construction/destruction + mc88110_disassembler(); + +protected: + // control register helpers + virtual void format_gcr(std::ostream &stream, u8 cr) override; + virtual void format_fcr(std::ostream &stream, u8 cr) override; + +private: + // decode map + static const std::map<u32, const instruction> s_ops; +}; + +#endif // MAME_CPU_M88000_M88000D_H diff --git a/src/devices/cpu/mips/mips1.cpp b/src/devices/cpu/mips/mips1.cpp index c2a34e47e73..26260b836b4 100644 --- a/src/devices/cpu/mips/mips1.cpp +++ b/src/devices/cpu/mips/mips1.cpp @@ -54,9 +54,9 @@ DEFINE_DEVICE_TYPE(R3071, r3071_device, "r3071", "IDT R3071") DEFINE_DEVICE_TYPE(R3081, r3081_device, "r3081", "IDT R3081") DEFINE_DEVICE_TYPE(SONYPS2_IOP, iop_device, "sonyiop", "Sony Playstation 2 IOP") -ALLOW_SAVE_TYPE(mips1core_device_base::branch_state_t); +ALLOW_SAVE_TYPE(mips1core_device_base::branch_state); -mips1core_device_base::mips1core_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size) +mips1core_device_base::mips1core_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config_be("program", ENDIANNESS_BIG, 32, 32) , m_program_config_le("program", ENDIANNESS_LITTLE, 32, 32) @@ -71,64 +71,64 @@ mips1core_device_base::mips1core_device_base(const machine_config &mconfig, devi { } -mips1_device_base::mips1_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size) +mips1_device_base::mips1_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size) : mips1core_device_base(mconfig, type, tag, owner, clock, cpurev, icache_size, dcache_size) , m_fcr0(0) { } -r2000_device::r2000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) +r2000_device::r2000_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) : mips1_device_base(mconfig, R2000, tag, owner, clock, 0x0100, icache_size, dcache_size) { } -r2000a_device::r2000a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) +r2000a_device::r2000a_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) : mips1_device_base(mconfig, R2000A, tag, owner, clock, 0x0210, icache_size, dcache_size) { } -r3000_device::r3000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) +r3000_device::r3000_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) : mips1_device_base(mconfig, R3000, tag, owner, clock, 0x0220, icache_size, dcache_size) { } -r3000a_device::r3000a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) +r3000a_device::r3000a_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) : mips1_device_base(mconfig, R3000A, tag, owner, clock, 0x0230, icache_size, dcache_size) { } -r3041_device::r3041_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) +r3041_device::r3041_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : mips1core_device_base(mconfig, R3041, tag, owner, clock, 0x0700, 2048, 512) { } -r3051_device::r3051_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) +r3051_device::r3051_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : mips1core_device_base(mconfig, R3051, tag, owner, clock, 0x0200, 4096, 2048) { } -r3052_device::r3052_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) +r3052_device::r3052_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : mips1core_device_base(mconfig, R3052, tag, owner, clock, 0x0200, 8192, 2048) { } -r3052e_device::r3052e_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) +r3052e_device::r3052e_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : mips1_device_base(mconfig, R3052E, tag, owner, clock, 0x0200, 8192, 2048) { } -r3071_device::r3071_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) +r3071_device::r3071_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) : mips1_device_base(mconfig, R3071, tag, owner, clock, 0x0200, icache_size, dcache_size) { } -r3081_device::r3081_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) +r3081_device::r3081_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size, size_t dcache_size) : mips1_device_base(mconfig, R3081, tag, owner, clock, 0x0200, icache_size, dcache_size) { set_fpu(0x0300); } -iop_device::iop_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) +iop_device::iop_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : mips1core_device_base(mconfig, SONYPS2_IOP, tag, owner, clock, 0x001f, 4096, 1024) { m_endianness = ENDIANNESS_LITTLE; @@ -184,6 +184,8 @@ void mips1core_device_base::device_start() // initialise cpu id register m_cop0[COP0_PRId] = m_cpurev; + m_cop0[COP0_Cause] = 0; + m_r[0] = 0; } @@ -197,6 +199,10 @@ void r3041_device::device_start() state_add(MIPS1_COP0 + COP0_Count, "Count", m_cop0[COP0_Count]); state_add(MIPS1_COP0 + COP0_PortSize, "PortSize", m_cop0[COP0_PortSize]); state_add(MIPS1_COP0 + COP0_Compare, "Compare", m_cop0[COP0_Compare]); + + m_cop0[COP0_BusCtrl] = 0x20130b00U; + m_cop0[COP0_Config] = 0x40000000U; + m_cop0[COP0_PortSize] = 0; } void mips1core_device_base::device_reset() @@ -212,6 +218,14 @@ void mips1core_device_base::device_reset() m_bus_error = false; } +void r3041_device::device_reset() +{ + mips1core_device_base::device_reset(); + + m_cop0[COP0_Count] = 0; + m_cop0[COP0_Compare] = 0x00ffffffU; +} + void mips1core_device_base::execute_run() { // core execution loop @@ -649,13 +663,8 @@ bool mips1core_device_base::memory_translate(int spacenum, int intention, offs_t } else if (SR & SR_KUc) { - if (!machine().side_effects_disabled()) - { - // exception - m_cop0[COP0_BadVAddr] = address; + address_error(intention, address); - generate_exception((intention & TRANSLATE_WRITE) ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD); - } return false; } } @@ -861,6 +870,21 @@ void mips1core_device_base::generate_exception(u32 exception, bool refill) debugger_privilege_hook(); } +void mips1core_device_base::address_error(int intention, u32 const address) +{ + if (!machine().side_effects_disabled() && !(intention & TRANSLATE_DEBUG_MASK)) + { + logerror("address_error 0x%08x (%s)\n", address, machine().describe_context()); + + m_cop0[COP0_BadVAddr] = address; + + generate_exception((intention & TRANSLATE_WRITE) ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD); + + // address errors shouldn't typically occur, so a breakpoint is handy + machine().debug_break(); + } +} + void mips1core_device_base::handle_cop0(u32 const op) { switch (RSREG) @@ -1032,7 +1056,7 @@ void mips1core_device_base::handle_cop3(u32 const op) void mips1core_device_base::lwl(u32 const op) { offs_t const offset = SIMMVAL + m_r[RSREG]; - load<u32>(offset & ~3, [this, op, offset](u32 temp) + load<u32, false>(offset, [this, op, offset](u32 temp) { unsigned const shift = ((offset & 3) ^ ENDIAN_VALUE_LE_BE(m_endianness, 3, 0)) << 3; @@ -1043,7 +1067,7 @@ void mips1core_device_base::lwl(u32 const op) void mips1core_device_base::lwr(u32 const op) { offs_t const offset = SIMMVAL + m_r[RSREG]; - load<u32>(offset & ~3, [this, op, offset](u32 temp) + load<u32, false>(offset, [this, op, offset](u32 temp) { unsigned const shift = ((offset & 0x3) ^ ENDIAN_VALUE_LE_BE(m_endianness, 0, 3)) << 3; @@ -1056,7 +1080,7 @@ void mips1core_device_base::swl(u32 const op) offs_t const offset = SIMMVAL + m_r[RSREG]; unsigned const shift = ((offset & 3) ^ ENDIAN_VALUE_LE_BE(m_endianness, 3, 0)) << 3; - store<u32>(offset & ~3, m_r[RTREG] >> shift, 0xffffffffU >> shift); + store<u32, false>(offset, m_r[RTREG] >> shift, 0xffffffffU >> shift); } void mips1core_device_base::swr(u32 const op) @@ -1064,13 +1088,24 @@ void mips1core_device_base::swr(u32 const op) offs_t const offset = SIMMVAL + m_r[RSREG]; unsigned const shift = ((offset & 3) ^ ENDIAN_VALUE_LE_BE(m_endianness, 0, 3)) << 3; - store<u32>(offset & ~3, m_r[RTREG] << shift, 0xffffffffU << shift); + store<u32, false>(offset, m_r[RTREG] << shift, 0xffffffffU << shift); } -template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, void> mips1core_device_base::load(u32 address, U &&apply) +template <typename T, bool Aligned, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, void> mips1core_device_base::load(u32 address, U &&apply) { + // alignment error + if (Aligned && (address & (sizeof(T) - 1))) + { + address_error(TRANSLATE_READ, address); + return; + } + if (memory_translate(m_data_spacenum, TRANSLATE_READ, address)) { + // align address for ld[lr] instructions + if (!Aligned) + address &= ~(sizeof(T) - 1); + T const data = (sizeof(T) == 1) ? space(m_data_spacenum).read_byte(address) : (sizeof(T) == 2) ? space(m_data_spacenum).read_word(address) @@ -1086,10 +1121,21 @@ template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::f } } -template <typename T, typename U> std::enable_if_t<std::is_convertible<U, T>::value, void> mips1core_device_base::store(u32 address, U data, T mem_mask) +template <typename T, bool Aligned, typename U> std::enable_if_t<std::is_convertible<U, T>::value, void> mips1core_device_base::store(u32 address, U data, T mem_mask) { + // alignment error + if (Aligned && (address & (sizeof(T) - 1))) + { + address_error(TRANSLATE_WRITE, address); + return; + } + if (memory_translate(m_data_spacenum, TRANSLATE_WRITE, address)) { + // align address for sd[lr] instructions + if (!Aligned) + address &= ~(sizeof(T) - 1); + switch (sizeof(T)) { case 1: space(m_data_spacenum).write_byte(address, T(data)); break; @@ -1101,6 +1147,13 @@ template <typename T, typename U> std::enable_if_t<std::is_convertible<U, T>::va bool mips1core_device_base::fetch(u32 address, std::function<void(u32)> &&apply) { + // alignment error + if (address & 3) + { + address_error(TRANSLATE_FETCH, address); + return false; + } + if (memory_translate(0, TRANSLATE_FETCH, address)) { u32 const data = space(0).read_dword(address); @@ -1913,13 +1966,8 @@ bool mips1_device_base::memory_translate(int spacenum, int intention, offs_t &ad } else if (SR & SR_KUc) { - if (!machine().side_effects_disabled()) - { - // exception - m_cop0[COP0_BadVAddr] = address; + address_error(intention, address); - generate_exception((intention & TRANSLATE_WRITE) ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD); - } return false; } } diff --git a/src/devices/cpu/mips/mips1.h b/src/devices/cpu/mips/mips1.h index b3cdeedcdf3..1abff01bc86 100644 --- a/src/devices/cpu/mips/mips1.h +++ b/src/devices/cpu/mips/mips1.h @@ -17,7 +17,7 @@ public: void berr_w(int state) { m_bus_error = bool(state); } protected: - mips1core_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size); + mips1core_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size); enum registers : unsigned { @@ -172,8 +172,9 @@ protected: void icache_map(address_map &map); void dcache_map(address_map &map); - // interrupts + // exceptions void generate_exception(u32 exception, bool refill = false); + void address_error(int intention, u32 const address); // cop0 virtual void handle_cop0(u32 const op); @@ -192,8 +193,8 @@ protected: void swr(u32 const op); // memory accessors - template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, void> load(u32 address, U &&apply); - template <typename T, typename U> std::enable_if_t<std::is_convertible<U, T>::value, void> store(u32 address, U data, T mem_mask = ~T(0)); + template <typename T, bool Aligned = true, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, void> load(u32 address, U &&apply); + template <typename T, bool Aligned = true, typename U> std::enable_if_t<std::is_convertible<U, T>::value, void> store(u32 address, U data, T mem_mask = ~T(0)); bool fetch(u32 address, std::function<void(u32)> &&apply); // debug helpers @@ -201,10 +202,10 @@ protected: std::string debug_string_array(u32 array_pointer); // address spaces - const address_space_config m_program_config_be; - const address_space_config m_program_config_le; - const address_space_config m_icache_config; - const address_space_config m_dcache_config; + address_space_config const m_program_config_be; + address_space_config const m_program_config_le; + address_space_config const m_icache_config; + address_space_config const m_dcache_config; int m_data_spacenum; @@ -223,7 +224,7 @@ protected: // internal stuff int m_icount; - enum branch_state_t : unsigned + enum branch_state : unsigned { NONE = 0, DELAY = 1, // delay slot instruction active @@ -246,7 +247,7 @@ class mips1_device_base : public mips1core_device_base { public: // floating point coprocessor revision numbers recognised by RISC/os 4.52 and IRIX - enum fpu_rev_t : u32 + enum fpu_rev : u32 { MIPS_R2360 = 0x0100, // MIPS R2360 Floating Point Board MIPS_R2010 = 0x0200, // MIPS R2010 VLSI Floating Point Chip @@ -260,7 +261,7 @@ public: void set_fpu(u32 revision, unsigned interrupt = 3) { m_fcr0 = revision; m_fpu_irq = interrupt; } protected: - mips1_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size); + mips1_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, u32 cpurev, size_t icache_size, size_t dcache_size); enum cp1_fcr31_mask : u32 { @@ -323,70 +324,71 @@ private: class r2000_device : public mips1_device_base { public: - r2000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); + r2000_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); }; class r2000a_device : public mips1_device_base { public: - r2000a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); + r2000a_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); }; class r3000_device : public mips1_device_base { public: - r3000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); + r3000_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); }; class r3000a_device : public mips1_device_base { public: - r3000a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); + r3000a_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size = 0, size_t dcache_size = 0); }; class r3041_device : public mips1core_device_base { public: - r3041_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + r3041_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); protected: virtual void device_start() override; + virtual void device_reset() override; }; class r3051_device : public mips1core_device_base { public: - r3051_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + r3051_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); }; class r3052_device : public mips1core_device_base { public: - r3052_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + r3052_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); }; class r3052e_device : public mips1_device_base { public: - r3052e_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + r3052e_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); }; class r3071_device : public mips1_device_base { public: - r3071_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size = 16384, size_t dcache_size = 4096); + r3071_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size = 16384, size_t dcache_size = 4096); }; class r3081_device : public mips1_device_base { public: - r3081_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, size_t icache_size = 16384, size_t dcache_size = 4096); + r3081_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, size_t icache_size = 16384, size_t dcache_size = 4096); }; class iop_device : public mips1core_device_base { public: - iop_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + iop_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); }; DECLARE_DEVICE_TYPE(R2000, r2000_device) diff --git a/src/devices/cpu/mips/r4000.cpp b/src/devices/cpu/mips/r4000.cpp index 7b26493f61c..13f75f47ed5 100644 --- a/src/devices/cpu/mips/r4000.cpp +++ b/src/devices/cpu/mips/r4000.cpp @@ -85,7 +85,7 @@ DEFINE_DEVICE_TYPE(R4000, r4000_device, "r4000", "MIPS R4000") DEFINE_DEVICE_TYPE(R4400, r4400_device, "r4400", "MIPS R4400") DEFINE_DEVICE_TYPE(R4600, r4600_device, "r4600", "QED R4600") -r4000_base_device::r4000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 prid, u32 fcr, cache_size_t icache_size, cache_size_t dcache_size) +r4000_base_device::r4000_base_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, u32 prid, u32 fcr, cache_size icache_size, cache_size dcache_size) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config_le("program", ENDIANNESS_LITTLE, 64, 32) , m_program_config_be("program", ENDIANNESS_BIG, 64, 32) @@ -189,14 +189,20 @@ void r4000_base_device::device_reset() { m_branch_state = NONE; m_pc = s64(s32(0xbfc00000)); + m_r[0] = 0; + + if (m_hard_reset) + m_cp0[CP0_Status] = SR_BEV | SR_ERL; + else + m_cp0[CP0_Status] = SR_BEV | SR_ERL | SR_SR; - m_cp0[CP0_Status] = SR_BEV | SR_ERL; m_cp0[CP0_Wired] = 0; m_cp0[CP0_Compare] = 0; m_cp0[CP0_Count] = 0; m_cp0_timer_zero = total_cycles(); + m_hard_reset = false; m_ll_active = false; m_bus_error = false; @@ -240,7 +246,7 @@ bool r4000_base_device::memory_translate(int spacenum, int intention, offs_t &ad // FIXME: address truncation u64 placeholder = s32(address); - translate_t const t = translate(intention, placeholder); + translate_result const t = translate(intention, placeholder); if (t == ERROR || t == MISS) return false; @@ -1146,7 +1152,7 @@ void r4000_base_device::cpu_lwl(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 3) ^ R4000_ENDIAN_LE_BE(3, 0)) << 3; - load<u32>(offset & ~3, + load<u32, false>(offset, [this, op, shift](u32 const data) { m_r[RTREG] = s32((m_r[RTREG] & ~u32(~u32(0) << shift)) | (data << shift)); @@ -1158,7 +1164,7 @@ void r4000_base_device::cpu_lwr(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 0x3) ^ R4000_ENDIAN_LE_BE(0, 3)) << 3; - load<u32>(offset & ~3, + load<u32, false>(offset, [this, op, shift](u32 const data) { m_r[RTREG] = s32((m_r[RTREG] & ~u32(~u32(0) >> shift)) | (data >> shift)); @@ -1170,7 +1176,7 @@ void r4000_base_device::cpu_swl(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 3) ^ R4000_ENDIAN_LE_BE(3, 0)) << 3; - store<u32>(offset & ~3, u32(m_r[RTREG]) >> shift, ~u32(0) >> shift); + store<u32, false>(offset, u32(m_r[RTREG]) >> shift, ~u32(0) >> shift); } void r4000_base_device::cpu_swr(u32 const op) @@ -1178,7 +1184,7 @@ void r4000_base_device::cpu_swr(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 3) ^ R4000_ENDIAN_LE_BE(0, 3)) << 3; - store<u32>(offset & ~3, u32(m_r[RTREG]) << shift, ~u32(0) << shift); + store<u32, false>(offset, u32(m_r[RTREG]) << shift, ~u32(0) << shift); } void r4000_base_device::cpu_ldl(u32 const op) @@ -1186,7 +1192,7 @@ void r4000_base_device::cpu_ldl(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 7) ^ R4000_ENDIAN_LE_BE(7, 0)) << 3; - load<u64>(offset & ~7, + load<u64, false>(offset, [this, op, shift](u64 const data) { m_r[RTREG] = (m_r[RTREG] & ~u64(~u64(0) << shift)) | (data << shift); @@ -1198,7 +1204,7 @@ void r4000_base_device::cpu_ldr(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 7) ^ R4000_ENDIAN_LE_BE(0, 7)) << 3; - load<u64>(offset & ~7, + load<u64, false>(offset, [this, op, shift](u64 const data) { m_r[RTREG] = (m_r[RTREG] & ~u64(~u64(0) >> shift)) | (data >> shift); @@ -1210,7 +1216,7 @@ void r4000_base_device::cpu_sdl(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 7) ^ R4000_ENDIAN_LE_BE(7, 0)) << 3; - store<u64>(offset & ~7, m_r[RTREG] >> shift, ~u64(0) >> shift); + store<u64, false>(offset, m_r[RTREG] >> shift, ~u64(0) >> shift); } void r4000_base_device::cpu_sdr(u32 const op) @@ -1218,7 +1224,7 @@ void r4000_base_device::cpu_sdr(u32 const op) u64 const offset = ADDR(m_r[RSREG], s16(op)); unsigned const shift = ((offset & 7) ^ R4000_ENDIAN_LE_BE(0, 7)) << 3; - store<u64>(offset & ~7, m_r[RTREG] << shift, ~u64(0) << shift); + store<u64, false>(offset, m_r[RTREG] << shift, ~u64(0) << shift); } void r4000_base_device::cp0_execute(u32 const op) @@ -1469,7 +1475,7 @@ void r4000_base_device::cp0_tlbr() if (index < ARRAY_LENGTH(m_tlb)) { - tlb_entry_t const &entry = m_tlb[index]; + tlb_entry const &entry = m_tlb[index]; m_cp0[CP0_PageMask] = entry.mask; m_cp0[CP0_EntryHi] = entry.vpn; @@ -1482,7 +1488,7 @@ void r4000_base_device::cp0_tlbwi(u8 const index) { if (index < ARRAY_LENGTH(m_tlb)) { - tlb_entry_t &entry = m_tlb[index]; + tlb_entry &entry = m_tlb[index]; entry.mask = m_cp0[CP0_PageMask]; entry.vpn = m_cp0[CP0_EntryHi] & EH_WM; @@ -1517,7 +1523,7 @@ void r4000_base_device::cp0_tlbp() m_cp0[CP0_Index] = 0x80000000; for (u8 index = 0; index < ARRAY_LENGTH(m_tlb); index++) { - tlb_entry_t const &entry = m_tlb[index]; + tlb_entry const &entry = m_tlb[index]; u64 const mask = (cp0_64() ? EH_R | (EH_VPN2_64 & ~entry.mask) : (EH_VPN2_32 & ~entry.mask)) | ((entry.vpn & EH_G) ? 0 : EH_ASID); @@ -1530,9 +1536,9 @@ void r4000_base_device::cp0_tlbp() } if (m_cp0[CP0_Index] == 0x80000000) - LOGMASKED(LOG_TLB, "tlbp miss 0x%08x\n", m_cp0[CP0_EntryHi]); + LOGMASKED(LOG_TLB, "tlbp miss 0x%08x (%s)\n", m_cp0[CP0_EntryHi], machine().describe_context()); else - LOGMASKED(LOG_TLB, "tlbp hit 0x%08x index %02d\n", m_cp0[CP0_EntryHi], m_cp0[CP0_Index]); + LOGMASKED(LOG_TLB, "tlbp hit 0x%08x index %02d (%s)\n", m_cp0[CP0_EntryHi], m_cp0[CP0_Index], machine().describe_context()); } void r4000_base_device::cp0_update_timer(bool start) @@ -2727,7 +2733,7 @@ void r4000_base_device::cp2_execute(u32 const op) } } -r4000_base_device::translate_t r4000_base_device::translate(int intention, u64 &address) +r4000_base_device::translate_result r4000_base_device::translate(int intention, u64 &address) { /* * Decode the program address into one of the following ranges depending on @@ -2890,7 +2896,7 @@ r4000_base_device::translate_t r4000_base_device::translate(int intention, u64 & for (unsigned i = 0; i < ARRAY_LENGTH(m_tlb); i++) { unsigned const index = mru[i]; - tlb_entry_t const &entry = m_tlb[index]; + tlb_entry const &entry = m_tlb[index]; // test vpn and asid u64 const mask = (extended ? EH_R | (EH_VPN2_64 & ~entry.mask) : (EH_VPN2_32 & ~entry.mask)) @@ -2934,13 +2940,13 @@ r4000_base_device::translate_t r4000_base_device::translate(int intention, u64 & { if (VERBOSE & LOG_TLB) { - char const mode[] = { 'r', 'w', 'x' }; + static char const mode[] = { 'r', 'w', 'x' }; if (modify) - LOGMASKED(LOG_TLB, "tlb modify asid %d address 0x%016x (%s)\n", - m_cp0[CP0_EntryHi] & EH_ASID, address, machine().describe_context()); + LOGMASKED(LOG_TLB, "tlb modify asid 0x%02x address 0x%016x (%s)\n", + m_cp0[CP0_EntryHi] & EH_ASID, address, machine().describe_context()); else - LOGMASKED(LOG_TLB, "tlb miss %c asid %d address 0x%016x (%s)\n", + LOGMASKED(LOG_TLB, "tlb miss %c asid 0x%02x address 0x%016x (%s)\n", mode[intention & TRANSLATE_TYPE_MASK], m_cp0[CP0_EntryHi] & EH_ASID, address, machine().describe_context()); } @@ -2976,16 +2982,16 @@ void r4000_base_device::address_error(int intention, u64 const address) } } -template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, bool> r4000_base_device::load(u64 address, U &&apply) +template <typename T, bool Aligned, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, bool> r4000_base_device::load(u64 address, U &&apply) { // alignment error - if (address & (sizeof(T) - 1)) + if (Aligned && (address & (sizeof(T) - 1))) { address_error(TRANSLATE_READ, address); return false; } - translate_t const t = translate(TRANSLATE_READ, address); + translate_result const t = translate(TRANSLATE_READ, address); // address error if (t == ERROR) @@ -3011,6 +3017,10 @@ template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::f } } + // align address for l[dw][lr] instructions + if (!Aligned) + address &= ~(sizeof(T) - 1); + // TODO: cache lookup T value = 0; @@ -3044,7 +3054,7 @@ template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::f return false; } - translate_t const t = translate(TRANSLATE_READ, address); + translate_result const t = translate(TRANSLATE_READ, address); // address error if (t == ERROR) @@ -3080,16 +3090,16 @@ template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::f return true; } -template <typename T, typename U> std::enable_if_t<std::is_convertible<U, T>::value, bool> r4000_base_device::store(u64 address, U data, T mem_mask) +template <typename T, bool Aligned, typename U> std::enable_if_t<std::is_convertible<U, T>::value, bool> r4000_base_device::store(u64 address, U data, T mem_mask) { // alignment error - if (address & (sizeof(T) - 1)) + if (Aligned && (address & (sizeof(T) - 1))) { address_error(TRANSLATE_WRITE, address); return false; } - translate_t const t = translate(TRANSLATE_WRITE, address); + translate_result const t = translate(TRANSLATE_WRITE, address); // address error if (t == ERROR) @@ -3114,6 +3124,10 @@ template <typename T, typename U> std::enable_if_t<std::is_convertible<U, T>::va } } + // align address for s[dw][lr] instructions + if (!Aligned) + address &= ~(sizeof(T) - 1); + // TODO: cache lookup switch (sizeof(T)) @@ -3139,7 +3153,7 @@ bool r4000_base_device::fetch(u64 address, std::function<void(u32)> &&apply) return false; } - translate_t const t = translate(TRANSLATE_FETCH, address); + translate_result const t = translate(TRANSLATE_FETCH, address); // address error if (t == ERROR) diff --git a/src/devices/cpu/mips/r4000.h b/src/devices/cpu/mips/r4000.h index 80aac4ef56b..80b2bb1db4b 100644 --- a/src/devices/cpu/mips/r4000.h +++ b/src/devices/cpu/mips/r4000.h @@ -45,7 +45,7 @@ public: void bus_error() { m_bus_error = true; } protected: - enum cache_size_t + enum cache_size { CACHE_4K = 0, CACHE_8K = 1, @@ -56,7 +56,7 @@ protected: CACHE_256K = 6, CACHE_512K = 7, }; - r4000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 prid, u32 fcr, cache_size_t icache_size, cache_size_t dcache_size); + r4000_base_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, u32 prid, u32 fcr, cache_size icache_size, cache_size dcache_size); enum cp0_reg : int { @@ -361,13 +361,13 @@ protected: void cp2_execute(u32 const op); // address and memory handling - enum translate_t { ERROR, MISS, UNCACHED, CACHED }; - translate_t translate(int intention, u64 &address); + enum translate_result { ERROR, MISS, UNCACHED, CACHED }; + translate_result translate(int intention, u64 &address); void address_error(int intention, u64 const address); - template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, bool> load(u64 program_address, U &&apply); + template <typename T, bool Aligned = true, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(T)>>::value, bool> load(u64 program_address, U &&apply); template <typename T, typename U> std::enable_if_t<std::is_convertible<U, std::function<void(u64, T)>>::value, bool> load_linked(u64 program_address, U &&apply); - template <typename T, typename U> std::enable_if_t<std::is_convertible<U, T>::value, bool> store(u64 program_address, U data, T mem_mask = ~T(0)); + template <typename T, bool Aligned = true, typename U> std::enable_if_t<std::is_convertible<U, T>::value, bool> store(u64 program_address, U data, T mem_mask = ~T(0)); bool fetch(u64 address, std::function<void(u32)> &&apply); // debugging helpers @@ -387,7 +387,7 @@ protected: u64 m_r[32]; u64 m_hi; u64 m_lo; - enum branch_state_t : unsigned + enum branch_state : unsigned { NONE = 0, DELAY = 1, // delay slot instruction active @@ -402,9 +402,10 @@ protected: u64 m_cp0[32]; u64 m_cp0_timer_zero; emu_timer *m_cp0_timer; + bool m_hard_reset = true; bool m_ll_active; bool m_bus_error; - struct tlb_entry_t + struct tlb_entry { u64 mask; u64 vpn; diff --git a/src/devices/cpu/ns32000/ns32000dasm.cpp b/src/devices/cpu/ns32000/ns32000dasm.cpp index 8bc25f48c60..9556f7bcdda 100644 --- a/src/devices/cpu/ns32000/ns32000dasm.cpp +++ b/src/devices/cpu/ns32000/ns32000dasm.cpp @@ -360,7 +360,7 @@ int8_t ns32000_disassembler::short2int(uint8_t val) return (val & 0x08) ? val | 0xf0 : val; } -std::string ns32000_disassembler::mnemonic_index(std::string form, std::string itype, std::string ftype) +std::string ns32000_disassembler::mnemonic_index(std::string form, const std::string &itype, const std::string &ftype) { if (itype.size() && form.find('i') != std::string::npos) form.replace(form.find('i'), 1, itype); diff --git a/src/devices/cpu/ns32000/ns32000dasm.h b/src/devices/cpu/ns32000/ns32000dasm.h index 4cbf4cf3bda..0c8d3e2ab82 100644 --- a/src/devices/cpu/ns32000/ns32000dasm.h +++ b/src/devices/cpu/ns32000/ns32000dasm.h @@ -101,7 +101,7 @@ private: static char const *const M[]; static char const *const PR[]; - std::string mnemonic_index(std::string form, std::string itype, std::string ftype); + std::string mnemonic_index(std::string form, const std::string &itype, const std::string &ftype); uint8_t opcode_format(uint8_t byte); int8_t short2int(uint8_t val); static inline int32_t get_disp(offs_t &pc, const data_buffer &opcodes); diff --git a/src/devices/cpu/pace/pace.cpp b/src/devices/cpu/pace/pace.cpp new file mode 100644 index 00000000000..478a690d38a --- /dev/null +++ b/src/devices/cpu/pace/pace.cpp @@ -0,0 +1,1004 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + National Semiconductor PACE/INS8900 + + The IPC-16A PACE (Processing and Control Element) was one of the first + commercially available 16-bit microprocessors. It was am architectural + successor to the multiple-chip IMP-16 processor contained in a single + PMOS LSI package with internal microcode (though the emulation + currently uses a state machine instead, loosely based on the published + IMP-16 microcode; IMP-16's opcodes and instruction timings differ from + PACE's in various ways). The two clock inputs with non-overlapping low + phases required by PACE may be generated by the DP8302 STE (System + Timing Element), which divides its oscillator input by 2. + + Much like the Data General Nova, PACE and IMP-16 have four 16-bit + accumulators, two of which can be used as index registers. The program + counter can also be used as a base for relative addressing, and 256 + consecutive words including address 0 may be addressed absolutely. The + upper 128 words of this base page may be mapped to either 0080–00FF + or FF80–FFFF, depending on the state of the BPS input (which National + suggests connecting to one of the flag outputs). The on-chip 10-level + LIFO stack (IMP-16 has a 16-level stack) may hold both return addresses + and register data. The flag register, which includes four general- + purpose outputs, may be transferred to or from the stack or one of the + accumulators. + + The standard machine cycle takes 4 clock periods (and the shortest + instructions take 4 cycles each), though cycles can be stretched by + asserting the EXTEND pin (the emulation does not currently support + this). Six prioritized interrupts are available, one triggered only by + internal stack full/empty conditions; the nonmaskable level 0 interrupt + is intended primarily for debugging use. Each instruction is one word. + + INS8900 was a NMOS reimplementation of PACE which takes a single-phase + clock and allows up to 2 MHz operation. It has different power supply + requirements, but is functionally identical. + +***************************************************************************/ + +#include "emu.h" +#include "pace.h" +#include "pacedasm.h" + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE(INS8900, ins8900_device, "ins8900", "National Semiconductor INS8900") + + +//************************************************************************** +// DEVICE CONSTRUCTION AND INITIALIZATION +//************************************************************************** + +ALLOW_SAVE_TYPE(pace_device::cycle); + +//------------------------------------------------- +// pace_device - constructor +//------------------------------------------------- + +pace_device::pace_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig, type, tag, owner, clock) + , m_space_config("program", ENDIANNESS_LITTLE, 16, 16, -1) + , m_space(nullptr) + , m_cache(nullptr) + , m_bps_callback(*this) + , m_jc_callback{{*this}, {*this}, {*this}} + , m_flag_callback{{*this}, {*this}, {*this}, {*this}} + , m_fr(0xffff) + , m_pc(0) + , m_mdr(0) + , m_mar(0) + , m_ac{0, 0, 0, 0} + , m_stkp(0) + , m_stack_depth(0) + , m_stack{0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + , m_ppc(0) + , m_cir(0) + , m_shift_link(false) + , m_cycle(cycle::UNKNOWN) + , m_icount(0) +{ +} + + +//------------------------------------------------- +// ins8900_device - constructor +//------------------------------------------------- + +ins8900_device::ins8900_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : pace_device(mconfig, INS8900, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// memory_space_config - return a vector of +// configuration structures for memory spaces +//------------------------------------------------- + +device_memory_interface::space_config_vector pace_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_space_config) + }; +} + + +//------------------------------------------------- +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time +//------------------------------------------------- + +void pace_device::device_resolve_objects() +{ + // resolve callbacks + m_bps_callback.resolve_safe(0); + for (auto &cb : m_jc_callback) + cb.resolve_safe(0); + for (auto &cb : m_flag_callback) + cb.resolve_safe(); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void pace_device::device_start() +{ + // get memory spaces + m_space = &space(AS_PROGRAM); + m_cache = m_space->cache<1, -1, ENDIANNESS_LITTLE>(); + + set_icountptr(m_icount); + + // debug state registration + state_add(PACE_PC, "PC", m_pc); + state_add(STATE_GENPC, "GENPC", m_pc).noshow(); + state_add(STATE_GENPCBASE, "GENPCBASE", m_ppc).noshow(); + state_add<u16>(PACE_FR, "FR", [this]() { return m_fr; }, [this](u16 data) { set_fr(data); }); + state_add(STATE_GENFLAGS, "GENFLAGS", m_fr).noshow().formatstr("%14s"); + for (int i = 0; i < 4; i++) + state_add(PACE_AC0 + i, string_format("AC%d", i).c_str(), m_ac[i]); + state_add<u8>(PACE_STKD, "STKD", [this]() { return m_stack_depth; }, [this](u8 data) { m_stack_depth = data >= 10 ? 10 : data; }).mask(0xf); + for (int i = 0; i < 10; i++) + state_add<u16>(PACE_STK0 + i, string_format("STK%d", i).c_str(), + [this, i]() { return m_stack[m_stkp > i ? m_stkp - i - 1 : m_stkp + 9 - i]; }, + [this, i](u16 data) { m_stack[m_stkp > i ? m_stkp - i - 1 : m_stkp + 9 - i] = data; } + ); + + // save states + save_item(NAME(m_fr)); + save_item(NAME(m_pc)); + save_item(NAME(m_mdr)); + save_item(NAME(m_mar)); + save_item(NAME(m_ac)); + save_item(NAME(m_stkp)); + save_item(NAME(m_stack_depth)); + save_item(NAME(m_stack)); + save_item(NAME(m_ppc)); + save_item(NAME(m_cir)); + save_item(NAME(m_shift_link)); + save_item(NAME(m_cycle)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void pace_device::device_reset() +{ + set_fr(0); + m_pc = m_ppc = 0; + m_stkp = 0; + m_stack_depth = 0; + m_cycle = cycle::IFETCH_M1; +} + + +//------------------------------------------------- +// create_disassembler - factory method for +// disassembling program code +//------------------------------------------------- + +std::unique_ptr<util::disasm_interface> pace_device::create_disassembler() +{ + return std::make_unique<pace_disassembler>(); +} + + +//************************************************************************** +// I/O LINES, INTERRUPTS AND CONTROL FLAGS +//************************************************************************** + +//------------------------------------------------- +// set_control_flag - set one bit in the flag +// register +//------------------------------------------------- + +void pace_device::set_control_flag(u8 fc) +{ + if (fc == 15) + { + // TODO: SFLG/PFLG F15 is used to exit from level 0 interrupt + } + else if (!BIT(m_fr, fc)) + { + m_fr |= 1 << fc; + if (fc >= 11 && fc <= 14) + m_flag_callback[fc - 11](1); + } +} + + +//------------------------------------------------- +// reset_control_flag - reset one bit in the flag +// register +//------------------------------------------------- + +void pace_device::reset_control_flag(u8 fc) +{ + // F0 and F15 are always 1 (not implemented in hardware) + if (fc != 0 && fc != 15 && BIT(m_fr, fc)) + { + m_fr &= ~(1 << fc); + if (fc >= 11 && fc <= 14) + m_flag_callback[fc - 11](0); + } +} + + +//------------------------------------------------- +// set_fr - update the flag register +//------------------------------------------------- + +void pace_device::set_fr(u16 r) +{ + // F0 and F15 are always logic 1 (not implemented in hardware) + r |= 0x8001; + std::swap(m_fr, r); + + // Update flag outputs + for (int i = 0; i < 4; i++) + if (BIT(r, 11 + i) != BIT(m_fr, 11 + i)) + m_flag_callback[i](BIT(m_fr, 11 + i)); +} + + +//------------------------------------------------- +// execute_set_input - +//------------------------------------------------- + +void pace_device::execute_set_input(int irqline, int state) +{ + // TODO +} + + +//************************************************************************** +// CONDITION CODES AND ALU +//************************************************************************** + +//------------------------------------------------- +// sign_bit - test the sign bit of a word, taking +// BYTE mode into account +//------------------------------------------------- + +bool pace_device::sign_bit(u16 r) const noexcept +{ + return BIT(m_fr, 10) ? BIT(r, 7) : BIT(r, 15); +} + + +//------------------------------------------------- +// equals_0 - test whether a word is equal to +// zero, taking BYTE mode into account +//------------------------------------------------- + +bool pace_device::equals_0(u16 r) const noexcept +{ + // Only lower 7 bits are tested in BYTE mode + return (BIT(m_fr, 10) ? r & 0x00ff : r) == 0; +} + + +//------------------------------------------------- +// poll_condition - test condition by index +//------------------------------------------------- + +bool pace_device::poll_condition(u8 cc) +{ + switch (cc) + { + case 0: // STFL + return m_stack_depth == 10; + + case 1: // REQ0 + return equals_0(m_ac[0]); + + case 2: // PSIGN + return !sign_bit(m_ac[0]); + + case 3: // BIT0 + return BIT(m_ac[0], 0); + + case 4: // BIT1 + return BIT(m_ac[0], 1); + + case 5: // NREQ0 + return !equals_0(m_ac[0]); + + case 6: // BIT2 + return BIT(m_ac[0], 2); + + case 7: // CONTIN (TODO) + return false; + + case 8: // LINK + return BIT(m_fr, 8); + + case 9: // IEN + return BIT(m_fr, 9); + + case 10: // CARRY + return BIT(m_fr, 7); + + case 11: // NSIGN + return sign_bit(m_ac[0]); + + case 12: // OVF + return BIT(m_fr, 6); + + case 13: + case 14: + case 15: + return m_jc_callback[cc - 13](); + + default: + return false; + } +} + + +//------------------------------------------------- +// sign_extend - extend byte sign into upper 8 +// bits of word +//------------------------------------------------- + +void pace_device::sign_extend(u16 &r) +{ + if (BIT(r, 7)) + r |= 0xff00; + else + r &= 0x00ff; +} + + +//------------------------------------------------- +// add - add source to destination, with or +// without carry +//------------------------------------------------- + +void pace_device::add(u16 &dr, u16 sr, bool c) +{ + u32 carry_test = (BIT(m_fr, 10) ? u32(dr & 0x00ff) + u32(sr & 0x00ff) : u32(dr) + u32(sr)) + (c && BIT(m_fr, 7) ? 1 : 0); + s32 overflow_test = BIT(m_fr, 10) ? s32(s8(dr & 0x00ff)) + s32(s8(sr & 0x00ff)) : s32(s16(dr)) + s32(s16(sr)); + dr += sr + (c && BIT(m_fr, 7) ? 1 : 0); + + if (BIT(m_fr, 10) ? BIT(carry_test, 8) : BIT(carry_test, 16)) + set_control_flag(7); + else + reset_control_flag(7); + + if (overflow_test > s16(0x7fff) || overflow_test < s16(0x8000)) + set_control_flag(6); + else + reset_control_flag(6); +} + + +//------------------------------------------------- +// decimal_add - perform one adjusted stage of +// decimal addition +//------------------------------------------------- + +void pace_device::decimal_add(u16 &dr, u16 sr, unsigned stage) +{ + bool carry_out = ((sr >> stage) & 15) + ((dr >> stage) & 15) >= (BIT(m_fr, 7) ? 9 : 10); + s32 overflow_test = s32(s16(sr << (12 - stage))) + s32(s16(dr << (12 - stage))); + dr += (sr & (0x000f << stage)) + ((BIT(m_fr, 7) + (carry_out ? 6 : 0)) << stage); + + if (stage == 0) + reset_control_flag(7); + else if (stage == (BIT(m_fr, 10) ? 4 : 12)) + { + if (carry_out) + set_control_flag(7); + else + reset_control_flag(7); + + if (overflow_test > s16(0x7fff) || overflow_test < s16(0x8000)) + set_control_flag(6); + else + reset_control_flag(6); + } +} + + +//------------------------------------------------- +// prepare_shift - setup registers for shift or +// rotate instruction +//------------------------------------------------- + +void pace_device::prepare_shift() +{ + m_shift_link = BIT(m_mdr, 0); + m_mdr = (m_mdr & 0x00fe) >> 1; +} + + +//------------------------------------------------- +// shift_left - shift or rotate a register left +// by one bit +//------------------------------------------------- + +void pace_device::shift_left(u16 &r, bool rotate) +{ + bool shift_out = sign_bit(r); + r <<= 1; + if (rotate && (m_shift_link ? BIT(m_fr, 8) : shift_out)) + r |= 0x0001; + if (BIT(m_fr, 10)) + r &= 0x00ff; + + if (m_shift_link) + { + if (shift_out) + set_control_flag(8); + else + reset_control_flag(8); + } +} + + +//------------------------------------------------- +// shift_right - shift or rotate a register right +// by one bit +//------------------------------------------------- + +void pace_device::shift_right(u16 &r, bool rotate) +{ + bool shift_out = BIT(r, 0); + r >>= 1; + if (rotate && (m_shift_link ? BIT(m_fr, 8) : shift_out)) + r |= BIT(m_fr, 10) ? 0x0080 : 0x8000; + + if (m_shift_link) + { + if (shift_out) + set_control_flag(8); + else + reset_control_flag(8); + } +} + + +//************************************************************************** +// LIFO STACK MANAGEMENT +//************************************************************************** + +//------------------------------------------------- +// stack_push - push one word onto the stack +//------------------------------------------------- + +void pace_device::stack_push(u16 r) +{ + m_stack[m_stkp] = r; + m_stkp = m_stkp == 9 ? 0 : m_stkp + 1; + + if (m_stack_depth == 10) + logerror("%04X: Stack overflow\n", m_ppc); + else + m_stack_depth++; // TODO: stack full interrupt +} + + +//------------------------------------------------- +// stack_pull - extract top entry from the stack +//------------------------------------------------- + +u16 pace_device::stack_pull() +{ + if (m_stack_depth == 0) + { + logerror("%04X: Stack underflow\n", m_ppc); + return 0; + } + m_stack_depth--; + + m_stkp = m_stkp == 0 ? 9 : m_stkp - 1; + return std::exchange(m_stack[m_stkp], 0); +} + + +//************************************************************************** +// PROGRAM EXECUTION +//************************************************************************** + +// instruction decode +const pace_device::cycle pace_device::s_decode[64] = { + cycle::HALT_M4, cycle::CFR_M4, cycle::CRF_M4, cycle::PUSHF_M4, + cycle::PULLF_M4, cycle::JSR_M4, cycle::JMP_M4, cycle::XCHRS_M4, + cycle::ROL_M4, cycle::ROR_M4, cycle::SHL_M4, cycle::SHR_M4, + cycle::PFLG_M4, cycle::PFLG_M4, cycle::PFLG_M4, cycle::PFLG_M4, + cycle::BOC_M4, cycle::BOC_M4, cycle::BOC_M4, cycle::BOC_M4, + cycle::LI_M4, cycle::RAND_M4, cycle::RXOR_M4, cycle::RCPY_M4, + cycle::PUSH_M4, cycle::PULL_M4, cycle::RADD_M4, cycle::RXCH_M4, + cycle::CAI_M4, cycle::RADC_M4, cycle::AISZ_M4, cycle::RTI_M4, + cycle::RTS_M4, cycle::UNKNOWN, cycle::DECA_M4, cycle::ISZ_M4, + cycle::SUBB_M4, cycle::JSR_IND_M4, cycle::JMP_IND_M4, cycle::SKG_M4, + cycle::LD_IND_M4, cycle::OR_M4, cycle::AND_M4, cycle::DSZ_M4, + cycle::ST_IND_M4, cycle::UNKNOWN, cycle::SKAZ_M4, cycle::LSEX_M4, + cycle::LD_M4, cycle::LD_M4, cycle::LD_M4, cycle::LD_M4, + cycle::ST_M4, cycle::ST_M4, cycle::ST_M4, cycle::ST_M4, + cycle::ADD_M4, cycle::ADD_M4, cycle::ADD_M4, cycle::ADD_M4, + cycle::SKNE_M4, cycle::SKNE_M4, cycle::SKNE_M4, cycle::SKNE_M4 +}; + + +//------------------------------------------------- +// read_instruction - read the next instruction +// into internal registers +//------------------------------------------------- + +void pace_device::read_instruction() +{ + // TODO: interrupt check + m_ppc = m_pc; + debugger_instruction_hook(m_pc); + m_mdr = m_cache->read_word(m_pc++); + m_cir = m_mdr >> 6; + sign_extend(m_mdr); +} + + +//------------------------------------------------- +// get_effective_address - calculate effective +// address for the current instruction +//------------------------------------------------- + +u16 pace_device::get_effective_address() +{ + if ((m_cir & 0x00c) == 0) + { + // Direct page mapping depends on BPS + return m_mdr & (m_bps_callback() ? 0xffff : 0x00ff); + } + else if ((m_cir & 0x00c) == 0x004) + { + // PC-relative + return m_mdr + m_pc; + } + else + { + // AC2 or AC3-indexed + return m_mdr + m_ac[(m_cir & 0x00c) >> 2]; + } +} + + +//------------------------------------------------- +// read_effective_address - read the word at the +// effective address into MDR, if applicable to +// the current instruction +//------------------------------------------------- + +void pace_device::read_effective_address() +{ + // All opcodes with bit 15 set read from an EA except RTS and non-indirect ST + if (m_cir > 0x200 && (m_cir & 0x3c0) != 0x340) + { + if ((m_cir & 0x00c) == 0x004) + m_mdr = m_cache->read_word(m_mar); + else + m_mdr = m_space->read_word(m_mar); + } +} + + +//------------------------------------------------- +// write_effective_address - write one word to +// the effective address +//------------------------------------------------- + +void pace_device::write_effective_address(u16 r) +{ + if ((m_cir & 0x00c) == 0x004) + m_cache->write_word(m_mar, r); + else + m_space->write_word(m_mar, r); +} + + +//------------------------------------------------- +// execute_one - execute one machine cycle of an +// instruction +//------------------------------------------------- + +pace_device::cycle pace_device::execute_one() +{ + switch (m_cycle) + { + case cycle::IFETCH_M1: + read_instruction(); + return cycle::LEA_M2; + + case cycle::LEA_M2: + m_mar = get_effective_address(); + return cycle::RDEA_M3; + + case cycle::RDEA_M3: + read_effective_address(); + return s_decode[(m_cir & 0x3f0) >> 4]; + + case cycle::BOC_M4: + return cycle::BOC_M5; + + case cycle::BOC_M5: + return poll_condition((m_cir & 0x03c) >> 2) ? cycle::BRANCH : cycle::IFETCH_M1; + + case cycle::JMP_M4: + case cycle::JSR_M5: + m_pc = m_mar; + return cycle::IFETCH_M1; + + case cycle::JMP_IND_M4: + case cycle::JSR_IND_M5: + m_pc = m_mdr; + return cycle::IFETCH_M1; + + case cycle::JSR_M4: + stack_push(m_pc); + return cycle::JSR_M5; + + case cycle::JSR_IND_M4: + stack_push(m_pc); + return cycle::JSR_IND_M5; + + case cycle::RTS_M4: + case cycle::RTI_M5: + m_pc = stack_pull(); + return cycle::RTS_M5; + + case cycle::RTI_M4: + set_control_flag(9); // enable interrupts + return cycle::RTI_M5; + + case cycle::RTS_M5: + case cycle::RTI_M6: + case cycle::BRANCH: + m_pc += m_mdr; + return cycle::IFETCH_M1; + + case cycle::SKNE_M4: + m_mdr ^= m_ac[(m_cir & 0x030) >> 4]; + return cycle::SKNE_M5; + + case cycle::SKNE_M5: + return equals_0(m_mdr) ? cycle::IFETCH_M1 : cycle::SKIP; + + case cycle::SKG_M4: + if (BIT(m_fr, 10)) + sign_extend(m_mdr); + return cycle::SKG_M5; + + case cycle::SKG_M5: + m_mdr = ~m_mdr + m_ac[0]; + return cycle::SKG_M6; + + case cycle::SKG_M6: + if (BIT(m_fr, 10)) + sign_extend(m_mdr); + return cycle::SKG_M7; + + case cycle::SKG_M7: + return BIT(m_mdr, 15) ? cycle::SKIP : cycle::IFETCH_M1; + + case cycle::SKAZ_M4: + m_mdr &= m_ac[0]; + return cycle::SKAZ_M5; + + case cycle::SKAZ_M5: + case cycle::ISZ_M7: + case cycle::DSZ_M7: + return equals_0(m_mdr) ? cycle::SKIP : cycle::IFETCH_M1; + + case cycle::ISZ_M4: + m_mdr += 1; + return cycle::ISZ_M5; + + case cycle::ISZ_M5: + case cycle::DSZ_M5: + write_effective_address(m_mdr); + return cycle::ISZ_M6; + + case cycle::ISZ_M6: + case cycle::DSZ_M6: + return cycle::ISZ_M7; + + case cycle::DSZ_M4: + m_mdr -= 1; + return cycle::DSZ_M5; + + case cycle::AISZ_M4: + m_ac[(m_cir & 0x00c) >> 2] += m_mdr; + return cycle::AISZ_M5; + + case cycle::AISZ_M5: + // 16-bit test always performed even in BYTE mode + return m_ac[(m_cir & 0x00c) >> 2] == 0 ? cycle::SKIP : cycle::IFETCH_M1; + + case cycle::SKIP: + m_pc += 1; + return cycle::IFETCH_M1; + + case cycle::LD_M4: + m_ac[(m_cir & 0x030) >> 4] = m_mdr; + return cycle::IFETCH_M1; + + case cycle::LD_IND_M4: + m_mdr = m_space->read_word(m_mdr); + return cycle::LD_IND_M5; + + case cycle::LD_IND_M5: + m_ac[0] = m_mdr; + return cycle::IFETCH_M1; + + case cycle::ST_M4: + write_effective_address(m_ac[(m_cir & 0x030) >> 4]); + return cycle::IFETCH_M1; + + case cycle::ST_IND_M4: + m_space->write_word(m_mdr, m_ac[0]); + return cycle::IFETCH_M1; + + case cycle::LSEX_M4: + m_mdr = m_space->read_word(m_mdr); + sign_extend(m_mdr); + return cycle::IFETCH_M1; + + case cycle::AND_M4: + m_ac[0] &= m_mdr; + return cycle::IFETCH_M1; + + case cycle::OR_M4: + m_ac[0] |= m_mdr; + return cycle::IFETCH_M1; + + case cycle::ADD_M4: + add(m_ac[(m_cir & 0x030) >> 4], m_mdr, false); + return cycle::IFETCH_M1; + + case cycle::SUBB_M4: + add(m_ac[0], ~m_mdr, true); + return cycle::IFETCH_M1; + + case cycle::DECA_M4: + decimal_add(m_ac[0], m_mdr, 0); + return cycle::DECA_M5; + + case cycle::DECA_M5: + decimal_add(m_ac[0], m_mdr, 4); + return cycle::DECA_M6; + + case cycle::DECA_M6: + decimal_add(m_ac[0], m_mdr, 8); + return cycle::DECA_M7; + + case cycle::DECA_M7: + decimal_add(m_ac[0], m_mdr, 12); + return cycle::IFETCH_M1; + + case cycle::LI_M4: + case cycle::RXCH_M6: + case cycle::XCHRS_M6: + case cycle::CAI_M5: + m_ac[(m_cir & 0x00c) >> 2] = m_mdr; + return cycle::IFETCH_M1; + + case cycle::RCPY_M4: + m_ac[(m_cir & 0x00c) >> 2] = m_ac[m_cir & 0x003]; + return cycle::IFETCH_M1; + + case cycle::RXCH_M4: + m_mdr = m_ac[(m_cir & 0x00c) >> 2]; + return cycle::RXCH_M5; + + case cycle::RXCH_M5: + m_ac[(m_cir & 0x00c) >> 2] = m_ac[m_cir & 0x003]; + return cycle::RXCH_M6; + + case cycle::XCHRS_M4: + m_mdr = stack_pull(); // IMP-16 uses MAR as the temporary + return cycle::XCHRS_M5; + + case cycle::XCHRS_M5: + stack_push(m_ac[(m_cir & 0x00c) >> 2]); + return cycle::XCHRS_M6; + + case cycle::CFR_M4: + m_ac[(m_cir & 0x00c) >> 2] = m_fr; + return cycle::IFETCH_M1; + + case cycle::CRF_M4: + set_fr(m_ac[(m_cir & 0x00c) >> 2]); + return cycle::IFETCH_M1; + + case cycle::PUSH_M4: + stack_push(m_ac[(m_cir & 0x00c) >> 2]); + return cycle::IFETCH_M1; + + case cycle::PULL_M4: + m_ac[(m_cir & 0x00c) >> 2] = stack_pull(); + return cycle::IFETCH_M1; + + case cycle::PUSHF_M4: + stack_push(m_fr); + return cycle::IFETCH_M1; + + case cycle::PULLF_M4: + set_fr(stack_pull()); + return cycle::IFETCH_M1; + + case cycle::RADD_M4: + add(m_ac[(m_cir & 0x00c) >> 2], m_ac[m_cir & 0x003], false); + return cycle::IFETCH_M1; + + case cycle::RADC_M4: + add(m_ac[(m_cir & 0x00c) >> 2], m_ac[m_cir & 0x003], true); + return cycle::IFETCH_M1; + + case cycle::RAND_M4: + m_ac[(m_cir & 0x00c) >> 2] &= m_ac[m_cir & 0x003]; + return cycle::IFETCH_M1; + + case cycle::RXOR_M4: + m_ac[(m_cir & 0x00c) >> 2] ^= m_ac[m_cir & 0x003]; + return cycle::IFETCH_M1; + + case cycle::CAI_M4: + m_mdr += ~m_ac[(m_cir & 0x00c) >> 2]; + return cycle::CAI_M5; + + case cycle::SHL_M4: + prepare_shift(); + return cycle::SHL_M5; + + case cycle::SHL_M5: + if (BIT(m_fr, 10)) + m_ac[(m_cir & 0x00c) >> 2] &= 0x00ff; + return cycle::SHL_M6; + + case cycle::SHL_M6: + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::SHL_M7; + + case cycle::SHL_M7: + shift_left(m_ac[(m_cir & 0x00c) >> 2], false); + return cycle::SHL_M8; + + case cycle::SHL_M8: + m_mdr -= 1; + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::SHL_M6; + + case cycle::SHR_M4: + prepare_shift(); + return cycle::SHR_M5; + + case cycle::SHR_M5: + if (BIT(m_fr, 10)) + m_ac[(m_cir & 0x00c) >> 2] &= 0x00ff; + return cycle::SHR_M6; + + case cycle::SHR_M6: + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::SHR_M7; + + case cycle::SHR_M7: + shift_right(m_ac[(m_cir & 0x00c) >> 2], false); + return cycle::SHR_M8; + + case cycle::SHR_M8: + m_mdr -= 1; + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::SHR_M6; + + case cycle::ROL_M4: + prepare_shift(); + return cycle::ROL_M5; + + case cycle::ROL_M5: + if (BIT(m_fr, 10)) + m_ac[(m_cir & 0x00c) >> 2] &= 0x00ff; + return cycle::ROL_M6; + + case cycle::ROL_M6: + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::ROL_M7; + + case cycle::ROL_M7: + shift_left(m_ac[(m_cir & 0x00c) >> 2], true); + return cycle::ROL_M7; + + case cycle::ROL_M8: + m_mdr -= 1; + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::ROL_M5; + + case cycle::ROR_M4: + prepare_shift(); + return cycle::ROR_M5; + + case cycle::ROR_M5: + if (BIT(m_fr, 10)) + m_ac[(m_cir & 0x00c) >> 2] &= 0x00ff; + return cycle::ROR_M6; + + case cycle::ROR_M6: + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::ROR_M7; + + case cycle::ROR_M7: + shift_right(m_ac[(m_cir & 0x00c) >> 2], true); + return cycle::ROR_M8; + + case cycle::ROR_M8: + m_mdr -= 1; + return m_mdr == 0 ? cycle::IFETCH_M1 : cycle::ROR_M6; + + case cycle::HALT_M4: // TODO + logerror("%04X: HALT opcode encountered\n", m_ppc); + return cycle::IFETCH_M1; + + case cycle::PFLG_M4: // PFLG or SFLG + return cycle::PFLG_M5; + + case cycle::PFLG_M5: // PFLG or SFLG + set_control_flag((m_cir & 0x03c) >> 2); + return BIT(m_mdr, 7) ? cycle::IFETCH_M1 : cycle::PFLG_M6; + + case cycle::PFLG_M6: // PFLG only + reset_control_flag((m_cir & 0x03c) >> 2); + return cycle::IFETCH_M1; + + case cycle::UNKNOWN: + default: + logerror("%04X: Unknown %02XXX opcode encountered\n", m_ppc, m_cir >> 2); + return cycle::IFETCH_M1; + } +} + + +//------------------------------------------------- +// execute_run - +//------------------------------------------------- + +void pace_device::execute_run() +{ + while (m_icount > 0) + { + m_cycle = execute_one(); + m_icount--; + } +} + + +//------------------------------------------------- +// state_string_export - +//------------------------------------------------- + +void pace_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c", + BIT(m_fr, 14) ? 'F' : '.', + BIT(m_fr, 13) ? 'F' : '.', + BIT(m_fr, 12) ? 'F' : '.', + BIT(m_fr, 11) ? 'F' : '.', + BIT(m_fr, 10) ? 'B' : '.', + BIT(m_fr, 9) ? 'I' : '.', + BIT(m_fr, 8) ? 'L' : '.', + BIT(m_fr, 7) ? 'C' : '.', + BIT(m_fr, 6) ? 'O' : '.', + BIT(m_fr, 5) ? '5' : '.', + BIT(m_fr, 4) ? '4' : '.', + BIT(m_fr, 3) ? '3' : '.', + BIT(m_fr, 2) ? '2' : '.', + BIT(m_fr, 1) ? '1' : '.'); + break; + } +} diff --git a/src/devices/cpu/pace/pace.h b/src/devices/cpu/pace/pace.h new file mode 100644 index 00000000000..5fdbcdb7e57 --- /dev/null +++ b/src/devices/cpu/pace/pace.h @@ -0,0 +1,225 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + National Semiconductor PACE/INS8900 + +**************************************************************************** + _____________ + D04 1 | | 40 D05 + D03 2 | | 39 D06 + D02 3 | | 38 D07 + D01 4 | | 37 D08 + D00 5 | | 36 D09 + IDS 6 | | 35 D10 + ODS 7 | | 34 D11 + NADS 8 | | 33 D12 + NHALT 9 | | 32 D13 + CONTIN 10 | IPC-16A | 31 D14 + JC14 11 | INS8900 | 30 D15 + JC15 12 | | 29 Vgg/Vdd* + JC13 13 | | 28 BPS + NIR5 14 | | 27 EXTEND + NIR4 15 | | 26 NINIT + NIR3 16 | | 25 CLK/Vcc* + NIR2 17 | | 24 NCLK/CLKX + F11 18 | | 23 Vbb* + F12 19 | | 22 F14 + Vss* 20 |_____________| 21 F13 + + * For PACE (IPC-16A): Vss = +5V, Vbb = +8V, Vgg = -12V + * For INS8900: Vss = GND, Vbb = -8V, Vcc = +5V, Vdd = +12V + +***************************************************************************/ + +#ifndef MAME_CPU_PACE_PACE_H +#define MAME_CPU_PACE_PACE_H + +#pragma once + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> pace_device + +class pace_device : public cpu_device +{ +public: + // register enumeration + enum { + PACE_PC, + PACE_FR, + PACE_AC0, PACE_AC1, PACE_AC2, PACE_AC3, + PACE_STKD, + PACE_STK0, PACE_STK1, PACE_STK2, PACE_STK3, PACE_STK4, + PACE_STK5, PACE_STK6, PACE_STK7, PACE_STK8, PACE_STK9 + }; + + // callback configuration + auto jc13_callback() { return m_jc_callback[0].bind(); } + auto jc14_callback() { return m_jc_callback[1].bind(); } + auto jc15_callback() { return m_jc_callback[2].bind(); } + auto f11_callback() { return m_flag_callback[0].bind(); } + auto f12_callback() { return m_flag_callback[1].bind(); } + auto f13_callback() { return m_flag_callback[2].bind(); } + auto f14_callback() { return m_flag_callback[3].bind(); } + +protected: + // construction/destruction + pace_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device-specific overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } + virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } + virtual void execute_run() override; + virtual void execute_set_input(int irqline, int state) override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // device_state_interface overrides + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + +private: + enum class cycle { + IFETCH_M1, LEA_M2, RDEA_M3, + + BOC_M4, BOC_M5, + JMP_M4, + JMP_IND_M4, + JSR_M4, JSR_M5, + JSR_IND_M4, JSR_IND_M5, + RTS_M4, RTS_M5, + RTI_M4, RTI_M5, RTI_M6, + BRANCH, + + SKNE_M4, SKNE_M5, + SKG_M4, SKG_M5, SKG_M6, SKG_M7, + SKAZ_M4, SKAZ_M5, + ISZ_M4, ISZ_M5, ISZ_M6, ISZ_M7, + DSZ_M4, DSZ_M5, DSZ_M6, DSZ_M7, + AISZ_M4, AISZ_M5, + SKIP, + + LD_M4, + LD_IND_M4, LD_IND_M5, + ST_M4, + ST_IND_M4, + LSEX_M4, + + AND_M4, + OR_M4, + ADD_M4, + SUBB_M4, + DECA_M4, DECA_M5, DECA_M6, DECA_M7, + + LI_M4, + RCPY_M4, + RXCH_M4, RXCH_M5, RXCH_M6, + XCHRS_M4, XCHRS_M5, XCHRS_M6, + CFR_M4, + CRF_M4, + PUSH_M4, + PULL_M4, + PUSHF_M4, + PULLF_M4, + + RADD_M4, + RADC_M4, + RAND_M4, + RXOR_M4, + CAI_M4, CAI_M5, + + SHL_M4, SHL_M5, SHL_M6, SHL_M7, SHL_M8, + SHR_M4, SHR_M5, SHR_M6, SHR_M7, SHR_M8, + ROL_M4, ROL_M5, ROL_M6, ROL_M7, ROL_M8, + ROR_M4, ROR_M5, ROR_M6, ROR_M7, ROR_M8, + + HALT_M4, + PFLG_M4, PFLG_M5, PFLG_M6, + + UNKNOWN + }; + + static const cycle s_decode[64]; + + // flag and interrupt helpers + void set_control_flag(u8 fc); + void reset_control_flag(u8 fc); + void set_fr(u16 r); + + // conditions and ALU helpers + bool sign_bit(u16 r) const noexcept; + bool equals_0(u16 r) const noexcept; + bool poll_condition(u8 cc); + static void sign_extend(u16 &r); + void add(u16 &dr, u16 sr, bool c); + void decimal_add(u16 &dr, u16 sr, unsigned stage); + void prepare_shift(); + void shift_left(u16 &r, bool rotate); + void shift_right(u16 &r, bool rotate); + + // stack helpers + void stack_push(u16 r); + u16 stack_pull(); + + // execution helpers + void read_instruction(); + u16 get_effective_address(); + void read_effective_address(); + void write_effective_address(u16 r); + cycle execute_one(); + + // address space and cache + address_space_config m_space_config; + address_space *m_space; + memory_access_cache<1, -1, ENDIANNESS_LITTLE> *m_cache; + + // callback objects + devcb_read_line m_bps_callback; + devcb_read_line m_jc_callback[3]; + devcb_write_line m_flag_callback[4]; + + // core registers + u16 m_fr; + u16 m_pc; + u16 m_mdr; + u16 m_mar; + u16 m_ac[4]; + + // stack + u8 m_stkp; + u8 m_stack_depth; + u16 m_stack[10]; + + // execution state + u16 m_ppc; + u16 m_cir; + bool m_shift_link; + cycle m_cycle; + s32 m_icount; +}; + +// ======================> ins8900_device + +class ins8900_device : public pace_device +{ +public: + // device type constructor + ins8900_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +// device type declarations +DECLARE_DEVICE_TYPE(INS8900, ins8900_device) + +#endif // MAME_CPU_PACE_PACE_H diff --git a/src/devices/cpu/pace/pacedasm.cpp b/src/devices/cpu/pace/pacedasm.cpp new file mode 100644 index 00000000000..6ab93f8f75d --- /dev/null +++ b/src/devices/cpu/pace/pacedasm.cpp @@ -0,0 +1,321 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + National Semiconductor PACE (IPC-16A, INS8900) disassembler + + This uses the same basic instruction set as IMP-16, but the binary + encoding is not compatible. + +***************************************************************************/ + +#include "emu.h" +#include "pacedasm.h" + + +//************************************************************************** +// PACE DISASSEMBLER +//************************************************************************** + +pace_disassembler::pace_disassembler() + : util::disasm_interface() +{ +} + +u32 pace_disassembler::opcode_alignment() const +{ + return 1; +} + +const char *const pace_disassembler::s_cc[16] = { + "STFL", // stack full + "REQ0", // AC0 equals zero + "PSIGN", // AC0 has positive sign + "BIT0", // AC0 has bit 0 set + "BIT1", // AC0 has bit 1 set + "NREQ0", // AC0 does not equal zero + "BIT2", // AC0 has bit 2 set + "CONTIN", // CONTIN input is high + "LINK", // LINK is set + "IEN", // IEN is set + "CARRY", // CARRY is set + "NSIGN", // AC0 has negative sign + "OV", // OV is set + "JC13", // JC13 is high + "JC14", // JC14 is high + "JC15" // JC15 is high +}; + +const char *const pace_disassembler::s_flags[16] = { + "F0", // does not exist in FR + "IE1", + "IE2", + "IE3", + "IE4", + "IE5", + "OVF", + "CRY", + "LINK", + "IEN", + "BYTE", + "F11", + "F12", + "F13", + "F14", + "F15" // does not exist in FR, but used to reset IE0 after level 0 interrupt +}; + +void pace_disassembler::format_addr(std::ostream &stream, u16 addr) +{ + if (addr >= 0x1000) + stream << "0"; + util::stream_format(stream, "%04X", addr); +} + +void pace_disassembler::format_disp(std::ostream &stream, u8 disp) +{ + if (disp >= 0x80) + { + stream << "-"; + disp = 0x100 - disp; + } + if (disp < 0x0a) + util::stream_format(stream, "%d", disp); + else + util::stream_format(stream, "0%X", disp); +} + +void pace_disassembler::format_ea(std::ostream &stream, u16 pc, u16 inst) +{ + if ((inst & 0x0300) == 0x0000) + { + // 0000–00FF or 0000–007F, FF80–FFFF depending on BPS input + if ((inst & 0x00ff) >= 0x10) + stream << "0"; + util::stream_format(stream, "%02X", inst & 0x00ff); + } + else if ((inst & 0x0300) == 0x0100) + format_addr(stream, pc + 1 + s8(inst & 0x00ff)); + else + { + format_disp(stream, inst & 0x00ff); + util::stream_format(stream, "(AC%d)", (inst & 0x0300) >> 8); + } +} + +offs_t pace_disassembler::disassemble(std::ostream &stream, offs_t pc, const pace_disassembler::data_buffer &opcodes, const pace_disassembler::data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc); + + switch (inst & 0xfc00) + { + case 0x0000: + stream << "HALT"; + return 1; + + case 0x0400: + util::stream_format(stream, "%-8sAC%d", "CFR", (inst & 0x0300) >> 8); + return 1; + + case 0x0800: + util::stream_format(stream, "%-8sAC%d", "CRF", (inst & 0x0300) >> 8); + return 1; + + case 0x0c00: + stream << "PUSHF"; + return 1; + + case 0x1000: + stream << "PULLF"; + return 1; + + case 0x1400: + util::stream_format(stream, "%-8s", "JSR"); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + case 0x1800: + util::stream_format(stream, "%-8s", "JMP"); + format_ea(stream, pc, inst); + return 1; + + case 0x1c00: + util::stream_format(stream, "%-8sAC%d", "XCHRS", (inst & 0x0300) >> 8); + return 1; + + case 0x2000: + util::stream_format(stream, "%-8sAC%d,%d,%d", "ROL", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); + return 1; + + case 0x2400: + util::stream_format(stream, "%-8sAC%d,%d,%d", "ROR", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); + return 1; + + case 0x2800: + util::stream_format(stream, "%-8sAC%d,%d,%d", "SHL", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); + return 1; + + case 0x2c00: + util::stream_format(stream, "%-8sAC%d,%d,%d", "SHR", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); + return 1; + + case 0x3000: case 0x3400: case 0x3800: case 0x3c00: + util::stream_format(stream, "%-8s%s", BIT(inst, 7) ? "SFLG" : "PFLG", s_flags[(inst & 0x0f00) >> 8]); + return 1; + + case 0x4000: case 0x4400: case 0x4800: case 0x4c00: + util::stream_format(stream, "%-8s%s,", "BOC", s_cc[(inst & 0x0f00) >> 8]); + format_addr(stream, pc + 1 + s8(inst & 0x00ff)); + return 1; + + case 0x5000: + util::stream_format(stream, "%-8sAC%d,", "LI", (inst & 0x0300) >> 8); + format_disp(stream, inst & 0x00ff); + return 1; + + case 0x5400: + util::stream_format(stream, "%-8sAC%d,AC%d", "RAND", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); + return 1; + + case 0x5800: + util::stream_format(stream, "%-8sAC%d,AC%d", "RXOR", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); + return 1; + + case 0x5c00: + if ((inst & 0x0300) >> 2 == (inst & 0x00c0)) + stream << "NOP"; + else + util::stream_format(stream, "%-8sAC%d,AC%d", "RCPY", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); + return 1; + + case 0x6000: + util::stream_format(stream, "%-8sAC%d", "PUSH", (inst & 0x0300) >> 8); + return 1; + + case 0x6400: + util::stream_format(stream, "%-8sAC%d", "PULL", (inst & 0x0300) >> 8); + return 1; + + case 0x6800: + util::stream_format(stream, "%-8sAC%d,AC%d", "RADD", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); + return 1; + + case 0x6c00: + util::stream_format(stream, "%-8sAC%d,AC%d", "RXCH", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); + return 1; + + case 0x7000: + util::stream_format(stream, "%-8sAC%d,", "CAI", (inst & 0x0300) >> 8); + format_disp(stream, inst & 0x00ff); + return 1; + + case 0x7400: + util::stream_format(stream, "%-8sAC%d,AC%d", "RADC", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); + return 1; + + case 0x7800: + util::stream_format(stream, "%-8sAC%d,", "AISZ", (inst & 0x0300) >> 8); + format_disp(stream, inst & 0x00ff); + return 1 | STEP_OVER; + + case 0x7c00: + util::stream_format(stream, "%-8s", "RTI"); + format_disp(stream, inst & 0x00ff); + return 1 | STEP_OUT; + + case 0x8000: + util::stream_format(stream, "%-8s", "RTS"); + format_disp(stream, inst & 0x00ff); + return 1 | STEP_OUT; + + case 0x8800: + util::stream_format(stream, "%-8sAC0,", "DECA"); + format_ea(stream, pc, inst); + return 1; + + case 0x8c00: + util::stream_format(stream, "%-8s", "ISZ"); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + case 0x9000: + util::stream_format(stream, "%-8sAC0,", "SUBB"); + format_ea(stream, pc, inst); + return 1; + + case 0x9400: + util::stream_format(stream, "%-8s@", "JSR"); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + case 0x9800: + util::stream_format(stream, "%-8s@", "JMP"); + format_ea(stream, pc, inst); + return 1; + + case 0x9c00: + util::stream_format(stream, "%-8sAC0,", "SKG"); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + case 0xa000: + util::stream_format(stream, "%-8sAC0,@", "LD"); + format_ea(stream, pc, inst); + return 1; + + case 0xa400: + util::stream_format(stream, "%-8sAC0,", "OR"); + format_ea(stream, pc, inst); + return 1; + + case 0xa800: + util::stream_format(stream, "%-8sAC0,", "AND"); + format_ea(stream, pc, inst); + return 1; + + case 0xac00: + util::stream_format(stream, "%-8s", "DSZ"); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + case 0xb000: + util::stream_format(stream, "%-8sAC0,@", "ST"); + format_ea(stream, pc, inst); + return 1; + + case 0xb800: + util::stream_format(stream, "%-8sAC0,", "SKAZ"); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + case 0xbc00: + util::stream_format(stream, "%-8sAC0,", "LSEX"); + format_ea(stream, pc, inst); + return 1; + + case 0xc000: case 0xc400: case 0xc800: case 0xcc00: + util::stream_format(stream, "%-8sAC%d,", "LD", (inst & 0x0c00) >> 10); + format_ea(stream, pc, inst); + return 1; + + case 0xd000: case 0xd400: case 0xd800: case 0xdc00: + util::stream_format(stream, "%-8sAC%d,", "ST", (inst & 0x0c00) >> 10); + format_ea(stream, pc, inst); + return 1; + + case 0xe000: case 0xe400: case 0xe800: case 0xec00: + util::stream_format(stream, "%-8sAC%d,", "ADD", (inst & 0x0c00) >> 10); + format_ea(stream, pc, inst); + return 1; + + case 0xf000: case 0xf400: case 0xf800: case 0xfc00: + util::stream_format(stream, "%-8sAC%d,", "SKNE", (inst & 0x0c00) >> 10); + format_ea(stream, pc, inst); + return 1 | STEP_OVER; + + default: + util::stream_format(stream, "%-8s", ".WORD"); + format_addr(stream, inst); + return 1; + } +} diff --git a/src/devices/cpu/pace/pacedasm.h b/src/devices/cpu/pace/pacedasm.h new file mode 100644 index 00000000000..19471e0950a --- /dev/null +++ b/src/devices/cpu/pace/pacedasm.h @@ -0,0 +1,36 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + National Semiconductor PACE (IPC-16, INS8900) disassembler + +***************************************************************************/ + +#ifndef MAME_CPU_PACE_PACEDASM_H +#define MAME_CPU_PACE_PACEDASM_H + +#pragma once + +class pace_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + pace_disassembler(); + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + // internal helpers + void format_addr(std::ostream &stream, u16 addr); + void format_disp(std::ostream &stream, u8 disp); + void format_ea(std::ostream &stream, u16 pc, u16 inst); + + // tables + static const char *const s_cc[16]; + static const char *const s_flags[16]; +}; + +#endif // MAME_CPU_PACE_PACEDASM_H diff --git a/src/devices/cpu/pic16c5x/16c5xdsm.cpp b/src/devices/cpu/pic16c5x/16c5xdsm.cpp index a748b553cd3..65f931df057 100644 --- a/src/devices/cpu/pic16c5x/16c5xdsm.cpp +++ b/src/devices/cpu/pic16c5x/16c5xdsm.cpp @@ -26,7 +26,7 @@ #include "emu.h" #include "16c5xdsm.h" -#include <ctype.h> +#include <cctype> #include <stdexcept> diff --git a/src/devices/cpu/pic16c62x/16c62xdsm.cpp b/src/devices/cpu/pic16c62x/16c62xdsm.cpp index 3b1dcdfca57..1e088fbb05c 100644 --- a/src/devices/cpu/pic16c62x/16c62xdsm.cpp +++ b/src/devices/cpu/pic16c62x/16c62xdsm.cpp @@ -29,7 +29,7 @@ #include "emu.h" #include "16c62xdsm.h" -#include <ctype.h> +#include <cctype> #include <stdexcept> diff --git a/src/devices/cpu/pic16c62x/pic16c62x.cpp b/src/devices/cpu/pic16c62x/pic16c62x.cpp index d7cdb791b8b..6263fd04f42 100644 --- a/src/devices/cpu/pic16c62x/pic16c62x.cpp +++ b/src/devices/cpu/pic16c62x/pic16c62x.cpp @@ -123,10 +123,15 @@ void pic16c62x_device::pic16c62xa_ram(address_map &map) pic16c62x_device::pic16c62x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int picmodel) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, program_width, -1 - , ( ( program_width == 9 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c62x_rom_9), this) : ( ( program_width == 10 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c62x_rom_10), this) : address_map_constructor(FUNC(pic16c62x_device::pic16c62x_rom_11), this) ))) + , ( ( program_width == 9 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c62x_rom_9), this) : + ( ( program_width == 10 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c62x_rom_10), this) : + address_map_constructor(FUNC(pic16c62x_device::pic16c62x_rom_11), this) ))) , m_data_config("data", ENDIANNESS_LITTLE, 8, 8, 0 - , ( ( picmodel == 0x16C620 || picmodel == 0x16C621 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c620_ram), this) : ( ( picmodel == 0x16C622 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c622_ram), this) : address_map_constructor(FUNC(pic16c62x_device::pic16c62xa_ram), this) ) ) ) + , ( ( picmodel == 0x16C620 || picmodel == 0x16C621 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c620_ram), this) : + ( ( picmodel == 0x16C622 ) ? address_map_constructor(FUNC(pic16c62x_device::pic16c622_ram), this) : + address_map_constructor(FUNC(pic16c62x_device::pic16c62xa_ram), this) ) ) ) , m_io_config("io", ENDIANNESS_LITTLE, 8, 5, 0) + , m_CONFIG(0x3fff) , m_reset_vector(0x0) , m_picmodel(picmodel) , m_picRAMmask(0xff) @@ -145,22 +150,22 @@ pic16c620a_device::pic16c620a_device(const machine_config &mconfig, const char * } pic16c621_device::pic16c621_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : pic16c62x_device(mconfig, PIC16C621, tag, owner, clock, 9, 0x16C621) + : pic16c62x_device(mconfig, PIC16C621, tag, owner, clock, 10, 0x16C621) { } pic16c621a_device::pic16c621a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : pic16c62x_device(mconfig, PIC16C621A, tag, owner, clock, 9, 0x16C621A) + : pic16c62x_device(mconfig, PIC16C621A, tag, owner, clock, 10, 0x16C621A) { } pic16c622_device::pic16c622_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : pic16c62x_device(mconfig, PIC16C622, tag, owner, clock, 9, 0x16C622) + : pic16c62x_device(mconfig, PIC16C622, tag, owner, clock, 11, 0x16C622) { } pic16c622a_device::pic16c622a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : pic16c62x_device(mconfig, PIC16C622A, tag, owner, clock, 9, 0x16C622A) + : pic16c62x_device(mconfig, PIC16C622A, tag, owner, clock, 11, 0x16C622A) { } @@ -169,7 +174,8 @@ device_memory_interface::space_config_vector pic16c62x_device::memory_space_conf { return space_config_vector{ std::make_pair(AS_PROGRAM, &m_program_config), - std::make_pair(AS_DATA, &m_data_config) + std::make_pair(AS_DATA, &m_data_config), + std::make_pair(AS_IO, &m_io_config) }; } @@ -339,6 +345,7 @@ uint16_t pic16c62x_device::POP_STACK() m_STACK[1] = m_STACK[0]; return (data & ADDR_MASK); } + void pic16c62x_device::PUSH_STACK(uint16_t data) { m_STACK[0] = m_STACK[1]; @@ -885,8 +892,6 @@ void pic16c62x_device::device_start() m_data = &space(AS_DATA); m_io = &space(AS_IO); - m_CONFIG = 0x3fff; - /* ensure the internal ram pointers are set before get_info is called */ update_internalram_ptr(); @@ -1045,7 +1050,7 @@ void pic16c62x_device::pic16c62x_soft_reset() pic16c62x_reset_regs(); } -void pic16c62x_device::pic16c62x_set_config(int data) +void pic16c62x_device::set_config(int data) { logerror("Writing %04x to the PIC16C62x configuration bits\n",data); m_CONFIG = (data & 0x3fff); diff --git a/src/devices/cpu/pic16c62x/pic16c62x.h b/src/devices/cpu/pic16c62x/pic16c62x.h index a3be8637765..517191f7f37 100644 --- a/src/devices/cpu/pic16c62x/pic16c62x.h +++ b/src/devices/cpu/pic16c62x/pic16c62x.h @@ -53,6 +53,9 @@ DECLARE_DEVICE_TYPE(PIC16C622A, pic16c622a_device) class pic16c62x_device : public cpu_device { +public: + void set_config(int data); + protected: // construction/destruction pic16c62x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int picmodel); @@ -189,7 +192,6 @@ private: void build_opcode_table(void); void pic16c62x_reset_regs(); void pic16c62x_soft_reset(); - void pic16c62x_set_config(int data); void pic16c62x_update_watchdog(int counts); void pic16c62x_update_timer(int counts); diff --git a/src/devices/cpu/rx01/rx01.cpp b/src/devices/cpu/rx01/rx01.cpp new file mode 100644 index 00000000000..75eb2f91578 --- /dev/null +++ b/src/devices/cpu/rx01/rx01.cpp @@ -0,0 +1,419 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC RX01 skeleton CPU device + + This TTL disk control processor executes its custom instruction set at + the rather brisk rate of 200 ns per machine cycle. However, it has no + ALU or general-purpose data bus, so most of its operations amount to + simple manipulations of an assortment of synchronous up counters, shift + registers and flip-flops. + + The instruction memory is organized as a series of 256-byte "fields" + which limit the extent of conditional branches. The architecture allows + for up to 16 fields, although the original hardware only implements F0 + through F5. DEC's documentation treats the program counter as being + only 8 bits, calling the upper 4 bits the field counter. This emulation + treats PC and FC as a single 12-bit register since the overflow carry + from the lower counters is in fact linked to the upper counter, even + though the actual microcode does not rely on this. + + The CRC LFSR is implemented using three 74174 registers using negative + logic, since these TTL ICs can be cleared but not preset. + +***************************************************************************/ + +#include "emu.h" +#include "rx01.h" +#include "rx01dasm.h" + +//#define VERBOSE 1 +#include "logmacro.h" + +// device type definition +DEFINE_DEVICE_TYPE(RX01_CPU, rx01_cpu_device, "rx01_cpu", "DEC RX01 CPU") + +rx01_cpu_device::rx01_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig, RX01_CPU, tag, owner, clock) + , m_inst_config("program", ENDIANNESS_LITTLE, 8, 12, 0) + , m_sp_config("scratchpad", ENDIANNESS_LITTLE, 8, 4, 0, address_map_constructor(FUNC(rx01_cpu_device::scratchpad_map), this)) + , m_inst_cache(nullptr) + , m_sp_cache(nullptr) + , m_pc(0) + , m_ppc(0) + , m_mb(0) + , m_br_condition(false) + , m_inst_disable(false) + , m_inst_repeat(false) + , m_cntr(0) + , m_sr(0) + , m_spar(0) + , m_bar(0) + , m_crc(0) + , m_flags(0) + , m_unit(false) + , m_load_head(false) + , m_icount(0) +{ + m_inst_config.m_is_octal = true; + m_sp_config.m_is_octal = true; +} + +std::unique_ptr<util::disasm_interface> rx01_cpu_device::create_disassembler() +{ + return std::make_unique<rx01_disassembler>(); +} + +void rx01_cpu_device::scratchpad_map(address_map &map) +{ + map(0, 15).ram().share("scratchpad"); // two 7489 16x4 register files +} + +device_memory_interface::space_config_vector rx01_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_inst_config), + std::make_pair(AS_DATA, &m_sp_config) + }; +} + +void rx01_cpu_device::device_start() +{ + m_inst_cache = space(AS_PROGRAM).cache<0, 0, ENDIANNESS_LITTLE>(); + m_sp_cache = space(AS_DATA).cache<0, 0, ENDIANNESS_LITTLE>(); + + set_icountptr(m_icount); + + // Debug state registration + state_add(RX01_PC, "PC", m_pc).mask(07777).formatstr("%04O"); + state_add(STATE_GENPC, "GENPC", m_pc).mask(07777).formatstr("%04O").noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_pc).mask(07777).formatstr("%04O").noshow(); + state_add(STATE_GENFLAGS, "FLAGS", m_flags).formatstr("%12s").noshow(); + state_add(RX01_CNTR, "CNTR", m_cntr).formatstr("%03O"); + state_add(RX01_SR, "SR", m_sr).formatstr("%03O"); + state_add(RX01_SPAR, "SPAR", m_spar).mask(15).formatstr("%3s"); + u8 *sp = static_cast<u8 *>(memshare("scratchpad")->ptr()); + for (int r = 0; r < 16; r++) + state_add(RX01_R0 + r, string_format("R%d", r).c_str(), sp[r]).formatstr("%03O"); + state_add(RX01_BAR, "BAR", m_bar).mask(07777).formatstr("%04O"); + state_add(RX01_CRC, "CRC", m_crc).formatstr("%06O"); + state_add(RX01_UNIT, "UNIT", m_unit); + state_add(RX01_LDHD, "LDHD", m_load_head); + + // Save state registration + save_item(NAME(m_pc)); + save_item(NAME(m_ppc)); + save_item(NAME(m_mb)); + save_item(NAME(m_br_condition)); + save_item(NAME(m_inst_disable)); + save_item(NAME(m_inst_repeat)); + save_item(NAME(m_cntr)); + save_item(NAME(m_sr)); + save_item(NAME(m_spar)); + save_item(NAME(m_bar)); + save_item(NAME(m_crc)); + save_item(NAME(m_flags)); + save_item(NAME(m_unit)); + save_item(NAME(m_load_head)); +} + +void rx01_cpu_device::device_reset() +{ + // Clear address registers, counters and flags + m_pc = 0; + m_mb = 0; + m_inst_disable = false; + m_inst_repeat = false; + m_bar = 0; + m_cntr = 0; + m_sr = 0; + m_spar = 0; + m_flags = 0; + m_unit = false; + m_load_head = false; +} + +u8 rx01_cpu_device::mux_out() +{ + if (BIT(m_mb, 0)) + return m_sp_cache->read_byte(m_spar); + else + return m_inst_cache->read_byte(m_pc); +} + +bool rx01_cpu_device::sep_data() +{ + // TODO + return false; +} + +bool rx01_cpu_device::missing_clk() +{ + // TODO + return false; +} + +bool rx01_cpu_device::drv_sel_trk0() +{ + // TODO + return false; +} + +bool rx01_cpu_device::test_condition() +{ + switch (m_mb & 074) + { + case 000: + // Interface transfer request or command pending (TODO) + return false; + + case 004: + // Output buffer bit 3 + return (m_flags & FF_IOB3) != 0; + + case 020: + // MSB of shift register + return BIT(m_sr, 7); + + case 024: + // Counter overflow + return m_cntr == 0377; + + case 030: + // 16th stage of CRC generator + return BIT(m_crc, 0); + + case 034: + // Track zero of selected drive on head + return (m_flags & FF_IOB0) && (m_flags & FF_IOB3) && drv_sel_trk0(); + + case 054: + // Separated data equals shift register MSB + return BIT(m_sr, 7) == sep_data(); + + case 060: + // Sector buffer address overflow + return m_bar == 07777; + + case 064: + // Missing clock equals shift register MSB + return BIT(m_sr, 7) == missing_clk(); + + case 074: + // Flag state equals one + return (m_flags & FF_FLAG) != 0; + + default: + LOG("%04o: Unhandled branch condition %d\n", m_ppc, (m_mb & 074) >> 2); + return true; + } +} + +void rx01_cpu_device::shift_crc(bool data) +{ + // TODO: double-check algorithm + if (data == BIT(m_crc, 0)) + m_crc = (m_crc >> 1) ^ 0002010; + else + m_crc = (m_crc >> 1) | 0100000; +} + +void rx01_cpu_device::set_flag(bool j, bool k) +{ + if (j && !(m_flags & FF_FLAG)) + m_flags |= FF_FLAG; + else if (k && (m_flags & FF_FLAG)) + m_flags &= ~FF_FLAG; +} + +void rx01_cpu_device::execute_run() +{ + while (m_icount > 0) + { + if (m_inst_disable) + { + if ((m_mb & 0302) == 0202) + m_pc = u16(m_mb & 074) << 6 | mux_out(); + else if (BIT(m_mb, 6) && m_br_condition) + m_pc = ((m_pc + 1) & 07400) | mux_out(); + else + m_pc = (m_pc + 1) & 07777; + + m_inst_disable = false; + m_inst_repeat = false; + } + else + { + if (!m_inst_repeat) + { + m_ppc = m_pc; + debugger_instruction_hook(m_pc); + + m_mb = m_inst_cache->read_byte(m_pc); + m_pc = (m_pc + 1) & 03777; + } + + if (BIT(m_mb, 6)) + { + m_br_condition = test_condition() == BIT(m_mb, 1); + if (BIT(m_mb, 7)) + { + m_inst_disable = m_cntr == 0377 || m_br_condition; + m_inst_repeat = m_cntr != 0377 && !m_br_condition; + m_cntr++; + } + else + m_inst_disable = true; + } + else if (BIT(m_mb, 7)) + { + if (BIT(m_mb, 1)) + m_inst_disable = true; + else + m_spar = (m_mb & 074) >> 2; + } + else switch (m_mb & 074) + { + case 000: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB0; + else + m_flags &= ~FF_IOB0; + break; + + case 004: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB1; + else + m_flags &= ~FF_IOB1; + break; + + case 010: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB2; + else + m_flags &= ~FF_IOB2; + break; + + case 014: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB3; + else + m_flags &= ~FF_IOB3; + break; + + case 020: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB4; + else + m_flags &= ~FF_IOB4; + break; + + case 024: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB5; + else + m_flags &= ~FF_IOB5; + break; + + case 030: + if (BIT(m_mb, 1)) + m_flags |= FF_IOB6; + else + m_flags &= ~FF_IOB6; + break; + + case 034: + m_unit = BIT(m_mb, 1); + break; + + case 040: + m_load_head = BIT(m_mb, 1); + break; + + case 044: + if (BIT(m_mb, 1)) + m_bar = (m_bar + 1) & 07777; + else + m_bar = BIT(m_mb, 0) ? 0 : 06000; + break; + + case 050: + if (BIT(m_mb, 0)) + m_flags |= FF_WRTBUF; + else + m_flags &= ~FF_WRTBUF; + break; + + case 054: + if ((m_mb & 3) == 3) + m_crc = 0177777; + else if (BIT(m_mb, 0)) + shift_crc(sep_data()); + else + shift_crc(BIT(m_mb, 1)); + break; + + case 060: + set_flag(BIT(m_mb, 1), BIT(m_mb, 0)); + break; + + case 064: + m_sp_cache->write_byte(m_spar, m_sr); + break; + + case 070: + if (BIT(m_mb, 1)) + m_cntr++; + else + m_cntr = mux_out(); + m_inst_disable = !BIT(m_mb, 0); + break; + + case 074: + if ((m_mb & 3) == 1) + m_sr = m_cntr; + else if (BIT(m_mb, 0)) + m_sr = (m_sr << 1) | sep_data(); + else + m_sr = (m_sr << 1) | BIT(m_mb, 1); + break; + } + } + + m_icount--; + } +} + +void rx01_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + if (m_flags & FF_IOB0) + str = string_format("D%c%c%c%c%c%c %4s", + (m_flags & FF_WRTBUF) ? 'B' : ':', + (m_flags & FF_IOB1) ? 'W' : '.', + (m_flags & FF_IOB2) ? 'S' : '.', + (m_flags & FF_IOB3) ? 'H' : '.', + (m_flags & FF_IOB4) ? 'E' : '.', + (m_flags & FF_IOB5) ? 'T' : '.', + (m_flags & FF_FLAG) ? ((m_flags & FF_IOB1) ? "DATA" : "FLAG") : ""); + else + str = string_format("I%c%c%c%c%c%c %s %c", + (m_flags & FF_WRTBUF) ? 'B' : ':', + (m_flags & FF_IOB1) ? 'E' : '.', + (m_flags & FF_IOB2) ? 'R' : '.', + (m_flags & FF_IOB3) ? 'O' : '.', + (m_flags & FF_IOB4) ? 'D' : '.', + (m_flags & FF_IOB5) ? 'S' : '.', + (m_flags & FF_IOB6) ? "SB" : "SR", + (m_flags & FF_FLAG) ? 'F' : ' '); + break; + + case RX01_SPAR: + str = string_format("R%-2d", m_spar); + break; + } +} diff --git a/src/devices/cpu/rx01/rx01.h b/src/devices/cpu/rx01/rx01.h new file mode 100644 index 00000000000..4ff3cba99d9 --- /dev/null +++ b/src/devices/cpu/rx01/rx01.h @@ -0,0 +1,94 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_RX01_RX01_H +#define MAME_CPU_RX01_RX01_H + +#pragma once + +class rx01_cpu_device : public cpu_device +{ +public: + enum { + RX01_PC, + RX01_CNTR, RX01_SR, RX01_SPAR, + RX01_R0, RX01_R1, RX01_R2, RX01_R3, RX01_R4, RX01_R5, RX01_R6, RX01_R7, + RX01_R8, RX01_R9, RX01_R10, RX01_R11, RX01_R12, RX01_R13, RX01_R14, RX01_R15, + RX01_BAR, + RX01_CRC, + RX01_UNIT, RX01_LDHD + }; + + enum : u16 { + FF_IOB0 = 1 << 0, + FF_IOB1 = 1 << 1, + FF_IOB2 = 1 << 2, + FF_IOB3 = 1 << 3, + FF_IOB4 = 1 << 4, + FF_IOB5 = 1 << 5, + FF_IOB6 = 1 << 6, + FF_WRTBUF = 1 << 7, + FF_FLAG = 1 << 8 + }; + + // device type constructor + rx01_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } + virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } + virtual void execute_run() override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // device_state_interface overrides + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + +private: + void scratchpad_map(address_map &map); + + // internal helpers + u8 mux_out(); + bool sep_data(); + bool missing_clk(); + bool drv_sel_trk0(); + bool test_condition(); + void shift_crc(bool data); + void set_flag(bool j, bool k); + + // address spaces + address_space_config m_inst_config; + address_space_config m_sp_config; + memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_inst_cache; + memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_sp_cache; + + // internal state + u16 m_pc; + u16 m_ppc; + u8 m_mb; + bool m_br_condition; + bool m_inst_disable; + bool m_inst_repeat; + u8 m_cntr; + u8 m_sr; + u8 m_spar; + u16 m_bar; + u16 m_crc; + u16 m_flags; + bool m_unit; + bool m_load_head; + s32 m_icount; +}; + +DECLARE_DEVICE_TYPE(RX01_CPU, rx01_cpu_device) + +#endif // MAME_CPU_RX01_RX01_H diff --git a/src/devices/cpu/rx01/rx01dasm.cpp b/src/devices/cpu/rx01/rx01dasm.cpp new file mode 100644 index 00000000000..978d9398014 --- /dev/null +++ b/src/devices/cpu/rx01/rx01dasm.cpp @@ -0,0 +1,182 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC RX01 microcode disassembler + +***************************************************************************/ + +#include "emu.h" +#include "rx01dasm.h" + +rx01_disassembler::rx01_disassembler() + : util::disasm_interface() +{ +} + +const char *const rx01_disassembler::s_0_or_1[2] = { + "ZERO", + "ONE" +}; + +const char *const rx01_disassembler::s_conditions[16] = { + "RUN", + "IOB3OT", + "DATAIN", + "INDX", + "SR7", + "COFL", + "CRC16", + "HOME", + "WRTEN", + "SEPCLK", + "XIIBIT", + "DEQSR7", + "BAROFL", + "MCEQSH", + "BDATAO", + "FLAGO" +}; + +const char *const rx01_disassembler::s_flag_control[4] = { + "NOP", + "OFF", + "ON", + "TOG" +}; + +u32 rx01_disassembler::opcode_alignment() const +{ + return 1; +} + +offs_t rx01_disassembler::disassemble(std::ostream &stream, offs_t pc, const rx01_disassembler::data_buffer &opcodes, const rx01_disassembler::data_buffer ¶ms) +{ + u8 opcode = opcodes.r8(pc); + + if (BIT(opcode, 6)) + { + // Branch instructions + util::stream_format(stream, "%sBR %s ", + BIT(opcode, 7) ? "W" : "", + s_conditions[(opcode & 074) >> 2]); + if ((opcode & 074) == 020) + stream << s_0_or_1[BIT(opcode, 1)]; + else + stream << (BIT(opcode, 1) ? "T" : "F"); + if (BIT(opcode, 0)) + { + stream << " IND"; + return 1 | (BIT(opcode, 7) ? STEP_OVER : 0) | SUPPORTED; + } + else + { + util::stream_format(stream, " %04o", ((pc + 2) & 07400) | opcodes.r8(pc + 1)); + return 2 | (BIT(opcode, 7) ? STEP_OVER : 0) | SUPPORTED; + } + } + else if (BIT(opcode, 7)) + { + if (BIT(opcode, 1)) + { + stream << "JUMP "; + if (BIT(opcode, 0)) + { + util::stream_format(stream, "F%d IND", (opcode & 074) >> 2); + return 1 | SUPPORTED; + } + else + { + util::stream_format(stream, "%04o", u16(opcode & 074) << 6 | opcodes.r8(pc + 1)); + return 2 | SUPPORTED; + } + } + else + { + // Clock scratchpad address register + util::stream_format(stream, "OPEN R%d", (opcode & 074) >> 2); + return 1 | SUPPORTED; + } + } + else switch (opcode & 074) + { + case 000: case 004: case 010: case 014: case 020: case 024: case 030: + // IOB flip-flops for drive or interface + util::stream_format(stream, "%s IOB%d", BIT(opcode, 1) ? "SET" : "CLR", (opcode & 074) >> 2); + return 1 | SUPPORTED; + + case 034: + // Drive select + util::stream_format(stream, "UNIT %s", s_0_or_1[BIT(opcode, 1)]); + return 1 | SUPPORTED; + + case 040: + // Head load/unload + util::stream_format(stream, "%sHD", BIT(opcode, 1) ? "LD" : "UN"); + return 1 | SUPPORTED; + + case 044: + // Clock buffer address register + if (BIT(opcode, 1)) + stream << "INCR BAR"; + else + util::stream_format(stream, "CLR BAR %s", BIT(opcode, 0) ? "LONG" : "SHORT"); + return 1 | SUPPORTED; + + case 050: + // Sector data buffer write + util::stream_format(stream, "%s WRTBUF", BIT(opcode, 0) ? "START" : "FIN"); + return 1 | SUPPORTED; + + case 054: + // Shift/preset CRC + if (BIT(opcode, 0)) + util::stream_format(stream, "%sCRC", BIT(opcode, 1) ? "PRE" : "DAT"); + else + util::stream_format(stream, "CRC %s", s_0_or_1[BIT(opcode, 1)]); + return 1 | SUPPORTED; + + case 060: + // Clock flag flip-flop (J/K) + util::stream_format(stream, "%s FLAG", s_flag_control[opcode & 3]); + return 1 | SUPPORTED; + + case 064: + // Write to scratchpad + stream << "LSP"; + return 1 | SUPPORTED; + + case 070: + // Clock counter + if (BIT(opcode, 1)) + { + stream << "ICT"; + return 1 | SUPPORTED; + } + else if (BIT(opcode, 0)) + { + stream << "ESP"; + return 1 | SUPPORTED; + } + else + { + util::stream_format(stream, "LCT %03o", opcodes.r8(pc + 1)); + return 2 | SUPPORTED; + } + + case 074: + // Clock shift register + if (!BIT(opcode, 0)) + util::stream_format(stream, "ROTATE %s", s_0_or_1[BIT(opcode, 1)]); + else if (BIT(opcode, 1)) + stream << "DATSR"; + else + stream << "LSR"; + return 1 | SUPPORTED; + + default: + // This should never happen + util::stream_format(stream, ".BYTE %03o", opcode); + return 1 | SUPPORTED; + } +} diff --git a/src/devices/cpu/rx01/rx01dasm.h b/src/devices/cpu/rx01/rx01dasm.h new file mode 100644 index 00000000000..047ed2c39ef --- /dev/null +++ b/src/devices/cpu/rx01/rx01dasm.h @@ -0,0 +1,27 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_RX01_RX01DASM_H +#define MAME_CPU_RX01_RX01DASM_H + +#pragma once + +class rx01_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + rx01_disassembler(); + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + // tables + static const char *const s_0_or_1[2]; + static const char *const s_conditions[16]; + static const char *const s_flag_control[4]; +}; + +#endif // MAME_CPU_RX01_RX01DASM_H diff --git a/src/devices/cpu/s2650/2650dasm.cpp b/src/devices/cpu/s2650/2650dasm.cpp index 34b144532d2..871ea354594 100644 --- a/src/devices/cpu/s2650/2650dasm.cpp +++ b/src/devices/cpu/s2650/2650dasm.cpp @@ -45,7 +45,7 @@ std::string s2650_disassembler::IMM(offs_t pc, const data_buffer ¶ms) const char s2650_disassembler::cc[4] = { 'z', 'p', 'm', 'a' }; -void s2650_disassembler::add(std::string &buf, std::string str) +void s2650_disassembler::add(std::string &buf, const std::string &str) { if(!buf.empty()) buf += '+'; diff --git a/src/devices/cpu/s2650/2650dasm.h b/src/devices/cpu/s2650/2650dasm.h index 15f04cdffa7..cb5db5f85c8 100644 --- a/src/devices/cpu/s2650/2650dasm.h +++ b/src/devices/cpu/s2650/2650dasm.h @@ -34,7 +34,7 @@ private: static const int rel[0x100]; static const char cc[4]; - void add(std::string &buf, std::string str); + void add(std::string &buf, const std::string &str); std::string SYM(int addr); std::string IMM(offs_t pc, const data_buffer ¶ms); std::string IMM_PSL(offs_t pc, const data_buffer ¶ms); diff --git a/src/devices/cpu/s2650/s2650.cpp b/src/devices/cpu/s2650/s2650.cpp index 0b306682249..8ef7be2a0ad 100644 --- a/src/devices/cpu/s2650/s2650.cpp +++ b/src/devices/cpu/s2650/s2650.cpp @@ -25,14 +25,14 @@ #define INLINE_EA 1 -DEFINE_DEVICE_TYPE(S2650, s2650_device, "s2650", "Signetics S2650") +DEFINE_DEVICE_TYPE(S2650, s2650_device, "s2650", "Signetics 2650") s2650_device::s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, S2650, tag, owner, clock) - , m_program_config("program", ENDIANNESS_LITTLE, 8, 15) - , m_io_config("io", ENDIANNESS_LITTLE, 8, 8) - , m_data_config("data", ENDIANNESS_LITTLE, 8, 1) + , m_program_config("program", ENDIANNESS_BIG, 8, 15) + , m_io_config("io", ENDIANNESS_BIG, 8, 8) + , m_data_config("data", ENDIANNESS_BIG, 8, 1) , m_sense_handler(*this) , m_flag_handler(*this), m_intack_handler(*this) , m_ppc(0), m_page(0), m_iar(0), m_ea(0), m_psl(0), m_psu(0), m_r(0) @@ -826,7 +826,7 @@ void s2650_device::device_start() m_flag_handler.resolve_safe(); m_intack_handler.resolve_safe(); - m_cache = space(AS_PROGRAM).cache<0, 0, ENDIANNESS_LITTLE>(); + m_cache = space(AS_PROGRAM).cache<0, 0, ENDIANNESS_BIG>(); save_item(NAME(m_ppc)); save_item(NAME(m_page)); diff --git a/src/devices/cpu/s2650/s2650.h b/src/devices/cpu/s2650/s2650.h index 73a6db57082..af883c740a3 100644 --- a/src/devices/cpu/s2650/s2650.h +++ b/src/devices/cpu/s2650/s2650.h @@ -84,7 +84,7 @@ private: uint8_t m_irq_state; int m_icount; - memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_cache; + memory_access_cache<0, 0, ENDIANNESS_BIG> *m_cache; // For debugger uint16_t m_debugger_temp; diff --git a/src/devices/cpu/sc61860/readpc.cpp b/src/devices/cpu/sc61860/readpc.cpp index 46afbbf8a3e..bdd3928b48e 100644 --- a/src/devices/cpu/sc61860/readpc.cpp +++ b/src/devices/cpu/sc61860/readpc.cpp @@ -7,7 +7,7 @@ #include <fcntl.h> #include <unistd.h> #endif -#include <stdio.h> +#include <cstdio> #include <dos.h> // gcc -O diff --git a/src/devices/cpu/sh/sh3comn.cpp b/src/devices/cpu/sh/sh3comn.cpp index 6871a1aef01..77f4b079414 100644 --- a/src/devices/cpu/sh/sh3comn.cpp +++ b/src/devices/cpu/sh/sh3comn.cpp @@ -123,10 +123,12 @@ READ32_MEMBER( sh3_base_device::sh3_internal_high_r ) return m_sh3internal_upper[offset]; case SH3_INTEVT_ADDR: - logerror("'%s' (%08x): unmapped internal read from %08x mask %08x (SH3 INTEVT - %08x)\n",tag(), m_sh2_state->pc & SH34_AM,(offset *4)+SH3_UPPER_REGBASE,mem_mask, m_sh3internal_upper[offset]); - fatalerror("INTEVT unsupported on SH3\n"); - // never executed - //return m_sh3internal_upper[offset]; + //logerror("'%s' (%08x): unmapped internal read from %08x mask %08x (SH3 INTEVT - %08x)\n",tag(), m_sh2_state->pc & SH34_AM,(offset *4)+SH3_UPPER_REGBASE,mem_mask, m_sh3internal_upper[offset]); + return m_sh3internal_upper[offset]; + + case SH3_SCSSR_ADDR: + // hack until SCI is not implemented + return 0x84<<24; default: diff --git a/src/devices/cpu/sh/sh3comn.h b/src/devices/cpu/sh/sh3comn.h index 241035b993e..30f8e59ab68 100644 --- a/src/devices/cpu/sh/sh3comn.h +++ b/src/devices/cpu/sh/sh3comn.h @@ -78,6 +78,8 @@ #define SH3_ICR0_IPRA_ADDR ((0xfffffee0 - SH3_UPPER_REGBASE)/4) #define SH3_IPRB_ADDR ((0xfffffee4 - SH3_UPPER_REGBASE)/4) +#define SH3_SCSSR_ADDR ((0xfffffe88 - SH3_UPPER_REGBASE)/4) + #define SH3_TOCR_TSTR_ADDR ((0xfffffe90 - SH3_UPPER_REGBASE)/4) #define SH3_TCOR0_ADDR ((0xfffffe94 - SH3_UPPER_REGBASE)/4) #define SH3_TCNT0_ADDR ((0xfffffe98 - SH3_UPPER_REGBASE)/4) diff --git a/src/devices/cpu/sh/sh4.cpp b/src/devices/cpu/sh/sh4.cpp index 636bcd05ddb..b646882e0dc 100644 --- a/src/devices/cpu/sh/sh4.cpp +++ b/src/devices/cpu/sh/sh4.cpp @@ -1569,7 +1569,21 @@ void sh34_base_device::device_reset() m_nmi_line_state = 0; m_sh2_state->m_frt_input = 0; m_internal_irq_vector = 0; + for (int i = 0; i < 3; i++) + { + if (m_timer[i]) + m_timer[i]->adjust(attotime::never, i); + } + for (int i = 0; i < 4; i++) + { + if (m_dma_timer[i]) + m_dma_timer[i]->adjust(attotime::never, i); + } + if (m_refresh_timer) + m_refresh_timer->adjust(attotime::never); m_refresh_timer_base = 0; + if (m_rtc_timer) + m_rtc_timer->adjust(attotime::never); memset(m_dma_timer_active, 0, sizeof(m_dma_timer_active)); memset(m_dma_source, 0, sizeof(m_dma_source)); memset(m_dma_destination, 0, sizeof(m_dma_destination)); diff --git a/src/devices/cpu/sh/sh4comn.cpp b/src/devices/cpu/sh/sh4comn.cpp index 8c3e8cbc82c..4eaa267c31e 100644 --- a/src/devices/cpu/sh/sh4comn.cpp +++ b/src/devices/cpu/sh/sh4comn.cpp @@ -147,7 +147,7 @@ static const int exception_codes[] = static const int sh3_intevt2_exception_codes[] = { 0x000, /* Power-on Reset */ - -1, /* Manual Reset */ + 0x020, /* Manual Reset */ -1, /* H-UDI Reset */ -1, /* Inst TLB Multiple Hit */ -1, /* Data TLB Multiple Hit */ @@ -169,26 +169,26 @@ static const int sh3_intevt2_exception_codes[] = -1, /* FPU Exception */ -1, /* Initial Page Write exception */ - -1, /* Unconditional TRAP */ + 0x160, /* Unconditional TRAP */ -1, /* User break After Instruction */ - -1, /* NMI */ /* SH4_INTC_NMI=23 represents this location in this list.. */ - - -1, /* EX Irq 0 */ - -1, /* 1 */ - -1, /* 2 */ - -1, /* 3 */ - -1, /* 4 */ - -1, /* 5 */ - -1, /* 6 */ - -1, /* 7 */ - -1, /* 8 */ - -1, /* 9 */ - -1, /* A */ - -1, /* B */ - -1, /* C */ - -1, /* D */ - -1, /* E */ + 0x1C0, /* NMI */ /* SH4_INTC_NMI=23 represents this location in this list.. */ + + 0x200, /* EX Irq 0 */ + 0x220, /* 1 */ + 0x240, /* 2 */ + 0x260, /* 3 */ + 0x280, /* 4 */ + 0x2A0, /* 5 */ + 0x2C0, /* 6 */ + 0x2E0, /* 7 */ + 0x300, /* 8 */ + 0x320, /* 9 */ + 0x340, /* A */ + 0x360, /* B */ + 0x380, /* C */ + 0x3A0, /* D */ + 0x3C0, /* E */ 0x600, /* SH4_INTC_IRL0 */ 0x620, /* SH4_INTC_IRL1 */ @@ -198,10 +198,10 @@ static const int sh3_intevt2_exception_codes[] = -1, /* HUDI */ -1, /* SH4_INTC_GPOI */ - -1, /* SH4_INTC_DMTE0 */ - -1, /* SH4_INTC_DMTE1 */ - -1, /* SH4_INTC_DMTE2 */ - -1, /* SH4_INTC_DMTE3 */ + 0x800, /* SH4_INTC_DMTE0 */ + 0x820, /* SH4_INTC_DMTE1 */ + 0x840, /* SH4_INTC_DMTE2 */ + 0x860, /* SH4_INTC_DMTE3 */ -1, /* SH4_INTC_DMTE4 */ -1, /* SH4_INTC_DMTE5 */ @@ -458,6 +458,10 @@ void sh34_base_device::sh4_exception(const char *message, int exception) // hand m_sh3internal_lower[INTEVT2] = sh3_intevt2_exception_codes[exception]; m_sh3internal_upper[SH3_EXPEVT_ADDR] = exception_codes[exception]; + if (sh3_intevt2_exception_codes[exception] >= 0x600) + m_sh3internal_upper[SH3_INTEVT_ADDR] = 0x3E0 - ((m_exception_priority[exception] >> 8) & 255) * 0x20; + else + m_sh3internal_upper[SH3_INTEVT_ADDR] = sh3_intevt2_exception_codes[exception]; LOG(("SH-3 '%s' interrupt exception #%d after [%s]\n", tag(), exception, message)); diff --git a/src/devices/cpu/sharc/compute.hxx b/src/devices/cpu/sharc/compute.hxx index 766d7be044f..077788f3c3c 100644 --- a/src/devices/cpu/sharc/compute.hxx +++ b/src/devices/cpu/sharc/compute.hxx @@ -2,7 +2,7 @@ // copyright-holders:Ville Linde /* compute operations */ -#include <math.h> +#include <cmath> #define CLEAR_ALU_FLAGS() (m_core->astat &= ~(AZ|AN|AV|AC|AS|AI)) diff --git a/src/devices/cpu/spc700/spc700.cpp b/src/devices/cpu/spc700/spc700.cpp index b5d2b835cfc..7855bf77b1b 100644 --- a/src/devices/cpu/spc700/spc700.cpp +++ b/src/devices/cpu/spc700/spc700.cpp @@ -67,7 +67,7 @@ Address Function Register R/W When Reset Remarks #include "debugger.h" -#include <limits.h> +#include <climits> /* ======================================================================== */ diff --git a/src/devices/cpu/t11/t11.cpp b/src/devices/cpu/t11/t11.cpp index a4d52ffceb9..a93f69ae90e 100644 --- a/src/devices/cpu/t11/t11.cpp +++ b/src/devices/cpu/t11/t11.cpp @@ -279,15 +279,15 @@ void t11_device::device_start() save_item(NAME(m_irq_state)); // Register debugger state - state_add( T11_PC, "PC", m_reg[7].w.l).formatstr("%04X"); - state_add( T11_SP, "SP", m_reg[6].w.l).formatstr("%04X"); - state_add( T11_PSW, "PSW", m_psw.b.l).formatstr("%02X"); - state_add( T11_R0, "R0", m_reg[0].w.l).formatstr("%04X"); - state_add( T11_R1, "R1", m_reg[1].w.l).formatstr("%04X"); - state_add( T11_R2, "R2", m_reg[2].w.l).formatstr("%04X"); - state_add( T11_R3, "R3", m_reg[3].w.l).formatstr("%04X"); - state_add( T11_R4, "R4", m_reg[4].w.l).formatstr("%04X"); - state_add( T11_R5, "R5", m_reg[5].w.l).formatstr("%04X"); + state_add( T11_PC, "PC", m_reg[7].w.l).formatstr("%06O"); + state_add( T11_SP, "SP", m_reg[6].w.l).formatstr("%06O"); + state_add( T11_PSW, "PSW", m_psw.b.l).formatstr("%03O"); + state_add( T11_R0, "R0", m_reg[0].w.l).formatstr("%06O"); + state_add( T11_R1, "R1", m_reg[1].w.l).formatstr("%06O"); + state_add( T11_R2, "R2", m_reg[2].w.l).formatstr("%06O"); + state_add( T11_R3, "R3", m_reg[3].w.l).formatstr("%06O"); + state_add( T11_R4, "R4", m_reg[4].w.l).formatstr("%06O"); + state_add( T11_R5, "R5", m_reg[5].w.l).formatstr("%06O"); state_add(STATE_GENPC, "GENPC", m_reg[7].w.l).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_ppc.w.l).noshow(); diff --git a/src/devices/cpu/t11/t11dasm.cpp b/src/devices/cpu/t11/t11dasm.cpp index 583fc7b0255..536d811eff0 100644 --- a/src/devices/cpu/t11/t11dasm.cpp +++ b/src/devices/cpu/t11/t11dasm.cpp @@ -24,12 +24,10 @@ u16 t11_disassembler::r16p(offs_t &pc, const data_buffer &opcodes) return r; } -template <int Width> std::string t11_disassembler::MakeEA (int lo, offs_t &pc, const data_buffer &opcodes) +template <bool Byte> std::string t11_disassembler::MakeEA (int lo, offs_t &pc, const data_buffer &opcodes) { int reg, pm; - static_assert((Width == 2) || (Width == 4), "invalid width - must be 2 or 4"); - reg = lo & 7; switch ((lo >> 3) & 7) @@ -44,7 +42,7 @@ template <int Width> std::string t11_disassembler::MakeEA (int lo, offs_t &pc, c if (reg == 7) // immediate { pm = r16p(pc, opcodes); - return util::string_format ("#%0*X", Width, pm & ((Width == 2) ? 0xff : 0xffff)); + return util::string_format ("#%0*o", Byte ? 3 : 6, pm & (Byte ? 0377 : 0177777)); } else { @@ -55,7 +53,7 @@ template <int Width> std::string t11_disassembler::MakeEA (int lo, offs_t &pc, c if (reg == 7) // absolute { pm = r16p(pc, opcodes); - return util::string_format ("@#%04X", pm &= 0xffff); + return util::string_format ("@#%06o", pm & 0177777); } else { @@ -72,13 +70,13 @@ template <int Width> std::string t11_disassembler::MakeEA (int lo, offs_t &pc, c pm = r16p(pc, opcodes); if (reg == 7) // relative { - return util::string_format ("%04X", (pm + pc) & 0xffff); + return util::string_format ("%06o", (pm + pc) & 0177777); } else { - return util::string_format ("%s%X(%s)", - (pm&0x8000)?"-":"", - (pm&0x8000)?-(signed short)pm:pm, + return util::string_format ("%s%o(%s)", + BIT(pm,15)?"-":"", + BIT(pm,15)?-(int16_t)pm:pm, regs[reg]); } break; @@ -86,13 +84,13 @@ template <int Width> std::string t11_disassembler::MakeEA (int lo, offs_t &pc, c pm = r16p(pc, opcodes); if (reg == 7) // relative deferred { - return util::string_format ("@%04X", (pm + pc) & 0xffff); + return util::string_format ("@%06o", (pm + pc) & 0177777); } else { - return util::string_format ("@%s%X(%s)", - (pm&0x8000)?"-":"", - (pm&0x8000)?-(signed short)pm:pm, + return util::string_format ("@%s%o(%s)", + BIT(pm,15)?"-":"", + BIT(pm,15)?-(int16_t)pm:pm, regs[reg]); } break; @@ -113,26 +111,26 @@ offs_t t11_disassembler::disassemble(std::ostream &stream, offs_t pc, const data lo = op & 077; hi = (op >> 6) & 077; - switch (op & 0xffc0) + switch (op & 0177700) { - case 0x0000: + case 0000000: switch (lo) { - case 0x00: util::stream_format(stream, "HALT"); break; - case 0x01: util::stream_format(stream, "WAIT"); break; - case 0x02: util::stream_format(stream, "RTI"); flags = STEP_OUT; break; - case 0x03: util::stream_format(stream, "BPT"); break; - case 0x04: util::stream_format(stream, "IOT"); break; - case 0x05: util::stream_format(stream, "RESET"); break; - case 0x06: util::stream_format(stream, "RTT"); break; - default: util::stream_format(stream, "???? (%04X)", op); break; + case 000: util::stream_format(stream, "HALT"); break; + case 001: util::stream_format(stream, "WAIT"); break; + case 002: util::stream_format(stream, "RTI"); flags = STEP_OUT; break; + case 003: util::stream_format(stream, "BPT"); break; + case 004: util::stream_format(stream, "IOT"); break; + case 005: util::stream_format(stream, "RESET"); break; + case 006: util::stream_format(stream, "RTT"); break; + default: util::stream_format(stream, ".WORD %06o", op); break; } break; - case 0x0040: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0000100: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "JMP %s", ea1); break; - case 0x0080: + case 0000200: switch (lo & 070) { case 000: @@ -146,136 +144,139 @@ offs_t t11_disassembler::disassemble(std::ostream &stream, offs_t pc, const data case 050: switch( lo & 15 ) { - case 0x00: util::stream_format(stream, "NOP"); break; - case 0x0f: util::stream_format(stream, "CCC"); break; - case 0x01: util::stream_format(stream, "CEC"); break; - case 0x02: util::stream_format(stream, "CEV"); break; - case 0x04: util::stream_format(stream, "CEZ"); break; - case 0x08: util::stream_format(stream, "CEN"); break; - default: util::stream_format(stream, "Ccc #%X", lo & 15); break; + case 000: util::stream_format(stream, "NOP"); break; + case 017: util::stream_format(stream, "CCC"); break; + case 001: util::stream_format(stream, "CEC"); break; + case 002: util::stream_format(stream, "CEV"); break; + case 004: util::stream_format(stream, "CEZ"); break; + case 010: util::stream_format(stream, "CEN"); break; + default: util::stream_format(stream, "Ccc #%02o", lo & 15); break; } break; case 060: case 070: switch( lo & 15 ) { - case 0x00: util::stream_format(stream, "NOP"); break; - case 0x0f: util::stream_format(stream, "SCC"); break; - case 0x01: util::stream_format(stream, "SEC"); break; - case 0x02: util::stream_format(stream, "SEV"); break; - case 0x04: util::stream_format(stream, "SEZ"); break; - case 0x08: util::stream_format(stream, "SEN"); break; - default: util::stream_format(stream, "Scc #%X", lo & 15); break; + case 000: util::stream_format(stream, "NOP"); break; + case 017: util::stream_format(stream, "SCC"); break; + case 001: util::stream_format(stream, "SEC"); break; + case 002: util::stream_format(stream, "SEV"); break; + case 004: util::stream_format(stream, "SEZ"); break; + case 010: util::stream_format(stream, "SEN"); break; + default: util::stream_format(stream, "Scc #%02o", lo & 15); break; } break; + default: + util::stream_format(stream, ".WORD %06o", op); + break; } break; - case 0x00c0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0000300: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "SWAB %s", ea1); break; - case 0x0100: case 0x0140: case 0x0180: case 0x01c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BR %04X", pc + offset); + case 0000400: case 0000500: case 0000600: case 0000700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BR %06o", (pc + offset) & 0177777); break; - case 0x0200: case 0x0240: case 0x0280: case 0x02c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BNE %04X", pc + offset); + case 0001000: case 0001100: case 0001200: case 0001300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BNE %06o", (pc + offset) & 0177777); break; - case 0x0300: case 0x0340: case 0x0380: case 0x03c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BEQ %04X", pc + offset); + case 0001400: case 0001500: case 0001600: case 0001700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BEQ %06o", (pc + offset) & 0177777); break; - case 0x0400: case 0x0440: case 0x0480: case 0x04c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BGE %04X", pc + offset); + case 0002000: case 0002100: case 0002200: case 0002300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BGE %06o", (pc + offset) & 0177777); break; - case 0x0500: case 0x0540: case 0x0580: case 0x05c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BLT %04X", pc + offset); + case 0002400: case 0002500: case 0002600: case 0002700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BLT %06o", (pc + offset) & 0177777); break; - case 0x0600: case 0x0640: case 0x0680: case 0x06c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BGT %04X", pc + offset); + case 0003000: case 0003100: case 0003200: case 0003300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BGT %06o", (pc + offset) & 0177777); break; - case 0x0700: case 0x0740: case 0x0780: case 0x07c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BLE %04X", pc + offset); + case 0003400: case 0003500: case 0003600: case 0003700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BLE %06o", (pc + offset) & 0177777); break; - case 0x0800: case 0x0840: case 0x0880: case 0x08c0: - case 0x0900: case 0x0940: case 0x0980: case 0x09c0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0004000: case 0004100: case 0004200: case 0004300: + case 0004400: case 0004500: case 0004600: case 0004700: + ea1 = MakeEA<false> (lo, pc, opcodes); if ( (hi & 7) == 7 ) util::stream_format(stream, "JSR %s", ea1); else util::stream_format(stream, "JSR %s,%s", regs[hi & 7], ea1); flags = STEP_OVER; break; - case 0x0a00: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005000: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "CLR %s", ea1); break; - case 0x0a40: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005100: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "COM %s", ea1); break; - case 0x0a80: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005200: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "INC %s", ea1); break; - case 0x0ac0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005300: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "DEC %s", ea1); break; - case 0x0b00: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005400: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "NEG %s", ea1); break; - case 0x0b40: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005500: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "ADC %s", ea1); break; - case 0x0b80: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005600: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "SBC %s", ea1); break; - case 0x0bc0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0005700: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "TST %s", ea1); break; - case 0x0c00: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0006000: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "ROR %s", ea1); break; - case 0x0c40: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0006100: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "ROL %s", ea1); break; - case 0x0c80: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0006200: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "ASR %s", ea1); break; - case 0x0cc0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0006300: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "ASL %s", ea1); break; -/* case 0x0d00: - util::stream_format(stream, "MARK #%X", lo); +/* case 0006400: + util::stream_format(stream, "MARK #%o", lo); break;*/ - case 0x0dc0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0006700: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "SXT %s", ea1); break; - case 0x1000: case 0x1040: case 0x1080: case 0x10c0: case 0x1100: case 0x1140: case 0x1180: case 0x11c0: - case 0x1200: case 0x1240: case 0x1280: case 0x12c0: case 0x1300: case 0x1340: case 0x1380: case 0x13c0: - case 0x1400: case 0x1440: case 0x1480: case 0x14c0: case 0x1500: case 0x1540: case 0x1580: case 0x15c0: - case 0x1600: case 0x1640: case 0x1680: case 0x16c0: case 0x1700: case 0x1740: case 0x1780: case 0x17c0: - case 0x1800: case 0x1840: case 0x1880: case 0x18c0: case 0x1900: case 0x1940: case 0x1980: case 0x19c0: - case 0x1a00: case 0x1a40: case 0x1a80: case 0x1ac0: case 0x1b00: case 0x1b40: case 0x1b80: case 0x1bc0: - case 0x1c00: case 0x1c40: case 0x1c80: case 0x1cc0: case 0x1d00: case 0x1d40: case 0x1d80: case 0x1dc0: - case 0x1e00: case 0x1e40: case 0x1e80: case 0x1ec0: case 0x1f00: case 0x1f40: case 0x1f80: case 0x1fc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0010000: case 0010100: case 0010200: case 0010300: case 0010400: case 0010500: case 0010600: case 0010700: + case 0011000: case 0011100: case 0011200: case 0011300: case 0011400: case 0011500: case 0011600: case 0011700: + case 0012000: case 0012100: case 0012200: case 0012300: case 0012400: case 0012500: case 0012600: case 0012700: + case 0013000: case 0013100: case 0013200: case 0013300: case 0013400: case 0013500: case 0013600: case 0013700: + case 0014000: case 0014100: case 0014200: case 0014300: case 0014400: case 0014500: case 0014600: case 0014700: + case 0015000: case 0015100: case 0015200: case 0015300: case 0015400: case 0015500: case 0015600: case 0015700: + case 0016000: case 0016100: case 0016200: case 0016300: case 0016400: case 0016500: case 0016600: case 0016700: + case 0017000: case 0017100: case 0017200: case 0017300: case 0017400: case 0017500: case 0017600: case 0017700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); if (lo == 046) /* MOV src,-(SP) */ util::stream_format(stream, "PUSH %s", ea1); else @@ -284,247 +285,250 @@ offs_t t11_disassembler::disassemble(std::ostream &stream, offs_t pc, const data else /* all other */ util::stream_format(stream, "MOV %s,%s", ea1, ea2); break; - case 0x2000: case 0x2040: case 0x2080: case 0x20c0: case 0x2100: case 0x2140: case 0x2180: case 0x21c0: - case 0x2200: case 0x2240: case 0x2280: case 0x22c0: case 0x2300: case 0x2340: case 0x2380: case 0x23c0: - case 0x2400: case 0x2440: case 0x2480: case 0x24c0: case 0x2500: case 0x2540: case 0x2580: case 0x25c0: - case 0x2600: case 0x2640: case 0x2680: case 0x26c0: case 0x2700: case 0x2740: case 0x2780: case 0x27c0: - case 0x2800: case 0x2840: case 0x2880: case 0x28c0: case 0x2900: case 0x2940: case 0x2980: case 0x29c0: - case 0x2a00: case 0x2a40: case 0x2a80: case 0x2ac0: case 0x2b00: case 0x2b40: case 0x2b80: case 0x2bc0: - case 0x2c00: case 0x2c40: case 0x2c80: case 0x2cc0: case 0x2d00: case 0x2d40: case 0x2d80: case 0x2dc0: - case 0x2e00: case 0x2e40: case 0x2e80: case 0x2ec0: case 0x2f00: case 0x2f40: case 0x2f80: case 0x2fc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0020000: case 0020100: case 0020200: case 0020300: case 0020400: case 0020500: case 0020600: case 0020700: + case 0021000: case 0021100: case 0021200: case 0021300: case 0021400: case 0021500: case 0021600: case 0021700: + case 0022000: case 0022100: case 0022200: case 0022300: case 0022400: case 0022500: case 0022600: case 0022700: + case 0023000: case 0023100: case 0023200: case 0023300: case 0023400: case 0023500: case 0023600: case 0023700: + case 0024000: case 0024100: case 0024200: case 0024300: case 0024400: case 0024500: case 0024600: case 0024700: + case 0025000: case 0025100: case 0025200: case 0025300: case 0025400: case 0025500: case 0025600: case 0025700: + case 0026000: case 0026100: case 0026200: case 0026300: case 0026400: case 0026500: case 0026600: case 0026700: + case 0027000: case 0027100: case 0027200: case 0027300: case 0027400: case 0027500: case 0027600: case 0027700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "CMP %s,%s", ea1, ea2); break; - case 0x3000: case 0x3040: case 0x3080: case 0x30c0: case 0x3100: case 0x3140: case 0x3180: case 0x31c0: - case 0x3200: case 0x3240: case 0x3280: case 0x32c0: case 0x3300: case 0x3340: case 0x3380: case 0x33c0: - case 0x3400: case 0x3440: case 0x3480: case 0x34c0: case 0x3500: case 0x3540: case 0x3580: case 0x35c0: - case 0x3600: case 0x3640: case 0x3680: case 0x36c0: case 0x3700: case 0x3740: case 0x3780: case 0x37c0: - case 0x3800: case 0x3840: case 0x3880: case 0x38c0: case 0x3900: case 0x3940: case 0x3980: case 0x39c0: - case 0x3a00: case 0x3a40: case 0x3a80: case 0x3ac0: case 0x3b00: case 0x3b40: case 0x3b80: case 0x3bc0: - case 0x3c00: case 0x3c40: case 0x3c80: case 0x3cc0: case 0x3d00: case 0x3d40: case 0x3d80: case 0x3dc0: - case 0x3e00: case 0x3e40: case 0x3e80: case 0x3ec0: case 0x3f00: case 0x3f40: case 0x3f80: case 0x3fc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0030000: case 0030100: case 0030200: case 0030300: case 0030400: case 0030500: case 0030600: case 0030700: + case 0031000: case 0031100: case 0031200: case 0031300: case 0031400: case 0031500: case 0031600: case 0031700: + case 0032000: case 0032100: case 0032200: case 0032300: case 0032400: case 0032500: case 0032600: case 0032700: + case 0033000: case 0033100: case 0033200: case 0033300: case 0033400: case 0033500: case 0033600: case 0033700: + case 0034000: case 0034100: case 0034200: case 0034300: case 0034400: case 0034500: case 0034600: case 0034700: + case 0035000: case 0035100: case 0035200: case 0035300: case 0035400: case 0035500: case 0035600: case 0035700: + case 0036000: case 0036100: case 0036200: case 0036300: case 0036400: case 0036500: case 0036600: case 0036700: + case 0037000: case 0037100: case 0037200: case 0037300: case 0037400: case 0037500: case 0037600: case 0037700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "BIT %s,%s", ea1, ea2); break; - case 0x4000: case 0x4040: case 0x4080: case 0x40c0: case 0x4100: case 0x4140: case 0x4180: case 0x41c0: - case 0x4200: case 0x4240: case 0x4280: case 0x42c0: case 0x4300: case 0x4340: case 0x4380: case 0x43c0: - case 0x4400: case 0x4440: case 0x4480: case 0x44c0: case 0x4500: case 0x4540: case 0x4580: case 0x45c0: - case 0x4600: case 0x4640: case 0x4680: case 0x46c0: case 0x4700: case 0x4740: case 0x4780: case 0x47c0: - case 0x4800: case 0x4840: case 0x4880: case 0x48c0: case 0x4900: case 0x4940: case 0x4980: case 0x49c0: - case 0x4a00: case 0x4a40: case 0x4a80: case 0x4ac0: case 0x4b00: case 0x4b40: case 0x4b80: case 0x4bc0: - case 0x4c00: case 0x4c40: case 0x4c80: case 0x4cc0: case 0x4d00: case 0x4d40: case 0x4d80: case 0x4dc0: - case 0x4e00: case 0x4e40: case 0x4e80: case 0x4ec0: case 0x4f00: case 0x4f40: case 0x4f80: case 0x4fc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0040000: case 0040100: case 0040200: case 0040300: case 0040400: case 0040500: case 0040600: case 0040700: + case 0041000: case 0041100: case 0041200: case 0041300: case 0041400: case 0041500: case 0041600: case 0041700: + case 0042000: case 0042100: case 0042200: case 0042300: case 0042400: case 0042500: case 0042600: case 0042700: + case 0043000: case 0043100: case 0043200: case 0043300: case 0043400: case 0043500: case 0043600: case 0043700: + case 0044000: case 0044100: case 0044200: case 0044300: case 0044400: case 0044500: case 0044600: case 0044700: + case 0045000: case 0045100: case 0045200: case 0045300: case 0045400: case 0045500: case 0045600: case 0045700: + case 0046000: case 0046100: case 0046200: case 0046300: case 0046400: case 0046500: case 0046600: case 0046700: + case 0047000: case 0047100: case 0047200: case 0047300: case 0047400: case 0047500: case 0047600: case 0047700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "BIC %s,%s", ea1, ea2); break; - case 0x5000: case 0x5040: case 0x5080: case 0x50c0: case 0x5100: case 0x5140: case 0x5180: case 0x51c0: - case 0x5200: case 0x5240: case 0x5280: case 0x52c0: case 0x5300: case 0x5340: case 0x5380: case 0x53c0: - case 0x5400: case 0x5440: case 0x5480: case 0x54c0: case 0x5500: case 0x5540: case 0x5580: case 0x55c0: - case 0x5600: case 0x5640: case 0x5680: case 0x56c0: case 0x5700: case 0x5740: case 0x5780: case 0x57c0: - case 0x5800: case 0x5840: case 0x5880: case 0x58c0: case 0x5900: case 0x5940: case 0x5980: case 0x59c0: - case 0x5a00: case 0x5a40: case 0x5a80: case 0x5ac0: case 0x5b00: case 0x5b40: case 0x5b80: case 0x5bc0: - case 0x5c00: case 0x5c40: case 0x5c80: case 0x5cc0: case 0x5d00: case 0x5d40: case 0x5d80: case 0x5dc0: - case 0x5e00: case 0x5e40: case 0x5e80: case 0x5ec0: case 0x5f00: case 0x5f40: case 0x5f80: case 0x5fc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0050000: case 0050100: case 0050200: case 0050300: case 0050400: case 0050500: case 0050600: case 0050700: + case 0051000: case 0051100: case 0051200: case 0051300: case 0051400: case 0051500: case 0051600: case 0051700: + case 0052000: case 0052100: case 0052200: case 0052300: case 0052400: case 0052500: case 0052600: case 0052700: + case 0053000: case 0053100: case 0053200: case 0053300: case 0053400: case 0053500: case 0053600: case 0053700: + case 0054000: case 0054100: case 0054200: case 0054300: case 0054400: case 0054500: case 0054600: case 0054700: + case 0055000: case 0055100: case 0055200: case 0055300: case 0055400: case 0055500: case 0055600: case 0055700: + case 0056000: case 0056100: case 0056200: case 0056300: case 0056400: case 0056500: case 0056600: case 0056700: + case 0057000: case 0057100: case 0057200: case 0057300: case 0057400: case 0057500: case 0057600: case 0057700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "BIS %s,%s", ea1, ea2); break; - case 0x6000: case 0x6040: case 0x6080: case 0x60c0: case 0x6100: case 0x6140: case 0x6180: case 0x61c0: - case 0x6200: case 0x6240: case 0x6280: case 0x62c0: case 0x6300: case 0x6340: case 0x6380: case 0x63c0: - case 0x6400: case 0x6440: case 0x6480: case 0x64c0: case 0x6500: case 0x6540: case 0x6580: case 0x65c0: - case 0x6600: case 0x6640: case 0x6680: case 0x66c0: case 0x6700: case 0x6740: case 0x6780: case 0x67c0: - case 0x6800: case 0x6840: case 0x6880: case 0x68c0: case 0x6900: case 0x6940: case 0x6980: case 0x69c0: - case 0x6a00: case 0x6a40: case 0x6a80: case 0x6ac0: case 0x6b00: case 0x6b40: case 0x6b80: case 0x6bc0: - case 0x6c00: case 0x6c40: case 0x6c80: case 0x6cc0: case 0x6d00: case 0x6d40: case 0x6d80: case 0x6dc0: - case 0x6e00: case 0x6e40: case 0x6e80: case 0x6ec0: case 0x6f00: case 0x6f40: case 0x6f80: case 0x6fc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0060000: case 0060100: case 0060200: case 0060300: case 0060400: case 0060500: case 0060600: case 0060700: + case 0061000: case 0061100: case 0061200: case 0061300: case 0061400: case 0061500: case 0061600: case 0061700: + case 0062000: case 0062100: case 0062200: case 0062300: case 0062400: case 0062500: case 0062600: case 0062700: + case 0063000: case 0063100: case 0063200: case 0063300: case 0063400: case 0063500: case 0063600: case 0063700: + case 0064000: case 0064100: case 0064200: case 0064300: case 0064400: case 0064500: case 0064600: case 0064700: + case 0065000: case 0065100: case 0065200: case 0065300: case 0065400: case 0065500: case 0065600: case 0065700: + case 0066000: case 0066100: case 0066200: case 0066300: case 0066400: case 0066500: case 0066600: case 0066700: + case 0067000: case 0067100: case 0067200: case 0067300: case 0067400: case 0067500: case 0067600: case 0067700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "ADD %s,%s", ea1, ea2); break; - case 0x7800: case 0x7840: case 0x7880: case 0x78c0: case 0x7900: case 0x7940: case 0x7980: case 0x79c0: - ea1 = MakeEA<4> (lo, pc, opcodes); + case 0074000: case 0074100: case 0074200: case 0074300: case 0074400: case 0074500: case 0074600: case 0074700: + ea1 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "XOR %s,%s", regs[hi & 7], ea1); break; - case 0x7e00: case 0x7e40: case 0x7e80: case 0x7ec0: case 0x7f00: case 0x7f40: case 0x7f80: case 0x7fc0: - addr = (pc + 2 - 2 * lo) & 0xffff; - util::stream_format(stream, "SOB %s,%04X", regs[hi & 7], addr); + case 0077000: case 0077100: case 0077200: case 0077300: case 0077400: case 0077500: case 0077600: case 0077700: + addr = (pc - 2 * lo) & 0177777; + util::stream_format(stream, "SOB %s,%06o", regs[hi & 7], addr); break; - case 0x8000: case 0x8040: case 0x8080: case 0x80c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BPL %04X", pc + offset); + case 0100000: case 0100100: case 0100200: case 0100300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BPL %06o", (pc + offset) & 0177777); break; - case 0x8100: case 0x8140: case 0x8180: case 0x81c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BMI %04X", pc + offset); + case 0100400: case 0100500: case 0100600: case 0100700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BMI %06o", (pc + offset) & 0177777); break; - case 0x8200: case 0x8240: case 0x8280: case 0x82c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BHI %04X", pc + offset); + case 0101000: case 0101100: case 0101200: case 0101300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BHI %06o", (pc + offset) & 0177777); break; - case 0x8300: case 0x8340: case 0x8380: case 0x83c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BLOS %04X", pc + offset); + case 0101400: case 0101500: case 0101600: case 0101700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BLOS %06o", (pc + offset) & 0177777); break; - case 0x8400: case 0x8440: case 0x8480: case 0x84c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BVC %04X", pc + offset); + case 0102000: case 0102100: case 0102200: case 0102300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BVC %06o", (pc + offset) & 0177777); break; - case 0x8500: case 0x8540: case 0x8580: case 0x85c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BVS %04X", pc + offset); + case 0102400: case 0102500: case 0102600: case 0102700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BVS %06o", (pc + offset) & 0177777); break; - case 0x8600: case 0x8640: case 0x8680: case 0x86c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BCC %04X", pc + offset); + case 0103000: case 0103100: case 0103200: case 0103300: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BCC %06o", (pc + offset) & 0177777); break; - case 0x8700: case 0x8740: case 0x8780: case 0x87c0: - offset = 2 * (int8_t)(op & 0xff); - util::stream_format(stream, "BCS %04X", pc + offset); + case 0103400: case 0103500: case 0103600: case 0103700: + offset = 2 * (int8_t)(op & 0377); + util::stream_format(stream, "BCS %06o", (pc + offset) & 0177777); break; - case 0x8800: case 0x8840: case 0x8880: case 0x88c0: - util::stream_format(stream, "EMT %02X", op & 0xff); + case 0104000: case 0104100: case 0104200: case 0104300: + util::stream_format(stream, "EMT %03o", op & 0377); break; - case 0x8900: case 0x8940: case 0x8980: case 0x89c0: - util::stream_format(stream, "TRAP %02X", op & 0xff); + case 0104400: case 0104500: case 0104600: case 0104700: + util::stream_format(stream, "TRAP %03o", op & 0377); break; - case 0x8a00: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105000: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "CLRB %s", ea1); break; - case 0x8a40: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105100: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "COMB %s", ea1); break; - case 0x8a80: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105200: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "INCB %s", ea1); break; - case 0x8ac0: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105300: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "DECB %s", ea1); break; - case 0x8b00: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105400: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "NEGB %s", ea1); break; - case 0x8b40: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105500: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "ADCB %s", ea1); break; - case 0x8b80: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105600: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "SBCB %s", ea1); break; - case 0x8bc0: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0105700: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "TSTB %s", ea1); break; - case 0x8c00: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0106000: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "RORB %s", ea1); break; - case 0x8c40: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0106100: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "ROLB %s", ea1); break; - case 0x8c80: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0106200: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "ASRB %s", ea1); break; - case 0x8cc0: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0106300: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "ASLB %s", ea1); break; - case 0x8d00: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0106400: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "MTPS %s", ea1); break; - case 0x8dc0: - ea1 = MakeEA<2> (lo, pc, opcodes); + case 0106700: + ea1 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "MFPS %s", ea1); break; - case 0x9000: case 0x9040: case 0x9080: case 0x90c0: case 0x9100: case 0x9140: case 0x9180: case 0x91c0: - case 0x9200: case 0x9240: case 0x9280: case 0x92c0: case 0x9300: case 0x9340: case 0x9380: case 0x93c0: - case 0x9400: case 0x9440: case 0x9480: case 0x94c0: case 0x9500: case 0x9540: case 0x9580: case 0x95c0: - case 0x9600: case 0x9640: case 0x9680: case 0x96c0: case 0x9700: case 0x9740: case 0x9780: case 0x97c0: - case 0x9800: case 0x9840: case 0x9880: case 0x98c0: case 0x9900: case 0x9940: case 0x9980: case 0x99c0: - case 0x9a00: case 0x9a40: case 0x9a80: case 0x9ac0: case 0x9b00: case 0x9b40: case 0x9b80: case 0x9bc0: - case 0x9c00: case 0x9c40: case 0x9c80: case 0x9cc0: case 0x9d00: case 0x9d40: case 0x9d80: case 0x9dc0: - case 0x9e00: case 0x9e40: case 0x9e80: case 0x9ec0: case 0x9f00: case 0x9f40: case 0x9f80: case 0x9fc0: - ea1 = MakeEA<2> (hi, pc, opcodes); - ea2 = MakeEA<2> (lo, pc, opcodes); + + case 0110000: case 0110100: case 0110200: case 0110300: case 0110400: case 0110500: case 0110600: case 0110700: + case 0111000: case 0111100: case 0111200: case 0111300: case 0111400: case 0111500: case 0111600: case 0111700: + case 0112000: case 0112100: case 0112200: case 0112300: case 0112400: case 0112500: case 0112600: case 0112700: + case 0113000: case 0113100: case 0113200: case 0113300: case 0113400: case 0113500: case 0113600: case 0113700: + case 0114000: case 0114100: case 0114200: case 0114300: case 0114400: case 0114500: case 0114600: case 0114700: + case 0115000: case 0115100: case 0115200: case 0115300: case 0115400: case 0115500: case 0115600: case 0115700: + case 0116000: case 0116100: case 0116200: case 0116300: case 0116400: case 0116500: case 0116600: case 0116700: + case 0117000: case 0117100: case 0117200: case 0117300: case 0117400: case 0117500: case 0117600: case 0117700: + ea1 = MakeEA<true> (hi, pc, opcodes); + ea2 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "MOVB %s,%s", ea1, ea2); break; - case 0xa000: case 0xa040: case 0xa080: case 0xa0c0: case 0xa100: case 0xa140: case 0xa180: case 0xa1c0: - case 0xa200: case 0xa240: case 0xa280: case 0xa2c0: case 0xa300: case 0xa340: case 0xa380: case 0xa3c0: - case 0xa400: case 0xa440: case 0xa480: case 0xa4c0: case 0xa500: case 0xa540: case 0xa580: case 0xa5c0: - case 0xa600: case 0xa640: case 0xa680: case 0xa6c0: case 0xa700: case 0xa740: case 0xa780: case 0xa7c0: - case 0xa800: case 0xa840: case 0xa880: case 0xa8c0: case 0xa900: case 0xa940: case 0xa980: case 0xa9c0: - case 0xaa00: case 0xaa40: case 0xaa80: case 0xaac0: case 0xab00: case 0xab40: case 0xab80: case 0xabc0: - case 0xac00: case 0xac40: case 0xac80: case 0xacc0: case 0xad00: case 0xad40: case 0xad80: case 0xadc0: - case 0xae00: case 0xae40: case 0xae80: case 0xaec0: case 0xaf00: case 0xaf40: case 0xaf80: case 0xafc0: - ea1 = MakeEA<2> (hi, pc, opcodes); - ea2 = MakeEA<2> (lo, pc, opcodes); + case 0120000: case 0120100: case 0120200: case 0120300: case 0120400: case 0120500: case 0120600: case 0120700: + case 0121000: case 0121100: case 0121200: case 0121300: case 0121400: case 0121500: case 0121600: case 0121700: + case 0122000: case 0122100: case 0122200: case 0122300: case 0122400: case 0122500: case 0122600: case 0122700: + case 0123000: case 0123100: case 0123200: case 0123300: case 0123400: case 0123500: case 0123600: case 0123700: + case 0124000: case 0124100: case 0124200: case 0124300: case 0124400: case 0124500: case 0124600: case 0124700: + case 0125000: case 0125100: case 0125200: case 0125300: case 0125400: case 0125500: case 0125600: case 0125700: + case 0126000: case 0126100: case 0126200: case 0126300: case 0126400: case 0126500: case 0126600: case 0126700: + case 0127000: case 0127100: case 0127200: case 0127300: case 0127400: case 0127500: case 0127600: case 0127700: + ea1 = MakeEA<true> (hi, pc, opcodes); + ea2 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "CMPB %s,%s", ea1, ea2); break; - case 0xb000: case 0xb040: case 0xb080: case 0xb0c0: case 0xb100: case 0xb140: case 0xb180: case 0xb1c0: - case 0xb200: case 0xb240: case 0xb280: case 0xb2c0: case 0xb300: case 0xb340: case 0xb380: case 0xb3c0: - case 0xb400: case 0xb440: case 0xb480: case 0xb4c0: case 0xb500: case 0xb540: case 0xb580: case 0xb5c0: - case 0xb600: case 0xb640: case 0xb680: case 0xb6c0: case 0xb700: case 0xb740: case 0xb780: case 0xb7c0: - case 0xb800: case 0xb840: case 0xb880: case 0xb8c0: case 0xb900: case 0xb940: case 0xb980: case 0xb9c0: - case 0xba00: case 0xba40: case 0xba80: case 0xbac0: case 0xbb00: case 0xbb40: case 0xbb80: case 0xbbc0: - case 0xbc00: case 0xbc40: case 0xbc80: case 0xbcc0: case 0xbd00: case 0xbd40: case 0xbd80: case 0xbdc0: - case 0xbe00: case 0xbe40: case 0xbe80: case 0xbec0: case 0xbf00: case 0xbf40: case 0xbf80: case 0xbfc0: - ea1 = MakeEA<2> (hi, pc, opcodes); - ea2 = MakeEA<2> (lo, pc, opcodes); + case 0130000: case 0130100: case 0130200: case 0130300: case 0130400: case 0130500: case 0130600: case 0130700: + case 0131000: case 0131100: case 0131200: case 0131300: case 0131400: case 0131500: case 0131600: case 0131700: + case 0132000: case 0132100: case 0132200: case 0132300: case 0132400: case 0132500: case 0132600: case 0132700: + case 0133000: case 0133100: case 0133200: case 0133300: case 0133400: case 0133500: case 0133600: case 0133700: + case 0134000: case 0134100: case 0134200: case 0134300: case 0134400: case 0134500: case 0134600: case 0134700: + case 0135000: case 0135100: case 0135200: case 0135300: case 0135400: case 0135500: case 0135600: case 0135700: + case 0136000: case 0136100: case 0136200: case 0136300: case 0136400: case 0136500: case 0136600: case 0136700: + case 0137000: case 0137100: case 0137200: case 0137300: case 0137400: case 0137500: case 0137600: case 0137700: + ea1 = MakeEA<true> (hi, pc, opcodes); + ea2 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "BITB %s,%s", ea1, ea2); break; - case 0xc000: case 0xc040: case 0xc080: case 0xc0c0: case 0xc100: case 0xc140: case 0xc180: case 0xc1c0: - case 0xc200: case 0xc240: case 0xc280: case 0xc2c0: case 0xc300: case 0xc340: case 0xc380: case 0xc3c0: - case 0xc400: case 0xc440: case 0xc480: case 0xc4c0: case 0xc500: case 0xc540: case 0xc580: case 0xc5c0: - case 0xc600: case 0xc640: case 0xc680: case 0xc6c0: case 0xc700: case 0xc740: case 0xc780: case 0xc7c0: - case 0xc800: case 0xc840: case 0xc880: case 0xc8c0: case 0xc900: case 0xc940: case 0xc980: case 0xc9c0: - case 0xca00: case 0xca40: case 0xca80: case 0xcac0: case 0xcb00: case 0xcb40: case 0xcb80: case 0xcbc0: - case 0xcc00: case 0xcc40: case 0xcc80: case 0xccc0: case 0xcd00: case 0xcd40: case 0xcd80: case 0xcdc0: - case 0xce00: case 0xce40: case 0xce80: case 0xcec0: case 0xcf00: case 0xcf40: case 0xcf80: case 0xcfc0: - ea1 = MakeEA<2> (hi, pc, opcodes); - ea2 = MakeEA<2> (lo, pc, opcodes); + case 0140000: case 0140100: case 0140200: case 0140300: case 0140400: case 0140500: case 0140600: case 0140700: + case 0141000: case 0141100: case 0141200: case 0141300: case 0141400: case 0141500: case 0141600: case 0141700: + case 0142000: case 0142100: case 0142200: case 0142300: case 0142400: case 0142500: case 0142600: case 0142700: + case 0143000: case 0143100: case 0143200: case 0143300: case 0143400: case 0143500: case 0143600: case 0143700: + case 0144000: case 0144100: case 0144200: case 0144300: case 0144400: case 0144500: case 0144600: case 0144700: + case 0145000: case 0145100: case 0145200: case 0145300: case 0145400: case 0145500: case 0145600: case 0145700: + case 0146000: case 0146100: case 0146200: case 0146300: case 0146400: case 0146500: case 0146600: case 0146700: + case 0147000: case 0147100: case 0147200: case 0147300: case 0147400: case 0147500: case 0147600: case 0147700: + ea1 = MakeEA<true> (hi, pc, opcodes); + ea2 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "BICB %s,%s", ea1, ea2); break; - case 0xd000: case 0xd040: case 0xd080: case 0xd0c0: case 0xd100: case 0xd140: case 0xd180: case 0xd1c0: - case 0xd200: case 0xd240: case 0xd280: case 0xd2c0: case 0xd300: case 0xd340: case 0xd380: case 0xd3c0: - case 0xd400: case 0xd440: case 0xd480: case 0xd4c0: case 0xd500: case 0xd540: case 0xd580: case 0xd5c0: - case 0xd600: case 0xd640: case 0xd680: case 0xd6c0: case 0xd700: case 0xd740: case 0xd780: case 0xd7c0: - case 0xd800: case 0xd840: case 0xd880: case 0xd8c0: case 0xd900: case 0xd940: case 0xd980: case 0xd9c0: - case 0xda00: case 0xda40: case 0xda80: case 0xdac0: case 0xdb00: case 0xdb40: case 0xdb80: case 0xdbc0: - case 0xdc00: case 0xdc40: case 0xdc80: case 0xdcc0: case 0xdd00: case 0xdd40: case 0xdd80: case 0xddc0: - case 0xde00: case 0xde40: case 0xde80: case 0xdec0: case 0xdf00: case 0xdf40: case 0xdf80: case 0xdfc0: - ea1 = MakeEA<2> (hi, pc, opcodes); - ea2 = MakeEA<2> (lo, pc, opcodes); + case 0150000: case 0150100: case 0150200: case 0150300: case 0150400: case 0150500: case 0150600: case 0150700: + case 0151000: case 0151100: case 0151200: case 0151300: case 0151400: case 0151500: case 0151600: case 0151700: + case 0152000: case 0152100: case 0152200: case 0152300: case 0152400: case 0152500: case 0152600: case 0152700: + case 0153000: case 0153100: case 0153200: case 0153300: case 0153400: case 0153500: case 0153600: case 0153700: + case 0154000: case 0154100: case 0154200: case 0154300: case 0154400: case 0154500: case 0154600: case 0154700: + case 0155000: case 0155100: case 0155200: case 0155300: case 0155400: case 0155500: case 0155600: case 0155700: + case 0156000: case 0156100: case 0156200: case 0156300: case 0156400: case 0156500: case 0156600: case 0156700: + case 0157000: case 0157100: case 0157200: case 0157300: case 0157400: case 0157500: case 0157600: case 0157700: + ea1 = MakeEA<true> (hi, pc, opcodes); + ea2 = MakeEA<true> (lo, pc, opcodes); util::stream_format(stream, "BISB %s,%s", ea1, ea2); break; - case 0xe000: case 0xe040: case 0xe080: case 0xe0c0: case 0xe100: case 0xe140: case 0xe180: case 0xe1c0: - case 0xe200: case 0xe240: case 0xe280: case 0xe2c0: case 0xe300: case 0xe340: case 0xe380: case 0xe3c0: - case 0xe400: case 0xe440: case 0xe480: case 0xe4c0: case 0xe500: case 0xe540: case 0xe580: case 0xe5c0: - case 0xe600: case 0xe640: case 0xe680: case 0xe6c0: case 0xe700: case 0xe740: case 0xe780: case 0xe7c0: - case 0xe800: case 0xe840: case 0xe880: case 0xe8c0: case 0xe900: case 0xe940: case 0xe980: case 0xe9c0: - case 0xea00: case 0xea40: case 0xea80: case 0xeac0: case 0xeb00: case 0xeb40: case 0xeb80: case 0xebc0: - case 0xec00: case 0xec40: case 0xec80: case 0xecc0: case 0xed00: case 0xed40: case 0xed80: case 0xedc0: - case 0xee00: case 0xee40: case 0xee80: case 0xeec0: case 0xef00: case 0xef40: case 0xef80: case 0xefc0: - ea1 = MakeEA<4> (hi, pc, opcodes); - ea2 = MakeEA<4> (lo, pc, opcodes); + case 0160000: case 0160100: case 0160200: case 0160300: case 0160400: case 0160500: case 0160600: case 0160700: + case 0161000: case 0161100: case 0161200: case 0161300: case 0161400: case 0161500: case 0161600: case 0161700: + case 0162000: case 0162100: case 0162200: case 0162300: case 0162400: case 0162500: case 0162600: case 0162700: + case 0163000: case 0163100: case 0163200: case 0163300: case 0163400: case 0163500: case 0163600: case 0163700: + case 0164000: case 0164100: case 0164200: case 0164300: case 0164400: case 0164500: case 0164600: case 0164700: + case 0165000: case 0165100: case 0165200: case 0165300: case 0165400: case 0165500: case 0165600: case 0165700: + case 0166000: case 0166100: case 0166200: case 0166300: case 0166400: case 0166500: case 0166600: case 0166700: + case 0167000: case 0167100: case 0167200: case 0167300: case 0167400: case 0167500: case 0167600: case 0167700: + ea1 = MakeEA<false> (hi, pc, opcodes); + ea2 = MakeEA<false> (lo, pc, opcodes); util::stream_format(stream, "SUB %s,%s", ea1, ea2); break; + // 17xxxx: floating point (not implemented on T-11) + default: - util::stream_format(stream, "???? (%06o)", op); + util::stream_format(stream, ".WORD %06o", op); break; } diff --git a/src/devices/cpu/t11/t11dasm.h b/src/devices/cpu/t11/t11dasm.h index e9d31c161a6..5fbdd61a6c7 100644 --- a/src/devices/cpu/t11/t11dasm.h +++ b/src/devices/cpu/t11/t11dasm.h @@ -26,7 +26,7 @@ public: private: static const char *const regs[8]; u16 r16p(offs_t &pc, const data_buffer &opcodes); - template <int Width> std::string MakeEA (int lo, offs_t &pc, const data_buffer &opcodes); + template <bool Byte> std::string MakeEA (int lo, offs_t &pc, const data_buffer &opcodes); }; diff --git a/src/devices/cpu/tms32010/32010dsm.cpp b/src/devices/cpu/tms32010/32010dsm.cpp index 4601498ce64..0f385274f25 100644 --- a/src/devices/cpu/tms32010/32010dsm.cpp +++ b/src/devices/cpu/tms32010/32010dsm.cpp @@ -27,7 +27,7 @@ #include "emu.h" #include "32010dsm.h" -#include <ctype.h> +#include <cctype> #include <stdexcept> diff --git a/src/devices/cpu/tms32010/dis32010.cpp b/src/devices/cpu/tms32010/dis32010.cpp index 681c83f8891..ed1cbae3b51 100644 --- a/src/devices/cpu/tms32010/dis32010.cpp +++ b/src/devices/cpu/tms32010/dis32010.cpp @@ -11,8 +11,8 @@ * * \**************************************************************************/ -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> #include "32010dsm.c" diff --git a/src/devices/cpu/tms32025/32025dsm.cpp b/src/devices/cpu/tms32025/32025dsm.cpp index c2ae6f96b2a..99640020341 100644 --- a/src/devices/cpu/tms32025/32025dsm.cpp +++ b/src/devices/cpu/tms32025/32025dsm.cpp @@ -33,7 +33,7 @@ #include "emu.h" #include "32025dsm.h" -#include <ctype.h> +#include <cctype> #include <stdexcept> diff --git a/src/devices/cpu/unsp/unsp.cpp b/src/devices/cpu/unsp/unsp.cpp index 87a95bd900f..ff27f97df62 100644 --- a/src/devices/cpu/unsp/unsp.cpp +++ b/src/devices/cpu/unsp/unsp.cpp @@ -60,24 +60,28 @@ unsp_device::unsp_device(const machine_config &mconfig, device_type type, const , m_enable_drc(false) { m_iso = 10; + m_numregs = 8; } unsp_device::unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : unsp_device(mconfig, UNSP, tag, owner, clock, address_map_constructor()) { m_iso = 10; + m_numregs = 8; } unsp_11_device::unsp_11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : unsp_device(mconfig, UNSP_11, tag, owner, clock, address_map_constructor()) { m_iso = 11; + m_numregs = 8; } unsp_11_device::unsp_11_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal) : unsp_device(mconfig, type, tag, owner, clock, internal) { m_iso = 11; + m_numregs = 8; } @@ -85,24 +89,28 @@ unsp_12_device::unsp_12_device(const machine_config &mconfig, const char *tag, d : unsp_11_device(mconfig, UNSP_12, tag, owner, clock, address_map_constructor()) { m_iso = 12; + m_numregs = 8; } unsp_12_device::unsp_12_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal) : unsp_11_device(mconfig, type, tag, owner, clock, internal) { m_iso = 12; + m_numregs = 8; } unsp_20_device::unsp_20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : unsp_12_device(mconfig, UNSP_20, tag, owner, clock, address_map_constructor()) { m_iso = 20; + m_numregs = 16; } unsp_20_device::unsp_20_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal) : unsp_12_device(mconfig, type, tag, owner, clock, internal) { m_iso = 20; + m_numregs = 16; } unsp_device::~unsp_device() @@ -182,6 +190,7 @@ void unsp_device::unimplemented_opcode(uint16_t op, uint16_t ximm, uint16_t ximm void unsp_device::device_start() { + m_core = (internal_unsp_state *)m_cache.alloc_near(sizeof(internal_unsp_state)); memset(m_core, 0, sizeof(internal_unsp_state)); @@ -275,21 +284,25 @@ void unsp_20_device::device_start() int baseindex = UNSP_SB + 1; #endif - state_add(baseindex + UNSP20_R8, "R8", m_secondary_r[UNSP20_R8]).formatstr("%04X"); - state_add(baseindex + UNSP20_R9, "R9", m_secondary_r[UNSP20_R9]).formatstr("%04X"); - state_add(baseindex + UNSP20_R10, "R10", m_secondary_r[UNSP20_R10]).formatstr("%04X"); - state_add(baseindex + UNSP20_R11, "R11", m_secondary_r[UNSP20_R11]).formatstr("%04X"); - state_add(baseindex + UNSP20_R12, "R12", m_secondary_r[UNSP20_R12]).formatstr("%04X"); - state_add(baseindex + UNSP20_R13, "R13", m_secondary_r[UNSP20_R13]).formatstr("%04X"); - state_add(baseindex + UNSP20_R14, "R14", m_secondary_r[UNSP20_R14]).formatstr("%04X"); - state_add(baseindex + UNSP20_R15, "R15", m_secondary_r[UNSP20_R15]).formatstr("%04X"); - - save_item(NAME(m_secondary_r)); + state_add(baseindex + UNSP20_R8, "R8", m_core->m_r[UNSP20_R8+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R9, "R9", m_core->m_r[UNSP20_R9+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R10, "R10", m_core->m_r[UNSP20_R10+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R11, "R11", m_core->m_r[UNSP20_R11+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R12, "R12", m_core->m_r[UNSP20_R12+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R13, "R13", m_core->m_r[UNSP20_R13+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R14, "R14", m_core->m_r[UNSP20_R14+8]).formatstr("%04X"); + state_add(baseindex + UNSP20_R15, "R15", m_core->m_r[UNSP20_R15+8]).formatstr("%04X"); } void unsp_device::device_reset() { - memset(m_core->m_r, 0, sizeof(uint32_t) * 8); + for (int i = 0; i < m_numregs; i++) + { + if (i < m_numregs) + m_core->m_r[i] = 0; + else + m_core->m_r[i] = 0xdeadbeef; + } m_core->m_r[REG_PC] = read16(0xfff7); m_core->m_enable_irq = 0; @@ -301,11 +314,6 @@ void unsp_device::device_reset() void unsp_20_device::device_reset() { unsp_12_device::device_reset(); - - for (int i = 0; i < 8; i++) - { - m_secondary_r[i] = 0; - } } void unsp_device::device_stop() diff --git a/src/devices/cpu/unsp/unsp.h b/src/devices/cpu/unsp/unsp.h index 507d731ffff..35a2ced29d3 100644 --- a/src/devices/cpu/unsp/unsp.h +++ b/src/devices/cpu/unsp/unsp.h @@ -164,7 +164,7 @@ protected: struct internal_unsp_state { - uint32_t m_r[8]; // why are these 32-bit? they're 16-bit regs? (changing to uint16_t causes crashes tho, so something is depending on this) + uint32_t m_r[16]; // why are these 32-bit? they're 16-bit regs? (changing to uint16_t causes crashes tho, so something is depending on this) uint32_t m_enable_irq; uint32_t m_enable_fiq; uint32_t m_irq; @@ -232,6 +232,7 @@ protected: void update_nz(uint32_t value); void update_nzsc(uint32_t value, uint16_t r0, uint16_t r1); + bool do_basic_alu_ops(const uint16_t& op0, uint32_t& lres, uint16_t& r0, uint16_t& r1, uint32_t& r2, bool update_flags); private: // compilation boundaries -- how far back/forward does the analysis extend? @@ -320,6 +321,8 @@ private: #if UNSP_LOG_REGS FILE *m_log_file; #endif +protected: + int m_numregs; }; diff --git a/src/devices/cpu/unsp/unsp_extended.cpp b/src/devices/cpu/unsp/unsp_extended.cpp index a3986d124b8..44f2a2d263d 100644 --- a/src/devices/cpu/unsp/unsp_extended.cpp +++ b/src/devices/cpu/unsp/unsp_extended.cpp @@ -9,6 +9,10 @@ #include "unspdasm.h" +// TODO: the call conventions and general use of 'do_basic_alu_ops' from unsp_other.cpp could be cleaned up +// at the moment things like the 'Store' opcode make things more complex than they need to be, and require +// the passing of a store address each time, they make the regular use of the code a little awkward too tho. + void unsp_device::execute_extended_group(uint16_t op) { // shouldn't get here anyway @@ -26,122 +30,27 @@ void unsp_20_device::execute_extended_group(uint16_t op) { case 0x00: case 0x10: { - // Ext Register Ra = Ra op Rb + // Ext Register + // Ra = Ra op Rb + // A = B op C uint8_t aluop = (ximm & 0xf000) >> 12; uint8_t rb = (ximm & 0x000f) >> 0; uint8_t ra = (ximm & 0x0e00) >> 9; ra |= (ximm & 0x0100) >> 5; - switch (aluop) - { - case 0x00: // add - // A += B - logerror( "(Extended group 0) %s += %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x01: // adc - // A += B, Carry - logerror( "(Extended group 0) %s += %s, carry\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x02: // sub - // A -= B - logerror( "(Extended group 0) %s -= %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x03: // sbc - // A -= B, Carry - logerror( "(Extended group 0) %s -= %s, carry\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x04: // cmp - // CMP A,B - logerror( "(Extended group 0) cmp %s, %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x06: // neg - // A = -B - logerror( "(Extended group 0) %s = -%s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x08: // xor - // A ^= B - logerror( "(Extended group 0) %s ^= %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; + uint16_t b = m_core->m_r[ra]; + uint16_t c = m_core->m_r[rb]; + uint32_t lres; + uint32_t storeaddr = b; // dest address for STORE - case 0x09: // load - // A = B - logerror( "(Extended group 0) %s = %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; + bool write = do_basic_alu_ops(aluop, lres, b, c, storeaddr, (ra != 7)); - case 0x0a: // or - // A |= B - logerror( "(Extended group 0) %s |= %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0b: // and - // A &= B - logerror( "(Extended group 0) %s &= %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0c: // test - // TEST A,B - logerror( "(Extended group 0) test %s, %s\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0d: // store - // B = A - logerror( "(Extended group 0) %s = %s\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 0) <INVALID Ra = Ra op Rb form>\n"); - unimplemented_opcode(op, ximm); - return; - break; + if (write) + { + // a = Ra + m_core->m_r[ra] = (uint16_t)lres; } - - unimplemented_opcode(op, ximm); return; } case 0x02: @@ -151,8 +60,6 @@ void unsp_20_device::execute_extended_group(uint16_t op) // Ext Push/Pop if (ximm & 0x8000) { - // just skip for now, as nothing really even uses the extended registers yet - uint8_t rb = (ximm & 0x000f) >> 0; uint8_t size = (ximm & 0x7000) >> 12; uint8_t rx = (ximm & 0x0e00) >> 9; @@ -166,10 +73,7 @@ void unsp_20_device::execute_extended_group(uint16_t op) while (size--) { - if (rb & 0x8) - push(m_secondary_r[rx--], &m_secondary_r[rb & 0x7]); - else - push(m_secondary_r[rx--], &m_core->m_r[rb & 0x7]); + push(m_core->m_r[(rx--) + 8], &m_core->m_r[rb]); } } else @@ -177,7 +81,7 @@ void unsp_20_device::execute_extended_group(uint16_t op) logerror("(Ext) push <BAD>\n"); unimplemented_opcode(op, ximm); } - + return; } else @@ -192,15 +96,15 @@ void unsp_20_device::execute_extended_group(uint16_t op) if ((rx - (size - 1)) >= 0) { //logerror("(Ext) pop %s, %s from [%s]\n", - // extregs[rx - size], extregs[rx], (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); + // extregs[rx - size], extregs[rx], (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); int realrx = 7 - rx; while (size--) { if (rb & 0x8) - m_secondary_r[realrx++] = pop(&m_secondary_r[rb & 0x07]); + m_core->m_r[(realrx++) + 8] = pop(&m_core->m_r[(rb & 0x07) + 8]); else - m_secondary_r[realrx++] = pop(&m_core->m_r[rb & 0x07]); + m_core->m_r[(realrx++) + 8] = pop(&m_core->m_r[rb & 0x07]); } } else @@ -219,135 +123,33 @@ void unsp_20_device::execute_extended_group(uint16_t op) uint16_t imm16_2 = read16(UNSP_LPC); add_lpc(1); - // Ra=Rb op IMM16 + // Ra = Rb op IMM16 + // A = B op C + uint8_t aluop = (ximm & 0xf000) >> 12; uint8_t rb = (ximm & 0x000f) >> 0; uint8_t ra = (ximm & 0x0e00) >> 9; ra |= (ximm & 0x0100) >> 5; - switch (aluop) - { - case 0x00: // add - // A = B + C - logerror( "(Extended group 1) %s = %s + %04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x01: // adc - // A = B + C, Carry - logerror( "(Extended group 1) %s = %s + %04x, carry\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x02: // sub - // A = B - C - logerror( "(Extended group 1) %s = %s - %04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x03: // sbc - // A = B - C, Carry - logerror( "(Extended group 1) %s = %s - %04x, carry\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + uint16_t b = m_core->m_r[rb]; + uint32_t lres; + uint32_t storeaddr = 0;// m_core->m_r[ra]; // dest address for STORE (invalid anyway?) - case 0x04: // cmp - // CMP B,C - logerror( "(Extended group 1) cmp %s, %04x\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x06: // neg - // A = -C - logerror( "(Extended group 1) %s = -%04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x08: // xor - // A = B ^ C - logerror( "(Extended group 1) %s = %s ^ %04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x09: // load + if (aluop == 0xd) { - // A = C - //logerror("(Extended group 1) %s = %04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - // , imm16_2); - m_core->m_icount -= 1; // TODO - - uint16_t lres = imm16_2; - update_nz(lres); - if (ra & 0x8) - { - m_secondary_r[ra & 0x7] = (uint16_t)lres; - } - else - { - m_core->m_r[ra & 0x7] = (uint16_t)lres; - } - - return; - break; - } - case 0x0a: // or - // A = B | C - logerror( "(Extended group 1) %s = %s | %04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); + // store is invalid? unimplemented_opcode(op, ximm, imm16_2); - return; - break; + } - case 0x0b: // and - // A = B & C - logerror( "(Extended group 1) %s = %s & %04x\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + bool write = do_basic_alu_ops(aluop, lres, b, imm16_2, storeaddr, (ra != 7)); - case 0x0c: // test - // TEST B,C - logerror( "(Extended group 1) test %s, %04x\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0d: // store, C = B, invalid for this mode (would store to immediate) - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 1) <INVALID Ra=Rb op IMM16 form>\n"); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + if (write) + { + // a = Ra + m_core->m_r[ra] = (uint16_t)lres; } - unimplemented_opcode(op, ximm, imm16_2); return; } @@ -357,891 +159,165 @@ void unsp_20_device::execute_extended_group(uint16_t op) uint16_t imm16_2 = read16(UNSP_LPC); add_lpc(1); - // Ra=Rb op [A16] + // Ra = Rb op [A16] + // A = B op C + uint8_t aluop = (ximm & 0xf000) >> 12; uint8_t rb = (ximm & 0x000f) >> 0; uint8_t ra = (ximm & 0x0e00) >> 9; ra |= (ximm & 0x0100) >> 5; - switch (aluop) - { - case 0x00: // add - // A = B + C - logerror( "(Extended group 2) %s = %s + [%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + uint16_t b = m_core->m_r[rb]; + uint16_t c = read16(imm16_2); + uint32_t storeaddr = imm16_2; // dest address for STORE + uint32_t lres; - case 0x01: // adc - // A = B + C, Carry - logerror( "(Extended group 2) %s = %s + [%04x], carry\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x02: // sub - // A = B - C - logerror( "(Extended group 2) %s = %s - [%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + bool write = do_basic_alu_ops(aluop, lres, b, c, storeaddr, (ra != 7)); - case 0x03: // sbc - // A = B - C, Carry - logerror( "(Extended group 2) %s = %s - [%04x], carry\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x04: // cmp - // CMP B,C - logerror( "(Extended group 2) cmp %s, [%04x]\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x06: // neg - // A = -C - logerror( "(Extended group 2) %s = -[%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x08: // xor - // A = B ^ C - logerror( "(Extended group 2) %s = %s ^ [%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x09: // load + if (write) { - // A = C - //logerror("(Extended group 2) %s = [%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - // , imm16_2); - //unimplemented_opcode(op, ximm, imm16_2); - - m_core->m_icount -= 1; // TODO - - //uin32_t lreg = UNSP_LREG_I(imm16_2); - - uint16_t lres = read16(imm16_2); - update_nz(lres); - if (ra & 0x8) - { - m_secondary_r[ra & 0x7] = (uint16_t)lres; - } - else - { - m_core->m_r[ra & 0x7] = (uint16_t)lres; - } - - return; - break; + // a = Ra + m_core->m_r[ra] = (uint16_t)lres; } - case 0x0a: // or - // A = B | C - logerror( "(Extended group 2) %s = %s | [%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0b: // and - // A = B & C - logerror( "(Extended group 2) %s = %s & [%04x]\n", (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7] - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0c: // test - // TEST B,C - logerror( "(Extended group 2) test %s, [%04x]\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , imm16_2); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0d: // store - // C = B - logerror( "(Extended group 2) [%04x] = %s\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 2) <INVALID Ra = Rb op [A16] form>\n"); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - } - - unimplemented_opcode(op, ximm, imm16_2); return; } case 0x07: case 0x17: { + // this decoding / hookup might be incorrect, only seen Store used, and that the decode seems strange for that + uint16_t imm16_2 = read16(UNSP_LPC); add_lpc(1); //[A16] = Ra op Rb + // A = B op C + uint8_t aluop = (ximm & 0xf000) >> 12; uint8_t rb = (ximm & 0x000f) >> 0; uint8_t ra = (ximm & 0x0e00) >> 9; ra |= (ximm & 0x0100) >> 5; - switch (aluop) - { - case 0x00: // add - // A = B + C - logerror( "(Extended group 3) [%04x] = %s + %s\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + uint16_t a = imm16_2; + uint16_t b = m_core->m_r[ra]; + uint16_t c = m_core->m_r[rb]; + uint32_t lres; + uint32_t r2 = a; - case 0x01: // adc - // A = B + C, Carry - logerror( "(Extended group 3) [%04x] = %s + %s, carry\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + bool write = do_basic_alu_ops(aluop, lres, b, c, r2, true); - case 0x02: // sub - // A = B - C - logerror( "(Extended group 3) [%04x] = %s - %s\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x03: // sbc - // A = B - C, Carry - logerror( "(Extended group 3) [%04x] = %s - %s, carry\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x04: // cmp (is this even a valid form? [A16] not even used) - // CMP B,C - logerror( "(Extended group 3) cmp %s, %s\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x06: // neg - // A = -C - logerror( "(Extended group 3) [%04x] = -%s\n", imm16_2 - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x08: // xor - // A = B ^ C - logerror( "(Extended group 3) [%04x] = %s ^ %s\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x09: // load - // A = C - logerror( "(Extended group 3) [%04x] = %s\n", imm16_2 - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0a: // or - // A = B | C - logerror( "(Extended group 3) [%04x] = %s | %s\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0b: // and - // A = B & C - logerror( "(Extended group 3) [%04x] = %s & %s\n", imm16_2 - , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0c: // test (is this even a valid form? [A16] not even used) - // TEST B,C - logerror( "(Extended group 3) test %s, %s\n", (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7] - , (ra & 0x8) ? extregs[ra & 0x7] : regs[ra & 0x7]); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; - - case 0x0d: // store (is this even a valid form? [A16] not even used if C = B form below is used, code needs to write to A) + if (write) { - // C = B - //logerror( "(Extended group 3) [%04x] = %s\n", imm16_2 - // , (rb & 0x8) ? extregs[rb & 0x7] : regs[rb & 0x7]); - m_core->m_icount -= 1; // TODO - - if (ra != rb) - { - logerror("(Extended group 3) store ra != rb"); - unimplemented_opcode(op, ximm, imm16_2); - } - - if (rb & 0x8) - { - write16(imm16_2, m_secondary_r[rb & 0x07]); - } - else - { - write16(imm16_2, m_core->m_r[rb & 0x07]); - } - - return; - break; - } - - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 3) <INVALID [A16] = Ra op Rb form>\n"); - unimplemented_opcode(op, ximm, imm16_2); - return; - break; + // a = [A16] + write16(imm16_2, lres); } - unimplemented_opcode(op, ximm, imm16_2); return; } case 0x08: case 0x09: { - // Ext Indirect Rx=Rx op [Ry@] - uint8_t aluop = (ximm & 0xf000) >> 12; - uint8_t ry = (ximm & 0x0007) >> 0; - uint8_t form = (ximm & 0x0018) >> 3; - uint8_t rx = (ximm & 0x0e00) >> 9; + // Ext Indirect + // Rx = Rx op [Ry@] + // A = B op C - switch (aluop) - { - case 0x00: // add - // A += B - logerror( "(Extended group 4) %s += ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x01: // adc - // A += B, Carry - logerror( "(Extended group 4) %s += ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror( ", carry"); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x02: // sub - // A -= B - logerror( "(Extended group 4) %s -= ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x03: // sbc - // A -= B, Carry - logerror( "(Extended group 4) %s -= ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror( ", carry"); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x04: // cmp - // CMP A,B - logerror( "(Extended group 4) cmp %s, ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x06: // neg - // A = -B - logerror( "(Extended group 4) %s = -", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x08: // xor - // A ^= B - logerror( "(Extended group 4) %s ^= ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x09: // load - // A = B - logerror( "(Extended group 4) %s = ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0a: // or - // A |= B - logerror( "(Extended group 4) %s |= ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0b: // and - // A &= B - logerror( "(Extended group 4) %s &= ", extregs[rx]); - logerror( forms[form], extregs[ry]); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0c: // test - // TEST A,B - logerror( "(Extended group 4) test %s, ", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0d: // store - // B = A - logerror( "(Extended group 4) "); - logerror( forms[form], extregs[ry]); - logerror( " = %s", extregs[rx]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 4) <INVALID Indirect Rx=Rx op [Ry@] form>\n"); - unimplemented_opcode(op, ximm); - return; - break; - } + //uint8_t aluop = (ximm & 0xf000) >> 12; + //uint8_t ry = (ximm & 0x0007) >> 0; + //uint8_t form = (ximm & 0x0018) >> 3; + //uint8_t rx = (ximm & 0x0e00) >> 9; + logerror("(Extended group 4 'Rx=Rx op [Ry@]' form) unimplemented "); unimplemented_opcode(op, ximm); return; } case 0x0a: case 0x0b: { // Ext DS_Indirect Rx=Rx op ds:[Ry@] - uint8_t aluop = (ximm & 0xf000) >> 12; - uint8_t ry = (ximm & 0x0007) >> 0; - uint8_t form = (ximm & 0x0018) >> 3; - uint8_t rx = (ximm & 0x0e00) >> 9; - switch (aluop) - { - case 0x00: // add - // A += B - logerror( "(Extended group 5) %s += ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x01: // adc - // A += B, Carry - logerror( "(Extended group 5) %s += ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror( ", carry"); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; + //uint8_t aluop = (ximm & 0xf000) >> 12; + //uint8_t ry = (ximm & 0x0007) >> 0; + //uint8_t form = (ximm & 0x0018) >> 3; + //uint8_t rx = (ximm & 0x0e00) >> 9; - case 0x02: // sub - // A -= B - logerror( "(Extended group 5) %s -= ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x03: // sbc - // A -= B, Carry - logerror( "(Extended group 5) %s -= ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror( ", carry"); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x04: // cmp - // CMP A,B - logerror( "(Extended group 5) cmp %s, ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x06: // neg - // A = -B - logerror( "(Extended group 5) %s = -ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x08: // xor - // A ^= B - logerror( "(Extended group 5) %s ^= ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x09: // load - // A = B - logerror( "(Extended group 5) %s = ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0a: // or - // A |= B - logerror( "(Extended group 5) %s |= ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0b: // and - // A &= B - logerror( "(Extended group 5) %s &= ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0c: // test - // TEST A,B - logerror( "(Extended group 5) test %s, ds:", extregs[rx]); - logerror( forms[form], extregs[ry]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0d: // store - // B = A - logerror( "(Extended group 5) ds:"); - logerror( forms[form], extregs[ry]); - logerror( " = %s", extregs[rx]); - logerror("\n"); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 5) <INVALID DS_Indirect Rx=Rx op ds:[Ry@] form>\n"); - unimplemented_opcode(op, ximm); - return; - break; - } + logerror("(Extended group 5 'Rx=Rx op ds:[Ry@]' form) unimplemented "); unimplemented_opcode(op, ximm); return; } case 0x18: case 0x19: case 0x1a: case 0x1b: { - // Ext IM6 Rx=Rx op IM6 + // Ext IM6 + // Rx = Rx op IM6 + // A = B op C + uint8_t aluop = (ximm & 0xf000) >> 12; uint8_t rx = (ximm & 0x0e00) >> 9; uint8_t imm6 = (ximm & 0x003f) >> 0; - switch (aluop) - { - case 0x00: // add - // A += B - logerror("(Extended group 6) %s += %02x\n", extregs[rx], imm6); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x01: // adc - // A += B, Carry - logerror("(Extended group 6) %s += %02x, carry\n", extregs[rx], imm6); - unimplemented_opcode(op, ximm); - return; - break; + uint16_t b = m_core->m_r[rx + 8]; + uint16_t c = imm6; - case 0x02: // sub - // A -= B - logerror("(Extended group 6) %s -= %02x\n", extregs[rx], imm6); - unimplemented_opcode(op, ximm); - return; - break; + uint32_t storeaddr = 0; // dest address for STORE + uint32_t lres; - case 0x03: // sbc - // A -= B, Carry - logerror("(Extended group 6) %s -= %02x, carry\n", extregs[rx], imm6); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x04: // cmp + if (aluop == 0xd) { - // CMP A,B - //logerror("(Extended group 6) cmp %s, %02x\n", extregs[rx], imm6); - - m_core->m_icount -= 1; // TODO - - uint16_t lres = m_secondary_r[rx] + (uint16_t)(~imm6) + uint32_t(1); - update_nzsc(lres, m_secondary_r[rx] , ~imm6); - - //unimplemented_opcode(op, ximm); - return; - break; - } - case 0x06: // neg - // A = -B - logerror( "(Extended group 6) %s = -%02x\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x08: // xor - // A ^= B - logerror( "(Extended group 6) %s ^= %02x\n", extregs[rx], imm6 ); + // store is invalid? unimplemented_opcode(op, ximm); - return; - break; - - case 0x09: // load - { - // A = B - //logerror( "(Extended group 6) %s = %02x\n", extregs[rx], imm6 ); - - m_core->m_icount -= 1; // TODO - - uint16_t lres = imm6; - update_nz(lres); - m_secondary_r[rx] = (uint16_t)lres; - - return; - break; } - case 0x0a: // or - // A |= B - logerror( "(Extended group 6) %s |= %02x\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0b: // and - // A &= B - logerror( "(Extended group 6) %s &= %02x\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; + bool write = do_basic_alu_ops(aluop, lres, b, c, storeaddr, true); - case 0x0c: // test - // TEST A,B - logerror( "(Extended group 6) test %s, %02x\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0d: // store, B = A (invalid for this type) - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 6) <INVALID IM6 Rx=Rx op IM6 form>\n"); - unimplemented_opcode(op, ximm); - return; - break; + if (write) + { + // A = Rx + m_core->m_r[rx + 8] = (uint16_t)lres; } - unimplemented_opcode(op, ximm); return; } case 0x0c: case 0x0d: case 0x0e: case 0x0f: { - // Ext Base+Disp6 Rx=Rx op [BP+IM6] + // Ext Base+Disp6 + // Rx = Rx op [BP+IM6] + // A = B op C + uint8_t aluop = (ximm & 0xf000) >> 12; uint8_t rx = (ximm & 0x0e00) >> 9; uint8_t imm6 = (ximm & 0x003f) >> 0; - switch (aluop) - { - case 0x00: // add - // A += B - logerror( "(Extended group 7) %s += [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x01: // adc - // A += B, Carry - logerror( "(Extended group 7) %s += [BP+%02x], carry\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; + uint32_t addr = (uint16_t)(m_core->m_r[REG_BP] + (imm6 & 0x3f)); - case 0x02: // sub - // A -= B - logerror( "(Extended group 7) %s -= [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; + uint16_t b = m_core->m_r[rx + 8]; + uint16_t c = read16(addr); - case 0x03: // sbc - // A -= B, Carry - logerror( "(Extended group 7) %s -= [BP+%02x], carry\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; + uint32_t storeaddr = addr; // dest address for STORE + uint32_t lres; - case 0x04: // cmp - // CMP A,B - logerror( "(Extended group 7) cmp %s, [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x06: // neg - // A = -B - logerror( "(Extended group 7) %s = -[BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x08: // xor - // A ^= B - logerror( "(Extended group 7) %s ^= [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x09: // load - // A = B - logerror( "(Extended group 7) %s = [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0a: // or - // A |= B - logerror( "(Extended group 7) %s |= [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0b: // and - // A &= B - logerror( "(Extended group 7) %s &= [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0c: // test - // TEST A,B - logerror( "(Extended group 7) test %s, [BP+%02x]\n", extregs[rx], imm6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0d: // store - // B = A - logerror( "(Extended group 7) [BP+%02x] = %s\n", imm6, extregs[rx] ); - unimplemented_opcode(op, ximm); - return; - break; + bool write = do_basic_alu_ops(aluop, lres, b, c, storeaddr, true); - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 7) <INVALID Base+Disp6 Rx=Rx op [BP+IM6] form>\n"); - unimplemented_opcode(op, ximm); - return; - break; + if (write) + { + // A = Rx + m_core->m_r[rx + 8] = (uint16_t)lres; } - unimplemented_opcode(op, ximm); return; } case 0x1c: case 0x1d: case 0x1e: case 0x1f: { - // Ext A6 Rx=Rx op [A6] - uint8_t aluop = (ximm & 0xf000) >> 12; - uint8_t rx = (ximm & 0x0e00) >> 9; - uint8_t a6 = (ximm & 0x003f) >> 0; - - switch (aluop) - { - case 0x00: // add - // A += B - logerror( "(Extended group 8) %s += [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x01: // adc - // A += B, Carry - logerror( "(Extended group 8) %s += [%02x], carry\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x02: // sub - // A -= B - logerror( "(Extended group 8) %s -= [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x03: // sbc - // A -= B, Carry - logerror( "(Extended group 8) %s -= [%02x], carry\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x04: // cmp - // CMP A,B - logerror( "(Extended group 8) cmp %s, [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x06: // neg - // A = -B - logerror( "(Extended group 8) %s = -[%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x08: // xor - // A ^= B - logerror( "(Extended group 8) %s ^= [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x09: // load - // A = B - logerror( "(Extended group 8) %s = [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0a: // or - // A |= B - logerror( "(Extended group 8) %s |= [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; + // Ext A6 + // Rx = Rx op [A6] + // A = B op C - case 0x0b: // and - // A &= B - logerror( "(Extended group 8) %s &= [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0c: // test - // TEST A,B - logerror( "(Extended group 8) test %s, [%02x]\n", extregs[rx], a6 ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x0d: // store - // B = A - logerror( "(Extended group 8) [%02x] = %s\n", a6, extregs[rx] ); - unimplemented_opcode(op, ximm); - return; - break; - - case 0x05: // invalid - case 0x07: // invalid - case 0x0e: // invalid - case 0x0f: // invalid - logerror( "(Extended group 8) <INVALID A6 Rx=Rx op [A6] form>\n"); - unimplemented_opcode(op, ximm); - return; - break; - } + //uint8_t aluop = (ximm & 0xf000) >> 12; + //uint8_t rx = (ximm & 0x0e00) >> 9; + //uint8_t a6 = (ximm & 0x003f) >> 0; + logerror("(Extended group 8 'Rx=Rx op [A6]' form) unimplemented "); unimplemented_opcode(op, ximm); return; diff --git a/src/devices/cpu/unsp/unsp_exxx.cpp b/src/devices/cpu/unsp/unsp_exxx.cpp index 5e8f108ed52..0107c1fd0c7 100644 --- a/src/devices/cpu/unsp/unsp_exxx.cpp +++ b/src/devices/cpu/unsp/unsp_exxx.cpp @@ -9,6 +9,14 @@ #include "unspdasm.h" +#define LOG_UNSP_SHIFTS (1U << 2) +#define LOG_UNSP_MULS (1U << 1) + +#define VERBOSE (0) + +#include "logmacro.h" + + void unsp_device::execute_exxx_group(uint16_t op) { // several exxx opcodes have already been decoded as jumps by the time we get here @@ -60,7 +68,7 @@ void unsp_12_device::execute_exxx_group(uint16_t op) return; case 0x03: - fatalerror("UNSP: unknown opcode invb Rd,offset (%04x) at %04x\n", op, UNSP_LPC); + m_core->m_r[rd] ^= (1 << offset); return; } return; @@ -120,7 +128,7 @@ void unsp_12_device::execute_exxx_group(uint16_t op) const uint16_t opb = op & 7; m_core->m_icount -= 12; - logerror("%s: MUL su with %04x (signed) * %04x (unsigned) : ", machine().describe_context(), m_core->m_r[opa], m_core->m_r[opb]); + LOGMASKED(LOG_UNSP_MULS, "%s: MUL su with %04x (signed) * %04x (unsigned) : ", machine().describe_context(), m_core->m_r[opa], m_core->m_r[opb]); uint32_t lres = m_core->m_r[opa] * m_core->m_r[opb]; if (m_core->m_r[opa] & 0x8000) @@ -130,7 +138,7 @@ void unsp_12_device::execute_exxx_group(uint16_t op) m_core->m_r[REG_R4] = lres >> 16; m_core->m_r[REG_R3] = (uint16_t)lres; - logerror("result was : %08x\n", lres); + LOGMASKED(LOG_UNSP_MULS, "result was : %08x\n", lres); return; } @@ -156,7 +164,7 @@ void unsp_12_device::execute_exxx_group(uint16_t op) // MULS uu or MULS su (invalid?) print_muls(stream, op); */ - logerror("MULS uu or su\n"); + LOGMASKED(LOG_UNSP_MULS, "MULS uu or su\n"); unimplemented_opcode(op); return; } @@ -170,56 +178,110 @@ void unsp_12_device::execute_exxx_group(uint16_t op) switch (shift) { case 0x00: - logerror("%s = %s asr %s\n", regs[rd], regs[rd], regs[rs]); + LOGMASKED(LOG_UNSP_SHIFTS, "%s = %s asr %s\n", regs[rd], regs[rd], regs[rs]); unimplemented_opcode(op); return; - case 0x01: - logerror("%s = %s asror %s\n", regs[rd], regs[rd], regs[rs]); - unimplemented_opcode(op); + case 0x01: // jak_car2 on starting a game + { + LOGMASKED(LOG_UNSP_SHIFTS, "%s = %s asror %s\n", regs[rd], regs[rd], regs[rs]); + if (rd != 4) // 4 = R4 3 = R3 - the 'register bleeding' is only verified as needed between r3/r4, so bail for other regs until verified + unimplemented_opcode(op); + + uint32_t res = (uint16_t)(m_core->m_r[rd]); + int shift = (m_core->m_r[rs] & 0x01f); + res <<= 16; + + if (res & 0x80000000) + { + res = res >> shift; + res |= (0xffffffff << (32 - shift)); + + m_core->m_r[rd] = (res >> 16); + m_core->m_r[rd - 1] |= (res & 0xffff); // register bleeding? + } + else + { + res = res >> shift; + m_core->m_r[rd] = (res >> 16); + m_core->m_r[rd - 1] |= (res & 0xffff); // register bleeding? + } + + LOGMASKED(LOG_UNSP_SHIFTS, "result %04x\n", m_core->m_r[rd]); return; + } case 0x02: - logerror("pc:%06x: %s = %s lsl %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); - m_core->m_r[rd] = (uint16_t)((m_core->m_r[rd]&0xffff) << (m_core->m_r[rs] & 0x0f)); - logerror("result %04x\n", m_core->m_r[rd]); + LOGMASKED(LOG_UNSP_SHIFTS, "pc:%06x: %s = %s lsl %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); + + m_core->m_r[rd] = (uint16_t)((m_core->m_r[rd]&0xffff) << (m_core->m_r[rs] & 0x01f)); + + LOGMASKED(LOG_UNSP_SHIFTS, "result %04x\n", m_core->m_r[rd]); + return; case 0x03: { // wrlshunt uses this - logerror("pc:%06x: %s = %s lslor %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); - uint16_t tmp = m_core->m_r[rd]; - m_core->m_r[rd] = (uint16_t)((m_core->m_r[rd]&0xffff) << (m_core->m_r[rs] & 0x0f)); - m_core->m_r[rd] |= tmp; // guess - logerror("result %04x\n", m_core->m_r[rd]); + LOGMASKED(LOG_UNSP_SHIFTS, "pc:%06x: %s = %s lslor %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); + + if (rd != 3) // 4 = R4 3 = R3 - the 'register bleeding' is only verified as needed between r3/r4, so bail for other regs until verified + unimplemented_opcode(op); + + uint32_t res = (uint16_t)(m_core->m_r[rd]); + + res <<= (m_core->m_r[rs] & 0x01f); + + m_core->m_r[rd] = (res & 0xffff); + m_core->m_r[rd + 1] |= (res >> 16); // register bleeding? + + LOGMASKED(LOG_UNSP_SHIFTS, "result %04x\n", m_core->m_r[rd]); return; } case 0x04: // smartfp loops increasing shift by 4 up to values of 28? (but regs are 16-bit?) - logerror("pc:%06x: %s = %s lsr %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); - m_core->m_r[rd] = (uint16_t)((m_core->m_r[rd]&0xffff) >> (m_core->m_r[rs] & 0xf)); - logerror("result %04x\n", m_core->m_r[rd]); + LOGMASKED(LOG_UNSP_SHIFTS, "pc:%06x: %s = %s lsr %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); + m_core->m_r[rd] = (uint16_t)((m_core->m_r[rd]&0xffff) >> (m_core->m_r[rs] & 0x1f)); + LOGMASKED(LOG_UNSP_SHIFTS, "result %04x\n", m_core->m_r[rd]); return; case 0x05: { - logerror("pc:%06x: %s = %s lsror %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); - uint16_t tmp = m_core->m_r[rd]; - m_core->m_r[rd] = (uint16_t)((m_core->m_r[rd]&0xffff) >> (m_core->m_r[rs] & 0x0f)); - m_core->m_r[rd] |= tmp; // guess - logerror("result %04x\n", m_core->m_r[rd]); + LOGMASKED(LOG_UNSP_SHIFTS, "pc:%06x: %s = %s lsror %s (%04x %04x) : ", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); + + if (rd != 4) // 4 = R4 3 = R3 - the 'register bleeding' is only verified as needed between r3/r4, so bail for other regs until verified + unimplemented_opcode(op); + + uint32_t res = (uint16_t)(m_core->m_r[rd]); + + res <<= 16; + + res = res >> (m_core->m_r[rs] & 0x01f); + + // register bleeding behavior needed (for example) in jak_cars2 nand browser when increasing upper digits of address + // TODO: check if I'm missing something becaus this doesn't really seem logical, maybe other code is meant to take care of those bits? + // (although R3/R4 are the 'MR' register used for multiply stuff, so maybe there is some logic to this?) + + // code attempts to put a 32-bit value in r4/r3 then shift it like this? + //3c990: e92a r4 = r4 lsl r2 + //3c991: e73a r3 = r3 lslor r2 + + m_core->m_r[rd] = (res >> 16); + m_core->m_r[rd - 1] |= (res & 0xffff); // register bleeding? + + + LOGMASKED(LOG_UNSP_SHIFTS, "result %04x\n", m_core->m_r[rd]); return; } case 0x06: - logerror("%s = %s rol %s\n", regs[rd], regs[rd], regs[rs]); + LOGMASKED(LOG_UNSP_SHIFTS, "%s = %s rol %s\n", regs[rd], regs[rd], regs[rs]); unimplemented_opcode(op); return; case 0x07: - logerror("%s = %s ror %s\n", regs[rd], regs[rd], regs[rs]); + LOGMASKED(LOG_UNSP_SHIFTS, "%s = %s ror %s\n", regs[rd], regs[rd], regs[rs]); unimplemented_opcode(op); return; } diff --git a/src/devices/cpu/unsp/unsp_fxxx.cpp b/src/devices/cpu/unsp/unsp_fxxx.cpp index c563ac1d88c..eed523c5568 100644 --- a/src/devices/cpu/unsp/unsp_fxxx.cpp +++ b/src/devices/cpu/unsp/unsp_fxxx.cpp @@ -45,14 +45,14 @@ inline void unsp_device::execute_fxxx_000_group(uint16_t op) { int r = op & 0x7; logerror("%s = fr\n", regs[r]); - unimplemented_opcode(op); + // unimplemented_opcode(op); return; } else if (((op & 0xf1f8) == 0xf038) && m_iso >= 12) { int r = op & 0x7; logerror("fr = %s\n", regs[r]); - unimplemented_opcode(op); + // unimplemented_opcode(op); return; } @@ -97,16 +97,60 @@ inline void unsp_device::execute_fxxx_001_group(uint16_t op) uint8_t bitop = (op & 0x0030) >> 4; uint8_t offset = (op & 0x000f) >> 0; uint8_t d = (op & 0x0400) >> 10; + uint16_t imm16 = read16(UNSP_LPC); + add_lpc(1); if (d) { - logerror("%s ds:[$04x],%d\n", bitops[bitop], offset); - unimplemented_opcode(op); + switch (bitop) + { + case 0x0: // tstb + logerror("tstb ds:[%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + + case 0x1: // setb + logerror("setb ds:[%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + + case 0x2: // clrb + logerror("clrb ds:[%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + + case 0x3: // invb + logerror("invb ds:[%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + } } else { - logerror("%s [$04x],%d\n", bitops[bitop], offset); - unimplemented_opcode(op); + switch (bitop) + { + case 0x0: // tstb + logerror("tstb [%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + + case 0x1: // setb (bkrankp uses this) + { + uint16_t temp = read16(imm16); + temp |= (1 << offset); + write16(imm16, temp); + break; + } + case 0x2: // clrb + logerror("clrb [%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + + case 0x3: // invb + logerror("invb [%04x],%d\n", imm16, offset); + unimplemented_opcode(op); + break; + } } return; diff --git a/src/devices/cpu/unsp/unsp_other.cpp b/src/devices/cpu/unsp/unsp_other.cpp index 9e9fb984cb4..2300f2a5bc0 100644 --- a/src/devices/cpu/unsp/unsp_other.cpp +++ b/src/devices/cpu/unsp/unsp_other.cpp @@ -204,6 +204,7 @@ void unsp_device::execute_remaining(const uint16_t op) r0 = m_core->m_r[opb]; r2 = read16(UNSP_LPC); add_lpc(1); + // additional special case 'if (op1 == 0x04 && opn == 0x03)' write logic below break; default: // Shifted ops @@ -266,12 +267,26 @@ void unsp_device::execute_remaining(const uint16_t op) break; } + bool write = do_basic_alu_ops(op0, lres, r0, r1, r2, (opa != 7) ? true : false); + + if (write) + { + if (op1 == 0x04 && opn == 0x03) // store [imm16], r + write16(r2, lres); + else + m_core->m_r[opa] = (uint16_t)lres; + } +} + + +bool unsp_device::do_basic_alu_ops(const uint16_t &op0, uint32_t &lres, uint16_t &r0, uint16_t &r1, uint32_t &r2, bool update_flags) +{ switch (op0) { case 0x00: // Add { lres = r0 + r1; - if (opa != 7) + if (update_flags) update_nzsc(lres, r0, r1); break; } @@ -279,69 +294,66 @@ void unsp_device::execute_remaining(const uint16_t op) { uint32_t c = (m_core->m_r[REG_SR] & UNSP_C) ? 1 : 0; lres = r0 + r1 + c; - if (opa != 7) + if (update_flags) update_nzsc(lres, r0, r1); break; } case 0x02: // Subtract lres = r0 + (uint16_t)(~r1) + uint32_t(1); - if (opa != 7) + if (update_flags) update_nzsc(lres, r0, ~r1); break; case 0x03: // Subtract w/ carry { uint32_t c = (m_core->m_r[REG_SR] & UNSP_C) ? 1 : 0; lres = r0 + (uint16_t)(~r1) + c; - if (opa != 7) + if (update_flags) update_nzsc(lres, r0, ~r1); break; } case 0x04: // Compare lres = r0 + (uint16_t)(~r1) + uint32_t(1); - if (opa != 7) + if (update_flags) update_nzsc(lres, r0, ~r1); - return; + return false; case 0x06: // Negate lres = -r1; - if (opa != 7) + if (update_flags) update_nz(lres); break; case 0x08: // XOR lres = r0 ^ r1; - if (opa != 7) + if (update_flags) update_nz(lres); break; case 0x09: // Load lres = r1; - if (opa != 7) + if (update_flags) update_nz(lres); break; case 0x0a: // OR lres = r0 | r1; - if (opa != 7) + if (update_flags) update_nz(lres); break; case 0x0b: // AND lres = r0 & r1; - if (opa != 7) + if (update_flags) update_nz(lres); break; case 0x0c: // Test lres = r0 & r1; - if (opa != 7) + if (update_flags) update_nz(lres); - return; + return false; case 0x0d: // Store write16(r2, r0); - return; + return false; default: - unimplemented_opcode(op); - return; + fatalerror("UNSP: illegal ALU optype %02x at %04x\n", op0, UNSP_LPC); + return false; } - if (op1 == 0x04 && opn == 0x03) // store [imm16], r - write16(r2, lres); - else - m_core->m_r[opa] = (uint16_t)lres; + return true; } diff --git a/src/devices/cpu/unsp/unspdasm_fxxx.cpp b/src/devices/cpu/unsp/unspdasm_fxxx.cpp index 2e3d44f1203..be663bed7b0 100644 --- a/src/devices/cpu/unsp/unspdasm_fxxx.cpp +++ b/src/devices/cpu/unsp/unspdasm_fxxx.cpp @@ -83,9 +83,9 @@ offs_t unsp_disassembler::disassemble_fxxx_001_group(std::ostream& stream, offs_ uint8_t d = (op & 0x0400) >> 10; if (d) - util::stream_format(stream, "%s ds:[$04x],%d", bitops[bitop], offset); + util::stream_format(stream, "%s ds:[%04x],%d", bitops[bitop], ximm, offset); else - util::stream_format(stream, "%s [$04x],%d", bitops[bitop], offset); + util::stream_format(stream, "%s [%04x],%d", bitops[bitop], ximm, offset); return UNSP_DASM_OK; } diff --git a/src/devices/cpu/v60/op12.hxx b/src/devices/cpu/v60/op12.hxx index cb9dde1c153..87223ab5020 100644 --- a/src/devices/cpu/v60/op12.hxx +++ b/src/devices/cpu/v60/op12.hxx @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Farfetch'd, R. Belmont /* - * MUL* and MULU* do not set OV correctly * DIVX: the second operand should be treated as dword instead of word * GETATE, GETPTE and GETRA should not be used * UPDPSW: _CY and _OV must be cleared or unchanged? I suppose @@ -998,7 +997,6 @@ uint32_t v60_device::opMULB() F12LOADOP2BYTE(); - // @@@ OV not set!! tmp = (int8_t)appb * (int32_t)(int8_t)m_op1; appb = tmp; _Z = (appb == 0); @@ -1017,7 +1015,6 @@ uint32_t v60_device::opMULH() F12LOADOP2HALF(); - // @@@ OV not set!! tmp = (int16_t)apph * (int32_t)(int16_t)m_op1; apph = tmp; _Z = (apph == 0); @@ -1036,7 +1033,6 @@ uint32_t v60_device::opMULW() F12LOADOP2WORD(); - // @@@ OV not set!! tmp = (int32_t)appw * (int64_t)(int32_t)m_op1; appw = tmp; _Z = (appw == 0); @@ -1055,7 +1051,6 @@ uint32_t v60_device::opMULUB() F12LOADOP2BYTE(); - // @@@ OV not set!! tmp = appb * (uint8_t)m_op1; appb = tmp; _Z = (appb == 0); @@ -1074,7 +1069,6 @@ uint32_t v60_device::opMULUH() F12LOADOP2HALF(); - // @@@ OV not set!! tmp = apph * (uint16_t)m_op1; apph = tmp; _Z = (apph == 0); @@ -1093,7 +1087,6 @@ uint32_t v60_device::opMULUW() F12LOADOP2WORD(); - // @@@ OV not set!! tmp = (uint64_t)appw * (uint64_t)m_op1; appw = tmp; _Z = (appw == 0); @@ -1110,6 +1103,7 @@ uint32_t v60_device::opNEGB() /* TRUSTED (C too!)*/ m_modwritevalb = 0; SUBB(m_modwritevalb, (int8_t)m_op1); + _CY = m_modwritevalb ? 1 : 0; F12WriteSecondOperand(0); F12END(); @@ -1121,6 +1115,7 @@ uint32_t v60_device::opNEGH() /* TRUSTED (C too!)*/ m_modwritevalh = 0; SUBW(m_modwritevalh, (int16_t)m_op1); + _CY = m_modwritevalh ? 1 : 0; F12WriteSecondOperand(1); F12END(); @@ -1132,6 +1127,7 @@ uint32_t v60_device::opNEGW() /* TRUSTED (C too!)*/ m_modwritevalw = 0; SUBL(m_modwritevalw, (int32_t)m_op1); + _CY = m_modwritevalw ? 1 : 0; F12WriteSecondOperand(2); F12END(); diff --git a/src/devices/cpu/v60/v60.cpp b/src/devices/cpu/v60/v60.cpp index 9fb8374ae1b..989e509ef2e 100644 --- a/src/devices/cpu/v60/v60.cpp +++ b/src/devices/cpu/v60/v60.cpp @@ -152,17 +152,17 @@ std::unique_ptr<util::disasm_interface> v60_device::create_disassembler() #define SetSZPF_Word(x) {_Z = ((uint16_t)(x) == 0); _S = ((x)&0x8000) ? 1 : 0; } #define SetSZPF_Long(x) {_Z = ((uint32_t)(x) == 0); _S = ((x)&0x80000000) ? 1 : 0; } -#define ORB(dst, src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } -#define ORW(dst, src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Word(dst); } -#define ORL(dst, src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Long(dst); } +#define ORB(dst, src) { (dst) |= (src); _OV = 0; SetSZPF_Byte(dst); } +#define ORW(dst, src) { (dst) |= (src); _OV = 0; SetSZPF_Word(dst); } +#define ORL(dst, src) { (dst) |= (src); _OV = 0; SetSZPF_Long(dst); } -#define ANDB(dst, src) { (dst) &= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } -#define ANDW(dst, src) { (dst) &= (src); _CY = _OV = 0; SetSZPF_Word(dst); } -#define ANDL(dst, src) { (dst) &= (src); _CY = _OV = 0; SetSZPF_Long(dst); } +#define ANDB(dst, src) { (dst) &= (src); _OV = 0; SetSZPF_Byte(dst); } +#define ANDW(dst, src) { (dst) &= (src); _OV = 0; SetSZPF_Word(dst); } +#define ANDL(dst, src) { (dst) &= (src); _OV = 0; SetSZPF_Long(dst); } -#define XORB(dst, src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } -#define XORW(dst, src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Word(dst); } -#define XORL(dst, src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Long(dst); } +#define XORB(dst, src) { (dst) ^= (src); _OV = 0; SetSZPF_Byte(dst); } +#define XORW(dst, src) { (dst) ^= (src); _OV = 0; SetSZPF_Word(dst); } +#define XORL(dst, src) { (dst) ^= (src); _OV = 0; SetSZPF_Long(dst); } #define SUBB(dst, src) { unsigned res = (dst) - (src); SetCFB(res); SetOFB_Sub(res, src, dst); SetSZPF_Byte(res); dst = (uint8_t)res; } #define SUBW(dst, src) { unsigned res = (dst) - (src); SetCFW(res); SetOFW_Sub(res, src, dst); SetSZPF_Word(res); dst = (uint16_t)res; } @@ -498,7 +498,7 @@ void v60_device::device_start() state_add( STATE_GENPC, "GENPC", PC).noshow(); state_add( STATE_GENPCBASE, "CURPC", m_PPC ).noshow(); state_add( STATE_GENSP, "GENSP", SP ).noshow(); - state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).noshow(); + state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).callimport().formatstr("%7s").noshow(); set_icountptr(m_icount); } @@ -514,6 +514,18 @@ void v60_device::state_export(const device_state_entry &entry) } } +void v60_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch(entry.index()) { + case STATE_GENFLAGS: + str = string_format("%c%c%c%c", + PSW & 1 ? 'Z' : '.', + PSW & 2 ? 'S' : '.', + PSW & 4 ? 'O' : '.', + PSW & 8 ? 'C' : '.'); + break; + } +} void v60_device::state_import(const device_state_entry &entry) { diff --git a/src/devices/cpu/v60/v60.h b/src/devices/cpu/v60/v60.h index 805028fb0c7..35c5843c487 100644 --- a/src/devices/cpu/v60/v60.h +++ b/src/devices/cpu/v60/v60.h @@ -109,6 +109,7 @@ protected: // device_state_interface overrides virtual void state_import(const device_state_entry &entry) override; virtual void state_export(const device_state_entry &entry) override; + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; diff --git a/src/devices/cpu/v60/v60d.cpp b/src/devices/cpu/v60/v60d.cpp index d5d5c2d2f25..c611122724c 100644 --- a/src/devices/cpu/v60/v60d.cpp +++ b/src/devices/cpu/v60/v60d.cpp @@ -181,15 +181,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons if(m) { switch(mod>>5) { case 0: // Double displacement (8 bit) - out_AM_DoubleDisplacement(mod&0x1F, opcodes.r8(pc+1), opcodes.r8(pc+2), opsize, stream); + out_AM_DoubleDisplacement(mod&0x1F, int8_t(opcodes.r8(pc+1)), int8_t(opcodes.r8(pc+2)), opsize, stream); return 3; case 1: // Double displacement (16 bit) - out_AM_DoubleDisplacement(mod&0x1F, opcodes.r16(pc+1), opcodes.r16(pc+3), opsize, stream); + out_AM_DoubleDisplacement(mod&0x1F, int16_t(opcodes.r16(pc+1)), int16_t(opcodes.r16(pc+3)), opsize, stream); return 5; case 2: // Double displacement (32 bit) - out_AM_DoubleDisplacement(mod&0x1F, opcodes.r32(pc+1), opcodes.r32(pc+5), opsize, stream); + out_AM_DoubleDisplacement(mod&0x1F, int32_t(opcodes.r32(pc+1)), int32_t(opcodes.r32(pc+5)), opsize, stream); return 9; case 3: // Register @@ -208,15 +208,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons switch (opcodes.r8(pc+1)>>5) { case 0: // Displacement indexed (8 bit) - out_AM_DisplacementIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, opcodes.r8(pc+2), opsize, stream); + out_AM_DisplacementIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, int8_t(opcodes.r8(pc+2)), opsize, stream); return 3; case 1: // Displacement indexed (16 bit) - out_AM_DisplacementIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, opcodes.r16(pc+2), opsize, stream); + out_AM_DisplacementIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, int16_t(opcodes.r16(pc+2)), opsize, stream); return 4; case 2: // Displacement indexed (32 bit) - out_AM_DisplacementIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, opcodes.r32(pc+2), opsize, stream); + out_AM_DisplacementIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, int32_t(opcodes.r32(pc+2)), opsize, stream); return 6; case 3: // Register indirect indexed @@ -224,30 +224,30 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons return 2; case 4: // Displacement indirect indexed (8 bit) - out_AM_DisplacementIndirectIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, opcodes.r8(pc+2), opsize, stream); + out_AM_DisplacementIndirectIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, int8_t(opcodes.r8(pc+2)), opsize, stream); return 3; case 5: // Displacement indirect indexed (16 bit) - out_AM_DisplacementIndirectIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, opcodes.r16(pc+2), opsize, stream); + out_AM_DisplacementIndirectIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, int16_t(opcodes.r16(pc+2)), opsize, stream); return 4; case 6: // Displacement indirect indexed (32 bit) - out_AM_DisplacementIndirectIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, opcodes.r32(pc+2), opsize, stream); + out_AM_DisplacementIndirectIndexed(opcodes.r8(pc+1)&0x1F, mod&0x1F, int32_t(opcodes.r32(pc+2)), opsize, stream); return 6; case 7: switch (opcodes.r8(pc+1)&0x1F) { case 16: // PC Displacement Indexed (8 bit) - out_AM_PCDisplacementIndexed(ipc, opcodes.r8(pc+2), mod&0x1F, opsize, stream); + out_AM_PCDisplacementIndexed(ipc, int8_t(opcodes.r8(pc+2)), mod&0x1F, opsize, stream); return 3; case 17: // PC Displacement Indexed (16 bit) - out_AM_PCDisplacementIndexed(ipc, opcodes.r16(pc+2), mod&0x1F, opsize, stream); + out_AM_PCDisplacementIndexed(ipc, int16_t(opcodes.r16(pc+2)), mod&0x1F, opsize, stream); return 4; case 18: // PC Displacement Indexed (32 bit) - out_AM_PCDisplacementIndexed(ipc, opcodes.r32(pc+2), mod&0x1F, opsize, stream); + out_AM_PCDisplacementIndexed(ipc, int32_t(opcodes.r32(pc+2)), mod&0x1F, opsize, stream); return 6; case 19: // Direct Address Indexed @@ -255,15 +255,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons return 6; case 24: // PC Displacement Indirect Indexed(8 bit) - out_AM_PCDisplacementIndirectIndexed(ipc, opcodes.r8(pc+2), mod&0x1F, opsize, stream); + out_AM_PCDisplacementIndirectIndexed(ipc, int8_t(opcodes.r8(pc+2)), mod&0x1F, opsize, stream); return 3; case 25: // PC Displacement Indirect Indexed (16 bit) - out_AM_PCDisplacementIndirectIndexed(ipc, opcodes.r16(pc+2), mod&0x1F, opsize, stream); + out_AM_PCDisplacementIndirectIndexed(ipc, int16_t(opcodes.r16(pc+2)), mod&0x1F, opsize, stream); return 4; case 26: // PC Displacement Indirect Indexed (32 bit) - out_AM_PCDisplacementIndirectIndexed(ipc, opcodes.r32(pc+2), mod&0x1F, opsize, stream); + out_AM_PCDisplacementIndirectIndexed(ipc, int32_t(opcodes.r32(pc+2)), mod&0x1F, opsize, stream); return 6; case 27: // Direct Address Deferred Indexed @@ -287,15 +287,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons } else { switch(mod>>5) { case 0: // Displacement (8 bit) - out_AM_Displacement(mod&0x1F, opcodes.r8(pc+1), opsize, stream); + out_AM_Displacement(mod&0x1F, int8_t(opcodes.r8(pc+1)), opsize, stream); return 2; case 1: // Displacement (16 bit) - out_AM_Displacement(mod&0x1F, opcodes.r16(pc+1), opsize, stream); + out_AM_Displacement(mod&0x1F, int16_t(opcodes.r16(pc+1)), opsize, stream); return 3; case 2: // Displacement (32 bit) - out_AM_Displacement(mod&0x1F, opcodes.r32(pc+1), opsize, stream); + out_AM_Displacement(mod&0x1F, int32_t(opcodes.r32(pc+1)), opsize, stream); return 5; case 3: // Register indirect @@ -303,15 +303,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons return 1; case 4: // Displacement indirect (8 bit) - out_AM_DisplacementIndirect(mod&0x1F, opcodes.r8(pc+1), opsize, stream); + out_AM_DisplacementIndirect(mod&0x1F, int8_t(opcodes.r8(pc+1)), opsize, stream); return 2; case 5: // Displacement indirect (16 bit) - out_AM_DisplacementIndirect(mod&0x1F, opcodes.r16(pc+1), opsize, stream); + out_AM_DisplacementIndirect(mod&0x1F, int16_t(opcodes.r16(pc+1)), opsize, stream); return 3; case 6: // Displacement indirect (32 bit) - out_AM_DisplacementIndirect(mod&0x1F, opcodes.r32(pc+1), opsize, stream); + out_AM_DisplacementIndirect(mod&0x1F, int32_t(opcodes.r32(pc+1)), opsize, stream); return 5; case 7: @@ -336,15 +336,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons return 1; case 16: // PC Displacement (8 bit) - out_AM_PCDisplacement(ipc, opcodes.r8(pc+1), opsize, stream); + out_AM_PCDisplacement(ipc, int8_t(opcodes.r8(pc+1)), opsize, stream); return 2; case 17: // PC Displacement (16 bit) - out_AM_PCDisplacement(ipc, opcodes.r16(pc+1), opsize, stream); + out_AM_PCDisplacement(ipc, int16_t(opcodes.r16(pc+1)), opsize, stream); return 3; case 18: // PC Displacement (32 bit) - out_AM_PCDisplacement(ipc, opcodes.r32(pc+1), opsize, stream); + out_AM_PCDisplacement(ipc, int32_t(opcodes.r32(pc+1)), opsize, stream); return 5; case 19: // Direct Address @@ -372,15 +372,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons } case 24: // PC Displacement Indirect (8 bit) - out_AM_PCDisplacementIndirect(ipc, opcodes.r8(pc+1), opsize, stream); + out_AM_PCDisplacementIndirect(ipc, int8_t(opcodes.r8(pc+1)), opsize, stream); return 2; case 25: // PC Displacement Indirect (16 bit) - out_AM_PCDisplacementIndirect(ipc, opcodes.r16(pc+1), opsize, stream); + out_AM_PCDisplacementIndirect(ipc, int16_t(opcodes.r16(pc+1)), opsize, stream); return 3; case 26: // PC Displacement Indirect (32 bit) - out_AM_PCDisplacementIndirect(ipc, opcodes.r32(pc+1), opsize, stream); + out_AM_PCDisplacementIndirect(ipc, int32_t(opcodes.r32(pc+1)), opsize, stream); return 5; case 27: // Direct Address Deferred @@ -388,15 +388,15 @@ u32 v60_disassembler::decode_AM(unsigned ipc, offs_t pc, int m, int opsize, cons return 5; case 28: // PC Double Displacement (8 bit) - out_AM_PCDoubleDisplacement(ipc, opcodes.r8(pc+1), opcodes.r8(pc+2), opsize, stream); + out_AM_PCDoubleDisplacement(ipc, int8_t(opcodes.r8(pc+1)), int8_t(opcodes.r8(pc+2)), opsize, stream); return 3; case 29: // PC Double Displacement (16 bit) - out_AM_PCDoubleDisplacement(ipc, opcodes.r16(pc+1), opcodes.r16(pc+3), opsize, stream); + out_AM_PCDoubleDisplacement(ipc, int16_t(opcodes.r16(pc+1)), int16_t(opcodes.r16(pc+3)), opsize, stream); return 5; case 30: // PC Double Displacement (32 bit) - out_AM_PCDoubleDisplacement(ipc, opcodes.r32(pc+1), opcodes.r32(pc+5), opsize, stream); + out_AM_PCDoubleDisplacement(ipc, int32_t(opcodes.r32(pc+1)), int32_t(opcodes.r32(pc+5)), opsize, stream); return 9; default: @@ -455,13 +455,13 @@ u32 v60_disassembler::decode_F3(const char *opnm, int opsize1, int opsize2, unsi u32 v60_disassembler::decode_F4a(const char *opnm, int opsize1, int opsize2, unsigned ipc, offs_t pc, const data_buffer &opcodes, std::ostream &stream) { - util::stream_format(stream, "%-8s%X", opnm, ipc + static_cast<int8_t>(opcodes.r8(pc))); + util::stream_format(stream, "%-8s%X", opnm, ipc + int8_t(opcodes.r8(pc))); return 2; } u32 v60_disassembler::decode_F4b(const char *opnm, int opsize1, int opsize2, unsigned ipc, offs_t pc, const data_buffer &opcodes, std::ostream &stream) { - util::stream_format(stream, "%-8s%X", opnm, ipc + static_cast<int16_t>(opcodes.r16(pc))); + util::stream_format(stream, "%-8s%X", opnm, ipc + int16_t(opcodes.r16(pc))); return 3; } @@ -473,7 +473,7 @@ u32 v60_disassembler::decode_F5(const char *opnm, int opsize1, int opsize2, unsi u32 v60_disassembler::decode_F6(const char *opnm, int opsize1, int opsize2, unsigned ipc, offs_t pc, const data_buffer &opcodes, std::ostream &stream) { - util::stream_format(stream, "%-8s%s, %X[PC]", opnm, v60_reg_names[opcodes.r8(pc) & 0x1f], ipc+opcodes.r16(pc+1)); + util::stream_format(stream, "%-8s%s, %X[PC]", opnm, v60_reg_names[opcodes.r8(pc) & 0x1f], ipc + int16_t(opcodes.r16(pc+1))); return 4; } diff --git a/src/devices/cpu/vt50/vt50.cpp b/src/devices/cpu/vt50/vt50.cpp new file mode 100644 index 00000000000..b12b75e79da --- /dev/null +++ b/src/devices/cpu/vt50/vt50.cpp @@ -0,0 +1,831 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC VT50/VT52 microprocessor emulation + + The principal components of this custom TTL-based processor are + inelegantly divided between two PCBs: ROM, UART & Timing (RUT) and + Data Paths, Memory & Decoders. The UART present on the former board + is not included in this CPU emulation, which uses callbacks instead + (as for the keyboard, which is a separate component in the same case). + Opcodes may contain up to four instructions each, which are executed + sequentially during defined phases of the instruction cycle. + + The machine cycle time (each instruction takes two cycles) is also the + time it takes to display one character. RAM addresses are determined + by the contents of the X and Y registers (plus one XOR gate applied to + bit 3 of the X output) for both displayed characters and programmed + data transfers. During non-blanked portions of of horizontal lines, X + (but not Y) is automatically incremented as each character is latched, + with the lowest 3 bits of the accumulator defining the character scan + line. The firmware uses the tail end of RAM as its scratchpad area. + + The accumulator, X and Y registers are mostly implemented as 74193 + up/down counters. There is no proper ALU, only a 7485 magnitude + comparator and an 8242 equality checker whose output is also used to + establish the position of the underline cursor. + + RAM is 7 bits wide, even though the VT50's character generator can + only accept 6 bits. Most of the registers are also effectively 7 bits + wide, though unused eighth bits are physically present. PC is also + physically 12 bits wide, though only up to 10 bits are usable. Y is + only 4 bits wide on the VT50, which has a 12-line display; in order + to double the quantity of addressable RAM to allow for 24 lines, the + VT52 adds an extra flip-flop stage to Y and rejumpers the address + encoding circuit. + + The mode flip-flop changes the meanings of the jump conditions and the + function of the constant load instruction, whose execution in mode 0 + is conditioned on equality with the preincremented accumulator. Jumps, + if taken, load the highest two bits of the destination (which define + the ROM page) from a ripple counter whose value may be incremented by + the IROM instruction. + + The done flip-flop is set any time data is committed to memory. Its + purpose is to ensure that only one in a sequence of consecutive + load instructions in the firmware's keyboard lookup routine is + actually executed. + + While horizontal blanking is defined in hardware as 20 characters out + of every 100, vertical blanking periods are arbitrarily determined by + when the firmware decides to deactivate the video flip-flop, which + necessitates an awkward workaround since MAME's screen emulation + expects a definite value. The vertical and horizontal synchronization + pulses are also generated without regard to each other, which causes + the screen refresh period to be 256 lines in 60 Hz mode and 307.2 + lines in 50 Hz mode. The unorthodox split structure of the timing + chain permits it to double as a baud rate generator. + +***************************************************************************/ + +#include "emu.h" +#include "vt50.h" +#include "vt50dasm.h" +#include "screen.h" + +#define FIND_FIRST_LINE 0 + +// device type definitions +DEFINE_DEVICE_TYPE(VT50_CPU, vt50_cpu_device, "vt50_cpu", "DEC VT50 CPU") +DEFINE_DEVICE_TYPE(VT52_CPU, vt52_cpu_device, "vt52_cpu", "DEC VT52 CPU") + +vt5x_cpu_device::vt5x_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int bbits, int ybits) + : cpu_device(mconfig, type, tag, owner, clock) + , device_video_interface(mconfig, *this) + , m_rom_config("program", ENDIANNESS_LITTLE, 8, 10, 0) + , m_ram_config("data", ENDIANNESS_LITTLE, 8, 6 + ybits, 0) // actually 7 bits wide + , m_rom_cache(nullptr) + , m_ram_cache(nullptr) + , m_baud_9600_callback(*this) + , m_vert_count_callback(*this) + , m_uart_rd_callback(*this) + , m_uart_xd_callback(*this) + , m_ur_flag_callback(*this) + , m_ut_flag_callback(*this) + , m_ruf_callback(*this) + , m_key_up_callback(*this) + , m_kclk_callback(*this) + , m_frq_callback(*this) + , m_bell_callback(*this) + , m_cen_callback(*this) + , m_csf_callback(*this) + , m_ccf_callback(*this) + , m_char_data_callback(*this) + , m_bbits(bbits) + , m_ybits(ybits) + , m_pc(0) + , m_rom_page(0) + , m_mode_ff(false) + , m_done_ff(false) + , m_ac(0) + , m_buffer(0) + , m_x(0) + , m_y(0) + , m_x8(false) + , m_cursor_ff(false) + , m_cursor_active(false) + , m_video_process(false) + , m_ram_do(0) + , m_t(0) + , m_write_ff(false) + , m_flag_test_ff(false) + , m_m2u_ff(false) + , m_bell_ff(false) + , m_load_pc(false) + , m_icount(0) + , m_horiz_count(0) + , m_vert_count(0) + , m_top_of_screen(false) + , m_current_line(0) + , m_first_line(~0) +{ + m_rom_config.m_is_octal = true; + m_ram_config.m_is_octal = true; +} + +vt50_cpu_device::vt50_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vt5x_cpu_device(mconfig, VT50_CPU, tag, owner, clock, 4, 4) +{ +} + +vt52_cpu_device::vt52_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vt5x_cpu_device(mconfig, VT52_CPU, tag, owner, clock, 7, 5) + , m_graphic_callback(*this) +{ +} + +std::unique_ptr<util::disasm_interface> vt50_cpu_device::create_disassembler() +{ + return std::make_unique<vt50_disassembler>(); +} + +std::unique_ptr<util::disasm_interface> vt52_cpu_device::create_disassembler() +{ + return std::make_unique<vt52_disassembler>(); +} + +device_memory_interface::space_config_vector vt5x_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_rom_config), + std::make_pair(AS_DATA, &m_ram_config) + }; +} + +void vt5x_cpu_device::device_config_complete() +{ + if (!has_screen()) + return; + + if (!screen().has_screen_update()) + screen().set_screen_update(*this, FUNC(vt5x_cpu_device::screen_update)); + + if (!screen().refresh_attoseconds()) + screen().set_raw(clock(), 900, 128, 848, 256, 4, 244); // 60 Hz default parameters +} + +void vt5x_cpu_device::device_resolve_objects() +{ + // resolve callbacks + m_baud_9600_callback.resolve_safe(); + m_vert_count_callback.resolve_safe(); + m_uart_rd_callback.resolve_safe(0); + m_uart_xd_callback.resolve_safe(); + m_ur_flag_callback.resolve_safe(0); + m_ut_flag_callback.resolve_safe(0); + m_ruf_callback.resolve_safe(); + m_key_up_callback.resolve_safe(1); + m_kclk_callback.resolve_safe(1); + m_frq_callback.resolve_safe(1); + m_bell_callback.resolve_safe(); + m_cen_callback.resolve_safe(); + m_csf_callback.resolve_safe(1); + m_ccf_callback.resolve_safe(1); + m_char_data_callback.resolve_safe(0177); +} + +void vt52_cpu_device::device_resolve_objects() +{ + vt5x_cpu_device::device_resolve_objects(); + + m_graphic_callback.resolve_safe(); +} + +void vt5x_cpu_device::device_start() +{ + // acquire address spaces + m_rom_cache = space(AS_PROGRAM).cache<0, 0, ENDIANNESS_LITTLE>(); + m_ram_cache = space(AS_DATA).cache<0, 0, ENDIANNESS_LITTLE>(); + + screen().register_screen_bitmap(m_bitmap); + set_icountptr(m_icount); + + state_add(VT5X_PC, "PC", m_pc).formatstr("%04O").mask(01777); + state_add(STATE_GENPC, "GENPC", m_pc).mask(01777).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_pc).mask(01777).noshow(); + state_add<u8>(STATE_GENFLAGS, "CURFLAGS", [this]() { + return (m_mode_ff ? 1 : 0) | (m_done_ff ? 2 : 0); + }).formatstr("%7s").noshow(); + state_add(VT5X_PAGE, "PAGE", m_rom_page).mask(3); + state_add(VT5X_MODE, "MODE", m_mode_ff).noshow(); + state_add(VT5X_DONE, "DONE", m_done_ff).noshow(); + state_add(VT5X_AC, "AC", m_ac).formatstr("%03O").mask(0177); + state_add(VT5X_B, "B", m_buffer).formatstr(m_bbits > 6 ? "%03O" : "%02O").mask((1 << m_bbits) - 1); + state_add(VT5X_X, "X", m_x).formatstr("%03O").mask(0177); + state_add(VT5X_Y, "Y", m_y).formatstr("%02O").mask((1 << m_ybits) - 1); + state_add(VT5X_X8, "X8", m_x8); + state_add<u16>(VT5X_XYAD, "XYAD", [this]() { return translate_xy(); }).formatstr("%04O").mask((1 << (6 + m_ybits)) - 1); + state_add(VT5X_CFF, "CFF", m_cursor_ff); + state_add(VT5X_VID, "VID", m_video_process); + + // save state + save_item(NAME(m_pc)); + save_item(NAME(m_rom_page)); + save_item(NAME(m_mode_ff)); + save_item(NAME(m_done_ff)); + save_item(NAME(m_ac)); + save_item(NAME(m_buffer)); + save_item(NAME(m_x)); + save_item(NAME(m_y)); + save_item(NAME(m_x8)); + save_item(NAME(m_cursor_ff)); + save_item(NAME(m_cursor_active)); + save_item(NAME(m_video_process)); + save_item(NAME(m_ram_do)); + save_item(NAME(m_t)); + save_item(NAME(m_write_ff)); + save_item(NAME(m_flag_test_ff)); + save_item(NAME(m_m2u_ff)); + save_item(NAME(m_bell_ff)); + save_item(NAME(m_load_pc)); + save_item(NAME(m_horiz_count)); + save_item(NAME(m_vert_count)); + save_item(NAME(m_top_of_screen)); + save_item(NAME(m_current_line)); +#if FIND_FIRST_LINE + save_item(NAME(m_first_line)); +#else + (void)m_first_line; +#endif +} + +void vt5x_cpu_device::device_reset() +{ + m_pc = 0; + m_rom_page = 0; + m_video_process = false; + + // CPU is initialized in weird state that does not allow first instruction to fully execute + m_t = 7; + m_flag_test_ff = false; + m_load_pc = false; + + m_horiz_count = 0; + m_vert_count = 0; + m_top_of_screen = true; + m_current_line = 0; + + m_baud_9600_callback(0); + m_vert_count_callback(0); +} + +u32 vt5x_cpu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); + return 0; +} + +void vt5x_cpu_device::draw_char_line() +{ + if (m_current_line < screen().visible_area().top() || m_current_line > screen().visible_area().bottom()) + return; + + u8 hc = (u8(m_horiz_count) >> 4) * 10 + (m_horiz_count & 15); + unsigned xc = ((hc >= 22 ? hc : hc + 100) - 22) * 9 + screen().visible_area().left(); + if (xc > screen().visible_area().right() - 8) + return; + + u32 *pix = &m_bitmap.pix32(m_current_line, xc); + if (m_video_process && m_cursor_ff && m_cursor_active) + std::fill_n(pix, 9, rgb_t::white()); + else if (!m_video_process || m_cursor_ff) + std::fill_n(pix, 9, rgb_t::black()); + else + { + // CD6 is first shifted out; CD0 is last out + u8 vsr = m_char_data_callback(u16(m_ram_do) << 3 | (m_ac & 7)) | 0200; + for (int i = 0; i < 9; i++) + { + *pix++ = BIT(vsr, 7) ? rgb_t::black() : rgb_t::white(); + vsr = (vsr << 1) | 1; + } + } +} + +offs_t vt5x_cpu_device::translate_xy() const +{ + // A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 + // Screen RAM, columns 0–63: y3 y2 y1 y0 x5 x4 x3 x2 x1 x0 + // Screen RAM, columns 64–79: 1 1 y1 y0 y3 y2 x3 x2 x1 x0 + // Scratchpad (not displayed): 1 1 y1 y0 1 1 x3 x2 x1 x0 + const u8 x = m_x ^ (m_x8 ? 8 : 0); + const offs_t y_shifted = (offs_t(m_y) << (10 - m_ybits)) & 01700; + const offs_t page_sel = offs_t(m_y & ((1 << (m_ybits - 4)) - 1)) << 10; + if (BIT(x, 6) || (y_shifted & 01400) == 01400) + return (x & 0017) | (y_shifted & 01400) >> 4 | y_shifted | 01400 | page_sel; + else + return x | y_shifted | page_sel; +} + +void vt5x_cpu_device::execute_te(u8 inst) +{ + if (BIT(inst, 3) && !BIT(inst, 7)) + { + switch (inst & 0160) + { + case 0000: + // ZXZY + m_x = 0; + m_y = 0; + m_x8 = false; + break; + + case 0020: + // X8 + m_x8 = !m_x8; + break; + + case 0040: + // IXDY + m_x = (m_x + 1) & 0177; + m_y = (m_y - 1) & ((1 << m_ybits) - 1); + break; + + case 0060: + // IX + m_x = (m_x + 1) & 0177; + break; + + case 0100: + // ZA + m_ac = 0; + break; + + case 0120: + // M1 + m_mode_ff = true; + break; + + case 0140: + // ZX + m_x = 0; + m_x8 = false; + break; + + case 0160: + // M0 + m_mode_ff = false; + break; + } + } + + if (m_m2u_ff) + { + m_uart_xd_callback(m_ram_do); + m_m2u_ff = false; + } + + m_flag_test_ff = false; + m_load_pc = false; + if (!BIT(inst, 7)) + m_done_ff = false; + else if (!m_mode_ff) + m_ac = (m_ac + 1) & 0177; +} + +void vt5x_cpu_device::execute_tf(u8 inst) +{ + if (BIT(inst, 2) && !BIT(inst, 7)) + { + switch (inst & 0160) + { + case 0000: + // DXDY + m_x = (m_x - 1) & 0177; + m_y = (m_y - 1) & ((1 << m_ybits) - 1); + break; + + case 0020: + case 0040: + // IA or IA1 + m_ac = (m_ac + 1) & 0177; + break; + + case 0060: + // IY + m_y = (m_y + 1) & ((1 << m_ybits) - 1); + break; + + case 0100: + // DY + m_y = (m_y - 1) & ((1 << m_ybits) - 1); + break; + + case 0120: + // IROM + m_rom_page = (m_rom_page + 1) & 3; + break; + + case 0140: + // DX + m_x = (m_x - 1) & 0177; + break; + + case 0160: + // DA + m_ac = (m_ac - 1) & 0177; + break; + } + } + + // RUF is transparently latched from U2M decode + m_ruf_callback((inst & 0362) == 0122 ? 0 : 1); +} + +void vt5x_cpu_device::execute_tw(u8 inst) +{ + if ((inst & 0217) == 0) + { + switch (inst & 0160) + { + case 0000: + // SCFF + m_cursor_ff = true; + break; + + case 0020: + // SVID + m_video_process = true; + break; + + case 0040: + // B2Y + m_y = m_buffer & ((1 << m_ybits) - 1); + break; + + case 0060: + // CBFF + m_bell_ff = !m_bell_ff; + m_bell_callback(m_bell_ff); + break; + + case 0100: + // ZCAV + m_cursor_ff = false; + m_video_process = false; + break; + + case 0120: + // LPB (TODO: load print shift register) + break; + + case 0140: + // EPR + m_cen_callback(1); + break; + + case 0160: + // HPR!ZY + m_cen_callback(0); + m_y = 0; + break; + } + } + + if (BIT(inst, 0) && !BIT(inst, 7)) + m_flag_test_ff = true; + + // set FF for instructions that write to RAM + if (BIT(inst, 7)) + m_write_ff = (m_mode_ff || m_ac >= m_ram_do) && !m_done_ff; + else + m_write_ff = (inst & 0162) == 0022 || (inst & 0162) == 0062 || (inst & 0162) == 0122; + + // DONE is set by any RAM write, not just LD + if (m_write_ff) + m_done_ff = true; +} + +void vt52_cpu_device::execute_tw(u8 inst) +{ + vt5x_cpu_device::execute_tw(inst); + + // ZCAV also borrows from the upper half of AC on the VT52 + if (inst == 0100) + m_ac = (m_ac - 020) & 0177; +} + +void vt50_cpu_device::execute_tg(u8 inst) +{ + switch (inst & 0362) + { + case 0022: + // A2M + m_ram_do = m_ac; + break; + + case 0062: + // L40M (http://catb.org/jargon/html/O/octal-forty.html) + m_ram_do = 040; + break; + + case 0122: + // U2M + m_ram_do = m_uart_rd_callback() & 0177; + break; + + default: + // LD (TODO: B/C masking in mode 0 is determined by optional jumpers) + m_ram_do = inst & (!m_mode_ff && m_cursor_ff ? 0037 : 0177); + break; + } + + m_ram_cache->write_byte(translate_xy(), m_ram_do); + m_write_ff = false; +} + +void vt52_cpu_device::execute_tg(u8 inst) +{ + switch (inst & 0362) + { + case 0022: + // A2M + m_ram_do = m_ac; + break; + + case 0062: + // B2M + m_ram_do = m_buffer; + break; + + case 0122: + // U2M + m_ram_do = m_uart_rd_callback() & 0177; + break; + + default: + // LD (TODO: B/C masking in mode 0 is determined by optional jumpers) + m_ram_do = inst & (!m_mode_ff && m_cursor_ff ? 0037 : 0177); + break; + } + + m_ram_cache->write_byte(translate_xy(), m_ram_do); + m_write_ff = false; +} + +void vt5x_cpu_device::execute_th(u8 inst) +{ + switch (inst & 0362) + { + case 0002: + // M2A + m_ac = m_ram_do; + break; + + case 0042: + // M2U + m_m2u_ff = true; + break; + + case 0102: + // M2X + m_x = m_ram_do; + break; + + case 0142: + // M2B + m_buffer = m_ram_do & ((1 << m_bbits) - 1); + break; + } + + if (m_flag_test_ff) + { + switch (inst & 0160) + { + case 0000: + // M0: PSCJ + // M1: URJ + if (m_mode_ff) + m_load_pc = m_ur_flag_callback(); + else + m_load_pc = m_csf_callback(); + break; + + case 0020: + // M0: TABJ (jump on 74H10 NAND of AC0–2; documentation incorrectly suggests the opposite) + // M1: AEMJ + if (m_mode_ff) + m_load_pc = m_ac == m_ram_do; + else + m_load_pc = (m_ac & 7) != 7; + break; + + case 0040: + // M0: KCLJ + // M1: ALMJ + if (m_mode_ff) + m_load_pc = m_ac < m_ram_do; + else + m_load_pc = m_kclk_callback(); + break; + + case 0060: + // M0: FRQJ + // M1: ADXJ + if (m_mode_ff) + m_load_pc = m_ac != (m_x ^ (m_x8 ? 8 : 0)); + else + m_load_pc = m_frq_callback(); + break; + + case 0100: + // M0: PRQJ + // M1: AEM2J + if (m_mode_ff) + m_load_pc = m_ac == m_ram_do; + else + m_load_pc = m_ccf_callback(); + break; + + case 0120: + // M0: COPJ (TODO?) + // M1: TRUJ + m_load_pc = true; + break; + + case 0140: + // M0: UTJ + // M1: VSCJ + if (m_mode_ff) + m_load_pc = m_horiz_count >= 8; + else + m_load_pc = !m_ut_flag_callback(); + break; + + case 0160: + // M0: TOSJ + // M1: KEYJ + if (m_mode_ff) + m_load_pc = m_key_up_callback(m_ac) & 1; + else + m_load_pc = !m_top_of_screen; + break; + } + } + + if ((m_pc & 0377) == 0377) + m_rom_page = (m_rom_page + 1) & 3; + m_pc = (m_pc + 1) & 03777; +} + +void vt52_cpu_device::execute_th(u8 inst) +{ + // not actually synchronized to TH (but may be gated externally with EN CYCLE) + if ((inst & 0362) == 0162) + m_graphic_callback(m_ram_do); + + vt5x_cpu_device::execute_th(inst); +} + +void vt5x_cpu_device::execute_tj(u8 dest) +{ + if (m_load_pc) + m_pc = u16(m_rom_page) << 8 | dest; + else + { + // Hardware bug: the ROM page counter will not increment on the second byte of a jump not taken. + m_pc = (m_pc + 1) & 03777; + } +} + +void vt5x_cpu_device::clock_video_counters() +{ + if ((m_horiz_count & 9) == 9) + { + m_horiz_count = (m_horiz_count & (15 * 16)) + 16; + if (m_vert_count == 07777) + { + m_vert_count = m_frq_callback() ? 03000 : 02000; + m_horiz_count = 0; + m_top_of_screen = true; + m_vert_count_callback(0); + } + else + { + m_vert_count++; + if (m_horiz_count == 10 * 16) + m_horiz_count = 0; + m_vert_count_callback(m_vert_count & 0177); + } + } + else + { + m_horiz_count++; + if (m_horiz_count == 8) + { + if (m_top_of_screen) + { + m_top_of_screen = false; + + // This calculates the number of visible lines, which is actually firmware-defined. + bool is_60hz = BIT(m_vert_count, 9); + unsigned first_line = is_60hz ? 4 : 32; + screen().configure( + 900, + (010000 - m_vert_count) / 10, + rectangle(128, 847, first_line, 24 * (is_60hz ? 10 : 11) + first_line - 1), + clocks_to_attotime((010000 - m_vert_count) * 90).as_attoseconds() + ); + screen().reset_origin(); + m_current_line = 0; +#if FIND_FIRST_LINE + m_first_line = ~0; +#endif + } + else + m_current_line++; + m_baud_9600_callback(0); + } + else if (m_horiz_count == 4) + m_baud_9600_callback(1); + } +} + +void vt5x_cpu_device::execute_run() +{ + while (m_icount > 0) + { + bool en_cycle = BIT(m_horiz_count, 0); + switch (m_t) + { + case 0: + if (!en_cycle) + debugger_instruction_hook(m_pc); + m_t = 1; + break; + + case 1: + if (!en_cycle) + execute_te(m_rom_cache->read_byte(m_pc)); + m_t = 2; + break; + + case 2: + if (!en_cycle) + execute_tf(m_rom_cache->read_byte(m_pc)); + if (!m_write_ff) + m_ram_do = m_ram_cache->read_byte(translate_xy()) & 0177; + m_cursor_active = m_ac == (m_x ^ (m_x8 ? 8 : 0)); + if (u8(m_horiz_count - 2) >= 2 * 16) + { + if (m_video_process) + { +#if FIND_FIRST_LINE + if (m_first_line > m_current_line) + m_first_line = m_current_line; +#endif + m_x = (m_x + 1) & 0177; + } + draw_char_line(); + } + m_t = 3; + break; + + case 3: + if (en_cycle && m_write_ff) + execute_tg(m_rom_cache->read_byte(m_pc)); + m_t = 4; + break; + + case 4: + if (en_cycle) + execute_th(m_rom_cache->read_byte(m_pc)); + m_t = 5; + break; + + case 5: + m_t = 6; + break; + + case 6: + if (en_cycle && m_flag_test_ff) + execute_tj(m_rom_cache->read_byte(m_pc)); + m_t = 7; + break; + + case 7: + if (!en_cycle) + execute_tw(m_rom_cache->read_byte(m_pc)); + m_t = 8; + break; + + case 8: + m_t = 0; + clock_video_counters(); + break; + } + + m_icount--; + } +} + +void vt5x_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = string_format("M%d %4s", m_mode_ff ? 1 : 0, m_done_ff ? "DONE" : ""); + break; + } +} diff --git a/src/devices/cpu/vt50/vt50.h b/src/devices/cpu/vt50/vt50.h new file mode 100644 index 00000000000..fd73d1fd83e --- /dev/null +++ b/src/devices/cpu/vt50/vt50.h @@ -0,0 +1,174 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_VT50_VT50_H +#define MAME_CPU_VT50_VT50_H + +#pragma once + +class vt5x_cpu_device : public cpu_device, public device_video_interface +{ +public: + enum { + VT5X_PC, VT5X_PAGE, + VT5X_MODE, VT5X_DONE, + VT5X_AC, VT5X_B, VT5X_X, VT5X_Y, VT5X_X8, VT5X_XYAD, + VT5X_CFF, VT5X_VID + }; + + // callback configuration + auto baud_9600_callback() { return m_baud_9600_callback.bind(); } + auto vert_count_callback() { return m_vert_count_callback.bind(); } + auto uart_rd_callback() { return m_uart_rd_callback.bind(); } + auto uart_xd_callback() { return m_uart_xd_callback.bind(); } + auto ur_flag_callback() { return m_ur_flag_callback.bind(); } + auto ut_flag_callback() { return m_ut_flag_callback.bind(); } + auto ruf_callback() { return m_ruf_callback.bind(); } + auto key_up_callback() { return m_key_up_callback.bind(); } + auto kclk_callback() { return m_kclk_callback.bind(); } + auto frq_callback() { return m_frq_callback.bind(); } + auto bell_callback() { return m_bell_callback.bind(); } + auto cen_callback() { return m_cen_callback.bind(); } + auto ccf_callback() { return m_ccf_callback.bind(); } + auto csf_callback() { return m_csf_callback.bind(); } + auto char_data_callback() { return m_char_data_callback.bind(); } + + // screen update method + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + +protected: + // construction/destruction + vt5x_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int bbits, int ybits); + + // device-level overrides + virtual void device_config_complete() override; + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual void execute_run() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // device_state_interface overrides + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + + // video helpers + void draw_char_line(); + + // address translation + offs_t translate_xy() const; + + // execution helpers + void execute_te(u8 inst); + void execute_tf(u8 inst); + virtual void execute_tw(u8 inst); + virtual void execute_tg(u8 inst) = 0; + virtual void execute_th(u8 inst); + void execute_tj(u8 dest); + void clock_video_counters(); + + // address spaces + address_space_config m_rom_config; + address_space_config m_ram_config; + memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_rom_cache; + memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_ram_cache; + + // device callbacks + devcb_write_line m_baud_9600_callback; + devcb_write8 m_vert_count_callback; + devcb_read8 m_uart_rd_callback; + devcb_write8 m_uart_xd_callback; + devcb_read_line m_ur_flag_callback; + devcb_read_line m_ut_flag_callback; + devcb_write_line m_ruf_callback; + devcb_read8 m_key_up_callback; + devcb_read_line m_kclk_callback; + devcb_read_line m_frq_callback; + devcb_write_line m_bell_callback; + devcb_write_line m_cen_callback; + devcb_read_line m_csf_callback; + devcb_read_line m_ccf_callback; + devcb_read8 m_char_data_callback; + + // register dimensions + const u8 m_bbits; + const u8 m_ybits; + + // internal state + u16 m_pc; + u8 m_rom_page; + bool m_mode_ff; + bool m_done_ff; + u8 m_ac; + u8 m_buffer; + u8 m_x; + u8 m_y; + bool m_x8; + bool m_cursor_ff; + bool m_cursor_active; + bool m_video_process; + u8 m_ram_do; + + // execution phases + u8 m_t; + bool m_write_ff; + bool m_flag_test_ff; + bool m_m2u_ff; + bool m_bell_ff; + bool m_load_pc; + s32 m_icount; + + // video timing + u8 m_horiz_count; + u16 m_vert_count; + bool m_top_of_screen; + u16 m_current_line; + u16 m_first_line; + + // display bitmap + bitmap_rgb32 m_bitmap; +}; + +class vt50_cpu_device : public vt5x_cpu_device +{ +public: + // device type constructor + vt50_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + virtual void execute_tg(u8 inst) override; +}; + +class vt52_cpu_device : public vt5x_cpu_device +{ +public: + // device type constructor + vt52_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + auto graphic_callback() { return m_graphic_callback.bind(); } + +protected: + // device-level overrides + virtual void device_resolve_objects() override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + virtual void execute_tw(u8 inst) override; + virtual void execute_tg(u8 inst) override; + virtual void execute_th(u8 inst) override; + +private: + devcb_write8 m_graphic_callback; +}; + +DECLARE_DEVICE_TYPE(VT50_CPU, vt50_cpu_device) +DECLARE_DEVICE_TYPE(VT52_CPU, vt52_cpu_device) + +#endif // MAME_CPU_VT50_VT50_H diff --git a/src/devices/cpu/vt50/vt50dasm.cpp b/src/devices/cpu/vt50/vt50dasm.cpp new file mode 100644 index 00000000000..5f97d1eb1a9 --- /dev/null +++ b/src/devices/cpu/vt50/vt50dasm.cpp @@ -0,0 +1,129 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC VT50/VT52 microcode disassembler + +***************************************************************************/ + +#include "emu.h" +#include "vt50dasm.h" + +vt5x_disassembler::vt5x_disassembler(const char *const opcodes_e[8], const char *const opcodes_f[8], const char *const opcodes_g[8], const char *const jumps_h[2][8], const char *const opcodes_w[8]) + : util::disasm_interface() + , m_opcodes_e(opcodes_e) + , m_opcodes_f(opcodes_f) + , m_opcodes_g(opcodes_g) + , m_jumps_h(jumps_h) + , m_opcodes_w(opcodes_w) +{ +} + +vt50_disassembler::vt50_disassembler() + : vt5x_disassembler(s_opcodes_e, s_opcodes_f, s_opcodes_g, s_jumps_h, s_opcodes_w) +{ +} + +vt52_disassembler::vt52_disassembler() + : vt5x_disassembler(s_opcodes_e, s_opcodes_f, s_opcodes_g, s_jumps_h, s_opcodes_w) +{ +} + +const char *const vt5x_disassembler::s_opcodes_e[8] = { + "ZXZY", "X8", "IXDY", "IX", "ZA", "M1", "ZX", "M0" +}; + +const char *const vt5x_disassembler::s_opcodes_f[8] = { + "DXDY", "IA", "IA1", "IY", "DY", "IROM", "DX", "DA" // IA is functionally duplicated +}; + +const char *const vt50_disassembler::s_opcodes_g[8] = { + "M2A", "A2M", "M2U", "B2M", "L40M", "U2M", "M2B", "SPARE" +}; + +const char *const vt52_disassembler::s_opcodes_g[8] = { + "M2A", "A2M", "M2U", "B2M", "M2X", "U2M", "M2B", "GRPH" +}; + +const char *const vt50_disassembler::s_jumps_h[2][8] = { + { "PSC", "TAB", "KCL", "FRQ", "PRQ", "TRU", "UT", "TOS" }, // mode 0 + { "UR", "AEM", "ALM", "ADX", "AEM2", nullptr, "VSC", "KEY" } // mode 1 +}; + +const char *const vt52_disassembler::s_jumps_h[2][8] = { + { "PSC", "TAB", "KCL", "FRQ", "PRQ", "COP", "UT", "TOS" }, // mode 0 + { "UR", "AEM", "ALM", "ADX", "AEM2", "TRU", "VSC", "KEY" } // mode 1 +}; + +const char *const vt5x_disassembler::s_opcodes_w[8] = { + "SCFF", "SVID", "B2Y", "CBFF", "ZCAV", "LPB", "EPR", "HPR!ZY" +}; + +u32 vt5x_disassembler::opcode_alignment() const +{ + return 1; +} + +offs_t vt5x_disassembler::disassemble(std::ostream &stream, offs_t pc, const vt5x_disassembler::data_buffer &opcodes, const vt5x_disassembler::data_buffer ¶ms) +{ + u8 opcode = opcodes.r8(pc); + + if (BIT(opcode, 7)) + { + util::stream_format(stream, "LD %03o", opcode & 0177); // execution varies by mode + return 1; + } + else if ((opcode & 0017) == 0) + { + stream << m_opcodes_w[(opcode & 0160) >> 4]; + return 1; + } + else + { + bool first = true; + if (BIT(opcode, 3)) + { + first = false; + stream << m_opcodes_e[(opcode & 0160) >> 4]; + } + if (BIT(opcode, 2)) + { + if (!first) + stream << "!"; + first = false; + stream << m_opcodes_f[(opcode & 0160) >> 4]; + } + if (BIT(opcode, 1)) + { + if (!first) + stream << "!"; + first = false; + stream << m_opcodes_g[(opcode & 0160) >> 4]; + } + if (BIT(opcode, 0)) + { + if (!first) + stream << "!"; + bool m0 = (opcode & 0170) != 0130; + bool m1 = (opcode & 0170) != 0170; + if (m_jumps_h[1][(opcode & 0160) >> 4] == nullptr) + m0 = std::exchange(m1, false); + if (m0) + { + util::stream_format(stream, "%sJ", m_jumps_h[0][(opcode & 0160) >> 4]); + if (m1) + stream << "/"; + } + if (m1) + util::stream_format(stream, "%sJ", m_jumps_h[1][(opcode & 0160) >> 4]); + + u16 nextpc = pc + 1; + if ((opcode & 0164) == 0124) // IROM adjustment + nextpc += 0400; + util::stream_format(stream, " %04o", (nextpc & 01400) | opcodes.r8(pc + 1)); + return 2; + } + else + return 1; + } +} diff --git a/src/devices/cpu/vt50/vt50dasm.h b/src/devices/cpu/vt50/vt50dasm.h new file mode 100644 index 00000000000..163598c133c --- /dev/null +++ b/src/devices/cpu/vt50/vt50dasm.h @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_VT50_VT50DASM_H +#define MAME_CPU_VT50_VT50DASM_H + +#pragma once + +class vt5x_disassembler : public util::disasm_interface +{ +protected: + vt5x_disassembler(const char *const opcodes_e[8], const char *const opcodes_f[8], const char *const opcodes_g[8], const char *const jumps_h[2][8], const char *const opcodes_w[8]); + + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + + // tables + static const char *const s_opcodes_e[8]; + static const char *const s_opcodes_f[8]; + static const char *const s_opcodes_w[8]; + +private: + const char *const *m_opcodes_e; + const char *const *m_opcodes_f; + const char *const *m_opcodes_g; + const char *const (*m_jumps_h)[8]; + const char *const *m_opcodes_w; +}; + +class vt50_disassembler : public vt5x_disassembler +{ +public: + // construction/destruction + vt50_disassembler(); + +private: + // tables + static const char *const s_opcodes_g[8]; + static const char *const s_jumps_h[2][8]; +}; + +class vt52_disassembler : public vt5x_disassembler +{ +public: + // construction/destruction + vt52_disassembler(); + +private: + // tables + static const char *const s_opcodes_g[8]; + static const char *const s_jumps_h[2][8]; +}; + +#endif // MAME_CPU_VT50_VT50DASM_H diff --git a/src/devices/cpu/vt61/vt61.cpp b/src/devices/cpu/vt61/vt61.cpp new file mode 100644 index 00000000000..96fba64faf5 --- /dev/null +++ b/src/devices/cpu/vt61/vt61.cpp @@ -0,0 +1,120 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC VT61 CPU + + Currently this device is just a stub with no actual execution core. + +***************************************************************************/ + +#include "emu.h" +#include "vt61.h" +#include "vt61dasm.h" + +// device type definition +DEFINE_DEVICE_TYPE(VT61_CPU, vt61_cpu_device, "vt61_cpu", "DEC VT61 CPU") + +vt61_cpu_device::vt61_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig, VT61_CPU, tag, owner, clock) + , m_program_config("microprogram", ENDIANNESS_LITTLE, 16, 10, -1) + , m_memory_config("memory", ENDIANNESS_LITTLE, 8, 16, 0) + , m_idr_config("IDR", ENDIANNESS_LITTLE, 8, 6, 0) + , m_program_cache(nullptr) + , m_memory_cache(nullptr) + , m_idr_cache(nullptr) + , m_pc(0) + , m_ac(0) + , m_mar(0) + , m_mdr(0) + , m_ir(0) + , m_sp{0} + , m_icount(0) + , m_misc_flags(0) + , m_modem_flags(0) + , m_intrpt_control(0) +{ + m_program_config.m_is_octal = true; + m_memory_config.m_is_octal = true; + m_idr_config.m_is_octal = true; +} + +std::unique_ptr<util::disasm_interface> vt61_cpu_device::create_disassembler() +{ + return std::make_unique<vt61_disassembler>(); +} + +device_memory_interface::space_config_vector vt61_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_DATA, &m_memory_config), + std::make_pair(AS_IDR, &m_idr_config) + }; +} + +void vt61_cpu_device::device_start() +{ + m_program_cache = space(AS_PROGRAM).cache<1, -1, ENDIANNESS_LITTLE>(); + m_memory_cache = space(AS_DATA).cache<0, 0, ENDIANNESS_LITTLE>(); + m_idr_cache = space(AS_IDR).cache<0, 0, ENDIANNESS_LITTLE>(); + + set_icountptr(m_icount); + + state_add(VT61_PC, "PC", m_pc).mask(01777).formatstr("%5s"); + state_add(STATE_GENPC, "GENPC", m_pc).mask(01777).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_pc).mask(01777).noshow(); + state_add(VT61_AC, "AC", m_ac).formatstr("%03O"); + state_add(VT61_MAR, "MAR", m_mar).formatstr("%06O"); + state_add<u8>(VT61_MALO, "MALO", + [this]() { return m_mar & 000377; }, + [this](u8 data) { m_mar = (m_mar & 0177400) | data; } + ).noshow(); + state_add<u8>(VT61_MAHI, "MAHI", + [this]() { return (m_mar & 0177400) >> 8; }, + [this](u8 data) { m_mar = (m_mar & 000377) | (data << 8); } + ).noshow(); + state_add(VT61_MDR, "MDR", m_mdr).formatstr("%03O"); + state_add(VT61_IR, "IR", m_ir).mask(6); + for (int i = 0; i < 16; i++) + state_add(VT61_R0 + i, string_format("R%d", i).c_str(), m_sp[i]).formatstr("%03O"); + state_add(VT61_MISC, "MISC", m_misc_flags).formatstr("%03O"); + state_add(VT61_MOD, "MOD", m_modem_flags).formatstr("%02O").mask(017); + state_add(VT61_INTRC, "INTRC", m_intrpt_control).formatstr("%02O").mask(017); + + save_item(NAME(m_pc)); + save_item(NAME(m_ac)); + save_item(NAME(m_mar)); + save_item(NAME(m_mdr)); + save_item(NAME(m_ir)); + save_item(NAME(m_sp)); + save_item(NAME(m_misc_flags)); + save_item(NAME(m_modem_flags)); + save_item(NAME(m_intrpt_control)); +} + +void vt61_cpu_device::device_reset() +{ + m_pc = 0; + + m_misc_flags = 0; + m_modem_flags = 0; + m_intrpt_control = 0; +} + +void vt61_cpu_device::execute_run() +{ + debugger_instruction_hook(m_pc); + + m_icount = 0; +} + +void vt61_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case VT61_PC: + str = string_format("%o:%03o", m_pc >> 8, m_pc & 0377); + break; + } +} diff --git a/src/devices/cpu/vt61/vt61.h b/src/devices/cpu/vt61/vt61.h new file mode 100644 index 00000000000..c5c3013641f --- /dev/null +++ b/src/devices/cpu/vt61/vt61.h @@ -0,0 +1,75 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_VT61_VT61_H +#define MAME_CPU_VT61_VT61_H + +#pragma once + +class vt61_cpu_device : public cpu_device +{ +public: + enum { + VT61_PC, + VT61_AC, + VT61_MAR, VT61_MALO, VT61_MAHI, + VT61_MDR, + VT61_IR, + VT61_R0, VT61_R1, VT61_R2, VT61_R3, + VT61_R4, VT61_R5, VT61_R6, VT61_R7, + VT61_R8, VT61_R9, VT61_R10, VT61_R11, + VT61_R12, VT61_R13, VT61_R14, VT61_R15, + VT61_MISC, VT61_MOD, VT61_INTRC + }; + + enum { + AS_IDR = 2 + }; + + // construction/destruction + vt61_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual void execute_run() override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // device_state_interface overrides + void state_string_export(const device_state_entry &entry, std::string &str) const override; + +private: + // address spaces + address_space_config m_program_config; + address_space_config m_memory_config; + address_space_config m_idr_config; + memory_access_cache<1, -1, ENDIANNESS_LITTLE> *m_program_cache; + memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_memory_cache; + memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_idr_cache; + + // processor state + u16 m_pc; + u8 m_ac; + u16 m_mar; + u8 m_mdr; + u8 m_ir; + u8 m_sp[16]; // scratchpad memory + s32 m_icount; + + // I/O registers + u8 m_misc_flags; + u8 m_modem_flags; + u8 m_intrpt_control; +}; + +DECLARE_DEVICE_TYPE(VT61_CPU, vt61_cpu_device) + +#endif // MAME_CPU_VT61_VT61_H diff --git a/src/devices/cpu/vt61/vt61dasm.cpp b/src/devices/cpu/vt61/vt61dasm.cpp new file mode 100644 index 00000000000..1471cf0a918 --- /dev/null +++ b/src/devices/cpu/vt61/vt61dasm.cpp @@ -0,0 +1,275 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC VT61 microcode disassembler + + No microprogram source listing appears to have been published by DEC, + nor any instruction reference other than the decode signal references + in the schematics. The instruction format should not be regarded as + official, though it draws on some of DEC's PDP assembly languages. + +***************************************************************************/ + +#include "emu.h" +#include "vt61dasm.h" + +vt61_disassembler::vt61_disassembler() + : util::disasm_interface() +{ +} + +const char *const vt61_disassembler::s_opr_a[8] = { + "NOP", // NO OP A + "IAC", // INC AC + "LIR", // LD IR + "IMA", // INC MA + "SMD", // SHIFT MDR + "JMP0", // CLR PC + "CMPC8", // COMP PC 8 + "LDR" // LD RAM +}; + +const char *const vt61_disassembler::s_opr_b[16] = { + "OPR", // NO OP B + "SPARE", + "RC", // RESET C FLAG + "SPARE", + "SPARE", + "LMISC", // LD MISC FLAG + "LLED", // LD LED FLAG + "LMOD", // LD MODEM FLAG + "SKCLK", // SET KEYCLICK + "LINTRC", // LD INTRPT CONTROL + "SPARE", + "CNBR", // CLR NBR + "LSYNC", // LD SYNC + CLR NBX + "PLD", // PLD + "CVSR", // CLR VID SERV REQ + "ENVID" // ENABLE VID LOAD +}; + +const char *const vt61_disassembler::s_sources[12] = { + "AC", // SEL AC + "STAT1", // SEL STATUS 1 + "SW", // SEL SWITCHES + "CAS1", // SEL CAS 1 + "CAS2", // SEL CAS 2 + "RAM", // SEL RAM + "IDR", // SEL IDR + "UART", // SEL UART + "SPARE", + "TBSW", // TEST BOX SWITCH + "invalid", // SEL SPM LO + "invalid" // SEL SPM HI +}; + +const char *const vt61_disassembler::s_conditions[32][2] = { + { "NINTR1", "INTR1" }, // INTR 1 L + { "NBXF", "NBXT" }, // NBX L + { "NBRF", "NBRT" }, // NBR L + { "NF1", "F1" }, // F1 L + { "NF2", "F2" }, // F2 L + { "NCF", "CF" }, // C L + { "NURF", "URF" }, // UART R FLAG L + { "NUTB", "UTB" }, // UART T BUFF L + { "NXOFF", "XOFF" }, // DO X OFF L + { "NGOSR", "GOSR" }, // GOUT SER RQ L + { "NF3", "F3" }, // F3 L + { "NINTR2", "INTR2" }, // INTR 2 L + { "KEYUP", "KEYDN" }, // KEY DOWN L + { "NPWRUP", "PWRUP" }, // PWR UP L + { "NSYNC", "SYNC" }, // SYNC ENA L + { "PE", "NPE" }, // PARITY ERROR H + { "BZY", "NBZY" }, // MEM BZY H + { "EQ", "NE" }, // EQUAL H + { "CC", "CS" }, // CARRY OUT L + { "MDOFO", "MDOFZ" }, // MDR O.F. OUT H + { "NCSR", "CSR" }, // COPIER SER REQ L + { "NCPCF", "CPCF" }, // C-PCF L + { "T", "F" }, // TRUE H + { "NVSR", "VSR" }, // VID SERV REQ L + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" } +}; + +u32 vt61_disassembler::opcode_alignment() const +{ + return 1; +} + +u32 vt61_disassembler::interface_flags() const +{ + return PAGED; +} + +u32 vt61_disassembler::page_address_bits() const +{ + return 8; +} + +void vt61_disassembler::dasm_spr(std::ostream &stream, u8 r) +{ + if (BIT(r, 4)) + util::stream_format(stream, "IR%d", r & 9); + else + util::stream_format(stream, "R%d", r); +} + +void vt61_disassembler::dasm_source(std::ostream &stream, u16 inst) +{ + if ((inst & 003000) == 003000) + util::stream_format(stream, "#%03o", inst & 000377); + else + { + if ((inst & 003400) == 002400 && (inst & 070000) != 070000) + dasm_spr(stream, (inst & 000170) >> 2 | (inst & 000200) >> 7); + else + stream << s_sources[(inst & 003600) >> 7]; + if ((inst & 000007) != 0 && (inst & 0170000) != 0100000) + stream << "," << s_opr_a[inst & 000007]; + } +} + +offs_t vt61_disassembler::disassemble(std::ostream &stream, offs_t pc, const vt61_disassembler::data_buffer &opcodes, const vt61_disassembler::data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc); + offs_t flags = SUPPORTED; + + if (!BIT(inst, 15)) + { + if ((inst & 074000) == 054000) + { + stream << "LDU"; + if ((inst & 000007) != 0 && (inst & 003000) != 003000) + { + stream << " " << s_opr_a[inst & 000007]; + if ((inst & 000007) == 5) + flags |= STEP_OUT; + } + } + else + { + switch (inst & 070000) + { + case 000000: + stream << "LAC "; + break; + + case 040000: + stream << "LMA " << (BIT(inst, 11) ? "HI," : "LO,"); + break; + + case 050000: + stream << "JMP "; + break; + + case 060000: + if (BIT(inst, 11)) + stream << "LMD "; + else + stream << "CAS3 "; + break; + + case 070000: + stream << "LSP "; + dasm_spr(stream, (inst & 000170) >> 2 | (inst & 004000) >> 11); + stream << ","; + break; + + default: + stream << "LD? "; + break; + } + + dasm_source(stream, inst); + if ((inst & 000007) == 5 && (inst & 003000) != 003000) + flags |= STEP_OUT; + } + } + else if (BIT(inst, 14)) + { + util::stream_format(stream, "BR %s,%03o", s_conditions[(inst & 017400) >> 8][BIT(inst, 13)], inst & 000377); + } + else if (BIT(inst, 13)) + { + if ((inst & 007407) == 0) + stream << "NOP"; + else + { + stream << s_opr_b[(inst & 007400) >> 8]; + if ((inst & 000007) != 0) + { + stream << " " << s_opr_a[inst & 000007]; + if ((inst & 000207) == 000204) + stream << "A"; // ENABLE MDR A (CAS DATA) + if ((inst & 000107) == 000104) + stream << "B"; // ENABLE MDR B (SYNC DATA IN) + if ((inst & 000007) == 5) + flags |= STEP_OUT; + } + } + } + else if (BIT(inst, 12)) + { + stream << "CMP "; + dasm_source(stream, inst); + if ((inst & 000007) == 5 && (inst & 003000) != 003000) + flags |= STEP_OUT; + } + else switch (inst & 000007) + { + case 0: + stream << "CMA"; + break; + + case 1: + stream << "ORA "; + dasm_source(stream, inst); + break; + + case 2: + stream << "XOR "; + dasm_source(stream, inst); + break; + + case 3: + stream << "AND "; + dasm_source(stream, inst); + break; + + case 4: + stream << "DCA"; + if (BIT(inst, 11)) + stream << " C"; + break; + + case 5: + stream << "ADD "; + if (BIT(inst, 11)) + stream << "C,"; + dasm_source(stream, inst); + break; + + case 6: + stream << "SUB "; + if (BIT(inst, 11)) + stream << "C,"; + dasm_source(stream, inst); + break; + + case 7: + stream << "SLA"; + if (BIT(inst, 11)) + stream << " C"; + break; + } + + return 1 | flags; +} diff --git a/src/devices/cpu/vt61/vt61dasm.h b/src/devices/cpu/vt61/vt61dasm.h new file mode 100644 index 00000000000..a2f038f1458 --- /dev/null +++ b/src/devices/cpu/vt61/vt61dasm.h @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_VT61_VT61DASM_H +#define MAME_CPU_VT61_VT61DASM_H + +#pragma once + +class vt61_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + vt61_disassembler(); + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual u32 interface_flags() const override; + virtual u32 page_address_bits() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + // tables + static const char *const s_opr_a[8]; + static const char *const s_opr_b[16]; + static const char *const s_sources[12]; + static const char *const s_conditions[32][2]; + + // disassembly helpers + void dasm_spr(std::ostream &stream, u8 r); + void dasm_source(std::ostream &stream, u16 inst); +}; + +#endif // MAME_CPU_VT61_VT61DASM_H diff --git a/src/devices/cpu/we32000/we32100.cpp b/src/devices/cpu/we32000/we32100.cpp new file mode 100644 index 00000000000..1d4b5fbcd04 --- /dev/null +++ b/src/devices/cpu/we32000/we32100.cpp @@ -0,0 +1,113 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + AT&T WE32100 32-Bit Microprocessor + + Currently this device is just a stub with no actual execution core. + +***************************************************************************/ + +#include "emu.h" +#include "we32100.h" +#include "we32100d.h" + +// device type definitions +DEFINE_DEVICE_TYPE(WE32100, we32100_device, "we32100", "AT&T WE32100") + +we32100_device::we32100_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : cpu_device(mconfig, WE32100, tag, owner, clock) + , m_space_config("program", ENDIANNESS_BIG, 32, 32, 0) + , m_space(nullptr) + , m_cache(nullptr) + , m_r{0} + , m_icount(0) +{ +} + +std::unique_ptr<util::disasm_interface> we32100_device::create_disassembler() +{ + return std::make_unique<we32100_disassembler>(); +} + +device_memory_interface::space_config_vector we32100_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_space_config), + }; +} + +void we32100_device::device_start() +{ + m_space = &space(AS_PROGRAM); + m_cache = m_space->cache<2, 0, ENDIANNESS_BIG>(); + + set_icountptr(m_icount); + + state_add(STATE_GENPC, "GENPC", m_r[15]).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_r[15]).noshow(); + state_add(STATE_GENFLAGS, "CURFLAGS", m_r[11]).noshow().formatstr("%23s"); + for (int i = 0; i < 9; i++) + state_add(WE_R0 + i, string_format("r%d", i).c_str(), m_r[i]); + for (int i = 9; i < 15; i++) + state_add(WE_R0 + i, string_format("r%d", i).c_str(), m_r[i]).noshow(); + state_add(WE_FP, "FP", m_r[9]); + state_add(WE_AP, "AP", m_r[10]); + state_add(WE_PSW, "PSW", m_r[11]); + state_add(WE_SP, "SP", m_r[12]); + state_add(WE_PCBP, "PCBP", m_r[13]); + state_add(WE_ISP, "ISP", m_r[14]); + state_add(WE_PC, "PC", m_r[15]); + + save_item(NAME(m_r)); +} + +void we32100_device::device_reset() +{ + // TODO +} + +void we32100_device::execute_run() +{ + // On-reset sequence: load PCBP, then load PSW, PC and SP from there + m_r[13] = m_space->read_dword(0x00000080); + m_r[11] = m_space->read_dword(m_r[13]); + m_r[15] = m_space->read_dword(m_r[13] + 4); + m_r[12] = m_space->read_dword(m_r[13] + 8); + + debugger_instruction_hook(m_r[15]); + + m_icount = 0; +} + +void we32100_device::execute_set_input(int inputnum, int state) +{ + // TODO +} + +void we32100_device::state_string_export(const device_state_entry &entry, std::string &str) const +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + str = string_format("%c%c%c%c%c%c%c%c%c<%X>%c(%c)%c%c<%X>%c%c", + BIT(m_r[11], 25) ? 'f' : '.', + BIT(m_r[11], 24) ? 'Q' : '.', + BIT(m_r[11], 23) ? 'c' : '.', + BIT(m_r[11], 22) ? 'O' : '.', + BIT(m_r[11], 21) ? 'N' : '.', + BIT(m_r[11], 20) ? 'Z' : '.', + BIT(m_r[11], 19) ? 'V' : '.', + BIT(m_r[11], 18) ? 'C' : '.', + BIT(m_r[11], 17) ? 'T' : '.', + (m_r[11] & 0x0001e000) >> 13, + "KESU"[(m_r[11] & 0x00001800) >> 11], + "KESU"[(m_r[11] & 0x00000600) >> 9], + BIT(m_r[11], 8) ? 'R' : '.', + BIT(m_r[11], 7) ? 'I' : '.', + (m_r[11] & 0x00000078) >> 3, + BIT(m_r[11], 2) ? 'T' : '.', + "RPSN"[m_r[11] & 0x00000003]); + break; + } +} diff --git a/src/devices/cpu/we32000/we32100.h b/src/devices/cpu/we32000/we32100.h new file mode 100644 index 00000000000..54e1edc4a3e --- /dev/null +++ b/src/devices/cpu/we32000/we32100.h @@ -0,0 +1,59 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + AT&T WE32100 32-Bit Microprocessor + +***************************************************************************/ + +#ifndef MAME_CPU_WE32000_WE32100_H +#define MAME_CPU_WE32000_WE32100_H + +#pragma once + + +class we32100_device : public cpu_device +{ +public: + enum { + WE_R0, WE_R1, WE_R2, WE_R3, WE_R4, WE_R5, WE_R6, WE_R7, WE_R8, + WE_R9, WE_R10, WE_R11, WE_R12, WE_R13, WE_R14, WE_R15, + WE_FP, WE_AP, WE_PSW, WE_SP, WE_PCBP, WE_ISP, WE_PC + }; + + // construction/destruction + we32100_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual void execute_run() override; + virtual void execute_set_input(int inputnum, int state) override; + + // device_disasm_interface overrides + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // device_state_interface overrides + void state_string_export(const device_state_entry &entry, std::string &str) const override; + +private: + // address space + address_space_config m_space_config; + address_space *m_space; + memory_access_cache<2, 0, ENDIANNESS_BIG> *m_cache; + + // internal state + u32 m_r[16]; + s32 m_icount; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(WE32100, we32100_device) + +#endif // MAME_CPU_WE32000_WE32100_H diff --git a/src/devices/cpu/we32000/we32100d.cpp b/src/devices/cpu/we32000/we32100d.cpp new file mode 100644 index 00000000000..65406d85446 --- /dev/null +++ b/src/devices/cpu/we32000/we32100d.cpp @@ -0,0 +1,902 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Disassembler for AT&T's WE32100 processor. + + Operands are formatted similarly to AT&T's m32dis. Note that operand + encoding is little-endian even though memory accesses are big-endian + (and must also be aligned). + +***************************************************************************/ + +#include "emu.h" +#include "we32100d.h" + + +//************************************************************************** +// WE32100 DISASSEMBLER +//************************************************************************** + +we32100_disassembler::we32100_disassembler() + : util::disasm_interface() +{ +} + +u32 we32100_disassembler::opcode_alignment() const +{ + return 1; +} + +const char *const we32100_disassembler::s_rnames[16] = { + "r0", + "r1", + "r2", + "r3", + "r4", + "r5", + "r6", + "r7", + "r8", + "fp", // Frame Pointer + "ap", // Argument Pointer + "psw", // Processor Status Word (privileged) + "sp", // Stack Pointer + "pcbp", // Process Control Block Pointer (privileged) + "isp", // Interrupt Stack Pointer (privileged) + "pc" // Program Counter +}; + +void we32100_disassembler::format_signed(std::ostream &stream, s32 x) +{ + if (x == 0) + stream << "0"; + else if (x > 0) + util::stream_format(stream, "0x%x", x); + else + util::stream_format(stream, "-0x%x", u32(-x)); +} + +void we32100_disassembler::dasm_am(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes, u8 n, bool dst, bool spectype) +{ + switch (n & 0xf0) + { + case 0x00: case 0x10: case 0x20: case 0x30: case 0xf0: + if (dst) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Positive or negative literal + stream << "&"; + format_signed(stream, s8(n)); + } + break; + + case 0x40: + if (n != 0x4f) + { + // Register + util::stream_format(stream, "%%%s", s_rnames[n & 0x0f]); + } + else if (dst) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Word immediate + util::stream_format(stream, "&0x%08x", swapendian_int32(opcodes.r32(pc))); + pc += 4; + } + break; + + case 0x50: + if (n != 0x5b && n != 0x5f) + { + // Register deferred + util::stream_format(stream, "(%%%s)", s_rnames[n & 0x0f]); + } + else if (n == 0x5b || dst) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Halfword immediate + util::stream_format(stream, "&0x%04x", swapendian_int16(opcodes.r16(pc))); + pc += 2; + } + break; + + case 0x60: + if (n != 0x6f) + { + // FP short offset + format_signed(stream, n & 0x0f); + stream << "(%fp)"; + } + else if (dst) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Byte immediate + util::stream_format(stream, "&0x%02x", opcodes.r8(pc++)); + } + break; + + case 0x70: + if (n != 0x7f) + { + // AP short offset + format_signed(stream, n & 0x0f); + stream << "(%ap)"; + } + else + { + // Absolute + util::stream_format(stream, "$0x%08x", swapendian_int32(opcodes.r32(pc))); + pc += 4; + } + break; + + case 0x80: case 0x90: + if ((n & 0x0f) == 0x0b) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Word displacement or displacement deferred + if (BIT(n, 4)) + stream << "*"; + format_signed(stream, s32(swapendian_int32(opcodes.r32(pc)))); + pc += 4; + util::stream_format(stream, "(%%%s)", s_rnames[n & 0x0f]); + } + break; + + case 0xa0: case 0xb0: + if ((n & 0x0f) == 0x0b) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Halfword displacement or displacement deferred + if (BIT(n, 4)) + stream << "*"; + format_signed(stream, s16(swapendian_int16(opcodes.r16(pc)))); + pc += 2; + util::stream_format(stream, "(%%%s)", s_rnames[n & 0x0f]); + } + break; + + case 0xc0: case 0xd0: + if ((n & 0x0f) == 0x0b) + util::stream_format(stream, "invalid(0x%02x)", n); + else + { + // Byte displacement or displacement deferred + if (BIT(n, 4)) + stream << "*"; + format_signed(stream, s8(opcodes.r8(pc++))); + util::stream_format(stream, "(%%%s)", s_rnames[n & 0x0f]); + } + break; + + case 0xe0: + if (n == 0xef) + { + // Absolute deferred + util::stream_format(stream, "*$0x%08x", swapendian_int32(opcodes.r32(pc))); + pc += 4; + } + else if (spectype) + util::stream_format(stream, "invalid(0x%02x)", n); + else if (BIT(n, 3) || (n & 0x03) == 0x01) + util::stream_format(stream, "reserved(0x%02x)", n); + else + { + // Expanded operand type + if (!BIT(n, 1)) + util::stream_format(stream, "{%cword}", BIT(n, 2) ? 's' : 'u'); + else if (!BIT(n, 0)) + util::stream_format(stream, "{%chalf}", BIT(n, 2) ? 's' : 'u'); + else + util::stream_format(stream, "{%cbyte}", BIT(n, 2) ? 's' : 'u'); + u8 m = opcodes.r8(pc++); + dasm_am(stream, pc, opcodes, m, dst, true); + } + break; + } +} + +void we32100_disassembler::dasm_src(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) +{ + u8 n = opcodes.r8(pc++); + dasm_am(stream, pc, opcodes, n, false, false); +} + +void we32100_disassembler::dasm_srcw(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) +{ + u8 n = opcodes.r8(pc++); + dasm_am(stream, pc, opcodes, n, false, true); +} + +void we32100_disassembler::dasm_dst(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) +{ + u8 n = opcodes.r8(pc++); + dasm_am(stream, pc, opcodes, n, true, false); +} + +void we32100_disassembler::dasm_dstw(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) +{ + u8 n = opcodes.r8(pc++); + dasm_am(stream, pc, opcodes, n, true, true); +} + +void we32100_disassembler::dasm_ea(std::ostream &stream, offs_t &pc, offs_t ppc, const we32100_disassembler::data_buffer &opcodes) +{ + u8 n = opcodes.r8(pc++); + if (n >= 0x50 && (n < 0xe0 || n == 0xef) && n != 0x5f && n != 0x6f) + { + if ((n & 0x8f) == 0x8f && n != 0xef) + { + if (BIT(n, 4)) + stream << "*"; + + // Show calculated PC-relative displacement + s32 disp; + if (BIT(n, 6)) + disp = s8(opcodes.r8(pc++)); + else if (BIT(n, 5)) + { + disp = s16(swapendian_int16(opcodes.r16(pc))); + pc += 2; + } + else + { + disp = s32(swapendian_int32(opcodes.r32(pc))); + pc += 4; + } + format_signed(stream, disp); + util::stream_format(stream, "(%%%s) <%x>", s_rnames[15], u32(ppc + disp)); + } + else + dasm_am(stream, pc, opcodes, n, false, true); + } + else + util::stream_format(stream, "invalid(0x%02x)", n); +} + +void we32100_disassembler::dasm_sr(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) +{ + u8 n = opcodes.r8(pc++); + if (n >= 0x40 && n <= 0x49) + util::stream_format(stream, "%%%s", s_rnames[n & 0x0f]); + else + util::stream_format(stream, "invalid(0x%02x)", n); +} + +void we32100_disassembler::dasm_bdisp(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes, bool byte) +{ + u32 ppc = pc - 1; + int disp; + if (byte) + { + disp = s8(opcodes.r8(pc++)); + } + else + { + disp = s16(swapendian_int16(opcodes.r16(pc))); + pc += 2; + } + format_signed(stream, disp); + util::stream_format(stream, " <%x>", u32(ppc + disp)); +} + +offs_t we32100_disassembler::dasm_30xx(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) +{ + u32 flags = SUPPORTED; + u8 op = opcodes.r8(pc++); + + switch (op) + { + case 0x09: + stream << "MVERNO"; + break; + + case 0x0d: + stream << "ENBVJMP"; // (privileged) + break; + + case 0x13: + stream << "DISVJMP"; // (privileged) + break; + + case 0x19: + stream << "MOVBLW"; + break; + + case 0x1f: + stream << "STREND"; + break; + + case 0x2f: + stream << "INTACK"; // (privileged) + break; + + case 0x35: + stream << "STRCPY"; + break; + + case 0x45: + stream << "RETG"; + flags |= STEP_OUT; + break; + + case 0x61: + stream << "GATE"; + flags |= STEP_OVER; + break; + + case 0xac: + stream << "CALLPS"; // (privileged) + flags |= STEP_OVER; + break; + + case 0xc8: + stream << "RETPS"; // (privileged) + flags |= STEP_OUT; + break; + + default: + stream << "reserved"; + break; + } + + return flags; +} + +offs_t we32100_disassembler::disassemble(std::ostream &stream, offs_t pc, const we32100_disassembler::data_buffer &opcodes, const we32100_disassembler::data_buffer ¶ms) +{ + offs_t ppc = pc; + u32 flags = SUPPORTED; + u8 op = opcodes.r8(pc++); + + if ((op & 0x03) == 0x01 + || op == 0x00 + || op == 0x26 + || (op & 0xfa) == 0x0a + || (op & 0xfd) == 0x12 + || (op & 0xfe) == 0x1a + || (op & 0xfc) == 0x98 + || (op & 0xde) == 0xc2 + || (op & 0xfe) == 0xd6 + || (op & 0xfe) == 0xda) + { + stream << "reserved"; + } + else switch (op & 0xfc) + { + case 0x00: case 0x04: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s", "MOVAW"); + dasm_ea(stream, pc, ppc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + } + else if (!BIT(op, 0)) + { + util::stream_format(stream, "%-8s0x%08x,", BIT(op, 4) ? "SPOPRT" : "SPOPRD", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_src(stream, pc, opcodes); + } + else + { + util::stream_format(stream, "%-8s0x%08x,", BIT(op, 4) ? "SPOPT2" : "SPOPD2", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + } + break; + + case 0x08: + stream << "RET"; + flags |= STEP_OUT; + break; + + case 0x0c: + util::stream_format(stream, "%-8s", "MOVTRW"); // (privileged) + dasm_src(stream, pc, opcodes); // or effective address? + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0x10: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s", "SAVE"); + dasm_sr(stream, pc, opcodes); + } + else + { + util::stream_format(stream, "%-8s0x%08x,", "SPOPWD", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_dst(stream, pc, opcodes); + } + break; + + case 0x14: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s0x%02x", "EXTOP", opcodes.r8(pc++)); + flags |= STEP_OVER; + } + else + { + util::stream_format(stream, "%-8s0x%08x,", "SPOPWT", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_dst(stream, pc, opcodes); + } + break; + + case 0x18: + util::stream_format(stream, "%-8s", "RESTORE"); + dasm_sr(stream, pc, opcodes); + break; + + case 0x1c: + util::stream_format(stream, "%-8s", util::string_format("SWAP%cI", "W?HB"[op & 0x03])); + dasm_ea(stream, pc, ppc, opcodes); + break; + + case 0x20: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s", "POPW"); + dasm_dstw(stream, pc, opcodes); + } + else if (!BIT(op, 0)) + { + util::stream_format(stream, "%-8s0x%08x,", "SPOPRS", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_src(stream, pc, opcodes); + } + else + { + util::stream_format(stream, "%-8s0x%08x,", "SPOPS2", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + } + break; + + case 0x24: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s", "JMP"); + dasm_ea(stream, pc, ppc, opcodes); + } + else + stream << "CFLUSH"; + break; + + case 0x28: + util::stream_format(stream, "%-8s", util::string_format("TST%c", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + break; + + case 0x2c: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s", "CALL"); + dasm_ea(stream, pc, ppc, opcodes); + stream << ","; + dasm_ea(stream, pc, ppc, opcodes); + flags |= STEP_OVER; + } + else if (!BIT(op, 0)) + { + stream << "BPT"; + flags |= STEP_OVER; + } + else + { + stream << "WAIT"; // (privileged) + } + break; + + case 0x30: + if (!BIT(op, 1)) + flags = dasm_30xx(stream, pc, opcodes); + else if (!BIT(op, 0)) + { + util::stream_format(stream, "%-8s0x%08x", "SPOP", swapendian_int32(opcodes.r32(pc))); + pc += 4; + } + else + { + util::stream_format(stream, "%-8s0x%08x,", "SPOPWS", swapendian_int32(opcodes.r32(pc))); + pc += 4; + dasm_dst(stream, pc, opcodes); + } + break; + + case 0x34: + if (!BIT(op, 1)) + { + util::stream_format(stream, "%-8s", "JSB"); + dasm_ea(stream, pc, ppc, opcodes); + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BSBB" : "BSBH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + flags |= STEP_OVER; + break; + + case 0x38: + util::stream_format(stream, "%-8s", util::string_format("BIT%c", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + break; + + case 0x3c: + util::stream_format(stream, "%-8s", util::string_format("CMP%c", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + break; + + case 0x40: + if (!BIT(op, 1)) + { + stream << "RGEQ"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BGEB" : "BGEH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x44: case 0x54: + if (!BIT(op, 1)) + { + stream << "RGTR"; + if (BIT(op, 4)) + stream << "U"; + flags |= STEP_OUT; + } + else + { + if (BIT(op, 4)) + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BGUB" : "BGUH"); + else + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BGB" : "BGH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x48: + if (!BIT(op, 1)) + { + stream << "RLSS"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BLB" : "BLH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x4c: case 0x5c: + if (!BIT(op, 1)) + { + stream << "RLEQ"; + if (BIT(op, 4)) + stream << "U"; + flags |= STEP_OUT; + } + else + { + if (BIT(op, 4)) + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BLEUB" : "BLEUH"); + else + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BLEB" : "BLEH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x50: + if (!BIT(op, 1)) + { + stream << "RCC"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BCC" : "BCC"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x58: + if (!BIT(op, 1)) + { + stream << "RCS"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BCSB" : "BCSH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x60: + if (!BIT(op, 1)) + { + stream << "RVS"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BVCB" : "BVCH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x64: case 0x74: + if (!BIT(op, 1)) + { + stream << "RNEQ"; + if (!BIT(op, 4)) + stream << "U"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BNEB" : "BNEH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x68: + if (!BIT(op, 1)) + { + stream << "RVS"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BVSB" : "BVSH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x6c: case 0x7c: + if (!BIT(op, 1)) + { + stream << "REQL"; + if (!BIT(op, 4)) + stream << "U"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BEB" : "BEH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x70: + if (!BIT(op, 1)) + stream << "NOP"; + else if (BIT(op, 0)) + util::stream_format(stream, "%-8s0x%02x", "NOP2", opcodes.r8(pc++)); + else + { + util::stream_format(stream, "%-8s0x%04x", "NOP3", swapendian_int16(opcodes.r16(pc))); + pc += 2; + } + break; + + case 0x78: + if (!BIT(op, 1)) + { + stream << "RSB"; + flags |= STEP_OUT; + } + else + { + util::stream_format(stream, "%-8s", BIT(op, 0) ? "BRB" : "BRH"); + dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); + } + break; + + case 0x80: + util::stream_format(stream, "%-8s", util::string_format("CLR%c", "W?HB"[op & 0x03])); + dasm_dst(stream, pc, opcodes); + break; + + case 0x84: + util::stream_format(stream, "%-8s", util::string_format("MOV%c", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0x88: + util::stream_format(stream, "%-8s", util::string_format("MCOM%c", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0x8c: + util::stream_format(stream, "%-8s", util::string_format("MNEG%c", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0x90: + util::stream_format(stream, "%-8s", util::string_format("INC%c", "W?HB"[op & 0x03])); + dasm_dst(stream, pc, opcodes); + break; + + case 0x94: + util::stream_format(stream, "%-8s", util::string_format("DEC%c", "W?HB"[op & 0x03])); + dasm_dst(stream, pc, opcodes); + break; + + case 0x9c: case 0xdc: + util::stream_format(stream, "%-8s", util::string_format("ADD%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xa0: + util::stream_format(stream, "%-8s", "PUSHW"); + dasm_srcw(stream, pc, opcodes); + break; + + case 0xa4: case 0xe4: + util::stream_format(stream, "%-8s", util::string_format("MOD%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xa8: case 0xe8: + util::stream_format(stream, "%-8s", util::string_format("MUL%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xac: case 0xec: + util::stream_format(stream, "%-8s", util::string_format("DIV%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xb0: case 0xf0: + util::stream_format(stream, "%-8s", util::string_format("OR%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xb4: case 0xf4: + util::stream_format(stream, "%-8s", util::string_format("XOR%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xb8: case 0xf8: + util::stream_format(stream, "%-8s", util::string_format("AND%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xbc: case 0xfc: + util::stream_format(stream, "%-8s", util::string_format("SUB%c%d", "W?HB"[op & 0x03], BIT(op, 6) ? 3 : 2)); + dasm_src(stream, pc, opcodes); + if (BIT(op, 6)) + { + stream << ","; + dasm_src(stream, pc, opcodes); + } + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xc0: case 0xc4: case 0xd0: case 0xd4: + util::stream_format(stream, "%-8s", util::string_format("%c%cS%c3", BIT(op, 4) ? 'L' : 'A', BIT(op, 2) ? 'R' : 'L', "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xc8: + util::stream_format(stream, "%-8s", util::string_format("INS%c3", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xcc: + util::stream_format(stream, "%-8s", util::string_format("EXT%c3", "W?HB"[op & 0x03])); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xd8: + util::stream_format(stream, "%-8s", "ROTW"); + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_src(stream, pc, opcodes); + stream << ","; + dasm_dst(stream, pc, opcodes); + break; + + case 0xe0: + util::stream_format(stream, "%-8s", "PUSHAW"); + dasm_ea(stream, pc, ppc, opcodes); + break; + } + + return flags | ((pc - ppc) & LENGTHMASK); +} diff --git a/src/devices/cpu/we32000/we32100d.h b/src/devices/cpu/we32000/we32100d.h new file mode 100644 index 00000000000..afe653d518d --- /dev/null +++ b/src/devices/cpu/we32000/we32100d.h @@ -0,0 +1,36 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_WE32000_WE32100D_H +#define MAME_CPU_WE32000_WE32100D_H + +#pragma once + +class we32100_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + we32100_disassembler(); + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const char *const s_rnames[16]; + + // internal helpers + void format_signed(std::ostream &stream, s32 x); + void dasm_am(std::ostream &stream, offs_t &pc, const data_buffer &opcodes, u8 n, bool dst, bool spectype); + void dasm_src(std::ostream &stream, offs_t &pc, const data_buffer &opcodes); + void dasm_srcw(std::ostream &stream, offs_t &pc, const data_buffer &opcodes); + void dasm_dst(std::ostream &stream, offs_t &pc, const data_buffer &opcodes); + void dasm_dstw(std::ostream &stream, offs_t &pc, const data_buffer &opcodes); + void dasm_ea(std::ostream &stream, offs_t &pc, offs_t ppc, const data_buffer &opcodes); + void dasm_sr(std::ostream &stream, offs_t &pc, const data_buffer &opcodes); + void dasm_bdisp(std::ostream &stream, offs_t &pc, const data_buffer &opcodes, bool byte); + offs_t dasm_30xx(std::ostream &stream, offs_t &pc, const data_buffer &opcodes); +}; + +#endif // MAME_CPU_WE32000_WE32100D_H diff --git a/src/devices/cpu/z8000/makedab.cpp b/src/devices/cpu/z8000/makedab.cpp index 02a27f6783e..05538ae204e 100644 --- a/src/devices/cpu/z8000/makedab.cpp +++ b/src/devices/cpu/z8000/makedab.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Juergen Buchmueller,Ernesto Corvi -#include <stdio.h> +#include <cstdio> #define CF 0x100 #define HF 0x200 diff --git a/src/devices/imagedev/cassette.cpp b/src/devices/imagedev/cassette.cpp index ee618b33c79..4e090b0e498 100644 --- a/src/devices/imagedev/cassette.cpp +++ b/src/devices/imagedev/cassette.cpp @@ -124,10 +124,17 @@ void cassette_image_device::update() void cassette_image_device::change_state(cassette_state state, cassette_state mask) { - cassette_state new_state = (m_state & ~mask) | (state & mask); - if ((m_state ^ new_state) & (CASSETTE_MASK_UISTATE | CASSETTE_MASK_MOTOR)) - m_position_time = machine().time().as_double(); - m_state = new_state; + cassette_state new_state; + + new_state = m_state; + new_state &= ~mask; + new_state |= (state & mask); + + if (new_state != m_state) + { + update(); + m_state = new_state; + } } @@ -136,7 +143,7 @@ double cassette_image_device::input() { update(); int32_t sample = m_value; - double double_value = sample / double(0x7FFFFFFF); + double double_value = sample / (double(0x7FFFFFFF)); LOGMASKED(LOG_DETAIL, "cassette_input(): time_index=%g value=%g\n", m_position, double_value); @@ -154,14 +161,18 @@ void cassette_image_device::output(double value) value = std::min(value, 1.0); value = std::max(value, -1.0); - m_value = (int32_t) (value * 0x7FFFFFFF); + m_value = int32_t(value * 0x7FFFFFFF); } } double cassette_image_device::get_position() { - return m_position; + double position = m_position; + + if (is_motor_on()) + position += (machine().time().as_double() - m_position_time)*m_speed*m_direction; + return position; } @@ -197,6 +208,8 @@ void cassette_image_device::go_reverse() void cassette_image_device::seek(double time, int origin) { + update(); + double length = get_length(); switch(origin) { @@ -290,8 +303,7 @@ image_init_result cassette_image_device::internal_load(bool is_create) } /* set to default state, but only change the UI state */ - //change_state(m_default_state, CASSETTE_MASK_UISTATE); - m_state = m_default_state; + change_state(m_default_state, CASSETTE_MASK_UISTATE); /* reset the position */ m_position = 0.0; @@ -374,7 +386,7 @@ std::string cassette_image_device::call_display() ? u8"\u25BA" : u8"\u25CF"; - // Since you can have anything in a BDF file, we will use crude ascii characters instead + // create information string result = string_format("%s %s %02d:%02d (%04d) [%02d:%02d (%04d)]", shapes[n], // animation status_icon, // play or record @@ -384,6 +396,18 @@ std::string cassette_image_device::call_display() ((int)length / 60), ((int)length % 60), (int)length); + + // make sure tape stops at end when playing + if ((m_state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY) + { + if (m_cassette) + { + if (get_position() > get_length()) + { + m_state = ((m_state & ~CASSETTE_MASK_UISTATE) | CASSETTE_STOPPED); + } + } + } } return result; } @@ -400,7 +424,7 @@ void cassette_image_device::sound_stream_update(sound_stream &stream, stream_sam if (m_stereo) right_buffer = outputs[1]; - cassette_state state = get_state(); + cassette_state state = get_state() & (CASSETTE_MASK_UISTATE | CASSETTE_MASK_MOTOR | CASSETTE_MASK_SPEAKER); if (exists() && (state == (CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED))) { diff --git a/src/devices/machine/acorn_vidc.cpp b/src/devices/machine/acorn_vidc.cpp index 94ddfb8b3c8..54317b991e2 100644 --- a/src/devices/machine/acorn_vidc.cpp +++ b/src/devices/machine/acorn_vidc.cpp @@ -77,7 +77,7 @@ acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, device_t acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : acorn_vidc10_device(mconfig, ACORN_VIDC10, tag, owner, clock) { - m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_device::regs_map), this)); + m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_device::regs_map), this)); m_pal_4bpp_base = 0x100; m_pal_cursor_base = 0x10; m_pal_border_base = 0x110; @@ -87,7 +87,7 @@ acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, const ch acorn_vidc10_lcd_device::acorn_vidc10_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : acorn_vidc10_device(mconfig, ACORN_VIDC10_LCD, tag, owner, clock) { - m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_lcd_device::regs_map), this)); + m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_lcd_device::regs_map), this)); // TODO: confirm being identical to raster version m_pal_4bpp_base = 0x100; m_pal_cursor_base = 0x10; @@ -296,7 +296,7 @@ WRITE32_MEMBER( acorn_vidc10_device::write ) // TODO: check against mem_mask not 32-bit wide u8 reg = data >> 24; u32 val = data & 0xffffff; - + this->space(AS_IO).write_dword(reg, val); } @@ -346,7 +346,7 @@ WRITE32_MEMBER( acorn_vidc10_device::control_w ) //m_test_mode = (data & 0xc100) != 0xc100; //todo: vga/svga modes sets 0x1000? - m_crtc_regs[CRTC_HDSR] = convert_crtc_hdisplay(0); + m_crtc_regs[CRTC_HDSR] = convert_crtc_hdisplay(0); m_crtc_regs[CRTC_HDER] = convert_crtc_hdisplay(1); screen_vblank_line_update(); screen_dynamic_res_change(); @@ -362,18 +362,18 @@ WRITE32_MEMBER( acorn_vidc10_device::crtc_w ) { switch(offset) { - case CRTC_HCR: m_crtc_regs[CRTC_HCR] = ((data >> 14)<<1)+2; break; -// case CRTC_HSWR: m_crtc_regs[CRTC_HSWR] = (data >> 14)+1; break; - case CRTC_HBSR: m_crtc_regs[CRTC_HBSR] = ((data >> 14)<<1)+1; break; - case CRTC_HDSR: + case CRTC_HCR: m_crtc_regs[CRTC_HCR] = ((data >> 14)<<1)+2; break; +// case CRTC_HSWR: m_crtc_regs[CRTC_HSWR] = (data >> 14)+1; break; + case CRTC_HBSR: m_crtc_regs[CRTC_HBSR] = ((data >> 14)<<1)+1; break; + case CRTC_HDSR: m_crtc_raw_horz[0] = (data >> 14); - m_crtc_regs[CRTC_HDSR] = convert_crtc_hdisplay(0); + m_crtc_regs[CRTC_HDSR] = convert_crtc_hdisplay(0); break; - case CRTC_HDER: + case CRTC_HDER: m_crtc_raw_horz[1] = (data >> 14); - m_crtc_regs[CRTC_HDER] = convert_crtc_hdisplay(1); + m_crtc_regs[CRTC_HDER] = convert_crtc_hdisplay(1); break; - case CRTC_HBER: m_crtc_regs[CRTC_HBER] = ((data >> 14)<<1)+1; break; + case CRTC_HBER: m_crtc_regs[CRTC_HBER] = ((data >> 14)<<1)+1; break; case CRTC_HCSR: m_crtc_regs[CRTC_HCSR] = ((data >> 13) & 0x7ff) + 6; return; // case CRTC_HIR: // ... @@ -440,7 +440,7 @@ WRITE32_MEMBER( acorn_vidc10_device::sound_frequency_w ) //************************************************************************** void acorn_vidc10_device::write_dac(u8 channel, u8 data) -{ +{ int16_t res; res = m_ulaw_lookup[data]; m_dac[channel & 7]->write(res); @@ -572,7 +572,7 @@ void arm_vidc20_device::regs_map(address_map &map) arm_vidc20_device::arm_vidc20_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : acorn_vidc10_device(mconfig, ARM_VIDC20, tag, owner, clock) { - m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, -2, address_map_constructor(FUNC(arm_vidc20_device::regs_map), this)); + m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, -2, address_map_constructor(FUNC(arm_vidc20_device::regs_map), this)); m_pal_4bpp_base = 0x000; m_pal_cursor_base = 0x100; m_pal_border_base = 0x100; @@ -634,7 +634,7 @@ inline void arm_vidc20_device::update_8bpp_palette(u16 index, u32 paldata) int r,g,b; // TODO: ext hookup, supremacy plus other stuff according to the manual -// ext = (paldata & 0x0f000000) >> 24; +// ext = (paldata & 0x0f000000) >> 24; b = (paldata & 0x00ff0000) >> 16; g = (paldata & 0x0000ff00) >> 8; r = (paldata & 0x000000ff) >> 0; @@ -670,14 +670,14 @@ u32 arm_vidc20_device::get_pixel_clock() //printf("%d %02x %02x %d %d\n",this->clock(), 1 << m_pixel_rate, m_pixel_source, m_vco_v_modulo, m_vco_r_modulo); if (m_pixel_source == 2) // RCLK return (this->clock() << 1) >> m_pixel_rate; - + // VCLK source is just an external connection - // TODO: get clock from outside world, understand how the modulos are really used, - // understand if SW do some VCO testing before setting CRTC params, + // TODO: get clock from outside world, understand how the modulos are really used, + // understand if SW do some VCO testing before setting CRTC params, // if there isn't a monitor ID mechanism that copes with this if (m_pixel_source == 0) // VCLK return (25175000); - + throw emu_fatalerror("%s unhandled pixel source %02x selected",this->tag(), m_pixel_source); } @@ -685,7 +685,7 @@ WRITE32_MEMBER(arm_vidc20_device::vidc20_crtc_w) { if (offset & 0x8) throw emu_fatalerror("%s accessing CRTC test register %02x, please call the ambulance",this->tag(),offset+0x80); - + const u8 crtc_offset = (offset & 0x7) | ((offset & 0x10) >> 1); switch(crtc_offset) @@ -697,23 +697,23 @@ WRITE32_MEMBER(arm_vidc20_device::vidc20_crtc_w) case CRTC_HDER: m_crtc_regs[CRTC_HDER] = (data&0x7ffe) + 18; break; case CRTC_HBER: m_crtc_regs[CRTC_HBER] = (data&0x7ffe) + 12; break; case CRTC_HCSR: m_crtc_regs[CRTC_HCSR] = (data&0x7fff) + 17; return; -// case CRTC_HIR: +// case CRTC_HIR: case CRTC_VCR: m_crtc_regs[CRTC_VCR] = (data&0x3fff) + 2; break; case CRTC_VSWR: m_crtc_regs[CRTC_VSWR] = (data&0x3fff) + 1; break; case CRTC_VBSR: m_crtc_regs[CRTC_VBSR] = (data&0x3fff) + 1; break; case CRTC_VDSR: m_crtc_regs[CRTC_VDSR] = (data&0x3fff) + 1; break; - case CRTC_VDER: - m_crtc_regs[CRTC_VDER] = (data&0x3fff) + 1; + case CRTC_VDER: + m_crtc_regs[CRTC_VDER] = (data&0x3fff) + 1; screen_vblank_line_update(); break; case CRTC_VBER: m_crtc_regs[CRTC_VBER] = (data&0x3fff) + 1; break; // TODO: bits 15-14 specific for duplex LCD mode - case CRTC_VCSR: - m_crtc_regs[CRTC_VCSR] = (data&0x3fff) + 1; + case CRTC_VCSR: + m_crtc_regs[CRTC_VCSR] = (data&0x3fff) + 1; return; case CRTC_VCER: m_crtc_regs[CRTC_VCER] = (data&0x3fff) + 1; return; } - + screen_dynamic_res_change(); } @@ -722,7 +722,7 @@ WRITE32_MEMBER( arm_vidc20_device::fsynreg_w ) m_vco_r_modulo = data & 0x3f; m_vco_v_modulo = (data >> 8) & 0x3f; // bits 15-14 and 7-6 are test bits - + screen_dynamic_res_change(); } @@ -740,7 +740,7 @@ WRITE32_MEMBER( arm_vidc20_device::vidc20_control_w ) // (data & 0xf0000) >> 16 test mode m_bpp_mode = (data & 0xe0) >> 5; m_crtc_interlace = BIT(data, 12); - + screen_vblank_line_update(); screen_dynamic_res_change(); } @@ -759,7 +759,7 @@ WRITE32_MEMBER( arm_vidc20_device::vidc20_sound_frequency_w ) } void arm_vidc20_device::write_dac32(u8 channel, u16 data) -{ +{ m_dac[channel & 1]->write(data); } diff --git a/src/devices/machine/acorn_vidc.h b/src/devices/machine/acorn_vidc.h index bfa09402ea4..1931e1ee0d6 100644 --- a/src/devices/machine/acorn_vidc.h +++ b/src/devices/machine/acorn_vidc.h @@ -49,7 +49,7 @@ public: void update_sound_mode(bool state) { m_sound_mode = state; refresh_sound_frequency(); } void set_cursor_enable(bool state) { m_cursor_enable = state; } u32 get_cursor_size() { return (m_crtc_regs[CRTC_VCER] - m_crtc_regs[CRTC_VCSR]) * (32/4); } - + protected: acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); @@ -105,13 +105,13 @@ private: DECLARE_WRITE32_MEMBER( crtc_w ); DECLARE_WRITE32_MEMBER( sound_frequency_w ); DECLARE_WRITE32_MEMBER( control_w ); - + u8 m_pixel_clock; bool m_cursor_enable; //bool m_flyback; emu_timer *m_video_timer; emu_timer *m_sound_timer; - + std::unique_ptr<u8[]> m_data_vram; std::unique_ptr<u8[]> m_cursor_vram; // TODO: correct data vram size @@ -176,7 +176,7 @@ private: DECLARE_WRITE32_MEMBER( vidc20_sound_frequency_w ); DECLARE_WRITE32_MEMBER( vidc20_sound_control_w ); DECLARE_WRITE32_MEMBER( fsynreg_w ); - + u8 m_pal_data_index; inline void update_8bpp_palette(u16 index, u32 paldata); bool m_dac_serial_mode; diff --git a/src/devices/machine/am9517a.cpp b/src/devices/machine/am9517a.cpp index f277f9ffed1..5036f8e9dab 100644 --- a/src/devices/machine/am9517a.cpp +++ b/src/devices/machine/am9517a.cpp @@ -1319,4 +1319,5 @@ void eisa_dma_device::device_start() m_address_mask = 0xffffffffU; save_item(NAME(m_stop)); + save_item(NAME(m_ext_mode)); } diff --git a/src/devices/machine/am9517a.h b/src/devices/machine/am9517a.h index a1e9215d125..224170701ac 100644 --- a/src/devices/machine/am9517a.h +++ b/src/devices/machine/am9517a.h @@ -212,6 +212,11 @@ public: m_channel[Channel].m_count = (m_channel[Channel].m_count & 0x0000ffffU) | (u32(data) << 16); } + void set_ext_mode(u8 data) + { + m_ext_mode[data & 3] = data; + } + template <unsigned Channel> u32 get_stop() { return m_stop[Channel]; } template <unsigned Channel> void set_stop(offs_t offset, u32 data, u32 mem_mask) { @@ -224,6 +229,7 @@ protected: private: u32 m_stop[4]; + u8 m_ext_mode[4]; }; // device type definition diff --git a/src/devices/machine/arm_iomd.cpp b/src/devices/machine/arm_iomd.cpp index ca2683dc8b4..2752c6dffdc 100644 --- a/src/devices/machine/arm_iomd.cpp +++ b/src/devices/machine/arm_iomd.cpp @@ -2,17 +2,17 @@ // copyright-holders:Angelo Salese /************************************************************************************************** - ARM IOMD device emulation - - ARM7 SoC or stand-alone device, upgraded version(s) of the IOC found in Acorn Archimedes. - - TODO: - - IOCR / IOLINES hookups can be further improved, also DDR bits needs verifying; - - word-boundary accesses for 8-bit ports; - - split into different types, add quick notes about where they diverges do in this header; - - keyboard/mouse interface hookup is wrong for PS/2 and unimplemented for quadrature. - I guess we can use connectors over a custom handling, with a terminal mock for testing it - without the overhead of everything else. + ARM IOMD device emulation + + ARM7 SoC or stand-alone device, upgraded version(s) of the IOC found in Acorn Archimedes. + + TODO: + - IOCR / IOLINES hookups can be further improved, also DDR bits needs verifying; + - word-boundary accesses for 8-bit ports; + - split into different types, add quick notes about where they diverges do in this header; + - keyboard/mouse interface hookup is wrong for PS/2 and unimplemented for quadrature. + I guess we can use connectors over a custom handling, with a terminal mock for testing it + without the overhead of everything else. **************************************************************************************************/ @@ -55,35 +55,35 @@ void arm_iomd_device::base_map(address_map &map) map(0x024, 0x027).rw(FUNC(arm_iomd_device::irqrq_r<IRQB>), FUNC(arm_iomd_device::irqrq_w<IRQB>)); map(0x028, 0x02b).rw(FUNC(arm_iomd_device::irqmsk_r<IRQB>), FUNC(arm_iomd_device::irqmsk_w<IRQB>)); -// map(0x030, 0x033).r(FUNC(arm_iomd_device::fiqst_r)); -// map(0x034, 0x037).rw(FUNC(arm_iomd_device::fiqrq_r), FUNC(arm_iomd_device::fiqrq_w)); -// map(0x038, 0x03b).rw(FUNC(arm_iomd_device::fiqmsk_r), FUNC(arm_iomd_device::fiqmsk_w)); +// map(0x030, 0x033).r(FUNC(arm_iomd_device::fiqst_r)); +// map(0x034, 0x037).rw(FUNC(arm_iomd_device::fiqrq_r), FUNC(arm_iomd_device::fiqrq_w)); +// map(0x038, 0x03b).rw(FUNC(arm_iomd_device::fiqmsk_r), FUNC(arm_iomd_device::fiqmsk_w)); // timers map(0x040, 0x043).rw(FUNC(arm_iomd_device::tNlow_r<0>), FUNC(arm_iomd_device::tNlow_w<0>)); map(0x044, 0x047).rw(FUNC(arm_iomd_device::tNhigh_r<0>), FUNC(arm_iomd_device::tNhigh_w<0>)); map(0x048, 0x04b).w(FUNC(arm_iomd_device::tNgo_w<0>)); map(0x04c, 0x04f).w(FUNC(arm_iomd_device::tNlatch_w<0>)); - + map(0x050, 0x053).rw(FUNC(arm_iomd_device::tNlow_r<1>), FUNC(arm_iomd_device::tNlow_w<1>)); map(0x054, 0x057).rw(FUNC(arm_iomd_device::tNhigh_r<1>), FUNC(arm_iomd_device::tNhigh_w<1>)); map(0x058, 0x05b).w(FUNC(arm_iomd_device::tNgo_w<1>)); map(0x05c, 0x05f).w(FUNC(arm_iomd_device::tNlatch_w<1>)); // ROM control -// map(0x080, 0x083).rw(FUNC(arm_iomd_device::romcr_r<0>), FUNC(arm_iomd_device::romcr_w<0>)); -// map(0x084, 0x087).rw(FUNC(arm_iomd_device::romcr_r<1>), FUNC(arm_iomd_device::romcr_w<1>)); -// map(0x08c, 0x08f).rw(FUNC(arm_iomd_device::refcr_r), FUNC(arm_iomd_device::refcr_w)); +// map(0x080, 0x083).rw(FUNC(arm_iomd_device::romcr_r<0>), FUNC(arm_iomd_device::romcr_w<0>)); +// map(0x084, 0x087).rw(FUNC(arm_iomd_device::romcr_r<1>), FUNC(arm_iomd_device::romcr_w<1>)); +// map(0x08c, 0x08f).rw(FUNC(arm_iomd_device::refcr_r), FUNC(arm_iomd_device::refcr_w)); // device identifiers map(0x094, 0x097).r(FUNC(arm_iomd_device::id_r<0>)); map(0x098, 0x09b).r(FUNC(arm_iomd_device::id_r<1>)); map(0x09c, 0x09f).r(FUNC(arm_iomd_device::version_r)); // mouse -// map(0x0a0, 0x0a3) // ... +// map(0x0a0, 0x0a3) // ... // I/O control -// map(0x0c4, 0x0c7).rw(FUNC(arm_iomd_device::iotcr_r), FUNC(arm_iomd_device::iotcr_w)); -// map(0x0c8, 0x0cb).rw(FUNC(arm_iomd_device::ectcr_r), FUNC(arm_iomd_device::ectcr_w)); +// map(0x0c4, 0x0c7).rw(FUNC(arm_iomd_device::iotcr_r), FUNC(arm_iomd_device::iotcr_w)); +// map(0x0c8, 0x0cb).rw(FUNC(arm_iomd_device::ectcr_r), FUNC(arm_iomd_device::ectcr_w)); // sound DMA // TODO: IOMD actually have a sd1* register, rework this map(0x180, 0x183).rw(FUNC(arm_iomd_device::sdcur_r<0>), FUNC(arm_iomd_device::sdcur_w<0>)); @@ -94,19 +94,19 @@ void arm_iomd_device::base_map(address_map &map) map(0x194, 0x197).r(FUNC(arm_iomd_device::sdst_r)); // video DMA -// map(0x1c0, 0x1c3).rw(FUNC(arm_iomd_device::curscur_r), FUNC(arm_iomd_device::curscur_w)); +// map(0x1c0, 0x1c3).rw(FUNC(arm_iomd_device::curscur_r), FUNC(arm_iomd_device::curscur_w)); map(0x1c4, 0x1c7).rw(FUNC(arm_iomd_device::cursinit_r), FUNC(arm_iomd_device::cursinit_w)); -// map(0x1d0, 0x1d3).rw(FUNC(arm_iomd_device::vidcura_r), FUNC(arm_iomd_device::vidcura_w)); +// map(0x1d0, 0x1d3).rw(FUNC(arm_iomd_device::vidcura_r), FUNC(arm_iomd_device::vidcura_w)); map(0x1d4, 0x1d7).rw(FUNC(arm_iomd_device::vidend_r), FUNC(arm_iomd_device::vidend_w)); -// map(0x1d8, 0x1db).rw(FUNC(arm_iomd_device::vidstart_r), FUNC(arm_iomd_device::vidstart_w)); +// map(0x1d8, 0x1db).rw(FUNC(arm_iomd_device::vidstart_r), FUNC(arm_iomd_device::vidstart_w)); map(0x1dc, 0x1df).rw(FUNC(arm_iomd_device::vidinita_r), FUNC(arm_iomd_device::vidinita_w)); map(0x1e0, 0x1e3).rw(FUNC(arm_iomd_device::vidcr_r), FUNC(arm_iomd_device::vidcr_w)); // interrupt DMA map(0x1f0, 0x1f3).r(FUNC(arm_iomd_device::irqst_r<IRQDMA>)); map(0x1f4, 0x1f7).rw(FUNC(arm_iomd_device::irqrq_r<IRQDMA>), FUNC(arm_iomd_device::irqrq_w<IRQDMA>)); - map(0x1f8, 0x1fb).rw(FUNC(arm_iomd_device::irqmsk_r<IRQDMA>), FUNC(arm_iomd_device::irqmsk_w<IRQDMA>)); + map(0x1f8, 0x1fb).rw(FUNC(arm_iomd_device::irqmsk_r<IRQDMA>), FUNC(arm_iomd_device::irqmsk_w<IRQDMA>)); // TODO: iomd2 has extra regs in 0x200-0x3ff area, others NOPs / mirrors? } @@ -114,25 +114,25 @@ void arm_iomd_device::base_map(address_map &map) void arm_iomd_device::map(address_map &map) { arm_iomd_device::base_map(map); -// map(0x088, 0x08b).rw(FUNC(arm_iomd_device::dramcr_r), FUNC(arm_iomd_device::dramcr_w)); +// map(0x088, 0x08b).rw(FUNC(arm_iomd_device::dramcr_r), FUNC(arm_iomd_device::dramcr_w)); // VRAM control -// map(0x08c, 0x08f).rw(FUNC(arm_iomd_device::vrefcr_r), FUNC(arm_iomd_device::vrefcr_w)); +// map(0x08c, 0x08f).rw(FUNC(arm_iomd_device::vrefcr_r), FUNC(arm_iomd_device::vrefcr_w)); // flyback line size -// map(0x090, 0x093).rw(FUNC(arm_iomd_device::fsize_r), FUNC(arm_iomd_device::fsize_w)); +// map(0x090, 0x093).rw(FUNC(arm_iomd_device::fsize_r), FUNC(arm_iomd_device::fsize_w)); // quadrature mouse control -// map(0x0a0, 0x0a3).rw(FUNC(arm_iomd_device::mousex_r), FUNC(arm_iomd_device::mousex_w)); -// map(0x0a4, 0x0a7).rw(FUNC(arm_iomd_device::mousey_r), FUNC(arm_iomd_device::mousey_w)); +// map(0x0a0, 0x0a3).rw(FUNC(arm_iomd_device::mousex_r), FUNC(arm_iomd_device::mousex_w)); +// map(0x0a4, 0x0a7).rw(FUNC(arm_iomd_device::mousey_r), FUNC(arm_iomd_device::mousey_w)); // DACK timing control -// map(0x0c0, 0x0c3).rw(FUNC(arm_iomd_device::dmatcr_r), FUNC(arm_iomd_device::dmatcr_w)); +// map(0x0c0, 0x0c3).rw(FUNC(arm_iomd_device::dmatcr_r), FUNC(arm_iomd_device::dmatcr_w)); // DMA external control -// map(0x0cc, 0x0cf).rw(FUNC(arm_iomd_device::dmaext_r), FUNC(arm_iomd_device::dmaext_w)); +// map(0x0cc, 0x0cf).rw(FUNC(arm_iomd_device::dmaext_r), FUNC(arm_iomd_device::dmaext_w)); // I/O DMA, similar structure as sound DMA -// map(0x100, 0x11f) ch 0 -// map(0x120, 0x13f) ch 1 -// map(0x140, 0x15f) ch 2 -// map(0x160, 0x17f) ch 3 +// map(0x100, 0x11f) ch 0 +// map(0x120, 0x13f) ch 1 +// map(0x140, 0x15f) ch 2 +// map(0x160, 0x17f) ch 3 // sound DMA -// map(0x1a0, 0x1bf) ch 1 +// map(0x1a0, 0x1bf) ch 1 } @@ -152,7 +152,7 @@ arm_iomd_device::arm_iomd_device(const machine_config &mconfig, const char *tag, : arm_iomd_device(mconfig, ARM_IOMD, tag, owner, clock) { m_id = 0xd4e7; - m_version = 0; + m_version = 0; } void arm7500fe_iomd_device::map(address_map &map) @@ -161,37 +161,37 @@ void arm7500fe_iomd_device::map(address_map &map) map(0x00c, 0x00f).rw(FUNC(arm7500fe_iomd_device::iolines_r), FUNC(arm7500fe_iomd_device::iolines_w)); // master clock controls -// map(0x01c, 0x01f).rw(FUNC(arm7500fe_iomd_device::susmode_r), FUNC(arm7500fe_iomd_device::susmode_w)); -// map(0x02c, 0x02f).w(FUNC(arm7500fe_iomd_device::stopmode_w)); +// map(0x01c, 0x01f).rw(FUNC(arm7500fe_iomd_device::susmode_r), FUNC(arm7500fe_iomd_device::susmode_w)); +// map(0x02c, 0x02f).w(FUNC(arm7500fe_iomd_device::stopmode_w)); map(0x03c, 0x03f).rw(FUNC(arm7500fe_iomd_device::clkctl_r), FUNC(arm7500fe_iomd_device::clkctl_w)); // interrupt C/D map(0x060, 0x063).r(FUNC(arm7500fe_iomd_device::irqst_r<IRQC>)); map(0x064, 0x067).rw(FUNC(arm7500fe_iomd_device::irqrq_r<IRQC>), FUNC(arm7500fe_iomd_device::irqrq_w<IRQC>)); - map(0x068, 0x06b).rw(FUNC(arm7500fe_iomd_device::irqmsk_r<IRQC>), FUNC(arm7500fe_iomd_device::irqmsk_w<IRQC>)); -// map(0x06c, 0x06f).rw(FUNC(arm7500fe_iomd_device::vidmux_r), FUNC(arm7500fe_iomd_device::vidmux_w)); + map(0x068, 0x06b).rw(FUNC(arm7500fe_iomd_device::irqmsk_r<IRQC>), FUNC(arm7500fe_iomd_device::irqmsk_w<IRQC>)); +// map(0x06c, 0x06f).rw(FUNC(arm7500fe_iomd_device::vidmux_r), FUNC(arm7500fe_iomd_device::vidmux_w)); map(0x070, 0x073).r(FUNC(arm7500fe_iomd_device::irqst_r<IRQD>)); map(0x074, 0x077).rw(FUNC(arm7500fe_iomd_device::irqrq_r<IRQD>), FUNC(arm7500fe_iomd_device::irqrq_w<IRQD>)); - map(0x078, 0x07b).rw(FUNC(arm7500fe_iomd_device::irqmsk_r<IRQD>), FUNC(arm7500fe_iomd_device::irqmsk_w<IRQD>)); - + map(0x078, 0x07b).rw(FUNC(arm7500fe_iomd_device::irqmsk_r<IRQD>), FUNC(arm7500fe_iomd_device::irqmsk_w<IRQD>)); + // PS/2 mouse -// map(0x0a8, 0x0ab).rw(FUNC(arm7500fe_iomd_device::msedat_r), FUNC(arm7500fe_iomd_device::msedat_w)); +// map(0x0a8, 0x0ab).rw(FUNC(arm7500fe_iomd_device::msedat_r), FUNC(arm7500fe_iomd_device::msedat_w)); map(0x0ac, 0x0af).rw(FUNC(arm7500fe_iomd_device::msecr_r), FUNC(arm7500fe_iomd_device::msecr_w)); // I/O control -// map(0x0cc, 0x0cf).rw(FUNC(arm7500fe_iomd_device::astcr_r), FUNC(arm7500fe_iomd_device::astcr_w)); +// map(0x0cc, 0x0cf).rw(FUNC(arm7500fe_iomd_device::astcr_r), FUNC(arm7500fe_iomd_device::astcr_w)); // RAM control -// map(0x0d0, 0x0d3).rw(FUNC(arm7500fe_iomd_device::dramctl_r), FUNC(arm7500fe_iomd_device::dramctl_w)); -// map(0x0d4, 0x0d7).rw(FUNC(arm7500fe_iomd_device::selfref_r), FUNC(arm7500fe_iomd_device::selfref_w)); +// map(0x0d0, 0x0d3).rw(FUNC(arm7500fe_iomd_device::dramctl_r), FUNC(arm7500fe_iomd_device::dramctl_w)); +// map(0x0d4, 0x0d7).rw(FUNC(arm7500fe_iomd_device::selfref_r), FUNC(arm7500fe_iomd_device::selfref_w)); // A/D converter -// map(0x0e0, 0x0e3).rw(FUNC(arm7500fe_iomd_device::atodicr_r), FUNC(arm7500fe_iomd_device::atodicr_w)); -// map(0x0e4, 0x0e7).r(FUNC(arm7500fe_iomd_device::atodsr_r)); -// map(0x0e8, 0x0eb).rw(FUNC(arm7500fe_iomd_device::atodcc_r), FUNC(arm7500fe_iomd_device::atodcc_w)); -// map(0x0ec, 0x0ef).r(FUNC(arm7500fe_iomd_device::atodcnt_r<0>)); -// map(0x0f0, 0x0f3).r(FUNC(arm7500fe_iomd_device::atodcnt_r<1>)); -// map(0x0f4, 0x0f7).r(FUNC(arm7500fe_iomd_device::atodcnt_r<2>)); -// map(0x0f8, 0x0fb).r(FUNC(arm7500fe_iomd_device::atodcnt_r<3>)); +// map(0x0e0, 0x0e3).rw(FUNC(arm7500fe_iomd_device::atodicr_r), FUNC(arm7500fe_iomd_device::atodicr_w)); +// map(0x0e4, 0x0e7).r(FUNC(arm7500fe_iomd_device::atodsr_r)); +// map(0x0e8, 0x0eb).rw(FUNC(arm7500fe_iomd_device::atodcc_r), FUNC(arm7500fe_iomd_device::atodcc_w)); +// map(0x0ec, 0x0ef).r(FUNC(arm7500fe_iomd_device::atodcnt_r<0>)); +// map(0x0f0, 0x0f3).r(FUNC(arm7500fe_iomd_device::atodcnt_r<1>)); +// map(0x0f4, 0x0f7).r(FUNC(arm7500fe_iomd_device::atodcnt_r<2>)); +// map(0x0f8, 0x0fb).r(FUNC(arm7500fe_iomd_device::atodcnt_r<3>)); // video DMA -// map(0x1c8, 0x1cb).rw(FUNC(arm7500fe_iomd_device::vidcurb_r), FUNC(arm7500fe_iomd_device::vidcurb_w)); -// map(0x1e8, 0x1eb).rw(FUNC(arm7500fe_iomd_device::vidinitb_r), FUNC(arm7500fe_iomd_device::vidinitb_w)); +// map(0x1c8, 0x1cb).rw(FUNC(arm7500fe_iomd_device::vidcurb_r), FUNC(arm7500fe_iomd_device::vidcurb_w)); +// map(0x1e8, 0x1eb).rw(FUNC(arm7500fe_iomd_device::vidinitb_r), FUNC(arm7500fe_iomd_device::vidinitb_w)); } @@ -232,10 +232,10 @@ void arm_iomd_device::device_start() { for (devcb_read_line &cb : m_iocr_read_od_cb) cb.resolve_safe(1); - + for (devcb_write_line &cb : m_iocr_write_od_cb) cb.resolve_safe(); - + m_iocr_read_id_cb.resolve_safe(1); m_iocr_write_id_cb.resolve_safe(); @@ -249,16 +249,16 @@ void arm_iomd_device::device_start() save_item(NAME(m_cursinit)); save_pointer(NAME(m_irq_mask), IRQ_SOURCES_SIZE); save_pointer(NAME(m_irq_status), IRQ_SOURCES_SIZE); - + m_host_space = &m_host_cpu->space(AS_PROGRAM); - + m_timer[0] = timer_alloc(T0_TIMER); m_timer[1] = timer_alloc(T1_TIMER); save_pointer(NAME(m_timer_in), timer_ch_size); save_pointer(NAME(m_timer_out), timer_ch_size); save_pointer(NAME(m_timer_counter), timer_ch_size); save_pointer(NAME(m_timer_readinc), timer_ch_size); - + save_item(NAME(m_sndcur)); save_item(NAME(m_sndend)); save_item(NAME(m_sound_dma_on)); @@ -271,21 +271,21 @@ void arm_iomd_device::device_start() save_pointer(NAME(m_sndstop_reg), sounddma_ch_size); save_pointer(NAME(m_sndlast_reg), sounddma_ch_size); save_pointer(NAME(m_sndbuffer_ok), sounddma_ch_size); - + // TODO: jumps to EASI space at $0c0016xx for RiscPC if POR is on? } void arm7500fe_iomd_device::device_start() { arm_iomd_device::device_start(); - + m_iolines_read_cb.resolve_safe(0xff); m_iolines_write_cb.resolve_safe(); save_item(NAME(m_iolines_ddr)); save_item(NAME(m_cpuclk_divider)); save_item(NAME(m_memclk_divider)); - save_item(NAME(m_ioclk_divider)); + save_item(NAME(m_ioclk_divider)); } //------------------------------------------------- @@ -306,7 +306,7 @@ void arm_iomd_device::device_reset() m_irq_status[i] = 0; m_irq_mask[i] = 0; } - + for (i=0; i<timer_ch_size; i++) m_timer[i]->adjust(attotime::never); @@ -323,7 +323,7 @@ void arm7500fe_iomd_device::device_reset() m_cpuclk_divider = m_ioclk_divider = m_memclk_divider = false; refresh_host_cpu_clocks(); - + m_iolines_ddr = 0xff; } @@ -332,7 +332,7 @@ void arm_iomd_device::device_timer(emu_timer &timer, device_timer_id id, int par switch(id) { case T0_TIMER: - case T1_TIMER: + case T1_TIMER: trigger_irq<IRQA>(id == T1_TIMER ? 0x40 : 0x20); break; } @@ -350,7 +350,7 @@ READ32_MEMBER( arm_iomd_device::iocr_r ) res = m_iocr_read_id_cb() << 3; res|= m_iocr_read_od_cb[1]() << 1; res|= m_iocr_read_od_cb[0]() << 0; - + return (m_vidc->flyback_r() << 7) | 0x34 | (res & m_iocr_ddr); } @@ -375,7 +375,7 @@ READ32_MEMBER( arm_iomd_device::kbdcr_r ) { if (m_kbdc.found()) return m_kbdc->status_r(); - + logerror("%s attempted to read kbdcr with no controller\n", this->tag()); return 0xff; } @@ -398,7 +398,7 @@ WRITE32_MEMBER( arm_iomd_device::kbdcr_w ) m_kbdc->command_w(data & 0xff); return; } - + logerror("%s attempted to write %02x on kbdcr with no controller\n", this->tag(),data & 0xff); } @@ -498,12 +498,12 @@ inline void arm_iomd_device::trigger_timer(unsigned Which) { int timer_count = m_timer_counter[Which]; // TODO: it's actually a 2 MHz timer - int val = timer_count / 2; + int val = timer_count / 2; if(val==0) m_timer[Which]->adjust(attotime::never); else - m_timer[Which]->adjust(attotime::from_usec(val), 0, attotime::from_usec(val)); + m_timer[Which]->adjust(attotime::from_usec(val), 0, attotime::from_usec(val)); } // TODO: live updates aren't really supported here @@ -562,14 +562,14 @@ DECLARE_READ32_MEMBER( version_r ); template <unsigned Which> READ32_MEMBER( arm_iomd_device::sdcur_r ) { return m_sndcur_reg[Which]; } template <unsigned Which> WRITE32_MEMBER( arm_iomd_device::sdcur_w ) { COMBINE_DATA(&m_sndcur_reg[Which]); } -template <unsigned Which> READ32_MEMBER( arm_iomd_device::sdend_r ) +template <unsigned Which> READ32_MEMBER( arm_iomd_device::sdend_r ) { - return (m_sndstop_reg[Which] << 31) | (m_sndlast_reg[Which] << 30) | (m_sndend_reg[Which] & 0x00fffff0); + return (m_sndstop_reg[Which] << 31) | (m_sndlast_reg[Which] << 30) | (m_sndend_reg[Which] & 0x00fffff0); } -template <unsigned Which> WRITE32_MEMBER( arm_iomd_device::sdend_w ) -{ - COMBINE_DATA(&m_sndend_reg[Which]); +template <unsigned Which> WRITE32_MEMBER( arm_iomd_device::sdend_w ) +{ + COMBINE_DATA(&m_sndend_reg[Which]); m_sndend_reg[Which] &= 0x00fffff0; m_sndstop_reg[Which] = BIT(data, 31); m_sndlast_reg[Which] = BIT(data, 30); @@ -594,7 +594,7 @@ WRITE32_MEMBER( arm_iomd_device::sdcr_w ) { // ... } - + // TODO: bit 7 resets sound DMA } @@ -686,12 +686,12 @@ WRITE_LINE_MEMBER( arm_iomd_device::vblank_irq ) src++; src &= 0x1fffffff; } - + if (m_cursor_enable == true) { src = m_cursinit; size = m_vidc->get_cursor_size(); - + // TODO: same as above for (u32 m_curscur = 0; m_curscur<size; m_curscur++) { @@ -708,7 +708,7 @@ inline void arm_iomd_device::sounddma_swap_buffer() m_sndcur = m_sndcur_reg[m_sndcur_buffer]; m_sndend = m_sndcur + (m_sndend_reg[m_sndcur_buffer] + 0x10); m_sndbuffer_ok[m_sndcur_buffer] = true; - + // TODO: actual condition for int m_snd_overrun = false; m_snd_int = false; @@ -718,14 +718,14 @@ WRITE_LINE_MEMBER( arm_iomd_device::sound_drq ) { if (!state) return; - + if (m_vidc->get_dac_mode() == true) { for (int ch=0;ch<2;ch++) m_vidc->write_dac32(ch, (m_host_space->read_word(m_sndcur + ch*2))); - + m_sndcur += 4; - + if (m_sndcur >= m_sndend) { // TODO: interrupt bit diff --git a/src/devices/machine/arm_iomd.h b/src/devices/machine/arm_iomd.h index c996a88b3dd..668c55d284c 100644 --- a/src/devices/machine/arm_iomd.h +++ b/src/devices/machine/arm_iomd.h @@ -2,7 +2,7 @@ // copyright-holders:Angelo Salese /*************************************************************************** - ARM IOMD device emulation + ARM IOMD device emulation ***************************************************************************/ @@ -63,11 +63,11 @@ protected: virtual void device_start() override; virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - + void base_map(address_map &map); u16 m_id; u8 m_version; - + enum { IRQA = 0, IRQB, @@ -97,12 +97,12 @@ private: DECLARE_READ32_MEMBER( iocr_r ); DECLARE_WRITE32_MEMBER( iocr_w ); - + DECLARE_READ32_MEMBER( kbddat_r ); DECLARE_WRITE32_MEMBER( kbddat_w ); DECLARE_READ32_MEMBER( kbdcr_r ); DECLARE_WRITE32_MEMBER( kbdcr_w ); - + u32 m_vidinita, m_vidend; bool m_vidlast, m_videqual; bool m_video_enable; @@ -116,7 +116,7 @@ private: bool m_cursor_enable; DECLARE_READ32_MEMBER( cursinit_r ); DECLARE_WRITE32_MEMBER( cursinit_w ); - + static constexpr int sounddma_ch_size = 2; u32 m_sndcur, m_sndend; u32 m_sndcur_reg[sounddma_ch_size], m_sndend_reg[sounddma_ch_size]; @@ -148,22 +148,22 @@ private: u16 m_timer_in[2]; u16 m_timer_out[2]; int m_timer_counter[2]; - u8 m_timer_readinc[2]; + u8 m_timer_readinc[2]; emu_timer *m_timer[2]; - + template <unsigned Which> DECLARE_READ32_MEMBER( tNlow_r ); template <unsigned Which> DECLARE_READ32_MEMBER( tNhigh_r ); template <unsigned Which> DECLARE_WRITE32_MEMBER( tNlow_w ); template <unsigned Which> DECLARE_WRITE32_MEMBER( tNhigh_w ); template <unsigned Which> DECLARE_WRITE32_MEMBER( tNgo_w ); template <unsigned Which> DECLARE_WRITE32_MEMBER( tNlatch_w ); - + template <unsigned Nibble> DECLARE_READ32_MEMBER( id_r ); DECLARE_READ32_MEMBER( version_r ); - + // used in vidcr_r / sndcr_r, documentation hints this is a purged idea during chip development, to be checked out static constexpr u8 dmaid_size = 0x10; // qword transfer -// constexpr u8 dmaid_mask = 0x1f; +// constexpr u8 dmaid_mask = 0x1f; }; class arm7500fe_iomd_device : public arm_iomd_device @@ -188,11 +188,11 @@ private: inline void refresh_host_cpu_clocks(); DECLARE_READ32_MEMBER( clkctl_r ); DECLARE_WRITE32_MEMBER( clkctl_w ); - + u8 m_iolines_ddr; DECLARE_READ32_MEMBER( iolines_r ); DECLARE_WRITE32_MEMBER( iolines_w ); - + DECLARE_READ32_MEMBER( msecr_r ); DECLARE_WRITE32_MEMBER( msecr_w ); }; diff --git a/src/devices/machine/ataflash.h b/src/devices/machine/ataflash.h index 9bd5581f0e9..6bf9ce3242b 100644 --- a/src/devices/machine/ataflash.h +++ b/src/devices/machine/ataflash.h @@ -27,6 +27,7 @@ protected: virtual void device_reset() override; virtual attotime seek_time() override; + uint8_t calculate_status() override { return ata_hle_device::calculate_status(); }; private: uint8_t m_cis[512]; diff --git a/src/devices/machine/ay31015.cpp b/src/devices/machine/ay31015.cpp index 6ab1103b28a..e4dc2344e28 100644 --- a/src/devices/machine/ay31015.cpp +++ b/src/devices/machine/ay31015.cpp @@ -336,7 +336,9 @@ void ay31015_device::rx_process() if (m_rx_pulses == 8) // sample input stream { - m_rx_parity ^= get_si(); // calculate cumulative parity + m_internal_sample = get_si(); + m_rx_parity ^= m_internal_sample; // calculate cumulative parity + LOG("Receive parity bit: %d\n", m_internal_sample); } else if (!m_rx_pulses) // end of a byte @@ -350,7 +352,10 @@ void ay31015_device::rx_process() if ((m_control_reg & CONTROL_EPS) && (!m_rx_parity)) m_rx_parity = 0; // even parity, ok else + { m_rx_parity = 1; // parity error + LOG("Parity error\n"); + } } return; @@ -478,7 +483,7 @@ void ay31015_device::tx_process() } else set_so(0); - LOG("Transmit data bit #%d: %d\n", 9 - (m_tx_pulses >> 4), m_tx_data & 1); + LOG("Transmit data bit #%d: %d\n", 1 + ((m_total_pulses - m_tx_pulses) >> 4), m_tx_data & 1); m_tx_data >>= 1; // adjust the shift register } @@ -524,25 +529,26 @@ void ay31015_device::tx_process() m_tx_pulses--; if (!m_tx_pulses) { - m_status_reg |= STATUS_EOC; // character is completely sent if (m_second_stop_bit) { m_tx_state = SECOND_STOP_BIT; m_tx_pulses = m_second_stop_bit; - LOG("Transmit second stop bit\n"); - } - else - if (m_status_reg & STATUS_TBMT) - { - m_tx_state = IDLE; // if nothing to send, go idle - LOG("Transmitter idle\n"); } else { - m_tx_pulses = 16; - m_tx_state = START_BIT; // otherwise immediately start next byte + m_status_reg |= STATUS_EOC; // character is completely sent + if (m_status_reg & STATUS_TBMT) + { + m_tx_state = IDLE; // if nothing to send, go idle + LOG("Transmitter idle\n"); + } + else + { + m_tx_pulses = 16; + m_tx_state = START_BIT; // otherwise immediately start next byte + } + update_status_pins(); } - update_status_pins(); } return; @@ -552,6 +558,7 @@ void ay31015_device::tx_process() m_tx_pulses--; if (!m_tx_pulses) { + m_status_reg |= STATUS_EOC; // character is completely sent if (m_status_reg & STATUS_TBMT) { m_tx_state = IDLE; // if nothing to send, go idle @@ -562,6 +569,7 @@ void ay31015_device::tx_process() m_tx_pulses = 16; m_tx_state = START_BIT; // otherwise immediately start next byte } + update_status_pins(); } return; diff --git a/src/devices/machine/corvushd.h b/src/devices/machine/corvushd.h index b7b9bc4e946..868d98678fb 100644 --- a/src/devices/machine/corvushd.h +++ b/src/devices/machine/corvushd.h @@ -18,7 +18,7 @@ #pragma once #include "imagedev/harddriv.h" -#include <ctype.h> +#include <cctype> class corvus_hdc_device : public device_t { diff --git a/src/devices/machine/diablo_hd.cpp b/src/devices/machine/diablo_hd.cpp index 36c57cbd0d7..938173a945b 100644 --- a/src/devices/machine/diablo_hd.cpp +++ b/src/devices/machine/diablo_hd.cpp @@ -93,7 +93,7 @@ diablo_hd_device::diablo_hd_device(const machine_config &mconfig, const char *ta m_head(-1), m_sector(-1), m_page(-1), - m_bits(nullptr), + m_bits(), m_rdfirst(-1), m_rdlast(-1), m_wrfirst(-1), @@ -434,7 +434,7 @@ uint32_t* diablo_hd_device::expand_sector() return nullptr; /* already expanded this sector? */ if (m_bits[m_page]) - return m_bits[m_page]; + return m_bits[m_page].get(); /* allocate a sector buffer */ if (!m_cache[m_page]) { @@ -444,7 +444,8 @@ uint32_t* diablo_hd_device::expand_sector() diablo_sector_t *s = reinterpret_cast<diablo_sector_t *>(m_cache[m_page].get()); /* allocate a bits image */ - uint32_t *bits = auto_alloc_array_clear(machine(), uint32_t, 400); + m_bits[m_page] = make_unique_clear<uint32_t[]>(400); + uint32_t* bits = m_bits[m_page].get(); if (m_diablo31) { /* write sync bit after (MFROBL-MRPAL) words - 1 bit */ @@ -483,7 +484,6 @@ uint32_t* diablo_hd_device::expand_sector() /* fill MWPAL words of clock and 0 data bits */ dst = expand_zeroes(bits, dst, MWPAL); } - m_bits[m_page] = bits; LOG_DRIVE(0,"[DHD%u] CHS:%03d/%d/%02d #%5d bits\n", m_unit, m_cylinder, m_head, m_sector, dst); if (DIABLO_DEBUG) @@ -722,7 +722,7 @@ void diablo_hd_device::squeeze_sector() LOG_DRIVE(0,"[DHD%u] no bits\n", m_unit); return; } - uint32_t *bits = m_bits[m_page]; + uint32_t *bits = m_bits[m_page].get(); // pointer to sector buffer s = reinterpret_cast<diablo_sector_t *>(m_cache[m_page].get()); @@ -767,8 +767,7 @@ void diablo_hd_device::squeeze_sector() if (cksum_header || cksum_label || cksum_data) { LOG_DRIVE(0,"[DHD%u] cksum check - header:%06o label:%06o data:%06o\n", m_unit, cksum_header, cksum_label, cksum_data); } - auto_free(machine(), m_bits[m_page]); - m_bits[m_page] = nullptr; + m_bits[m_page].reset(); if (m_disk) { if (!hard_disk_write(m_disk, m_page, m_cache[m_page].get())) { @@ -1328,13 +1327,7 @@ void diablo_hd_device::device_reset() if (m_cache[page]) m_cache[page] = nullptr; // free previous bits cache - if (m_bits) { - for (int page = 0; page < m_pages; page++) - if (m_bits[page]) - auto_free(machine(), m_bits[page]); - auto_free(machine(), m_bits); - m_bits = nullptr; - } + m_bits.reset(); m_handle = m_image->get_chd_file(); m_diablo31 = true; // FIXME: get from m_handle meta data? m_disk = m_image->get_hard_disk_file(); @@ -1395,7 +1388,7 @@ void diablo_hd_device::device_reset() if (!m_handle) return; // for units with a CHD assigned to them start the timer - m_bits = auto_alloc_array_clear(machine(), uint32_t*, m_pages); + m_bits = std::make_unique<std::unique_ptr<uint32_t[]>[]>(m_pages); timer_set(m_sector_time - m_sector_mark_0_time, 1, 0); read_sector(); } diff --git a/src/devices/machine/diablo_hd.h b/src/devices/machine/diablo_hd.h index 93915e628e3..ea96d2c4c70 100644 --- a/src/devices/machine/diablo_hd.h +++ b/src/devices/machine/diablo_hd.h @@ -101,7 +101,7 @@ private: int m_sector; //!< current sector number in track int m_page; //!< current page (derived from cylinder, head and sector) std::unique_ptr<uint8_t[]> m_cache[2 * DIABLO_PAGES]; //!< pages raw bytes - uint32_t** m_bits; //!< pages expanded to bits + std::unique_ptr<std::unique_ptr<uint32_t[]>[]> m_bits; //!< pages expanded to bits int m_rdfirst; //!< set to first bit of a sector that is read from int m_rdlast; //!< set to last bit of a sector that was read from int m_wrfirst; //!< set to non-zero if a sector is written to diff --git a/src/devices/machine/dp83932c.cpp b/src/devices/machine/dp83932c.cpp index 82d70f02797..c08a16b655c 100644 --- a/src/devices/machine/dp83932c.cpp +++ b/src/devices/machine/dp83932c.cpp @@ -10,118 +10,565 @@ * http://bitsavers.org/components/national/_dataBooks/1995_National_Ethernet_Databook.pdf * * TODO - * - everything (skeleton only) + * - bus mode (big endian, interrupts active low) + * - byte count mismatch + * - data widths + * - tally counters + * - software reset + * - watchdog timers + * - loopback modes + * - programmable outputs and extended bus mode */ #include "emu.h" #include "dp83932c.h" #include "hashing.h" -#define VERBOSE 0 +#define LOG_GENERAL (1U << 0) +#define LOG_COMMAND (1U << 1) +#define LOG_FILTER (1U << 2) +#define LOG_PACKETS (1U << 3) + +//#define VERBOSE (LOG_GENERAL|LOG_COMMAND|LOG_FILTER|LOG_PACKETS) #include "logmacro.h" +#define EA(hi, lo) ((u32(hi) << 16) | lo) + DEFINE_DEVICE_TYPE(DP83932C, dp83932c_device, "dp83932c", "National Semiconductor DP83932C SONIC") -dp83932c_device::dp83932c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +static constexpr u32 FCS_RESIDUE = 0xdebb20e3; + +static char const *const regname[] = +{ + "CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA", + "TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0", + "CRBA1", "RBWC0", "RBWC1", "EOBC", "URRA", "RSA", "REA", "RRP", + "RWP", "TRBA0", "TRBA1", "TBWC0", "TBWC1", "ADDR0", "ADDR1", "LLFA", + + "TTDA", "CEP", "CAP2", "CAP1", "CAP0", "CE", "CDP", "CDC", + "SR", "WT0", "WT1", "RSC", "CRCT", "FAET", "MPT", "MDT", + "30", "31", "32", "33", "34", "35", "36", "37", + "38", "39", "3a", "3b", "3c", "3d", "3e", "DCR2", +}; + +static u16 const regmask[] = +{ + 0x03bf, 0xbfff, 0xfe00, 0xf000, 0x7fff, 0x7fff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xfffe, 0xfffe, + 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + + 0xffff, 0x000f, 0x0000, 0x0000, 0x0000, 0xffff, 0xfffe, 0x001f, + 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xf017, +}; + +dp83932c_device::dp83932c_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, DP83932C, tag, owner, clock) , device_network_interface(mconfig, *this, 10.0f) - , m_ram(*this, finder_base::DUMMY_TAG) + , m_bus(*this, finder_base::DUMMY_TAG, 0) , m_out_int(*this) + , m_int_state(false) { } void dp83932c_device::map(address_map &map) { - // datasheet uses unshifted register addresses - int const shift = 1; - - // command and status registers - map(0x00 << shift, (0x00 << shift) | 0x01).rw(FUNC(dp83932c_device::cr_r), FUNC(dp83932c_device::cr_w)); - //map(0x01 << shift, (0x01 << shift) | 0x01).rw(FUNC(dp83932c_device::dcr_r), FUNC(dp83932c_device::dcr_w)); - //map(0x02 << shift, (0x02 << shift) | 0x01).rw(FUNC(dp83932c_device::rcr_r), FUNC(dp83932c_device::rcr_w)); - map(0x03 << shift, (0x03 << shift) | 0x01).rw(FUNC(dp83932c_device::tcr_r), FUNC(dp83932c_device::tcr_w)); - //map(0x04 << shift, (0x04 << shift) | 0x01).rw(FUNC(dp83932c_device::imr_r), FUNC(dp83932c_device::imr_w)); - map(0x05 << shift, (0x05 << shift) | 0x01).rw(FUNC(dp83932c_device::isr_r), FUNC(dp83932c_device::isr_w)); - - // transmit registers - map(0x06 << shift, (0x06 << shift) | 0x01).rw(FUNC(dp83932c_device::utda_r), FUNC(dp83932c_device::utda_w)); - //map(0x07 << shift, (0x07 << shift) | 0x01).rw(FUNC(dp83932c_device::ctda_r), FUNC(dp83932c_device::ctda_w)); - - // tps - // tfc - // tsa0 - // tsa1 - // tfs - - // receive registers - //map(0x0d << shift, (0x0d << shift) | 0x01).rw(FUNC(dp83932c_device::urda_r), FUNC(dp83932c_device::urda_w)); - map(0x0e << shift, (0x0e << shift) | 0x01).rw(FUNC(dp83932c_device::crda_r), FUNC(dp83932c_device::crda_w)); - - // crba0 - // crba1 - // rbwc0 - // rbwc1 - // eobc - // urra - // rsa - // rea - map(0x17 << shift, (0x17 << shift) | 0x01).rw(FUNC(dp83932c_device::rrp_r), FUNC(dp83932c_device::rrp_w)); - map(0x18 << shift, (0x18 << shift) | 0x01).rw(FUNC(dp83932c_device::rwp_r), FUNC(dp83932c_device::rwp_w)); - // trba0 - // trba1 - // tbwc0 - // tbwc1 - // addr0 - // addr1 - // llfa - // ttda - // cep - // cap2 - // cap1 - // cap0 - map(0x25 << shift, (0x25 << shift) | 0x01).rw(FUNC(dp83932c_device::ce_r), FUNC(dp83932c_device::ce_w)); - // cdp - // cdc - // sr - map(0x29 << shift, (0x29 << shift) | 0x01).rw(FUNC(dp83932c_device::wt0_r), FUNC(dp83932c_device::wt0_w)); - map(0x2a << shift, (0x2a << shift) | 0x01).rw(FUNC(dp83932c_device::wt1_r), FUNC(dp83932c_device::wt1_w)); - map(0x2b << shift, (0x2b << shift) | 0x01).rw(FUNC(dp83932c_device::rsc_r), FUNC(dp83932c_device::rsc_w)); - // crct - map(0x2d << shift, (0x2d << shift) | 0x01).rw(FUNC(dp83932c_device::faet_r), FUNC(dp83932c_device::faet_w)); - // mpt - // mdt - - // 30-3e internal use registers - // dcr2 + map(0x00, 0x7f).rw(FUNC(dp83932c_device::reg_r), FUNC(dp83932c_device::reg_w)); } void dp83932c_device::device_start() { m_out_int.resolve(); + + m_command = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dp83932c_device::command), this)); + + save_item(NAME(m_int_state)); + save_item(NAME(m_reg)); + save_item(NAME(m_cam)); + + for (u16 ® : m_reg) + reg = 0; + + m_reg[SR] = 6; // silicon revision for DP83932CVF } void dp83932c_device::device_reset() { - m_cr = RST | STP | RXDIS; - m_tcr = NCRS | PTX; - m_isr = 0; - m_ce = 0; - m_rsc = 0; + m_reg[CR] = CR_RST | CR_STP | CR_RXDIS; + m_reg[DCR] &= ~(DCR_EXBUS | DCR_LBR); // TODO: sample USR1,0 + m_reg[RCR] &= ~(RCR_RNT | RCR_BRD | RCR_LB); + m_reg[TCR] |= TCR_NCRS | TCR_PTX; + m_reg[TCR] &= ~(TCR_TPC | TCR_BCM); + m_reg[IMR] = 0; + m_reg[ISR] = 0; + m_reg[EOBC] = 0x02f8; + m_reg[CE] = 0; + m_reg[RSC] = 0; + m_reg[DCR2] = 0; + + update_interrupts(); } -void dp83932c_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +int dp83932c_device::recv_start_cb(u8 *buf, int length) { + unsigned const width = (m_reg[DCR] & DCR_DW) ? 4 : 2; + + if (!(m_reg[CR] & CR_RXEN)) + return -1; + + m_reg[RCR] &= ~(RCR_MC | RCR_BC | RCR_LPKT | RCR_CRCR | RCR_FAER | RCR_LBK | RCR_PRX); + + // address filter + if (!address_filter(buf)) + return -1; + + if ((length < 64) && !(m_reg[RCR] & RCR_RNT)) + return -1; + + u32 const fcs = util::crc32_creator::simple(buf, length); + if (~fcs != FCS_RESIDUE) + { + if (m_reg[RCR] & RCR_ERR) + m_reg[RCR] |= RCR_CRCR; + else + return -1; + } + else + m_reg[RCR] |= RCR_PRX; + + LOG("recv_start_cb %d\n", length); + + // loopback + if (m_reg[RCR] & RCR_LB) + m_reg[RCR] |= RCR_LBK; + + dump_bytes(buf, length); + + if (m_reg[CRDA] & 1) + { + // re-read the previous descriptor link field + m_reg[CRDA] = m_bus->read_word(EA(m_reg[URDA], m_reg[LLFA])); + if (m_reg[CRDA] & 1) + { + logerror("no receive descriptor available\n"); + return -2; + } + } + + // save rba pointer registers + m_reg[TRBA0] = m_reg[CRBA0]; + m_reg[TRBA1] = m_reg[CRBA1]; + m_reg[TBWC0] = m_reg[RBWC0]; + m_reg[TBWC1] = m_reg[RBWC1]; + + // store data to rba + // TODO: word/dword transfers (allow unaligned) + // TODO: pad to word/dword size with 0xff + // TODO: check for buffer overflow + offs_t const rba = EA(m_reg[CRBA1], m_reg[CRBA0]); + for (unsigned i = 0; i < length; i++) + m_bus->write_byte(rba + i, buf[i]); + + // update remaining buffer word count + u32 const rbwc = ((u32(m_reg[RBWC1]) << 16) | m_reg[RBWC0]) - (length + 1) / 2; + m_reg[RBWC1] = rbwc >> 16; + m_reg[RBWC0] = u16(rbwc); + + if (rbwc < m_reg[EOBC]) + m_reg[RCR] |= RCR_LPKT; + + // write status to rda + // TODO: don't write the rda if rba limit exceeded (buffer overflow) + offs_t const rda = EA(m_reg[URDA], m_reg[CRDA]); + m_bus->write_word(rda + 0 * width, m_reg[RCR]); + m_bus->write_word(rda + 1 * width, length); + m_bus->write_word(rda + 2 * width, m_reg[CRBA0]); + m_bus->write_word(rda + 3 * width, m_reg[CRBA1]); + m_bus->write_word(rda + 4 * width, m_reg[RSC]); + m_reg[LLFA] = m_reg[CRDA] + 5 * width; + m_reg[CRDA] = m_bus->read_word(rda + 5 * width); + + // check for end of list + if (m_reg[CRDA] & 1) + m_reg[ISR] |= ISR_RDE; + else + m_bus->write_word(rda + 6 * width, 0); + + // handle buffer exhaustion + if (rbwc < m_reg[EOBC]) + read_rra(); + else + m_reg[RSC] = (m_reg[RSC] & 0xff00) | u8(m_reg[RSC] + 1); + + return length; +} + +void dp83932c_device::recv_complete_cb(int result) +{ + if (result > 0) + { + m_reg[ISR] |= ISR_PKTRX; + update_interrupts(); + } +} + +void dp83932c_device::reg_w(offs_t offset, u16 data) +{ + LOG("reg_w register %s data 0x%04x (%s)\n", regname[offset], data, machine().describe_context()); + + // TODO: can only write during reset: DCR, DCR2 + + switch (offset) + { + case CR: + if (m_reg[CR] & CR_RST) + { + if (!(data & CR_RST)) + { + LOGMASKED(LOG_COMMAND, "exit software reset\n"); + + m_reg[CR] &= ~CR_RST; + } + + return; + } + + if (data & CR_RST) + { + LOGMASKED(LOG_COMMAND, "enter software reset\n"); + + m_command->adjust(attotime::never); + + m_reg[CR] &= ~(CR_LCAM | CR_RRRA | CR_TXP | CR_HTX); + m_reg[CR] |= (CR_RST | CR_RXDIS); + + return; + } + + m_reg[offset] |= data & regmask[offset]; + m_command->adjust(attotime::zero, data & regmask[offset]); + break; + + case RCR: + m_reg[offset] = (m_reg[offset] & ~regmask[offset]) | (data & regmask[offset]); + set_loopback(bool(m_reg[offset] & RCR_LB)); + break; + + case IMR: + m_reg[offset] = (m_reg[offset] & ~regmask[offset]) | (data & regmask[offset]); + update_interrupts(); + break; + + case ISR: + m_reg[offset] &= ~(data & regmask[offset]); + // TODO: reload rra after RBE cleared + update_interrupts(); + break; + + case CRCT: + case FAET: + case MPT: + // inverted + m_reg[offset] = ~data; + break; + + default: + if (regmask[offset]) + m_reg[offset] = (m_reg[offset] & ~regmask[offset]) | (data & regmask[offset]); + else + logerror("write to read-only register %s data 0x%04x (%s)\n", + regname[offset], data, machine().describe_context()); + break; + } +} + +void dp83932c_device::command(void *ptr, s32 param) +{ + if (param & CR_HTX) + { + LOGMASKED(LOG_COMMAND, "halt transmission\n"); + m_reg[CR] &= ~CR_TXP; + } + + if (param & CR_TXP) + { + LOGMASKED(LOG_COMMAND, "transmit\n"); + m_reg[CR] &= ~CR_HTX; + + transmit(); + } + + if (param & CR_RXDIS) + { + LOGMASKED(LOG_COMMAND, "receiver disable\n"); + m_reg[CR] &= ~CR_RXEN; + } + + if (param & CR_RXEN) + { + LOGMASKED(LOG_COMMAND, "receiver enable\n"); + m_reg[CR] &= ~CR_RXDIS; + } + + if (param & CR_STP) + { + LOGMASKED(LOG_COMMAND, "stop timer\n"); + m_reg[CR] &= ~CR_ST; + } + + if (param & CR_ST) + { + LOGMASKED(LOG_COMMAND, "start timer\n"); + m_reg[CR] &= ~CR_STP; + } + + if (param & CR_RRRA) + { + LOGMASKED(LOG_COMMAND, "read rra\n"); + read_rra(true); + } + + if (param & CR_LCAM) + { + LOGMASKED(LOG_COMMAND, "load cam\n"); + load_cam(); + } + + update_interrupts(); +} + +void dp83932c_device::transmit() +{ + unsigned const width = (m_reg[DCR] & DCR_DW) ? 4 : 2; + + m_reg[TTDA] = m_reg[CTDA]; + offs_t const tda = EA(m_reg[UTDA], m_reg[CTDA]); + unsigned word = 1; + + // read control information from tda and load registers + u16 const tcr = m_reg[TCR]; + m_reg[TCR] = m_bus->read_word(tda + word++ * width) & TCR_TPC; + m_reg[TPS] = m_bus->read_word(tda + word++ * width); + m_reg[TFC] = m_bus->read_word(tda + word++ * width); + + // check for programmable interrupt + if ((m_reg[TCR] & TCR_PINT) && !(tcr & TCR_PINT)) + m_reg[ISR] |= ISR_PINT; + + // FIXME: abort if tps > buffer size + u8 buf[1520]; + unsigned length = 0; + + // read fragments into buffer + for (unsigned fragment = 0; fragment < m_reg[TFC]; fragment++) + { + // read fragment address and size + m_reg[TSA0] = m_bus->read_word(tda + word++ * width); + m_reg[TSA1] = m_bus->read_word(tda + word++ * width); + m_reg[TFS] = m_bus->read_word(tda + word++ * width); + + offs_t const tsa = EA(m_reg[TSA1], m_reg[TSA0]); + + // FIXME: word/dword transfers (allow unaligned) + for (unsigned byte = 0; byte < m_reg[TFS]; byte++) + buf[length++] = m_bus->read_byte(tsa + byte); + } + + // append fcs if not inhibited + if (!(m_reg[TCR] & TCR_CRCI)) + { + u32 const crc = util::crc32_creator::simple(buf, length); + + // insert the fcs + buf[length++] = crc >> 0; + buf[length++] = crc >> 8; + buf[length++] = crc >> 16; + buf[length++] = crc >> 24; + } + + // advance ctda to the link field + m_reg[CTDA] += word * width; + + // transmit data + dump_bytes(buf, length); + send(buf, length); } void dp83932c_device::send_complete_cb(int result) { + // TODO: errors + if (result > 0) + { + // TODO: number of collisions + + m_reg[TCR] |= TCR_PTX; + } + + // write descriptor status + m_bus->write_word(EA(m_reg[UTDA], m_reg[TTDA]), m_reg[TCR] & TCR_TPS); + + // check for halt + if (!(m_reg[CR] & CR_HTX)) + { + // load next descriptor address + m_reg[CTDA] = m_bus->read_word(EA(m_reg[UTDA], m_reg[CTDA])); + + // check for end of list + if (m_reg[CTDA] & 1) + { + m_reg[ISR] |= ISR_TXDN; + m_reg[CR] &= ~CR_TXP; + + update_interrupts(); + } + else + // transmit next packet + if (m_command->enabled()) + m_command->set_param(m_command->param() | CR_TXP); + else + m_command->adjust(attotime::zero, CR_TXP); + } + else + m_reg[CR] &= ~CR_TXP; } -int dp83932c_device::recv_start_cb(u8 *buf, int length) +void dp83932c_device::read_rra(bool command) +{ + unsigned const width = (m_reg[DCR] & DCR_DW) ? 4 : 2; + + offs_t const rrp = EA(m_reg[URRA], m_reg[RRP]); + + m_reg[CRBA0] = m_bus->read_word(rrp + 0 * width); + m_reg[CRBA1] = m_bus->read_word(rrp + 1 * width); + m_reg[RBWC0] = m_bus->read_word(rrp + 2 * width); + m_reg[RBWC1] = m_bus->read_word(rrp + 3 * width); + + LOG("read_rra crba 0x%08x rbwc 0x%08x\n", + EA(m_reg[CRBA1], m_reg[CRBA0]), EA(m_reg[RBWC1], m_reg[RBWC0])); + + // advance rrp + m_reg[RRP] += 4 * width; + + // check for wrapping and resource exhaustion + if (m_reg[RRP] == m_reg[REA]) + m_reg[RRP] = m_reg[RSA]; + + if (m_reg[RRP] == m_reg[RWP]) + m_reg[ISR] |= ISR_RBE; + + if (command) + m_reg[CR] &= ~CR_RRRA; + else + m_reg[RSC] = (m_reg[RSC] & 0xff00) + 0x100; +} + +void dp83932c_device::load_cam() { - return 0; + unsigned const width = (m_reg[DCR] & DCR_DW) ? 4 : 2; + + while (m_reg[CDC]) + { + offs_t const cdp = EA(m_reg[URRA], m_reg[CDP]); + + u16 const cep = m_bus->read_word(cdp + 0 * width) & 0xf; + u16 const cap0 = m_bus->read_word(cdp + 1 * width); + u16 const cap1 = m_bus->read_word(cdp + 2 * width); + u16 const cap2 = m_bus->read_word(cdp + 3 * width); + + // FIXME: documented byte/word order doesn't match emulation + + LOG("load_cam entry %2d %02x:%02x:%02x:%02x:%02x:%02x\n", + cep, u8(cap0), cap0 >> 8, u8(cap1), cap1 >> 8, u8(cap2), cap2 >> 8); + + m_cam[cep] = + (u64(u8(cap0 >> 0)) << 40) | (u64(u8(cap0 >> 8)) << 32) | (u64(u8(cap1 >> 0)) << 24) | + (u64(u8(cap1 >> 8)) << 16) | (u64(u8(cap2 >> 0)) << 8) | (u64(u8(cap2 >> 8)) << 0); + + m_reg[CDP] += 4 * width; + m_reg[CDC]--; + } + + // read cam enable + m_reg[CE] = m_bus->read_word(EA(m_reg[URRA], m_reg[CDP])); + LOG("load_cam enable 0x%04x\n", m_reg[CE]); + + m_reg[CR] &= ~CR_LCAM; + m_reg[ISR] |= ISR_LCD; } -void dp83932c_device::recv_complete_cb(int result) +void dp83932c_device::update_interrupts() +{ + bool const int_state = bool(m_reg[ISR] & m_reg[IMR]); + + if (int_state != m_int_state) + { + m_int_state = int_state; + m_out_int(m_int_state); + } +} + +bool dp83932c_device::address_filter(u8 *buf) { + if (m_reg[RCR] & RCR_PRO) + { + LOGMASKED(LOG_FILTER, "address_filter accepted (promiscuous)\n"); + + return true; + } + + u64 const address = + (u64(buf[0]) << 40) | (u64(buf[1]) << 32) | (u64(buf[2]) << 24) | + (u64(buf[3]) << 16) | (u64(buf[4]) << 8) | (u64(buf[5]) << 0); + + // broadcast + if ((address == 0xffff'ffffffffULL) && (m_reg[RCR] & (RCR_AMC | RCR_BRD))) + { + LOGMASKED(LOG_FILTER, "address_filter accepted (broadcast) %02x-%02x-%02x-%02x-%02x-%02x\n", + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); + + m_reg[RCR] |= RCR_BC; + return true; + } + + // multicast + if ((address & 0x0100'00000000ULL) && (m_reg[RCR] & RCR_AMC)) + { + LOGMASKED(LOG_FILTER, "address_filter accepted (multicast) %02x-%02x-%02x-%02x-%02x-%02x\n", + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); + + m_reg[RCR] |= RCR_MC; + return true; + } + + // content addressable memory + for (unsigned i = 0; i < 16; i++) + { + if ((address == m_cam[i]) && BIT(m_reg[CE], i)) + { + LOGMASKED(LOG_FILTER, "address_filter accepted (cam entry %d match) %02x-%02x-%02x-%02x-%02x-%02x\n", + i, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); + + return true; + } + } + + return false; +} + +void dp83932c_device::dump_bytes(u8 *buf, int length) +{ + if (VERBOSE & LOG_PACKETS) + { + // pad with zeros to 8-byte boundary + for (int i = 0; i < 8 - (length % 8); i++) + buf[length + i] = 0; + + // dump length / 8 (rounded up) groups of 8 bytes + for (int i = 0; i < (length + 7) / 8; i++) + LOGMASKED(LOG_PACKETS, "%02x %02x %02x %02x %02x %02x %02x %02x\n", + buf[i * 8 + 0], buf[i * 8 + 1], buf[i * 8 + 2], buf[i * 8 + 3], + buf[i * 8 + 4], buf[i * 8 + 5], buf[i * 8 + 6], buf[i * 8 + 7]); + } } diff --git a/src/devices/machine/dp83932c.h b/src/devices/machine/dp83932c.h index e608f7508a6..054bb9e28cd 100644 --- a/src/devices/machine/dp83932c.h +++ b/src/devices/machine/dp83932c.h @@ -6,111 +6,207 @@ #pragma once -#include "machine/ram.h" - class dp83932c_device : public device_t , public device_network_interface { public: - dp83932c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static constexpr feature_type imperfect_features() { return feature::LAN; } + dp83932c_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); // configuration - template <typename T> void set_ram(T &&tag) { m_ram.set_tag(std::forward<T>(tag)); } + template <typename T> void set_bus(T &&tag, int spacenum) { m_bus.set_tag(std::forward<T>(tag), spacenum); } auto out_int_cb() { return m_out_int.bind(); } + // external interface void map(address_map &map); + u16 reg_r(offs_t offset) { return m_reg[offset]; } + void reg_w(offs_t offset, u16 data); protected: // device_t overrides virtual void device_start() override; virtual void device_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_network_interface overrides virtual void send_complete_cb(int result) override; virtual int recv_start_cb(u8 *buf, int length) override; virtual void recv_complete_cb(int result) override; - enum cr_mask : u16 + // command helpers + void command(void *ptr, s32 param); + void transmit(); + void read_rra(bool command = false); + void load_cam(); + void update_interrupts(); + bool address_filter(u8 *buf); + + // diagnostic helper + void dump_bytes(u8 *buf, int length); + + enum registers : unsigned { - HTX = 0x0001, // halt transmission - TXP = 0x0002, // transmit packets - RXDIS = 0x0004, // receiver disable - RXEN = 0x0008, // receiver enable - STP = 0x0010, // stop timer - ST = 0x0020, // start timer - RST = 0x0080, // software reset - RRRA = 0x0100, // read rra - LCAM = 0x0200, // load cam - - CR_WMASK = 0x03bf + CR = 0x00, // command + DCR = 0x01, // data configuration + RCR = 0x02, // receive control + TCR = 0x03, // transmit control + IMR = 0x04, // interrupt mask + ISR = 0x05, // interrupt status + UTDA = 0x06, // upper transmit descriptor address + CTDA = 0x07, // current transmit descriptor address + TPS = 0x08, // transmit packet size + TFC = 0x09, // transmit fragment count + TSA0 = 0x0a, // transmit start address 0 + TSA1 = 0x0b, // transmit start address 1 + TFS = 0x0c, // transmit fragment size + URDA = 0x0d, // upper receive descriptor address + CRDA = 0x0e, // current receive descriptor address + CRBA0 = 0x0f, // current receive buffer address 0 + CRBA1 = 0x10, // current receive buffer address 1 + RBWC0 = 0x11, // remaining buffer word count 0 + RBWC1 = 0x12, // remaining buffer word count 1 + EOBC = 0x13, // end of buffer word count + URRA = 0x14, // upper receive resource address + RSA = 0x15, // resource start address + REA = 0x16, // resource end address + RRP = 0x17, // resource read pointer + RWP = 0x18, // resource write pointer + TRBA0 = 0x19, // temporary receive buffer address 0 + TRBA1 = 0x1a, // temporary receive buffer address 1 + TBWC0 = 0x1b, // temporary buffer word count 0 + TBWC1 = 0x1c, // temporary buffer word count 1 + ADDR0 = 0x1d, // address generator 0 + ADDR1 = 0x1e, // address generator 1 + LLFA = 0x1f, // last link field address + TTDA = 0x20, // temporary transmit descriptor address + CEP = 0x21, // cam entry pointer + CAP2 = 0x22, // cam address port 2 + CAP1 = 0x23, // cam address port 1 + CAP0 = 0x24, // cam address port 0 + CE = 0x25, // cam enable + CDP = 0x26, // cam descriptor pointer + CDC = 0x27, // cam descriptor count + SR = 0x28, // silicon revision + WT0 = 0x29, // watchdog timer 0 + WT1 = 0x2a, // watchdog timer 1 + RSC = 0x2b, // receive sequence counter + CRCT = 0x2c, // crc error tally + FAET = 0x2d, // fae tally + MPT = 0x2e, // missed packet tally + MDT = 0x2f, // maximum deferral timer + // factory use only + DCR2 = 0x3f, // data configuration 2 }; - enum tcr_mask : u16 + enum cr_mask : u16 + { + CR_HTX = 0x0001, // halt transmission + CR_TXP = 0x0002, // transmit packets + CR_RXDIS = 0x0004, // receiver disable + CR_RXEN = 0x0008, // receiver enable + CR_STP = 0x0010, // stop timer + CR_ST = 0x0020, // start timer + CR_RST = 0x0080, // software reset + CR_RRRA = 0x0100, // read rra + CR_LCAM = 0x0200, // load cam + }; + enum dcr_mask : u16 + { + DCR_TFT = 0x0003, // transmit fifo threshold + DCR_RFT = 0x000c, // receive fifo threshold + DCR_BMS = 0x0010, // block mode select for dma + DCR_DW = 0x0020, // data width select + DCR_WC = 0x00c0, // wait state control + DCR_USR = 0x0300, // user definable pins + DCR_SBUS = 0x0400, // synchronous bus mode + DCR_PO = 0x1800, // programmable outputs + DCR_LBR = 0x2000, // latched bus retry + DCR_EXBUS = 0x8000, // extended bus mode + }; + enum rcr_mask : u16 { - PTX = 0x0001, // packet transmitted ok - BCM = 0x0002, // byte count mismatch - FU = 0x0004, // fifo underrun - PMB = 0x0008, // packet monitored bad - OWC = 0x0020, // out of window collision - EXC = 0x0040, // excessive collisions - CRSL = 0x0080, // crs lost - NCRS = 0x0100, // no crs - DEF = 0x0200, // deferred transmission - EXD = 0x0400, // excessive deferral - EXDIS = 0x1000, // disable excessive deferral timer - CRCI = 0x2000, // crc inhibit - POWC = 0x4000, // programmed out of window collision timer - PINT = 0x8000, // programmable interrupt - - TCR_WMASK = 0xf000 + RCR_PRX = 0x0001, // packet received ok + RCR_LBK = 0x0002, // loopback packet received + RCR_FAER = 0x0004, // frame alignment error + RCR_CRCR = 0x0008, // crc error + RCR_COL = 0x0010, // collision activity + RCR_CRS = 0x0020, // carrier sense activity + RCR_LPKT = 0x0040, // last packet in rba + RCR_BC = 0x0080, // broadcast packet received + RCR_MC = 0x0100, // multicast packet received + RCR_LB = 0x0600, // loopback control + RCR_AMC = 0x0800, // accept all multicast packets + RCR_PRO = 0x1000, // physical promiscuous mode + RCR_BRD = 0x2000, // accept broadcast packets + RCR_RNT = 0x4000, // accept runt packets + RCR_ERR = 0x8000, // accept packet with crc errors or collisions }; + enum tcr_mask : u16 + { + TCR_PTX = 0x0001, // packet transmitted ok + TCR_BCM = 0x0002, // byte count mismatch + TCR_FU = 0x0004, // fifo underrun + TCR_PMB = 0x0008, // packet monitored bad + TCR_OWC = 0x0020, // out of window collision + TCR_EXC = 0x0040, // excessive collisions + TCR_CRSL = 0x0080, // crs lost + TCR_NCRS = 0x0100, // no crs + TCR_DEF = 0x0200, // deferred transmission + TCR_EXD = 0x0400, // excessive deferral + TCR_EXDIS = 0x1000, // disable excessive deferral timer + TCR_CRCI = 0x2000, // crc inhibit + TCR_POWC = 0x4000, // programmed out of window collision timer + TCR_PINT = 0x8000, // programmable interrupt + + TCR_TPC = 0xf000, // tx packet descriptor config + TCR_TPS = 0x07ff, // tx packet descriptor status - u16 cr_r() { return m_cr; } - u16 tcr_r() { return m_tcr; } - u16 utda_r() { return m_utda; } - u16 crda_r() { return m_crda; } - u16 rrp_r() { return m_rrp; } - u16 rwp_r() { return m_rwp; } - u16 isr_r() { return m_isr; } - u16 ce_r() { return m_ce; } - u16 wt0_r() { return m_wt0; } - u16 wt1_r() { return m_wt1; } - u16 rsc_r() { return m_rsc; } - u16 faet_r() { return m_faet; } - - void cr_w(u16 data) { m_cr = (data & CR_WMASK) | (m_cr & ~CR_WMASK); } - void tcr_w(u16 data) { m_tcr = (data & TCR_WMASK) | (m_tcr & ~TCR_WMASK); } - void utda_w(u16 data) { m_utda = data; } - void crda_w(u16 data) { m_crda = data; } - void rrp_w(u16 data) { m_rrp = data; } - void rwp_w(u16 data) { m_rwp = data; } - void isr_w(u16 data) { m_isr = data; } - void ce_w(u16 data) { m_ce = data; } - void wt0_w(u16 data) { m_wt0 = data; } - void wt1_w(u16 data) { m_wt1 = data; } - void rsc_w(u16 data) { m_rsc = data; } - void faet_w(u16 data) { m_faet = ~data; } + }; + enum imr_mask : u16 + { + IMR_RFOEN = 0x0001, // receive fifo overrun + IMR_MPEN = 0x0002, // missed packet tally counter warning + IMR_FAEEN = 0x0004, // frame alignment error tally counter warning + IMR_CRCEN = 0x0008, // crc tally counter warning + IMR_RBAEEN = 0x0010, // receive buffer area exceeded + IMR_RBEEN = 0x0020, // receive buffers exhausted + IMR_RDEEN = 0x0040, // receive descriptors exhausted + IMR_TCEN = 0x0080, // general purpose timer complete + IMR_TXEREN = 0x0100, // transmit error + IMR_PTXEN = 0x0200, // packet transmitted ok + IMR_PRXEN = 0x0400, // packet received + IMR_PINTEN = 0x0800, // programmable interrupt + IMR_LCDEN = 0x1000, // load cam done + IMR_HBLEN = 0x2000, // heartbeat lost + IMR_BREN = 0x4000, // bus retry occurred + }; + enum isr_mask : u16 + { + ISR_RFO = 0x0001, // receive fifo overrun + ISR_MP = 0x0002, // missed packet counter rollover + ISR_FAE = 0x0004, // frame alignment error tally counter rollover + ISR_CRC = 0x0008, // crc tally counter rollover + ISR_RBAE = 0x0010, // receive buffer area exceeded + ISR_RBE = 0x0020, // receive buffer exhausted + ISR_RDE = 0x0040, // receive descriptors exhausted + ISR_TC = 0x0080, // general purpose timer complete + ISR_TXER = 0x0100, // transmit error + ISR_TXDN = 0x0200, // transmission done + ISR_PKTRX = 0x0400, // packet received + ISR_PINT = 0x0800, // programmed interrupt + ISR_LCD = 0x1000, // load cam done + ISR_HBL = 0x2000, // cd heartbeat lost + ISR_BR = 0x4000, // bus retry occurred + }; private: - required_device<ram_device> m_ram; - + required_address_space m_bus; devcb_write_line m_out_int; - u16 m_cr; - u16 m_tcr; - u16 m_utda; - u16 m_crda; - u16 m_rrp; - u16 m_rwp; - u16 m_isr; - u16 m_ce; - u16 m_wt0; - u16 m_wt1; - u16 m_rsc; - u16 m_faet; + emu_timer *m_command; + + bool m_int_state; + u16 m_reg[64]; + u64 m_cam[16]; }; DECLARE_DEVICE_TYPE(DP83932C, dp83932c_device) diff --git a/src/devices/machine/ds1204.cpp b/src/devices/machine/ds1204.cpp index cd722bc8929..ba86725df66 100644 --- a/src/devices/machine/ds1204.cpp +++ b/src/devices/machine/ds1204.cpp @@ -10,7 +10,7 @@ #include "emu.h" #include "ds1204.h" -#include <stdio.h> +#include <cstdio> #define VERBOSE_LEVEL ( 0 ) diff --git a/src/devices/machine/ds1205.cpp b/src/devices/machine/ds1205.cpp index 3dca4c8de2f..460d267928a 100644 --- a/src/devices/machine/ds1205.cpp +++ b/src/devices/machine/ds1205.cpp @@ -10,7 +10,7 @@ #include "emu.h" #include "ds1205.h" -#include <stdio.h> +#include <cstdio> #define VERBOSE_LEVEL ( 0 ) diff --git a/src/devices/machine/ds1994.cpp b/src/devices/machine/ds1994.cpp index bf0f6eef017..5bd8a7024ca 100644 --- a/src/devices/machine/ds1994.cpp +++ b/src/devices/machine/ds1994.cpp @@ -15,7 +15,7 @@ #include "emu.h" #include "machine/ds1994.h" -#include <time.h> +#include <ctime> #define VERBOSE_LEVEL 0 diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp index 4f92a844a45..ce24d0336ca 100644 --- a/src/devices/machine/ds2404.cpp +++ b/src/devices/machine/ds2404.cpp @@ -12,7 +12,7 @@ #include "ds2404.h" #include <algorithm> -#include <time.h> // FIXME: re-write in terms of device_rtc_interface and remove this +#include <ctime> // FIXME: re-write in terms of device_rtc_interface and remove this //************************************************************************** diff --git a/src/devices/machine/gen_fifo.cpp b/src/devices/machine/gen_fifo.cpp index bcbd3f54201..10fcf37429c 100644 --- a/src/devices/machine/gen_fifo.cpp +++ b/src/devices/machine/gen_fifo.cpp @@ -107,6 +107,12 @@ template<typename T> void generic_fifo_device_base<T>::device_timer(emu_timer &t template<typename T> T generic_fifo_device_base<T>::pop() { + if(machine().side_effects_disabled()) { + if(is_empty()) + return T(); + return m_values.front(); + } + // Are we empty? if(is_empty()) { // First, trigger the sync diff --git a/src/devices/machine/i3001.cpp b/src/devices/machine/i3001.cpp new file mode 100644 index 00000000000..decca559d56 --- /dev/null +++ b/src/devices/machine/i3001.cpp @@ -0,0 +1,137 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +/********************************************************************** + + i3001.cpp + + Intel 3001 Microprogram Control Unit + +**********************************************************************/ + +#include "emu.h" +#include "i3001.h" + +// Device type definition +DEFINE_DEVICE_TYPE(I3001, i3001_device, "i3001", "Intel i3001 MCU") + +i3001_device::i3001_device(const machine_config &mconfig , const char *tag , device_t *owner , uint32_t clock) + : device_t(mconfig , I3001 , tag , owner , clock) + , m_fo_handler(*this) + , m_px_handler(*this) + , m_sx_handler(*this) +{ +} + +void i3001_device::fc_w(uint8_t fc) +{ + m_fc = fc; + + switch (fc & 0b1100) { + case 0: + // FF0 + m_fo = false; + break; + + case 0b0100: + // FFC + m_fo = m_carry; + break; + + case 0b1000: + // FFZ + m_fo = m_zero; + break; + + case 0b1100: + // FF1 + m_fo = true; + break; + } + m_fo_handler(m_fo); +} + +WRITE_LINE_MEMBER(i3001_device::clk_w) +{ + update(); +} + +void i3001_device::device_start() +{ + m_fo_handler.resolve_safe(); + m_px_handler.resolve_safe(0); + m_sx_handler.resolve_safe(0); + + save_item(NAME(m_addr)); + save_item(NAME(m_pr)); + save_item(NAME(m_ac)); + save_item(NAME(m_fc)); + save_item(NAME(m_fi)); + save_item(NAME(m_carry)); + save_item(NAME(m_zero)); + save_item(NAME(m_flag)); +} + +void i3001_device::update() +{ + m_flag = m_fi; + + // Decode FC10 + switch (m_fc & 0b11) { + case 0: + // SCZ + m_carry = m_zero = m_flag; + break; + + case 0b01: + // STZ + m_zero = m_flag; + break; + + case 0b10: + // STC + m_carry = m_flag; + break; + + default: + // HCZ + break; + } + + // Decode AC + if ((m_ac & 0b1100000) == 0b0000000) { + // JCC + m_addr = pack_row_col(m_ac & 0b11111 , get_col(m_addr)); + } else if ((m_ac & 0b1110000) == 0b0100000) { + // JZR + m_addr = pack_row_col(0 , m_ac & 0b1111); + } else if ((m_ac & 0b1110000) == 0b0110000) { + // JCR + m_addr = pack_row_col(get_row(m_addr) , m_ac & 0b1111); + } else if ((m_ac & 0b1111000) == 0b1110000) { + // JCE + m_addr = pack_row_col((get_row(m_addr) & 0b11000) | (m_ac & 0b00111) , get_col(m_addr)); + } else if ((m_ac & 0b1110000) == 0b1000000) { + // JFL + m_addr = pack_row_col((get_row(m_addr) & 0b10000) | (m_ac & 0b01111) , (get_col(m_addr) & 0b1000) | 0b0010 | m_flag); + } else if ((m_ac & 0b1111000) == 0b1010000) { + // JCF + m_addr = pack_row_col((get_row(m_addr) & 0b11000) | (m_ac & 0b00111) , (get_col(m_addr) & 0b1000) | 0b0010 | m_carry); + } else if ((m_ac & 0b1111000) == 0b1011000) { + // JZF + m_addr = pack_row_col((get_row(m_addr) & 0b11000) | (m_ac & 0b00111) , (get_col(m_addr) & 0b1000) | 0b0010 | m_zero); + } else if ((m_ac & 0b1111000) == 0b1100000) { + // JPR + m_addr = pack_row_col((get_row(m_addr) & 0b11000) | (m_ac & 0b00111) , m_pr); + } else if ((m_ac & 0b1111000) == 0b1101000) { + // JLL + m_addr = pack_row_col((get_row(m_addr) & 0b11000) | (m_ac & 0b00111) , 0b0100 | (m_pr >> 2)); + } else if ((m_ac & 0b1111100) == 0b1111100) { + // JRL + m_addr = pack_row_col((get_row(m_addr) & 0b11000) | 0b00100 | (m_ac & 0b00011) , 0b1100 | (m_pr & 0b0011)); + } else { + // JPX + uint8_t px = m_px_handler() & 0b1111; + m_pr = m_sx_handler() & 0b1111; + m_addr = pack_row_col((get_row(m_addr) & 0b11100) | (m_ac & 0b00011) , px); + } +} diff --git a/src/devices/machine/i3001.h b/src/devices/machine/i3001.h new file mode 100644 index 00000000000..11231456f5b --- /dev/null +++ b/src/devices/machine/i3001.h @@ -0,0 +1,106 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +/********************************************************************** + + i3001.h + + Intel 3001 Microprogram Control Unit + +********************************************************************** + _____ _____ + PX4/ 1|* \_/ |40 VCC + PX7/ 2| |39 AC0 + PX6/ 3| |38 AC1 + PX5/ 4| |37 AC5 + SX3/ 5| |36 LD + SX2/ 6| |35 ERA + PR2 7| |34 MA8 + SX1/ 8| |33 MA7 + PR1 9| DIP40 |32 MA6 + SX0/ 10| i3001 |31 MA5 + PR0 11| |30 MA4 + FC3 12| |29 MA0 + FC2 13| |28 MA3 + FO/ 14| |27 MA2 + FC0 15| |26 MA1 + FC1 16| |25 EN + FI/ 17| |24 AC6 + ISE 18| |23 AC4 + CLK 19| |22 AC3 + GND 20|_____________|21 AC2 + +**********************************************************************/ + +#ifndef MAME_MACHINE_I3001_H +#define MAME_MACHINE_I3001_H + +#pragma once + +class i3001_device : public device_t +{ +public: + i3001_device(const machine_config &mconfig , const char *tag , device_t *owner , uint32_t clock = 0); + + // Mask of valid bits in address + static constexpr uint16_t ADDR_MASK = ((1U << 9) - 1); + + // Read current microprogram address (9 bits) + uint16_t addr_r() const { return m_addr; } + + // Set Address Control code (7 bits) + void ac_w(uint16_t ac) { m_ac = ac; } + + // Set Flag Control code (4 bits) + void fc_w(uint8_t fc); + + // Write Flag Input + DECLARE_WRITE_LINE_MEMBER(fi_w) { m_fi = state; } + + // Read Flag Output + DECLARE_READ_LINE_MEMBER(fo_r) { return m_fo; } + + // Read carry/zero flags + DECLARE_READ_LINE_MEMBER(carry_r) { return m_carry; } + DECLARE_READ_LINE_MEMBER(zero_r) { return m_zero; } + + // Output callbacks + auto fo_w() { return m_fo_handler.bind(); } + + // Input callbacks + auto px_r() { return m_px_handler.bind(); } + auto sx_r() { return m_sx_handler.bind(); } + + // Load address (in real hw address is loaded through PX/SX buses) + void addr_w(uint16_t addr) { m_addr = addr & ADDR_MASK; } + + // Clock pulse + DECLARE_WRITE_LINE_MEMBER(clk_w); + +protected: + virtual void device_start() override; + +private: + devcb_write_line m_fo_handler; + devcb_read8 m_px_handler; + devcb_read8 m_sx_handler; + + uint16_t m_addr; + uint8_t m_pr; + uint8_t m_ac; + uint8_t m_fc; + bool m_fi; + bool m_fo; + bool m_carry; + bool m_zero; + bool m_flag; + + void update(); + static uint8_t get_row(uint16_t addr) { return (addr >> 4); } + static uint8_t get_col(uint16_t addr) { return addr & 0b1111; } + static uint16_t pack_row_col(uint8_t row , uint8_t col) { return ((uint16_t)row << 4) | col; } +}; + +// device type definition +DECLARE_DEVICE_TYPE(I3001, i3001_device) + +#endif /* MAME_MACHINE_I3001_H */ diff --git a/src/devices/machine/i3002.cpp b/src/devices/machine/i3002.cpp new file mode 100644 index 00000000000..0abfff3eb45 --- /dev/null +++ b/src/devices/machine/i3002.cpp @@ -0,0 +1,428 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +/********************************************************************** + + i3002.cpp + + Intel 3002 Central Processing Element + +**********************************************************************/ + +#include "emu.h" +#include "i3002.h" + +// Device type definition +DEFINE_DEVICE_TYPE(I3002, i3002_device, "i3002", "Intel i3002 CPE") + +// Bit manipulation +namespace { + template<typename T> constexpr T BIT_MASK(unsigned n) + { + return (T)1U << n; + } + + template<typename T> void BIT_CLR(T& w , unsigned n) + { + w &= ~BIT_MASK<T>(n); + } + + template<typename T> void BIT_SET(T& w , unsigned n) + { + w |= BIT_MASK<T>(n); + } +} + +// Table to decode bits 0..3 of FC into RG and register index +struct fc_fields { + uint8_t rg; // Register group [0..2] ("I" , "II" , "III" in Intel docs) + unsigned reg; // Register index +}; + +constexpr std::array<struct fc_fields , 16> fc_field_tab = + {{ + { 0 , i3002_device::REG_R0 }, // 0000 + { 0 , i3002_device::REG_R1 }, // 0001 + { 0 , i3002_device::REG_R2 }, // 0010 + { 0 , i3002_device::REG_R3 }, // 0011 + { 0 , i3002_device::REG_R4 }, // 0100 + { 0 , i3002_device::REG_R5 }, // 0101 + { 0 , i3002_device::REG_R6 }, // 0110 + { 0 , i3002_device::REG_R7 }, // 0111 + { 0 , i3002_device::REG_R8 }, // 1000 + { 0 , i3002_device::REG_R9 }, // 1001 + { 1 , i3002_device::REG_T }, // 1010 + { 1 , i3002_device::REG_AC }, // 1011 + { 0 , i3002_device::REG_T }, // 1100 + { 0 , i3002_device::REG_AC }, // 1101 + { 2 , i3002_device::REG_T }, // 1110 + { 2 , i3002_device::REG_AC } // 1111 + }}; + +// Register names +static const std::array<const char* , i3002_device::REG_COUNT> reg_names = + {{ + "R0", + "R1", + "R2", + "R3", + "R4", + "R5", + "R6", + "R7", + "R8", + "R9", + "T", + "AC", + "MAR" + }}; + +i3002_device::i3002_device(const machine_config &mconfig , const char *tag , device_t *owner , uint32_t clock) + : device_t(mconfig , I3002 , tag , owner , clock) + , m_co_handler(*this) + , m_ro_handler(*this) + , m_ibus_handler(*this) + , m_mbus_handler(*this) +{ +} + +const char *i3002_device::reg_name(unsigned reg_idx) +{ + return reg_names[ reg_idx ]; +} + +void i3002_device::decode_fc(uint8_t fc , uint8_t& fg , uint8_t& rg , unsigned& reg) +{ + // Function group + fg = (fc >> 4) & 7; + + uint8_t lsn = fc & 0xf; + + // Register & register group + rg = fc_field_tab[ lsn ].rg; + reg = fc_field_tab[ lsn ].reg; +} + +void i3002_device::fc_kbus_w(uint8_t fc , uint8_t k) +{ + m_fc = fc & 0x7f; + m_kbus = k & WORD_MASK; +} + +WRITE_LINE_MEMBER(i3002_device::clk_w) +{ + if (state) { + update(); + } +} + +bool i3002_device::update_ro() +{ + // Update RO output if doing a right-shift only + uint8_t fg; + uint8_t rg; + unsigned reg; + + decode_fc(m_fc , fg , rg , reg); + + if (fg == 0 && rg == 2) { + uint8_t ik = m_ibus_handler() & m_kbus; + uint8_t at = m_reg[ reg ]; + set_ro(BIT(at , 0) && !BIT(ik , 0)); + return true; + } else { + return false; + } +} + +void i3002_device::device_start() +{ + m_co_handler.resolve_safe(); + m_ro_handler.resolve_safe(); + m_ibus_handler.resolve_safe(0); + m_mbus_handler.resolve_safe(0); + + save_item(NAME(m_reg)); + save_item(NAME(m_fc)); + save_item(NAME(m_kbus)); + save_item(NAME(m_ci)); + save_item(NAME(m_li)); + save_item(NAME(m_co)); + save_item(NAME(m_ro)); +} + +void i3002_device::update() +{ + uint8_t fg; + uint8_t rg; + unsigned reg; + + decode_fc(m_fc , fg , rg , reg); + + switch (fg) { + case 0: + switch (rg) { + case 0: + // FC 0 RG I + { + uint8_t tmp = (m_reg[ REG_AC ] & m_kbus) + m_reg[ reg ] + m_ci; + m_reg[ REG_AC ] = m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 1: + // FC 0 RG II + { + uint8_t m = m_mbus_handler() & WORD_MASK; + uint8_t tmp = (m_reg[ REG_AC ] & m_kbus) + m + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 2: + // FC 0 RG III + { + // Who designed this mess??? + uint8_t ik = m_ibus_handler() & WORD_MASK & m_kbus; + uint8_t at = m_reg[ reg ]; + m_reg[ reg ] = 0; + set_ro(BIT(at , 0) && !BIT(ik , 0)); + if (m_li || (BIT(ik , 1) && BIT(at , 1))) { + BIT_SET(m_reg[ reg ] , 1); + } + if ((BIT(at , 0) && BIT(ik , 0)) || (BIT(at , 1) || BIT(ik , 1))) { + BIT_SET(m_reg[ reg ] , 0); + } + } + break; + } + break; + + case 1: + switch (rg) { + case 0: + // FC 1 RG I + { + m_reg[ REG_MAR ] = m_kbus | m_reg[ reg ]; + uint8_t tmp = m_reg[ reg ] + m_kbus + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 1: + // FC 1 RG II + { + uint8_t m = m_mbus_handler() & WORD_MASK; + m_reg[ REG_MAR ] = m_kbus | m; + uint8_t tmp = m + m_kbus + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 2: + // FC 1 RG III + { + uint8_t tmp = ((m_reg[ reg ] ^ WORD_MASK) | m_kbus) + (m_reg[ reg ] & m_kbus) + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + } + break; + + case 2: + switch (rg) { + case 0: + case 1: + // FC 2 RG I + // FC 2 RG II + { + uint8_t tmp = (m_reg[ REG_AC ] & m_kbus) + WORD_MASK + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 2: + // FC 2 RG III + { + uint8_t i = m_ibus_handler() & WORD_MASK; + uint8_t tmp = (i & m_kbus) + WORD_MASK + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + } + break; + + case 3: + switch (rg) { + case 0: + // FC 3 RG I + { + uint8_t tmp = (m_reg[ REG_AC ] & m_kbus) + m_reg[ reg ] + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 1: + // FC 3 RG II (== FC 0 RG II) + { + uint8_t m = m_mbus_handler() & WORD_MASK; + uint8_t tmp = (m_reg[ REG_AC ] & m_kbus) + m + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + + case 2: + // FC 3 RG III + { + uint8_t i = m_ibus_handler() & WORD_MASK; + uint8_t tmp = (i & m_kbus) + m_reg[ reg ] + m_ci; + m_reg[ reg ] = tmp & WORD_MASK; + set_co(BIT(tmp , SLICE_SIZE)); + } + break; + } + break; + + case 4: + switch (rg) { + case 0: + // FC 4 RG I + { + uint8_t tmp = m_reg[ reg ] & m_reg[ REG_AC ] & m_kbus; + m_reg[ reg ] = tmp; + set_co(m_ci || tmp != 0); + } + break; + + case 1: + // FC 4 RG II + { + uint8_t m = m_mbus_handler() & WORD_MASK; + uint8_t tmp = m & m_reg[ REG_AC ] & m_kbus; + m_reg[ reg ] = tmp; + set_co(m_ci || tmp != 0); + } + break; + + case 2: + // FC 4 RG III + { + uint8_t i = m_ibus_handler() & WORD_MASK; + uint8_t tmp = i & m_reg[ reg ] & m_kbus; + m_reg[ reg ] = tmp; + set_co(m_ci || tmp != 0); + } + break; + } + break; + + case 5: + switch (rg) { + case 0: + case 2: + // FC 5 RG I + // FC 5 RG III + { + uint8_t tmp = m_reg[ reg ] & m_kbus; + m_reg[ reg ] = tmp; + set_co(m_ci || tmp != 0); + } + break; + + case 1: + // FC 5 RG II + { + uint8_t m = m_mbus_handler() & WORD_MASK; + uint8_t tmp = m & m_kbus; + m_reg[ reg ] = tmp; + set_co(m_ci || tmp != 0); + } + break; + } + break; + + case 6: + switch (rg) { + case 0: + // FC 6 RG I + { + uint8_t tmp = m_reg[ REG_AC ] & m_kbus; + m_reg[ reg ] |= tmp; + set_co(m_ci || tmp != 0); + } + break; + + case 1: + // FC 6 RG II + { + uint8_t m = m_mbus_handler() & WORD_MASK; + uint8_t tmp = m_reg[ REG_AC ] & m_kbus; + m_reg[ reg ] = m | tmp; + set_co(m_ci || tmp != 0); + } + break; + + case 2: + // FC 6 RG III + { + uint8_t ik = m_ibus_handler() & WORD_MASK & m_kbus; + m_reg[ reg ] |= ik; + set_co(m_ci || ik != 0); + } + break; + } + break; + + case 7: + switch (rg) { + case 0: + // FC 7 RG I + { + uint8_t tmp = m_reg[ REG_AC ] & m_kbus; + set_co(m_ci || (m_reg[ reg ] & tmp) != 0); + m_reg[ reg ] = m_reg[ reg ] ^ tmp ^ WORD_MASK; + } + break; + + case 1: + // FC 7 RG II + { + uint8_t m = m_mbus_handler() & WORD_MASK; + uint8_t tmp = m_reg[ REG_AC ] & m_kbus; + set_co(m_ci || (m & tmp) != 0); + m_reg[ reg ] = m ^ tmp ^ WORD_MASK; + } + break; + + case 2: + // FC 7 RG III + { + uint8_t ik = m_ibus_handler() & WORD_MASK & m_kbus; + set_co(m_ci || (m_reg[ reg ] & ik) != 0); + m_reg[ reg ] = m_reg[ reg ] ^ ik ^ WORD_MASK; + } + break; + } + break; + } +} + +void i3002_device::set_co(bool co) +{ + m_co = co; + m_co_handler(m_co); +} + +void i3002_device::set_ro(bool ro) +{ + m_ro = ro; + m_ro_handler(m_ro); +} diff --git a/src/devices/machine/i3002.h b/src/devices/machine/i3002.h new file mode 100644 index 00000000000..70932afe7a2 --- /dev/null +++ b/src/devices/machine/i3002.h @@ -0,0 +1,130 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +/********************************************************************** + + i3002.h + + Intel 3002 Central Processing Element + +********************************************************************** + _____ _____ + I0/ 1|* \_/ |28 VCC + I1/ 2| |27 F2 + K0/ 3| |26 F1 + K1/ 4| |25 F0 + X 5| |24 F3 + Y 6| |23 ED/ + CO/ 7| |22 M0/ + RO/ 8| |21 M1/ + LI/ 9| DIP28 |20 D1/ + CI/ 10| i3002 |19 D0/ + EA/ 11| |18 CLK + A1/ 12| |17 F4 + A0/ 13| |16 F5 + GND 14|_____________|15 F6 + +**********************************************************************/ + +#ifndef MAME_MACHINE_I3002_H +#define MAME_MACHINE_I3002_H + +#pragma once + +class i3002_device : public device_t +{ +public: + i3002_device(const machine_config &mconfig , const char *tag , device_t *owner , uint32_t clock = 0); + + // Width of bit-slice + static constexpr unsigned SLICE_SIZE = 2; + + // Mask of significant bits + static constexpr uint8_t WORD_MASK = ((1U << SLICE_SIZE) - 1); + + // Registers + enum : unsigned { + REG_R0, + REG_R1, + REG_R2, + REG_R3, + REG_R4, + REG_R5, + REG_R6, + REG_R7, + REG_R8, + REG_R9, + REG_T, + REG_AC, + REG_MAR, + REG_COUNT + }; + + static const char *reg_name(unsigned reg_idx); + + // Decode function code into function group, register group and register index + static void decode_fc(uint8_t fc , uint8_t& fg , uint8_t& rg , unsigned& reg); + + // Set function code (7 bits) and K-bus (2 bits) + void fc_kbus_w(uint8_t fc , uint8_t k); + + // Write Carry Input + DECLARE_WRITE_LINE_MEMBER(ci_w) { m_ci = state != 0; } + + // Write Left Input + DECLARE_WRITE_LINE_MEMBER(li_w) { m_li = state != 0; } + + // Read Carry Output + DECLARE_READ_LINE_MEMBER(co_r) const { return m_co; } + + // Read Right Output + DECLARE_READ_LINE_MEMBER(ro_r) const { return m_ro; } + + // Output callbacks + auto co_w() { return m_co_handler.bind(); } + auto ro_w() { return m_ro_handler.bind(); } + + // Input bus callbacks + auto ibus_r() { return m_ibus_handler.bind(); } + auto mbus_r() { return m_mbus_handler.bind(); } + + // Read output buses + uint8_t abus_r() const { return m_reg[ REG_MAR ]; } + uint8_t dbus_r() const { return m_reg[ REG_AC ]; } + + // Clock pulse + DECLARE_WRITE_LINE_MEMBER(clk_w); + + // Compute RO if FC is the code of right-shift op (and return true) + // Return false in all other cases + bool update_ro(); + + // Access to registers (debugging only: registers are not directly accessible in the real hw) + const uint8_t& get_reg(unsigned idx) const { return m_reg[ idx ]; } + uint8_t& get_reg(unsigned idx) { return m_reg[ idx ]; } + +protected: + virtual void device_start() override; + +private: + devcb_write_line m_co_handler; + devcb_write_line m_ro_handler; + devcb_read8 m_ibus_handler; + devcb_read8 m_mbus_handler; + + uint8_t m_reg[ REG_COUNT ]; + uint8_t m_fc; + uint8_t m_kbus; + bool m_ci; + bool m_li; + bool m_co; + bool m_ro; + + void update(); + void set_co(bool co); + void set_ro(bool ro); +}; + +// device type definition +DECLARE_DEVICE_TYPE(I3002, i3002_device) + +#endif /* MAME_MACHINE_I3002_H */ diff --git a/src/devices/machine/i8087.cpp b/src/devices/machine/i8087.cpp index fd942656885..aae326006bb 100644 --- a/src/devices/machine/i8087.cpp +++ b/src/devices/machine/i8087.cpp @@ -21,7 +21,7 @@ #include "emu.h" #include "i8087.h" -#include <math.h> +#include <cmath> /************************************* * @@ -261,7 +261,8 @@ void i8087_device::execute() WRITE32_MEMBER(i8087_device::insn_w) { - m_ppc = m_pc = data; + m_ppc = m_pc; + m_pc = data; } WRITE32_MEMBER(i8087_device::addr_w) @@ -433,7 +434,7 @@ int i8087_device::dec_stack() * *************************************/ -int i8087_device::check_exceptions() +int i8087_device::check_exceptions(bool store) { /* Update the exceptions from SoftFloat */ if (float_exception_flags & float_flag_invalid) @@ -456,13 +457,21 @@ int i8087_device::check_exceptions() m_sw |= X87_SW_PE; float_exception_flags &= ~float_flag_inexact; } + if (float_exception_flags & float_flag_divbyzero) + { + m_sw |= X87_SW_ZE; + float_exception_flags &= ~float_flag_divbyzero; + } + + u16 unmasked = (m_sw & ~m_cw) & 0x3f; if ((m_sw & ~m_cw) & 0x3f) { // interrupt handler if (!(m_cw & X87_CW_IEM)) { m_sw |= X87_SW_ES; m_int_handler(1); } logerror("Unmasked x87 exception (CW:%.4x, SW:%.4x)\n", m_cw, m_sw); - return 0; + if (store || !(unmasked & (X87_SW_OE | X87_SW_UE))) + return 0; } return 1; @@ -2760,11 +2769,9 @@ void i8087_device::fst_m32real(u8 modrm) value = ST(0); } - if (check_exceptions()) - { - u32 m32real = floatx80_to_float32(value); + u32 m32real = floatx80_to_float32(value); + if (check_exceptions(true)) WRITE32(ea, m32real); - } CYCLES(7); } @@ -2785,11 +2792,9 @@ void i8087_device::fst_m64real(u8 modrm) value = ST(0); } - if (check_exceptions()) - { - uint64_t m64real = floatx80_to_float64(value); + u64 m64real = floatx80_to_float64(value); + if (check_exceptions(true)) WRITE64(ea, m64real); - } CYCLES(8); } @@ -2832,9 +2837,9 @@ void i8087_device::fstp_m32real(u8 modrm) value = ST(0); } - if (check_exceptions()) + u32 m32real = floatx80_to_float32(value); + if (check_exceptions(true)) { - u32 m32real = floatx80_to_float32(value); WRITE32(ea, m32real); inc_stack(); } @@ -2859,9 +2864,9 @@ void i8087_device::fstp_m64real(u8 modrm) u32 ea = m_ea; - if (check_exceptions()) + u64 m64real = floatx80_to_float64(value); + if (check_exceptions(true)) { - uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); inc_stack(); } @@ -2885,7 +2890,7 @@ void i8087_device::fstp_m80real(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE80(ea, value); inc_stack(); @@ -2944,7 +2949,7 @@ void i8087_device::fist_m16int(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE16(ea, m16int); } @@ -2977,7 +2982,7 @@ void i8087_device::fist_m32int(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE32(ea, m32int); } @@ -3010,7 +3015,7 @@ void i8087_device::fistp_m16int(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE16(ea, m16int); inc_stack(); @@ -3044,7 +3049,7 @@ void i8087_device::fistp_m32int(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE32(ea, m32int); inc_stack(); @@ -3078,7 +3083,7 @@ void i8087_device::fistp_m64int(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE64(ea, m64int); inc_stack(); @@ -3113,7 +3118,7 @@ void i8087_device::fbstp(u8 modrm) } u32 ea = m_ea; - if (check_exceptions()) + if (check_exceptions(true)) { WRITE80(ea, result); inc_stack(); @@ -4185,12 +4190,17 @@ void i8087_device::fstcw(u8 modrm) void i8087_device::fldenv(u8 modrm) { - // TODO: Pointers and selectors u32 ea = m_ea; + u16 temp; write_cw(READ16(ea)); m_sw = READ16(ea + 2); m_tw = READ16(ea + 4); + m_ppc = READ16(ea + 6); + temp = READ16(ea + 8); + m_opcode = temp & 0x7ff; + m_ppc |= ((temp & 0xf000) << 4); + m_ea = READ16(ea + 10) | ((READ16(ea + 12) & 0xf000) << 4); check_exceptions(); @@ -4205,6 +4215,10 @@ void i8087_device::fstenv(u8 modrm) WRITE16(ea + 0, m_cw); WRITE16(ea + 2, m_sw); WRITE16(ea + 4, m_tw); + WRITE16(ea + 6, m_ppc & 0xffff); + WRITE16(ea + 8, (m_opcode & 0x07ff) | ((m_ppc & 0x0f0000) >> 4)); + WRITE16(ea + 10, m_ea & 0xffff); + WRITE16(ea + 12, (m_ea & 0x0f0000) >> 4); CYCLES(67); } @@ -4215,6 +4229,10 @@ void i8087_device::fsave(u8 modrm) WRITE16(ea + 0, m_cw); WRITE16(ea + 2, m_sw); WRITE16(ea + 4, m_tw); + WRITE16(ea + 6, m_ppc & 0xffff); + WRITE16(ea + 8, (m_opcode & 0x07ff) | ((m_ppc & 0x0f0000) >> 4)); + WRITE16(ea + 10, m_ea & 0xffff); + WRITE16(ea + 12, (m_ea & 0x0f0000) >> 4); for (int i = 0; i < 8; ++i) WRITE80(ea + i*10, ST(i)); @@ -4225,10 +4243,16 @@ void i8087_device::fsave(u8 modrm) void i8087_device::frstor(u8 modrm) { u32 ea = m_ea; + u16 temp; write_cw(READ16(ea)); m_sw = READ16(ea + 2); m_tw = READ16(ea + 4); + m_ppc = READ16(ea + 6); + temp = READ16(ea + 8); + m_opcode = temp & 0x7ff; + m_ppc |= ((temp & 0xf000) << 4); + m_ea = READ16(ea + 10) | ((READ16(ea + 12) & 0xf000) << 4); for (int i = 0; i < 8; ++i) write_stack(i, READ80(ea + i*10), false); diff --git a/src/devices/machine/i8087.h b/src/devices/machine/i8087.h index 9344ca2e68e..aab97cd3305 100644 --- a/src/devices/machine/i8087.h +++ b/src/devices/machine/i8087.h @@ -76,7 +76,7 @@ private: void set_stack_overflow(); int inc_stack(); int dec_stack(); - int check_exceptions(); + int check_exceptions(bool store = false); void write_cw(u16 cw); floatx80 add(floatx80 a, floatx80 b); floatx80 sub(floatx80 a, floatx80 b); diff --git a/src/devices/machine/i82355.cpp b/src/devices/machine/i82355.cpp index 18741710489..88726f7f04e 100644 --- a/src/devices/machine/i82355.cpp +++ b/src/devices/machine/i82355.cpp @@ -36,7 +36,7 @@ i82355_device::i82355_device(const machine_config &mconfig, const char *tag, dev , m_lint_callback(*this) , m_local_index(0x00) , m_local_status(0x00) - , m_id{0} + , m_id{{0}} , m_global_config(0x00) // TBD: revision code in upper 4 bits , m_system_interrupt(0x00) , m_semaphore_flag{false, false} @@ -46,19 +46,19 @@ i82355_device::i82355_device(const machine_config &mconfig, const char *tag, dev , m_local_doorbell_enable(0x00) , m_eisa_doorbell_status(0x00) , m_eisa_doorbell_enable(0x00) - , m_peek_poke_data{0} - , m_peek_poke_address{0} + , m_peek_poke_data{{0}} + , m_peek_poke_address{{0}} , m_peek_poke_status(0x00) , m_io_decode_base{0x00, 0x00} , m_io_decode_control{0x00, 0x00} , m_transfer_config{0x00, 0x00} , m_transfer_status{0x00, 0x00} - , m_base_count{{0}, {0}} - , m_base_address{{0}, {0}} - , m_current_count{{0}, {0}} - , m_current_address{{0}, {0}} - , m_tbi_base{{0}, {0}} - , m_tbi_current{{0}, {0}} + , m_base_count{ {{0}}, {{0}} } + , m_base_address{ {{0}}, {{0}} } + , m_current_count{ {{0}}, {{0}} } + , m_current_address{ {{0}}, {{0}} } + , m_tbi_base{ {{0}}, {{0}} } + , m_tbi_current{ {{0}}, {{0}} } { // TODO: 24-byte FIFO for each data transfer channel std::fill(std::begin(m_mailbox), std::end(m_mailbox), 0x00); diff --git a/src/devices/machine/i82357.cpp b/src/devices/machine/i82357.cpp index 6c6c75e838d..7fa9a62d556 100644 --- a/src/devices/machine/i82357.cpp +++ b/src/devices/machine/i82357.cpp @@ -10,6 +10,9 @@ * * http://bitsavers.org/components/intel/_dataBooks/1996_Intel_Peripheral_Components.pdf * + * https://web.archive.org/web/20040214013557/http://www.techfest.com/hardware/bus/eisa.htm + * https://web.archive.org/web/20040405230259/http://www.mindshare.com/pdf/eisabook.pdf + * * TODO * - expose everything to an actual EISA bus * - 32-bit dma functionality @@ -151,7 +154,7 @@ void i82357_device::map(address_map &map) map(0x407, 0x407).rw(m_dma[0], FUNC(eisa_dma_device::get_count_high<3>), FUNC(eisa_dma_device::set_count_high<3>)); //map(0x40a, 0x40a); // DMA1 Set Chaining Mode (w)/Interrupt Status (r) - //map(0x40b, 0x40b); // DMA1 Ext Write Mode (w) + map(0x40b, 0x40b).w(m_dma[0], FUNC(eisa_dma_device::set_ext_mode)); //map(0x40c, 0x40c); // Chain Buffer Control //map(0x40d, 0x40d); // Stepping Level Register (ro) //map(0x40e, 0x40e); // ISP Test Register @@ -188,7 +191,7 @@ void i82357_device::map(address_map &map) NAME([this] (offs_t offset, u8 data) { m_elcr[offset] = data; })); //map(0x4d4, 0x4d4); // DMA2 Set Chaining Mode - //map(0x4d6, 0x4d6); // DMA2 Ext Write Mode Register + map(0x4d6, 0x4d6).w(m_dma[1], FUNC(eisa_dma_device::set_ext_mode)); map(0x4e0, 0x4e3).rw(m_dma[0], FUNC(eisa_dma_device::get_stop<0>), FUNC(eisa_dma_device::set_stop<0>)); map(0x4e4, 0x4e7).rw(m_dma[0], FUNC(eisa_dma_device::get_stop<1>), FUNC(eisa_dma_device::set_stop<1>)); @@ -219,6 +222,12 @@ void i82357_device::device_reset() m_nmi_reg = 0; m_nmi_ext = 0; + for (unsigned i = 0; i < 4; i++) + m_dma[0]->set_ext_mode(0x00 | i); + + for (unsigned i = 0; i < 4; i++) + m_dma[1]->set_ext_mode(0x04 | i); + m_nmi_check->adjust(attotime::zero); } diff --git a/src/devices/machine/i8355.cpp b/src/devices/machine/i8355.cpp index 917f46ea8b1..f6a28f07297 100644 --- a/src/devices/machine/i8355.cpp +++ b/src/devices/machine/i8355.cpp @@ -51,9 +51,9 @@ DEFINE_DEVICE_TYPE(I8355, i8355_device, "i8355", "Intel 8355") // read_port - read from input port //------------------------------------------------- -inline uint8_t i8355_device::read_port(int port) +inline u8 i8355_device::read_port(int port) { - uint8_t data = m_output[port] & m_ddr[port]; + u8 data = m_output[port] & m_ddr[port]; if (m_ddr[port] != 0xff) { @@ -69,7 +69,7 @@ inline uint8_t i8355_device::read_port(int port) // write_port - write to output port //------------------------------------------------- -inline void i8355_device::write_port(int port, uint8_t data) +inline void i8355_device::write_port(int port, u8 data) { m_output[port] = data; @@ -87,7 +87,7 @@ inline void i8355_device::write_port(int port, uint8_t data) // i8355_device - constructor //------------------------------------------------- -i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, I8355, tag, owner, clock), m_in_pa_cb(*this), m_out_pa_cb(*this), @@ -131,11 +131,11 @@ void i8355_device::device_reset() // io_r - register read //------------------------------------------------- -READ8_MEMBER( i8355_device::io_r ) +u8 i8355_device::io_r(offs_t offset) { int port = offset & 0x01; - uint8_t data = 0; + u8 data = 0; switch (offset & 0x03) { @@ -158,7 +158,7 @@ READ8_MEMBER( i8355_device::io_r ) // io_w - register write //------------------------------------------------- -WRITE8_MEMBER( i8355_device::io_w ) +void i8355_device::io_w(offs_t offset, u8 data) { int port = offset & 0x01; @@ -186,7 +186,7 @@ WRITE8_MEMBER( i8355_device::io_w ) // memory_r - internal ROM read //------------------------------------------------- -READ8_MEMBER( i8355_device::memory_r ) +u8 i8355_device::memory_r(offs_t offset) { return m_rom[offset]; } diff --git a/src/devices/machine/i8355.h b/src/devices/machine/i8355.h index 9a6228d0fa0..e9205a86a9d 100644 --- a/src/devices/machine/i8355.h +++ b/src/devices/machine/i8355.h @@ -45,10 +45,10 @@ public: auto in_pb() { return m_in_pb_cb.bind(); } auto out_pb() { return m_out_pb_cb.bind(); } - DECLARE_READ8_MEMBER( io_r ); - DECLARE_WRITE8_MEMBER( io_w ); + u8 io_r(offs_t offset); + void io_w(offs_t offset, u8 data); - DECLARE_READ8_MEMBER( memory_r ); + u8 memory_r(offs_t offset); protected: // device-level overrides diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp index ec5d8e041d7..9c6121e9a2d 100644 --- a/src/devices/machine/ins8250.cpp +++ b/src/devices/machine/ins8250.cpp @@ -436,7 +436,7 @@ u8 ins8250_uart_device::ins8250_r(offs_t offset) clear the int if this is the source of the int */ if (!machine().side_effects_disabled()) { - if (m_regs.iir == 0x02) + if ((m_regs.iir & 0x0f) == 0x02) clear_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY); } break; diff --git a/src/devices/machine/intelfsh.cpp b/src/devices/machine/intelfsh.cpp index c08d9f800ac..0ce7ed8dc53 100644 --- a/src/devices/machine/intelfsh.cpp +++ b/src/devices/machine/intelfsh.cpp @@ -92,6 +92,7 @@ DEFINE_DEVICE_TYPE(AMD_29LV200T, amd_29lv200t_device, "amd_29l DEFINE_DEVICE_TYPE(FUJITSU_29F160T, fujitsu_29f160t_device, "fujitsu_29f160t", "Fujitsu 29F160T Flash") DEFINE_DEVICE_TYPE(FUJITSU_29F016A, fujitsu_29f016a_device, "fujitsu_29f016a", "Fujitsu 29F016A Flash") DEFINE_DEVICE_TYPE(FUJITSU_29DL16X, fujitsu_29dl16x_device, "fujitsu_29dl16x", "Fujitsu 29DL16X Flash") +DEFINE_DEVICE_TYPE(FUJITSU_29LV002TC, fujitsu_29lv002tc_device, "fujitsu_29lv002tc", "Fujitsu 29LV002TC Flash") DEFINE_DEVICE_TYPE(INTEL_E28F400B, intel_e28f400b_device, "intel_e28f400b", "Intel E28F400B Flash") DEFINE_DEVICE_TYPE(MACRONIX_29L001MC, macronix_29l001mc_device, "macronix_29l001mc", "Macronix 29L001MC Flash") DEFINE_DEVICE_TYPE(MACRONIX_29LV160TMC, macronix_29lv160tmc_device, "macronix_29lv160tmc", "Macronix 29LV160TMC Flash") @@ -110,6 +111,7 @@ DEFINE_DEVICE_TYPE(SHARP_LH28F160S3, sharp_lh28f160s3_device, "sharp_l DEFINE_DEVICE_TYPE(INTEL_TE28F320, intel_te28f320_device, "intel_te28f320", "Intel TE28F320 Flash") DEFINE_DEVICE_TYPE(SHARP_LH28F320BF, sharp_lh28f320bf_device, "sharp_lh28f320bf", "Sharp LH28F320BFHE-PBTL Flash") DEFINE_DEVICE_TYPE(INTEL_28F320J3D, intel_28f320j3d_device, "intel_28f320j3d", "Intel 28F320J3D Flash") +DEFINE_DEVICE_TYPE(SPANSION_S29GL064S, spansion_s29gl064s_device, "spansion_s29gl064s", "Spansion / Cypress S29GL064S Flash" ) DEFINE_DEVICE_TYPE(INTEL_28F320J5, intel_28f320j5_device, "intel_28f320j5", "Intel 28F320J5 Flash") DEFINE_DEVICE_TYPE(SST_39VF400A, sst_39vf400a_device, "sst_39vf400a", "SST 39VF400A Flash") @@ -117,6 +119,7 @@ DEFINE_DEVICE_TYPE(SST_39VF400A, sst_39vf400a_device, "sst_39v DEFINE_DEVICE_TYPE(ATMEL_49F4096, atmel_49f4096_device, "atmel_49f4096", "Atmel AT49F4096 Flash") + //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -227,6 +230,13 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type m_device_id = 0x16; m_sector_is_4k = true; break; + case FLASH_SPANSION_S29GL064S: // senbbs + m_bits = 16; + m_size = 0x800000; + m_maker_id = MFG_SPANSION; + m_device_id = 0x227e; + m_sector_is_4k = false; + break; case FLASH_INTEL_28F320J5: // funkball m_bits = 16; m_size = 0x400000; @@ -286,6 +296,12 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type m_maker_id = MFG_FUJITSU; m_device_id = 0x35; break; + case FLASH_FUJITSU_29LV002TC: + m_bits = 8; + m_size = 0x40000; + m_maker_id = MFG_FUJITSU; + m_device_id = 0x40; + break; case FLASH_INTEL_E28F008SA: m_bits = 8; m_size = 0x100000; @@ -378,6 +394,9 @@ fujitsu_29f016a_device::fujitsu_29f016a_device(const machine_config &mconfig, co fujitsu_29dl16x_device::fujitsu_29dl16x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, FUJITSU_29DL16X, tag, owner, clock, FLASH_FUJITSU_29DL16X) { } +fujitsu_29lv002tc_device::fujitsu_29lv002tc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : intelfsh8_device(mconfig, FUJITSU_29LV002TC, tag, owner, clock, FLASH_FUJITSU_29LV002TC) { } + sharp_lh28f016s_device::sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SHARP_LH28F016S, tag, owner, clock, FLASH_SHARP_LH28F016S) { } @@ -447,6 +466,9 @@ sharp_lh28f160s3_device::sharp_lh28f160s3_device(const machine_config &mconfig, intel_te28f320_device::intel_te28f320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_TE28F320, tag, owner, clock, FLASH_INTEL_TE28F320) { } +spansion_s29gl064s_device::spansion_s29gl064s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : intelfsh16_device(mconfig, SPANSION_S29GL064S, tag, owner, clock, FLASH_SPANSION_S29GL064S) { } + intel_e28f400b_device::intel_e28f400b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_E28F400B, tag, owner, clock, FLASH_INTEL_E28F400B) { } @@ -883,7 +905,14 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) (( address & 0xfff ) == 0xaaa && ( data & 0xff ) == 0x10 ) ) { // chip erase - memset(&m_data[0], 0xff, m_size); + if (m_maker_id == MFG_FUJITSU && m_device_id == 0x40) + { + // hardcoded for Dreamcast, TODO properly handle sector protection + memset(&m_data[0], 0xff, 0x3A000); + memset(&m_data[0x3C000], 0xff, 0x04000); + } + else + memset(&m_data[0], 0xff, m_size); m_status = 1 << 3; m_flash_mode = FM_ERASEAMD4; @@ -939,6 +968,23 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) m_timer->adjust( attotime::from_msec( 500 ) ); } } + else if (m_maker_id == MFG_FUJITSU && m_device_id == 0x40) + { + constexpr u32 sectors[] = { 0x10000, 0x10000, 0x10000, 0x08000, 0x02000, 0x02000, 0x4000 }; + + u32 sec_num = 0; + u32 toffset = base; + while (toffset >= sectors[sec_num]) + toffset -= sectors[sec_num++]; + u32 sec_len = sectors[sec_num]; + + if (sec_num != 5) // hardcoded for Dreamcast, TODO properly handle sector protection + { + memset(&m_data[base & ~(sec_len - 1)], 0xff, sec_len); + } + m_erase_sector = address & ~(sec_len - 1); + m_timer->adjust(attotime::from_seconds(1)); + } else { memset(&m_data[base & ~0xffff], 0xff, 64 * 1024); @@ -958,12 +1004,20 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) switch( m_bits ) { case 8: + if (m_maker_id == MFG_FUJITSU && m_device_id == 0x40) { - m_data[address] = data; + if (address < 0x3a000 || address >= 0x3c000) // hardcoded for Dreamcast, TODO properly handle sector protection + m_data[address] &= data; } + else + m_data[address] = data; + break; + case 16: // senbbs test mode requires this, note, flash type is guessed there based on manufacturer + device ident as markings were erased + m_data[address*2] = data >> 8; + m_data[address*2+1] = data; break; default: - logerror( "FM_BYTEPROGRAM not supported when m_bits == %d\n", m_bits ); + logerror( "FM_BYTEPROGRAM not supported when m_bits == %d (address %08x data %04x)\n", m_bits, address, data ); break; } m_flash_mode = FM_NORMAL; diff --git a/src/devices/machine/intelfsh.h b/src/devices/machine/intelfsh.h index 2d459f59eed..dbab11362ae 100644 --- a/src/devices/machine/intelfsh.h +++ b/src/devices/machine/intelfsh.h @@ -20,6 +20,7 @@ public: FLASH_FUJITSU_29F160T, FLASH_FUJITSU_29F016A, FLASH_FUJITSU_29DL16X, + FLASH_FUJITSU_29LV002TC, FLASH_ATMEL_29C010, FLASH_AMD_29F010, FLASH_AMD_29F040, @@ -48,6 +49,7 @@ public: FLASH_INTEL_TE28F320, FLASH_SHARP_LH28F320BF, FLASH_INTEL_28F320J3D, + FLASH_SPANSION_S29GL064S, FLASH_INTEL_28F320J5, FLASH_SST_39VF400A, FLASH_ATMEL_49F4096 @@ -161,6 +163,12 @@ public: fujitsu_29dl16x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; +class fujitsu_29lv002tc_device : public intelfsh8_device +{ +public: + fujitsu_29lv002tc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); +}; + class atmel_29c010_device : public intelfsh8_device { public: @@ -300,6 +308,12 @@ public: intel_te28f320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; +class spansion_s29gl064s_device : public intelfsh16_device +{ +public: + spansion_s29gl064s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); +}; + class intel_e28f400b_device : public intelfsh16_device { public: @@ -352,6 +366,7 @@ DECLARE_DEVICE_TYPE(AMD_29LV200T, amd_29lv200t_device) DECLARE_DEVICE_TYPE(FUJITSU_29F160T, fujitsu_29f160t_device) DECLARE_DEVICE_TYPE(FUJITSU_29F016A, fujitsu_29f016a_device) DECLARE_DEVICE_TYPE(FUJITSU_29DL16X, fujitsu_29dl16x_device) +DECLARE_DEVICE_TYPE(FUJITSU_29LV002TC, fujitsu_29lv002tc_device) DECLARE_DEVICE_TYPE(INTEL_E28F400B, intel_e28f400b_device) DECLARE_DEVICE_TYPE(MACRONIX_29L001MC, macronix_29l001mc_device) DECLARE_DEVICE_TYPE(MACRONIX_29LV160TMC, macronix_29lv160tmc_device) @@ -368,6 +383,7 @@ DECLARE_DEVICE_TYPE(INTEL_E28F008SA, intel_e28f008sa_device) DECLARE_DEVICE_TYPE(INTEL_TE28F160, intel_te28f160_device) DECLARE_DEVICE_TYPE(SHARP_LH28F160S3, sharp_lh28f160s3_device) DECLARE_DEVICE_TYPE(INTEL_TE28F320, intel_te28f320_device) +DECLARE_DEVICE_TYPE(SPANSION_S29GL064S, spansion_s29gl064s_device) DECLARE_DEVICE_TYPE(SHARP_LH28F320BF, sharp_lh28f320bf_device) DECLARE_DEVICE_TYPE(INTEL_28F320J3D, intel_28f320j3d_device) DECLARE_DEVICE_TYPE(INTEL_28F320J5, intel_28f320j5_device) diff --git a/src/devices/machine/k054321.cpp b/src/devices/machine/k054321.cpp index ec59ae89d94..9a809e2d7cb 100644 --- a/src/devices/machine/k054321.cpp +++ b/src/devices/machine/k054321.cpp @@ -33,7 +33,7 @@ #include "emu.h" #include "k054321.h" -#include <math.h> +#include <cmath> DEFINE_DEVICE_TYPE(K054321, k054321_device, "k054321", "K054321 Maincpu-Soundcpu interface") diff --git a/src/devices/machine/mc68901.cpp b/src/devices/machine/mc68901.cpp index 307d5fc6c90..082e02985a7 100644 --- a/src/devices/machine/mc68901.cpp +++ b/src/devices/machine/mc68901.cpp @@ -1,9 +1,12 @@ // license:BSD-3-Clause -// copyright-holders:Curt Coder +// copyright-holders:Curt Coder, AJR /********************************************************************** Motorola MC68901 Multi Function Peripheral emulation + This chip was originally designed by Mostek (MK68901) as a 68000- + oriented evolution of the Z80 STI. + **********************************************************************/ /* @@ -34,12 +37,7 @@ the GLUE is essentially invisible w.r.t IPL. The CPU and the MFP manage to add the delays all by themselves. - - divide serial clock by 16 - - synchronous mode - - 1.5/2 stop bits - - interrupt on receiver break end - - interrupt on character boundaries during break transmission - - loopback mode + - RR & TR outputs */ @@ -47,7 +45,11 @@ #include "mc68901.h" #include "cpu/m68000/m68000.h" -//#define VERBOSE 1 +#define LOG_GENERAL (1 << 0U) +#define LOG_RCV (1 << 1U) +#define LOG_XMIT (1 << 2U) + +//#define VERBOSE (LOG_GENERAL | LOG_RCV | LOG_XMIT) #include "logmacro.h" @@ -61,105 +63,104 @@ DEFINE_DEVICE_TYPE(MC68901, mc68901_device, "mc68901", "Motorola MC68901 MFP") //************************************************************************** -#define AER_GPIP_0 0x01 -#define AER_GPIP_1 0x02 -#define AER_GPIP_2 0x04 -#define AER_GPIP_3 0x08 -#define AER_GPIP_4 0x10 -#define AER_GPIP_5 0x20 -#define AER_GPIP_6 0x40 -#define AER_GPIP_7 0x80 - - -#define VR_S 0x08 - - -#define IR_GPIP_0 0x0001 -#define IR_GPIP_1 0x0002 -#define IR_GPIP_2 0x0004 -#define IR_GPIP_3 0x0008 -#define IR_TIMER_D 0x0010 -#define IR_TIMER_C 0x0020 -#define IR_GPIP_4 0x0040 -#define IR_GPIP_5 0x0080 -#define IR_TIMER_B 0x0100 -#define IR_XMIT_ERROR 0x0200 -#define IR_XMIT_BUFFER_EMPTY 0x0400 -#define IR_RCV_ERROR 0x0800 -#define IR_RCV_BUFFER_FULL 0x1000 -#define IR_TIMER_A 0x2000 -#define IR_GPIP_6 0x4000 -#define IR_GPIP_7 0x8000 - - -#define TCR_TIMER_STOPPED 0x00 -#define TCR_TIMER_DELAY_4 0x01 -#define TCR_TIMER_DELAY_10 0x02 -#define TCR_TIMER_DELAY_16 0x03 -#define TCR_TIMER_DELAY_50 0x04 -#define TCR_TIMER_DELAY_64 0x05 -#define TCR_TIMER_DELAY_100 0x06 -#define TCR_TIMER_DELAY_200 0x07 -#define TCR_TIMER_EVENT 0x08 -#define TCR_TIMER_PULSE_4 0x09 -#define TCR_TIMER_PULSE_10 0x0a -#define TCR_TIMER_PULSE_16 0x0b -#define TCR_TIMER_PULSE_50 0x0c -#define TCR_TIMER_PULSE_64 0x0d -#define TCR_TIMER_PULSE_100 0x0e -#define TCR_TIMER_PULSE_200 0x0f -#define TCR_TIMER_RESET 0x10 - - -#define UCR_PARITY_ENABLED 0x04 -#define UCR_PARITY_EVEN 0x02 -#define UCR_PARITY_ODD 0x00 -#define UCR_WORD_LENGTH_8 0x00 -#define UCR_WORD_LENGTH_7 0x20 -#define UCR_WORD_LENGTH_6 0x40 -#define UCR_WORD_LENGTH_5 0x60 -#define UCR_START_STOP_0_0 0x00 -#define UCR_START_STOP_1_1 0x08 -#define UCR_START_STOP_1_15 0x10 -#define UCR_START_STOP_1_2 0x18 -#define UCR_CLOCK_DIVIDE_16 0x80 -#define UCR_CLOCK_DIVIDE_1 0x00 - - -#define RSR_RCV_ENABLE 0x01 -#define RSR_SYNC_STRIP_ENABLE 0x02 -#define RSR_MATCH 0x04 -#define RSR_CHAR_IN_PROGRESS 0x04 -#define RSR_FOUND_SEARCH 0x08 -#define RSR_BREAK 0x08 -#define RSR_FRAME_ERROR 0x10 -#define RSR_PARITY_ERROR 0x20 -#define RSR_OVERRUN_ERROR 0x40 -#define RSR_BUFFER_FULL 0x80 - -#define TSR_XMIT_ENABLE 0x01 -#define TSR_OUTPUT_HI_Z 0x00 -#define TSR_OUTPUT_LOW 0x02 -#define TSR_OUTPUT_HIGH 0x04 -#define TSR_OUTPUT_LOOP 0x06 -#define TSR_OUTPUT_MASK 0x06 -#define TSR_BREAK 0x08 -#define TSR_END_OF_XMIT 0x10 -#define TSR_AUTO_TURNAROUND 0x20 -#define TSR_UNDERRUN_ERROR 0x40 -#define TSR_BUFFER_EMPTY 0x80 +enum : u8 { + VR_S = 0x08 +}; + +enum : u16 { + IR_GPIP_0 = 0x0001, + IR_GPIP_1 = 0x0002, + IR_GPIP_2 = 0x0004, + IR_GPIP_3 = 0x0008, + IR_TIMER_D = 0x0010, + IR_TIMER_C = 0x0020, + IR_GPIP_4 = 0x0040, + IR_GPIP_5 = 0x0080, + IR_TIMER_B = 0x0100, + IR_XMIT_ERROR = 0x0200, + IR_XMIT_BUFFER_EMPTY = 0x0400, + IR_RCV_ERROR = 0x0800, + IR_RCV_BUFFER_FULL = 0x1000, + IR_TIMER_A = 0x2000, + IR_GPIP_6 = 0x4000, + IR_GPIP_7 = 0x8000 +}; + +enum : u8 { + TCR_TIMER_STOPPED = 0x00, + TCR_TIMER_DELAY_4 = 0x01, + TCR_TIMER_DELAY_10 = 0x02, + TCR_TIMER_DELAY_16 = 0x03, + TCR_TIMER_DELAY_50 = 0x04, + TCR_TIMER_DELAY_64 = 0x05, + TCR_TIMER_DELAY_100 = 0x06, + TCR_TIMER_DELAY_200 = 0x07, + TCR_TIMER_EVENT = 0x08, + TCR_TIMER_PULSE_4 = 0x09, + TCR_TIMER_PULSE_10 = 0x0a, + TCR_TIMER_PULSE_16 = 0x0b, + TCR_TIMER_PULSE_50 = 0x0c, + TCR_TIMER_PULSE_64 = 0x0d, + TCR_TIMER_PULSE_100 = 0x0e, + TCR_TIMER_PULSE_200 = 0x0f, + TCR_TIMER_RESET = 0x10 +}; + +enum : u8 { + UCR_PARITY_ENABLED = 0x04, + UCR_PARITY_EVEN = 0x02, + UCR_PARITY_ODD = 0x00, + UCR_WORD_LENGTH_8 = 0x00, + UCR_WORD_LENGTH_7 = 0x20, + UCR_WORD_LENGTH_6 = 0x40, + UCR_WORD_LENGTH_5 = 0x60, + UCR_WORD_LENGTH_MASK = 0x60, + UCR_START_STOP_0_0 = 0x00, + UCR_START_STOP_1_1 = 0x08, + UCR_START_STOP_1_15 = 0x10, + UCR_START_STOP_1_2 = 0x18, + UCR_CLOCK_DIVIDE_16 = 0x80, + UCR_CLOCK_DIVIDE_1 = 0x00 +}; + +enum : u8 { + RSR_RCV_ENABLE = 0x01, + RSR_SYNC_STRIP_ENABLE = 0x02, + RSR_MATCH = 0x04, + RSR_CHAR_IN_PROGRESS = 0x04, + RSR_FOUND_SEARCH = 0x08, + RSR_BREAK = 0x08, + RSR_FRAME_ERROR = 0x10, + RSR_PARITY_ERROR = 0x20, + RSR_OVERRUN_ERROR = 0x40, + RSR_BUFFER_FULL = 0x80 +}; + +enum : u8 { + TSR_XMIT_ENABLE = 0x01, + TSR_OUTPUT_HI_Z = 0x00, + TSR_OUTPUT_LOW = 0x02, + TSR_OUTPUT_HIGH = 0x04, + TSR_OUTPUT_LOOP = 0x06, + TSR_OUTPUT_MASK = 0x06, + TSR_BREAK = 0x08, + TSR_END_OF_XMIT = 0x10, + TSR_AUTO_TURNAROUND = 0x20, + TSR_UNDERRUN_ERROR = 0x40, + TSR_BUFFER_EMPTY = 0x80 +}; #define DIVISOR PRESCALER[data & 0x07] -const int mc68901_device::INT_MASK_GPIO[] = +const u16 mc68901_device::INT_MASK_GPIO[] = { IR_GPIP_0, IR_GPIP_1, IR_GPIP_2, IR_GPIP_3, IR_GPIP_4, IR_GPIP_5, IR_GPIP_6, IR_GPIP_7 }; -const int mc68901_device::INT_MASK_TIMER[] = +const u16 mc68901_device::INT_MASK_TIMER[] = { IR_TIMER_A, IR_TIMER_B, IR_TIMER_C, IR_TIMER_D }; @@ -190,13 +191,29 @@ inline void mc68901_device::check_interrupts() } } -inline void mc68901_device::take_interrupt(uint16_t mask) +inline void mc68901_device::take_interrupt(u16 mask) { m_ipr |= mask; check_interrupts(); } +inline void mc68901_device::tx_buffer_empty() +{ + if (m_ier & IR_XMIT_BUFFER_EMPTY) + { + take_interrupt(IR_XMIT_BUFFER_EMPTY); + } +} + +inline void mc68901_device::tx_error() +{ + if (m_ier & IR_XMIT_ERROR) + { + take_interrupt(IR_XMIT_ERROR); + } +} + inline void mc68901_device::rx_buffer_full() { if (m_ier & IR_RCV_BUFFER_FULL) @@ -312,7 +329,7 @@ inline void mc68901_device::gpio_input(int bit, int state) void mc68901_device::gpio_output() { - uint8_t new_gpio_output = m_gpip & m_ddr; + u8 new_gpio_output = m_gpip & m_ddr; if (m_gpio_output != new_gpio_output) { @@ -329,12 +346,9 @@ void mc68901_device::gpio_output() // mc68901_device - constructor //------------------------------------------------- -mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MC68901, tag, owner, clock), - device_serial_interface(mconfig, *this), m_timer_clock(0), - m_rx_clock(0), - m_tx_clock(0), m_out_irq_cb(*this), m_out_gpio_cb(*this), m_out_tao_cb(*this), @@ -347,8 +361,28 @@ mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, d m_iack_chain_cb(*this), m_aer(0), m_ier(0), + m_scr(0), + m_scr_parity(false), + m_transmit_buffer(0), + m_receive_buffer(0), m_gpio_input(0), - m_gpio_output(0xff) + m_gpio_output(0xff), + m_rframe(0), + m_rclk(0), + m_rbits(0), + m_si_scan(0xff), + m_next_rsr(0), + m_rc(true), + m_si(true), + m_last_si(true), + m_rparity(false), + m_osr(0), + m_tclk(0), + m_tbits(0), + m_tc(true), + m_so(false), + m_tparity(false), + m_underrun(false) { } @@ -359,8 +393,6 @@ mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, d void mc68901_device::device_start() { - m_start_bit_hack_for_external_clocks = true; - /* resolve callbacks */ m_out_irq_cb.resolve_safe(); m_out_gpio_cb.resolve_safe(); @@ -379,16 +411,6 @@ void mc68901_device::device_start() m_timer[TIMER_C] = timer_alloc(TIMER_C); m_timer[TIMER_D] = timer_alloc(TIMER_D); - if (m_rx_clock > 0) - { - set_rcv_rate(m_rx_clock); - } - - if (m_tx_clock > 0) - { - set_tra_rate(m_tx_clock); - } - /* register for state saving */ save_item(NAME(m_gpip)); save_item(NAME(m_aer)); @@ -406,17 +428,30 @@ void mc68901_device::device_start() save_item(NAME(m_to)); save_item(NAME(m_ti)); save_item(NAME(m_scr)); + save_item(NAME(m_scr_parity)); save_item(NAME(m_ucr)); save_item(NAME(m_rsr)); save_item(NAME(m_tsr)); save_item(NAME(m_transmit_buffer)); - save_item(NAME(m_transmit_pending)); save_item(NAME(m_receive_buffer)); - save_item(NAME(m_overrun_pending)); save_item(NAME(m_gpio_input)); save_item(NAME(m_gpio_output)); - save_item(NAME(m_rsr_read)); + save_item(NAME(m_rframe)); + save_item(NAME(m_rclk)); + save_item(NAME(m_rbits)); + save_item(NAME(m_si_scan)); save_item(NAME(m_next_rsr)); + save_item(NAME(m_rc)); + save_item(NAME(m_si)); + save_item(NAME(m_last_si)); + save_item(NAME(m_rparity)); + save_item(NAME(m_osr)); + save_item(NAME(m_tclk)); + save_item(NAME(m_tbits)); + save_item(NAME(m_tc)); + save_item(NAME(m_so)); + save_item(NAME(m_tparity)); + save_item(NAME(m_underrun)); } @@ -426,40 +461,41 @@ void mc68901_device::device_start() void mc68901_device::device_reset() { - m_tsr = 0; - m_transmit_pending = false; - m_overrun_pending = false; + m_rsr = 0; + m_tsr = TSR_BUFFER_EMPTY; + m_underrun = false; + m_rclk = 0; + m_tclk = 0; // Avoid read-before-write m_ipr = m_imr = 0; + m_rframe = 0x100; m_next_rsr = 0; memset(m_tmc, 0, sizeof(m_tmc)); memset(m_ti, 0, sizeof(m_ti)); memset(m_to, 0, sizeof(m_to)); - register_w(REGISTER_GPIP, 0); - register_w(REGISTER_AER, 0); - register_w(REGISTER_DDR, 0); - register_w(REGISTER_IERA, 0); - register_w(REGISTER_IERB, 0); - register_w(REGISTER_IPRA, 0); - register_w(REGISTER_IPRB, 0); - register_w(REGISTER_ISRA, 0); - register_w(REGISTER_ISRB, 0); - register_w(REGISTER_IMRA, 0); - register_w(REGISTER_IMRB, 0); - register_w(REGISTER_VR, 0); - register_w(REGISTER_TACR, 0); - register_w(REGISTER_TBCR, 0); - register_w(REGISTER_TCDCR, 0); - register_w(REGISTER_SCR, 0); - register_w(REGISTER_UCR, 0); - register_w(REGISTER_RSR, 0); - - transmit_register_reset(); - receive_register_reset(); + write(REGISTER_GPIP, 0); + write(REGISTER_AER, 0); + write(REGISTER_DDR, 0); + write(REGISTER_IERA, 0); + write(REGISTER_IERB, 0); + write(REGISTER_IPRA, 0); + write(REGISTER_IPRB, 0); + write(REGISTER_ISRA, 0); + write(REGISTER_ISRB, 0); + write(REGISTER_IMRA, 0); + write(REGISTER_IMRB, 0); + write(REGISTER_VR, 0); + write(REGISTER_TACR, 0); + write(REGISTER_TBCR, 0); + write(REGISTER_TCDCR, 0); + write(REGISTER_SCR, 0); + write(REGISTER_UCR, 0); + + set_so(true); } @@ -475,87 +511,10 @@ void mc68901_device::device_timer(emu_timer &timer, device_timer_id id, int para //------------------------------------------------- -// tra_callback - -//------------------------------------------------- - -void mc68901_device::tra_callback() -{ - m_out_so_cb(transmit_register_get_data_bit()); -} - - -//------------------------------------------------- -// tra_complete - +// read - read from one MFP register //------------------------------------------------- -void mc68901_device::tra_complete() -{ - if (m_tsr & TSR_XMIT_ENABLE) - { - if (m_transmit_pending) - { - transmit_register_setup(m_transmit_buffer); - m_transmit_pending = false; - m_tsr |= TSR_BUFFER_EMPTY; - - if (m_ier & IR_XMIT_BUFFER_EMPTY) - { - take_interrupt(IR_XMIT_BUFFER_EMPTY); - } - } - else - { - m_tsr |= TSR_UNDERRUN_ERROR; - // TODO: transmit error? - } - } - else - { - m_tsr |= TSR_END_OF_XMIT; - } -} - - -//------------------------------------------------- -// rcv_complete - -//------------------------------------------------- - -void mc68901_device::rcv_complete() -{ - receive_register_extract(); - if (m_rsr & RSR_BUFFER_FULL) - { - m_overrun_pending = true; - } - else - { - m_receive_buffer = get_received_char(); - m_rsr |= RSR_BUFFER_FULL; - LOG("Received Character: %02x\n", m_receive_buffer); - - if (is_receive_framing_error()) - m_rsr |= RSR_FRAME_ERROR; - else - m_rsr &= ~RSR_FRAME_ERROR; - - if (is_receive_parity_error()) - m_rsr |= RSR_PARITY_ERROR; - else - m_rsr &= ~RSR_PARITY_ERROR; - - if ((m_rsr & (RSR_FRAME_ERROR | RSR_PARITY_ERROR)) && (m_ier & IR_RCV_ERROR)) - rx_error(); - else - rx_buffer_full(); - } -} - - -//------------------------------------------------- -// read - -//------------------------------------------------- - -READ8_MEMBER( mc68901_device::read ) +u8 mc68901_device::read(offs_t offset) { switch (offset) { @@ -586,7 +545,7 @@ READ8_MEMBER( mc68901_device::read ) case REGISTER_UCR: return m_ucr; case REGISTER_RSR: { - uint8_t rsr = m_rsr; + u8 rsr = m_rsr; if (!machine().side_effects_disabled()) m_rsr &= ~RSR_OVERRUN_ERROR; return rsr; @@ -595,8 +554,8 @@ READ8_MEMBER( mc68901_device::read ) case REGISTER_TSR: { /* clear UE bit (in reality, this won't be cleared until one full clock cycle of the transmitter has passed since the bit was set) */ - uint8_t tsr = m_tsr; - if (!machine().side_effects_disabled()) + u8 tsr = m_tsr; + if (!machine().side_effects_disabled() && !m_underrun) m_tsr &= ~TSR_UNDERRUN_ERROR; return tsr; } @@ -605,10 +564,15 @@ READ8_MEMBER( mc68901_device::read ) if (!machine().side_effects_disabled()) { m_rsr &= ~RSR_BUFFER_FULL; - if (m_overrun_pending) + if (m_next_rsr != 0) { - m_overrun_pending = false; - m_rsr |= RSR_OVERRUN_ERROR; + m_rsr |= m_next_rsr; + m_next_rsr = 0; + rx_error(); + } + if ((m_rsr & RSR_BREAK) && BIT(m_rframe, 9)) + { + m_rsr &= ~RSR_BREAK; rx_error(); } } @@ -621,10 +585,10 @@ READ8_MEMBER( mc68901_device::read ) //------------------------------------------------- -// register_w - +// write - write to one MFP register //------------------------------------------------- -void mc68901_device::register_w(offs_t offset, uint8_t data) +void mc68901_device::write(offs_t offset, u8 data) { switch (offset) { @@ -918,6 +882,7 @@ void mc68901_device::register_w(offs_t offset, uint8_t data) LOG("MC68901 Sync Character : %x\n", data); m_scr = data; + m_scr_parity = BIT(population_count_32(data), 0); break; case REGISTER_UCR: @@ -932,60 +897,41 @@ void mc68901_device::register_w(offs_t offset, uint8_t data) case UCR_WORD_LENGTH_5: data_bit_count = 5; break; } - parity_t parity; - if (data & UCR_PARITY_ENABLED) { if (data & UCR_PARITY_EVEN) { LOG("MC68901 Parity : Even\n"); - - parity = PARITY_EVEN; } else { LOG("MC68901 Parity : Odd\n"); - - parity = PARITY_ODD; } } else { LOG("MC68901 Parity : Disabled\n"); - - parity = PARITY_NONE; } LOG("MC68901 Word Length : %u bits\n", data_bit_count); - int start_bits; - stop_bits_t stop_bits; - switch (data & 0x18) { case UCR_START_STOP_0_0: default: - start_bits = 0; - stop_bits = STOP_BITS_0; LOG("MC68901 Start Bits : 0, Stop Bits : 0, Format : synchronous\n"); break; case UCR_START_STOP_1_1: - start_bits = 1; - stop_bits = STOP_BITS_1; LOG("MC68901 Start Bits : 1, Stop Bits : 1, Format : asynchronous\n"); break; case UCR_START_STOP_1_15: - start_bits = 1; - stop_bits = STOP_BITS_1_5; LOG("MC68901 Start Bits : 1, Stop Bits : 1.5, Format : asynchronous\n"); break; case UCR_START_STOP_1_2: - start_bits = 1; - stop_bits = STOP_BITS_2; LOG("MC68901 Start Bits : 1, Stop Bits : 2, Format : asynchronous\n"); break; } @@ -999,9 +945,6 @@ void mc68901_device::register_w(offs_t offset, uint8_t data) LOG("MC68901 Rx/Tx Clock Divisor : 1\n"); } - set_data_frame(start_bits, data_bit_count, parity, stop_bits); - receive_register_reset(); - m_ucr = data; } break; @@ -1015,20 +958,32 @@ void mc68901_device::register_w(offs_t offset, uint8_t data) else { LOG("MC68901 Receiver Enabled\n"); + m_rsr |= RSR_RCV_ENABLE; if (data & RSR_SYNC_STRIP_ENABLE) { LOG("MC68901 Sync Strip Enabled\n"); + m_rsr |= RSR_SYNC_STRIP_ENABLE; } else { LOG("MC68901 Sync Strip Disabled\n"); + m_rsr &= ~RSR_SYNC_STRIP_ENABLE; } - if (data & RSR_FOUND_SEARCH) - LOG("MC68901 Receiver Search Mode Enabled\n"); - - m_rsr = data & 0x0b; + if ((m_ucr & UCR_START_STOP_1_2) == UCR_START_STOP_0_0) + { + if (data & RSR_FOUND_SEARCH) + { + LOG("MC68901 Receiver Search Mode Disabled\n"); + m_rsr |= RSR_FOUND_SEARCH; + } + else + { + LOG("MC68901 Receiver Search Mode Disabled\n"); + m_rsr &= ~RSR_FOUND_SEARCH; + } + } } break; @@ -1037,12 +992,11 @@ void mc68901_device::register_w(offs_t offset, uint8_t data) if ((data & TSR_XMIT_ENABLE) == 0) { - LOG("MC68901 Transmitter Disabled\n"); - m_tsr &= ~TSR_UNDERRUN_ERROR; + m_underrun = false; - if (is_transmit_register_empty()) - m_tsr |= TSR_END_OF_XMIT; + if (m_tbits == 0) + set_so((m_tsr & TSR_OUTPUT_MASK) != TSR_OUTPUT_LOW); } else { @@ -1083,40 +1037,19 @@ void mc68901_device::register_w(offs_t offset, uint8_t data) } m_tsr &= ~TSR_END_OF_XMIT; - - if (m_transmit_pending && is_transmit_register_empty()) - { - transmit_register_setup(m_transmit_buffer); - m_transmit_pending = false; - } - if (!m_transmit_pending) - m_tsr |= TSR_BUFFER_EMPTY; } break; case REGISTER_UDR: LOG("MC68901 UDR %x\n", data); m_transmit_buffer = data; - m_transmit_pending = true; m_tsr &= ~TSR_BUFFER_EMPTY; - - if ((m_tsr & TSR_XMIT_ENABLE) && is_transmit_register_empty()) - { - transmit_register_setup(m_transmit_buffer); - m_transmit_pending = false; - m_tsr |= TSR_BUFFER_EMPTY; - } break; } } -WRITE8_MEMBER( mc68901_device::write ) -{ - register_w(offset, data); -} - -uint8_t mc68901_device::get_vector() +u8 mc68901_device::get_vector() { for (int ch = 15; ch >= 0; ch--) { @@ -1167,7 +1100,416 @@ WRITE_LINE_MEMBER( mc68901_device::tbi_w ) timer_input(TIMER_B, state); } -WRITE_LINE_MEMBER(mc68901_device::write_rx) +//************************************************************************** +// USART +//************************************************************************** + +//------------------------------------------------- +// si_w - serial data input for receiver +//------------------------------------------------- + +WRITE_LINE_MEMBER(mc68901_device::si_w) +{ + m_si = state; +} + +//------------------------------------------------- +// rc_w - receiver clock input +//------------------------------------------------- + +WRITE_LINE_MEMBER(mc68901_device::rc_w) +{ + if (state != m_rc) + { + // receiver active on rising edge + m_rc = state; + if (state && (m_rsr & RSR_RCV_ENABLE) && (m_tsr & TSR_OUTPUT_MASK) != TSR_OUTPUT_LOOP) + rx_clock(m_si); + } +} + +//------------------------------------------------- +// tc_w - transmitter clock input +//------------------------------------------------- + +WRITE_LINE_MEMBER(mc68901_device::tc_w) +{ + if (state != m_tc) + { + // transmitter active on falling edge + m_tc = state; + if (!state && ((m_tsr & TSR_XMIT_ENABLE) || !(m_tsr & TSR_END_OF_XMIT))) + tx_clock(); + else if (state && (m_rsr & RSR_RCV_ENABLE) && (m_tsr & TSR_OUTPUT_MASK) == TSR_OUTPUT_LOOP) + rx_clock(m_so); + } +} + +//------------------------------------------------- +// set_so - set serial output +//------------------------------------------------- + +void mc68901_device::set_so(bool state) +{ + if (m_so != state) + { + m_so = state; + m_out_so_cb(state); + } +} + +//------------------------------------------------- +// rx_frame_start - begin a new frame of received +// data (following start bit for async mode) +//------------------------------------------------- + +void mc68901_device::rx_frame_start() +{ + m_rframe = 0; + m_rbits = (m_ucr & UCR_WORD_LENGTH_MASK) >> 5; + m_rparity = (m_ucr & UCR_PARITY_EVEN) == UCR_PARITY_ODD; +} + +//------------------------------------------------- +// rx_sync_found - notify that a sync character +// was found +//------------------------------------------------- + +void mc68901_device::rx_sync_found() { - device_serial_interface::rx_w(state); + m_rsr |= RSR_FOUND_SEARCH; + LOGMASKED(LOG_RCV, "USART sync character found (%02X)\n", m_scr); + + // causes error interrupt, but does not fill receiver buffer + rx_error(); +} + +//------------------------------------------------- +// rx_async_frame_complete - finish receiving one +// character in asynchronous mode +//------------------------------------------------- + +void mc68901_device::rx_async_frame_complete() +{ + if (m_rsr & RSR_BUFFER_FULL) + { + LOGMASKED(LOG_RCV, "USART discarding received character %02X (%s)\n", m_rframe & 0xff, (m_rframe == 0 && !m_last_si) ? "break" : "overrun"); + m_next_rsr |= (m_rframe == 0 && !m_last_si) ? RSR_BREAK : RSR_OVERRUN_ERROR; + } + else if (m_rsr & RSR_OVERRUN_ERROR) + { + if (m_rframe == 0 && !m_last_si) + m_rsr |= RSR_BREAK; + } + else + { + // load the receiver buffer + m_receive_buffer = m_rframe & 0xff; + m_rsr |= RSR_BUFFER_FULL; + + // set error flags + m_rsr &= ~(RSR_PARITY_ERROR | RSR_FRAME_ERROR | RSR_BREAK); + if (m_rparity) + m_rsr |= RSR_PARITY_ERROR; + if (!m_last_si) + m_rsr |= m_rframe == 0 ? RSR_BREAK : RSR_FRAME_ERROR; + LOGMASKED(LOG_RCV, "USART received character: %02X (PE = %d, FE = %d, B = %d)\n", m_receive_buffer, + m_rparity, + !m_last_si && m_rframe != 0, + !m_last_si && m_rframe == 0); + + // set normal or error interrupt (if the latter is disabled, always use the former) + if ((m_rparity || !m_last_si) && (m_ier & IR_RCV_ERROR)) + rx_error(); + else + rx_buffer_full(); + } +} + +//------------------------------------------------- +// rx_sync_frame_complete - finish receiving one +// character in synchronous mode (error flags are +// different from asynchronous mode) +//------------------------------------------------- + +void mc68901_device::rx_sync_frame_complete() +{ + // check if sync character matches + bool match = (m_rframe & 0xff) == (m_scr & (0xff >> ((m_ucr & UCR_WORD_LENGTH_MASK) >> 5))) && !m_rparity; + + // suppress sync characters if strip option set + if (!match || !(m_rsr & RSR_SYNC_STRIP_ENABLE)) + { + if (m_rsr & RSR_BUFFER_FULL) + m_next_rsr |= RSR_OVERRUN_ERROR; + else if (!(m_rsr & RSR_OVERRUN_ERROR)) + { + // load the receiver buffer + m_receive_buffer = m_rframe & 0xff; + m_rsr |= RSR_BUFFER_FULL; + + // set error flags + m_rsr &= ~(RSR_FRAME_ERROR | RSR_PARITY_ERROR | RSR_MATCH); + if (m_rparity) + m_rsr |= RSR_PARITY_ERROR; + if (match) + m_rsr |= RSR_MATCH; + LOGMASKED(LOG_RCV, "USART received character: %02X (PE = %d, sync %smatched)\n", m_receive_buffer, + m_rparity, + match ? "not " : ""); + + // set normal or error interrupt (if the latter is disabled, always use the former) + if ((m_rparity || match) && (m_ier & IR_RCV_ERROR)) + rx_error(); + else + rx_buffer_full(); + } + } + else + LOGMASKED(LOG_RCV, "USART sync character stripped (%02X)\n", m_rframe & 0xff); +} + +//------------------------------------------------- +// rx_clock - process one active transition on +// the receiver clock +//------------------------------------------------- + +void mc68901_device::rx_clock(bool si) +{ + m_rclk++; + if (m_rclk >= 244) + m_rclk &= 15; + m_si_scan = (m_si_scan >> 1) | (si ? 0x80 : 0); + bool rclk_sync = (m_ucr & UCR_CLOCK_DIVIDE_16) == UCR_CLOCK_DIVIDE_1 || (m_rclk >= 4 && (m_si_scan & 0xe0) == (m_last_si ? 0 : 0xe0)); + bool sync_mode = (m_ucr & UCR_START_STOP_1_2) == UCR_START_STOP_0_0; + if (rclk_sync) + { + LOGMASKED(LOG_RCV, "SI = %d (synchronized); RSR = %02X; rframe = %X; %d rbits, %d rclks\n", si, m_rsr, m_rframe, m_rbits, m_rclk); + m_last_si = si; + if (si && !sync_mode && !(m_rsr & RSR_CHAR_IN_PROGRESS)) + { + m_rframe = 0x100; + if (!(m_rsr & RSR_BUFFER_FULL) && (m_rsr & RSR_BREAK)) + { + // valid 0 to 1 transition ends break condition + m_rsr &= ~RSR_BREAK; + rx_error(); + } + } + m_rclk = 0; + } + + if ((m_ucr & UCR_CLOCK_DIVIDE_16) == UCR_CLOCK_DIVIDE_1 || (m_rclk & 15) == 8) + { + if (sync_mode && !(m_rsr & RSR_FOUND_SEARCH)) + { + // search mode: continuous comparison + m_rframe = (m_rframe >> 1) | (m_last_si ? 0x100 : 0); + if ((m_ucr & UCR_PARITY_ENABLED) && (m_ucr & UCR_WORD_LENGTH_MASK) == UCR_WORD_LENGTH_8) + { + // check calculated parity of 8-bit sync character + if ((m_rframe & 0xff) == m_scr && m_last_si == ((m_ucr & UCR_PARITY_EVEN) ? m_scr_parity : !m_scr_parity)) + { + rx_sync_found(); + rx_frame_start(); + } + } + else + { + // parity, if any, must be included in SCR when words are less than 8 bits + int frame_bits = ((m_ucr & UCR_PARITY_ENABLED) ? 9 : 8) - ((m_ucr & UCR_WORD_LENGTH_MASK) >> 5); + if ((m_rframe >> (9 - frame_bits)) == (m_scr & ((1 << frame_bits) - 1))) + { + rx_sync_found(); + rx_frame_start(); + } + } + } + else if (sync_mode || (m_rsr & RSR_CHAR_IN_PROGRESS)) + { + if (m_rbits > 8) + { + rx_async_frame_complete(); + m_rframe = m_last_si ? 0x100 : 0; + m_rsr &= ~RSR_CHAR_IN_PROGRESS; + } + else + { + LOGMASKED(LOG_RCV, "USART shifting in %d %s bit\n", m_last_si, m_rbits < 8 ? "data" : "parity"); + m_rframe = (m_rframe >> 1) | (m_last_si ? 0x100 : 0); + if (m_last_si) + m_rparity = !m_rparity; + m_rbits++; + + if (m_rbits == 8) + { + // adjust for fewer than 8 data bits + m_rframe >>= (m_ucr & UCR_WORD_LENGTH_MASK) >> 5; + + // adjust for no parity + if (!(m_ucr & UCR_PARITY_ENABLED)) + { + m_rframe >>= 1; + m_rparity = false; + m_rbits++; + } + } + + if (m_rbits > 8 && sync_mode) + { + rx_sync_frame_complete(); + + // one character follows another in sync mode + rx_frame_start(); + } + } + } + else if (!m_last_si && BIT(m_rframe, 8)) + { + // start bit valid + LOGMASKED(LOG_RCV, "USART received start bit\n"); + m_rsr |= RSR_CHAR_IN_PROGRESS; + rx_frame_start(); + } + } +} + +//------------------------------------------------- +// tx_frame_load - load one character into the +// shift register for transmission +//------------------------------------------------- + +void mc68901_device::tx_frame_load(u8 data) +{ + // set up output shift register + m_osr = data; + m_tbits = 9 - ((m_ucr & UCR_WORD_LENGTH_MASK) >> 5); + m_tparity = (m_ucr & UCR_PARITY_EVEN) == UCR_PARITY_ODD; + + // add start and stop bits for asynchronous mode + if ((m_ucr & UCR_START_STOP_1_2) != UCR_START_STOP_0_0) + { + m_osr = (m_osr << 1) | (1 << m_tbits); + m_tbits += 2; + } +} + +//------------------------------------------------- +// tx_clock - process one active edge on the +// transmitter clock +//------------------------------------------------- + +void mc68901_device::tx_clock() +{ + if (m_tclk != 0) + { + m_tclk--; + return; + } + + m_underrun = false; + + bool sync_mode = (m_ucr & UCR_START_STOP_1_2) == UCR_START_STOP_0_0; + if (m_tbits == (sync_mode ? 2 : 3)) + { + // inject the calculated parity or skip that bit + if (m_ucr & UCR_PARITY_ENABLED) + m_osr = (m_osr << 1) | m_tparity; + else + m_tbits--; + } + + bool send_break = !sync_mode && (m_tsr & TSR_BREAK); + bool tbusy = false; + if (m_tbits != 0) + { + m_tbits--; + if (m_tbits != 0) + tbusy = true; + else if (!(m_tsr & TSR_XMIT_ENABLE)) + { + LOGMASKED(LOG_XMIT, "USART transmitter disabled\n"); + + // transmitter is now effectively disabled + m_tsr |= TSR_END_OF_XMIT; + tx_error(); + + // automatic turnaround enables the receiver + if (m_tsr & TSR_AUTO_TURNAROUND) + { + m_rsr |= RSR_RCV_ENABLE; + m_tsr &= ~TSR_AUTO_TURNAROUND; + } + } + else if ((m_tsr & TSR_BUFFER_EMPTY) && !(m_tsr & TSR_UNDERRUN_ERROR) && !send_break) + { + LOGMASKED(LOG_XMIT, "USART transmitter underrun\n"); + + // underrun error condition + m_tsr |= TSR_UNDERRUN_ERROR; + m_underrun = true; + tx_error(); + } + } + + if (!tbusy && (m_tsr & TSR_XMIT_ENABLE)) + { + // break inhibits reload + if (!(m_tsr & TSR_BUFFER_EMPTY) && !send_break) + { + LOGMASKED(LOG_XMIT, "USART loading character (%02X)\n", m_transmit_buffer); + + // empty buffer into shift register + m_tsr |= TSR_BUFFER_EMPTY; + tx_buffer_empty(); + tx_frame_load(m_transmit_buffer); + tbusy = true; + } + else if (sync_mode) + { + LOGMASKED(LOG_XMIT, "USART loading sync character (%02X)\n", m_scr); + + // transmit sync characters if nothing else is loaded + tx_frame_load(m_scr); + tbusy = true; + } + } + + if (tbusy) + { + LOGMASKED(LOG_XMIT, "USART shifting out %d %s bit\n", BIT(m_osr, 0), + m_tbits == 1 && !sync_mode ? "stop" : m_tbits == (sync_mode ? 1 : 2) ? "parity" : "data or start"); + + // shift out one bit + set_so(BIT(m_osr, 0)); + if (BIT(m_osr, 0)) + m_tparity = !m_tparity; + m_osr >>= 1; + + if (m_tbits == 1 && (m_ucr & UCR_START_STOP_1_2) >= UCR_START_STOP_1_15) + { + // 1½ or 2 stop bits selected + if (m_ucr & UCR_CLOCK_DIVIDE_16) + m_tclk = (m_ucr & UCR_START_STOP_1_2) == UCR_START_STOP_1_2 ? 31 : 23; + else + m_tclk = (m_ucr & UCR_START_STOP_1_2) == UCR_START_STOP_1_2 ? 1 : 0; + } + else if (m_ucr & UCR_CLOCK_DIVIDE_16) + m_tclk = 15; + } + else if (!(m_tsr & TSR_XMIT_ENABLE)) + { + // high/low output on SO (Hi-Z not supported) + set_so((m_tsr & TSR_OUTPUT_MASK) != TSR_OUTPUT_LOW); + } + else if (send_break) + { + set_so(false); + m_tbits = 1; + } + else + { + // asynchronous marking condition + set_so(true); + } } diff --git a/src/devices/machine/mc68901.h b/src/devices/machine/mc68901.h index 93f47ccfd5d..cc792b34900 100644 --- a/src/devices/machine/mc68901.h +++ b/src/devices/machine/mc68901.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Curt Coder +// copyright-holders:Curt Coder, AJR /********************************************************************** Motorola MC68901 Multi Function Peripheral emulation @@ -38,8 +38,6 @@ #pragma once -#include "diserial.h" - //************************************************************************** // TYPE DEFINITIONS @@ -48,19 +46,14 @@ // ======================> mc68901_device -class mc68901_device : public device_t, - public device_serial_interface +class mc68901_device : public device_t { public: // construction/destruction - mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); void set_timer_clock(int timer_clock) { m_timer_clock = timer_clock; } - void set_rx_clock(int rx_clock) { m_rx_clock = rx_clock; } - void set_tx_clock(int tx_clock) { m_tx_clock = tx_clock; } void set_timer_clock(const XTAL &xtal) { set_timer_clock(xtal.value()); } - void set_rx_clock(const XTAL &xtal) { set_rx_clock(xtal.value()); } - void set_tx_clock(const XTAL &xtal) { set_tx_clock(xtal.value()); } auto out_irq_cb() { return m_out_irq_cb.bind(); } auto out_gpio_cb() { return m_out_gpio_cb.bind(); } @@ -73,10 +66,10 @@ public: //auto out_tr_cb() { return m_out_tr_cb.bind(); } auto iack_chain_cb() { return m_iack_chain_cb.bind(); } - DECLARE_READ8_MEMBER( read ); - DECLARE_WRITE8_MEMBER( write ); + u8 read(offs_t offset); + void write(offs_t offset, u8 data); - uint8_t get_vector(); + u8 get_vector(); DECLARE_WRITE_LINE_MEMBER( i0_w ); DECLARE_WRITE_LINE_MEMBER( i1_w ); @@ -90,7 +83,9 @@ public: DECLARE_WRITE_LINE_MEMBER( tai_w ); DECLARE_WRITE_LINE_MEMBER( tbi_w ); - DECLARE_WRITE_LINE_MEMBER( write_rx ); + DECLARE_WRITE_LINE_MEMBER( si_w ); + DECLARE_WRITE_LINE_MEMBER( rc_w ); + DECLARE_WRITE_LINE_MEMBER( tc_w ); protected: // device-level overrides @@ -98,20 +93,25 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - // device_serial_interface overrides - virtual void tra_callback() override; - virtual void tra_complete() override; - virtual void rcv_complete() override; - void check_interrupts(); - void take_interrupt(uint16_t mask); + void take_interrupt(u16 mask); + void tx_buffer_empty(); + void tx_error(); void rx_buffer_full(); void rx_error(); void timer_count(int index); void timer_input(int index, int value); void gpio_input(int bit, int state); void gpio_output(); - void register_w(offs_t offset, uint8_t data); + + void set_so(bool state); + void rx_frame_start(); + void rx_sync_found(); + void rx_async_frame_complete(); + void rx_sync_frame_complete(); + void rx_clock(bool si); + void tx_frame_load(u8 data); + void tx_clock(); private: enum @@ -199,14 +199,12 @@ private: XMIT_STOPPING }; - static const int INT_MASK_GPIO[]; - static const int INT_MASK_TIMER[]; + static const u16 INT_MASK_GPIO[]; + static const u16 INT_MASK_TIMER[]; static const int GPIO_TIMER[]; static const int PRESCALER[]; int m_timer_clock; /* timer clock */ - int m_rx_clock; /* serial receive clock */ - int m_tx_clock; /* serial transmit clock */ devcb_write_line m_out_irq_cb; @@ -223,49 +221,59 @@ private: devcb_read8 m_iack_chain_cb; - //int m_device_type; /* device type */ - - /* registers */ - uint8_t m_gpip; /* general purpose I/O register */ - uint8_t m_aer; /* active edge register */ - uint8_t m_ddr; /* data direction register */ - - uint16_t m_ier; /* interrupt enable register */ - uint16_t m_ipr; /* interrupt pending register */ - uint16_t m_isr; /* interrupt in-service register */ - uint16_t m_imr; /* interrupt mask register */ - uint8_t m_vr; /* vector register */ - - uint8_t m_tacr; /* timer A control register */ - uint8_t m_tbcr; /* timer B control register */ - uint8_t m_tcdcr; /* timers C and D control register */ - uint8_t m_tdr[4]; /* timer data registers */ - - uint8_t m_scr; /* synchronous character register */ - uint8_t m_ucr; /* USART control register */ - uint8_t m_tsr; /* transmitter status register */ - uint8_t m_rsr; /* receiver status register */ - uint8_t m_transmit_buffer; /* USART data register */ - bool m_transmit_pending; - uint8_t m_receive_buffer; - bool m_overrun_pending; - uint8_t m_gpio_input; - uint8_t m_gpio_output; - - /* counter timer state */ - uint8_t m_tmc[4]; /* timer main counters */ - int m_ti[4]; /* timer in latch */ - int m_to[4]; /* timer out latch */ - - /* interrupt state */ - //int m_irqlevel; /* interrupt level latch */ - - /* serial state */ - uint8_t m_next_rsr; /* receiver status register latch */ - int m_rsr_read; /* receiver status register read flag */ + // registers + u8 m_gpip; // general purpose I/O register + u8 m_aer; // active edge register + u8 m_ddr; // data direction register + + u16 m_ier; // interrupt enable register + u16 m_ipr; // interrupt pending register + u16 m_isr; // interrupt in-service register + u16 m_imr; // interrupt mask register + u8 m_vr; // vector register + + u8 m_tacr; // timer A control register + u8 m_tbcr; // timer B control register + u8 m_tcdcr; // timers C and D control register + u8 m_tdr[4]; // timer data registers + + u8 m_scr; // synchronous character register + bool m_scr_parity; // parity of sync character + u8 m_ucr; // USART control register + u8 m_tsr; // transmitter status register + u8 m_rsr; // receiver status register + u8 m_transmit_buffer; // USART data register + u8 m_receive_buffer; + u8 m_gpio_input; + u8 m_gpio_output; + + // counter timer state + u8 m_tmc[4]; // timer main counters + int m_ti[4]; // timer in latch + int m_to[4]; // timer out latch + + // serial receiver state + u16 m_rframe; // receiver frame shift register + u8 m_rclk; // receiver clock counter + u8 m_rbits; // receiver bit counter + u8 m_si_scan; // receiver bitstream scan + u8 m_next_rsr; // receiver status register latch + bool m_rc; // receiver clock input + bool m_si; // serial data input + bool m_last_si; // synchronized serial data input + bool m_rparity; // receiver data parity + + // serial transmitter state + u16 m_osr; // output shift register + u8 m_tclk; // transmit clock counter + u8 m_tbits; // transmit bit counter + bool m_tc; // transmit clock input + bool m_so; // serial data output + bool m_tparity; // transmit data transmit + bool m_underrun; // underrun preset time // timers - emu_timer *m_timer[4]; /* counter timers */ + emu_timer *m_timer[4]; // counter timers }; diff --git a/src/devices/machine/microtch.cpp b/src/devices/machine/microtch.cpp index 6d4ae2c246f..c9d60a4b932 100644 --- a/src/devices/machine/microtch.cpp +++ b/src/devices/machine/microtch.cpp @@ -9,6 +9,49 @@ - calibration mode (command CX) - only tablet format and decimal format are supported for returning touch screen state +Known MicroTouch boards use an 80C32 (compatible: Siemens, Winbond, Philips, MHS, etc.) with external ROM and a custom MicroTouch MCU. +It seems there are different MicroTouch MCU versions, named "Kahuna", "Excalibur", and probably others, with unknown differences. + + +ISA board ((c) 1997 MicroTouch Systems Inc. FAB 5405800 REV 2.3) +_________________________________________________________________ +| ______ ______ | +| MM74HC04M HC125A ____ | +| 34072 __|__ +| _______ ____ ____ ____ ____ | | +| R11APB18 78M05 34072 34072 93C46S | DB | +| ___________ __________ ____________ | 25 | +| |SIEMENS | |U1 BIOS | |MicroTouch| |(P1)| +| |SAB 80C32 | | | |Excalibur | |____| +| |__________| |_________| |__________| | +| ________ _______ __________ O <- LED +| |_LS240_| DM74LS30M |TI | | +| JP2->::::: |TL16C450FN ________ | +| JP1->:::::::::::::: |_________| |_LS245_| | +|__ ___ _____ | + |_|_|_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_| + ISA EDGE CONNECTOR + +JP1 = ADDRESS / INTERRUPT (A1, A2, A3, A4, A5, A6, I2, I3, I4, I5, I10, I11, I12, I15) +JP2 = TEST (T1, T2, T3, T4, T5, T6) +Y1 = XTAL R11APB18 +U3 = MicroTouch Excalibur +U4 = 80C32 +U11 = 93C46S Serial EEPROM +P1 = RS-232 + + JP1 ADDRESS JUMPERS +COM ADDRESS A1 A2 A3 A4 A5 A6 +-------------------------------- +COM1 3F8-3FF ON : ON : ON : +COM2 2F8-2FF : ON ON : ON : +COM3 3E8-3EF ON : : ON ON : <- DEFAULT +COM4 2E8-2EF : ON : ON ON : +COM5 3E0-2E7 : ON : ON : ON +COM6 2F0-2F7 : ON ON : : ON +COM7 3E0-3E7 ON : : ON : ON +COM8 3F0-3F7 ON : ON : : ON + */ #include "emu.h" @@ -312,6 +355,15 @@ INPUT_CHANGED_MEMBER( microtouch_device::touch ) } } +// BIOS not hooked up +ROM_START(microtouch) + ROM_REGION(0x10000, "bios", 0) + ROM_SYSTEM_BIOS(0, "microtouch_5_6", "MicroTouch Rev.5.6") // "Excalibur", ISA card + ROMX_LOAD("microtouch_560410_rev_5.6.u1", 0x0000, 0x10000, CRC(d19ee080) SHA1(c695405ec8c2ac4408a63bacfc68a5a4b878928c), ROM_BIOS(0)) // 27c512 + ROM_SYSTEM_BIOS(1, "microtouch_5_5", "MicroTouch Rev.5.5") // "Kahuna", daughterboard integrated on monitor + ROMX_LOAD("microtouch_5603920_rev_5.5.u1", 0x0000, 0x08000, CRC(5cc164e7) SHA1(753277ce54e8be1b759c37ae760fe4a6846d1fae), ROM_BIOS(1)) +ROM_END + static INPUT_PORTS_START(microtouch) PORT_START("TOUCH") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME( "Touch screen" ) PORT_CHANGED_MEMBER( DEVICE_SELF,microtouch_device, touch, 0 ) @@ -339,3 +391,9 @@ void microtouch_device::tra_complete() m_output_valid = false; } } + +const tiny_rom_entry *microtouch_device::device_rom_region() const +{ + return ROM_NAME(microtouch); +} + diff --git a/src/devices/machine/microtch.h b/src/devices/machine/microtch.h index ed56310baca..2f955955e03 100644 --- a/src/devices/machine/microtch.h +++ b/src/devices/machine/microtch.h @@ -33,6 +33,9 @@ protected: virtual void tra_complete() override; virtual void rcv_complete() override; + // ROM region (unused, as the device is HLE'd) + virtual const tiny_rom_entry *device_rom_region() const override; + private: int check_command( const char* commandtocheck, int command_len, uint8_t* command_data ); void send_format_table_packet(uint8_t flag, int x, int y); diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index 6d2225fe9fc..799dbe7d640 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -36,8 +36,6 @@ #define MOVE_UNIQUE_PTR(x) (x) #endif - - DEFINE_DEVICE_TYPE(NETLIST_CORE, netlist_mame_device, "netlist_core", "Netlist Core Device") DEFINE_DEVICE_TYPE(NETLIST_CPU, netlist_mame_cpu_device, "netlist_cpu", "Netlist CPU Device") DEFINE_DEVICE_TYPE(NETLIST_SOUND, netlist_mame_sound_device, "netlist_sound", "Netlist Sound Device") @@ -182,12 +180,12 @@ public: m_cpu_device = downcast<netlist_mame_cpu_device *>(&nl->parent()); } - ATTR_COLD void reset() override + void reset() override { m_last = 0.0; } - ATTR_COLD void register_callback(netlist_mame_analog_output_device::output_delegate &&callback) + void register_callback(netlist_mame_analog_output_device::output_delegate &&callback) { m_callback.reset(new netlist_mame_analog_output_device::output_delegate(std::move(callback))); } @@ -240,12 +238,12 @@ public: m_cpu_device = downcast<netlist_mame_cpu_device *>(&nl->parent()); } - ATTR_COLD void reset() override + void reset() override { m_last = 0; } - ATTR_COLD void register_callback(netlist_mame_logic_output_device::output_delegate &&callback) + void register_callback(netlist_mame_logic_output_device::output_delegate &&callback) { m_callback.reset(new netlist_mame_logic_output_device::output_delegate(std::move(callback))); } @@ -418,42 +416,21 @@ public: , m_offset(*this, "OFFSET", 0.0) , m_buffer(nullptr) , m_bufsize(0) - , m_sample_time(netlist::netlist_time::from_hz(1)) //sufficiently big enough + , m_sample_time(netlist::netlist_time::from_hz(1)) , m_in(*this, "IN") , m_cur(0.0) , m_last_pos(0) - , m_last_buffer_time(*this, "m_last_buffer", netlist::netlist_time::zero()) + , m_last_buffer_time(*this, "m_last_buffer", netlist::netlist_time_ext::zero()) { } - //static const int BUFSIZE = 2048; +protected: - ATTR_COLD void reset() override + void reset() override { m_cur = 0.0; m_last_pos = 0; - m_last_buffer_time = netlist::netlist_time::zero(); - } - - ATTR_HOT void sound_update(const netlist::netlist_time &upto) - { - int pos = (upto - m_last_buffer_time) / m_sample_time; - if (pos > m_bufsize) - throw emu_fatalerror("sound %s: pos %d exceeded bufsize %d\n", name().c_str(), pos, m_bufsize); - while (m_last_pos < pos ) - { - m_buffer[m_last_pos++] = (stream_sample_t) m_cur; - } - } - - ATTR_HOT void sound_update_fill(int samples) - { - if (samples > m_bufsize) - throw emu_fatalerror("sound %s: pos %d exceeded bufsize %d\n", name().c_str(), samples, m_bufsize); - while (m_last_pos < samples ) - { - m_buffer[m_last_pos++] = (stream_sample_t) m_cur; - } + m_last_buffer_time = netlist::netlist_time_ext::zero(); } NETLIB_UPDATEI() @@ -471,12 +448,34 @@ public: } public: - ATTR_HOT void buffer_reset(const netlist::netlist_time &upto) + void buffer_reset(const netlist::netlist_time_ext &upto) { m_last_pos = 0; m_last_buffer_time = upto; } + void sound_update(const netlist::netlist_time_ext &upto) + { + int pos = (upto - m_last_buffer_time()) / m_sample_time; + if (pos > m_bufsize) + throw emu_fatalerror("sound %s: pos %d exceeded bufsize %d\n", name().c_str(), pos, m_bufsize); + while (m_last_pos < pos ) + { + m_buffer[m_last_pos++] = (stream_sample_t) m_cur; + } + } + + void sound_update_fill(int samples) + { + if (samples > m_bufsize) + throw emu_fatalerror("sound %s: pos %d exceeded bufsize %d\n", name().c_str(), samples, m_bufsize); + while (m_last_pos < samples ) + { + m_buffer[m_last_pos++] = (stream_sample_t) m_cur; + } + } + + netlist::param_int_t m_channel; netlist::param_fp_t m_mult; netlist::param_fp_t m_offset; @@ -489,7 +488,7 @@ private: netlist::analog_input_t m_in; double m_cur; int m_last_pos; - netlist::state_var<netlist::netlist_time> m_last_buffer_time; + netlist::state_var<netlist::netlist_time_ext> m_last_buffer_time; }; // ---------------------------------------------------------------------------------------- @@ -504,10 +503,11 @@ public: NETLIB_NAME(sound_in)(netlist::netlist_state_t &anetlist, const pstring &name) : netlist::device_t(anetlist, name) - , m_inc(netlist::netlist_time::from_nsec(1)) + , m_sample_time(netlist::netlist_time::from_nsec(1)) , m_feedback(*this, "FB") // clock part , m_Q(*this, "Q") , m_pos(0) + , m_samples(0) , m_num_channels(0) { connect(m_feedback, m_Q); @@ -520,16 +520,44 @@ public: } } - ATTR_COLD void reset() override +protected: + void reset() override { m_pos = 0; for (auto & elem : m_channels) elem.m_buffer = nullptr; } - ATTR_COLD void resolve() + NETLIB_UPDATEI() + { + if (m_pos < m_samples) + { + for (int i=0; i<m_num_channels; i++) + { + if (m_channels[i].m_buffer == nullptr) + break; // stop, called outside of stream_update + const nl_fptype v = m_channels[i].m_buffer[m_pos]; + m_channels[i].m_param->setTo(v * (*m_channels[i].m_param_mult)() + (*m_channels[i].m_param_offset)()); + } + } + else + { + // FIXME: The logic has a rounding issue because time resolution divided + // by 48,000 is not a natural number. The fractional part + // adds up to one samples every 13 seconds for 100 ps resolution. + // Fixing this is possible but complicated and expensive. + } + m_pos++; + + m_Q.net().toggle_and_push_to_queue(m_sample_time); + } + +public: + void resolve(netlist::netlist_time sample_time) { m_pos = 0; + m_sample_time = sample_time; + for (int i = 0; i < MAX_INPUT_CHANNELS; i++) { if ((*m_channels[i].m_param_name)() != pstring("")) @@ -542,23 +570,17 @@ public: } } - NETLIB_UPDATEI() + template <typename S> + void buffer_reset(netlist::netlist_time sample_time, int num_samples, S **inputs) { - for (int i=0; i<m_num_channels; i++) - { - if (m_channels[i].m_buffer == nullptr) - break; // stop, called outside of stream_update - const nl_fptype v = m_channels[i].m_buffer[m_pos]; - m_channels[i].m_param->setTo(v * (*m_channels[i].m_param_mult)() + (*m_channels[i].m_param_offset)()); - } - m_pos++; - m_Q.net().toggle_and_push_to_queue(m_inc); - } + m_samples = num_samples; + m_sample_time = sample_time; -public: - ATTR_HOT void buffer_reset() - { m_pos = 0; + for (int i=0; i < m_num_channels; i++) + { + m_channels[i].m_buffer = inputs[i]; + } } struct channel @@ -569,16 +591,18 @@ public: netlist::unique_pool_ptr<netlist::param_fp_t> m_param_mult; netlist::unique_pool_ptr<netlist::param_fp_t> m_param_offset; }; - channel m_channels[MAX_INPUT_CHANNELS]; - netlist::netlist_time m_inc; int num_channels() { return m_num_channels; } private: + channel m_channels[MAX_INPUT_CHANNELS]; + netlist::netlist_time m_sample_time; + netlist::logic_input_t m_feedback; netlist::logic_output_t m_Q; int m_pos; + int m_samples; int m_num_channels; }; @@ -967,9 +991,9 @@ void netlist_mame_stream_input_device::custom_netlist_additions(netlist::netlist pstring sparam = plib::pfmt("STREAM_INPUT.CHAN{1}")(m_channel); nlstate.setup().register_param(sparam, pstring(m_param_name)); sparam = plib::pfmt("STREAM_INPUT.MULT{1}")(m_channel); - nlstate.setup().register_param(sparam, m_mult); + nlstate.setup().register_param_val(sparam, m_mult); sparam = plib::pfmt("STREAM_INPUT.OFFSET{1}")(m_channel); - nlstate.setup().register_param(sparam, m_offset); + nlstate.setup().register_param_val(sparam, m_offset); } // ---------------------------------------------------------------------------------------- @@ -1003,9 +1027,9 @@ void netlist_mame_stream_output_device::custom_netlist_additions(netlist::netlis //snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.register_dev("nld_sound_out", sname)); nlstate.setup().register_dev("NETDEV_SOUND_OUT", sname); - nlstate.setup().register_param(sname + ".CHAN" , m_channel); - nlstate.setup().register_param(sname + ".MULT", m_mult); - nlstate.setup().register_param(sname + ".OFFSET", m_offset); + nlstate.setup().register_param_val(sname + ".CHAN" , m_channel); + nlstate.setup().register_param_val(sname + ".MULT", m_mult); + nlstate.setup().register_param_val(sname + ".OFFSET", m_offset); nlstate.setup().register_link(sname + ".IN", pstring(m_out_name)); } @@ -1022,7 +1046,7 @@ netlist_mame_device::netlist_mame_device(const machine_config &mconfig, const ch netlist_mame_device::netlist_mame_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_icount(0) - , m_old(netlist::netlist_time::zero()) + , m_old(netlist::netlist_time_ext::zero()) , m_setup_func(nullptr) { } @@ -1155,15 +1179,17 @@ void netlist_mame_device::device_start() save_state(); - m_old = netlist::netlist_time::zero(); - m_rem = netlist::netlist_time::zero(); + m_old = netlist::netlist_time_ext::zero(); + m_rem = netlist::netlist_time_ext::zero(); LOGDEVCALLS("device_start exit\n"); } void netlist_mame_device::device_clock_changed() { - m_div = netlist::netlist_time::from_hz(clock()); + m_div = static_cast<netlist::netlist_time_ext>( + (netlist::netlist_time_ext::resolution() << MDIV_SHIFT) / clock()); + //printf("m_div %d\n", (int) m_div.as_raw()); netlist().log().debug("Setting clock {1} and divisor {2}\n", clock(), m_div.as_double()); } @@ -1171,8 +1197,8 @@ void netlist_mame_device::device_clock_changed() void netlist_mame_device::device_reset() { LOGDEVCALLS("device_reset\n"); - m_old = netlist::netlist_time::zero(); - m_rem = netlist::netlist_time::zero(); + m_old = netlist::netlist_time_ext::zero(); + m_rem = netlist::netlist_time_ext::zero(); netlist().exec().reset(); } @@ -1182,7 +1208,7 @@ void netlist_mame_device::device_stop() netlist().exec().stop(); } -ATTR_COLD void netlist_mame_device::device_post_load() +void netlist_mame_device::device_post_load() { LOGDEVCALLS("device_post_load\n"); @@ -1190,20 +1216,20 @@ ATTR_COLD void netlist_mame_device::device_post_load() netlist().rebuild_lists(); } -ATTR_COLD void netlist_mame_device::device_pre_save() +void netlist_mame_device::device_pre_save() { LOGDEVCALLS("device_pre_save\n"); netlist().run_state_manager().pre_save(); } -void netlist_mame_device::update_icount(netlist::netlist_time time) noexcept +void netlist_mame_device::update_icount(netlist::netlist_time_ext time) noexcept { - const netlist::netlist_time newt(time); - const netlist::netlist_time delta(newt - m_old + m_rem); + const netlist::netlist_time_ext delta = (time - m_old).shl(MDIV_SHIFT) + m_rem; const uint64_t d = delta / m_div; - m_old = newt; - m_rem = delta - (m_div * d); + m_old = time; + m_rem = (delta - (m_div * d)); + //printf("d %d m_rem %d\n", (int) d, (int) m_rem.as_raw()); m_icount -= d; } @@ -1213,7 +1239,7 @@ void netlist_mame_device::check_mame_abort_slice() noexcept netlist().exec().abort_current_queue_slice(); } -ATTR_COLD void netlist_mame_device::save_state() +void netlist_mame_device::save_state() { for (auto const & s : netlist().run_state_manager().save_list()) { @@ -1301,17 +1327,17 @@ void netlist_mame_cpu_device::nl_register_devices(netlist::setup_t &lsetup) cons lsetup.factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback", "-"); } -ATTR_COLD uint64_t netlist_mame_cpu_device::execute_clocks_to_cycles(uint64_t clocks) const noexcept +uint64_t netlist_mame_cpu_device::execute_clocks_to_cycles(uint64_t clocks) const noexcept { return clocks; } -ATTR_COLD uint64_t netlist_mame_cpu_device::execute_cycles_to_clocks(uint64_t cycles) const noexcept +uint64_t netlist_mame_cpu_device::execute_cycles_to_clocks(uint64_t cycles) const noexcept { return cycles; } -ATTR_HOT void netlist_mame_cpu_device::execute_run() +void netlist_mame_cpu_device::execute_run() { //m_ppc = m_pc; // copy PC to previous PC if (debugger_enabled()) @@ -1321,13 +1347,13 @@ ATTR_HOT void netlist_mame_cpu_device::execute_run() m_genPC++; m_genPC &= 255; debugger_instruction_hook(m_genPC); - netlist().exec().process_queue(m_div); + netlist().exec().process_queue(nltime_ext_from_clocks(1)); update_icount(netlist().exec().time()); } } else { - netlist().exec().process_queue(m_div * m_icount); + netlist().exec().process_queue(nltime_ext_from_clocks(m_icount)); update_icount(netlist().exec().time()); } } @@ -1441,8 +1467,7 @@ void netlist_mame_sound_device::device_start() if (indevs.size() == 1) { m_in = indevs[0]; - m_in->resolve(); - m_in->m_inc = netlist::netlist_time::from_hz(clock()); + m_in->resolve(nltime_from_clocks(1)); } /* initialize the stream(s) */ @@ -1463,23 +1488,19 @@ void netlist_mame_sound_device::sound_stream_update(sound_stream &stream, stream { e.second->m_buffer = outputs[e.first]; e.second->m_bufsize = samples; + e.second->m_sample_time = nltime_from_clocks(1); } - if (m_in) { - m_in->buffer_reset(); - for (int i=0; i < m_in->num_channels(); i++) - { - m_in->m_channels[i].m_buffer = inputs[i]; - } + m_in->buffer_reset(nltime_from_clocks(1), samples, inputs); } - netlist::netlist_time cur(netlist().exec().time()); - - netlist().exec().process_queue(m_div * samples); + auto cur(netlist().exec().time()); + const auto delta(nltime_ext_from_clocks(samples)); + netlist().exec().process_queue(delta); - cur += (m_div * samples); + cur += delta; for (auto &e : m_out) { diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index a7667940809..9b11b1b5549 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -70,19 +70,32 @@ public: virtual ~netlist_mame_device(); - void set_setup_func(func_type &&func) { m_setup_func = std::move(func); } + void set_setup_func(func_type &&func) noexcept { m_setup_func = std::move(func); } netlist::setup_t &setup(); netlist_mame_t &netlist() noexcept { return *m_netlist; } - void update_icount(netlist::netlist_time time) noexcept; + void update_icount(netlist::netlist_time_ext time) noexcept; void check_mame_abort_slice() noexcept; static void register_memregion_source(netlist::nlparse_t &setup, device_t &dev, const char *name); int m_icount; + static constexpr const unsigned MDIV_SHIFT = 16; + + netlist::netlist_time_ext nltime_ext_from_clocks(unsigned c) const noexcept + { + return (m_div * c).shr(MDIV_SHIFT); + } + + netlist::netlist_time nltime_from_clocks(unsigned c) const noexcept + { + return static_cast<netlist::netlist_time>((m_div * c).shr(MDIV_SHIFT)); + } + protected: + netlist_mame_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // Custom to netlist ... @@ -98,8 +111,6 @@ protected: virtual void device_pre_save() override; virtual void device_clock_changed() override; - netlist::netlist_time m_div; - plib::unique_ptr<netlist::netlist_state_t> base_validity_check(validity_checker &valid) const; private: @@ -107,9 +118,9 @@ private: void common_dev_start(netlist::netlist_state_t *lnetlist) const; - /* timing support here - so sound can hijack it ... */ - netlist::netlist_time m_rem; - netlist::netlist_time m_old; + netlist::netlist_time_ext m_div; + netlist::netlist_time_ext m_rem; + netlist::netlist_time_ext m_old; std::unique_ptr<netlist_mame_t> m_netlist; diff --git a/src/devices/machine/ram.cpp b/src/devices/machine/ram.cpp index 1f4712392fa..30195810ac2 100644 --- a/src/devices/machine/ram.cpp +++ b/src/devices/machine/ram.cpp @@ -12,8 +12,8 @@ #include "ram.h" #include "emuopts.h" -#include <stdio.h> -#include <ctype.h> +#include <cstdio> +#include <cctype> #include <algorithm> #include <functional> diff --git a/src/devices/machine/s3520cf.cpp b/src/devices/machine/s3520cf.cpp index a272a85740c..bdd29a0d33f 100644 --- a/src/devices/machine/s3520cf.cpp +++ b/src/devices/machine/s3520cf.cpp @@ -25,6 +25,7 @@ TODO: // device type definition DEFINE_DEVICE_TYPE(S3520CF, s3520cf_device, "s3520cf", "Seiko Epson S-3520CF RTC") +DEFINE_DEVICE_TYPE(RTC4553, rtc4553_device, "rtc4553", "Epson RTC-4553 RTC/SRAM") // functionally same as above but integrated oscillator //************************************************************************** @@ -35,41 +36,55 @@ DEFINE_DEVICE_TYPE(S3520CF, s3520cf_device, "s3520cf", "Seiko Epson S-3520CF RTC // s3520cf_device - constructor //------------------------------------------------- -s3520cf_device::s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, S3520CF, tag, owner, clock) - , m_dir(0), m_latch(0), m_reset_line(0), m_read_latch(0), m_current_cmd(0), m_cmd_stream_pos(0), m_rtc_addr(0), m_mode(0), m_sysr(0), m_rtc_state() +s3520cf_device::s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : s3520cf_device(mconfig, S3520CF, tag, owner, clock) { } -TIMER_CALLBACK_MEMBER(s3520cf_device::timer_callback) +s3520cf_device::s3520cf_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_nvram_interface(mconfig, *this) + , m_region(*this, DEVICE_SELF) + , m_dir(0), m_latch(0), m_reset_line(0), m_read_latch(0), m_bitstream(0), m_stream_pos(0), m_mode(0), m_sysr(0), m_cntrl1(0), m_cntrl2(0) { - static constexpr uint8_t dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; - int dpm_count; +} - m_rtc.sec++; +void s3520cf_device::check_overflow() +{ + static constexpr u8 dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; + int dpm_count; - if((m_rtc.sec & 0x0f) >= 0x0a) { m_rtc.sec+=0x10; m_rtc.sec&=0xf0; } - if((m_rtc.sec & 0xf0) >= 0x60) { m_rtc.min++; m_rtc.sec = 0; } - if((m_rtc.min & 0x0f) >= 0x0a) { m_rtc.min+=0x10; m_rtc.min&=0xf0; } - if((m_rtc.min & 0xf0) >= 0x60) { m_rtc.hour++; m_rtc.min = 0; } - if((m_rtc.hour & 0x0f) >= 0x0a) { m_rtc.hour+=0x10; m_rtc.hour&=0xf0; } - if((m_rtc.hour & 0xff) >= 0x24) { m_rtc.day++; m_rtc.wday++; m_rtc.hour = 0; } - if(m_rtc.wday >= 7) { m_rtc.wday = 0; } - if((m_rtc.day & 0x0f) >= 0x0a) { m_rtc.day+=0x10; m_rtc.day&=0xf0; } + if ((m_rtc.sec & 0x0f) >= 0x0a) { m_rtc.sec += 0x10; m_rtc.sec &= 0xf0; } + if ((m_rtc.sec & 0xf0) >= 0x60) { m_rtc.min++; m_rtc.sec = 0; } + if ((m_rtc.min & 0x0f) >= 0x0a) { m_rtc.min += 0x10; m_rtc.min &= 0xf0; } + if ((m_rtc.min & 0xf0) >= 0x60) { m_rtc.hour++; m_rtc.min = 0; } + if ((m_rtc.hour & 0x0f) >= 0x0a) { m_rtc.hour += 0x10; m_rtc.hour &= 0xf0; } + if ((m_rtc.hour & 0xff) >= 0x24) { m_rtc.day++; m_rtc.wday++; m_rtc.hour = 0; } + if (m_rtc.wday >= 7) { m_rtc.wday = 0; } + if ((m_rtc.day & 0x0f) >= 0x0a) { m_rtc.day += 0x10; m_rtc.day &= 0xf0; } /* TODO: crude leap year support */ - dpm_count = (m_rtc.month & 0xf) + (((m_rtc.month & 0x10) >> 4)*10)-1; + dpm_count = (m_rtc.month & 0xf) + (((m_rtc.month & 0x10) >> 4) * 10) - 1; - if(((m_rtc.year % 4) == 0) && m_rtc.month == 2) + if (((m_rtc.year % 4) == 0) && m_rtc.month == 2) { - if((m_rtc.day & 0xff) >= dpm[dpm_count]+1+1) - { m_rtc.month++; m_rtc.day = 0x01; } + if ((m_rtc.day & 0xff) >= dpm[dpm_count] + 1 + 1) + { + m_rtc.month++; m_rtc.day = 0x01; + } } - else if((m_rtc.day & 0xff) >= dpm[dpm_count]+1){ m_rtc.month++; m_rtc.day = 0x01; } - if((m_rtc.month & 0x0f) >= 0x0a) { m_rtc.month = 0x10; } - if(m_rtc.month >= 0x13) { m_rtc.year++; m_rtc.month = 1; } - if((m_rtc.year & 0x0f) >= 0x0a) { m_rtc.year+=0x10; m_rtc.year&=0xf0; } - if((m_rtc.year & 0xf0) >= 0xa0) { m_rtc.year = 0; } //1901-2000 possible timeframe + else if ((m_rtc.day & 0xff) >= dpm[dpm_count] + 1) { m_rtc.month++; m_rtc.day = 0x01; } + if ((m_rtc.month & 0x0f) >= 0x0a) { m_rtc.month = 0x10; } + if (m_rtc.month >= 0x13) { m_rtc.year++; m_rtc.month = 1; } + if ((m_rtc.year & 0x0f) >= 0x0a) { m_rtc.year += 0x10; m_rtc.year &= 0xf0; } + if ((m_rtc.year & 0xf0) >= 0xa0) { m_rtc.year = 0; } //1901-2000 possible timeframe +} + + +TIMER_CALLBACK_MEMBER(s3520cf_device::timer_callback) +{ + m_rtc.sec++; + check_overflow(); } @@ -103,6 +118,25 @@ void s3520cf_device::device_start() m_rtc.hour = ((systime.local_time.hour / 10)<<4) | ((systime.local_time.hour % 10) & 0xf); m_rtc.min = ((systime.local_time.minute / 10)<<4) | ((systime.local_time.minute % 10) & 0xf); m_rtc.sec = ((systime.local_time.second / 10)<<4) | ((systime.local_time.second % 10) & 0xf); + + save_item(NAME(m_dir)); + save_item(NAME(m_latch)); + save_item(NAME(m_reset_line)); + save_item(NAME(m_read_latch)); + save_item(NAME(m_bitstream)); + save_item(NAME(m_stream_pos)); + save_item(NAME(m_mode)); + save_item(NAME(m_sysr)); + save_item(NAME(m_cntrl1)); + save_item(NAME(m_cntrl2)); + save_item(NAME(m_rtc.sec)); + save_item(NAME(m_rtc.min)); + save_item(NAME(m_rtc.hour)); + save_item(NAME(m_rtc.day)); + save_item(NAME(m_rtc.wday)); + save_item(NAME(m_rtc.month)); + save_item(NAME(m_rtc.year)); + save_item(NAME(m_nvdata)); } @@ -116,29 +150,64 @@ void s3520cf_device::device_reset() } //------------------------------------------------- -// rtc_read - used to route RTC reading registers +// nvram_default - called to initialize NVRAM to +// its default state //------------------------------------------------- -inline uint8_t s3520cf_device::rtc_read(uint8_t offset) +void s3520cf_device::nvram_default() { - uint8_t res; + for (auto & elem : m_nvdata) + elem = 0x00; - res = 0; + if (!m_region.found()) + logerror("s3520cf(%s) region not found\n", tag()); + else if (m_region->bytes() != 15) + logerror("s3520cf(%s) region length 0x%x expected 0x%x\n", tag(), m_region->bytes(), 15); + else + memcpy(m_nvdata, m_region->base(), 15); +} - if(m_mode != 0) - { - if(offset == 0xf) - res = (m_sysr << 3) | m_mode; - else +//------------------------------------------------- +// nvram_read - called to read NVRAM from the +// .nv file +//------------------------------------------------- + +void s3520cf_device::nvram_read(emu_file &file) +{ + file.read(m_nvdata, 15); +} + +//------------------------------------------------- +// nvram_write - called to write NVRAM to the +// .nv file +//------------------------------------------------- + +void s3520cf_device::nvram_write(emu_file &file) +{ + file.write(m_nvdata, 15); +} + +//------------------------------------------------- +// rtc_read - used to route RTC reading registers +//------------------------------------------------- + +inline u8 s3520cf_device::rtc_read(u8 offset) +{ + u8 res = 0; + + if (offset == 0xf) + res = (m_sysr << 3) | m_mode; + else + if (m_mode > 1) { - res = 0; - printf("Warning: S-3520CF RTC reads SRAM %02x %02x\n",offset,m_mode); + if (m_mode > 2) + offset += 15; + res = (m_nvdata[offset / 2] >> ((offset & 1) * 4)) & 0xf; } - } - else - { - switch(offset) + else { + switch (offset) + { case 0x0: res = m_rtc.sec & 0xf; break; case 0x1: res = m_rtc.sec >> 4; break; case 0x2: res = m_rtc.min & 0xf; break; @@ -152,24 +221,56 @@ inline uint8_t s3520cf_device::rtc_read(uint8_t offset) case 0xa: res = m_rtc.month >> 4; break; case 0xb: res = m_rtc.year & 0xf; break; case 0xc: res = m_rtc.year >> 4; break; + case 0xd: res = m_cntrl1; break; + case 0xe: res = m_cntrl2; break; + } } - } return res; } -inline void s3520cf_device::rtc_write(uint8_t offset,uint8_t data) +inline void s3520cf_device::rtc_write(u8 offset,u8 data) { if(offset == 0xf) { m_mode = data & 3; m_sysr = (data & 8) >> 3; - printf("%02x\n",data); + if (m_sysr) + { + m_rtc.wday = m_rtc.hour = m_rtc.min = m_rtc.sec = 0; + m_rtc.year = m_rtc.month = m_rtc.day = 1; + } } else { - if(m_mode != 0) - printf("Warning: S-3520CF RTC writes SRAM %02x %d\n",offset,m_mode); + if (m_mode > 1) + { + if (m_mode > 2) + offset += 15; + if (offset & 1) + m_nvdata[offset / 2] = (m_nvdata[offset / 2] & 0xf) | (data << 4); + else + m_nvdata[offset / 2] = (m_nvdata[offset / 2] & 0xf0) | (data & 0xf); + } + else + switch (offset) + { + case 0x0: m_rtc.sec = (m_cntrl1 & 2) ? 0 : m_rtc.sec + 1; check_overflow(); break; + case 0x1: m_rtc.sec = (m_cntrl1 & 2) ? 0 : m_rtc.sec + 0x10; check_overflow(); break; + case 0x2: m_rtc.min = (m_cntrl1 & 2) ? 0 : m_rtc.min + 1; check_overflow(); break; + case 0x3: m_rtc.min = (m_cntrl1 & 2) ? 0 : m_rtc.min + 0x10; check_overflow(); break; + case 0x4: m_rtc.hour = (m_cntrl1 & 2) ? 0 : m_rtc.hour + 1; check_overflow(); break; + case 0x5: m_rtc.hour = (m_cntrl1 & 2) ? 0 : m_rtc.hour; check_overflow(); break; + case 0x6: m_rtc.wday = (m_cntrl1 & 2) ? 0 : m_rtc.wday + 1; check_overflow(); break; + case 0x7: m_rtc.day = (m_cntrl1 & 2) ? 1 : m_rtc.day + 1; check_overflow(); break; + case 0x8: m_rtc.day = (m_cntrl1 & 2) ? 1 : m_rtc.day + 0x10; check_overflow(); break; + case 0x9: m_rtc.month = (m_cntrl1 & 2) ? 1: m_rtc.month + 1; check_overflow(); break; + case 0xa: m_rtc.month = (m_cntrl1 & 2) ? 1 : m_rtc.month + 0x10; check_overflow(); break; + case 0xb: m_rtc.year = (m_cntrl1 & 2) ? m_rtc.year & 0xf0 : m_rtc.year + 1; check_overflow(); break; + case 0xc: m_rtc.year = (m_cntrl1 & 2) ? m_rtc.year & 0x0f : m_rtc.year + 0x10; check_overflow(); break; + case 0xd: m_cntrl1 = data & 0xf; + case 0xe: m_cntrl2 = data & 0xf; + } } } @@ -199,10 +300,8 @@ WRITE_LINE_MEMBER( s3520cf_device::set_cs_line ) if(m_reset_line != CLEAR_LINE) { //printf("Reset asserted\n"); - m_current_cmd = 0; - m_cmd_stream_pos = 0; - m_rtc_state = RTC_SET_ADDRESS; - //m_latch = 0; + m_stream_pos = 0; + //m_latch = 0; // should be high impedance } } @@ -214,50 +313,26 @@ WRITE_LINE_MEMBER( s3520cf_device::write_bit ) WRITE_LINE_MEMBER( s3520cf_device::set_clock_line ) { + // NOTE: this device use 1-cycle (8 clocks) delayed data output if(state == 1 && m_reset_line == CLEAR_LINE) { //printf("%d %d\n",m_latch, m_dir); + m_read_latch = m_bitstream & 1; + m_bitstream = (m_bitstream >> 1) | ((m_latch & 1) << 7); + m_stream_pos = (m_stream_pos + 1) & 7; - switch(m_rtc_state) + if (m_stream_pos == 0) { - case RTC_SET_ADDRESS: - m_current_cmd = (m_current_cmd >> 1) | ((m_latch<<3)&8); - m_cmd_stream_pos++; - - if(m_cmd_stream_pos == 4) - { - m_rtc_addr = (m_current_cmd) & 0xf; - m_rtc_state = RTC_SET_DATA; - m_cmd_stream_pos = 0; - m_current_cmd = 0; - } - break; - case RTC_SET_DATA: - if(m_dir == 1) // READ - { - //if(m_cmd_stream_pos == 0) - { - //printf("%02x %d\n",m_rtc_addr,m_cmd_stream_pos); - } - m_read_latch = (rtc_read((m_rtc_addr+1) & 0xf) >> (m_cmd_stream_pos)) & 1; /* TODO: +1??? */ - } - - m_current_cmd = (m_current_cmd >> 1) | ((m_latch<<3)&8); - m_cmd_stream_pos++; - if(m_cmd_stream_pos == 4) - { - if(m_dir == 0) // WRITE - { - //printf("%02x %02x\n",m_rtc_addr,m_current_cmd); - rtc_write((m_rtc_addr - 1) & 0xf,m_current_cmd); /* TODO: -1??? */ - } - - m_rtc_addr = m_current_cmd; - m_rtc_state = RTC_SET_ADDRESS; - m_cmd_stream_pos = 0; - m_current_cmd = 0; - } - break; + u8 addr = m_bitstream & 0xf; + if (m_dir == 0) // Write + rtc_write(addr, m_bitstream >> 4); + // Read/Verify + m_bitstream = addr | (rtc_read(addr) << 4); } } } + +rtc4553_device::rtc4553_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : s3520cf_device(mconfig, RTC4553, tag, owner, clock) +{ +} diff --git a/src/devices/machine/s3520cf.h b/src/devices/machine/s3520cf.h index e05e76ec85a..11e739c9b9e 100644 --- a/src/devices/machine/s3520cf.h +++ b/src/devices/machine/s3520cf.h @@ -18,11 +18,12 @@ Seiko/Epson S-3520CF // ======================> s3520cf_device -class s3520cf_device : public device_t +class s3520cf_device : public device_t, + public device_nvram_interface { public: // construction/destruction - s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 32'768); + s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 32'768); // I/O operations DECLARE_READ_LINE_MEMBER( read_bit ); @@ -33,41 +34,56 @@ public: TIMER_CALLBACK_MEMBER(timer_callback); protected: - enum state_t - { - RTC_SET_ADDRESS = 0, - RTC_SET_DATA - }; + s3520cf_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); struct rtc_regs_t { - uint8_t sec, min, hour, day, wday, month, year; + u8 sec, min, hour, day, wday, month, year; }; // device-level overrides virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override; virtual void device_reset() override; - inline uint8_t rtc_read(uint8_t offset); - inline void rtc_write(uint8_t offset,uint8_t data); + + // device_nvram_interface overrides + virtual void nvram_default() override; + virtual void nvram_read(emu_file &file) override; + virtual void nvram_write(emu_file &file) override; + + optional_memory_region m_region; + + inline u8 rtc_read(u8 offset); + inline void rtc_write(u8 offset, u8 data); + void check_overflow(); int m_dir; int m_latch; int m_reset_line; int m_read_latch; - uint8_t m_current_cmd; - uint8_t m_cmd_stream_pos; - uint8_t m_rtc_addr; - uint8_t m_mode, m_sysr; + u8 m_bitstream, m_stream_pos; + u8 m_mode, m_sysr, m_cntrl1, m_cntrl2; - state_t m_rtc_state; rtc_regs_t m_rtc; + u8 m_nvdata[15]; emu_timer *m_timer; }; +/*************************************************************************** + +Epson RTC-4553 + +***************************************************************************/ + +class rtc4553_device : public s3520cf_device +{ +public: + rtc4553_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 32'768); +}; // device type definition DECLARE_DEVICE_TYPE(S3520CF, s3520cf_device) +DECLARE_DEVICE_TYPE(RTC4553, rtc4553_device) #endif // MAME_MACHINE_S3520CF_H diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp index 3a4201f976d..00fbd49c2c5 100644 --- a/src/devices/machine/s3c2400.cpp +++ b/src/devices/machine/s3c2400.cpp @@ -149,22 +149,6 @@ #define S3C24XX_GPIO_PORT_F S3C2400_GPIO_PORT_F #define S3C24XX_GPIO_PORT_G S3C2400_GPIO_PORT_G - -#define VERBOSE_LEVEL ( 0 ) - -static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) -{ - if (VERBOSE_LEVEL >= n_level) - { - va_list v; - char buf[32768]; - va_start(v, s_fmt); - vsprintf( buf, s_fmt, v); - va_end(v); - device.logerror("%s: %s", device.machine().describe_context( ), buf); - } -} - #define DEVICE_S3C2400 #define S3C24_CLASS_NAME s3c2400_device #include "machine/s3c24xx.hxx" @@ -225,7 +209,7 @@ void s3c2400_device::device_start() { s3c24xx_device_start(); - address_space &space = m_cpu->memory().space(AS_PROGRAM); + address_space &space = m_cpu->space(AS_PROGRAM); space.install_readwrite_handler(0x14000000, 0x1400003b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_memcon_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_memcon_w))); space.install_readwrite_handler(0x14200000, 0x1420005b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_usb_host_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_usb_host_w))); space.install_readwrite_handler(0x14400000, 0x14400017, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_irq_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_irq_w))); diff --git a/src/devices/machine/s3c2400.h b/src/devices/machine/s3c2400.h index dd598177308..8ffff4968ff 100644 --- a/src/devices/machine/s3c2400.h +++ b/src/devices/machine/s3c2400.h @@ -451,10 +451,12 @@ private: }; // internal state - required_device<device_t> m_cpu; + required_device<arm7_cpu_device> m_cpu; required_device<palette_device> m_palette; required_device<screen_device> m_screen; + memory_access_cache<2, 0, ENDIANNESS_LITTLE> *m_cache; + memcon_t m_memcon; usbhost_t m_usbhost; irq_t m_irq; diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp index 52f4243120e..4c5f102123e 100644 --- a/src/devices/machine/s3c2410.cpp +++ b/src/devices/machine/s3c2410.cpp @@ -205,22 +205,6 @@ static const uint32_t MAP_SUBINT_TO_INT[11] = #define S3C24XX_CORE_PIN_OM0 S3C2410_CORE_PIN_OM0 #define S3C24XX_CORE_PIN_OM1 S3C2410_CORE_PIN_OM1 - -#define VERBOSE_LEVEL ( 0 ) - -static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) -{ - if (VERBOSE_LEVEL >= n_level) - { - va_list v; - char buf[32768]; - va_start(v, s_fmt); - vsprintf(buf, s_fmt, v); - va_end(v); - device.logerror("%s: %s", device.machine().describe_context( ), buf); - } -} - #define DEVICE_S3C2410 #define S3C24_CLASS_NAME s3c2410_device #include "machine/s3c24xx.hxx" @@ -287,7 +271,7 @@ void s3c2410_device::device_start() { s3c24xx_device_start(); - address_space &space = m_cpu->memory().space( AS_PROGRAM); + address_space &space = m_cpu->space(AS_PROGRAM); space.install_readwrite_handler( 0x48000000, 0x4800003b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_memcon_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_memcon_w))); space.install_readwrite_handler( 0x49000000, 0x4900005b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_usb_host_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_usb_host_w))); space.install_readwrite_handler( 0x4a000000, 0x4a00001f, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_irq_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_irq_w))); diff --git a/src/devices/machine/s3c2410.h b/src/devices/machine/s3c2410.h index 9057e981528..dd87eba239f 100644 --- a/src/devices/machine/s3c2410.h +++ b/src/devices/machine/s3c2410.h @@ -559,10 +559,12 @@ private: }; // internal state - required_device<device_t> m_cpu; + required_device<arm7_cpu_device> m_cpu; required_device<palette_device> m_palette; required_device<screen_device> m_screen; + memory_access_cache<2, 0, ENDIANNESS_LITTLE> *m_cache; + uint8_t m_steppingstone[4*1024]; memcon_t m_memcon; usbhost_t m_usbhost; diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp index c00026f23ff..d20b8f9688b 100644 --- a/src/devices/machine/s3c2440.cpp +++ b/src/devices/machine/s3c2440.cpp @@ -220,22 +220,6 @@ static const uint32_t MAP_SUBINT_TO_INT[15] = #define S3C24XX_CORE_PIN_OM0 S3C2440_CORE_PIN_OM0 #define S3C24XX_CORE_PIN_OM1 S3C2440_CORE_PIN_OM1 - -#define VERBOSE_LEVEL ( 0 ) - -static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) -{ - if (VERBOSE_LEVEL >= n_level) - { - va_list v; - char buf[32768]; - va_start(v, s_fmt); - vsprintf(buf, s_fmt, v); - va_end(v); - device.logerror("%s: %s", device.machine().describe_context( ), buf); - } -} - #define DEVICE_S3C2440 #define S3C24_CLASS_NAME s3c2440_device #include "machine/s3c24xx.hxx" @@ -302,7 +286,7 @@ s3c2440_device::~s3c2440_device() void s3c2440_device::device_start() { - address_space &space = m_cpu->memory().space( AS_PROGRAM); + address_space &space = m_cpu->space(AS_PROGRAM); space.install_readwrite_handler(0x48000000, 0x4800003b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_memcon_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_memcon_w))); space.install_readwrite_handler(0x49000000, 0x4900005b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_usb_host_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_usb_host_w))); space.install_readwrite_handler(0x4a000000, 0x4a00001f, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_irq_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_irq_w))); diff --git a/src/devices/machine/s3c2440.h b/src/devices/machine/s3c2440.h index a16f6d49576..40a92776c3f 100644 --- a/src/devices/machine/s3c2440.h +++ b/src/devices/machine/s3c2440.h @@ -182,6 +182,8 @@ public: void s3c2440_touch_screen( int state); void s3c2440_request_eint( uint32_t number); + void s3c2440_uart_fifo_w(int uart, uint8_t data); + protected: // device-level overrides virtual void device_start() override; @@ -363,7 +365,6 @@ protected: void s3c24xx_device_reset(); void s3c24xx_device_start(); - void s3c2440_uart_fifo_w( int uart, uint8_t data); void s3c2440_request_irq( uint32_t int_type); private: @@ -603,10 +604,12 @@ private: }; // internal state - required_device<device_t> m_cpu; + required_device<arm7_cpu_device> m_cpu; required_device<palette_device> m_palette; required_device<screen_device> m_screen; + memory_access_cache<2, 0, ENDIANNESS_LITTLE> *m_cache; + uint8_t m_steppingstone[4*1024]; memcon_t m_memcon; usbhost_t m_usbhost; diff --git a/src/devices/machine/s3c24xx.h b/src/devices/machine/s3c24xx.h index 3cd6ae6303d..4309601b27d 100644 --- a/src/devices/machine/s3c24xx.h +++ b/src/devices/machine/s3c24xx.h @@ -5,6 +5,7 @@ #pragma once +#include "cpu/arm7/arm7.h" class s3c24xx_peripheral_types // TODO: better name for this { diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index 78b7109340d..63e8dfbd2d7 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -15,7 +15,7 @@ MACROS & CONSTANTS *******************************************************************************/ -//#define UART_PRINTF +#define UART_PRINTF #define CLOCK_MULTIPLIER 1 @@ -77,6 +77,47 @@ #endif +#define LOG_RESET (1 << 0) +#define LOG_ADC (1 << 1) +#define LOG_LCD_DMA (1 << 2) +#define LOG_LCD_TIMER (1 << 3) +#define LOG_LCD_REGS (1 << 4) +#define LOG_SPI (1 << 5) +#define LOG_LCD_CFG (1 << 6) +#define LOG_LCD_TFT (1 << 7) +#define LOG_LCD_STN (1 << 8) +#define LOG_CLKPOW (1 << 9) +#define LOG_MMC (1 << 10) +#define LOG_IRQS (1 << 11) +#define LOG_IRQ_REGS (1 << 12) +#define LOG_FLASH (1 << 13) +#define LOG_PWM (1 << 14) +#define LOG_PWM_REGS (1 << 15) +#define LOG_CAM (1 << 16) +#define LOG_DMA (1 << 17) +#define LOG_DMA_REQS (1 << 18) +#define LOG_DMA_REGS (1 << 19) +#define LOG_AC97 (1 << 20) +#define LOG_DMA_TIMERS (1 << 21) +#define LOG_GPIO (1 << 22) +#define LOG_MEMCON (1 << 23) +#define LOG_USBHOST (1 << 24) +#define LOG_UART (1 << 25) +#define LOG_USB (1 << 26) +#define LOG_WDT (1 << 27) +#define LOG_I2C (1 << 28) +#define LOG_I2S (1 << 29) +#define LOG_RTC (1 << 30) +#define LOG_SDI (1 << 31) + +#define LOG_ALL (LOG_RESET | LOG_ADC | LOG_LCD_DMA | LOG_LCD_TIMER | LOG_LCD_REGS | LOG_SPI | LOG_LCD_CFG | LOG_LCD_TFT | LOG_LCD_STN \ + | LOG_CLKPOW | LOG_MMC | LOG_IRQS | LOG_IRQ_REGS | LOG_FLASH | LOG_PWM | LOG_PWM_REGS | LOG_CAM | LOG_DMA | LOG_DMA_REQS \ + | LOG_DMA_REGS | LOG_AC97 | LOG_DMA_TIMERS | LOG_GPIO | LOG_MEMCON | LOG_USBHOST | LOG_UART | LOG_USB \ + | LOG_WDT | LOG_I2C | LOG_I2S | LOG_RTC | LOG_SDI) + +#define VERBOSE (LOG_ALL & ~(LOG_FLASH | LOG_UART)) +#include "logmacro.h" + /*************************************************************************** IMPLEMENTATION ***************************************************************************/ @@ -85,7 +126,7 @@ void S3C24_CLASS_NAME::s3c24xx_reset() { - verboselog( *this, 1, "reset\n"); + LOGMASKED(LOG_RESET, "reset\n"); m_cpu->reset(); this->reset(); } @@ -228,9 +269,14 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_dma_reload() m_lcd.pagewidth_max = (m_lcd.hpos_max - m_lcd.hpos_min + 1) / 16 * 12; } } - verboselog( *this, 3, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", m_lcd.vramaddr_cur, m_lcd.vramaddr_max, m_lcd.offsize, m_lcd.pagewidth_max); + LOGMASKED(LOG_LCD_DMA, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", m_lcd.vramaddr_cur, m_lcd.vramaddr_max, m_lcd.offsize, m_lcd.pagewidth_max); m_lcd.dma_data = 0; m_lcd.dma_bits = 0; + + if (machine().input().code_pressed_once(KEYCODE_K)) + { + s3c24xx_uart_fifo_w(0, 0x55); + } } void S3C24_CLASS_NAME::s3c24xx_lcd_dma_init() @@ -240,7 +286,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_dma_init() m_lcd.bswp = BIT( m_lcd.regs.lcdcon5, 1); m_lcd.hwswp = BIT( m_lcd.regs.lcdcon5, 0); m_lcd.tpal = m_lcd.regs.tpal; - verboselog( *this, 3, "LCD - bppmode %d hwswp %d bswp %d\n", m_lcd.bppmode, m_lcd.hwswp, m_lcd.bswp); + LOGMASKED(LOG_LCD_DMA, "LCD - bppmode %d hwswp %d bswp %d\n", m_lcd.bppmode, m_lcd.hwswp, m_lcd.bswp); m_lcd.dma_data = 0; m_lcd.dma_bits = 0; } @@ -248,20 +294,17 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_dma_init() #if 0 uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { - address_space& space = m_cpu->memory().space( AS_PROGRAM); - uint8_t *vram, data[4]; - vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); + uint8_t data[4]; for (int i = 0; i < 2; i++) { - data[i*2+0] = *vram++; - data[i*2+1] = *vram++; + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur + 0); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur + 1); m_lcd.vramaddr_cur += 2; m_lcd.pagewidth_cur++; if (m_lcd.pagewidth_cur >= m_lcd.pagewidth_max) { m_lcd.vramaddr_cur += m_lcd.offsize << 1; m_lcd.pagewidth_cur = 0; - vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); } } if (m_lcd.hwswp == 0) @@ -291,9 +334,7 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { - address_space& space = m_cpu->memory().space( AS_PROGRAM); - uint8_t *vram, data[4]; - vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); + uint8_t data[4]; for (int i = 0; i < 2; i++) { if (m_lcd.hwswp == 0) @@ -302,39 +343,39 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { if ((m_lcd.vramaddr_cur & 2) == 0) { - data[i*2+0] = *(vram + 3); - data[i*2+1] = *(vram + 2); + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur + 3); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur + 2); } else { - data[i*2+0] = *(vram - 1); - data[i*2+1] = *(vram - 2); + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur - 1); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur - 2); } } else { - data[i*2+0] = *(vram + 0); - data[i*2+1] = *(vram + 1); + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur + 0); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur + 1); } } else { if (m_lcd.bswp == 0) { - data[i*2+0] = *(vram + 1); - data[i*2+1] = *(vram + 0); + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur + 1); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur + 0); } else { if ((m_lcd.vramaddr_cur & 2) == 0) { - data[i*2+0] = *(vram + 2); - data[i*2+1] = *(vram + 3); + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur + 2); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur + 3); } else { - data[i*2+0] = *(vram - 2); - data[i*2+1] = *(vram - 1); + data[i*2+0] = m_cache->read_byte(m_lcd.vramaddr_cur - 2); + data[i*2+1] = m_cache->read_byte(m_lcd.vramaddr_cur - 1); } } } @@ -344,11 +385,6 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { m_lcd.vramaddr_cur += m_lcd.offsize << 1; m_lcd.pagewidth_cur = 0; - vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); - } - else - { - vram += 2; } } if (m_flags & S3C24XX_INTERFACE_LCD_REVERSE) @@ -669,10 +705,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16() TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp ) { - verboselog( *this, 2, "LCD timer callback\n"); + LOGMASKED(LOG_LCD_TIMER, "LCD timer callback\n"); m_lcd.vpos = m_screen->vpos(); m_lcd.hpos = m_screen->hpos(); - verboselog( *this, 3, "LCD - vpos %d hpos %d\n", m_lcd.vpos, m_lcd.hpos); + LOGMASKED(LOG_LCD_TIMER, "LCD - vpos %d hpos %d\n", m_lcd.vpos, m_lcd.hpos); uint32_t tpalen = S3C24XX_TPAL_GET_TPALEN( m_lcd.tpal); if (tpalen == 0) { @@ -680,7 +716,7 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp ) { s3c24xx_lcd_dma_reload(); } - verboselog( *this, 3, "LCD - vramaddr %08X\n", m_lcd.vramaddr_cur); + LOGMASKED(LOG_LCD_TIMER, "LCD - vramaddr %08X\n", m_lcd.vramaddr_cur); while (m_lcd.vramaddr_cur < m_lcd.vramaddr_max) { switch (m_lcd.bppmode) @@ -696,7 +732,7 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp ) case S3C24XX_BPPMODE_TFT_04: s3c24xx_lcd_render_tft_04(); break; case S3C24XX_BPPMODE_TFT_08: s3c24xx_lcd_render_tft_08(); break; case S3C24XX_BPPMODE_TFT_16: s3c24xx_lcd_render_tft_16(); break; - default: verboselog( *this, 0, "s3c24xx_lcd_timer_exp: bppmode %d not supported\n", m_lcd.bppmode); break; + default: LOGMASKED(LOG_LCD_TIMER, "s3c24xx_lcd_timer_exp: bppmode %d not supported\n", m_lcd.bppmode); break; } if ((m_lcd.vpos == m_lcd.vpos_min) && (m_lcd.hpos == m_lcd.hpos_min)) break; } @@ -712,6 +748,8 @@ void S3C24_CLASS_NAME::s3c24xx_video_start() { m_lcd.bitmap[0] = std::make_unique<bitmap_rgb32>(m_screen->width(), m_screen->height()); m_lcd.bitmap[1] = std::make_unique<bitmap_rgb32>(m_screen->width(), m_screen->height()); + + m_cache = m_cpu->space(AS_PROGRAM).cache<2, 0, ENDIANNESS_LITTLE>(); } void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bitmap_src_1, bitmap_rgb32 &bitmap_src_2) @@ -770,6 +808,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_r ) if (vpos < m_lcd.vpos_min) vpos = m_lcd.vpos_min; if (vpos > m_lcd.vpos_max) vpos = m_lcd.vpos_max; data = (data & ~0xFFFC0000) | ((m_lcd.vpos_max - vpos) << 18); + LOGMASKED(LOG_LCD_REGS, "%s: lcd read: LCDCON1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); } break; case S3C24XX_LCDCON5: @@ -779,16 +818,17 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_r ) if (vpos < m_lcd.vpos_min) data = data | 0x00000000; if (vpos > m_lcd.vpos_max) data = data | 0x00018000; // todo: 00 = VSYNC, 01 = BACK Porch, 10 = ACTIVE, 11 = FRONT Porch + LOGMASKED(LOG_LCD_REGS, "%s: lcd read: LCDCON5 = %08x & %08x\n", machine().describe_context(), data, mem_mask); } break; } - verboselog( *this, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCD + (offset << 2), data); + LOGMASKED(LOG_LCD_REGS, "%s: lcd read: %08X = %08X & %08x\n", machine().describe_context(), S3C24XX_BASE_LCD + (offset << 2), data, mem_mask); return data; } int S3C24_CLASS_NAME::s3c24xx_lcd_configure_tft() { - verboselog( *this, 5, "s3c24xx_lcd_configure_tft\n"); + LOGMASKED(LOG_LCD_TFT, "s3c24xx_lcd_configure_tft\n"); uint32_t vspw = BITS( m_lcd.regs.lcdcon2, 5, 0); uint32_t vbpd = BITS( m_lcd.regs.lcdcon2, 31, 24); uint32_t lineval = BITS( m_lcd.regs.lcdcon2, 23, 14); @@ -799,13 +839,13 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_tft() uint32_t hozval = BITS( m_lcd.regs.lcdcon3, 18, 8); uint32_t clkval = BITS( m_lcd.regs.lcdcon1, 17, 8); uint32_t hclk = s3c24xx_get_hclk(); - verboselog( *this, 3, "LCD - vspw %d vbpd %d lineval %d vfpd %d hspw %d hbpd %d hfpd %d hozval %d clkval %d hclk %d\n", vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk); + LOGMASKED(LOG_LCD_TFT, "LCD - vspw %d vbpd %d lineval %d vfpd %d hspw %d hbpd %d hfpd %d hozval %d clkval %d hclk %d\n", vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk); double vclk = (double)(hclk / ((clkval + 1) * 2)); - verboselog( *this, 3, "LCD - vclk %f\n", vclk); + LOGMASKED(LOG_LCD_TFT, "LCD - vclk %f\n", vclk); double framerate = vclk / (((vspw + 1) + (vbpd + 1) + (lineval + 1) + (vfpd + 1)) * ((hspw + 1) + (hbpd + 1) + (hozval + 1) + (hfpd + 1))); - verboselog( *this, 3, "LCD - framerate %f\n", framerate); + LOGMASKED(LOG_LCD_TFT, "LCD - framerate %f\n", framerate); m_lcd.framerate = framerate; uint32_t width = (hspw + 1) + (hbpd + 1) + (hozval + 1) + (hfpd + 1); @@ -816,8 +856,8 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_tft() visarea.min_y = (vspw + 1) + (vbpd + 1); visarea.max_x = visarea.min_x + (hozval + 1) - 1; visarea.max_y = visarea.min_y + (lineval + 1) - 1; - verboselog(*this, 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); - verboselog(*this, 3, "video_screen_configure %d %d %f\n", width, height, m_lcd.framerate); + LOGMASKED(LOG_LCD_TFT, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); + LOGMASKED(LOG_LCD_TFT, "screen->configure %d %d %f\n", width, height, m_lcd.framerate); m_lcd.hpos_min = (hspw + 1) + (hbpd + 1); m_lcd.hpos_max = m_lcd.hpos_min + (hozval + 1) - 1; @@ -829,7 +869,7 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_tft() int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() { - verboselog( *this, 5, "s3c24xx_lcd_configure_stn\n"); + LOGMASKED(LOG_LCD_STN, "s3c24xx_lcd_configure_stn\n"); uint32_t pnrmode = BITS( m_lcd.regs.lcdcon1, 6, 5); uint32_t bppmode = BITS( m_lcd.regs.lcdcon1, 4, 1); @@ -840,16 +880,16 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() uint32_t lineblank = BITS( m_lcd.regs.lcdcon3, 7, 0); uint32_t wlh = BITS( m_lcd.regs.lcdcon4, 1, 0); uint32_t hclk = s3c24xx_get_hclk(); - verboselog( *this, 3, "LCD - pnrmode %d bppmode %d clkval %d lineval %d wdly %d hozval %d lineblank %d wlh %d hclk %d\n", pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk); + LOGMASKED(LOG_LCD_STN, "LCD - pnrmode %d bppmode %d clkval %d lineval %d wdly %d hozval %d lineblank %d wlh %d hclk %d\n", pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk); if (clkval == 0) { return false; } double vclk = (double)(hclk / ((clkval + 0) * 2)); - verboselog( *this, 3, "LCD - vclk %f\n", vclk); + LOGMASKED(LOG_LCD_STN, "LCD - vclk %f\n", vclk); double framerate = 1 / (((1 / vclk) * (hozval + 1) + (1 / hclk) * ((1 << (4 + wlh)) + (1 << (4 + wdly)) + (lineblank * 8))) * (lineval + 1)); - verboselog( *this, 3, "LCD - framerate %f\n", framerate); + LOGMASKED(LOG_LCD_STN, "LCD - framerate %f\n", framerate); m_lcd.framerate = framerate; uint32_t width = 0; @@ -865,8 +905,8 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() rectangle visarea; visarea.set(0, width - 1, 0, height - 1); - verboselog( *this, 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); - verboselog( *this, 3, "video_screen_configure %d %d %f\n", width, height, m_lcd.framerate); + LOGMASKED(LOG_LCD_STN, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); + LOGMASKED(LOG_LCD_STN, "screen->configure %d %d %f\n", width, height, m_lcd.framerate); m_lcd.hpos_min = 0; m_lcd.hpos_max = width - 1; @@ -878,7 +918,7 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() int S3C24_CLASS_NAME::s3c24xx_lcd_configure() { - verboselog( *this, 5, "s3c24xx_lcd_configure\n"); + LOGMASKED(LOG_LCD_CFG, "s3c24xx_lcd_configure\n"); uint32_t bppmode = BITS(m_lcd.regs.lcdcon1, 4, 1); if ((bppmode & (1 << 3)) == 0) { @@ -892,7 +932,7 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure() void S3C24_CLASS_NAME::s3c24xx_lcd_start() { - verboselog(*this, 1, "LCD start\n"); + LOGMASKED(LOG_LCD_CFG, "LCD start\n"); if (s3c24xx_lcd_configure()) { s3c24xx_lcd_dma_init(); @@ -902,7 +942,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_start() void S3C24_CLASS_NAME::s3c24xx_lcd_stop() { - verboselog( *this, 1, "LCD stop\n"); + LOGMASKED(LOG_LCD_CFG, "LCD stop\n"); m_lcd.timer->adjust(attotime::never); } @@ -921,7 +961,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_recalc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_w ) { uint32_t old_value = ((uint32_t*)&m_lcd.regs)[offset]; - verboselog( *this, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCD + (offset << 2), data); + LOGMASKED(LOG_LCD_REGS, "%s: lcd write: %08X = %08X & %08x\n", machine().describe_context(), S3C24XX_BASE_LCD + (offset << 2), data, mem_mask); COMBINE_DATA(&((uint32_t*)&m_lcd.regs)[offset]); switch (offset) { @@ -941,17 +981,17 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_w ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_palette_r ) { uint32_t data = m_lcdpal.regs.data[offset]; - verboselog( *this, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data); + LOGMASKED(LOG_LCD_REGS, "%s: lcd palette read: %08X = %08X & %08x\n", machine().describe_context(), S3C24XX_BASE_LCDPAL + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_palette_w ) { - verboselog( *this, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data); + LOGMASKED(LOG_LCD_REGS, "%s: lcd palette write: %08X = %08X & %08x\n", machine().describe_context(), S3C24XX_BASE_LCDPAL + (offset << 2), data, mem_mask); COMBINE_DATA(&m_lcdpal.regs.data[offset]); if (mem_mask != 0xffffffff) { - verboselog( *this, 0, "s3c24xx_lcd_palette_w: unknown mask %08x\n", mem_mask); + LOGMASKED(LOG_LCD_REGS, "s3c24xx_lcd_palette_w: unknown mask %08x\n", mem_mask); } m_palette->set_pen_color( offset, s3c24xx_get_color_tft_16(data & 0xFFFF)); } @@ -996,7 +1036,7 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_get_fclk() temp2 = (double)((pdiv + 2) * (1 << sdiv)); fclk = (uint32_t)(temp1 / temp2); clkslow = m_clkpow.regs.clkslow; - if (BIT( clkslow, 4) == 1) + if (BIT(clkslow, 4) == 1) { uint32_t slow_val = BITS( clkslow, 2, 0); if (slow_val > 0) @@ -1010,14 +1050,14 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_get_fclk() uint32_t S3C24_CLASS_NAME::s3c24xx_get_hclk() { #if defined(DEVICE_S3C2400) || defined(DEVICE_S3C2410) - return s3c24xx_get_fclk() / (BIT( m_clkpow.regs.clkdivn, 1) + 1); + return s3c24xx_get_fclk() / (BIT(m_clkpow.regs.clkdivn, 1) + 1); #else - switch (BITS( m_clkpow.regs.clkdivn, 2, 1)) + switch (BITS(m_clkpow.regs.clkdivn, 2, 1)) { case 0: return s3c24xx_get_fclk() / 1; case 1: return s3c24xx_get_fclk() / 2; - case 2: return s3c24xx_get_fclk() / (4 * (BIT( m_clkpow.regs.camdivn, 9) + 1)); - case 3: return s3c24xx_get_fclk() / (3 * (BIT( m_clkpow.regs.camdivn, 8) + 1)); + case 2: return s3c24xx_get_fclk() / (4 * (BIT(m_clkpow.regs.camdivn, 9) + 1)); + case 3: return s3c24xx_get_fclk() / (3 * (BIT(m_clkpow.regs.camdivn, 8) + 1)); } return 0; #endif @@ -1025,30 +1065,39 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_get_hclk() uint32_t S3C24_CLASS_NAME::s3c24xx_get_pclk() { - return s3c24xx_get_hclk() / (1 << BIT( m_clkpow.regs.clkdivn, 0)); + return s3c24xx_get_hclk() / (1 << BIT(m_clkpow.regs.clkdivn, 0)); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_clkpow_r ) { uint32_t data = ((uint32_t*)&m_clkpow.regs)[offset]; - verboselog( *this, 9, "(CLKPOW) %08X -> %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data); + LOGMASKED(LOG_CLKPOW, "%s: clock/power read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_CLKPOW + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_clkpow_w ) { - verboselog( *this, 9, "(CLKPOW) %08X <- %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data); + const uint32_t old = ((uint32_t*)&m_clkpow.regs)[offset]; COMBINE_DATA(&((uint32_t*)&m_clkpow.regs)[offset]); switch (offset) { - case S3C24XX_MPLLCON : - verboselog( *this, 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk(), s3c24xx_get_hclk(), s3c24xx_get_pclk()); + case S3C24XX_MPLLCON: + LOGMASKED(LOG_CLKPOW, "%s: clock/power write: MPLLCON = %08x & %08x - fclk %d hclk %d pclk %d\n", machine().describe_context(), data, mem_mask, s3c24xx_get_fclk(), s3c24xx_get_hclk(), s3c24xx_get_pclk()); m_cpu->set_unscaled_clock(s3c24xx_get_fclk() * CLOCK_MULTIPLIER); break; - case S3C24XX_CLKSLOW : - verboselog( *this, 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk(), s3c24xx_get_hclk(), s3c24xx_get_pclk()); + case S3C24XX_CLKSLOW: + LOGMASKED(LOG_CLKPOW, "%s: clock/power write: CLKSLOW = %08x & %08x - fclk %d hclk %d pclk %d\n", machine().describe_context(), data, mem_mask, s3c24xx_get_fclk(), s3c24xx_get_hclk(), s3c24xx_get_pclk()); m_cpu->set_unscaled_clock(s3c24xx_get_fclk() * CLOCK_MULTIPLIER); break; + case S3C24XX_CLKCON: + LOGMASKED(LOG_CLKPOW, "%s: clock/power write: CLKCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); + if (BIT(data, 2) && !BIT(old, 2)) + { + m_cpu->suspend(SUSPEND_REASON_HALT, 1); + } + break; + default: + LOGMASKED(LOG_CLKPOW, "%s: clock/power write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_CLKPOW + (offset << 2), data, mem_mask); } } @@ -1078,19 +1127,20 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() if (temp != 0) { uint32_t int_type = 0; - verboselog( *this, 5, "srcpnd %08X intmsk %08X intmod %08X\n", m_irq.regs.srcpnd, m_irq.regs.intmsk, m_irq.regs.intmod); + LOGMASKED(LOG_IRQS, "IRQ: srcpnd %08X intmsk %08X intmod %08X\n", m_irq.regs.srcpnd, m_irq.regs.intmsk, m_irq.regs.intmod); while ((temp & 1) == 0) { int_type++; temp = temp >> 1; } - verboselog( *this, 5, "intpnd set bit %d\n", int_type); + LOGMASKED(LOG_IRQS, "IRQ: intpnd set bit %d\n", int_type); m_irq.regs.intpnd |= (1 << int_type); m_irq.regs.intoffset = int_type; if (m_irq.line_irq != ASSERT_LINE) { - verboselog( *this, 5, "ARM7_IRQ_LINE -> ASSERT_LINE\n"); - m_cpu->execute().set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); + LOGMASKED(LOG_IRQS, "triggering IRQ line\n"); + m_cpu->resume(SUSPEND_REASON_HALT); + m_cpu->set_input_line(ARM7_IRQ_LINE, ASSERT_LINE); m_irq.line_irq = ASSERT_LINE; } } @@ -1098,9 +1148,9 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() { if (m_irq.line_irq != CLEAR_LINE) { - verboselog( *this, 5, "srcpnd %08X intmsk %08X intmod %08X\n", m_irq.regs.srcpnd, m_irq.regs.intmsk, m_irq.regs.intmod); - verboselog( *this, 5, "ARM7_IRQ_LINE -> CLEAR_LINE\n"); - m_cpu->execute().set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); + LOGMASKED(LOG_IRQS, "IRQ: srcpnd %08X intmsk %08X intmod %08X\n", m_irq.regs.srcpnd, m_irq.regs.intmsk, m_irq.regs.intmod); + LOGMASKED(LOG_IRQS, "clearing IRQ line\n"); + m_cpu->set_input_line(ARM7_IRQ_LINE, CLEAR_LINE); m_irq.line_irq = CLEAR_LINE; } } @@ -1118,8 +1168,9 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() } if (m_irq.line_fiq != ASSERT_LINE) { - verboselog( *this, 5, "ARM7_FIRQ_LINE -> ASSERT_LINE\n"); - m_cpu->execute().set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); + LOGMASKED(LOG_IRQS, "asserting FIQ line\n"); + m_cpu->resume(SUSPEND_REASON_HALT); + m_cpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); m_irq.line_fiq = ASSERT_LINE; } } @@ -1127,8 +1178,8 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() { if (m_irq.line_fiq != CLEAR_LINE) { - verboselog( *this, 5, "ARM7_FIRQ_LINE -> CLEAR_LINE\n"); - m_cpu->execute().set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE); + LOGMASKED(LOG_IRQS, "clearing FIQ line\n"); + m_cpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE); m_irq.line_fiq = CLEAR_LINE; } } @@ -1136,7 +1187,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() void S3C24_CLASS_NAME::s3c24xx_request_irq(uint32_t int_type) { - verboselog( *this, 5, "request irq %d\n", int_type); + LOGMASKED(LOG_IRQS, "request irq %d\n", int_type); m_irq.regs.srcpnd |= (1 << int_type); s3c24xx_check_pending_irq(); } @@ -1160,7 +1211,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_subirq() ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_subirq( uint32_t int_type) { - verboselog( *this, 5, "request subirq %d\n", int_type); + LOGMASKED(LOG_IRQS, "request subirq %d\n", int_type); m_irq.regs.subsrcpnd |= (1 << int_type); s3c24xx_check_pending_subirq(); } @@ -1189,7 +1240,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_eint() ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_eint(uint32_t number) { - verboselog( *this, 5, "request external interrupt %d\n", number); + LOGMASKED(LOG_IRQS, "request external interrupt %d\n", number); if (number < 4) { s3c24xx_request_irq( S3C24XX_INT_EINT0 + number); @@ -1205,40 +1256,78 @@ ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_eint(uint32_t number) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_irq_r ) { - uint32_t data = ((uint32_t*)&m_irq.regs)[offset]; - verboselog( *this, 9, "(IRQ) %08X -> %08X\n", S3C24XX_BASE_INT + (offset << 2), data); + const uint32_t data = ((uint32_t*)&m_irq.regs)[offset]; + switch (offset) + { + case S3C24XX_SRCPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: SRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTMOD: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTMOD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTMSK: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_PRIORITY: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: PRIORITY = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTOFFSET: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTOFFSET = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; +#if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) + case S3C24XX_SUBSRCPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: SUBSRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case S3C24XX_INTSUBMSK: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: INTSUBMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; +#endif + default: + LOGMASKED(LOG_IRQ_REGS, "%s: irq read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_INT + (offset << 2), data, mem_mask); + break; + } return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_irq_w ) { uint32_t old_value = ((uint32_t*)&m_irq.regs)[offset]; - verboselog( *this, 9, "(IRQ) %08X <- %08X\n", S3C24XX_BASE_INT + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_irq.regs)[offset]); switch (offset) { case S3C24XX_SRCPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq write: SRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_irq.regs.srcpnd = (old_value & ~data); // clear only the bit positions of SRCPND corresponding to those set to one in the data m_irq.regs.intoffset = 0; // "This bit can be cleared automatically by clearing SRCPND and INTPND." s3c24xx_check_pending_irq(); break; case S3C24XX_INTMSK: + LOGMASKED(LOG_IRQ_REGS, "%s: irq write: INTMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); s3c24xx_check_pending_irq(); break; case S3C24XX_INTPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq write: INTPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_irq.regs.intpnd = (old_value & ~data); // clear only the bit positions of INTPND corresponding to those set to one in the data m_irq.regs.intoffset = 0; // "This bit can be cleared automatically by clearing SRCPND and INTPND." s3c24xx_check_pending_irq(); break; #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) - case S3C24XX_SUBSRCPND : + case S3C24XX_SUBSRCPND: + LOGMASKED(LOG_IRQ_REGS, "%s: irq write: SUBSRCPND = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_irq.regs.subsrcpnd = (old_value & ~data); // clear only the bit positions of SRCPND corresponding to those set to one in the data s3c24xx_check_pending_subirq(); break; case S3C24XX_INTSUBMSK: + LOGMASKED(LOG_IRQ_REGS, "%s: irq write: INTSUBMSK = %08x & %08x\n", machine().describe_context(), data, mem_mask); s3c24xx_check_pending_subirq(); break; #endif + default: + LOGMASKED(LOG_IRQ_REGS, "%s: irq write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_INT + (offset << 2), data, mem_mask); + break; } } @@ -1251,21 +1340,27 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_pwm_r ) { case pwm_t::TCNTO0: data = (data & ~0x0000FFFF) | m_pwm.calc_observation(0); + LOGMASKED(LOG_PWM_REGS, "%s: pwm read: TCNTO0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case pwm_t::TCNTO1: data = (data & ~0x0000FFFF) | m_pwm.calc_observation(1); + LOGMASKED(LOG_PWM_REGS, "%s: pwm read: TCNTO1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case pwm_t::TCNTO2: data = (data & ~0x0000FFFF) | m_pwm.calc_observation(2); + LOGMASKED(LOG_PWM_REGS, "%s: pwm read: TCNTO2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case pwm_t::TCNTO3: data = (data & ~0x0000FFFF) | m_pwm.calc_observation(3); + LOGMASKED(LOG_PWM_REGS, "%s: pwm read: TCNTO3 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case pwm_t::TCNTO4: data = (data & ~0x0000FFFF) | m_pwm.calc_observation(4); + LOGMASKED(LOG_PWM_REGS, "%s: pwm read: TCNTO4 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; + default: + LOGMASKED(LOG_PWM_REGS, "%s: pwm read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_PWM + (offset << 2), data, mem_mask); } - verboselog( *this, 9, "(PWM) %08X -> %08X\n", S3C24XX_BASE_PWM + (offset << 2), data); return data; } @@ -1274,12 +1369,12 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_start(int timer) static constexpr int mux_table[] = { 2, 4, 8, 16 }; static constexpr int prescaler_shift[] = { 0, 0, 8, 8, 8 }; static constexpr int mux_shift[] = { 0, 4, 8, 12, 16 }; - uint32_t pclk, prescaler, mux, cnt, cmp, auto_reload; + uint32_t cnt, cmp, auto_reload; double freq, hz; - verboselog( *this, 1, "PWM %d start\n", timer); - pclk = s3c24xx_get_pclk(); - prescaler = (m_pwm.regs.tcfg0 >> prescaler_shift[timer]) & 0xFF; - mux = (m_pwm.regs.tcfg1 >> mux_shift[timer]) & 0x0F; + LOGMASKED(LOG_PWM, "PWM %d start\n", timer); + uint32_t pclk = s3c24xx_get_pclk(); + uint32_t prescaler = (m_pwm.regs.tcfg0 >> prescaler_shift[timer]) & 0xFF; + uint32_t mux = (m_pwm.regs.tcfg1 >> mux_shift[timer]) & 0x0F; if (mux < 4) { freq = (double)pclk / (prescaler + 1) / mux_table[mux]; @@ -1329,13 +1424,13 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_start(int timer) { hz = freq / cnt; } - verboselog(*this, 5, "PWM %d - pclk=%d prescaler=%d div=%d freq=%f cnt=%d cmp=%d auto_reload=%d hz=%f\n", timer, pclk, prescaler, mux_table[mux], freq, cnt, cmp, auto_reload, hz); + LOGMASKED(LOG_PWM, "PWM %d - pclk=%d prescaler=%d div=%d freq=%f cnt=%d cmp=%d auto_reload=%d hz=%f\n", timer, pclk, prescaler, mux_table[mux], freq, cnt, cmp, auto_reload, hz); m_pwm.cnt[timer] = cnt; m_pwm.cmp[timer] = cmp; m_pwm.freq[timer] = freq; if (auto_reload) { - m_pwm.timer[timer]->adjust(attotime::from_hz( hz), timer, attotime::from_hz(hz)); + m_pwm.timer[timer]->adjust(attotime::from_hz(hz), timer, attotime::from_hz(hz)); } else { @@ -1345,7 +1440,7 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_start(int timer) void S3C24_CLASS_NAME::s3c24xx_pwm_stop(int timer) { - verboselog(*this, 1, "PWM %d stop\n", timer); + LOGMASKED(LOG_PWM, "PWM %d stop\n", timer); m_pwm.timer[timer]->adjust(attotime::never); } @@ -1365,11 +1460,11 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_recalc(int timer) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_pwm_w ) { uint32_t const old_value = ((uint32_t*)&m_pwm.regs)[offset]; - verboselog( *this, 9, "(PWM) %08X <- %08X\n", S3C24XX_BASE_PWM + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_pwm.regs)[offset]); switch (offset) { case pwm_t::TCON: + LOGMASKED(LOG_PWM_REGS, "%s: pwm write: TCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); if (BIT(data ^ old_value, 0)) { s3c24xx_pwm_recalc(0); @@ -1391,6 +1486,9 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_pwm_w ) s3c24xx_pwm_recalc(4); } break; + default: + LOGMASKED(LOG_PWM_REGS, "%s: pwm write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_PWM + (offset << 2), data, mem_mask); + break; } } @@ -1398,7 +1496,7 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_pwm_timer_exp ) { int ch = param; static constexpr int ch_int[] = { S3C24XX_INT_TIMER0, S3C24XX_INT_TIMER1, S3C24XX_INT_TIMER2, S3C24XX_INT_TIMER3, S3C24XX_INT_TIMER4 }; - verboselog(*this, 2, "PWM %d timer callback\n", ch); + LOGMASKED(LOG_PWM, "PWM %d timer callback\n", ch); if (BITS(m_pwm.regs.tcfg1, 23, 20) == (ch + 1)) { s3c24xx_dma_request_pwm(); @@ -1432,10 +1530,10 @@ void S3C24_CLASS_NAME::s3c24xx_dma_trigger(int ch) { dma_regs_t *regs = &m_dma[ch].regs; uint32_t curr_tc, curr_src, curr_dst; - address_space &space = m_cpu->memory().space(AS_PROGRAM); + address_space &space = m_cpu->space(AS_PROGRAM); int dsz, inc_src, inc_dst, servmode, tsz; static constexpr uint32_t ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3 }; - verboselog(*this, 5, "DMA %d trigger\n", ch); + LOGMASKED(LOG_DMA, "DMA %d trigger\n", ch); curr_tc = S3C24XX_DSTAT_GET_CURR_TC(regs->dstat); dsz = S3C24XX_DCON_GET_DSZ(regs->dcon); curr_src = S3C24XX_DCSRC_GET_CURR_SRC(regs->dcsrc); @@ -1449,7 +1547,7 @@ void S3C24_CLASS_NAME::s3c24xx_dma_trigger(int ch) inc_src = BIT( regs->disrcc, 0); inc_dst = BIT(regs->didstc, 0); #endif - verboselog(*this, 5, "DMA %d - curr_src %08X curr_dst %08X curr_tc %d dsz %d\n", ch, curr_src, curr_dst, curr_tc, dsz); + LOGMASKED(LOG_DMA, "DMA %d - curr_src %08X curr_dst %08X curr_tc %d dsz %d\n", ch, curr_src, curr_dst, curr_tc, dsz); while (curr_tc > 0) { curr_tc--; @@ -1489,14 +1587,14 @@ void S3C24_CLASS_NAME::s3c24xx_dma_trigger(int ch) void S3C24_CLASS_NAME::s3c24xx_dma_request_iis() { dma_regs_t *regs = &m_dma[2].regs; - verboselog( *this, 5, "s3c24xx_dma_request_iis\n"); + LOGMASKED(LOG_DMA_REQS, "s3c24xx_dma_request_iis\n"); if ((S3C24XX_DMASKTRIG_GET_ON_OFF(regs->dmasktrig) != 0) && (S3C24XX_DCON_GET_SWHWSEL(regs->dcon) != 0) && (S3C24XX_DCON_GET_HWSRCSEL(regs->dcon) == 0)) s3c24xx_dma_trigger(2); } void S3C24_CLASS_NAME::s3c24xx_dma_request_pwm() { - verboselog( *this, 5, "s3c24xx_dma_request_pwm\n"); + LOGMASKED(LOG_DMA_REQS, "s3c24xx_dma_request_pwm\n"); for (int i = 0; i < 4; i++) { if (i != 1) @@ -1516,7 +1614,7 @@ void S3C24_CLASS_NAME::s3c24xx_dma_start(int ch) dma_regs_t *regs = &m_dma[ch].regs; uint32_t dsz, tsz, reload; int inc_src, inc_dst, _int, servmode, swhwsel, hwsrcsel; - verboselog(*this, 1, "DMA %d start\n", ch); + LOGMASKED(LOG_DMA, "DMA %d start\n", ch); addr_src = S3C24XX_DISRC_GET_SADDR(regs->disrc); addr_dst = S3C24XX_DIDST_GET_DADDR(regs->didst); tc = S3C24XX_DCON_GET_TC(regs->dcon); @@ -1534,8 +1632,8 @@ void S3C24_CLASS_NAME::s3c24xx_dma_start(int ch) inc_src = BIT(regs->disrcc, 0); inc_dst = BIT(regs->didstc, 0); #endif - verboselog(*this, 5, "DMA %d - addr_src %08X inc_src %d addr_dst %08X inc_dst %d int %d tsz %d servmode %d hwsrcsel %d swhwsel %d reload %d dsz %d tc %d\n", ch, addr_src, inc_src, addr_dst, inc_dst, _int, tsz, servmode, hwsrcsel, swhwsel, reload, dsz, tc); - verboselog(*this, 5, "DMA %d - copy %08X bytes from %08X (%s) to %08X (%s)\n", ch, (tc << dsz) << (tsz << 1), addr_src, inc_src ? "fix" : "inc", addr_dst, inc_dst ? "fix" : "inc"); + LOGMASKED(LOG_DMA, "DMA %d - addr_src %08X inc_src %d addr_dst %08X inc_dst %d int %d tsz %d servmode %d hwsrcsel %d swhwsel %d reload %d dsz %d tc %d\n", ch, addr_src, inc_src, addr_dst, inc_dst, _int, tsz, servmode, hwsrcsel, swhwsel, reload, dsz, tc); + LOGMASKED(LOG_DMA, "DMA %d - copy %08X bytes from %08X (%s) to %08X (%s)\n", ch, (tc << dsz) << (tsz << 1), addr_src, inc_src ? "fix" : "inc", addr_dst, inc_dst ? "fix" : "inc"); s3c24xx_dma_reload(ch); if (swhwsel == 0) s3c24xx_dma_trigger(ch); @@ -1543,7 +1641,7 @@ void S3C24_CLASS_NAME::s3c24xx_dma_start(int ch) void S3C24_CLASS_NAME::s3c24xx_dma_stop(int ch) { - verboselog(*this, 1, "DMA %d stop\n", ch); + LOGMASKED(LOG_DMA, "DMA %d stop\n", ch); } void S3C24_CLASS_NAME::s3c24xx_dma_recalc(int ch) @@ -1556,11 +1654,15 @@ void S3C24_CLASS_NAME::s3c24xx_dma_recalc(int ch) uint32_t S3C24_CLASS_NAME::s3c24xx_dma_r(uint32_t ch, uint32_t offset) { - return ((uint32_t*)&m_dma[ch].regs)[offset]; + static const uint32_t s_bases[4] = { S3C24XX_BASE_DMA_0, S3C24XX_BASE_DMA_1, S3C24XX_BASE_DMA_2, S3C24XX_BASE_DMA_3 }; + const uint32_t data = ((uint32_t*)&m_dma[ch].regs)[offset]; + LOGMASKED(LOG_DMA_REGS, "%s: dma %d read: %08x = %08x\n", machine().describe_context(), ch, s_bases[ch] + (offset << 2), data); + return data; } void S3C24_CLASS_NAME::s3c24xx_dma_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { + static const uint32_t s_bases[4] = { S3C24XX_BASE_DMA_0, S3C24XX_BASE_DMA_1, S3C24XX_BASE_DMA_2, S3C24XX_BASE_DMA_3 }; uint32_t old_value = ((uint32_t*)&m_dma[ch].regs)[offset]; COMBINE_DATA(&((uint32_t*)&m_dma[ch].regs)[offset]); switch (offset) @@ -1573,70 +1675,63 @@ void S3C24_CLASS_NAME::s3c24xx_dma_w(uint32_t ch, uint32_t offset, uint32_t data regs->dmasktrig &= ~(1 << 1); // clear on/off } #endif + LOGMASKED(LOG_DMA_REGS, "%s: dma %d write: DCON = %08x & %08x\n", machine().describe_context(), ch, data, mem_mask); break; case S3C24XX_DMASKTRIG : + LOGMASKED(LOG_DMA_REGS, "%s: dma %d write: DMASKTRIG = %08x & %08x\n", machine().describe_context(), ch, data, mem_mask); if (BIT(data ^ old_value, 1)) s3c24xx_dma_recalc(ch); break; + default: + LOGMASKED(LOG_DMA_REGS, "%s: dma %d write: %08x = %08x & %08x\n", machine().describe_context(), ch, s_bases[ch] + (offset << 2), data, mem_mask); + break; } } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_0_r ) { - uint32_t data = s3c24xx_dma_r( 0, offset); - verboselog(*this, 9, "(DMA 0) %08X -> %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data); - return data; + return s3c24xx_dma_r(0, offset); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_1_r ) { - uint32_t data = s3c24xx_dma_r(1, offset); - verboselog(*this, 9, "(DMA 1) %08X -> %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data); - return data; + return s3c24xx_dma_r(1, offset); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_2_r ) { - uint32_t data = s3c24xx_dma_r( 2, offset); - verboselog(*this, 9, "(DMA 2) %08X -> %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data); - return data; + return s3c24xx_dma_r(2, offset); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_3_r ) { - uint32_t data = s3c24xx_dma_r( 3, offset); - verboselog(*this, 9, "(DMA 3) %08X -> %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data); - return data; + return s3c24xx_dma_r(3, offset); } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_0_w ) { - verboselog(*this, 9, "(DMA 0) %08X <- %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data); s3c24xx_dma_w(0, offset, data, mem_mask); } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_1_w ) { - verboselog(*this, 9, "(DMA 1) %08X <- %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data); s3c24xx_dma_w(1, offset, data, mem_mask); } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_2_w ) { - verboselog(*this, 9, "(DMA 2) %08X <- %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data); s3c24xx_dma_w(2, offset, data, mem_mask); } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_3_w ) { - verboselog(*this, 9, "(DMA 3) %08X <- %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data); s3c24xx_dma_w(3, offset, data, mem_mask); } TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_timer_exp ) { int ch = param; - verboselog(*this, 2, "DMA %d timer callback\n", ch); + LOGMASKED(LOG_DMA_TIMERS, "DMA %d timer callback\n", ch); } /* I/O Port */ @@ -1709,37 +1804,48 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_gpio_r ) { case S3C24XX_GPADAT : data = iface_gpio_port_r( S3C24XX_GPIO_PORT_A, 0) & S3C24XX_GPADAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPADAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case S3C24XX_GPBDAT : data = iface_gpio_port_r( S3C24XX_GPIO_PORT_B, s3c24xx_gpio_get_mask(m_gpio.regs.gpbcon, 0) & S3C24XX_GPBDAT_MASK) & S3C24XX_GPBDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPBDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case S3C24XX_GPCDAT : data = iface_gpio_port_r( S3C24XX_GPIO_PORT_C, s3c24xx_gpio_get_mask(m_gpio.regs.gpccon, 0) & S3C24XX_GPCDAT_MASK) & S3C24XX_GPCDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPCDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; - case S3C24XX_GPDDAT : + case S3C24XX_GPDDAT: data = iface_gpio_port_r( S3C24XX_GPIO_PORT_D, s3c24xx_gpio_get_mask(m_gpio.regs.gpdcon, 0) & S3C24XX_GPDDAT_MASK) & S3C24XX_GPDDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPDDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; - case S3C24XX_GPEDAT : + case S3C24XX_GPEDAT: data = iface_gpio_port_r( S3C24XX_GPIO_PORT_E, s3c24xx_gpio_get_mask(m_gpio.regs.gpecon, 0) & S3C24XX_GPEDAT_MASK) & S3C24XX_GPEDAT_MASK; + //LOGMASKED(LOG_GPIO, "%s: GPIO read: GPEDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; - case S3C24XX_GPFDAT : + case S3C24XX_GPFDAT: data = iface_gpio_port_r( S3C24XX_GPIO_PORT_F, s3c24xx_gpio_get_mask(m_gpio.regs.gpfcon, 0) & S3C24XX_GPFDAT_MASK) & S3C24XX_GPFDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPFDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; - case S3C24XX_GPGDAT : + case S3C24XX_GPGDAT: data = iface_gpio_port_r( S3C24XX_GPIO_PORT_G, s3c24xx_gpio_get_mask(m_gpio.regs.gpgcon, 0) & S3C24XX_GPGDAT_MASK) & S3C24XX_GPGDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPGDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) - case S3C24XX_GPHDAT : + case S3C24XX_GPHDAT: data = iface_gpio_port_r( S3C24XX_GPIO_PORT_H, s3c24xx_gpio_get_mask(m_gpio.regs.gphcon, 0) & S3C24XX_GPHDAT_MASK) & S3C24XX_GPHDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPHDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #endif #if defined(DEVICE_S3C2440) - case S3C24XX_GPJDAT : + case S3C24XX_GPJDAT: data = iface_gpio_port_r( S3C24XX_GPIO_PORT_J, s3c24xx_gpio_get_mask(m_gpio.regs.gpjcon, 0) & S3C24XX_GPJDAT_MASK) & S3C24XX_GPJDAT_MASK; + LOGMASKED(LOG_GPIO, "%s: GPIO read: GPJDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #endif + default: + LOGMASKED(LOG_GPIO, "%s: GPIO read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_GPIO + (offset << 2), data, mem_mask); + break; } - verboselog(*this, 9, "(GPIO) %08X -> %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data); return data; } @@ -1748,51 +1854,69 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_gpio_w ) #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) uint32_t old_value = ((uint32_t*)&m_gpio.regs)[offset]; #endif - verboselog(*this, 9, "(GPIO) %08X <- %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_gpio.regs)[offset]); switch (offset) { case S3C24XX_GPADAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPADAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_A, m_gpio.regs.gpacon ^ 0xFFFFFFFF, data & S3C24XX_GPADAT_MASK); break; case S3C24XX_GPBDAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPBDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_B, s3c24xx_gpio_get_mask(m_gpio.regs.gpbcon, 1) & S3C24XX_GPBDAT_MASK, data & S3C24XX_GPBDAT_MASK); break; case S3C24XX_GPCDAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPCDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_C, s3c24xx_gpio_get_mask(m_gpio.regs.gpccon, 1) & S3C24XX_GPCDAT_MASK, data & S3C24XX_GPCDAT_MASK); break; case S3C24XX_GPDDAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPDDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_D, s3c24xx_gpio_get_mask(m_gpio.regs.gpdcon, 1) & S3C24XX_GPDDAT_MASK, data & S3C24XX_GPDDAT_MASK); break; case S3C24XX_GPEDAT: + //LOGMASKED(LOG_GPIO, "%s: GPIO write: GPEDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_E, s3c24xx_gpio_get_mask(m_gpio.regs.gpecon, 1) & S3C24XX_GPEDAT_MASK, data & S3C24XX_GPEDAT_MASK); break; case S3C24XX_GPFDAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPFDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_F, s3c24xx_gpio_get_mask(m_gpio.regs.gpfcon, 1) & S3C24XX_GPFDAT_MASK, data & S3C24XX_GPFDAT_MASK); break; case S3C24XX_GPGDAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPGDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_G, s3c24xx_gpio_get_mask(m_gpio.regs.gpgcon, 1) & S3C24XX_GPGDAT_MASK, data & S3C24XX_GPGDAT_MASK); break; #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) case S3C24XX_GPHDAT: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GPHDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_H, s3c24xx_gpio_get_mask(m_gpio.regs.gphcon, 1) & S3C24XX_GPHDAT_MASK, data & S3C24XX_GPHDAT_MASK); break; case S3C24XX_EINTPEND: + LOGMASKED(LOG_GPIO, "%s: GPIO write: EINTPEND = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_gpio.regs.eintpend = (old_value & ~data); s3c24xx_check_pending_eint(); break; case S3C24XX_EINTMASK: + LOGMASKED(LOG_GPIO, "%s: GPIO write: EINTMASK = %08x & %08x\n", machine().describe_context(), data, mem_mask); s3c24xx_check_pending_eint(); break; case S3C24XX_GSTATUS2: + LOGMASKED(LOG_GPIO, "%s: GPIO write: GSTATUS2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_gpio.regs.gstatus2 = (old_value & ~data) & 7; // "The setting is cleared by writing '1' to this bit" break; #endif #if defined(DEVICE_S3C2440) + case S3C24XX_GPJCON: + case S3C24XX_GPJUP: + // Don't log anything, it's really chatty + break; case S3C24XX_GPJDAT: + //LOGMASKED(LOG_GPIO, "%s: GPIO write: GPJDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); iface_gpio_port_w(S3C24XX_GPIO_PORT_J, s3c24xx_gpio_get_mask(m_gpio.regs.gpjcon, 1) & S3C24XX_GPJDAT_MASK, data & S3C24XX_GPJDAT_MASK); break; #endif + default: + LOGMASKED(LOG_GPIO, "%s: GPIO write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_GPIO + (offset << 2), data, mem_mask); + break; } } @@ -1802,13 +1926,13 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_memcon_r ) { assert(offset < ARRAY_LENGTH(m_memcon.regs.data)); uint32_t data = m_memcon.regs.data[offset]; - verboselog(*this, 9, "(MEMCON) %08X -> %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data); + LOGMASKED(LOG_MEMCON, "%s: memcon read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_MEMCON + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_memcon_w ) { - verboselog(*this, 9, "(MEMCON) %08X <- %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data); + LOGMASKED(LOG_MEMCON, "%s: memcon write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_MEMCON + (offset << 2), data, mem_mask); COMBINE_DATA(&m_memcon.regs.data[offset]); } @@ -1819,41 +1943,39 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_usb_host_r ) uint32_t data = m_usbhost.regs.data[offset]; switch (offset) { - // HcCommandStatus - case 0x08 / 4 : - { - data = data & ~(1 << 0); // [bit 0] HostControllerReset - } - break; - // HcPeriodStart - case 0x40 / 4: - { - // "After a hardware reset, this field is cleared. This is then set by" - // "HCD during the HC initialization. The value is calculated" - // "roughly as 10% off from HcFmInterval.. A typical value will be 3E67h." - data = (data & ~0x00003FFF) | 0x3E67; - } - break; - // HcRhDescriptorA - case 0x48 / 4: - { - data = (data & ~0xFF) | 2; // number of ports - } + // HcCommandStatus + case 0x08 / 4: + data = data & ~(1 << 0); // [bit 0] HostControllerReset + LOGMASKED(LOG_USBHOST, "%s: USB host read: HcCommandStatus = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + // HcPeriodStart + case 0x40 / 4: + // "After a hardware reset, this field is cleared. This is then set by" + // "HCD during the HC initialization. The value is calculated" + // "roughly as 10% off from HcFmInterval.. A typical value will be 3E67h." + data = (data & ~0x00003FFF) | 0x3E67; + LOGMASKED(LOG_USBHOST, "%s: USB host read: HcPeriodStart = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + // HcRhDescriptorA + case 0x48 / 4: + data = (data & ~0xFF) | 2; // number of ports + LOGMASKED(LOG_USBHOST, "%s: USB host read: HcRhDescriptorA = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + // HcRhStatus + case 0x50 / 4: + data = data & ~(1 << 16); // "The Root Hub does not support the local power status feature; thus, this bit is always read as ?0?." + LOGMASKED(LOG_USBHOST, "%s: USB host read: HcRhStatus = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; - // HcRhStatus - case 0x50 / 4: - { - data = data & ~(1 << 16); // "The Root Hub does not support the local power status feature; thus, this bit is always read as ?0?." - } + default: + LOGMASKED(LOG_USBHOST, "%s: USB host read: %08x = %08x & %08x\n", machine().describe_context(), offset << 2, data, mem_mask); break; } - verboselog(*this, 9, "(USB H) %08X -> %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_usb_host_w ) { - verboselog(*this, 9, "(USB H) %08X <- %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data); + LOGMASKED(LOG_USBHOST, "%s: USB host write: %08x = %08x & %08x\n", machine().describe_context(), offset << 2, data, mem_mask); COMBINE_DATA(&m_usbhost.regs.data[offset]); } @@ -1865,17 +1987,19 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_uart_r(uint32_t ch, uint32_t offset) switch (offset) { case uart_t::UTRSTAT: - { - data = (data & ~0x00000006) | 0x00000004 | 0x00000002; // [bit 2] Transmitter empty / [bit 1] Transmit buffer empty - } + data = (data & ~0x00000006) | 0x00000004 | 0x00000002; // [bit 2] Transmitter empty / [bit 1] Transmit buffer empty + LOGMASKED(LOG_UART, "%s: UART %d read: UTRSTAT = %08x\n", machine().describe_context(), ch, data); break; case uart_t::URXH: { uint8_t rxdata = data & 0xFF; - verboselog(*this, 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?'); m_uart[ch].regs.utrstat &= ~1; // [bit 0] Receive buffer data ready + LOGMASKED(LOG_UART, "%s: UART %d read: URXH = %08x (%c)\n", machine().describe_context(), ch, data, ((rxdata >= 0x20 && rxdata < 0x7f) ? (char)rxdata : '?')); } break; + default: + LOGMASKED(LOG_UART, "%s: UART %d read: %08x = %08x\n", machine().describe_context(), ch, offset << 2, data); + break; } return data; } @@ -1886,56 +2010,50 @@ void S3C24_CLASS_NAME::s3c24xx_uart_w(uint32_t ch, uint32_t offset, uint32_t dat switch (offset) { case uart_t::UFCON : - { - m_uart[ch].regs.ufcon &= ~((1 << 2) | (1 << 1)); // bits 1 and 2 are auto-cleared after resetting FIFO - } + m_uart[ch].regs.ufcon &= ~((1 << 2) | (1 << 1)); // bits 1 and 2 are auto-cleared after resetting FIFO + LOGMASKED(LOG_UART, "%s: UART %d write: UFCON = %08x & %08x\n", machine().describe_context(), ch, data, mem_mask); break; case uart_t::UTXH : { uint8_t txdata = data & 0xFF; - verboselog( *this, 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?'); #ifdef UART_PRINTF - printf("%c", ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?'); + printf("%c", (txdata >= 32 && txdata < 128) ? (char)txdata : '?'); #endif + LOGMASKED(LOG_UART, "%s: UART %d write: UTXH = %08x & %08x (%c)\n", machine().describe_context(), ch, data, mem_mask, ((txdata >= 32 && txdata < 128) ? (char)txdata : '?')); } break; + default: + LOGMASKED(LOG_UART, "%s: UART %d write: %08x = %08x & %08x\n", machine().describe_context(), ch, offset << 2, data, mem_mask); + break; } } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_0_r ) { - uint32_t data = s3c24xx_uart_r(0, offset); -// verboselog( *this, 9, "(UART 0) %08X -> %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data); - return data; + return s3c24xx_uart_r(0, offset); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_1_r ) { - uint32_t data = s3c24xx_uart_r(1, offset); -// verboselog( *this, 9, "(UART 1) %08X -> %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data); - return data; + return s3c24xx_uart_r(1, offset); } #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_2_r ) { - uint32_t data = s3c24xx_uart_r(2, offset); -// verboselog( *this, 9, "(UART 2) %08X -> %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data); - return data; + return s3c24xx_uart_r(2, offset); } #endif WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_0_w ) { -// verboselog( *this, 9, "(UART 0) %08X <- %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data); s3c24xx_uart_w(0, offset, data, mem_mask); } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_1_w ) { -// verboselog( *this, 9, "(UART 1) %08X <- %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data); s3c24xx_uart_w(1, offset, data, mem_mask); } @@ -1943,7 +2061,6 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_1_w ) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_2_w ) { -// verboselog( *this, 9, "(UART 2) %08X <- %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data); s3c24xx_uart_w(2, offset, data, mem_mask); } @@ -1951,9 +2068,29 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_2_w ) void S3C24_CLASS_NAME::s3c24xx_uart_fifo_w(int uart, uint8_t data) { -// printf( "s3c24xx_uart_fifo_w (%c)\n", data); +#if defined(DEVICE_S3C2400) + static const uint32_t s_int_bits[2] = { S3C24XX_INT_URXD0, S3C24XX_INT_URXD1 }; +#else + static const uint32_t s_int_bits[3] = { S3C24XX_SUBINT_RXD0, S3C24XX_SUBINT_RXD1, S3C24XX_SUBINT_RXD2 }; +#endif + m_uart[uart].regs.urxh = data; m_uart[uart].regs.utrstat |= 1; // [bit 0] Receive buffer data ready + + bool request_irq = true; + if (BIT(m_uart[uart].regs.ufcon, 0)) + { + request_irq = false; + } + + if (request_irq) + { +#if defined(DEVICE_S3C2400) + s3c24xx_request_irq(s_int_bits[uart]); +#else + s3c24xx_request_subirq(s_int_bits[uart]); +#endif + } } /* USB Device */ @@ -1980,14 +2117,14 @@ void S3C24_CLASS_NAME::s3c24xx_usb_device_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_usb_device_r ) { - uint32_t data = m_usbdev.regs.data[offset]; - verboselog(*this, 9, "(USB D) %08X -> %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data); + const uint32_t data = m_usbdev.regs.data[offset]; + LOGMASKED(LOG_USB, "%s: USB read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_USBDEV + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_usb_device_w ) { - verboselog(*this, 9, "(USB D) %08X <- %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data); + LOGMASKED(LOG_USB, "%s: USB read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_USBDEV + (offset << 2), data, mem_mask); COMBINE_DATA(&m_usbdev.regs.data[offset]); } @@ -2008,9 +2145,12 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_wdt_r ) data = 0; #endif } + LOGMASKED(LOG_WDT, "%s: watchdog read: WTCNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + default: + LOGMASKED(LOG_WDT, "%s: watchdog read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_WDT + (offset << 2), data, mem_mask); break; } - verboselog(*this, 9, "(WDT) %08X -> %08X\n", S3C24XX_BASE_WDT + (offset << 2), data); return data; } @@ -2018,13 +2158,13 @@ void S3C24_CLASS_NAME::s3c24xx_wdt_start() { uint32_t pclk, prescaler, clock; double freq, hz; - verboselog(*this, 1, "WDT start\n"); + LOGMASKED(LOG_WDT, "WDT start\n"); pclk = s3c24xx_get_pclk(); prescaler = BITS(m_wdt.regs.wtcon, 15, 8); clock = 16 << BITS(m_wdt.regs.wtcon, 4, 3); freq = (double)pclk / (prescaler + 1) / clock; hz = freq / m_wdt.regs.wtcnt; - verboselog(*this, 5, "WDT pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz); + LOGMASKED(LOG_WDT, "watchdog start: pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz); m_wdt.timer->adjust( attotime::from_hz( hz), 0, attotime::from_hz( hz)); #if defined(DEVICE_S3C2410) m_wdt.freq = freq; @@ -2034,7 +2174,7 @@ void S3C24_CLASS_NAME::s3c24xx_wdt_start() void S3C24_CLASS_NAME::s3c24xx_wdt_stop() { - verboselog( *this, 1, "WDT stop\n"); + LOGMASKED(LOG_WDT, "watchdog stop\n"); #if defined(DEVICE_S3C2410) m_wdt.regs.wtcnt = m_wdt.calc_current_count(); #else @@ -2054,20 +2194,23 @@ void S3C24_CLASS_NAME::s3c24xx_wdt_recalc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_wdt_w ) { uint32_t old_value = ((uint32_t*)&m_wdt.regs)[offset]; - verboselog( *this, 9, "(WDT) %08X <- %08X\n", S3C24XX_BASE_WDT + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_wdt.regs)[offset]); switch (offset) { - case wdt_t::WTCON : + case wdt_t::WTCON: + LOGMASKED(LOG_WDT, "%s: watchdog write: WTCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); if (BIT(data ^ old_value, 5)) s3c24xx_wdt_recalc(); break; + default: + LOGMASKED(LOG_WDT, "%s: watchdog write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_WDT + (offset << 2), data, mem_mask); + break; } } TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_wdt_timer_exp ) { - verboselog( *this, 2, "WDT timer callback\n"); + LOGMASKED(LOG_WDT, "WDT timer callback\n"); if (BIT(m_wdt.regs.wtcon, 2)) { #if defined(DEVICE_S3C2400) || defined(DEVICE_S3C2410) @@ -2117,7 +2260,7 @@ int S3C24_CLASS_NAME::iface_i2c_sda_r() void S3C24_CLASS_NAME::i2c_send_start() { // FIXME: this needs to sense busy condition and use realistic timing - verboselog(*this, 5, "i2c_send_start\n"); + LOGMASKED(LOG_I2C, "i2c_send_start\n"); iface_i2c_sda_w(1); iface_i2c_scl_w(1); iface_i2c_sda_w(0); @@ -2127,7 +2270,7 @@ void S3C24_CLASS_NAME::i2c_send_start() void S3C24_CLASS_NAME::i2c_send_stop() { // FIXME: this needs realistic timing - verboselog(*this, 5, "i2c_send_stop\n"); + LOGMASKED(LOG_I2C, "i2c_send_stop\n"); iface_i2c_sda_w(0); iface_i2c_scl_w(1); iface_i2c_sda_w(1); @@ -2137,7 +2280,7 @@ void S3C24_CLASS_NAME::i2c_send_stop() uint8_t S3C24_CLASS_NAME::i2c_receive_byte(int ack) { uint8_t data = 0; - verboselog(*this, 5, "i2c_receive_byte ...\n"); + LOGMASKED(LOG_I2C, "i2c_receive_byte ...\n"); iface_i2c_sda_w(1); for (int i = 0; i < 8; i++) { @@ -2145,8 +2288,8 @@ uint8_t S3C24_CLASS_NAME::i2c_receive_byte(int ack) data = (data << 1) + (iface_i2c_sda_r() ? 1 : 0); iface_i2c_scl_w( 0); } - verboselog(*this, 5, "recv data %02X\n", data); - verboselog(*this, 5, "send ack %d\n", ack); + LOGMASKED(LOG_I2C, "recv data %02X\n", data); + LOGMASKED(LOG_I2C, "send ack %d\n", ack); iface_i2c_sda_w(ack ? 0 : 1); iface_i2c_scl_w(1); iface_i2c_scl_w(0); @@ -2156,8 +2299,8 @@ uint8_t S3C24_CLASS_NAME::i2c_receive_byte(int ack) int S3C24_CLASS_NAME::i2c_send_byte(uint8_t data) { int ack; - verboselog(*this, 5, "i2c_send_byte ...\n"); - verboselog(*this, 5, "send data %02X\n", data); + LOGMASKED(LOG_I2C, "i2c_send_byte ...\n"); + LOGMASKED(LOG_I2C, "send data %02X\n", data); for (int i = 0; i < 8; i++) { iface_i2c_sda_w((data & 0x80) ? 1 : 0); @@ -2168,41 +2311,39 @@ int S3C24_CLASS_NAME::i2c_send_byte(uint8_t data) iface_i2c_sda_w(1); // ack bit iface_i2c_scl_w(1); ack = iface_i2c_sda_r(); - verboselog(*this, 5, "recv ack %d\n", ack); + LOGMASKED(LOG_I2C, "recv ack %d\n", ack); iface_i2c_scl_w(0); return ack; } void S3C24_CLASS_NAME::iic_start() { - int mode_selection; - verboselog(*this, 1, "IIC start\n"); + LOGMASKED(LOG_I2C, "I2C start\n"); i2c_send_start(); - mode_selection = BITS( m_iic.regs.iicstat, 7, 6); + int mode_selection = BITS(m_iic.regs.iicstat, 7, 6); switch (mode_selection) { - case 2: i2c_send_byte( m_iic.regs.iicds | 0x01); break; - case 3: i2c_send_byte( m_iic.regs.iicds & 0xFE); break; + case 2: i2c_send_byte(m_iic.regs.iicds | 0x01); break; + case 3: i2c_send_byte(m_iic.regs.iicds & 0xFE); break; } m_iic.timer->adjust( attotime::from_usec( 1)); } void S3C24_CLASS_NAME::iic_stop() { - verboselog(*this, 1, "IIC stop\n"); + LOGMASKED(LOG_I2C, "IIC stop\n"); i2c_send_stop(); m_iic.timer->adjust(attotime::never); } void S3C24_CLASS_NAME::iic_resume() { - int mode_selection; - verboselog(*this, 1, "IIC resume\n"); - mode_selection = BITS(m_iic.regs.iicstat, 7, 6); + LOGMASKED(LOG_I2C, "IIC resume\n"); + int mode_selection = BITS(m_iic.regs.iicstat, 7, 6); switch (mode_selection) { - case 2: m_iic.regs.iicds = i2c_receive_byte(BIT( m_iic.regs.iiccon, 7)); break; - case 3: i2c_send_byte( m_iic.regs.iicds & 0xFF); break; + case 2: m_iic.regs.iicds = i2c_receive_byte(BIT(m_iic.regs.iiccon, 7)); break; + case 3: i2c_send_byte(m_iic.regs.iicds & 0xFF); break; } m_iic.timer->adjust(attotime::from_usec(1)); } @@ -2214,32 +2355,32 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_r ) { case S3C24XX_IICSTAT: data = data & ~0x0000000F; + LOGMASKED(LOG_I2C, "%s: i2c read: IICSTAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + default: + LOGMASKED(LOG_I2C, "%s: i2c read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_IIC + (offset << 2), data, mem_mask); break; } - verboselog(*this, 9, "(IIC) %08X -> %08X\n", S3C24XX_BASE_IIC + (offset << 2), data); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_w ) { uint32_t old_value = ((uint32_t*)&m_iic.regs)[offset]; - verboselog(*this, 9, "(IIC) %08X <- %08X\n", S3C24XX_BASE_IIC + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_iic.regs)[offset]); switch (offset) { case S3C24XX_IICCON: { - int interrupt_pending_flag; + LOGMASKED(LOG_I2C, "%s: i2c write: IICCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); #if 0 static constexpr int div_table[] = { 16, 512 }; - int enable_interrupt, transmit_clock_value, tx_clock_source_selection - double clock; - transmit_clock_value = (data >> 0) & 0xF; - tx_clock_source_selection = (data >> 6) & 1; - enable_interrupt = (data >> 5) & 1; - clock = (double)s3c24xx_get_pclk() / div_table[tx_clock_source_selection] / (transmit_clock_value + 1); -#endif - interrupt_pending_flag = BIT(old_value, 4); + int transmit_clock_value = (data >> 0) & 0xF; + int tx_clock_source_selection = (data >> 6) & 1; + int enable_interrupt = (data >> 5) & 1; + double clock = (double)s3c24xx_get_pclk() / div_table[tx_clock_source_selection] / (transmit_clock_value + 1); +#endif + int interrupt_pending_flag = BIT(old_value, 4); if (interrupt_pending_flag != 0) { interrupt_pending_flag = BIT(data, 4); @@ -2269,13 +2410,12 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_w ) break; case S3C24XX_IICSTAT: { - int interrupt_pending_flag; + LOGMASKED(LOG_I2C, "%s: i2c write: IICSTAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_iic.count = 0; - interrupt_pending_flag = BIT( m_iic.regs.iiccon, 4); + int interrupt_pending_flag = BIT(m_iic.regs.iiccon, 4); if (interrupt_pending_flag == 0) { - int start_stop_condition; - start_stop_condition = BIT( data, 5); + int start_stop_condition = BIT(data, 5); if (start_stop_condition != 0) { if (m_iic.count == 0) @@ -2295,13 +2435,16 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_w ) } } break; + default: + LOGMASKED(LOG_I2C, "%s: i2c write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_IIC + (offset << 2), data, mem_mask); + break; } } TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_timer_exp ) { int enable_interrupt; - verboselog(*this, 2, "IIC timer callback\n"); + LOGMASKED(LOG_I2C, "I2C timer callback\n"); m_iic.count++; enable_interrupt = BIT(m_iic.regs.iiccon, 5); if (enable_interrupt) @@ -2322,23 +2465,21 @@ void S3C24_CLASS_NAME::iface_i2s_data_w(int ch, uint16_t data) void S3C24_CLASS_NAME::s3c24xx_iis_start() { const uint32_t codeclk_table[] = { 256, 384}; - double freq; - int pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk; - verboselog( *this, 1, "IIS start\n"); - prescaler_enable = BIT( m_iis.regs.iiscon, 1); - prescaler_control_a = BITS( m_iis.regs.iispsr, 9, 5); - prescaler_control_b = BITS( m_iis.regs.iispsr, 4, 0); - codeclk = BIT( m_iis.regs.iismod, 2); - pclk = s3c24xx_get_pclk(); - freq = ((double)pclk / (prescaler_control_a + 1) / codeclk_table[codeclk]) * 2; // why do I have to multiply by two? - verboselog( *this, 5, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq); + LOGMASKED(LOG_I2S, "IIS start\n"); + int prescaler_enable = BIT(m_iis.regs.iiscon, 1); + int prescaler_control_a = BITS(m_iis.regs.iispsr, 9, 5); + int prescaler_control_b = BITS(m_iis.regs.iispsr, 4, 0); + int codeclk = BIT(m_iis.regs.iismod, 2); + int pclk = s3c24xx_get_pclk(); + double freq = ((double)pclk / (prescaler_control_a + 1) / codeclk_table[codeclk]) * 2; // why do I have to multiply by two? + LOGMASKED(LOG_I2S, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq); m_iis.timer->adjust( attotime::from_hz( freq), 0, attotime::from_hz( freq)); } void S3C24_CLASS_NAME::s3c24xx_iis_stop() { - verboselog( *this, 1, "IIS stop\n"); - m_iis.timer->adjust( attotime::never); + LOGMASKED(LOG_I2S, "IIS stop\n"); + m_iis.timer->adjust(attotime::never); } void S3C24_CLASS_NAME::s3c24xx_iis_recalc() @@ -2355,27 +2496,29 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_r ) #if 0 switch (offset) { - case iis_t::IISCON : + case iis_t::IISCON: data = data & ~1; // hack for mp3 player + LOGMASKED(LOG_I2S, "%s: i2s read: IISCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; } #endif - verboselog(*this, 9, "(IIS) %08X -> %08X\n", S3C24XX_BASE_IIS + (offset << 2), data); + LOGMASKED(LOG_I2S, "%s: i2s read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_IIS + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_w ) { uint32_t old_value = ((uint32_t*)&m_iis.regs)[offset]; - verboselog(*this, 9, "(IIS) %08X <- %08X\n", S3C24XX_BASE_IIS + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_iis.regs)[offset]); switch (offset) { - case iis_t::IISCON : + case iis_t::IISCON: + LOGMASKED(LOG_I2S, "%s: i2s write: IISCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); if (BIT(data ^ old_value, 0)) s3c24xx_iis_recalc(); break; - case iis_t::IISFIFO : + case iis_t::IISFIFO: + LOGMASKED(LOG_I2S, "%s: i2s write: IISFIFO = %08x & %08x\n", machine().describe_context(), data, mem_mask); if (ACCESSING_BITS_16_31) { m_iis.fifo[m_iis.fifo_index++] = BITS(data, 31, 16); @@ -2391,12 +2534,15 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_w ) iface_i2s_data_w(1, m_iis.fifo[1]); } break; + default: + LOGMASKED(LOG_I2S, "%s: i2s write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_IIS + (offset << 2), data, mem_mask); + break; } } TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_timer_exp ) { - verboselog(*this, 2, "IIS timer callback\n"); + LOGMASKED(LOG_I2S, "IIS timer callback\n"); s3c24xx_dma_request_iis(); } @@ -2405,32 +2551,35 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_timer_exp ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_r ) { uint32_t data = ((uint32_t*)&m_rtc.regs)[offset]; - verboselog( *this, 9, "(RTC) %08X -> %08X\n", S3C24XX_BASE_RTC + (offset << 2), data); + LOGMASKED(LOG_RTC, "%s: rtc read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_RTC + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_w ) { - verboselog( *this, 9, "(RTC) %08X <- %08X\n", S3C24XX_BASE_RTC + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_rtc.regs)[offset]); switch (offset) { - case rtc_t::TICNT : + case rtc_t::TICNT: + LOGMASKED(LOG_RTC, "%s: rtc write: TICNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_rtc.recalc(); break; + default: + LOGMASKED(LOG_RTC, "%s: rtc write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_RTC + (offset << 2), data, mem_mask); + break; } } TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_timer_tick_count_exp ) { - verboselog(*this, 2, "RTC timer callback (tick count)\n"); + LOGMASKED(LOG_RTC, "RTC timer callback (tick count)\n"); s3c24xx_request_irq(S3C24XX_INT_TICK); } void S3C24_CLASS_NAME::s3c24xx_rtc_update() { m_rtc.update(); - verboselog( *this, 5, "RTC - %04d/%02d/%02d %02d:%02d:%02d\n", bcd_2_dec( m_rtc.regs.bcdyear) + 2000, bcd_2_dec( m_rtc.regs.bcdmon), bcd_2_dec( m_rtc.regs.bcdday), bcd_2_dec( m_rtc.regs.bcdhour), bcd_2_dec( m_rtc.regs.bcdmin), bcd_2_dec( m_rtc.regs.bcdsec)); + LOGMASKED(LOG_RTC, "RTC - %04d/%02d/%02d %02d:%02d:%02d\n", bcd_2_dec( m_rtc.regs.bcdyear) + 2000, bcd_2_dec( m_rtc.regs.bcdmon), bcd_2_dec( m_rtc.regs.bcdday), bcd_2_dec( m_rtc.regs.bcdhour), bcd_2_dec( m_rtc.regs.bcdmin), bcd_2_dec( m_rtc.regs.bcdsec)); } void S3C24_CLASS_NAME::s3c24xx_rtc_check_alarm() @@ -2441,7 +2590,7 @@ void S3C24_CLASS_NAME::s3c24xx_rtc_check_alarm() TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_timer_update_exp ) { - verboselog(*this, 2, "RTC timer callback (update)\n"); + LOGMASKED(LOG_RTC, "RTC timer callback (update)\n"); s3c24xx_rtc_update(); s3c24xx_rtc_check_alarm(); } @@ -2485,23 +2634,28 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_adc_r ) #if defined(DEVICE_S3C2400) case S3C24XX_ADCDAT: data = (data & ~0x3FF) | (iface_adc_data_r(0) & 0x3FF); + LOGMASKED(LOG_ADC, "%s: ADC read: ADCDAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #else case S3C24XX_ADCDAT0: data = (data & ~0x3FF) | (iface_adc_data_r(0) & 0x3FF); + LOGMASKED(LOG_ADC, "%s: ADC read: ADCDAT0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case S3C24XX_ADCDAT1: data = (data & ~0x3FF) | (iface_adc_data_r(1) & 0x3FF); + LOGMASKED(LOG_ADC, "%s: ADC read: ADCDAT1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #endif + default: + LOGMASKED(LOG_ADC, "%s: ADC read: %08x = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; } - verboselog(*this, 9, "(ADC) %08X -> %08X\n", S3C24XX_BASE_ADC + (offset << 2), data); return data; } void S3C24_CLASS_NAME::s3c24xx_adc_start() { - verboselog(*this, 1, "ADC start\n"); + LOGMASKED(LOG_ADC, "ADC start\n"); m_adc.regs.adccon &= ~(1 << 0); // A/D conversion is completed m_adc.regs.adccon |= (1 << 15); // End of A/D conversion #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) @@ -2512,18 +2666,19 @@ void S3C24_CLASS_NAME::s3c24xx_adc_start() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_adc_w ) { uint32_t old_value = ((uint32_t*)&m_adc.regs)[offset]; - verboselog(*this, 9, "(ADC) %08X <- %08X\n", S3C24XX_BASE_ADC + (offset << 2), data); COMBINE_DATA(&((uint32_t*)&m_adc.regs)[offset]); switch (offset) { - case S3C24XX_ADCCON : - { + case S3C24XX_ADCCON: if (((old_value & (1 << 0)) == 0) && ((data & (1 << 0)) != 0)) { s3c24xx_adc_start(); } - } - break; + LOGMASKED(LOG_ADC, "%s: ADC write: ADCCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + default: + LOGMASKED(LOG_ADC, "%s: ADC write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_ADC + (offset << 2), data, mem_mask); + break; } } @@ -2571,8 +2726,8 @@ void S3C24_CLASS_NAME::s3c24xx_spi_w(uint32_t ch, uint32_t offset, uint32_t data READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_0_r ) { - uint32_t data = s3c24xx_spi_r(0, offset); - verboselog(*this, 9, "(SPI 0) %08X -> %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data); + const uint32_t data = s3c24xx_spi_r(0, offset); + LOGMASKED(LOG_SPI, "%s: SPI 0 read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_SPI_0 + (offset << 2), data, mem_mask); return data; } @@ -2580,8 +2735,8 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_0_r ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_1_r ) { - uint32_t data = s3c24xx_spi_r(1, offset); - verboselog(*this, 9, "(SPI 1) %08X -> %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data); + const uint32_t data = s3c24xx_spi_r(1, offset); + LOGMASKED(LOG_SPI, "%s: SPI 0 read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_SPI_0 + (offset << 2), data, mem_mask); return data; } @@ -2589,7 +2744,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_1_r ) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_0_w ) { - verboselog( *this, 9, "(SPI 0) %08X <- %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data); + LOGMASKED(LOG_SPI, "%s: SPI 0 write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_SPI_0 + (offset << 2), data, mem_mask); s3c24xx_spi_w( 0, offset, data, mem_mask); } @@ -2597,7 +2752,7 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_0_w ) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_1_w ) { - verboselog( *this, 9, "(SPI 1) %08X <- %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data); + LOGMASKED(LOG_SPI, "%s: SPI 1 write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_SPI_0 + (offset << 2), data, mem_mask); s3c24xx_spi_w( 1, offset, data, mem_mask); } @@ -2609,14 +2764,14 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_1_w ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_mmc_r ) { - uint32_t data = m_mmc.regs.data[offset]; - verboselog(*this, 9, "(MMC) %08X -> %08X\n", S3C24XX_BASE_MMC + (offset << 2), data); + const uint32_t data = m_mmc.regs.data[offset]; + LOGMASKED(LOG_MMC, "%s: MMC read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_MMC + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_mmc_w ) { - verboselog(*this, 9, "(MMC) %08X <- %08X\n", S3C24XX_BASE_MMC + (offset << 2), data); + LOGMASKED(LOG_MMC, "%s: MMC write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_MMC + (offset << 2), data, mem_mask); COMBINE_DATA(&m_mmc.regs.data[offset]); } @@ -2640,13 +2795,13 @@ void S3C24_CLASS_NAME::s3c24xx_sdi_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_sdi_r ) { uint32_t data = m_sdi.regs.data[offset]; - verboselog( *this, 9, "(SDI) %08X -> %08X\n", S3C24XX_BASE_SDI + (offset << 2), data); + LOGMASKED(LOG_SDI, "%s: SDI read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_SDI + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_sdi_w ) { - verboselog( *this, 9, "(SDI) %08X <- %08X\n", S3C24XX_BASE_SDI + (offset << 2), data); + LOGMASKED(LOG_SDI, "%s: SDI write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_SDI + (offset << 2), data, mem_mask); COMBINE_DATA(&m_sdi.regs.data[offset]); } @@ -2768,7 +2923,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(uint8_t data) temp[1] = m_nand.mecc[1]; temp[2] = m_nand.mecc[2]; nand_update_mecc(m_nand.mecc, m_nand.ecc_pos++, data); - verboselog(*this, 5, "NAND - MECC %03X - %02X %02X %02X -> %02X %02X %02X\n", m_nand.ecc_pos - 1, temp[0], temp[1], temp[2], m_nand.mecc[0], m_nand.mecc[1], m_nand.mecc[2]); + LOGMASKED(LOG_FLASH, "%s: NAND - MECC %03X - %02X %02X %02X -> %02X %02X %02X\n", machine().describe_context(), m_nand.ecc_pos - 1, temp[0], temp[1], temp[2], m_nand.mecc[0], m_nand.mecc[1], m_nand.mecc[2]); if (m_nand.ecc_pos == 512) m_nand.ecc_pos = 0; #else @@ -2779,7 +2934,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(uint8_t data) temp[2] = m_nand.mecc[2]; temp[3] = m_nand.mecc[3]; nand_update_mecc( m_nand.mecc, m_nand.ecc_pos++, data); - verboselog( *this, 5, "NAND - MECC %03X - %02X %02X %02X %02X -> %02X %02X %02X %02X\n", m_nand.ecc_pos - 1, temp[0], temp[1], temp[2], temp[3], m_nand.mecc[0], m_nand.mecc[1], m_nand.mecc[2], m_nand.mecc[3]); + LOGMASKED(LOG_FLASH, "%s: NAND - MECC %03X - %02X %02X %02X %02X -> %02X %02X %02X %02X\n", machine().describe_context(), m_nand.ecc_pos - 1, temp[0], temp[1], temp[2], temp[3], m_nand.mecc[0], m_nand.mecc[1], m_nand.mecc[2], m_nand.mecc[3]); if (m_nand.ecc_pos == 2048) m_nand.ecc_pos = 0; } if (!BIT(m_nand.regs.nfcont, 6)) @@ -2787,7 +2942,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(uint8_t data) temp[0] = m_nand.secc[0]; temp[1] = m_nand.secc[1]; nand_update_secc(m_nand.secc, m_nand.ecc_pos++, data); - verboselog( *this, 5, "NAND - SECC %02X - %02X %02X -> %02X %02X\n", m_nand.ecc_pos - 1, temp[0], temp[1], m_nand.secc[0], m_nand.secc[1]); + LOGMASKED(LOG_FLASH, "%s: NAND - SECC %02X - %02X %02X -> %02X %02X\n", machine().describe_context(), m_nand.ecc_pos - 1, temp[0], temp[1], m_nand.secc[0], m_nand.secc[1]); if (m_nand.ecc_pos == 16) m_nand.ecc_pos = 0; } @@ -2796,31 +2951,31 @@ void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(uint8_t data) void S3C24_CLASS_NAME::s3c24xx_nand_command_w(uint8_t data) { - verboselog(*this, 5, "NAND write command %02X\n", data); + LOGMASKED(LOG_FLASH, "%s: NAND write command %02X\n", machine().describe_context(), data); m_nand.data_count = 0; - iface_nand_command_w( data); + iface_nand_command_w(data); } void S3C24_CLASS_NAME::s3c24xx_nand_address_w(uint8_t data) { - verboselog( *this, 5, "NAND write address %02X\n", data); + LOGMASKED(LOG_FLASH, "%s: NAND write address %02X\n", machine().describe_context(), data); m_nand.data_count = 0; - iface_nand_address_w( data); + iface_nand_address_w(data); } uint8_t S3C24_CLASS_NAME::s3c24xx_nand_data_r() { uint8_t data = iface_nand_data_r(); - verboselog( *this, 5, "NAND read data %02X [%04X]\n", data, m_nand.data_count++); - s3c24xx_nand_update_ecc( data); + LOGMASKED(LOG_FLASH, "%s: NAND read data %02X [%04X]\n", machine().describe_context(), data, m_nand.data_count++); + s3c24xx_nand_update_ecc(data); return data; } void S3C24_CLASS_NAME::s3c24xx_nand_data_w(uint8_t data) { - verboselog( *this, 5, "NAND write data %02X [%04X]\n", data, m_nand.data_count++); - iface_nand_data_w( data); - s3c24xx_nand_update_ecc( data); + LOGMASKED(LOG_FLASH, "%s: NAND write data %02X [%04X]\n", machine().describe_context(), data, m_nand.data_count++); + iface_nand_data_w(data); + s3c24xx_nand_update_ecc(data); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_r ) @@ -2842,30 +2997,37 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_r ) #if defined(DEVICE_S3C2410) case S3C24XX_NFECC : data = ((m_nand.mecc[2] << 16) | (m_nand.mecc[1] << 8) | (m_nand.mecc[0] << 0)); + LOGMASKED(LOG_FLASH, "%s: NAND read: NFECC = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #endif #if defined(DEVICE_S3C2440) case S3C24XX_NFMECC0 : data = (m_nand.mecc[3] << 24) | (m_nand.mecc[2] << 16) | (m_nand.mecc[1] << 8) | (m_nand.mecc[0] << 0); + LOGMASKED(LOG_FLASH, "%s: NAND read: NFMECC0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case S3C24XX_NFSECC : data = (m_nand.secc[1] << 8) | (m_nand.secc[0] << 0); + LOGMASKED(LOG_FLASH, "%s: NAND read: NFSECC = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case S3C24XX_NFESTAT0 : data &= ~0x000000F; // no main/spare ECC errors + LOGMASKED(LOG_FLASH, "%s: NAND read: NFESTAT0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; case S3C24XX_NFESTAT1 : data &= ~0x000000F; // no main/spare ECC errors + LOGMASKED(LOG_FLASH, "%s: NAND read: NFESTAT1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); break; #endif + default: + LOGMASKED(LOG_FLASH, "%s: NAND read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_NAND + (offset << 2), data, mem_mask); + break; } - verboselog(*this, 9, "(NAND) %08X -> %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask); return data; } void S3C24_CLASS_NAME::s3c24xx_nand_init_ecc() { - verboselog( *this, 5, "NAND - init ecc\n"); + LOGMASKED(LOG_FLASH, "NAND - init ecc\n"); m_nand.mecc[0] = 0xFF; m_nand.mecc[1] = 0xFF; m_nand.mecc[2] = 0xFF; @@ -2880,23 +3042,25 @@ void S3C24_CLASS_NAME::s3c24xx_nand_init_ecc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_w ) { uint32_t old_value = ((uint32_t*)&m_nand.regs)[offset]; - verboselog( *this, 9, "(NAND) %08X <- %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask); COMBINE_DATA(&((uint32_t*)&m_nand.regs)[offset]); switch (offset) { #if defined(DEVICE_S3C2410) case S3C24XX_NFCONF: + LOGMASKED(LOG_FLASH, "%s: NAND write: NFCONF = %08x & %08x\n", machine().describe_context(), data, mem_mask); if ((data & (1 << 12)) != 0) s3c24xx_nand_init_ecc(); break; #endif #if defined(DEVICE_S3C2440) case S3C24XX_NFCONT: + LOGMASKED(LOG_FLASH, "%s: NAND write: NFCONT = %08x & %08x\n", machine().describe_context(), data, mem_mask); if ((data & (1 << 4)) != 0) s3c24xx_nand_init_ecc(); break; #endif case S3C24XX_NFSTAT: + LOGMASKED(LOG_FLASH, "%s: NAND write: NFSTAT = %08x & %08x\n", machine().describe_context(), data, mem_mask); m_nand.regs.nfstat = (m_nand.regs.nfstat & ~0x03) | (old_value & 0x03); // read-only #if defined(DEVICE_S3C2440) if ((data & (1 << 2)) != 0) @@ -2904,9 +3068,11 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_w ) #endif break; case S3C24XX_NFCMD: + LOGMASKED(LOG_FLASH, "%s: NAND write: NFCMD = %08x & %08x\n", machine().describe_context(), data, mem_mask); s3c24xx_nand_command_w(data); break; case S3C24XX_NFADDR: + LOGMASKED(LOG_FLASH, "%s: NAND write: NFADDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); s3c24xx_nand_address_w(data); break; case S3C24XX_NFDATA: @@ -2919,12 +3085,15 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_w ) if ((mem_mask & 0xFF000000) != 0) s3c24xx_nand_data_w((data >> 24) & 0xFF); #endif break; + default: + LOGMASKED(LOG_FLASH, "%s: NAND write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_NAND + (offset << 2), data, mem_mask); + break; } } ATTR_UNUSED WRITE_LINE_MEMBER( S3C24_CLASS_NAME::s3c24xx_pin_frnb_w ) { - verboselog( *this, 9, "s3c24xx_pin_frnb_w (%d)\n", state); + LOGMASKED(LOG_FLASH, "s3c24xx_pin_frnb_w (%d)\n", state); #if defined(DEVICE_S3C2440) if ((BIT( m_nand.regs.nfstat, 0) == 0) && (state != 0)) { @@ -2948,13 +3117,13 @@ ATTR_UNUSED WRITE_LINE_MEMBER( S3C24_CLASS_NAME::s3c24xx_pin_frnb_w ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_cam_r ) { uint32_t data = m_cam.regs.data[offset]; - verboselog(*this, 9, "(CAM) %08X -> %08X\n", S3C24XX_BASE_CAM + (offset << 2), data); + LOGMASKED(LOG_CAM, "%s: camera read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_CAM + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_cam_w ) { - verboselog(*this, 9, "(CAM) %08X <- %08X\n", S3C24XX_BASE_CAM + (offset << 2), data); + LOGMASKED(LOG_CAM, "%s: camera write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_CAM + (offset << 2), data, mem_mask); COMBINE_DATA(&m_cam.regs.data[offset]); } @@ -2966,14 +3135,14 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_cam_w ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_ac97_r ) { - uint32_t data = m_ac97.regs.data[offset]; - verboselog(*this, 9, "(AC97) %08X -> %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data); + const uint32_t data = m_ac97.regs.data[offset]; + LOGMASKED(LOG_AC97, "%s: audio codec read: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_AC97 + (offset << 2), data, mem_mask); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_ac97_w ) { - verboselog(*this, 9, "(AC97) %08X <- %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data); + LOGMASKED(LOG_AC97, "%s: audio codec write: %08x = %08x & %08x\n", machine().describe_context(), S3C24XX_BASE_AC97 + (offset << 2), data, mem_mask); COMBINE_DATA(&m_ac97.regs.data[offset]); } @@ -3055,7 +3224,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_auto_boot() void S3C24_CLASS_NAME::s3c24xx_device_reset() { - verboselog( *this, 1, "s3c24xx device reset\n"); + LOGMASKED(LOG_RESET, "s3c24xx device reset\n"); for (uart_t &uart : m_uart) uart.reset(); m_pwm.reset(); @@ -3091,7 +3260,7 @@ void S3C24_CLASS_NAME::s3c24xx_device_reset() void S3C24_CLASS_NAME::s3c24xx_device_start() { - verboselog(*this, 1, "s3c24xx device start\n"); + LOGMASKED(LOG_RESET, "s3c24xx device start\n"); m_pin_r_cb.resolve(); m_pin_w_cb.resolve_safe(); m_port_r_cb.resolve(); @@ -3123,7 +3292,7 @@ void S3C24_CLASS_NAME::s3c24xx_device_start() int om1 = iface_core_pin_r(S3C24XX_CORE_PIN_OM1); if ((om0 == 0) && (om1 == 0)) { - address_space &space = m_cpu->memory().space(AS_PROGRAM); + address_space &space = m_cpu->space(AS_PROGRAM); space.install_ram(0x00000000, 0x00000fff, m_steppingstone); space.install_ram(0x40000000, 0x40000fff, m_steppingstone); } diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index 0c56bb51a17..8478f54bc58 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -264,6 +264,7 @@ void s3c44b0_device::device_start() m_data_r_cb.resolve_safe(0); m_data_w_cb.resolve(); + m_cache = m_cpu->space(AS_PROGRAM).cache<2, 0, ENDIANNESS_LITTLE>(); for (int i = 0; i < 6; i++) m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::pwm_timer_exp),this)); for (auto & elem : m_uart) elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::uart_timer_exp),this)); @@ -536,27 +537,25 @@ void s3c44b0_device::lcd_dma_init() void s3c44b0_device::lcd_dma_read(int count, uint8_t *data) { - address_space &space = m_cpu->space(AS_PROGRAM); - uint8_t *vram = (uint8_t *)space.get_read_ptr(m_lcd.vramaddr_cur); for (int i = 0; i < count / 2; i++) { if (m_lcd.bswp == 0) { if ((m_lcd.vramaddr_cur & 2) == 0) { - data[0] = *(vram + 3); - data[1] = *(vram + 2); + data[0] = m_cache->read_byte(m_lcd.vramaddr_cur + 3); + data[1] = m_cache->read_byte(m_lcd.vramaddr_cur + 2); } else { - data[0] = *(vram - 1); - data[1] = *(vram - 2); + data[0] = m_cache->read_byte(m_lcd.vramaddr_cur - 1); + data[1] = m_cache->read_byte(m_lcd.vramaddr_cur - 2); } } else { - data[0] = *(vram + 0); - data[1] = *(vram + 1); + data[0] = m_cache->read_byte(m_lcd.vramaddr_cur + 0); + data[1] = m_cache->read_byte(m_lcd.vramaddr_cur + 1); } m_lcd.vramaddr_cur += 2; m_lcd.pagewidth_cur++; @@ -568,11 +567,6 @@ void s3c44b0_device::lcd_dma_read(int count, uint8_t *data) lcd_dma_reload(); } m_lcd.pagewidth_cur = 0; - vram = (uint8_t *)space.get_read_ptr(m_lcd.vramaddr_cur); - } - else - { - vram += 2; } data += 2; } diff --git a/src/devices/machine/s3c44b0.h b/src/devices/machine/s3c44b0.h index f4f194ce3c8..bebddc710ac 100644 --- a/src/devices/machine/s3c44b0.h +++ b/src/devices/machine/s3c44b0.h @@ -599,6 +599,8 @@ private: devcb_write_line m_sda_w_cb; devcb_read32 m_data_r_cb; devcb_write16 m_data_w_cb; + + memory_access_cache<2, 0, ENDIANNESS_LITTLE> *m_cache; }; DECLARE_DEVICE_TYPE(S3C44B0, s3c44b0_device) diff --git a/src/devices/machine/sensorboard.h b/src/devices/machine/sensorboard.h index 424db04c558..d950b2041ac 100644 --- a/src/devices/machine/sensorboard.h +++ b/src/devices/machine/sensorboard.h @@ -45,6 +45,8 @@ public: u16 read_file(u8 x, bool reverse = false); u16 read_rank(u8 y, bool reverse = false); + bool is_inductive() { return m_inductive; } + // handle board state u8 read_piece(u8 x, u8 y) { return m_curstate[y * m_width + x]; } void write_piece(u8 x, u8 y, u8 id) { m_curstate[y * m_width + x] = id; } diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 804cafe4f76..bfb8e1a2cf5 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -86,16 +86,30 @@ void spg2xx_device::device_start() save_item(NAME(m_sprite_limit)); save_item(NAME(m_pal_flag)); + save_item(NAME(m_fiq_vector)); } void spg2xx_device::device_reset() { unsp_device::device_reset(); + m_fiq_vector = 0xff; +} + +WRITE8_MEMBER(spg2xx_device::fiq_vector_w) +{ + m_fiq_vector = data; } WRITE_LINE_MEMBER(spg2xx_device::videoirq_w) { - set_state_unsynced(UNSP_IRQ0_LINE, state); + if (m_fiq_vector == 0) + { + set_state_unsynced(UNSP_FIQ_LINE, state); + } + else + { + set_state_unsynced(UNSP_IRQ0_LINE, state); + } } WRITE_LINE_MEMBER(spg2xx_device::timerirq_w) @@ -156,6 +170,7 @@ void spg2xx_device::configure_spg_io(spg2xx_io_device* io) io->write_external_irq_callback().set(FUNC(spg2xx_device::extirq_w)); io->write_ffrq_tmr1_irq_callback().set(FUNC(spg2xx_device::ffreq1_w)); io->write_ffrq_tmr2_irq_callback().set(FUNC(spg2xx_device::ffreq2_w)); + io->write_fiq_vector_callback().set(FUNC(spg2xx_device::fiq_vector_w)); } void spg24x_device::device_add_mconfig(machine_config &config) diff --git a/src/devices/machine/spg2xx.h b/src/devices/machine/spg2xx.h index ec99c6f0533..6eaf6c32b2d 100644 --- a/src/devices/machine/spg2xx.h +++ b/src/devices/machine/spg2xx.h @@ -78,6 +78,7 @@ protected: void internal_map(address_map &map); + DECLARE_WRITE8_MEMBER(fiq_vector_w); DECLARE_WRITE_LINE_MEMBER(videoirq_w); DECLARE_WRITE_LINE_MEMBER(audioirq_w); DECLARE_WRITE_LINE_MEMBER(timerirq_w); @@ -117,6 +118,8 @@ protected: emu_timer *m_screenpos_timer; + uint8_t m_fiq_vector; + required_device<screen_device> m_screen; void configure_spg_io(spg2xx_io_device* io); diff --git a/src/devices/machine/spg2xx_io.cpp b/src/devices/machine/spg2xx_io.cpp index cbcb7f53213..796eeed1e9b 100644 --- a/src/devices/machine/spg2xx_io.cpp +++ b/src/devices/machine/spg2xx_io.cpp @@ -36,37 +36,38 @@ DEFINE_DEVICE_TYPE(SPG28X_IO, spg28x_io_device, "spg28x_io", "SPG280-series Syst #define IO_IRQ_ENABLE m_io_regs[0x21] #define IO_IRQ_STATUS m_io_regs[0x22] -spg2xx_io_device::spg2xx_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock) - , m_porta_out(*this) - , m_portb_out(*this) - , m_portc_out(*this) - , m_porta_in(*this) - , m_portb_in(*this) - , m_portc_in(*this) - , m_adc_in{{*this}, {*this}} - , m_i2c_w(*this) - , m_i2c_r(*this) - , m_uart_tx(*this) - , m_chip_sel(*this) - , m_cpu(*this, finder_base::DUMMY_TAG) - , m_screen(*this, finder_base::DUMMY_TAG) - , m_pal_read_cb(*this) - , m_timer_irq_cb(*this) - , m_uart_adc_irq_cb(*this) - , m_external_irq_cb(*this) - , m_ffreq_tmr1_irq_cb(*this) - , m_ffreq_tmr2_irq_cb(*this) +spg2xx_io_device::spg2xx_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + m_porta_out(*this), + m_portb_out(*this), + m_portc_out(*this), + m_porta_in(*this), + m_portb_in(*this), + m_portc_in(*this), + m_adc_in{{*this}, {*this}}, + m_i2c_w(*this), + m_i2c_r(*this), + m_uart_tx(*this), + m_chip_sel(*this), + m_cpu(*this, finder_base::DUMMY_TAG), + m_screen(*this, finder_base::DUMMY_TAG), + m_pal_read_cb(*this), + m_timer_irq_cb(*this), + m_uart_adc_irq_cb(*this), + m_external_irq_cb(*this), + m_ffreq_tmr1_irq_cb(*this), + m_ffreq_tmr2_irq_cb(*this), + m_fiq_vector_w(*this) { } -spg24x_io_device::spg24x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : spg2xx_io_device(mconfig, SPG24X_IO, tag, owner, clock, 256) +spg24x_io_device::spg24x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + spg2xx_io_device(mconfig, SPG24X_IO, tag, owner, clock, 256) { } -spg28x_io_device::spg28x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : spg2xx_io_device(mconfig, SPG28X_IO, tag, owner, clock, 64) +spg28x_io_device::spg28x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + spg2xx_io_device(mconfig, SPG28X_IO, tag, owner, clock, 64) { } @@ -93,6 +94,8 @@ void spg2xx_io_device::device_start() m_ffreq_tmr1_irq_cb.resolve(); m_ffreq_tmr2_irq_cb.resolve(); + m_fiq_vector_w.resolve(); + m_tmb1 = timer_alloc(TIMER_TMB1); m_tmb2 = timer_alloc(TIMER_TMB2); m_tmb1->adjust(attotime::never); @@ -131,6 +134,8 @@ void spg2xx_io_device::device_start() save_item(NAME(m_uart_baud_rate)); + save_item(NAME(m_sio_bits_remaining)); + save_item(NAME(m_sio_writing)); } void spg2xx_io_device::device_reset() @@ -160,10 +165,12 @@ void spg2xx_io_device::device_reset() m_rng_timer->adjust(attotime::from_hz(1234), 0, attotime::from_hz(1234)); // timer value is arbitrary, maybe should match system clock, but that would result in heavy switching - m_2khz_divider = 0; m_1khz_divider = 0; m_4hz_divider = 0; + + m_sio_bits_remaining = 0; + m_sio_writing = false; } /************************* @@ -321,7 +328,7 @@ READ16_MEMBER(spg2xx_io_device::io_extended_r) LOGMASKED(LOG_UART, "UART Rx data is available, clearing bits\n"); if (m_uart_rx_fifo_count) { - LOGMASKED(LOG_UART, "Remaining count %d, value %02x\n", m_uart_rx_fifo_count, m_uart_rx_fifo[m_uart_rx_fifo_start]); + LOGMASKED(LOG_UART, "%s: Remaining count %d, value %02x\n", machine().describe_context(), m_uart_rx_fifo_count, m_uart_rx_fifo[m_uart_rx_fifo_start]); m_io_regs[0x36] = m_uart_rx_fifo[m_uart_rx_fifo_start]; val = m_io_regs[0x36]; m_uart_rx_fifo_start = (m_uart_rx_fifo_start + 1) % ARRAY_LENGTH(m_uart_rx_fifo); @@ -357,8 +364,25 @@ READ16_MEMBER(spg2xx_io_device::io_extended_r) LOGMASKED(LOG_UART, "%s: io_r: UART Rx FIFO Control = %04x\n", machine().describe_context(), val); break; - case 0x51: // unknown, polled by ClickStart cartridges ( clikstrt ) - return 0x8000; + case 0x50: // SIO Setup + LOGMASKED(LOG_SIO, "%s: io_r: SIO Setup = %04x\n", machine().describe_context(), val); + break; + + case 0x51: // SIO Status + LOGMASKED(LOG_SIO, "%s: io_r: SIO Status = %04x\n", machine().describe_context(), val); + break; + + case 0x54: // SIO Data + LOGMASKED(LOG_SIO, "%s: io_r: SIO Data = %04x\n", machine().describe_context(), val); + if ((m_io_regs[0x51] & 0x8000) && !m_sio_writing) + { + m_sio_bits_remaining--; + if (m_sio_bits_remaining == 0) + { + m_io_regs[0x51] &= ~0x8000; + } + } + break; case 0x58: // I2C Command ( tvgogo ) LOGMASKED(LOG_I2C, "%s: io_r: I2C Command = %04x\n", machine().describe_context(), val); @@ -607,6 +631,9 @@ WRITE16_MEMBER(spg2xx_io_device::io_w) case 0x11: // Timebase Clear LOGMASKED(LOG_TIMERS, "%s: io_w: Timebase Clear = %04x\n", machine().describe_context(), data); + m_2khz_divider = 0; + m_1khz_divider = 0; + m_4hz_divider = 0; break; case 0x12: // Timer A Data @@ -748,7 +775,7 @@ WRITE16_MEMBER(spg2xx_io_device::io_w) LOGMASKED(LOG_IRQS, "%s: io_w: IRQ Enable = %04x\n", machine().describe_context(), data); const uint16_t old = IO_IRQ_ENABLE; m_io_regs[offset] = data; - const uint16_t changed = (old & IO_IRQ_ENABLE) ^ (IO_IRQ_STATUS & IO_IRQ_ENABLE); + const uint16_t changed = (IO_IRQ_STATUS & old) ^ (IO_IRQ_STATUS & IO_IRQ_ENABLE); if (changed) check_irqs(changed); break; @@ -878,6 +905,7 @@ WRITE16_MEMBER(spg2xx_io_device::io_w) }; LOGMASKED(LOG_FIQ, "%s: io_w: FIQ Source Select (not yet implemented) = %04x, %s\n", machine().describe_context(), data, s_fiq_select[data & 7]); m_io_regs[offset] = data; + m_fiq_vector_w(data & 7); break; } @@ -1002,19 +1030,37 @@ WRITE16_MEMBER(spg2xx_io_device::io_extended_w) , BIT(data, 11), BIT(data, 10), BIT(data, 9), BIT(data, 8), BIT(data, 7) ? 16 : 8, BIT(data, 6)); LOGMASKED(LOG_SIO, " (Mode:%s, RWProtocol:%d, Rate:sysclk%s, AddrMode:%s)\n" , BIT(data, 5), BIT(data, 4), s_baud_rate[(data >> 2) & 3], s_addr_mode[data & 3]); + if (BIT(data, 10)) + { + m_io_regs[0x51] |= 0x8000; + m_sio_bits_remaining = BIT(data, 7) ? 16 : 8; + m_sio_writing = BIT(data, 5); + } + else + { + m_io_regs[0x51] &= ~0x8000; + } break; } case 0x52: // SIO Start Address (low) - LOGMASKED(LOG_SIO, "%s: io_w: SIO Stat Address (low) (not implemented) = %04x\n", machine().describe_context(), data); + LOGMASKED(LOG_SIO, "%s: io_w: SIO Start Address (low) (not implemented) = %04x\n", machine().describe_context(), data); break; case 0x53: // SIO Start Address (hi) - LOGMASKED(LOG_SIO, "%s: io_w: SIO Stat Address (hi) (not implemented) = %04x\n", machine().describe_context(), data); + LOGMASKED(LOG_SIO, "%s: io_w: SIO Start Address (hi) (not implemented) = %04x\n", machine().describe_context(), data); break; case 0x54: // SIO Data LOGMASKED(LOG_SIO, "%s: io_w: SIO Data (not implemented) = %04x\n", machine().describe_context(), data); + if ((m_io_regs[0x51] & 0x8000) && m_sio_writing) + { + m_sio_bits_remaining--; + if (m_sio_bits_remaining == 0) + { + m_io_regs[0x51] &= ~0x8000; + } + } break; case 0x55: // SIO Automatic Transmit Count diff --git a/src/devices/machine/spg2xx_io.h b/src/devices/machine/spg2xx_io.h index 37cd0d6141f..f9bd8c4e1fb 100644 --- a/src/devices/machine/spg2xx_io.h +++ b/src/devices/machine/spg2xx_io.h @@ -40,7 +40,6 @@ public: virtual DECLARE_READ16_MEMBER(io_extended_r); virtual DECLARE_WRITE16_MEMBER(io_extended_w); - auto pal_read_callback() { return m_pal_read_cb.bind(); }; auto write_timer_irq_callback() { return m_timer_irq_cb.bind(); }; @@ -49,6 +48,8 @@ public: auto write_ffrq_tmr1_irq_callback() { return m_ffreq_tmr1_irq_cb.bind(); }; auto write_ffrq_tmr2_irq_callback() { return m_ffreq_tmr2_irq_cb.bind(); }; + auto write_fiq_vector_callback() { return m_fiq_vector_w.bind(); }; + protected: spg2xx_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint32_t sprite_limit) : spg2xx_io_device(mconfig, type, tag, owner, clock) @@ -140,6 +141,9 @@ protected: emu_timer *m_rng_timer; + uint8_t m_sio_bits_remaining; + bool m_sio_writing; + required_device<unsp_device> m_cpu; required_device<screen_device> m_screen; @@ -150,6 +154,8 @@ protected: devcb_write_line m_external_irq_cb; devcb_write_line m_ffreq_tmr1_irq_cb; devcb_write_line m_ffreq_tmr2_irq_cb; + + devcb_write8 m_fiq_vector_w; }; class spg24x_io_device : public spg2xx_io_device diff --git a/src/devices/machine/spg2xx_video.cpp b/src/devices/machine/spg2xx_video.cpp index 3fde969d344..89739adcb00 100644 --- a/src/devices/machine/spg2xx_video.cpp +++ b/src/devices/machine/spg2xx_video.cpp @@ -76,7 +76,6 @@ void spg2xx_video_device::device_start() m_rowscrolloffset_read_cb.resolve_safe(0); m_video_irq_cb.resolve(); - } void spg2xx_video_device::device_reset() @@ -214,19 +213,32 @@ void spg2xx_video_device::draw_bitmap(const rectangle& cliprect, uint32_t scanli if ((scanline < 0) || (scanline >= 240)) return; - address_space& space = m_cpu->space(AS_PROGRAM); - const int linewidth = 320 / 2; - int sourcebase = 0x3f0000; // this is correct for Texas Hold'em - TODO: get from a register? + address_space &space = m_cpu->space(AS_PROGRAM); - sourcebase++; // why is this needed? - int bitmapline = scanline - 20; // should be from scrolly? + uint32_t tilemap = regs[4]; + uint32_t palette_map = regs[5]; - // at least for Texas Hold'em there is only enough memory for this size bitmap, and other reads would be outside of memory and generate excessive logging - // maybe we just need to silence logging instead tho? - if ((bitmapline < 0) || (bitmapline >= 200)) - return; + //printf("draw bitmap bases %04x %04x\n", tilemap, palette_map); + + uint32_t yscroll = regs[1]; - sourcebase += bitmapline * linewidth; + int realline = (scanline + yscroll) & 0xff; + + + uint16_t tile = space.read_word(tilemap + realline); + uint16_t palette = 0; + + //if (!tile) + // continue; + + palette = space.read_word(palette_map + realline / 2); + if (scanline & 1) + palette >>= 8; + else + palette &= 0x00ff; + + //const int linewidth = 320 / 2; + int sourcebase = tile | (palette << 16); // this is correct for Texas Hold'em - TODO: get from a register? uint32_t* dest = &m_screenbuf[320 * scanline]; @@ -308,6 +320,8 @@ void spg2xx_video_device::draw_page(const rectangle &cliprect, uint32_t scanline palette = (ctrl & PAGE_WALLPAPER_MASK) ? space.read_word(palette_map) : space.read_word(palette_map + tile_address / 2); if (x0 & 1) palette >>= 8; + else + palette &= 0x00ff; uint32_t tileattr = attr; uint32_t tilectrl = ctrl; diff --git a/src/devices/machine/sun4c_mmu.cpp b/src/devices/machine/sun4c_mmu.cpp index 4ea51352568..3d2bf1b9297 100644 --- a/src/devices/machine/sun4c_mmu.cpp +++ b/src/devices/machine/sun4c_mmu.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE(SUN4C_MMU, sun4c_mmu_device, "sun4c_mmu", "Sun 4c MMU") #define LOG_TYPE1_TIMEOUT (1U << 12) #define LOG_UNKNOWN_SPACE (1U << 13) #define LOG_WRITE_PROTECT (1U << 14) -#define LOG_PARITY (1U << 15) +#define LOG_PARITY (1U << 15) #define LOG_ALL_ASI (1U << 16) // WARNING: Heavy! #define VERBOSE (0) @@ -433,7 +433,7 @@ void sun4_mmu_base_device::system_w(const uint32_t offset, const uint32_t data, m_cachetags[(offset >> 3) & m_cache_tag_mask] = data & 0x03f8fffc; /*if (m_cpu->pc() == 0xFFE8B4F8) { - m_log_mem = true; + m_log_mem = true; }*/ return; diff --git a/src/devices/machine/sunplus_gcm394.cpp b/src/devices/machine/sunplus_gcm394.cpp index 01c8104568e..b67a20550a4 100644 --- a/src/devices/machine/sunplus_gcm394.cpp +++ b/src/devices/machine/sunplus_gcm394.cpp @@ -21,44 +21,103 @@ DEFINE_DEVICE_TYPE(GCM394, sunplus_gcm394_device, "gcm394", "SunPlus GCM394 System-on-a-Chip") -sunplus_gcm394_device::sunplus_gcm394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : sunplus_gcm394_base_device(mconfig, GCM394, tag, owner, clock) +sunplus_gcm394_device::sunplus_gcm394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + sunplus_gcm394_base_device(mconfig, GCM394, tag, owner, clock) { } DEFINE_DEVICE_TYPE(GPAC800, generalplus_gpac800_device, "gpac800", "GeneralPlus GPAC800 System-on-a-Chip") -generalplus_gpac800_device::generalplus_gpac800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : sunplus_gcm394_base_device(mconfig, GPAC800, tag, owner, clock, address_map_constructor(FUNC(generalplus_gpac800_device::gpac800_internal_map), this)) +generalplus_gpac800_device::generalplus_gpac800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + sunplus_gcm394_base_device(mconfig, GPAC800, tag, owner, clock, address_map_constructor(FUNC(generalplus_gpac800_device::gpac800_internal_map), this)) { } +DEFINE_DEVICE_TYPE(GP_SPISPI, generalplus_gpspispi_device, "gpac800spi", "GeneralPlus unSP20 SPI-based SoC") + +generalplus_gpspispi_device::generalplus_gpspispi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + sunplus_gcm394_base_device(mconfig, GP_SPISPI, tag, owner, clock, address_map_constructor(FUNC(generalplus_gpspispi_device::gpspispi_internal_map), this)) +{ +} + + +void sunplus_gcm394_base_device::default_cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4) +{ + logerror("callback not hooked\n"); +} + // **************************************** SYSTEM DMA device ************************************************* -READ16_MEMBER(sunplus_gcm394_base_device::system_dma_status_r) +uint16_t sunplus_gcm394_base_device::read_dma_params(int channel, int offset) { - LOGMASKED(LOG_GCM394_SYSDMA, "%s:sunplus_gcm394_base_device::system_dma_status_r (7abf)\n", machine().describe_context()); - return 0x0001; + uint16_t retdata = m_dma_params[offset][channel]; + LOGMASKED(LOG_GCM394_SYSDMA, "%s:sunplus_gcm394_base_device::read_dma_params (channel %01x) %01x returning %04x\n", machine().describe_context(), channel, offset, retdata); + return retdata; } -WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_params_w) +void sunplus_gcm394_base_device::write_dma_params(int channel, int offset, uint16_t data) { - m_dma_params[offset] = data; - LOGMASKED(LOG_GCM394_SYSDMA, "%s:sunplus_gcm394_base_device::sys_dma_params_w %01x %04x\n", machine().describe_context(), offset, data); + m_dma_params[offset][channel] = data; + LOGMASKED(LOG_GCM394_SYSDMA, "%s:sunplus_gcm394_base_device::write_dma_params (channel %01x) %01x %04x\n", machine().describe_context(), channel, offset, data); } -WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_trigger_w) + +READ16_MEMBER(sunplus_gcm394_base_device::system_dma_params_channel0_r) +{ + return read_dma_params(0, offset); +} + + +WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_params_channel0_w) { - uint16_t mode = m_dma_params[0]; - uint32_t source = m_dma_params[1] | (m_dma_params[4] << 16); - uint32_t dest = m_dma_params[2] | (m_dma_params[5] << 16) ; - uint32_t length = m_dma_params[3] | (m_dma_params[6] << 16); + write_dma_params(0, offset, data); +} + +READ16_MEMBER(sunplus_gcm394_base_device::system_dma_params_channel1_r) +{ + return read_dma_params(1, offset); +} - LOGMASKED(LOG_GCM394_SYSDMA, "%s:possible DMA operation (7abf) (trigger %04x) with params mode:%04x source:%08x (word offset) dest:%08x (word offset) length:%08x (words)\n", machine().describe_context(), data, mode, source, dest, length ); +WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_params_channel1_w) +{ + write_dma_params(1, offset, data); +} + +READ16_MEMBER(sunplus_gcm394_base_device::system_dma_params_channel2_r) +{ + return read_dma_params(2, offset); +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_params_channel2_w) +{ + write_dma_params(2, offset, data); +} + + + + +READ16_MEMBER(sunplus_gcm394_base_device::system_dma_status_r) +{ + LOGMASKED(LOG_GCM394_SYSDMA, "%s:sunplus_gcm394_base_device::system_dma_status_r (7abf)\n", machine().describe_context()); + + // bit 0 = channel 0 ready + // bit 1 = channel 1 ready + + return 0x0003; +} + +void sunplus_gcm394_base_device::trigger_systemm_dma(address_space &space, int channel, uint16_t data) +{ + uint16_t mode = m_dma_params[0][channel]; + uint32_t source = m_dma_params[1][channel] | (m_dma_params[4][channel] << 16); + uint32_t dest = m_dma_params[2][channel] | (m_dma_params[5][channel] << 16) ; + uint32_t length = m_dma_params[3][channel] | (m_dma_params[6][channel] << 16); - if (source >= 0x20000) + LOGMASKED(LOG_GCM394_SYSDMA, "%s:possible DMA operation (7abf) (trigger %04x) with params mode:%04x source:%08x (word offset) dest:%08x (word offset) length:%08x (words) while csbank is %02x\n", machine().describe_context().c_str(), data, mode, source, dest, length, m_membankswitch_7810 ); + + if ((source&0x0fffffff) >= 0x20000) LOGMASKED(LOG_GCM394_SYSDMA, " likely transfer from ROM %08x - %08x\n", (source - 0x20000) * 2, (source - 0x20000) * 2 + (length * 2)- 1); // wrlshunt transfers ROM to RAM, all RAM write addresses have 0x800000 in the destination set @@ -66,36 +125,51 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_trigger_w) // mode 0x0089 == no source inc, used for memory clear operations? (source usually points at stack value) // mode 0x0009 == regular copy? (smartfp does 2 copies like this after the initial clears, source definitely points at a correctly sized data structure) // what does having bit 0x4000 on mode set mean? (first transfer on wrlshunt - maybe an IRQ disable?) - - if ((mode == 0x0089) || (mode == 0x0009) || (mode == 0x4009)) + + if (mode == 0x1089) // 8-bit no increment mode, counter is in bytes? used for DMA from NAND (first writes 0x1088 then does an OR with 0x0001) { - for (int i = 0; i < length; i++) + address_space& mem = this->space(AS_PROGRAM); + source &= 0x0fffffff; + + for (int i = 0; i < length/2; i++) { - uint16_t val = 0x0000; + uint16_t val1 = read_space(source); + uint16_t val2 = read_space(source); - address_space& mem = this->space(AS_PROGRAM); + //logerror("val1 %04x val2 %04x\n", val1, val2); - if (source < 0x20000) - { - val = mem.read_word(source); - } - else - { - // maybe the -0x20000 here should be handled in external space handlers instead - val = m_space_read_cb(space, source - 0x20000); - } - - if (dest < 0x20000) - { - mem.write_word(dest, val); - } - else - { - // maybe the -0x20000 here should be handled in external space handlers instead - m_space_write_cb(space, dest - 0x20000, val); - } + uint16_t val = (val2 << 8) | val1; + + write_space(dest, val); + dest += 1; + } + + // HACKS to get into service mode for debugging + + // note, these patch the code copied to SRAM so the 'PROGRAM ROM' check fails (it passes otherwise) + if (mem.read_word(0x3f368) == 0x4840) + mem.write_word(0x3f368, 0x4841); // cars 2 IRQ? wait hack + + //if (mem.read_word(0x4368c) == 0x4846) + // mem.write_word(0x4368c, 0x4840); // cars 2 force service mode + + if (mem.read_word(0x4d8d4) == 0x4840) + mem.write_word(0x4d8d4, 0x4841); // golden tee IRQ? wait hack + + //if (mem.read_word(0x34410) == 0x4846) + // mem.write_word(0x34410, 0x4840); // golden tee force service mode + + } + else if ((mode == 0x0089) || (mode == 0x0009) || (mode == 0x4009)) + { + for (int i = 0; i < length; i++) + { + + uint16_t val = read_space(source); + write_space(dest , val); dest += 1; + if ((mode&0x3fff) == 0x0009) source += 1; } @@ -105,11 +179,65 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_trigger_w) LOGMASKED(LOG_GCM394_SYSDMA, "unhandled!\n"); } - m_dma_params[0] = m_dma_params[1] = m_dma_params[2] = m_dma_params[3] = m_dma_params[4] = m_dma_params[5] = m_dma_params[6] = 0x0000; + m_dma_params[0][channel] = m_dma_params[1][channel] = m_dma_params[2][channel] = m_dma_params[3][channel] = m_dma_params[4][channel] = m_dma_params[5][channel] = m_dma_params[6][channel] = 0x0000; //machine().debug_break(); } +WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_trigger_w) +{ + // trigger is value based, not bit based, how many channels are there? + + if (data == 1) trigger_systemm_dma(space, 0, data); + else if (data == 2) trigger_systemm_dma(space, 1, data); + else if (data == 3) trigger_systemm_dma(space, 2, data); + else + { + fatalerror("unknown DMA trigger type\n"); + } +} + +READ16_MEMBER(sunplus_gcm394_base_device::system_dma_memtype_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::system_dma_memtype_r\n", machine().describe_context()); + return m_system_dma_memtype; +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::system_dma_memtype_w) +{ + static char const* const types[16] = + { + "Unused / USB", + "DAC CHA", + "UART TX", + "UART RX", + "SD/MMC", + "NAND Flash", + "Serial Interface", + "DAC CHB", + "ADC Audo Sample Full", + "SPI TX", + "SPI RX", + "RESERVED (c)", + "RESERVED (d)", + "RESERVED (e)", + "RESERVED (f)" + }; + + m_system_dma_memtype = data; + + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::system_dma_memtype_w %04x (CH3: %s | CH2: %s | CH1: %s | CH0: %s )\n", machine().describe_context(), data, + types[((m_system_dma_memtype>>12)&0xf)], + types[((m_system_dma_memtype>>8)&0xf)], + types[((m_system_dma_memtype>>4)&0xf)], + types[((m_system_dma_memtype)&0xf)]); + +} +READ16_MEMBER(sunplus_gcm394_base_device::system_7a3a_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::system_7a3a_r\n", machine().describe_context()); + return machine().rand(); +} // **************************************** 78xx region with some handling ************************************************* @@ -132,8 +260,6 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7819_w) { LOGMASKED(LOG_GCM39 // **************************************** 78xx region stubs ************************************************* -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7868_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7868_r\n", machine().describe_context()); return 0x0000; } - READ16_MEMBER(sunplus_gcm394_base_device::unkarea_782d_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_782d_r\n", machine().describe_context()); return m_782d; } WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_782d_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_782d_w %04x\n", machine().describe_context(), data); m_782d = data; } @@ -142,45 +268,73 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7803_w) { LOGMASKED(LOG_GCM39 WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7807_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7807_w %04x\n", machine().describe_context(), data); m_7807 = data; } +WRITE16_MEMBER(sunplus_gcm394_base_device::waitmode_enter_780c_w) +{ + // LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::waitmode_enter_780c_w %04x\n", machine().describe_context(), data); + // must be followed by 6 nops to ensure wait mode is entered +} + +// this gets stored / modified / restored before certain memory accesses ( +// used extensively during SDRAM checks in jak_gtg and jak_car2 -// this gets stored / modified / restored before certain memory accesses (in practical terms it just seems to flip from 0/1) maybe it changes the memory mapping (as 7820 seems to) -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7810_r) +READ16_MEMBER(sunplus_gcm394_base_device::membankswitch_7810_r) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7810_r\n", machine().describe_context()); - return m_7810; +// LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::membankswitch_7810_r\n", machine().describe_context()); + return m_membankswitch_7810; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7810_w) +WRITE16_MEMBER(sunplus_gcm394_base_device::membankswitch_7810_w) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7810_w %04x\n", machine().describe_context(), data); - m_7810 = data; +// if (m_membankswitch_7810 != data) +// LOGMASKED(LOG_GCM394,"%s:sunplus_gcm394_base_device::membankswitch_7810_w %04x\n", machine().describe_context(), data); + +// if (m_membankswitch_7810 != data) +// popmessage("bankswitch %04x -> %04x", m_membankswitch_7810, data); + + m_membankswitch_7810 = data; } WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7816_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7816_w %04x\n", machine().describe_context(), data); m_7816 = data; } WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7817_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7817_w %04x\n", machine().describe_context(), data); m_7817 = data; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7820_w) +WRITE16_MEMBER(sunplus_gcm394_base_device::chipselect_csx_memory_device_control_w) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7820_w (Rom Mapping control?) %04x\n", machine().describe_context(), data); - m_7820 = data; - m_mapping_write_cb(data); + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::chipselect_csx_memory_device_control_w %04x (782x registers offset %d)\n", machine().describe_context(), data, offset); + m_782x[offset] = data; + + + static const char* const md[] = + { + "(00) ROM / SRAM", + "(01) ROM / SRAM", + "(10) NOR FLASH", + "(11) NAND FLASH", + }; + + uint8_t cs_wait = data & 0x000f; + uint8_t cs_warat = (data & 0x0030)>>4; + uint8_t cs_md = (data & 0x00c0)>>6; + int cs_size = (data & 0xff00)>>8; + + logerror("CS%d set to size: %02x (%08x words) md: %01x %s warat: %01x wait: %01x\n", offset, cs_size, (cs_size+1)*0x10000, cs_md, md[cs_md], cs_warat, cs_wait); + + + m_cs_callback(m_782x[0], m_782x[1], m_782x[2], m_782x[3], m_782x[4]); + } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7821_w) +void sunplus_gcm394_base_device::device_post_load() { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7821_w %04x\n", machine().describe_context(), data); m_7821 = data; + m_cs_callback(m_782x[0], m_782x[1], m_782x[2], m_782x[3], m_782x[4]); } -// these seem to be related to the above but don't change after startup. maybe it's how different devices see memory? -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7822_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7822_w %04x\n", machine().describe_context(), data); m_7822 = data; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7823_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7823_w %04x\n", machine().describe_context(), data); m_7823 = data; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7824_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7824_w %04x\n", machine().describe_context(), data); m_7824 = data; } - WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7835_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7835_w %04x\n", machine().describe_context(), data); m_7835 = data; } // IO here? +// Port A + READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7860_porta_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7860_porta_r\n", machine().describe_context()); @@ -193,59 +347,123 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7860_porta_w) m_porta_out(data); } -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7861_r) +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7861_porta_buffer_r) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7861_r\n", machine().describe_context()); + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7861_porta_buffer_r\n", machine().describe_context()); return 0x0000;// 0xffff;// m_7861; } -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7862_r) +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7862_porta_direction_r) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7862_r\n", machine().describe_context()); - return 0x0000;// m_7862; + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7862_porta_direction_r\n", machine().describe_context()); + return m_7862_porta_direction; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7862_w) +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7862_porta_direction_w) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7862_w %04x\n", machine().describe_context(), data); - m_7862 = data; + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7862_porta_direction_w %04x\n", machine().describe_context(), data); + m_7862_porta_direction = data; } -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7863_r) +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7863_porta_attribute_r) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7863_r\n", machine().describe_context()); - return 0x0000; //0xffff;// m_7863; + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7863_porta_attribute_r\n", machine().describe_context()); + return m_7863_porta_attribute; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7863_w) +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7863_porta_attribute_w) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7863_w %04x\n", machine().describe_context(), data); - m_7863 = data; + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7863_porta_attribute_w %04x\n", machine().describe_context(), data); + m_7863_porta_attribute = data; } -// similar read/write pattern to above, 2nd group? +// Port B -READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7870_portb_r) +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7868_portb_r) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7870_portb_r\n", machine().describe_context()); + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7868_portb_r\n", machine().describe_context()); return m_portb_in(); } -WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7870_portb_w) +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7869_portb_buffer_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7869_portb_buffer_r\n", machine().describe_context()); + return machine().rand(); +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7868_portb_w) { - LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7870_portb_w %04x\n", machine().describe_context(), data); + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7868_portb_w %04x\n", machine().describe_context(), data); + //m_portb_out(data); +} + +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_786a_portb_direction_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_786a_portb_direction_r\n", machine().describe_context()); + return m_786a_portb_direction; +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_786a_portb_direction_w) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_786a_portb_direction_w %04x\n", machine().describe_context(), data); + m_786a_portb_direction = data; +} + +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_786b_portb_attribute_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_786b_portb_attribute_r\n", machine().describe_context()); + return m_786b_portb_attribute; +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_786b_portb_attribute_w) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_786b_portb_attribute_w %04x\n", machine().describe_context(), data); + m_786b_portb_attribute = data; +} + +// Port C + +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7870_portc_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7870_portc_r\n", machine().describe_context()); + return m_portc_in(); +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7870_portc_w) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7870_portc_w %04x\n", machine().describe_context(), data); m_7870 = data; } -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7871_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7871_r\n", machine().describe_context()); return 0xffff;// m_7871; +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7871_portc_buffer_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7871_portc_buffer_r\n", machine().describe_context()); + return 0xffff;// m_7871; } -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7872_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7872_r\n", machine().describe_context()); return 0xffff;// m_7872; +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7872_portc_direction_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7872_portc_direction_r\n", machine().describe_context()); + return m_7872_portc_direction; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7872_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7872_w %04x\n", machine().describe_context(), data); m_7872 = data; } -READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7873_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7873_r\n", machine().describe_context()); return 0xffff;// m_7873; + +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7872_portc_direction_w) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7872_portc_direction_w %04x\n", machine().describe_context(), data); + m_7872_portc_direction = data; +} + +READ16_MEMBER(sunplus_gcm394_base_device::ioarea_7873_portc_attribute_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7873_portc_attribute_r\n", machine().describe_context()); + return m_7873_portc_attribute; +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::ioarea_7873_portc_attribute_w) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::ioarea_7873_portc_attribute_w %04x\n", machine().describe_context(), data); + m_7873_portc_attribute = data; } -WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7873_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7873_w %04x\n", machine().describe_context(), data); m_7873 = data; } @@ -258,6 +476,12 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7883_w) { LOGMASKED(LOG_GCM39 WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_78a0_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78a0_w %04x\n", machine().describe_context(), data); m_78a0 = data; } +READ16_MEMBER(sunplus_gcm394_base_device::unkarea_78a0_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78a0_r\n", machine().describe_context()); + return 0x0000;// machine().rand(); +} + READ16_MEMBER(sunplus_gcm394_base_device::unkarea_78a1_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78a1_r\n", machine().describe_context()); @@ -285,6 +509,13 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_78b2_w) { LOGMASKED(LOG_GCM39 WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_78b8_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78b8_w %04x\n", machine().describe_context(), data); m_78b8 = data; } WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_78f0_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78f0_w %04x\n", machine().describe_context(), data); m_78f0 = data; } +READ16_MEMBER(sunplus_gcm394_base_device::unkarea_78d0_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78d0_r\n", machine().describe_context()); + return machine().rand(); +} + + // **************************************** 79xx region stubs ************************************************* READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7934_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7934_r\n", machine().describe_context()); return 0x0000; } @@ -299,6 +530,20 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7935_w) //checkirq6(); } +// these are related to the accelerometer values on jak_g500 (8-bit signed) and also the SPI reads for bkrankp +READ16_MEMBER(sunplus_gcm394_base_device::spi_7944_rxdata_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::spi_7944_rxdata_r\n", machine().describe_context()); + return machine().rand(); +} + +READ16_MEMBER(sunplus_gcm394_base_device::spi_7945_misc_control_reg_r) +{ + LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::spi_7945_misc_control_reg_r\n", machine().describe_context()); + return machine().rand();// &0x0007; +} + + READ16_MEMBER(sunplus_gcm394_base_device::unkarea_7936_r) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7936_r\n", machine().describe_context()); return 0x0000; } WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7936_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_7936_w %04x\n", machine().describe_context(), data); m_7936 = data; } @@ -333,7 +578,7 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unk_w) } } -void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) +void sunplus_gcm394_base_device::base_internal_map(address_map &map) { map(0x000000, 0x006fff).ram(); map(0x007000, 0x007fff).rw(FUNC(sunplus_gcm394_base_device::unk_r), FUNC(sunplus_gcm394_base_device::unk_w)); // catch unhandled @@ -344,37 +589,40 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) // note, tilemaps are at the same address offsets in video device as spg2xx (but unknown devices are extra) - map(0x007000, 0x007007).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid1_regs_w)); // written with other unknown_video_device1 LSB/MSB regs below (roz layer or line layer?) - map(0x007008, 0x00700f).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid2_regs_w)); // written with other unknown_video_device2 LSB/MSB regs below (roz layer or line layer?) + map(0x007000, 0x007007).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap2_regs_r), FUNC(gcm394_base_video_device::tmap2_regs_w)); // written with other unknown_video_device1 LSB/MSB regs below (roz layer or line layer?) + map(0x007008, 0x00700f).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap3_regs_r), FUNC(gcm394_base_video_device::tmap3_regs_w)); // written with other unknown_video_device2 LSB/MSB regs below (roz layer or line layer?) map(0x007010, 0x007015).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap0_regs_r), FUNC(gcm394_base_video_device::tmap0_regs_w)); map(0x007016, 0x00701b).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap1_regs_r), FUNC(gcm394_base_video_device::tmap1_regs_w)); + map(0x00701c, 0x00701c).w(m_spg_video, FUNC(gcm394_base_video_device::video_701c_w)); + // tilebase LSBs - map(0x007020, 0x007020).w(m_spg_video, FUNC(gcm394_base_video_device::tmap0_tilebase_lsb_w)); // tilebase, written with other tmap0 regs - map(0x007021, 0x007021).w(m_spg_video, FUNC(gcm394_base_video_device::tmap1_tilebase_lsb_w)); // tilebase, written with other tmap1 regs - map(0x007022, 0x007022).w(m_spg_video, FUNC(gcm394_base_video_device::sprite_7022_gfxbase_lsb_w)); // sprite tilebase written as 7022, 702d and 7042 group - map(0x007023, 0x007023).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid1_gfxbase_lsb_w)); // written with other unknown_video_device1 regs (roz layer or line layer?) - map(0x007024, 0x007024).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid2_gfxbase_lsb_w)); // written with other unknown_video_device2 regs (roz layer or line layer?) + map(0x007020, 0x007020).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap0_tilebase_lsb_r), FUNC(gcm394_base_video_device::tmap0_tilebase_lsb_w)); // tilebase, written with other tmap0 regs + map(0x007021, 0x007021).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap1_tilebase_lsb_r), FUNC(gcm394_base_video_device::tmap1_tilebase_lsb_w)); // tilebase, written with other tmap1 regs + map(0x007022, 0x007022).rw(m_spg_video, FUNC(gcm394_base_video_device::sprite_7022_gfxbase_lsb_r), FUNC(gcm394_base_video_device::sprite_7022_gfxbase_lsb_w)); // sprite tilebase written as 7022, 702d and 7042 group + map(0x007023, 0x007023).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap2_tilebase_lsb_r), FUNC(gcm394_base_video_device::tmap2_tilebase_lsb_w)); // written with other tmap2 regs (roz layer or line layer?) + map(0x007024, 0x007024).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap3_tilebase_lsb_r), FUNC(gcm394_base_video_device::tmap3_tilebase_lsb_w)); // written with other tmap3 regs (roz layer or line layer?) map(0x00702a, 0x00702a).w(m_spg_video, FUNC(gcm394_base_video_device::video_702a_w)); // blend level control // tilebase MSBs - map(0x00702b, 0x00702b).w(m_spg_video, FUNC(gcm394_base_video_device::tmap0_tilebase_msb_w)); // written with other tmap0 regs - map(0x00702c, 0x00702c).w(m_spg_video, FUNC(gcm394_base_video_device::tmap1_tilebase_msb_w)); // written with other tmap1 regs - map(0x00702d, 0x00702d).w(m_spg_video, FUNC(gcm394_base_video_device::sprite_702d_gfxbase_msb_w)); // sprites, written as 7022, 702d and 7042 group - map(0x00702e, 0x00702e).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid1_gfxbase_msb_w)); // written with other unknown_video_device1 regs (roz layer or line layer?) - map(0x00702f, 0x00702f).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid2_gfxbase_msb_w)); // written with other unknown_video_device2 regs (roz layer or line layer?) + map(0x00702b, 0x00702b).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap0_tilebase_msb_r), FUNC(gcm394_base_video_device::tmap0_tilebase_msb_w)); // written with other tmap0 regs + map(0x00702c, 0x00702c).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap1_tilebase_msb_r), FUNC(gcm394_base_video_device::tmap1_tilebase_msb_w)); // written with other tmap1 regs + map(0x00702d, 0x00702d).rw(m_spg_video, FUNC(gcm394_base_video_device::sprite_702d_gfxbase_msb_r), FUNC(gcm394_base_video_device::sprite_702d_gfxbase_msb_w)); // sprites, written as 7022, 702d and 7042 group + map(0x00702e, 0x00702e).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap2_tilebase_msb_r), FUNC(gcm394_base_video_device::tmap2_tilebase_msb_w)); // written with other tmap2 regs (roz layer or line layer?) + map(0x00702f, 0x00702f).rw(m_spg_video, FUNC(gcm394_base_video_device::tmap3_tilebase_msb_r), FUNC(gcm394_base_video_device::tmap3_tilebase_msb_w)); // written with other tmap3 regs (roz layer or line layer?) map(0x007030, 0x007030).rw(m_spg_video, FUNC(gcm394_base_video_device::video_7030_brightness_r), FUNC(gcm394_base_video_device::video_7030_brightness_w)); + map(0x007038, 0x007038).r(m_spg_video, FUNC(gcm394_base_video_device::video_curline_r)); map(0x00703a, 0x00703a).rw(m_spg_video, FUNC(gcm394_base_video_device::video_703a_palettebank_r), FUNC(gcm394_base_video_device::video_703a_palettebank_w)); - map(0x00703c, 0x00703c).w(m_spg_video, FUNC(gcm394_base_video_device::video_703c_w)); // TV Control 1 + map(0x00703c, 0x00703c).rw(m_spg_video, FUNC(gcm394_base_video_device::video_703c_tvcontrol1_r), FUNC(gcm394_base_video_device::video_703c_tvcontrol1_w)); // TV Control 1 map(0x007042, 0x007042).rw(m_spg_video, FUNC(gcm394_base_video_device::sprite_7042_extra_r), FUNC(gcm394_base_video_device::sprite_7042_extra_w)); // maybe sprites, written as 7022, 702d and 7042 group map(0x007051, 0x007051).r(m_spg_video, FUNC(gcm394_base_video_device::video_7051_r)); // wrlshunt checks this (doesn't exist on older SPG?) - map(0x007062, 0x007062).rw(m_spg_video, FUNC(gcm394_base_video_device::video_7062_r), FUNC(gcm394_base_video_device::video_7062_w)); + map(0x007062, 0x007062).rw(m_spg_video, FUNC(gcm394_base_video_device::videoirq_source_enable_r), FUNC(gcm394_base_video_device::videoirq_source_enable_w)); map(0x007063, 0x007063).rw(m_spg_video, FUNC(gcm394_base_video_device::video_7063_videoirq_source_r), FUNC(gcm394_base_video_device::video_7063_videoirq_source_ack_w)); // note, 70 / 71 / 72 are the same offsets used for DMA as in spg2xx video device @@ -383,7 +631,7 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) map(0x007072, 0x007072).rw(m_spg_video, FUNC(gcm394_base_video_device::video_dma_size_busy_r), FUNC(gcm394_base_video_device::video_dma_size_trigger_w)); // // these don't exist on older SPG - map(0x00707c, 0x00707c).r(m_spg_video, FUNC(gcm394_base_video_device::video_707c_r)); // wrlshunt polls this waiting for 0x8000, is this some kind of manual port based data upload? + map(0x00707c, 0x00707c).r(m_spg_video, FUNC(gcm394_base_video_device::video_707c_r)); // wrlshunt polls this waiting for 0x8000, is this some kind of manual port-based data upload? map(0x00707e, 0x00707e).w(m_spg_video, FUNC(gcm394_base_video_device::video_dma_unk_w)); // written around same time as DMA, seems to select alt sprite bank map(0x00707f, 0x00707f).rw(m_spg_video, FUNC(gcm394_base_video_device::video_707f_r), FUNC(gcm394_base_video_device::video_707f_w)); @@ -403,60 +651,99 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) // 73xx-77xx = video ram // ###################################################################################################################################################################################### - map(0x007100, 0x0071ef).ram().share("unkram1"); // maybe a line table? (assuming DMA isn't writing to wrong place) - map(0x007200, 0x0072ef).ram().share("unkram2"); // ^^ + map(0x007100, 0x0071ff).ram().share("rowscroll"); // based on jak_s500 + map(0x007200, 0x0072ff).ram().share("rowzoom"); // ^^ map(0x007300, 0x0073ff).rw(m_spg_video, FUNC(gcm394_base_video_device::palette_r), FUNC(gcm394_base_video_device::palette_w)); map(0x007400, 0x0077ff).rw(m_spg_video, FUNC(gcm394_base_video_device::spriteram_r), FUNC(gcm394_base_video_device::spriteram_w)); // ###################################################################################################################################################################################### - // 78xx region = io + other? + // 78xx region = system regs? // ###################################################################################################################################################################################### map(0x007803, 0x007803).rw(FUNC(sunplus_gcm394_base_device::unkarea_7803_r), FUNC(sunplus_gcm394_base_device::unkarea_7803_w)); map(0x007807, 0x007807).w(FUNC(sunplus_gcm394_base_device::unkarea_7807_w)); + // 7808 + + // 780a + + map(0x00780c, 0x00780c).w(FUNC(sunplus_gcm394_base_device::waitmode_enter_780c_w)); map(0x00780f, 0x00780f).r(FUNC(sunplus_gcm394_base_device::unkarea_780f_status_r)); - map(0x007810, 0x007810).rw(FUNC(sunplus_gcm394_base_device::unkarea_7810_r), FUNC(sunplus_gcm394_base_device::unkarea_7810_w)); + map(0x007810, 0x007810).rw(FUNC(sunplus_gcm394_base_device::membankswitch_7810_r), FUNC(sunplus_gcm394_base_device::membankswitch_7810_w)); // 7810 Bank Switch Control Register (P_BankSwitch_Ctrl) (maybe) map(0x007819, 0x007819).rw(FUNC(sunplus_gcm394_base_device::unkarea_7819_r), FUNC(sunplus_gcm394_base_device::unkarea_7819_w)); map(0x007816, 0x007816).w(FUNC(sunplus_gcm394_base_device::unkarea_7816_w)); map(0x007817, 0x007817).w(FUNC(sunplus_gcm394_base_device::unkarea_7817_w)); - // wrlshunt | smartfp - map(0x007820, 0x007820).w(FUNC(sunplus_gcm394_base_device::unkarea_7820_w)); // 7f8a (7f8a before DMA from ROM to RAM, 008a after DMA from ROM to RAM) | 3f04 - map(0x007821, 0x007821).w(FUNC(sunplus_gcm394_base_device::unkarea_7821_w)); // 7f47 | 0044 - map(0x007822, 0x007822).w(FUNC(sunplus_gcm394_base_device::unkarea_7822_w)); // 0047 | 1f44 - map(0x007823, 0x007823).w(FUNC(sunplus_gcm394_base_device::unkarea_7823_w)); // 0047 | 0044 - map(0x007824, 0x007824).w(FUNC(sunplus_gcm394_base_device::unkarea_7824_w)); // 0047 | 0044 + // ###################################################################################################################################################################################### + // 782x region = memory config / control + // ###################################################################################################################################################################################### + // wrlshunt | smartfp + map(0x007820, 0x007824).w(FUNC(sunplus_gcm394_base_device::chipselect_csx_memory_device_control_w)); // 7f8a (7f8a before DMA from ROM to RAM, 008a after DMA from ROM to RAM) | 3f04 7820 Chip Select (CS0) Memory Device Control (P_MC50_Ctrl) + // 7f47 | 0044 7821 Chip Select (CS1) Memory Device Control (P_MC51_Ctrl) + // 0047 | 1f44 7822 Chip Select (CS2) Memory Device Control (P_MC52_Ctrl) + // 0047 | 0044 7823 Chip Select (CS3) Memory Device Control (P_MC53_Ctrl) + // 0047 | 0044 7824 Chip Select (CS4) Memory Device Control (P_MC54_Ctrl) map(0x00782d, 0x00782d).rw(FUNC(sunplus_gcm394_base_device::unkarea_782d_r), FUNC(sunplus_gcm394_base_device::unkarea_782d_w)); // on startup + // 782f map(0x007835, 0x007835).w(FUNC(sunplus_gcm394_base_device::unkarea_7835_w)); - map(0x007860, 0x007860).rw(FUNC(sunplus_gcm394_base_device::ioarea_7860_porta_r), FUNC(sunplus_gcm394_base_device::ioarea_7860_porta_w)); + // 783a + // 783b + // 783c + // 783d + // 783e + + // 7841 + + // ###################################################################################################################################################################################### + // 786x - 787x - IO related? + // ###################################################################################################################################################################################### + + map(0x007860, 0x007860).rw(FUNC(sunplus_gcm394_base_device::ioarea_7860_porta_r), FUNC(sunplus_gcm394_base_device::ioarea_7860_porta_w)); // 7860 I/O PortA Data Register + map(0x007861, 0x007861).r(FUNC(sunplus_gcm394_base_device::ioarea_7861_porta_buffer_r)); // 7861 I/O PortA Buffer Register + map(0x007862, 0x007862).rw(FUNC(sunplus_gcm394_base_device::ioarea_7862_porta_direction_r), FUNC(sunplus_gcm394_base_device::ioarea_7862_porta_direction_w)); // 7862 I/O PortA Direction Register + map(0x007863, 0x007863).rw(FUNC(sunplus_gcm394_base_device::ioarea_7863_porta_attribute_r), FUNC(sunplus_gcm394_base_device::ioarea_7863_porta_attribute_w)); // 7863 I/O PortA Attribute Register - map(0x007861, 0x007861).r(FUNC(sunplus_gcm394_base_device::unkarea_7861_r)); - map(0x007862, 0x007862).rw(FUNC(sunplus_gcm394_base_device::unkarea_7862_r), FUNC(sunplus_gcm394_base_device::unkarea_7862_w)); - map(0x007863, 0x007863).rw(FUNC(sunplus_gcm394_base_device::unkarea_7863_r), FUNC(sunplus_gcm394_base_device::unkarea_7863_w)); + map(0x007868, 0x007868).rw(FUNC(sunplus_gcm394_base_device::ioarea_7868_portb_r), FUNC(sunplus_gcm394_base_device::ioarea_7868_portb_w)); // on startup // 7868 I/O PortB Data Register + map(0x007869, 0x007869).r(FUNC(sunplus_gcm394_base_device::ioarea_7869_portb_buffer_r)); // 7869 I/O PortB Buffer Register // jak_s500 + map(0x00786a, 0x00786a).rw(FUNC(sunplus_gcm394_base_device::ioarea_786a_portb_direction_r), FUNC(sunplus_gcm394_base_device::ioarea_786a_portb_direction_w)); // 786a I/O PortB Direction Register + map(0x00786b, 0x00786b).rw(FUNC(sunplus_gcm394_base_device::ioarea_786b_portb_attribute_r), FUNC(sunplus_gcm394_base_device::ioarea_786b_portb_attribute_w)); // 786b I/O PortB Attribute Register + // 786c I/O PortB Latch / Wakeup - map(0x007868, 0x007868).r(FUNC(sunplus_gcm394_base_device::unkarea_7868_r)); // on startup + map(0x007870, 0x007870).rw(FUNC(sunplus_gcm394_base_device::ioarea_7870_portc_r) ,FUNC(sunplus_gcm394_base_device::ioarea_7870_portc_w)); // 7870 I/O PortC Data Register + map(0x007871, 0x007871).r(FUNC(sunplus_gcm394_base_device::ioarea_7871_portc_buffer_r)); // 7871 I/O PortC Buffer Register + map(0x007872, 0x007872).rw(FUNC(sunplus_gcm394_base_device::ioarea_7872_portc_direction_r), FUNC(sunplus_gcm394_base_device::ioarea_7872_portc_direction_w)); // 7872 I/O PortC Direction Register + map(0x007873, 0x007873).rw(FUNC(sunplus_gcm394_base_device::ioarea_7873_portc_attribute_r), FUNC(sunplus_gcm394_base_device::ioarea_7873_portc_attribute_w)); // 7873 I/O PortC Attribute Register - map(0x007870, 0x007870).rw(FUNC(sunplus_gcm394_base_device::ioarea_7870_portb_r) ,FUNC(sunplus_gcm394_base_device::ioarea_7870_portb_w)); + // 7874 (data 0x1249) (bkrankp data 0x36db) + // 787c (data 0x1249) (bkrankp data 0x36db) + // 787e (data 0x1249) (bkrankp data 0x36db) - map(0x007871, 0x007871).r(FUNC(sunplus_gcm394_base_device::unkarea_7871_r)); - map(0x007872, 0x007872).rw(FUNC(sunplus_gcm394_base_device::unkarea_7872_r), FUNC(sunplus_gcm394_base_device::unkarea_7872_w)); - map(0x007873, 0x007873).rw(FUNC(sunplus_gcm394_base_device::unkarea_7873_r), FUNC(sunplus_gcm394_base_device::unkarea_7873_w)); + // 7878 I/O PortD Data Register + // 7879 I/O PortD Buffer Register + // 787a I/O PortD Direction Register + // 787b I/O PortD Attribute Register + + // 7880 map(0x007882, 0x007882).rw(FUNC(sunplus_gcm394_base_device::unkarea_7882_r), FUNC(sunplus_gcm394_base_device::unkarea_7882_w)); map(0x007883, 0x007883).rw(FUNC(sunplus_gcm394_base_device::unkarea_7883_r), FUNC(sunplus_gcm394_base_device::unkarea_7883_w)); - map(0x0078a0, 0x0078a0).w(FUNC(sunplus_gcm394_base_device::unkarea_78a0_w)); + // 0x7888 (data 0x1249) (bkrankp data 0x36db), written with 7874 / 787c / 787e above + + // ###################################################################################################################################################################################### + // 78ax - interrupt controller? + // ###################################################################################################################################################################################### + map(0x0078a0, 0x0078a0).rw(FUNC(sunplus_gcm394_base_device::unkarea_78a0_r), FUNC(sunplus_gcm394_base_device::unkarea_78a0_w)); map(0x0078a1, 0x0078a1).r(FUNC(sunplus_gcm394_base_device::unkarea_78a1_r)); map(0x0078a4, 0x0078a4).w(FUNC(sunplus_gcm394_base_device::unkarea_78a4_w)); @@ -465,26 +752,44 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) map(0x0078a8, 0x0078a8).w(FUNC(sunplus_gcm394_base_device::unkarea_78a8_w)); - map(0x0078b0, 0x0078b0).w(FUNC(sunplus_gcm394_base_device::unkarea_78b0_w)); - map(0x0078b1, 0x0078b1).w(FUNC(sunplus_gcm394_base_device::unkarea_78b1_w)); + // ###################################################################################################################################################################################### + // 78bx - timer control? + // ###################################################################################################################################################################################### + + map(0x0078b0, 0x0078b0).w(FUNC(sunplus_gcm394_base_device::unkarea_78b0_w)); // 78b0 TimeBase A Control Register (P_TimeBaseA_Ctrl) + map(0x0078b1, 0x0078b1).w(FUNC(sunplus_gcm394_base_device::unkarea_78b1_w)); // 78b1 TimeBase B Control Register (P_TimeBaseB_Ctrl) + map(0x0078b2, 0x0078b2).rw(FUNC(sunplus_gcm394_base_device::unkarea_78b2_r), FUNC(sunplus_gcm394_base_device::unkarea_78b2_w)); // 78b2 TimeBase C Control Register (P_TimeBaseC_Ctrl) - map(0x0078b2, 0x0078b2).r(FUNC(sunplus_gcm394_base_device::unkarea_78b2_r)); - map(0x0078b2, 0x0078b2).w(FUNC(sunplus_gcm394_base_device::unkarea_78b2_w)); + map(0x0078b8, 0x0078b8).w(FUNC(sunplus_gcm394_base_device::unkarea_78b8_w)); // 78b8 TimeBase Counter Reset Register (P_TimeBase_Reset) - map(0x0078b8, 0x0078b8).w(FUNC(sunplus_gcm394_base_device::unkarea_78b8_w)); + map(0x0078d0, 0x0078d0).r(FUNC(sunplus_gcm394_base_device::unkarea_78d0_r)); // jak_s500 + + + // ###################################################################################################################################################################################### + // 78fx - unknown + // ###################################################################################################################################################################################### map(0x0078f0, 0x0078f0).w(FUNC(sunplus_gcm394_base_device::unkarea_78f0_w)); map(0x0078fb, 0x0078fb).r(FUNC(sunplus_gcm394_base_device::unkarea_78fb_status_r)); // ###################################################################################################################################################################################### - // 79xx region = timers? + // 79xx - misc? // ###################################################################################################################################################################################### + // possible rtc? map(0x007934, 0x007934).rw(FUNC(sunplus_gcm394_base_device::unkarea_7934_r), FUNC(sunplus_gcm394_base_device::unkarea_7934_w)); map(0x007935, 0x007935).rw(FUNC(sunplus_gcm394_base_device::unkarea_7935_r), FUNC(sunplus_gcm394_base_device::unkarea_7935_w)); map(0x007936, 0x007936).rw(FUNC(sunplus_gcm394_base_device::unkarea_7936_r), FUNC(sunplus_gcm394_base_device::unkarea_7936_w)); + //7940 P_SPI_Ctrl - SPI Control Register + //7941 P_SPI_TXStatus - SPI Transmit Status Register + //7942 P_SPI_TXData - SPI Transmit FIFO Register + //7943 P_SPI_RXStatus - SPI Receive Status Register + map(0x007944, 0x007944).r(FUNC(sunplus_gcm394_base_device::spi_7944_rxdata_r)); // 7944 P_SPI_RXData - SPI Receive FIFO Register (jak_s500 accelerometer) (also the SPI ROM DMA input port for bkrankp?) + map(0x007945, 0x007945).r(FUNC(sunplus_gcm394_base_device::spi_7945_misc_control_reg_r)); // 7945 P_SPI_Misc - SPI Misc Control Register (jak_s500 accelerometer) + + // possible adc? map(0x007960, 0x007960).w(FUNC(sunplus_gcm394_base_device::unkarea_7960_w)); map(0x007961, 0x007961).rw(FUNC(sunplus_gcm394_base_device::unkarea_7961_r), FUNC(sunplus_gcm394_base_device::unkarea_7961_w)); @@ -492,7 +797,14 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) // 7axx region = system (including dma) // ###################################################################################################################################################################################### - map(0x007a80, 0x007a86).w(FUNC(sunplus_gcm394_base_device::system_dma_params_w)); + map(0x007a3a, 0x007a3a).r(FUNC(sunplus_gcm394_base_device::system_7a3a_r)); // ? + + map(0x007a80, 0x007a86).rw(FUNC(sunplus_gcm394_base_device::system_dma_params_channel0_r), FUNC(sunplus_gcm394_base_device::system_dma_params_channel0_w)); + map(0x007a88, 0x007a8e).rw(FUNC(sunplus_gcm394_base_device::system_dma_params_channel1_r), FUNC(sunplus_gcm394_base_device::system_dma_params_channel1_w)); // jak_tsm writes here + map(0x007a90, 0x007a96).rw(FUNC(sunplus_gcm394_base_device::system_dma_params_channel2_r), FUNC(sunplus_gcm394_base_device::system_dma_params_channel2_w)); // bkrankp writes here (is this on all types or just SPI?) + //map(0x007a98, 0x007a9e).rw(FUNC(sunplus_gcm394_base_device::system_dma_params_channel3_r), FUNC(sunplus_gcm394_base_device::system_dma_params_channel3_w)); // not seen, but probably + + map(0x007abe, 0x007abe).rw(FUNC(sunplus_gcm394_base_device::system_dma_memtype_r), FUNC(sunplus_gcm394_base_device::system_dma_memtype_w)); // 7abe - written with DMA stuff (source type for each channel so that device handles timings properly?) map(0x007abf, 0x007abf).rw(FUNC(sunplus_gcm394_base_device::system_dma_status_r), FUNC(sunplus_gcm394_base_device::system_dma_trigger_w)); // ###################################################################################################################################################################################### @@ -502,68 +814,454 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map) map(0x007b80, 0x007bbf).rw(m_spg_audio, FUNC(sunplus_gcm394_audio_device::control_r), FUNC(sunplus_gcm394_audio_device::control_w)); map(0x007c00, 0x007dff).rw(m_spg_audio, FUNC(sunplus_gcm394_audio_device::audio_r), FUNC(sunplus_gcm394_audio_device::audio_w)); map(0x007e00, 0x007fff).rw(m_spg_audio, FUNC(sunplus_gcm394_audio_device::audio_phase_r), FUNC(sunplus_gcm394_audio_device::audio_phase_w)); + } -READ16_MEMBER(generalplus_gpac800_device::unkarea_7850_r) +void sunplus_gcm394_base_device::gcm394_internal_map(address_map& map) { - return machine().rand(); + sunplus_gcm394_base_device::base_internal_map(map); + + // no internal ROM on this model? + + map(0x08000, 0x0ffff).r(FUNC(sunplus_gcm394_base_device::internalrom_lower32_r)).nopw(); + + map(0x10000, 0x01ffff).nopr(); + + map(0x020000, 0x1fffff).rw(FUNC(sunplus_gcm394_base_device::cs_space_r), FUNC(sunplus_gcm394_base_device::cs_space_w)); + map(0x200000, 0x3fffff).rw(FUNC(sunplus_gcm394_base_device::cs_bank_space_r), FUNC(sunplus_gcm394_base_device::cs_bank_space_w)); +} + +READ16_MEMBER(sunplus_gcm394_base_device::cs_space_r) +{ + return m_cs_space->read_word(offset); } -READ16_MEMBER(generalplus_gpac800_device::unkarea_7854_r) +WRITE16_MEMBER(sunplus_gcm394_base_device::cs_space_w) { - m_testval ^= 1; + m_cs_space->write_word(offset, data); +} +READ16_MEMBER(sunplus_gcm394_base_device::cs_bank_space_r) +{ + int bank = m_membankswitch_7810 & 0x3f; + int realoffset = offset + (bank * 0x200000) - m_csbase; - logerror("%s:sunplus_gcm394_base_device::unkarea_7854_r\n", machine().describe_context()); + if (realoffset < 0) + { + logerror("read real offset < 0\n"); + return 0; + } - // jak_tsm code looks for various 'magic values' + //return m_cs_space->read_word(offset + (0x200000 - m_csbase)); + return m_cs_space->read_word(realoffset); - if (m_testval == 1) - return 0xc2; +} + +WRITE16_MEMBER(sunplus_gcm394_base_device::cs_bank_space_w) +{ + int bank = m_membankswitch_7810 & 0x3f; + int realoffset = offset + (bank * 0x200000) - m_csbase; + + if (realoffset < 0) + { + logerror("write real offset < 0\n"); + return; + } + + m_cs_space->write_word(realoffset, data); +} + + + +READ16_MEMBER(sunplus_gcm394_base_device::internalrom_lower32_r) +{ + if (m_boot_mode == 0) + { + uint16_t* introm = (uint16_t*)m_internalrom->base(); + return introm[offset]; + } else - return 0x58; + { + if (!m_cs_space) + return 0x0000; + + uint16_t val = m_cs_space->read_word(offset+0x8000); + return val; + } } + +// GPR27P512A = C2 76 +// HY27UF081G2A = AD F1 80 1D +// H27U518S2C = AD 76 + +READ16_MEMBER(generalplus_gpac800_device::nand_7854_r) +{ + // TODO: use actual NAND / Smart Media devices once this is better understood. + // The games have extensive checks on startup to determine the flash types, but then it appears that + // certain games (eg jak_tsm) will only function correctly with specific ones, even if the code + // continues regardless. Others will bail early if they don't get what they want. + + // I think some unSP core maths bugs are causing severe issues after the initial load for jak_tsm + // at the moment, possibly the same ones that are causing rendering issues in the jak_gtg bitmap + // test and seemingly incorrect road data for jak_car2, either that or the hookup here is very + // non-standard outside of the ident codes + + // real TSM code starts at 4c000 + + + //logerror("%s:sunplus_gcm394_base_device::nand_7854_r\n", machine().describe_context()); + + if (m_nandcommand == 0x90) // read ident + { + logerror("%s:sunplus_gcm394_base_device::nand_7854_r READ IDENT byte %d\n", machine().describe_context(), m_curblockaddr); + + uint8_t data = 0x00; + + if (m_romtype == 0) + { + if (m_curblockaddr == 0) + data = 0xc2; + else + data = 0x76; + } + else if (m_romtype == 1) + { + if (m_curblockaddr == 0) + data = 0xad; + else if (m_curblockaddr == 1) + data = 0x76; + } + else + { + if (m_curblockaddr == 2) + data = 0xad; + else if (m_curblockaddr == 1) + data = 0xf1; + else if (m_curblockaddr == 2) + data = 0x80; + else if (m_curblockaddr == 3) + data = 0x1d; + } + + m_curblockaddr++; + + return data; + } + else if (m_nandcommand == 0x00) + { + //logerror("%s:sunplus_gcm394_base_device::nand_7854_r READ DATA byte %d\n", machine().describe_context(), m_curblockaddr); + + uint32_t nandaddress = (m_nand_addr_high << 16) | m_nand_addr_low; + uint8_t data = m_nand_read_cb((nandaddress * 2) + m_curblockaddr); + + m_curblockaddr++; + + return data; + } + else if (m_nandcommand == 0x70) // read status + { + logerror("%s:sunplus_gcm394_base_device::nand_7854_r READ STATUS byte %d\n", machine().describe_context(), m_curblockaddr); + + return 0xffff; + } + else + { + logerror("%s:sunplus_gcm394_base_device::nand_7854_r READ UNKNOWN byte %d\n", machine().describe_context(), m_curblockaddr); + return 0xffff; + } + + return 0x0000; +} + +// 7998 + +WRITE16_MEMBER(generalplus_gpac800_device::nand_command_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_command_w %04x\n", machine().describe_context(), data); + m_nandcommand = data; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_addr_low_w) +{ + //logerror("%s:sunplus_gcm394_base_device::nand_addr_low_w %04x\n", machine().describe_context(), data); + m_nand_addr_low = data; + m_curblockaddr = 0; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_addr_high_w) +{ + //logerror("%s:sunplus_gcm394_base_device::nand_addr_high_w %04x\n", machine().describe_context(), data); + m_nand_addr_high = data; + + uint32_t address = (m_nand_addr_high << 16) | m_nand_addr_low; + + logerror("%s: flash address is now %08x\n", machine().describe_context(), address); + + m_curblockaddr = 0; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_dma_ctrl_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_dma_ctrl_w(?) %04x\n", machine().describe_context(), data); + m_nand_dma_ctrl = data; +} + +READ16_MEMBER(generalplus_gpac800_device::nand_7850_r) +{ + // 0x8000 = ready + return m_nand_7850 | 0x8000; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_7850_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_7850_w %04x\n", machine().describe_context(), data); + m_nand_7850 = data; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_7856_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_7856_w %04x\n", machine().describe_context(), data); + m_nand_7856 = data; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_7857_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_7857_w %04x\n", machine().describe_context(), data); + m_nand_7857 = data; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_785b_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_785b_w %04x\n", machine().describe_context(), data); + m_nand_785b = data; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_785c_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_785c_w %04x\n", machine().describe_context(), data); + m_nand_785c = data; +} + +WRITE16_MEMBER(generalplus_gpac800_device::nand_785d_w) +{ + logerror("%s:sunplus_gcm394_base_device::nand_785d_w %04x\n", machine().describe_context(), data); + m_nand_785d = data; +} + +// [:maincpu] ':maincpu' (00146D) jak_tsm +READ16_MEMBER(generalplus_gpac800_device::nand_785e_r) +{ + return 0x0000; +} + +//[:maincpu] ':maincpu' (001490) jak_tsm +READ16_MEMBER(generalplus_gpac800_device::nand_ecc_low_byte_error_flag_1_r) +{ + return 0x0000; +} + +/* +UNMAPPED reads writes + +jak_tsm uses these (all iniitalized near start) +unclear if these are specific to the GPAC800 type, or present in the older types + +[:maincpu] ':maincpu' (00043F):sunplus_gcm394_base_device::unk_w @ 0x780a (data 0x0000) +[:maincpu] ':maincpu' (000442):sunplus_gcm394_base_device::unk_w @ 0x7808 (data 0x0000) +[:maincpu] ':maincpu' (000445):sunplus_gcm394_base_device::unk_w @ 0x782f (data 0x0002) +[:maincpu] ':maincpu' (000449):sunplus_gcm394_base_device::unk_w @ 0x783d (data 0x05d9) +[:maincpu] ':maincpu' (00044D):sunplus_gcm394_base_device::unk_w @ 0x783c (data 0x0a57) +[:maincpu] ':maincpu' (000451):sunplus_gcm394_base_device::unk_w @ 0x783b (data 0x2400) +[:maincpu] ':maincpu' (000454):sunplus_gcm394_base_device::unk_w @ 0x783e (data 0x0002) +[:maincpu] ':maincpu' (000458):sunplus_gcm394_base_device::unk_w @ 0x783a (data 0x3011) +[:maincpu] ':maincpu' (00045B):sunplus_gcm394_base_device::unk_w @ 0x7874 (data 0x0000) +[:maincpu] ':maincpu' (00045D):sunplus_gcm394_base_device::unk_w @ 0x787c (data 0x0000) +[:maincpu] ':maincpu' (00045F):sunplus_gcm394_base_device::unk_w @ 0x7888 (data 0x0000) +[:maincpu] ':maincpu' (000461):sunplus_gcm394_base_device::unk_w @ 0x787e (data 0x0000) + +jak_car2 uses these + +[:maincpu] ':maincpu' (004056):sunplus_gcm394_base_device::unk_w @ 0x782f (data 0x0002) +[:maincpu] ':maincpu' (004059):sunplus_gcm394_base_device::unk_w @ 0x783d (data 0x05d9) +[:maincpu] ':maincpu' (00405C):sunplus_gcm394_base_device::unk_w @ 0x783c (data 0x0a57) +[:maincpu] ':maincpu' (00405F):sunplus_gcm394_base_device::unk_w @ 0x783b (data 0x2400) +[:maincpu] ':maincpu' (004062):sunplus_gcm394_base_device::unk_w @ 0x783e (data 0x0002) +[:maincpu] ':maincpu' (004065):sunplus_gcm394_base_device::unk_w @ 0x783a (data 0x3011) +[:maincpu] ':maincpu' (004069):sunplus_gcm394_base_device::unk_r @ 0x7880 +[:maincpu] ':maincpu' (00406F):sunplus_gcm394_base_device::unk_w @ 0x7874 (data 0x1249) +[:maincpu] ':maincpu' (004071):sunplus_gcm394_base_device::unk_w @ 0x787c (data 0x1249) +[:maincpu] ':maincpu' (004073):sunplus_gcm394_base_device::unk_w @ 0x7888 (data 0x1249) +[:maincpu] ':maincpu' (004075):sunplus_gcm394_base_device::unk_w @ 0x787e (data 0x1249) +[:maincpu] ':maincpu' (004088):sunplus_gcm394_base_device::unk_w @ 0x7841 (data 0x000f) +[:maincpu] ':maincpu' (00408F):sunplus_gcm394_base_device::unk_w @ 0x780a (data 0x0000) +[:maincpu] ':maincpu' (004092):sunplus_gcm394_base_device::unk_w @ 0x7808 (data 0x0002) + +[:maincpu] ':maincpu' (03000A):sunplus_gcm394_base_device::unk_w @ 0x7874 (data 0x36db) +[:maincpu] ':maincpu' (03000C):sunplus_gcm394_base_device::unk_w @ 0x787c (data 0x36db) +[:maincpu] ':maincpu' (03000E):sunplus_gcm394_base_device::unk_w @ 0x7888 (data 0x36db) +[:maincpu] ':maincpu' (030010):sunplus_gcm394_base_device::unk_w @ 0x787e (data 0x36db) +[:maincpu] ':maincpu' (030013):sunplus_gcm394_base_device::unk_w @ 0x787f (data 0x0010) +[:maincpu] ':maincpu' (03001D):sunplus_gcm394_base_device::unk_w @ 0x7804 (data 0x1c7f) +[:maincpu] ':maincpu' (030023):sunplus_gcm394_base_device::unk_w @ 0x7805 (data 0xcdf0) +[:maincpu] ':maincpu' (03E645):sunplus_gcm394_base_device::unk_w @ 0x7861 (data 0x1f66) +[:maincpu] ':maincpu' (03E64C):sunplus_gcm394_base_device::unk_w @ 0x786b (data 0x0000) +[:maincpu] ':maincpu' (03E64F):sunplus_gcm394_base_device::unk_w @ 0x7869 (data 0x0000) +[:maincpu] ':maincpu' (03E652):sunplus_gcm394_base_device::unk_w @ 0x786a (data 0x0000) +[:maincpu] ':maincpu' (03E65B):sunplus_gcm394_base_device::unk_w @ 0x7966 (data 0x0001) +[:maincpu] ':maincpu' (03CBD0):sunplus_gcm394_base_device::unk_w @ 0x7871 (data 0x0000) + +-- this one seems like a common alt type of DMA, used in both hw types as it polls 707c status before doing it +[:maincpu] ':maincpu' (03B4C7):sunplus_gcm394_base_device::unk_w @ 0x707c (data 0x0001) +-- also video / alt dma? +[:maincpu] ':maincpu' (068C15):sunplus_gcm394_base_device::unk_r @ 0x707e + +beambox sets things up with different values (ultimately stalls on some check, maybe seeprom?) + +[:maincpu] ':maincpu' (00043F):sunplus_gcm394_base_device::unk_w @ 0x780a (data 0x0000) +[:maincpu] ':maincpu' (000442):sunplus_gcm394_base_device::unk_w @ 0x7808 (data 0x0000) +[:maincpu] ':maincpu' (000445):sunplus_gcm394_base_device::unk_w @ 0x782f (data 0x0002) +[:maincpu] ':maincpu' (000449):sunplus_gcm394_base_device::unk_w @ 0x783d (data 0x05d9) +[:maincpu] ':maincpu' (00044D):sunplus_gcm394_base_device::unk_w @ 0x783c (data 0x0f58) +[:maincpu] ':maincpu' (000451):sunplus_gcm394_base_device::unk_w @ 0x783b (data 0x2400) +[:maincpu] ':maincpu' (000454):sunplus_gcm394_base_device::unk_w @ 0x783e (data 0x0002) +[:maincpu] ':maincpu' (000458):sunplus_gcm394_base_device::unk_w @ 0x783a (data 0x4011) +[:maincpu] ':maincpu' (00045C):sunplus_gcm394_base_device::unk_w @ 0x7874 (data 0x2492) -- note pair of 4, but different values to above games +[:maincpu] ':maincpu' (00045E):sunplus_gcm394_base_device::unk_w @ 0x787c (data 0x2492) +[:maincpu] ':maincpu' (000460):sunplus_gcm394_base_device::unk_w @ 0x7888 (data 0x2492) +[:maincpu] ':maincpu' (000462):sunplus_gcm394_base_device::unk_w @ 0x787e (data 0x2492) + +vbaby code is very differet, attempts to load NAND block manually, not with DMA + +*/ + + // all tilemap registers etc. appear to be in the same place as the above system, including the 'extra' ones not on the earlier models // so it's likely this is built on top of that just with NAND support void generalplus_gpac800_device::gpac800_internal_map(address_map& map) { - sunplus_gcm394_base_device::gcm394_internal_map(map); + sunplus_gcm394_base_device::base_internal_map(map); + + // 785x = NAND device + map(0x007850, 0x007850).rw(FUNC(generalplus_gpac800_device::nand_7850_r), FUNC(generalplus_gpac800_device::nand_7850_w)); // NAND Control Reg + map(0x007851, 0x007851).w(FUNC(generalplus_gpac800_device::nand_command_w)); // NAND Command Reg + map(0x007852, 0x007852).w(FUNC(generalplus_gpac800_device::nand_addr_low_w)); // NAND Low Address Reg + map(0x007853, 0x007853).w(FUNC(generalplus_gpac800_device::nand_addr_high_w)); // NAND High Address Reg + map(0x007854, 0x007854).r(FUNC(generalplus_gpac800_device::nand_7854_r)); // NAND Data Reg + map(0x007855, 0x007855).w(FUNC(generalplus_gpac800_device::nand_dma_ctrl_w)); // NAND DMA / INT Control + map(0x007856, 0x007856).w(FUNC(generalplus_gpac800_device::nand_7856_w)); // usually 0x0021? + map(0x007857, 0x007857).w(FUNC(generalplus_gpac800_device::nand_7857_w)); + + // most of these are likely ECC stuff for testing the ROM? + map(0x00785b, 0x00785b).w(FUNC(generalplus_gpac800_device::nand_785b_w)); + map(0x00785c, 0x00785c).w(FUNC(generalplus_gpac800_device::nand_785c_w)); + map(0x00785d, 0x00785d).w(FUNC(generalplus_gpac800_device::nand_785d_w)); + map(0x00785e, 0x00785e).r(FUNC(generalplus_gpac800_device::nand_785e_r)); // also ECC status related? + map(0x00785f, 0x00785f).r(FUNC(generalplus_gpac800_device::nand_ecc_low_byte_error_flag_1_r)); // ECC Low Byte Error Flag 1 (maybe) + + // 128kwords internal ROM + //map(0x08000, 0x0ffff).rom().region("internal", 0); // lower 32kwords of internal ROM is visible / shadowed depending on boot pins and register + map(0x08000, 0x0ffff).r(FUNC(generalplus_gpac800_device::internalrom_lower32_r)).nopw(); + map(0x10000, 0x27fff).rom().region("internal", 0x10000); // upper 96kwords of internal ROM is always visible + map(0x28000, 0x2ffff).noprw(); // reserved + // 0x30000+ is CS access + + map(0x030000, 0x1fffff).rw(FUNC(generalplus_gpac800_device::cs_space_r), FUNC(generalplus_gpac800_device::cs_space_w)); + map(0x200000, 0x3fffff).rw(FUNC(generalplus_gpac800_device::cs_bank_space_r), FUNC(generalplus_gpac800_device::cs_bank_space_w)); +} + + +READ16_MEMBER(generalplus_gpspispi_device::spi_unk_7943_r) +{ + return 0x0007; +} + +void generalplus_gpspispi_device::gpspispi_internal_map(address_map& map) +{ + sunplus_gcm394_base_device::base_internal_map(map); + + map(0x007943, 0x007943).r(FUNC(generalplus_gpspispi_device::spi_unk_7943_r)); - // there is an extra command-based device at 785x, what it returns is important to code flow - // code is littered with NOPs so clearly the device can't accept commands too quickly and doesn't return data immediately - // - // this should be the NAND device, as the games attempt to do a DMA operation with '7854' as the source, and the target - // as the RAM location where code needs to end up before jumping to it - map(0x007850, 0x007850).r(FUNC(generalplus_gpac800_device::unkarea_7850_r)); // 'device ready' status flag? - map(0x007854, 0x007854).r(FUNC(generalplus_gpac800_device::unkarea_7854_r)); // data read port (timing appears to be important) + map(0x008000, 0x00ffff).rom().region("internal", 0); } - + + void sunplus_gcm394_base_device::device_start() { unsp_20_device::device_start(); + m_cs_callback.resolve(); + m_porta_in.resolve_safe(0); m_portb_in.resolve_safe(0); + m_portc_in.resolve_safe(0); m_porta_out.resolve(); + m_space_read_cb.resolve_safe(0); m_space_write_cb.resolve(); - m_mapping_write_cb.resolve(); + m_nand_read_cb.resolve_safe(0); m_unk_timer = timer_alloc(0); m_unk_timer->adjust(attotime::never); + + save_item(NAME(m_dma_params)); + save_item(NAME(m_7803)); + save_item(NAME(m_7807)); + save_item(NAME(m_membankswitch_7810)); + save_item(NAME(m_7816)); + save_item(NAME(m_7817)); + save_item(NAME(m_7819)); + save_item(NAME(m_782x)); + save_item(NAME(m_782d)); + save_item(NAME(m_7835)); + save_item(NAME(m_7860)); + save_item(NAME(m_7861)); + save_item(NAME(m_7862_porta_direction)); + save_item(NAME(m_7863_porta_attribute)); + + save_item(NAME(m_786a_portb_direction)); + save_item(NAME(m_786b_portb_attribute)); + + save_item(NAME(m_7870)); + //save_item(NAME(m_7871)); + save_item(NAME(m_7872_portc_direction)); + save_item(NAME(m_7873_portc_attribute)); + save_item(NAME(m_7882)); + save_item(NAME(m_7883)); + save_item(NAME(m_78a0)); + save_item(NAME(m_78a4)); + save_item(NAME(m_78a5)); + save_item(NAME(m_78a6)); + save_item(NAME(m_78a8)); + save_item(NAME(m_78b0)); + save_item(NAME(m_78b1)); + save_item(NAME(m_78b2)); + save_item(NAME(m_78b8)); + save_item(NAME(m_78f0)); + save_item(NAME(m_78fb)); + save_item(NAME(m_7934)); + save_item(NAME(m_7935)); + save_item(NAME(m_7936)); + save_item(NAME(m_7960)); + save_item(NAME(m_7961)); + save_item(NAME(m_system_dma_memtype)); + save_item(NAME(m_csbase)); + save_item(NAME(m_romtype)); } void sunplus_gcm394_base_device::device_reset() { unsp_20_device::device_reset(); - for (int i = 0; i < 7; i++) + for (int j = 0; j < 3; j++) { - m_dma_params[i] = 0x0000; + for (int i = 0; i < 7; i++) + { + m_dma_params[i][j] = 0x0000; + } } // 78xx unknown @@ -573,18 +1271,18 @@ void sunplus_gcm394_base_device::device_reset() m_7807 = 0x0000; - m_7810 = 0x0000; + m_membankswitch_7810 = 0x0001; m_7816 = 0x0000; m_7817 = 0x0000; m_7819 = 0x0000; - m_7820 = 0x0000; - m_7821 = 0x0000; - m_7822 = 0x0000; - m_7823 = 0x0000; - m_7824 = 0x0000; + m_782x[0] = 0x0000; + m_782x[1] = 0x0000; + m_782x[2] = 0x0000; + m_782x[3] = 0x0000; + m_782x[4] = 0x0000; m_7835 = 0x0000; @@ -592,15 +1290,18 @@ void sunplus_gcm394_base_device::device_reset() m_7861 = 0x0000; - m_7862 = 0x0000; - m_7863 = 0x0000; + m_7862_porta_direction = 0x0000; + m_7863_porta_attribute = 0x0000; + + m_786a_portb_direction = 0x0000; + m_786b_portb_attribute = 0x0000; m_7870 = 0x0000; - m_7871 = 0x0000; + //m_7871 = 0x0000; - m_7872 = 0x0000; - m_7873 = 0x0000; + m_7872_portc_direction = 0x0000; + m_7873_portc_attribute = 0x0000; m_7882 = 0x0000; m_7883 = 0x0000; @@ -629,17 +1330,29 @@ void sunplus_gcm394_base_device::device_reset() m_7960 = 0x0000; m_7961 = 0x0000; + m_system_dma_memtype = 0x0000; m_unk_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); +} - m_gfxregion = memregion(":maincpu")->base(); - m_gfxregionsize = memregion(":maincpu")->bytes(); - +void generalplus_gpac800_device::device_reset() +{ + sunplus_gcm394_base_device::device_reset(); + + m_nand_addr_low = 0x0000; + m_nand_addr_high = 0x0000; + m_nand_dma_ctrl = 0x0000; + m_nand_7850 = 0x0000; + m_nand_785d = 0x0000; + m_nand_785c = 0x0000; + m_nand_785b = 0x0000; + m_nand_7856 = 0x0000; + m_nand_7857 = 0x0000; } IRQ_CALLBACK_MEMBER(sunplus_gcm394_base_device::irq_vector_cb) { - //printf("irq_vector_cb %d\n", irqline); + //logerror("irq_vector_cb %d\n", irqline); if (irqline == UNSP_IRQ6_LINE) set_state_unsynced(UNSP_IRQ6_LINE, CLEAR_LINE); @@ -654,10 +1367,10 @@ IRQ_CALLBACK_MEMBER(sunplus_gcm394_base_device::irq_vector_cb) void sunplus_gcm394_base_device::checkirq6() { /* - if (m_7935 & 0x0100) - set_state_unsynced(UNSP_IRQ6_LINE, ASSERT_LINE); - else - set_state_unsynced(UNSP_IRQ6_LINE, CLEAR_LINE); + if (m_7935 & 0x0100) + set_state_unsynced(UNSP_IRQ6_LINE, ASSERT_LINE); + else + set_state_unsynced(UNSP_IRQ6_LINE, CLEAR_LINE); */ } @@ -696,7 +1409,7 @@ void sunplus_gcm394_base_device::device_timer(emu_timer &timer, device_timer_id set_state_unsynced(UNSP_IRQ6_LINE, ASSERT_LINE); //set_state_unsynced(UNSP_IRQ4_LINE, ASSERT_LINE); - // checkirq6(); + // checkirq6(); break; } } @@ -715,14 +1428,35 @@ WRITE_LINE_MEMBER(sunplus_gcm394_base_device::videoirq_w) uint16_t sunplus_gcm394_base_device::read_space(uint32_t offset) { -// uint16_t b = m_gfxregion[(offset * 2) & (m_gfxregionsize - 1)] | (m_gfxregion[(offset * 2 + 1) & (m_gfxregionsize - 1)] << 8); -// return b; - address_space& mem = this->space(AS_PROGRAM); - uint16_t retdata = mem.read_word(offset); - return retdata; + address_space& space = this->space(AS_PROGRAM); + uint16_t val; + if (offset < m_csbase) + { + val = space.read_word(offset); + } + else + { + val = m_cs_space->read_word(offset-m_csbase); + } + + return val; +} + +void sunplus_gcm394_base_device::write_space(uint32_t offset, uint16_t data) +{ + address_space& space = this->space(AS_PROGRAM); + if (offset < m_csbase) + { + space.write_word(offset, data); + } + else + { + m_cs_space->write_word(offset-m_csbase, data); + } } + void sunplus_gcm394_base_device::device_add_mconfig(machine_config &config) { SUNPLUS_GCM394_AUDIO(config, m_spg_audio, DERIVED_CLOCK(1, 1)); diff --git a/src/devices/machine/sunplus_gcm394.h b/src/devices/machine/sunplus_gcm394.h index 77c57ba3602..ad29b7b1208 100644 --- a/src/devices/machine/sunplus_gcm394.h +++ b/src/devices/machine/sunplus_gcm394.h @@ -17,6 +17,7 @@ #include "sunplus_gcm394_video.h" #include "spg2xx_audio.h" +typedef device_delegate<void (uint16_t, uint16_t, uint16_t, uint16_t, uint16_t)> sunplus_gcm394_cs_callback_device; class sunplus_gcm394_base_device : public unsp_20_device, public device_mixer_interface { @@ -32,12 +33,18 @@ public: m_screen(*this, finder_base::DUMMY_TAG), m_spg_video(*this, "spgvideo"), m_spg_audio(*this, "spgaudio"), + m_internalrom(*this, "internal"), m_porta_in(*this), m_portb_in(*this), + m_portc_in(*this), m_porta_out(*this), + m_nand_read_cb(*this), + m_csbase(0x20000), + m_romtype(0), m_space_read_cb(*this), m_space_write_cb(*this), - m_mapping_write_cb(*this) + m_boot_mode(0), + m_cs_callback(*this, DEVICE_SELF, FUNC(sunplus_gcm394_base_device::default_cs_callback)) { } @@ -45,44 +52,60 @@ public: auto porta_in() { return m_porta_in.bind(); } auto portb_in() { return m_portb_in.bind(); } + auto portc_in() { return m_portc_in.bind(); } auto porta_out() { return m_porta_out.bind(); } auto space_read_callback() { return m_space_read_cb.bind(); } auto space_write_callback() { return m_space_write_cb.bind(); } - auto mapping_write_callback() { return m_mapping_write_cb.bind(); } + auto nand_read_callback() { return m_nand_read_cb.bind(); } DECLARE_WRITE_LINE_MEMBER(vblank) { m_spg_video->vblank(state); } virtual void device_add_mconfig(machine_config& config) override; + void set_bootmode(int mode) { m_boot_mode = mode; } + IRQ_CALLBACK_MEMBER(irq_vector_cb); + template <typename... T> void set_cs_config_callback(T &&... args) { m_cs_callback.set(std::forward<T>(args)...); } + void default_cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4 ); + + void set_cs_space(address_space* csspace) { m_cs_space = csspace; } + + void set_paldisplaybank_high_hack(int pal_displaybank_high) { m_spg_video->set_paldisplaybank_high(pal_displaybank_high); } + void set_alt_tile_addressing_hack(int alt_tile_addressing) { m_spg_video->set_alt_tile_addressing(alt_tile_addressing); } + void set_romtype(int romtype) { m_romtype = romtype; } protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_post_load() override; + void gcm394_internal_map(address_map &map); + void base_internal_map(address_map &map); required_device<screen_device> m_screen; required_device<gcm394_video_device> m_spg_video; required_device<sunplus_gcm394_audio_device> m_spg_audio; + optional_memory_region m_internalrom; devcb_read16 m_porta_in; devcb_read16 m_portb_in; + devcb_read16 m_portc_in; devcb_write16 m_porta_out; - uint16_t m_dma_params[7]; + uint16_t m_dma_params[7][3]; // unk 78xx uint16_t m_7803; uint16_t m_7807; - uint16_t m_7810; + uint16_t m_membankswitch_7810; uint16_t m_7816; uint16_t m_7817; @@ -90,11 +113,7 @@ protected: uint16_t m_7819; - uint16_t m_7820; - uint16_t m_7821; - uint16_t m_7822; - uint16_t m_7823; - uint16_t m_7824; + uint16_t m_782x[5]; uint16_t m_782d; @@ -104,15 +123,18 @@ protected: uint16_t m_7861; - uint16_t m_7862; - uint16_t m_7863; + uint16_t m_7862_porta_direction; + uint16_t m_7863_porta_attribute; + + uint16_t m_786a_portb_direction; + uint16_t m_786b_portb_attribute; uint16_t m_7870; - uint16_t m_7871; + //uint16_t m_7871; - uint16_t m_7872; - uint16_t m_7873; + uint16_t m_7872_portc_direction; + uint16_t m_7873_portc_attribute; uint16_t m_7882; uint16_t m_7883; @@ -143,18 +165,42 @@ protected: uint16_t m_7960; uint16_t m_7961; + uint16_t m_system_dma_memtype; + + devcb_read16 m_nand_read_cb; + int m_csbase; + + DECLARE_READ16_MEMBER(internalrom_lower32_r); + + address_space* m_cs_space; + + DECLARE_READ16_MEMBER(cs_space_r); + DECLARE_WRITE16_MEMBER(cs_space_w); + DECLARE_READ16_MEMBER(cs_bank_space_r); + DECLARE_WRITE16_MEMBER(cs_bank_space_w); + int m_romtype; + private: devcb_read16 m_space_read_cb; devcb_write16 m_space_write_cb; - devcb_write16 m_mapping_write_cb; DECLARE_READ16_MEMBER(unk_r); DECLARE_WRITE16_MEMBER(unk_w); + void write_dma_params(int channel, int offset, uint16_t data); + uint16_t read_dma_params(int channel, int offset); + void trigger_systemm_dma(address_space &space, int channel, uint16_t data); - DECLARE_WRITE16_MEMBER(system_dma_params_w); - DECLARE_WRITE16_MEMBER(system_dma_trigger_w); + DECLARE_READ16_MEMBER(system_dma_params_channel0_r); + DECLARE_WRITE16_MEMBER(system_dma_params_channel0_w); + DECLARE_READ16_MEMBER(system_dma_params_channel1_r); + DECLARE_WRITE16_MEMBER(system_dma_params_channel1_w); + DECLARE_READ16_MEMBER(system_dma_params_channel2_r); + DECLARE_WRITE16_MEMBER(system_dma_params_channel2_w); DECLARE_READ16_MEMBER(system_dma_status_r); + DECLARE_WRITE16_MEMBER(system_dma_trigger_w); + DECLARE_READ16_MEMBER(system_dma_memtype_r); + DECLARE_WRITE16_MEMBER(system_dma_memtype_w); DECLARE_READ16_MEMBER(unkarea_780f_status_r); DECLARE_READ16_MEMBER(unkarea_78fb_status_r); @@ -164,8 +210,10 @@ private: DECLARE_WRITE16_MEMBER(unkarea_7807_w); - DECLARE_READ16_MEMBER(unkarea_7810_r); - DECLARE_WRITE16_MEMBER(unkarea_7810_w); + DECLARE_WRITE16_MEMBER(waitmode_enter_780c_w); + + DECLARE_READ16_MEMBER(membankswitch_7810_r); + DECLARE_WRITE16_MEMBER(membankswitch_7810_w); DECLARE_WRITE16_MEMBER(unkarea_7816_w); DECLARE_WRITE16_MEMBER(unkarea_7817_w); @@ -173,38 +221,42 @@ private: DECLARE_READ16_MEMBER(unkarea_7819_r); DECLARE_WRITE16_MEMBER(unkarea_7819_w); - DECLARE_WRITE16_MEMBER(unkarea_7820_w); - DECLARE_WRITE16_MEMBER(unkarea_7821_w); - DECLARE_WRITE16_MEMBER(unkarea_7822_w); - DECLARE_WRITE16_MEMBER(unkarea_7823_w); - DECLARE_WRITE16_MEMBER(unkarea_7824_w); + DECLARE_WRITE16_MEMBER(chipselect_csx_memory_device_control_w); DECLARE_WRITE16_MEMBER(unkarea_7835_w); - DECLARE_READ16_MEMBER(unkarea_7868_r); + // Port A + DECLARE_READ16_MEMBER(ioarea_7860_porta_r); + DECLARE_WRITE16_MEMBER(ioarea_7860_porta_w); + DECLARE_READ16_MEMBER(ioarea_7861_porta_buffer_r); + DECLARE_READ16_MEMBER(ioarea_7862_porta_direction_r); + DECLARE_WRITE16_MEMBER(ioarea_7862_porta_direction_w); + DECLARE_READ16_MEMBER(ioarea_7863_porta_attribute_r); + DECLARE_WRITE16_MEMBER(ioarea_7863_porta_attribute_w); + + // Port B + DECLARE_READ16_MEMBER(ioarea_7868_portb_r); + DECLARE_WRITE16_MEMBER(ioarea_7868_portb_w); + DECLARE_READ16_MEMBER(ioarea_7869_portb_buffer_r); + DECLARE_READ16_MEMBER(ioarea_786a_portb_direction_r); + DECLARE_WRITE16_MEMBER(ioarea_786a_portb_direction_w); + DECLARE_READ16_MEMBER(ioarea_786b_portb_attribute_r); + DECLARE_WRITE16_MEMBER(ioarea_786b_portb_attribute_w); DECLARE_READ16_MEMBER(unkarea_782d_r); DECLARE_WRITE16_MEMBER(unkarea_782d_w); - DECLARE_READ16_MEMBER(ioarea_7860_porta_r); - DECLARE_WRITE16_MEMBER(ioarea_7860_porta_w); - DECLARE_READ16_MEMBER(unkarea_7861_r); - DECLARE_READ16_MEMBER(unkarea_7862_r); - DECLARE_WRITE16_MEMBER(unkarea_7862_w); - DECLARE_READ16_MEMBER(unkarea_7863_r); - DECLARE_WRITE16_MEMBER(unkarea_7863_w); + DECLARE_READ16_MEMBER(ioarea_7870_portc_r); + DECLARE_WRITE16_MEMBER(ioarea_7870_portc_w); - DECLARE_READ16_MEMBER(ioarea_7870_portb_r); - DECLARE_WRITE16_MEMBER(ioarea_7870_portb_w); + DECLARE_READ16_MEMBER(ioarea_7871_portc_buffer_r); - DECLARE_READ16_MEMBER(unkarea_7871_r); - - DECLARE_READ16_MEMBER(unkarea_7872_r); - DECLARE_WRITE16_MEMBER(unkarea_7872_w); - DECLARE_READ16_MEMBER(unkarea_7873_r); - DECLARE_WRITE16_MEMBER(unkarea_7873_w); + DECLARE_READ16_MEMBER(ioarea_7872_portc_direction_r); + DECLARE_WRITE16_MEMBER(ioarea_7872_portc_direction_w); + DECLARE_READ16_MEMBER(ioarea_7873_portc_attribute_r); + DECLARE_WRITE16_MEMBER(ioarea_7873_portc_attribute_w); DECLARE_READ16_MEMBER(unkarea_7882_r); DECLARE_WRITE16_MEMBER(unkarea_7882_w); @@ -213,6 +265,7 @@ private: DECLARE_WRITE16_MEMBER(unkarea_78a0_w); + DECLARE_READ16_MEMBER(unkarea_78a0_r); DECLARE_READ16_MEMBER(unkarea_78a1_r); DECLARE_WRITE16_MEMBER(unkarea_78a4_w); @@ -229,6 +282,8 @@ private: DECLARE_WRITE16_MEMBER(unkarea_78b8_w); + DECLARE_READ16_MEMBER(unkarea_78d0_r); + DECLARE_WRITE16_MEMBER(unkarea_78f0_w); DECLARE_READ16_MEMBER(unkarea_7934_r); @@ -240,6 +295,9 @@ private: DECLARE_READ16_MEMBER(unkarea_7936_r); DECLARE_WRITE16_MEMBER(unkarea_7936_w); + DECLARE_READ16_MEMBER(spi_7944_rxdata_r); + DECLARE_READ16_MEMBER(spi_7945_misc_control_reg_r); + DECLARE_WRITE16_MEMBER(unkarea_7960_w); DECLARE_READ16_MEMBER(unkarea_7961_r); DECLARE_WRITE16_MEMBER(unkarea_7961_w); @@ -248,15 +306,19 @@ private: DECLARE_WRITE_LINE_MEMBER(videoirq_w); DECLARE_WRITE_LINE_MEMBER(audioirq_w); + DECLARE_READ16_MEMBER(system_7a3a_r); + void checkirq6(); emu_timer *m_unk_timer; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - uint8_t* m_gfxregion; - uint32_t m_gfxregionsize; - uint16_t read_space(uint32_t offset); + inline uint16_t read_space(uint32_t offset); + inline void write_space(uint32_t offset, uint16_t data); + // config registers (external pins) + int m_boot_mode; // 2 pins determine boot mode, likely only read at power-on + sunplus_gcm394_cs_callback_device m_cs_callback; }; @@ -283,7 +345,7 @@ public: generalplus_gpac800_device(mconfig, tag, owner, clock) { m_screen.set_tag(std::forward<T>(screen_tag)); - m_testval = 0; + m_csbase = 0x30000; } generalplus_gpac800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -291,16 +353,69 @@ public: protected: void gpac800_internal_map(address_map &map); + //virtual void device_start() override; + virtual void device_reset() override; + private: - DECLARE_READ16_MEMBER(unkarea_7850_r); - DECLARE_READ16_MEMBER(unkarea_7854_r); + DECLARE_READ16_MEMBER(nand_7850_r); + DECLARE_READ16_MEMBER(nand_7854_r); + DECLARE_WRITE16_MEMBER(nand_dma_ctrl_w); + DECLARE_WRITE16_MEMBER(nand_7850_w); + DECLARE_WRITE16_MEMBER(nand_command_w); + DECLARE_WRITE16_MEMBER(nand_addr_low_w); + DECLARE_WRITE16_MEMBER(nand_addr_high_w); + DECLARE_READ16_MEMBER(nand_ecc_low_byte_error_flag_1_r); + DECLARE_WRITE16_MEMBER(nand_7856_w); + DECLARE_WRITE16_MEMBER(nand_7857_w); + DECLARE_WRITE16_MEMBER(nand_785b_w); + DECLARE_WRITE16_MEMBER(nand_785c_w); + DECLARE_WRITE16_MEMBER(nand_785d_w); + DECLARE_READ16_MEMBER(nand_785e_r); + + uint16_t m_nandcommand; + + uint16_t m_nand_addr_low; + uint16_t m_nand_addr_high; + + uint16_t m_nand_dma_ctrl; + uint16_t m_nand_7850; + uint16_t m_nand_785d; + uint16_t m_nand_785c; + uint16_t m_nand_785b; + uint16_t m_nand_7856; + uint16_t m_nand_7857; + + int m_curblockaddr; +}; + + +class generalplus_gpspispi_device : public sunplus_gcm394_base_device +{ +public: + template <typename T> + generalplus_gpspispi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag) : + generalplus_gpspispi_device(mconfig, tag, owner, clock) + { + m_screen.set_tag(std::forward<T>(screen_tag)); + m_csbase = 0x30000; + } + + generalplus_gpspispi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - int m_testval; +protected: + void gpspispi_internal_map(address_map &map); + + //virtual void device_start() override; + //virtual void device_reset() override; + +private: + DECLARE_READ16_MEMBER(spi_unk_7943_r); }; DECLARE_DEVICE_TYPE(GCM394, sunplus_gcm394_device) DECLARE_DEVICE_TYPE(GPAC800, generalplus_gpac800_device) +DECLARE_DEVICE_TYPE(GP_SPISPI, generalplus_gpspispi_device) #endif // MAME_MACHINE_SUNPLUS_GCM394_H diff --git a/src/devices/machine/sunplus_gcm394_video.cpp b/src/devices/machine/sunplus_gcm394_video.cpp index 7f6d32eb03c..babd6998391 100644 --- a/src/devices/machine/sunplus_gcm394_video.cpp +++ b/src/devices/machine/sunplus_gcm394_video.cpp @@ -11,7 +11,9 @@ DEFINE_DEVICE_TYPE(GCM394_VIDEO, gcm394_video_device, "gcm394_video", "SunPlus GCM394 System-on-a-Chip (Video)") -#define LOG_GCM394_VIDEO_DMA (1U << 3) +#define LOG_GCM394_VIDEO_PALETTE (1U << 5) +#define LOG_GCM394_VIDEO_DMA (1U << 4) +#define LOG_GCM394_TMAP_EXTRA (1U << 3) #define LOG_GCM394_TMAP (1U << 2) #define LOG_GCM394_VIDEO (1U << 1) @@ -20,17 +22,22 @@ DEFINE_DEVICE_TYPE(GCM394_VIDEO, gcm394_video_device, "gcm394_video", "SunPlus G #include "logmacro.h" -gcm394_base_video_device::gcm394_base_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock) - //, device_gfx_interface(mconfig, *this, nullptr) - , device_video_interface(mconfig, *this) - , m_cpu(*this, finder_base::DUMMY_TAG) - , m_screen(*this, finder_base::DUMMY_TAG) -// , m_scrollram(*this, "scrollram") - , m_video_irq_cb(*this) - , m_palette(*this, "palette") - , m_gfxdecode(*this, "gfxdecode") - , m_space_read_cb(*this) +gcm394_base_video_device::gcm394_base_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + //device_gfx_interface(mconfig, *this, nullptr), + device_video_interface(mconfig, *this), + m_cpu(*this, finder_base::DUMMY_TAG), + m_screen(*this, finder_base::DUMMY_TAG), +// m_scrollram(*this, "scrollram"), + m_video_irq_cb(*this), + m_palette(*this, "palette"), + m_gfxdecode(*this, "gfxdecode"), + m_space_read_cb(*this), + m_rowscroll(*this, "^rowscroll"), + m_rowzoom(*this, "^rowzoom"), + m_global_y_mask(0x1ff), + m_pal_displaybank_high(0), + m_alt_tile_addressing(0) { } @@ -46,7 +53,7 @@ void gcm394_base_video_device::decodegfx(const char* tag) uint8_t* gfxregion = memregion(tag)->base(); int gfxregionsize = memregion(tag)->bytes(); - + if (1) { gfx_layout obj_layout = @@ -153,7 +160,7 @@ void gcm394_base_video_device::decodegfx(const char* tag) m_gfxdecode->set_gfx(m_maxgfxelement, std::make_unique<gfx_element>(m_palette, obj_layout, gfxregion, 0, 0x40 * 0x10, 0)); m_maxgfxelement++; } - + if (1) { gfx_layout obj_layout = @@ -206,20 +213,81 @@ void gcm394_base_video_device::device_start() m_maxgfxelement = 0; - decodegfx(":maincpu"); - - save_item(NAME(m_spriteextra)); - save_item(NAME(m_spriteram)); + // debug helper only + if (memregion(":maincpu")) + decodegfx(":maincpu"); m_space_read_cb.resolve_safe(0); + + + save_item(NAME(m_screenbuf)); + save_item(NAME(m_rgb5_to_rgb8)); + save_item(NAME(m_rgb555_to_rgb888)); + save_item(NAME(m_page0_addr_lsb)); + save_item(NAME(m_page0_addr_msb)); + save_item(NAME(m_page1_addr_lsb)); + save_item(NAME(m_page1_addr_msb)); + save_item(NAME(m_707e_videodma_bank)); + save_item(NAME(m_videodma_size)); + save_item(NAME(m_videodma_dest)); + save_item(NAME(m_videodma_source)); + save_item(NAME(m_tmap0_regs)); + save_item(NAME(m_tmap1_regs)); + save_item(NAME(m_tmap2_regs)); + save_item(NAME(m_tmap3_regs)); + save_item(NAME(m_tmap0_scroll)); + save_item(NAME(m_tmap1_scroll)); + save_item(NAME(m_tmap2_scroll)); + save_item(NAME(m_tmap3_scroll)); + save_item(NAME(m_707f)); + save_item(NAME(m_703a_palettebank)); + save_item(NAME(m_7062)); + save_item(NAME(m_7063)); + save_item(NAME(m_702a)); + save_item(NAME(m_7030_brightness)); + save_item(NAME(m_703c_tvcontrol1)); + save_item(NAME(m_7042_sprite)); + save_item(NAME(m_7080)); + save_item(NAME(m_7081)); + save_item(NAME(m_7082)); + save_item(NAME(m_7083)); + save_item(NAME(m_7084)); + save_item(NAME(m_7085)); + save_item(NAME(m_7086)); + save_item(NAME(m_7087)); + save_item(NAME(m_7088)); + save_item(NAME(m_sprite_7022_gfxbase_lsb)); + save_item(NAME(m_sprite_702d_gfxbase_msb)); + save_item(NAME(m_page2_addr_lsb)); + save_item(NAME(m_page2_addr_msb)); + save_item(NAME(m_page3_addr_lsb)); + save_item(NAME(m_page3_addr_msb)); + save_item(NAME(m_video_irq_status)); + save_item(NAME(m_spriteram)); + save_item(NAME(m_spriteextra)); + save_item(NAME(m_paletteram)); + save_item(NAME(m_maxgfxelement)); + save_item(NAME(m_global_y_mask)); + save_item(NAME(m_pal_displaybank_high)); + save_item(NAME(m_alt_tile_addressing)); } void gcm394_base_video_device::device_reset() { - for (int i = 0; i < 6; i++) + for (int i = 0; i < 4; i++) { m_tmap0_regs[i] = 0x0000; m_tmap1_regs[i] = 0x0000; + m_tmap2_regs[i] = 0x0000; + m_tmap3_regs[i] = 0x0000; + m_tmap2_scroll[i] = 0x0000; + m_tmap3_scroll[i] = 0x0000; + } + + for (int i = 0; i < 2; i++) + { + m_tmap0_scroll[i] = 0x0000; + m_tmap1_scroll[i] = 0x0000; } for (int i = 0; i < 0x400; i++) @@ -239,8 +307,8 @@ void gcm394_base_video_device::device_reset() m_702a = 0x0000; m_7030_brightness = 0x0000; - m_703c = 0x0000; - + m_703c_tvcontrol1 = 0x0000; + m_7042_sprite = 0x0000; m_7080 = 0x0000; @@ -262,10 +330,10 @@ void gcm394_base_video_device::device_reset() m_sprite_7022_gfxbase_lsb = 0; m_sprite_702d_gfxbase_msb = 0; - m_unk_vid1_gfxbase_lsb = 0; - m_unk_vid1_gfxbase_msb = 0; - m_unk_vid2_gfxbase_lsb = 0; - m_unk_vid2_gfxbase_msb = 0; + m_page2_addr_lsb = 0; + m_page2_addr_msb = 0; + m_page3_addr_lsb = 0; + m_page3_addr_msb = 0; } @@ -284,7 +352,7 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui uint32_t bits_per_row = nc_bpp * w / 16; uint32_t words_per_tile; - + if (addressing_mode == 1) { words_per_tile = bits_per_row * h; @@ -301,9 +369,9 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui uint32_t nbits = 0; uint32_t y = line; - int yy = (yoff + y) & 0x1ff; - if (yy >= 0x01c0) - yy -= 0x0200; + int yy = (yoff + y);// &0x1ff; + //if (yy >= 0x01c0) + // yy -= 0x0200; if (yy > cliprect.max_y || yy < 0) return; @@ -318,7 +386,7 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui if (nbits < nc_bpp) { - uint16_t b = m_space_read_cb((m++ & 0x3fffff)); + uint16_t b = m_space_read_cb((m++)&0x7ffffff); // smartfp suggests either 0x7ffffff mask, or some bits are being set incorrectly, jak_s500 needs over 0x3ffffff at least b = (b << 8) | (b >> 8); bits |= b << (nc_bpp - nbits); nbits += 16; @@ -334,13 +402,14 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui { // 2bpp // 4bpp - - current_palette_offset |= 0x0800; + if (m_pal_displaybank_high) // how is this set? + current_palette_offset |= 0x0800; } else if (nc_bpp < 8) { // 6bpp + // current_palette_offset |= 0x0800; } else @@ -355,9 +424,9 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui if (RowScroll) xx -= 0;// (int16_t)m_scrollram[yy & 0x1ff]; - xx &= 0x01ff; - if (xx >= 0x01c0) - xx -= 0x0200; + //xx &= 0x01ff; + //if (xx >= 0x01c0) + // xx -= 0x0200; if (xx >= 0 && xx <= cliprect.max_x) { @@ -385,111 +454,217 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui } } -void gcm394_base_video_device::draw_page(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t *regs) +void gcm394_base_video_device::draw_page(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t *regs, uint16_t *scroll) { - uint32_t xscroll = regs[0]; - uint32_t yscroll = regs[1]; - uint32_t attr = regs[2]; - uint32_t ctrl = regs[3]; - uint32_t tilemap = regs[4]; - uint32_t palette_map = regs[5]; + uint32_t xscroll = scroll[0]; + uint32_t yscroll = scroll[1]; + uint32_t attr_reg = regs[0]; + uint32_t ctrl_reg = regs[1]; + uint32_t tilemap = regs[2]; + uint32_t palette_map = regs[3]; address_space &space = m_cpu->space(AS_PROGRAM); - if (!(ctrl & PAGE_ENABLE_MASK)) + if (!(ctrl_reg & PAGE_ENABLE_MASK)) { return; } - if (((attr & PAGE_PRIORITY_FLAG_MASK) >> PAGE_PRIORITY_FLAG_SHIFT) != priority) + if (((attr_reg & PAGE_PRIORITY_FLAG_MASK) >> PAGE_PRIORITY_FLAG_SHIFT) != priority) { return; } - uint32_t tile_h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT); - uint32_t tile_w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT); + if (ctrl_reg & 0x01) // bitmap mode jak_car2 and jak_s500 use for the ingame race sections, also have a bitmap test in test mode + { + if (ctrl_reg & 0x10) + popmessage("bitmap mode %08x with rowscroll\n", bitmap_addr); + else + popmessage("bitmap mode %08x\n", bitmap_addr); + + // note, in interlace modes it appears every other line is unused? (480 entry table, but with blank values) + // and furthermore the rowscroll and rowzoom tables only have 240 entries, not enough for every line + // the end of the rowscroll table (entries 240-255) contain something else, maybe garbage data as it's offscreen, maybe not + + uint32_t linebase = space.read_word(tilemap + scanline); // every other word is unused, but there are only enough entries for 240 lines then, sometimes to do with interlace mode? + uint16_t palette = space.read_word(palette_map + (scanline / 2)); + + if (scanline & 1) + palette >>= 8; + else + palette &= 0xff; - uint32_t tile_count_x = 512 / tile_w; + if (!linebase) + return; - uint32_t bitmap_y = (scanline + yscroll) & 0xff; - uint32_t y0 = bitmap_y / tile_h; - uint32_t tile_scanline = bitmap_y % tile_h; - uint32_t tile_address = tile_count_x * y0; + linebase = linebase | (palette << 16); - for (uint32_t x0 = 0; x0 < tile_count_x; x0++, tile_address++) + // this logic works for jak_s500 and the test modes to get the correct base, doesn't seem to work for jak_car2 ingame, maybe data is copied to wrong place? + int gfxbase = (bitmap_addr&0x7ffffff) + (linebase&0x7ffffff); + + for (int i = 0; i < 160; i++) // will have to be 320 for jak_car2 ingame, jak_s500 lines are wider than screen, and zoomed + { + uint16_t pix = m_space_read_cb((gfxbase++)&0x7ffffff); + int xx; + int y_index = scanline * m_screen->width(); + uint16_t pal; + + if ((scanline >= 0) && (scanline < 480)) + { + xx = i * 2; + + pal = (pix & 0xff) | 0x100; + + if (xx >= 0 && xx <= cliprect.max_x) + { + int pix_index = xx + y_index; + + uint16_t rgb = m_paletteram[pal]; + + if (!(rgb & 0x8000)) + { + m_screenbuf[pix_index] = m_rgb555_to_rgb888[rgb]; + } + } + + xx = (i * 2)+1; + pal = (pix >> 8) + 0x100; + + if (xx >= 0 && xx <= cliprect.max_x) + { + int pix_index = xx + y_index; + + uint16_t rgb = m_paletteram[pal]; + + if (!(rgb & 0x8000)) + { + m_screenbuf[pix_index] = m_rgb555_to_rgb888[rgb]; + } + } + } + } + } + else { - uint32_t yy = ((tile_h * y0 - yscroll + 0x10) & 0xff) - 0x10; - uint32_t xx = (tile_w * x0 - xscroll) & 0x1ff; - uint32_t tile = (ctrl & PAGE_WALLPAPER_MASK) ? space.read_word(tilemap) : space.read_word(tilemap + tile_address); + uint32_t tile_h = 8 << ((attr_reg & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT); + uint32_t tile_w = 8 << ((attr_reg & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT); - uint16_t palette = (ctrl & PAGE_WALLPAPER_MASK) ? space.read_word(palette_map) : space.read_word(palette_map + tile_address / 2); - if (x0 & 1) - palette >>= 8; + int total_width; + int use_alt_drawmode = m_alt_tile_addressing; - tile |= (palette & 0x0007) << 16; + // just a guess based on this being set on the higher resolution tilemaps we've seen, could be 100% incorrect register + if ((attr_reg >> 14) & 0x2) + { + total_width = 1024; + // use_alt_drawmode = 1; // probably doesn't control this + } + else + { + total_width = 512; + // use_alt_drawmode = 0; // probably doesn't control this + } + + uint32_t tile_count_x = total_width / tile_w; + + uint32_t bitmap_y = (scanline + yscroll);// &0xff; + uint32_t y0 = bitmap_y / tile_h; + uint32_t tile_scanline = bitmap_y % tile_h; + uint32_t tile_address = tile_count_x * y0; + + for (uint32_t x0 = 0; x0 < tile_count_x; x0++, tile_address++) + { + uint32_t yy = ((tile_h * y0 - yscroll + 0x10) & m_global_y_mask) - 0x10; + uint32_t xx = (tile_w * x0 - xscroll);// &0x1ff; + uint32_t tile = (ctrl_reg & PAGE_WALLPAPER_MASK) ? space.read_word(tilemap) : space.read_word(tilemap + tile_address); + + uint16_t palette = (ctrl_reg & PAGE_WALLPAPER_MASK) ? space.read_word(palette_map) : space.read_word(palette_map + tile_address / 2); + if (x0 & 1) + palette >>= 8; - if (!tile) - continue; + if (!tile) + continue; - uint32_t tileattr = attr; - uint32_t tilectrl = ctrl; + + uint32_t tileattr = attr_reg; + uint32_t tilectrl = ctrl_reg; #if 0 - if ((ctrl & 2) == 0) - { // -(1) bld(1) flip(2) pal(4) - tileattr &= ~0x000c; - tileattr |= (palette >> 2) & 0x000c; // flip + if ((ctrl_reg & 2) == 0) + { // -(1) bld(1) flip(2) pal(4) + tileattr &= ~0x000c; + tileattr |= (palette >> 2) & 0x000c; // flip - tileattr &= ~0x0f00; - tileattr |= (palette << 8) & 0x0f00; // palette + tileattr &= ~0x0f00; + tileattr |= (palette << 8) & 0x0f00; // palette - tilectrl &= ~0x0100; - tilectrl |= (palette << 2) & 0x0100; // blend - } + tilectrl &= ~0x0100; + tilectrl |= (palette << 2) & 0x0100; // blend + } #endif - const bool blend = (tileattr & 0x4000 || tilectrl & 0x0100); - const bool row_scroll = (tilectrl & 0x0010); - const bool flip_x = (tileattr & TILE_X_FLIP); - const uint32_t yflipmask = tileattr & TILE_Y_FLIP ? tile_h - 1 : 0; - uint32_t palette_offset = (tileattr & 0x0f00) >> 4; + bool blend; + bool row_scroll; + bool flip_x; + uint32_t yflipmask; + uint32_t palette_offset; - //palette_offset |= 0x0900; - palette_offset |= 0x0100; + blend = (tileattr & 0x4000 || tilectrl & 0x0100); + row_scroll = (tilectrl & 0x0010); - const uint8_t bpp = tileattr & 0x0003; - if (blend) - { - if (row_scroll) + if ((ctrl_reg & 2) == 0) { - if (flip_x) - draw<BlendOn, RowScrollOn, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); - else - draw<BlendOn, RowScrollOn, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); + flip_x = 0; + yflipmask = 0; + palette_offset = (palette & 0x0f) << 4; } - else + else // jak_car2 uses this mode for sky ingame { - if (flip_x) - draw<BlendOn, RowScrollOff, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); - else - draw<BlendOn, RowScrollOff, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); + flip_x = (tileattr & TILE_X_FLIP); + yflipmask = tileattr & TILE_Y_FLIP ? tile_h - 1 : 0; + palette_offset = (tileattr & 0x0f00) >> 4; + tile |= (palette & 0x0007) << 16; } - } - else - { - if (row_scroll) + + + //palette_offset |= 0x0900; + palette_offset |= 0x0100; + + const uint8_t bpp = tileattr & 0x0003; + + + if (blend) { - if (flip_x) - draw<BlendOff, RowScrollOn, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); + if (row_scroll) + { + if (flip_x) + draw<BlendOn, RowScrollOn, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + else + draw<BlendOn, RowScrollOn, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + } else - draw<BlendOff, RowScrollOn, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); + { + if (flip_x) + draw<BlendOn, RowScrollOff, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + else + draw<BlendOn, RowScrollOff, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + } } else { - if (flip_x) - draw<BlendOff, RowScrollOff, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); + if (row_scroll) + { + if (flip_x) + draw<BlendOff, RowScrollOn, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + else + draw<BlendOff, RowScrollOn, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + } else - draw<BlendOff, RowScrollOff, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, 0); + { + if (flip_x) + draw<BlendOff, RowScrollOff, FlipXOn>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + else + draw<BlendOff, RowScrollOff, FlipXOff>(cliprect, tile_scanline, xx, yy, bitmap_addr, tile, tile_h, tile_w, bpp, yflipmask, palette_offset, use_alt_drawmode); + } } } } @@ -498,7 +673,7 @@ void gcm394_base_video_device::draw_page(const rectangle &cliprect, uint32_t sca void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t base_addr) { - uint32_t bitmap_addr = (m_sprite_702d_gfxbase_msb << 16) | m_sprite_7022_gfxbase_lsb; + uint32_t bitmap_addr = (m_sprite_702d_gfxbase_msb << 16) | m_sprite_7022_gfxbase_lsb; uint32_t tile = m_spriteram[base_addr + 0]; int16_t x = m_spriteram[base_addr + 1]; int16_t y = m_spriteram[base_addr + 2]; @@ -551,7 +726,7 @@ void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t s } bool blend = (attr & 0x4000); - + bool flip_x = false; // different attribute use? @@ -593,21 +768,45 @@ void gcm394_base_video_device::draw_sprites(const rectangle &cliprect, uint32_t uint32_t gcm394_base_video_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - memset(&m_screenbuf[m_screen->width() * cliprect.min_y], 0, 4 * m_screen->width() * ((cliprect.max_y - cliprect.min_y) + 1)); + // For jak_car2 and jak_gtg the palette entry for 'magenta' in the test mode is intentionally set to a transparent black pen + // (it is stored in the palette table in ROM that way, and copied directly) so the only way for the magenta entries on the screen + // to be correctly displayed is if there is a magenta BG pen to fall through to (or for another palette write to change the palette + // that is copied, but this does not appear to be the case). How the bg pen is set is unknown, it is not a regular palette entry. + // The 'bitmap test mode' in jak_car2 requires this to be black instead. - const uint32_t page0_addr = (m_page0_addr_lsb | (m_page0_addr_msb<<16)); - const uint32_t page1_addr = (m_page1_addr_lsb | (m_page1_addr_msb<<16)); - uint16_t* page0_regs = m_tmap0_regs; - uint16_t* page1_regs = m_tmap1_regs; + // jak_s500 briely sets pen 0 of the layer to magenta, but then ends up erasing it + + //const uint16_t bgcol = 0x7c1f; // magenta + const uint16_t bgcol = 0x0000; // black + + + if (m_707f & 0x0010) + { + m_screen->set_visible_area(0, 640-1, 0, 480-1); + } + else + { + m_screen->set_visible_area(0, 320-1, 0, 240-1); + } for (uint32_t scanline = (uint32_t)cliprect.min_y; scanline <= (uint32_t)cliprect.max_y; scanline++) { + uint32_t* bufferline = &m_screenbuf[scanline * m_screen->width()]; + + for (int x = 0; x < m_screen->width(); x++) + { + bufferline[x] = m_rgb555_to_rgb888[bgcol]; + } + for (int i = 0; i < 4; i++) { if (1) { - draw_page(cliprect, scanline, i, page0_addr, page0_regs); - draw_page(cliprect, scanline, i, page1_addr, page1_regs); + draw_page(cliprect, scanline, i, (m_page0_addr_lsb | (m_page0_addr_msb<<16)), m_tmap0_regs, m_tmap0_scroll); + draw_page(cliprect, scanline, i, (m_page1_addr_lsb | (m_page1_addr_msb<<16)), m_tmap1_regs, m_tmap1_scroll); + draw_page(cliprect, scanline, i, (m_page2_addr_lsb | (m_page2_addr_msb<<16)), m_tmap2_regs, m_tmap2_scroll); + draw_page(cliprect, scanline, i, (m_page3_addr_lsb | (m_page3_addr_msb<<16)), m_tmap3_regs, m_tmap3_scroll); + } draw_sprites(cliprect, scanline, i); } @@ -624,183 +823,315 @@ uint32_t gcm394_base_video_device::screen_update(screen_device &screen, bitmap_r } -void gcm394_base_video_device::write_tmap_regs(int tmap, uint16_t* regs, int offset, uint16_t data) +void gcm394_base_video_device::write_tmap_scroll(int tmap, uint16_t* regs, int offset, uint16_t data) { switch (offset) { case 0x0: // Page X scroll - LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d X Scroll = %04x\n", machine().describe_context(), tmap, data & 0x01ff); - regs[offset] = data & 0x01ff; + LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d X Scroll = %04x\n", machine().describe_context(), tmap, data); + regs[offset] = data; break; case 0x1: // Page Y scroll - LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d Y Scroll = %04x\n", machine().describe_context(), tmap, data & 0x00ff); - regs[offset] = data & 0x00ff; + LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d Y Scroll = %04x\n", machine().describe_context(), tmap, data); + regs[offset] = data; break; + } +} - case 0x2: // Page Attributes +void gcm394_base_video_device::write_tmap_regs(int tmap, uint16_t* regs, int offset, uint16_t data) +{ + switch (offset) + { + case 0x0: // Page Attributes LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d Attributes = %04x (unk %01x: Depth:%d, Palette:%d, VSize:%d, HSize:%d, FlipY:%d, FlipX:%d, BPP:%d)\n", machine().describe_context(), tmap, data, (data & 0xc000) >> 14, (data >> 12) & 3, (data >> 8) & 15, 8 << ((data >> 6) & 3), 8 << ((data >> 4) & 3), BIT(data, 3), BIT(data, 2), 2 * ((data & 3) + 1)); regs[offset] = data; break; - case 0x3: // Page Control + case 0x1: // Page Control LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d Control = %04x (unk:%02x Blend:%d, HiColor:%d, unk:%d, unk%d, RowScroll:%d, Enable:%d, Wallpaper:%d, RegSet:%d, Bitmap:%d)\n", machine().describe_context(), tmap, data, (data & 0xfe00) >> 9, BIT(data, 8), BIT(data, 7), BIT(data, 6), BIT(data, 5), BIT(data, 4), BIT(data, 3), BIT(data, 2), BIT(data, 1), BIT(data, 0)); regs[offset] = data; break; - case 0x4: // Page Tile Address + case 0x2: // Page Tile Address LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d Tile Address = %04x\n", machine().describe_context(), tmap, data); regs[offset] = data; break; - case 0x5: // Page Attribute write_tmap_regs + case 0x3: // Page Attribute Address LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d Attribute Address = %04x\n", machine().describe_context(), tmap, data); regs[offset] = data; break; } } + +// offsets 0,1,4,5,6,7 used in main IRQ code +// offsets 2,3 only cleared on startup + +// Based on code analysis this seems to be the same as the regular tilemap regs, except for the addition of regs 2,3 which shift the remaining ones along. +// As the hardware appears to support ROZ these are probably 2 extra tile layers, with the 2 additional words being the ROZ parameters? + + +void gcm394_base_video_device::write_tmap_extrascroll(int tmap, uint16_t* regs, int offset, uint16_t data) +{ + switch (offset) + { + case 0x0: // Page X scroll + case 0x1: // Page Y scroll + write_tmap_scroll(tmap, regs, offset, data); + break; + + case 0x2: // + LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d X Unk Rotation Zoom Attribute1 = %04x\n", machine().describe_context(), tmap, data); + regs[offset] = data; + break; + + case 0x3: + LOGMASKED(LOG_GCM394_TMAP, "%s: write_tmap_regs: Page %d X Unk Rotation Zoom Attribute = %04x\n", machine().describe_context(), tmap, data); + regs[offset] = data; + break; + + } +} + + // **************************************** TILEMAP 0 ************************************************* -READ16_MEMBER(gcm394_base_video_device::tmap0_regs_r) { return m_tmap0_regs[offset]; } +READ16_MEMBER(gcm394_base_video_device::tmap0_regs_r) +{ + if (offset < 2) + { + return m_tmap0_scroll[offset]; + } + else + { + return m_tmap0_regs[offset-2]; + } +} WRITE16_MEMBER(gcm394_base_video_device::tmap0_regs_w) { - LOGMASKED(LOG_GCM394_TMAP, "%s:gcm394_base_video_device::tmap0_regs_w %01x %04x\n", machine().describe_context(), offset, data); - write_tmap_regs(0, m_tmap0_regs, offset, data); + LOGMASKED(LOG_GCM394_TMAP_EXTRA, "%s:gcm394_base_video_device::tmap0_regs_w %01x %04x\n", machine().describe_context(), offset, data); + if (offset < 2) + { + write_tmap_scroll(0, m_tmap0_scroll, offset, data); + } + else + { + write_tmap_regs(0, m_tmap0_regs, offset-2, data); + } +} + +READ16_MEMBER(gcm394_base_video_device::tmap0_tilebase_lsb_r) +{ + return m_page0_addr_lsb; } WRITE16_MEMBER(gcm394_base_video_device::tmap0_tilebase_lsb_w) { LOGMASKED(LOG_GCM394_TMAP, "%s:gcm394_base_video_device::tmap0_tilebase_lsb_w %04x\n", machine().describe_context(), data); m_page0_addr_lsb = data; - LOGMASKED(LOG_GCM394_TMAP, " (tmap0 tilegfxbase is now %04x%04x)\n", m_page0_addr_msb, m_page0_addr_lsb); + LOGMASKED(LOG_GCM394_TMAP, "\t(tmap0 tilegfxbase is now %04x%04x)\n", m_page0_addr_msb, m_page0_addr_lsb); +} + +READ16_MEMBER(gcm394_base_video_device::tmap0_tilebase_msb_r) +{ + return m_page0_addr_msb; } WRITE16_MEMBER(gcm394_base_video_device::tmap0_tilebase_msb_w) { LOGMASKED(LOG_GCM394_TMAP, "%s:gcm394_base_video_device::tmap0_tilebase_msb_w %04x\n", machine().describe_context(), data); m_page0_addr_msb = data; - LOGMASKED(LOG_GCM394_TMAP, " (tmap0 tilegfxbase is now %04x%04x)\n", m_page0_addr_msb, m_page0_addr_lsb); + LOGMASKED(LOG_GCM394_TMAP, "\t(tmap0 tilegfxbase is now %04x%04x)\n", m_page0_addr_msb, m_page0_addr_lsb); } // **************************************** TILEMAP 1 ************************************************* -READ16_MEMBER(gcm394_base_video_device::tmap1_regs_r) { return m_tmap1_regs[offset]; } + +READ16_MEMBER(gcm394_base_video_device::tmap1_regs_r) +{ + if (offset < 2) + { + return m_tmap1_scroll[offset]; + } + else + { + return m_tmap1_regs[offset-2]; + } +} WRITE16_MEMBER(gcm394_base_video_device::tmap1_regs_w) { - LOGMASKED(LOG_GCM394_TMAP, "%s:gcm394_base_video_device::tmap1_regs_w %01x %04x\n", machine().describe_context(), offset, data); - write_tmap_regs(1, m_tmap1_regs, offset, data); + LOGMASKED(LOG_GCM394_TMAP_EXTRA, "%s:gcm394_base_video_device::tmap1_regs_w %01x %04x\n", machine().describe_context(), offset, data); + if (offset < 2) + { + write_tmap_scroll(1, m_tmap1_scroll, offset, data); + } + else + { + write_tmap_regs(1, m_tmap1_regs, offset-2, data); + } +} + +READ16_MEMBER(gcm394_base_video_device::tmap1_tilebase_lsb_r) +{ + return m_page1_addr_lsb; } WRITE16_MEMBER(gcm394_base_video_device::tmap1_tilebase_lsb_w) { LOGMASKED(LOG_GCM394_TMAP, "%s:gcm394_base_video_device::tmap1_tilebase_lsb_w %04x\n", machine().describe_context(), data); m_page1_addr_lsb = data; - LOGMASKED(LOG_GCM394_TMAP, " (tmap1 tilegfxbase is now %04x%04x)\n", m_page1_addr_msb, m_page1_addr_lsb); + LOGMASKED(LOG_GCM394_TMAP, "\t(tmap1 tilegfxbase is now %04x%04x)\n", m_page1_addr_msb, m_page1_addr_lsb); +} + +READ16_MEMBER(gcm394_base_video_device::tmap1_tilebase_msb_r) +{ + return m_page1_addr_msb; } WRITE16_MEMBER(gcm394_base_video_device::tmap1_tilebase_msb_w) { LOGMASKED(LOG_GCM394_TMAP, "%s:gcm394_base_video_device::tmap1_tilebase_msb_w %04x\n", machine().describe_context(), data); m_page1_addr_msb = data; - LOGMASKED(LOG_GCM394_TMAP, " (tmap1 tilegfxbase is now %04x%04x)\n", m_page1_addr_msb, m_page1_addr_lsb); + LOGMASKED(LOG_GCM394_TMAP, "\t(tmap1 tilegfxbase is now %04x%04x)\n", m_page1_addr_msb, m_page1_addr_lsb); } -// **************************************** unknown video device handler for below ************************************************* - -// offsets 0,1,4,5,6,7 used in main IRQ code -// offsets 2,3 only cleared on startup +// **************************************** unknown video device 1 (another tilemap? roz? line? zooming sprite layer?) ************************************************* -// Based on code analysis this seems to be the same as the regular tilemap regs, except for the addition of regs 2,3 which shift the remaining ones along. -// As the hardware appears to support ROZ these are probably 2 extra tile layers, with the 2 additional words being the ROZ parameters? -void gcm394_base_video_device::unk_vid_regs_w(int which, int offset, uint16_t data) +READ16_MEMBER(gcm394_base_video_device::tmap2_regs_r) { - switch (offset) + if (offset < 4) { - case 0x0: - LOGMASKED(LOG_GCM394_VIDEO, "%s: unk_vid_regs_w (unk chip %d) (offset %01x) (data %04x) (X scroll?)\n", machine().describe_context(), which, offset, data); // masked with 0x3ff in code like x-scroll for tilemaps - break; - case 0x1: - LOGMASKED(LOG_GCM394_VIDEO, "%s: unk_vid_regs_w (unk chip %d) (offset %01x) (data %04x) (y scroll?)\n", machine().describe_context(), which, offset, data); // masked with 0x3ff in code like x-scroll for tilemaps - break; - - case 0x05: // seems to be similar / the same as Page Control for tilemaps (written with same basic code, but for these layers) - LOGMASKED(LOG_GCM394_VIDEO, "%s: unk_vid_regs_w (unk chip %d) (offset %01x) (data %04x) (Page Control?)\n", machine().describe_context(), which, offset, data); - break; - - case 0x02: // startup? - case 0x03: // startup? - case 0x04: - case 0x06: - case 0x07: - LOGMASKED(LOG_GCM394_VIDEO, "%s: unk_vid_regs_w (unk chip %d) (offset %01x) (data %04x)\n", machine().describe_context(), which, offset, data); - break; + return m_tmap2_scroll[offset]; + } + else + { + return m_tmap2_regs[offset-4]; + } +} +WRITE16_MEMBER(gcm394_base_video_device::tmap2_regs_w) +{ + LOGMASKED(LOG_GCM394_TMAP_EXTRA, "%s:gcm394_base_video_device::tmap2_regs_w %01x %04x\n", machine().describe_context(), offset, data); + if (offset < 4) + { + write_tmap_extrascroll(2, m_tmap2_scroll, offset, data); + } + else + { + write_tmap_regs(2, m_tmap2_regs, offset-4, data); } } -// **************************************** unknown video device 1 (another tilemap? roz? line? zooming sprite layer?) ************************************************* +READ16_MEMBER(gcm394_base_video_device::tmap2_tilebase_lsb_r) +{ + return m_page2_addr_lsb; +} -WRITE16_MEMBER(gcm394_base_video_device::unk_vid1_regs_w) + +WRITE16_MEMBER(gcm394_base_video_device::tmap2_tilebase_lsb_w) { - unk_vid_regs_w(0, offset, data); + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::tmap2_tilebase_lsb_w %04x\n", machine().describe_context(), data); + m_page2_addr_lsb = data; + LOGMASKED(LOG_GCM394_TMAP, "\t(unk_vid1 tilegfxbase is now %04x%04x)\n", m_page2_addr_msb, m_page2_addr_lsb); } -WRITE16_MEMBER(gcm394_base_video_device::unk_vid1_gfxbase_lsb_w) +READ16_MEMBER(gcm394_base_video_device::tmap2_tilebase_msb_r) { - LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::unk_vid1_gfxbase_lsb_w %04x\n", machine().describe_context(), data); - m_unk_vid1_gfxbase_lsb = data; - LOGMASKED(LOG_GCM394_TMAP, " (unk_vid1 tilegfxbase is now %04x%04x)\n", m_unk_vid1_gfxbase_msb, m_unk_vid1_gfxbase_lsb); + return m_page2_addr_msb; } -WRITE16_MEMBER(gcm394_base_video_device::unk_vid1_gfxbase_msb_w) +WRITE16_MEMBER(gcm394_base_video_device::tmap2_tilebase_msb_w) { - LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::unk_vid1_gfxbase_msb_w %04x\n", machine().describe_context(), data); - m_unk_vid1_gfxbase_msb = data; - LOGMASKED(LOG_GCM394_TMAP, " (unk_vid1 tilegfxbase is now %04x%04x)\n", m_unk_vid1_gfxbase_msb, m_unk_vid1_gfxbase_lsb); + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::tmap2_tilebase_msb_w %04x\n", machine().describe_context(), data); + m_page2_addr_msb = data; + LOGMASKED(LOG_GCM394_TMAP, "\t(unk_vid1 tilegfxbase is now %04x%04x)\n", m_page2_addr_msb, m_page2_addr_lsb); } // **************************************** unknown video device 2 (another tilemap? roz? lines? zooming sprite layer?) ************************************************* -WRITE16_MEMBER(gcm394_base_video_device::unk_vid2_regs_w) +READ16_MEMBER(gcm394_base_video_device::tmap3_regs_r) +{ + if (offset < 4) + { + return m_tmap3_scroll[offset]; + } + else + { + return m_tmap3_regs[offset-4]; + } +} + +WRITE16_MEMBER(gcm394_base_video_device::tmap3_regs_w) { - unk_vid_regs_w(1, offset, data); + LOGMASKED(LOG_GCM394_TMAP_EXTRA, "%s:gcm394_base_video_device::tmap3_regs_w %01x %04x\n", machine().describe_context(), offset, data); + if (offset < 4) + { + write_tmap_extrascroll(3, m_tmap3_scroll, offset, data); + } + else + { + write_tmap_regs(3, m_tmap3_regs, offset-4, data); + } } -WRITE16_MEMBER(gcm394_base_video_device::unk_vid2_gfxbase_lsb_w) +READ16_MEMBER(gcm394_base_video_device::tmap3_tilebase_lsb_r) { - LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::unk_vid2_gfxbase_lsb_w %04x\n", machine().describe_context(), data); - m_unk_vid2_gfxbase_lsb = data; - LOGMASKED(LOG_GCM394_TMAP, " (unk_vid2 tilegfxbase is now %04x%04x)\n", m_unk_vid2_gfxbase_msb, m_unk_vid2_gfxbase_lsb); + return m_page3_addr_lsb; } -WRITE16_MEMBER(gcm394_base_video_device::unk_vid2_gfxbase_msb_w) + +WRITE16_MEMBER(gcm394_base_video_device::tmap3_tilebase_lsb_w) { - LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::unk_vid2_gfxbase_msb_w %04x\n", machine().describe_context(), data); - m_unk_vid2_gfxbase_msb = data; - LOGMASKED(LOG_GCM394_TMAP, " (unk_vid2 tilegfxbase is now %04x%04x)\n", m_unk_vid2_gfxbase_msb, m_unk_vid2_gfxbase_lsb); + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::tmap3_tilebase_lsb_w %04x\n", machine().describe_context(), data); + m_page3_addr_lsb = data; + LOGMASKED(LOG_GCM394_TMAP, "\t(unk_vid2 tilegfxbase is now %04x%04x)\n", m_page3_addr_msb, m_page3_addr_lsb); +} + +READ16_MEMBER(gcm394_base_video_device::tmap3_tilebase_msb_r) +{ + return m_page3_addr_msb; +} + + +WRITE16_MEMBER(gcm394_base_video_device::tmap3_tilebase_msb_w) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::tmap3_tilebase_msb_w %04x\n", machine().describe_context(), data); + m_page3_addr_msb = data; + LOGMASKED(LOG_GCM394_TMAP, "\t(unk_vid2 tilegfxbase is now %04x%04x)\n", m_page3_addr_msb, m_page3_addr_lsb); } // **************************************** sprite control registers ************************************************* // set to 001264c0 in wrlshunt, which point at the menu selectors (game names, arrows etc.) +READ16_MEMBER(gcm394_base_video_device::sprite_7022_gfxbase_lsb_r) +{ + return m_sprite_7022_gfxbase_lsb; +} + WRITE16_MEMBER(gcm394_base_video_device::sprite_7022_gfxbase_lsb_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::sprite_7022_gfxbase_lsb_w %04x\n", machine().describe_context(), data); m_sprite_7022_gfxbase_lsb = data; - LOGMASKED(LOG_GCM394_TMAP, " (sprite tilebase is now %04x%04x)\n", m_sprite_702d_gfxbase_msb, m_sprite_7022_gfxbase_lsb); + LOGMASKED(LOG_GCM394_TMAP, "\t(sprite tilebase is now %04x%04x)\n", m_sprite_702d_gfxbase_msb, m_sprite_7022_gfxbase_lsb); +} + +READ16_MEMBER(gcm394_base_video_device::sprite_702d_gfxbase_msb_r) +{ + return m_sprite_702d_gfxbase_msb; } WRITE16_MEMBER(gcm394_base_video_device::sprite_702d_gfxbase_msb_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::sprite_702d_gfxbase_msb_w %04x\n", machine().describe_context(), data); m_sprite_702d_gfxbase_msb = data; - LOGMASKED(LOG_GCM394_TMAP, " (sprite tilebase tilegfxbase is now %04x%04x)\n", m_sprite_702d_gfxbase_msb, m_sprite_7022_gfxbase_lsb); + LOGMASKED(LOG_GCM394_TMAP, "\t(sprite tilebase tilegfxbase is now %04x%04x)\n", m_sprite_702d_gfxbase_msb, m_sprite_7022_gfxbase_lsb); } READ16_MEMBER(gcm394_base_video_device::sprite_7042_extra_r) @@ -855,12 +1186,12 @@ WRITE16_MEMBER(gcm394_base_video_device::video_dma_size_trigger_w) WRITE16_MEMBER(gcm394_base_video_device::video_dma_unk_w) { - LOGMASKED(LOG_GCM394_VIDEO_DMA, "%s:gcm394_base_video_device::video_dma_unk_w %04x\n", machine().describe_context(), data); + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_dma_unk_w %04x\n", machine().describe_context(), data); m_707e_videodma_bank = data; } READ16_MEMBER(gcm394_base_video_device::video_707c_r) -{ +{ LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_707c_r\n", machine().describe_context()); return 0x8000; } @@ -914,11 +1245,11 @@ WRITE16_MEMBER(gcm394_base_video_device::video_707f_w) { if (data & mask) { - LOGMASKED(LOG_GCM394_VIDEO, " bit %04x Low -> High\n", mask); + LOGMASKED(LOG_GCM394_VIDEO, "\tbit %04x Low -> High\n", mask); } else { - LOGMASKED(LOG_GCM394_VIDEO, " bit %04x High -> Low\n", mask); + LOGMASKED(LOG_GCM394_VIDEO, "\tbit %04x High -> Low\n", mask); } } } @@ -938,11 +1269,20 @@ WRITE16_MEMBER(gcm394_base_video_device::video_703a_palettebank_w) m_703a_palettebank = data; } -READ16_MEMBER(gcm394_base_video_device::video_7062_r) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_7062_r\n", machine().describe_context()); return m_7062; } -WRITE16_MEMBER(gcm394_base_video_device::video_7062_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_7062_w %04x\n", machine().describe_context(), data); m_7062 = data; } +READ16_MEMBER(gcm394_base_video_device::videoirq_source_enable_r) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::videoirq_source_enable_r\n", machine().describe_context()); + return m_7062; +} + +WRITE16_MEMBER(gcm394_base_video_device::videoirq_source_enable_w) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::videoirq_source_enable_w %04x\n", machine().describe_context(), data); + m_7062 = data; +} READ16_MEMBER(gcm394_base_video_device::video_7063_videoirq_source_r) -{ +{ LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_7063_videoirq_source_r\n", machine().describe_context()); return machine().rand(); } @@ -961,7 +1301,17 @@ WRITE16_MEMBER(gcm394_base_video_device::video_7063_videoirq_source_ack_w) } } -WRITE16_MEMBER(gcm394_base_video_device::video_702a_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_702a_w %04x\n", machine().describe_context(), data); m_702a = data; } +WRITE16_MEMBER(gcm394_base_video_device::video_702a_w) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_702a_w %04x\n", machine().describe_context(), data); + m_702a = data; +} + +READ16_MEMBER(gcm394_base_video_device::video_curline_r) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s: video_r: Current Line: %04x\n", machine().describe_context(), m_screen->vpos()); + return m_screen->vpos(); +} // read in IRQ READ16_MEMBER(gcm394_base_video_device::video_7030_brightness_r) @@ -981,7 +1331,17 @@ WRITE16_MEMBER(gcm394_base_video_device::video_7030_brightness_w) m_7030_brightness = data; } -WRITE16_MEMBER(gcm394_base_video_device::video_703c_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_703c_w %04x\n", machine().describe_context(), data); m_703c = data; } +READ16_MEMBER(gcm394_base_video_device::video_703c_tvcontrol1_r) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_703c_tvcontrol1_r\n", machine().describe_context()); + return m_703c_tvcontrol1; +} + +WRITE16_MEMBER(gcm394_base_video_device::video_703c_tvcontrol1_w) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_703c_tvcontrol1_w %04x\n", machine().describe_context(), data); + m_703c_tvcontrol1 = data; +} READ16_MEMBER(gcm394_base_video_device::video_7051_r) { @@ -1008,7 +1368,7 @@ WRITE16_MEMBER(gcm394_base_video_device::spriteram_w) { // transfers an additional word for each sprite with this bit set (smartfp) or an entire extra bank (wrlshunt) // wrlshunt instead seems to base if it writes the extra data based on 707f so maybe this is more complex than banking - + // however for 707e only 0/1 is written, and it also gets written before system DMA, so despite being in the video DMA // region seems to operate separate from that. @@ -1045,7 +1405,7 @@ READ16_MEMBER(gcm394_base_video_device::spriteram_r) WRITE16_MEMBER(gcm394_base_video_device::palette_w) { - LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::palette_w %04x : %04x (value of 0x703a is %04x)\n", machine().describe_context(), offset, data, m_703a_palettebank); + LOGMASKED(LOG_GCM394_VIDEO_PALETTE, "%s:gcm394_base_video_device::palette_w %04x : %04x (value of 0x703a is %04x)\n", machine().describe_context(), offset, data, m_703a_palettebank); if (m_703a_palettebank & 0xfff0) { @@ -1079,6 +1439,11 @@ READ16_MEMBER(gcm394_base_video_device::palette_r) } } +WRITE16_MEMBER(gcm394_base_video_device::video_701c_w) +{ + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_701c_w %04x\n", machine().describe_context(), data); +} + void gcm394_base_video_device::check_video_irq() { diff --git a/src/devices/machine/sunplus_gcm394_video.h b/src/devices/machine/sunplus_gcm394_video.h index fe80a81b59d..e0f5ccc6a2f 100644 --- a/src/devices/machine/sunplus_gcm394_video.h +++ b/src/devices/machine/sunplus_gcm394_video.h @@ -25,25 +25,44 @@ public: auto space_read_callback() { return m_space_read_cb.bind(); } + void write_tmap_scroll(int tmap, uint16_t* regs, int offset, uint16_t data); + void write_tmap_extrascroll(int tmap, uint16_t* regs, int offset, uint16_t data); + void write_tmap_regs(int tmap, uint16_t* regs, int offset, uint16_t data); + void set_paldisplaybank_high(int pal_displaybank_high) { m_pal_displaybank_high = pal_displaybank_high; } + void set_alt_tile_addressing(int alt_tile_addressing) { m_alt_tile_addressing = alt_tile_addressing; } + DECLARE_READ16_MEMBER(tmap0_regs_r); DECLARE_WRITE16_MEMBER(tmap0_regs_w); + DECLARE_READ16_MEMBER(tmap0_tilebase_lsb_r); + DECLARE_READ16_MEMBER(tmap0_tilebase_msb_r); DECLARE_WRITE16_MEMBER(tmap0_tilebase_lsb_w); DECLARE_WRITE16_MEMBER(tmap0_tilebase_msb_w); DECLARE_READ16_MEMBER(tmap1_regs_r); DECLARE_WRITE16_MEMBER(tmap1_regs_w); + DECLARE_READ16_MEMBER(tmap1_tilebase_lsb_r); + DECLARE_READ16_MEMBER(tmap1_tilebase_msb_r); DECLARE_WRITE16_MEMBER(tmap1_tilebase_lsb_w); DECLARE_WRITE16_MEMBER(tmap1_tilebase_msb_w); - DECLARE_WRITE16_MEMBER(unk_vid1_regs_w); - DECLARE_WRITE16_MEMBER(unk_vid1_gfxbase_lsb_w); - DECLARE_WRITE16_MEMBER(unk_vid1_gfxbase_msb_w); + DECLARE_READ16_MEMBER(tmap2_regs_r); + DECLARE_WRITE16_MEMBER(tmap2_regs_w); + DECLARE_READ16_MEMBER(tmap2_tilebase_lsb_r); + DECLARE_READ16_MEMBER(tmap2_tilebase_msb_r); + DECLARE_WRITE16_MEMBER(tmap2_tilebase_lsb_w); + DECLARE_WRITE16_MEMBER(tmap2_tilebase_msb_w); + + DECLARE_READ16_MEMBER(tmap3_regs_r); + DECLARE_WRITE16_MEMBER(tmap3_regs_w); + DECLARE_READ16_MEMBER(tmap3_tilebase_lsb_r); + DECLARE_READ16_MEMBER(tmap3_tilebase_msb_r); + DECLARE_WRITE16_MEMBER(tmap3_tilebase_lsb_w); + DECLARE_WRITE16_MEMBER(tmap3_tilebase_msb_w); - DECLARE_WRITE16_MEMBER(unk_vid2_regs_w); - DECLARE_WRITE16_MEMBER(unk_vid2_gfxbase_lsb_w); - DECLARE_WRITE16_MEMBER(unk_vid2_gfxbase_msb_w); + DECLARE_READ16_MEMBER(sprite_7022_gfxbase_lsb_r); + DECLARE_READ16_MEMBER(sprite_702d_gfxbase_msb_r); DECLARE_WRITE16_MEMBER(sprite_7022_gfxbase_lsb_w); DECLARE_WRITE16_MEMBER(sprite_702d_gfxbase_msb_w); @@ -59,8 +78,8 @@ public: DECLARE_READ16_MEMBER(video_703a_palettebank_r); DECLARE_WRITE16_MEMBER(video_703a_palettebank_w); - DECLARE_READ16_MEMBER(video_7062_r); - DECLARE_WRITE16_MEMBER(video_7062_w); + DECLARE_READ16_MEMBER(videoirq_source_enable_r); + DECLARE_WRITE16_MEMBER(videoirq_source_enable_w); DECLARE_READ16_MEMBER(video_7063_videoirq_source_r); DECLARE_WRITE16_MEMBER(video_7063_videoirq_source_ack_w); @@ -68,7 +87,10 @@ public: DECLARE_WRITE16_MEMBER(video_702a_w); DECLARE_READ16_MEMBER(video_7030_brightness_r); DECLARE_WRITE16_MEMBER(video_7030_brightness_w); - DECLARE_WRITE16_MEMBER(video_703c_w); + DECLARE_READ16_MEMBER(video_curline_r); + + DECLARE_READ16_MEMBER(video_703c_tvcontrol1_r); + DECLARE_WRITE16_MEMBER(video_703c_tvcontrol1_w); DECLARE_READ16_MEMBER(video_707c_r); @@ -94,6 +116,7 @@ public: DECLARE_READ16_MEMBER(spriteram_r); DECLARE_READ16_MEMBER(video_7051_r); + DECLARE_WRITE16_MEMBER(video_701c_w); auto write_video_irq_callback() { return m_video_irq_cb.bind(); }; @@ -146,7 +169,7 @@ protected: template<blend_enable_t Blend, rowscroll_enable_t RowScroll, flipx_t FlipX> void draw(const rectangle &cliprect, uint32_t line, uint32_t xoff, uint32_t yoff, uint32_t bitmap_addr, uint32_t tile, int32_t h, int32_t w, uint8_t bpp, uint32_t yflipmask, uint32_t palette_offset, int addressing_mode); - void draw_page(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t *regs); + void draw_page(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t *regs, uint16_t *scroll); void draw_sprites(const rectangle& cliprect, uint32_t scanline, int priority); void draw_sprite(const rectangle& cliprect, uint32_t scanline, int priority, uint32_t base_addr); @@ -173,8 +196,19 @@ protected: // video 70xx - uint16_t m_tmap0_regs[0x6]; - uint16_t m_tmap1_regs[0x6]; + uint16_t m_tmap0_regs[0x4]; + uint16_t m_tmap1_regs[0x4]; + + uint16_t m_tmap2_regs[0x4]; + uint16_t m_tmap3_regs[0x4]; + + + uint16_t m_tmap0_scroll[0x2]; + uint16_t m_tmap1_scroll[0x2]; + + uint16_t m_tmap2_scroll[0x4]; + uint16_t m_tmap3_scroll[0x4]; + uint16_t m_707f; uint16_t m_703a_palettebank; @@ -183,7 +217,7 @@ protected: uint16_t m_702a; uint16_t m_7030_brightness; - uint16_t m_703c; + uint16_t m_703c_tvcontrol1; uint16_t m_7042_sprite; @@ -199,10 +233,10 @@ protected: uint16_t m_sprite_7022_gfxbase_lsb; uint16_t m_sprite_702d_gfxbase_msb; - uint16_t m_unk_vid1_gfxbase_lsb; - uint16_t m_unk_vid1_gfxbase_msb; - uint16_t m_unk_vid2_gfxbase_lsb; - uint16_t m_unk_vid2_gfxbase_msb; + uint16_t m_page2_addr_lsb; + uint16_t m_page2_addr_msb; + uint16_t m_page3_addr_lsb; + uint16_t m_page3_addr_msb; void unk_vid_regs_w(int which, int offset, uint16_t data); @@ -216,9 +250,16 @@ protected: required_device<gfxdecode_device> m_gfxdecode; devcb_read16 m_space_read_cb; + required_shared_ptr<uint16_t> m_rowscroll; + required_shared_ptr<uint16_t> m_rowzoom; + int m_maxgfxelement; void decodegfx(const char* tag); + int m_global_y_mask; + + int m_pal_displaybank_high; + int m_alt_tile_addressing; }; class gcm394_video_device : public gcm394_base_video_device diff --git a/src/devices/machine/tms9901.cpp b/src/devices/machine/tms9901.cpp index bb7148a91a6..b5ec6278865 100644 --- a/src/devices/machine/tms9901.cpp +++ b/src/devices/machine/tms9901.cpp @@ -147,7 +147,7 @@ Clock mode: #include "emu.h" #include "tms9901.h" -#include <math.h> +#include <cmath> #define LOG_GENERAL (1U << 0) #define LOG_PINS (1U << 1) diff --git a/src/devices/machine/tms9902.cpp b/src/devices/machine/tms9902.cpp index 813372f6f22..b6f8e4279c9 100644 --- a/src/devices/machine/tms9902.cpp +++ b/src/devices/machine/tms9902.cpp @@ -41,7 +41,7 @@ #include "emu.h" #include "tms9902.h" -#include <math.h> +#include <cmath> #define LOG_GENERAL (1U << 0) #define LOG_LINES (1U << 1) diff --git a/src/devices/machine/vic_pl192.cpp b/src/devices/machine/vic_pl192.cpp new file mode 100644 index 00000000000..7eda1220987 --- /dev/null +++ b/src/devices/machine/vic_pl192.cpp @@ -0,0 +1,130 @@ +// license:BSD-3-Clause +// copyright-holders:Melissa Goad + +// ARM PrimeCell PL192 VIC emulation + +#include "emu.h" +#include "machine/bankdev.h" +#include "machine/vic_pl192.h" + +#define LOG_GENERAL (1U << 0) + +#define VERBOSE (LOG_GENERAL) +#include "logmacro.h" + +void vic_pl192_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + if(u32 intrs = (raw_intr | soft_intr) & intr_en) + { + if(intrs & intr_select) m_out_fiq_func(1); + else m_out_fiq_func(0); + + if(intrs & ~intr_select) m_out_irq_func(1); + else m_out_irq_func(0); + } +} + +void vic_pl192_device::set_irq_line(int irq, int state) +{ + u32 mask = (1 << irq); + + if(state) + { + raw_intr |= mask; + } + else + { + raw_intr &= ~mask; + } + + timer_set(attotime::zero, TIMER_CHECK_IRQ); +} + +void vic_pl192_device::map(address_map &map) +{ + map(0x000, 0x003).lr32([this](offs_t offset){ return raw_intr & ~intr_select; }, "irq_status"); //IRQ_STATUS + map(0x004, 0x007).lr32([this](offs_t offset){ return raw_intr & intr_select; }, "fiq_status"); //FIQ_STATUS + map(0x008, 0x00b).lr32([this](offs_t offset){ return raw_intr; }, "raw_intr"); + map(0x00c, 0x00f).lrw32(NAME([this](offs_t offset){ return intr_select; }), NAME([this](offs_t offset, u32 data){ intr_select = data; timer_set(attotime::zero, TIMER_CHECK_IRQ); })); + map(0x010, 0x013).lrw32(NAME([this](offs_t offset){ return intr_en; }), NAME([this](offs_t offset, u32 data){ intr_en = data; timer_set(attotime::zero, TIMER_CHECK_IRQ); })); + map(0x014, 0x017).lw32([this](u32 data){ intr_en &= ~data; }, "intr_en_clear"); + map(0x018, 0x01b).lrw32(NAME([this](offs_t offset){ return soft_intr; }), NAME([this](offs_t offset, u32 data){ soft_intr = data; timer_set(attotime::zero, TIMER_CHECK_IRQ); })); + map(0x01c, 0x01f).lw32([this](u32 data){ soft_intr &= ~data; }, "soft_intr_clear"); + map(0x020, 0x020).lrw8(NAME([this](offs_t offset){ return protection; }), NAME([this](offs_t offset, u8 data){ protection = data & 1; })).umask32(0x000000ff); + map(0x024, 0x025).lrw8(NAME([this](offs_t offset){ return sw_priority_mask; }), NAME([this](offs_t offset, u16 data){ sw_priority_mask = data; })).umask32(0x0000ffff); + map(0x028, 0x028).lrw8(NAME([this](offs_t offset){ return daisy_priority; }), NAME([this](offs_t offset, u8 data){ daisy_priority = data & 0xf; })).umask32(0x000000ff); + map(0x100, 0x17f).lrw32(NAME([this](offs_t offset){ return vectaddr[(offset & 0x7c) >> 2]; }), NAME([this](offs_t offset, u32 data){ vectaddr[(offset & 0x7c) >> 2] = data; })); + map(0x200, 0x27f).lrw8(NAME([this](offs_t offset){ return vectprio[(offset & 0x7c) >> 2]; }), NAME([this](offs_t offset, u32 data){ vectprio[(offset & 0x7c) >> 2] = data & 0xf; })); + map(0xf00, 0xf03).lrw32(NAME([this](offs_t offset){ return vicaddress; }), NAME([this](offs_t offset, u32 data){ vectaddr[(offset & 0x7c) >> 2] = data; })); + map(0xfe0, 0xfe0).lr8([this](offs_t offset){ return periph_id[0]; }, "periph_id0").umask32(0x000000ff); + map(0xfe4, 0xfe4).lr8([this](offs_t offset){ return periph_id[1]; }, "periph_id1").umask32(0x000000ff); + map(0xfe8, 0xfe8).lr8([this](offs_t offset){ return periph_id[2]; }, "periph_id2").umask32(0x000000ff); + map(0xfec, 0xfec).lr8([this](offs_t offset){ return periph_id[3]; }, "periph_id3").umask32(0x000000ff); + map(0xff0, 0xff0).lr8([this](offs_t offset){ return pcell_id[0]; }, "pcell_id0").umask32(0x000000ff); + map(0xff4, 0xff4).lr8([this](offs_t offset){ return pcell_id[1]; }, "pcell_id1").umask32(0x000000ff); + map(0xff8, 0xff8).lr8([this](offs_t offset){ return pcell_id[2]; }, "pcell_id2").umask32(0x000000ff); + map(0xffc, 0xffc).lr8([this](offs_t offset){ return pcell_id[3]; }, "pcell_id3").umask32(0x000000ff); +} + +device_memory_interface::space_config_vector vic_pl192_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(0, &m_mmio_config) + }; +} + +void vic_pl192_device::device_resolve_objects() +{ + // resolve callbacks + m_out_irq_func.resolve_safe(); + m_out_fiq_func.resolve_safe(); +} + +void vic_pl192_device::device_start() +{ + save_item(NAME(raw_intr)); + save_item(NAME(intr_select)); + save_item(NAME(intr_en)); + save_item(NAME(soft_intr)); + save_item(NAME(vectaddr)); + save_item(NAME(vicaddress)); + save_item(NAME(protection)); + save_item(NAME(sw_priority_mask)); + save_item(NAME(daisy_priority)); + save_item(NAME(vectprio)); +} + +void vic_pl192_device::device_reset() +{ + raw_intr = intr_select = intr_en = soft_intr = vicaddress = protection = 0; + sw_priority_mask = 0xffff; + daisy_priority = 0xf; + + for(int i = 0; i < 32; i++) + { + vectaddr[i] = 0; + } + + for(int i = 0; i < 32; i++) + { + vectprio[i] = 0xf; + } +} + +DEFINE_DEVICE_TYPE(PL192_VIC, vic_pl192_device, "vic_pl192", "ARM PL192 VIC") + +vic_pl192_device::vic_pl192_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_mmio_config("mmio", ENDIANNESS_LITTLE, 32, 32, 0) + , m_out_irq_func(*this) + , m_out_fiq_func(*this) + , periph_id{0x92, 0x11, 0x04, 0x00} + , pcell_id{0x0d, 0xf0, 0x05, 0xb1} +{ +} + +vic_pl192_device::vic_pl192_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vic_pl192_device(mconfig, PL192_VIC, tag, owner, clock) +{ +}
\ No newline at end of file diff --git a/src/devices/machine/vic_pl192.h b/src/devices/machine/vic_pl192.h new file mode 100644 index 00000000000..79a40bd38ee --- /dev/null +++ b/src/devices/machine/vic_pl192.h @@ -0,0 +1,51 @@ +// license:BSD-3-Clause +// copyright-holders:Melissa Goad + +// ARM PrimeCell PL192 VIC emulation + +#ifndef MAME_MACHINE_VIC_PL192_H +#define MAME_MACHINE_VIC_PL192_H + +class vic_pl192_device : public device_t, public device_memory_interface +{ +public: + vic_pl192_device(const machine_config &mconfig, const char* tag, device_t *owner, uint32_t clock = 0); + + auto out_irq_cb() { return m_out_irq_func.bind(); } + auto out_fiq_cb() { return m_out_fiq_func.bind(); } + + template<unsigned IRQ> + DECLARE_WRITE_LINE_MEMBER( irq_w ) { set_irq_line(IRQ, state); } + + void map(address_map &map); + +protected: + vic_pl192_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + virtual space_config_vector memory_space_config() const override; + +private: + static constexpr device_timer_id TIMER_CHECK_IRQ = 0; + + void set_irq_line(int irq, int state); + + address_space_config m_mmio_config; + + devcb_write_line m_out_irq_func; + devcb_write_line m_out_fiq_func; + u32 raw_intr, intr_select, intr_en, soft_intr, vectaddr[32], vicaddress; + int protection; + u16 sw_priority_mask; + u8 daisy_priority, vectprio[32]; + u8 periph_id[4], pcell_id[4]; +}; + +DECLARE_DEVICE_TYPE(PL192_VIC, vic_pl192_device) + +#endif // MAME_MACHINE_VIC_PL192_H
\ No newline at end of file diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp index 76442866a6d..ef00ccc6ee1 100644 --- a/src/devices/machine/vrender0.cpp +++ b/src/devices/machine/vrender0.cpp @@ -98,9 +98,19 @@ void vrender0soc_device::regs_map(address_map &map) void vrender0soc_device::audiovideo_map(address_map &map) { map(0x00000000, 0x0000ffff).m(m_vr0vid, FUNC(vr0video_device::regs_map)); - map(0x00800000, 0x00ffffff).rw(FUNC(vrender0soc_device::textureram_r), FUNC(vrender0soc_device::textureram_w)); - map(0x01000000, 0x017fffff).rw(FUNC(vrender0soc_device::frameram_r), FUNC(vrender0soc_device::frameram_w)); - map(0x01800000, 0x01800fff).rw(m_vr0snd, FUNC(vr0sound_device::vr0_snd_read), FUNC(vr0sound_device::vr0_snd_write)); + map(0x00800000, 0x00ffffff).m(FUNC(vrender0soc_device::texture_map)); + map(0x01000000, 0x017fffff).m(FUNC(vrender0soc_device::frame_map)); + map(0x01800000, 0x01800fff).m(m_vr0snd, FUNC(vr0sound_device::sound_map)); +} + +void vrender0soc_device::texture_map(address_map &map) +{ + map(0x000000, 0x7fffff).rw(FUNC(vrender0soc_device::textureram_r), FUNC(vrender0soc_device::textureram_w)); +} + +void vrender0soc_device::frame_map(address_map &map) +{ + map(0x000000, 0x7fffff).rw(FUNC(vrender0soc_device::frameram_r), FUNC(vrender0soc_device::frameram_w)); } //------------------------------------------------- @@ -130,7 +140,10 @@ void vrender0soc_device::device_add_mconfig(machine_config &config) SPEAKER(config, m_lspeaker).front_left(); SPEAKER(config, m_rspeaker).front_right(); - SOUND_VRENDER0(config, m_vr0snd, 0); + SOUND_VRENDER0(config, m_vr0snd, DERIVED_CLOCK(1,1)); // Correct? + m_vr0snd->set_addrmap(vr0sound_device::AS_TEXTURE, &vrender0soc_device::texture_map); + m_vr0snd->set_addrmap(vr0sound_device::AS_FRAME, &vrender0soc_device::frame_map); + m_vr0snd->irq_callback().set(FUNC(vrender0soc_device::soundirq_cb)); m_vr0snd->add_route(0, m_lspeaker, 1.0); m_vr0snd->add_route(1, m_rspeaker, 1.0); } @@ -147,7 +160,6 @@ void vrender0soc_device::device_start() m_frameram = auto_alloc_array_clear(machine(), uint16_t, 0x00800000/2); m_vr0vid->set_areas(m_textureram, m_frameram); - m_vr0snd->set_areas(m_textureram, m_frameram); m_host_space = &m_host_cpu->space(AS_PROGRAM); if (this->clock() == 0) @@ -326,6 +338,14 @@ int vrender0soc_device::irq_callback() } +WRITE_LINE_MEMBER(vrender0soc_device::soundirq_cb) +{ + if (state) + { + IntReq(2); + } +} + /* * * Timer diff --git a/src/devices/machine/vrender0.h b/src/devices/machine/vrender0.h index 8947f6f1a95..287068631c9 100644 --- a/src/devices/machine/vrender0.h +++ b/src/devices/machine/vrender0.h @@ -97,6 +97,8 @@ public: void regs_map(address_map &map); void audiovideo_map(address_map &map); + void texture_map(address_map &map); + void frame_map(address_map &map); template<class T> void set_host_cpu_tag(T &&tag) { m_host_cpu.set_tag(std::forward<T>(tag)); } void set_external_vclk(const uint32_t vclk) { m_ext_vclk = vclk; } void set_external_vclk(const XTAL vclk) { m_ext_vclk = vclk.value(); } @@ -147,6 +149,8 @@ private: DECLARE_READ32_MEMBER(intst_r); DECLARE_WRITE32_MEMBER(intst_w); + DECLARE_WRITE_LINE_MEMBER(soundirq_cb); + // Timer template<int Which> DECLARE_WRITE32_MEMBER(tmcon_w); template<int Which> DECLARE_READ32_MEMBER(tmcon_r); diff --git a/src/devices/machine/wd2010.cpp b/src/devices/machine/wd2010.cpp index 95bb4803107..486d22b47f0 100644 --- a/src/devices/machine/wd2010.cpp +++ b/src/devices/machine/wd2010.cpp @@ -41,7 +41,7 @@ UNIMPLEMENTED FEATURES : #define VERBOSE 1 #include "logmacro.h" -#include <math.h> +#include <cmath> //************************************************************************** // MACROS / CONSTANTS //************************************************************************** diff --git a/src/devices/sound/2612intf.cpp b/src/devices/sound/2612intf.cpp index 484d15dde14..4c09413339c 100644 --- a/src/devices/sound/2612intf.cpp +++ b/src/devices/sound/2612intf.cpp @@ -2,9 +2,9 @@ // copyright-holders:Ernesto Corvi /*************************************************************************** - 2612intf.c + 2612intf.cpp - The YM2612 emulator supports up to 2 chips. + The YM2612 emulator supports up to 3 chips. Each chip has the following connections: - Status Read / Control Write A - Port Read / Data Write A @@ -61,7 +61,7 @@ void ym2612_device::timer_handler(int c,int count,int clock) void ym2612_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - ym2612_update_one(m_chip, outputs, samples); + ym2612_update_one(m_chip, outputs, samples, m_output_bits); } @@ -151,6 +151,7 @@ ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, dev ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , device_sound_interface(mconfig, *this) + , m_output_bits(9) // 9 bit internal DAC , m_stream(nullptr) , m_timer{ nullptr, nullptr } , m_chip(nullptr) @@ -158,10 +159,19 @@ ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, co { } - +// CMOS variation, with Higher sound output impedance DEFINE_DEVICE_TYPE(YM3438, ym3438_device, "ym3438", "YM3438 OPN2C") ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ym2612_device(mconfig, YM3438, tag, owner, clock) { } + +// Low voltage, External DAC variation +DEFINE_DEVICE_TYPE(YMF276, ymf276_device, "ymf276", "YMF276 OPN2L") + +ymf276_device::ymf276_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ym2612_device(mconfig, YMF276, tag, owner, clock) +{ + m_output_bits = 16; // external DAC +} diff --git a/src/devices/sound/2612intf.h b/src/devices/sound/2612intf.h index eceb0ce4e6e..1bbf9ea3bf9 100644 --- a/src/devices/sound/2612intf.h +++ b/src/devices/sound/2612intf.h @@ -35,6 +35,7 @@ protected: // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + u8 m_output_bits; private: void irq_handler(int irq); void timer_handler(int c, int count, int clock); @@ -59,7 +60,15 @@ public: }; +class ymf276_device : public ym2612_device +{ +public: + ymf276_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; + + DECLARE_DEVICE_TYPE(YM2612, ym2612_device) DECLARE_DEVICE_TYPE(YM3438, ym3438_device) +DECLARE_DEVICE_TYPE(YMF276, ymf276_device) #endif // MAME_SOUND_2612INTF_H diff --git a/src/devices/sound/c6280.cpp b/src/devices/sound/c6280.cpp index 6c6f2410166..8b0c4322e79 100644 --- a/src/devices/sound/c6280.cpp +++ b/src/devices/sound/c6280.cpp @@ -24,12 +24,7 @@ - Verify LFO frequency from real hardware. - - Add shared index for waveform playback and sample writes. Almost every - game will reset the index prior to playback so this isn't an issue. - - - While the noise emulation is complete, the data for the pseudo-random - bitstream is calculated by machine().rand() and is not a representation of what - the actual hardware does. + - Noise generating algorithm is shared in all channels? For some background on Hudson Soft's C62 chipset: @@ -45,75 +40,65 @@ #include "emu.h" #include "c6280.h" +#include <algorithm> void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - static const int scale_tab[] = { - 0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, - 0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F - }; - - int lmal = (m_balance >> 4) & 0x0F; - int rmal = (m_balance >> 0) & 0x0F; - - lmal = scale_tab[lmal]; - rmal = scale_tab[rmal]; + const u8 lmal = (m_balance >> 4) & 0x0f; + const u8 rmal = (m_balance >> 0) & 0x0f; /* Clear buffer */ - for (int i = 0; i < samples; i++) - { - outputs[0][i] = 0; - outputs[1][i] = 0; - } + std::fill_n(&outputs[0][0], samples, 0); + std::fill_n(&outputs[1][0], samples, 0); for (int ch = 0; ch < 6; ch++) { + channel *chan = &m_channel[ch]; /* Only look at enabled channels */ - if(m_channel[ch].m_control & 0x80) + if (chan->control & 0x80) { - int lal = (m_channel[ch].m_balance >> 4) & 0x0F; - int ral = (m_channel[ch].m_balance >> 0) & 0x0F; - int al = m_channel[ch].m_control & 0x1F; - - lal = scale_tab[lal]; - ral = scale_tab[ral]; + const u8 lal = (chan->balance >> 4) & 0x0f; + const u8 ral = (chan->balance >> 0) & 0x0f; + const u8 al = (chan->control >> 1) & 0x0f; // only high 4 bit is affected to calculating volume, low 1 bit is independent - /* Calculate volume just as the patent says */ - int vll = (0x1F - lal) + (0x1F - al) + (0x1F - lmal); - if(vll > 0x1F) vll = 0x1F; + // verified from both patent and manual + int vll = (0xf - lmal) + (0xf - al) + (0xf - lal); + if (vll > 0xf) vll = 0xf; - int vlr = (0x1F - ral) + (0x1F - al) + (0x1F - rmal); - if(vlr > 0x1F) vlr = 0x1F; + int vlr = (0xf - rmal) + (0xf - al) + (0xf - ral); + if (vlr > 0xf) vlr = 0xf; - vll = m_volume_table[vll]; - vlr = m_volume_table[vlr]; + vll = m_volume_table[(vll << 1) | (chan->control & 1)]; + vlr = m_volume_table[(vlr << 1) | (chan->control & 1)]; /* Check channel mode */ - if((ch >= 4) && (m_channel[ch].m_noise_control & 0x80)) + if ((ch >= 4) && (chan->noise_control & 0x80)) { /* Noise mode */ - uint32_t step = (m_channel[ch].m_noise_control & 0x1F) ^ 0x1F; + const u32 step = (chan->noise_control & 0x1f) ^ 0x1f; for (int i = 0; i < samples; i += 1) { - static int data = 0; - if(m_channel[ch].m_noise_counter <= 0) + s16 data = BIT(chan->noise_seed, 0) ? 0x1f : 0; + chan->noise_counter--; + if (chan->noise_counter <= 0) { - m_channel[ch].m_noise_counter = step << 2; - data = (machine().rand() & 1) ? 0x1F : 0; + chan->noise_counter = step << 6; // 32 * 2 + const u32 seed = chan->noise_seed; + // based on Charles MacDonald's research + chan->noise_seed = (seed >> 1) | ((BIT(seed, 0) ^ BIT(seed, 1) ^ BIT(seed, 11) ^ BIT(seed, 12) ^ BIT(seed, 17)) << 17); } - m_channel[ch].m_noise_counter--; - outputs[0][i] += (int16_t)(vll * (data - 16)); - outputs[1][i] += (int16_t)(vlr * (data - 16)); + outputs[0][i] += (s16)(vll * (data - 16)); + outputs[1][i] += (s16)(vlr * (data - 16)); } } else - if(m_channel[ch].m_control & 0x40) + if (chan->control & 0x40) { /* DDA mode */ for (int i = 0; i < samples; i++) { - outputs[0][i] += (int16_t)(vll * (m_channel[ch].m_dda - 16)); - outputs[1][i] += (int16_t)(vlr * (m_channel[ch].m_dda - 16)); + outputs[0][i] += (s16)(vll * (chan->dda - 16)); + outputs[1][i] += (s16)(vlr * (chan->dda - 16)); } } else @@ -123,56 +108,55 @@ void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **i if (ch == 0) // CH 0 only, CH 1 is muted { /* Waveform mode with LFO */ - uint16_t lfo_step = m_channel[1].m_frequency ? m_channel[1].m_frequency : 0x1000; + channel *lfo_srcchan = &m_channel[1]; + channel *lfo_dstchan = &m_channel[0]; + const u16 lfo_step = lfo_srcchan->frequency ? lfo_srcchan->frequency : 0x1000; for (int i = 0; i < samples; i += 1) { - int32_t step = m_channel[0].m_frequency ? m_channel[0].m_frequency : 0x1000; + s32 step = lfo_dstchan->frequency ? lfo_dstchan->frequency : 0x1000; if (m_lfo_control & 0x80) // reset LFO { - m_channel[1].m_tick = lfo_step * m_lfo_frequency; - m_channel[1].m_counter = 0; + lfo_srcchan->tick = lfo_step * m_lfo_frequency; + lfo_srcchan->index = 0; } else { - int lfooffset = m_channel[1].m_counter; - m_channel[1].m_tick--; - if (m_channel[1].m_tick <= 0) + const s16 lfo_data = lfo_srcchan->waveform[lfo_srcchan->index]; + lfo_srcchan->tick--; + if (lfo_srcchan->tick <= 0) { - m_channel[1].m_tick = lfo_step * m_lfo_frequency; // TODO : multiply? verify this from real hardware. - m_channel[1].m_counter = (m_channel[1].m_counter + 1) & 0x1f; + lfo_srcchan->tick = lfo_step * m_lfo_frequency; // verified from manual + lfo_srcchan->index = (lfo_srcchan->index + 1) & 0x1f; } - int16_t lfo_data = m_channel[1].m_waveform[lfooffset]; - step += ((lfo_data - 16) << (((m_lfo_control & 3)-1)<<1)); // verified from patent, TODO : same in real hardware? + step += ((lfo_data - 16) << (((m_lfo_control & 3)-1)<<1)); // verified from manual } - int offset = m_channel[0].m_counter; - m_channel[0].m_tick--; - if (m_channel[0].m_tick <= 0) + const s16 data = lfo_dstchan->waveform[lfo_dstchan->index]; + lfo_dstchan->tick--; + if (lfo_dstchan->tick <= 0) { - m_channel[0].m_tick = step; - m_channel[0].m_counter = (m_channel[0].m_counter + 1) & 0x1f; + lfo_dstchan->tick = step; + lfo_dstchan->index = (lfo_dstchan->index + 1) & 0x1f; } - int16_t data = m_channel[0].m_waveform[offset]; - outputs[0][i] += (int16_t)(vll * (data - 16)); - outputs[1][i] += (int16_t)(vlr * (data - 16)); + outputs[0][i] += (s16)(vll * (data - 16)); + outputs[1][i] += (s16)(vlr * (data - 16)); } } } else { /* Waveform mode */ - uint32_t step = m_channel[ch].m_frequency ? m_channel[ch].m_frequency : 0x1000; + const u32 step = chan->frequency ? chan->frequency : 0x1000; for (int i = 0; i < samples; i += 1) { - int offset = m_channel[ch].m_counter; - m_channel[ch].m_tick--; - if (m_channel[ch].m_tick <= 0) + const s16 data = chan->waveform[chan->index]; + chan->tick--; + if (chan->tick <= 0) { - m_channel[ch].m_tick = step; - m_channel[ch].m_counter = (m_channel[ch].m_counter + 1) & 0x1f; + chan->tick = step; + chan->index = (chan->index + 1) & 0x1f; } - int16_t data = m_channel[ch].m_waveform[offset]; - outputs[0][i] += (int16_t)(vll * (data - 16)); - outputs[1][i] += (int16_t)(vlr * (data - 16)); + outputs[0][i] += (s16)(vll * (data - 16)); + outputs[1][i] += (s16)(vlr * (data - 16)); } } } @@ -185,6 +169,50 @@ void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **i /* MAME specific code */ /*--------------------------------------------------------------------------*/ +/* Write Register Layout + + 76543210 + 00 -----xxx Channel Select + -----000 Channel 0 + -----001 Channel 1 + -----010 Channel 2 + -----011 Channel 3 + -----100 Channel 4 + -----101 Channel 5 + + 01 xxxx---- Overall Left Volume + ----xxxx Overall Right Volume + + 02 xxxxxxxx Frequency (Low 8 bits) + + 03 ----xxxx Frequency (High 4 bits) + + 04 x------- Channel Enable + -x------ Direct D/A + 00------ Write Data + 01------ Reset Counter + 10------ Mixing (Sound Output) + 11------ Direct D/A + ---xxxxx Channel Master Volume + + 05 xxxx---- Channel Left Volume + ----xxxx Channel Right Volume + + 06 ---xxxxx Waveform Data + + 07 x------- Noise Enable (channel 5, 6 only) + ---xxxxx Noise Frequency ^ 0x1f + + 08 xxxxxxxx LFO Frequency + + 09 x------- LFO Reset + ------xx LFO Control + ------00 LFO off + ------01 Direct Addition + ------10 2 bit Shift Addition + ------11 4 bit Shift Addition +*/ + WRITE8_MEMBER( c6280_device::c6280_w ) { channel *chan = &m_channel[m_select]; @@ -192,7 +220,7 @@ WRITE8_MEMBER( c6280_device::c6280_w ) /* Update stream */ m_stream->update(); - switch(offset & 0x0F) + switch (offset & 0x0f) { case 0x00: /* Channel select */ m_select = data & 0x07; @@ -203,59 +231,50 @@ WRITE8_MEMBER( c6280_device::c6280_w ) break; case 0x02: /* Channel frequency (LSB) */ - chan->m_frequency = (chan->m_frequency & 0x0F00) | data; - chan->m_frequency &= 0x0FFF; + chan->frequency = (chan->frequency & 0x0f00) | data; break; case 0x03: /* Channel frequency (MSB) */ - chan->m_frequency = (chan->m_frequency & 0x00FF) | (data << 8); - chan->m_frequency &= 0x0FFF; + chan->frequency = (chan->frequency & 0x00ff) | ((data << 8) & 0x0f00); break; case 0x04: /* Channel control (key-on, DDA mode, volume) */ /* 1-to-0 transition of DDA bit resets waveform index */ - if((chan->m_control & 0x40) && ((data & 0x40) == 0)) + if ((chan->control & 0x40) && ((data & 0x40) == 0)) { - chan->m_index = 0; + chan->index = 0; } - if(((chan->m_control & 0x80) == 0) && (data & 0x80)) + if (((chan->control & 0x80) == 0) && (data & 0x80)) { - chan->m_tick = chan->m_frequency; + chan->tick = chan->frequency; } - chan->m_control = data; + chan->control = data; break; case 0x05: /* Channel balance */ - chan->m_balance = data; + chan->balance = data; break; case 0x06: /* Channel waveform data */ - switch(chan->m_control & 0xC0) + switch (chan->control & 0x40) { - case 0x00: - chan->m_waveform[chan->m_index & 0x1F] = data & 0x1F; - chan->m_index = (chan->m_index + 1) & 0x1F; + case 0x00: // Waveform + chan->waveform[chan->index & 0x1f] = data & 0x1f; + if (!(chan->control & 0x80)) // TODO : wave pointer is increased at writing data when sound playback is off?? + chan->index = (chan->index + 1) & 0x1f; break; - case 0x40: - break; - - case 0x80: - chan->m_waveform[chan->m_index & 0x1F] = data & 0x1F; - chan->m_index = (chan->m_index + 1) & 0x1F; - break; - - case 0xC0: - chan->m_dda = data & 0x1F; + case 0x40: // Direct D/A + chan->dda = data & 0x1f; break; } break; case 0x07: /* Noise control (enable, frequency) */ - chan->m_noise_control = data; + chan->noise_control = data; break; case 0x08: /* LFO frequency */ @@ -273,7 +292,7 @@ WRITE8_MEMBER( c6280_device::c6280_w ) DEFINE_DEVICE_TYPE(C6280, c6280_device, "c6280", "Hudson Soft HuC6280 PSG") -c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, C6280, tag, owner, clock) , device_sound_interface(mconfig, *this) { @@ -305,28 +324,37 @@ void c6280_device::device_start() /* Make volume table */ /* PSG has 48dB volume range spread over 32 steps */ double step = 48.0 / 32.0; - for (int i = 0; i < 31; i++) + for (int i = 0; i < 30; i++) { - m_volume_table[i] = (uint16_t)level; + m_volume_table[i] = (u16)level; level /= pow(10.0, step / 20.0); } - m_volume_table[31] = 0; + m_volume_table[30] = m_volume_table[31] = 0; save_item(NAME(m_select)); save_item(NAME(m_balance)); save_item(NAME(m_lfo_frequency)); save_item(NAME(m_lfo_control)); - for (int chan = 0; chan < 8; chan++) + + save_item(STRUCT_MEMBER(m_channel, frequency)); + save_item(STRUCT_MEMBER(m_channel, control)); + save_item(STRUCT_MEMBER(m_channel, balance)); + save_item(STRUCT_MEMBER(m_channel, waveform)); + save_item(STRUCT_MEMBER(m_channel, index)); + save_item(STRUCT_MEMBER(m_channel, dda)); + save_item(STRUCT_MEMBER(m_channel, noise_control)); + save_item(STRUCT_MEMBER(m_channel, noise_counter)); + save_item(STRUCT_MEMBER(m_channel, noise_seed)); + save_item(STRUCT_MEMBER(m_channel, tick)); +} + +void c6280_device::device_reset() +{ + for (int ch = 0; ch < 6; ch++) { - save_item(NAME(m_channel[chan].m_frequency), chan); - save_item(NAME(m_channel[chan].m_control), chan); - save_item(NAME(m_channel[chan].m_balance), chan); - save_item(NAME(m_channel[chan].m_waveform), chan); - save_item(NAME(m_channel[chan].m_index), chan); - save_item(NAME(m_channel[chan].m_dda), chan); - save_item(NAME(m_channel[chan].m_noise_control), chan); - save_item(NAME(m_channel[chan].m_noise_counter), chan); - save_item(NAME(m_channel[chan].m_counter), chan); - save_item(NAME(m_channel[chan].m_tick), chan); + channel *chan = &m_channel[ch]; + chan->index = 0; + if (ch >= 4) + chan->noise_seed = 1; } } diff --git a/src/devices/sound/c6280.h b/src/devices/sound/c6280.h index 0cfdc34799b..dade29ab806 100644 --- a/src/devices/sound/c6280.h +++ b/src/devices/sound/c6280.h @@ -10,7 +10,7 @@ class c6280_device : public device_t, public device_sound_interface public: static constexpr feature_type imperfect_features() { return feature::SOUND; } // Incorrect / Not verified noise / LFO output - c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // write only DECLARE_WRITE8_MEMBER( c6280_w ); @@ -18,6 +18,7 @@ public: protected: // device-level overrides virtual void device_start() override; + virtual void device_reset() override; virtual void device_clock_changed() override; // sound stream update overrides @@ -25,26 +26,27 @@ protected: private: struct channel { - uint16_t m_frequency; - uint8_t m_control; - uint8_t m_balance; - uint8_t m_waveform[32]; - uint8_t m_index; - int16_t m_dda; - uint8_t m_noise_control; - int32_t m_noise_counter; - uint32_t m_counter; - int32_t m_tick; + u16 frequency; + u8 control; + u8 balance; + u8 waveform[32]; + u8 index; + s16 dda; + u8 noise_control; + s32 noise_counter; + u32 noise_frequency; + u32 noise_seed; + s32 tick; }; // internal state sound_stream *m_stream; - uint8_t m_select; - uint8_t m_balance; - uint8_t m_lfo_frequency; - uint8_t m_lfo_control; + u8 m_select; + u8 m_balance; + u8 m_lfo_frequency; + u8 m_lfo_control; channel m_channel[8]; - int16_t m_volume_table[32]; + s16 m_volume_table[32]; }; DECLARE_DEVICE_TYPE(C6280, c6280_device) diff --git a/src/devices/sound/disc_mth.hxx b/src/devices/sound/disc_mth.hxx index 9825ee0b899..cb423b175d1 100644 --- a/src/devices/sound/disc_mth.hxx +++ b/src/devices/sound/disc_mth.hxx @@ -49,7 +49,7 @@ * ************************************************************************/ -#include <float.h> +#include <cfloat> diff --git a/src/devices/sound/fm.h b/src/devices/sound/fm.h index 50b6b0d3d99..d49c5a40e99 100644 --- a/src/devices/sound/fm.h +++ b/src/devices/sound/fm.h @@ -176,7 +176,7 @@ void * ym2612_init(device_t *device, int baseclock, int rate, void ym2612_clock_changed(void *chip, int clock, int rate); void ym2612_shutdown(void *chip); void ym2612_reset_chip(void *chip); -void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length); +void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length, u8 output_bits); int ym2612_write(void *chip, int a,unsigned char v); unsigned char ym2612_read(void *chip,int a); diff --git a/src/devices/sound/fm2612.cpp b/src/devices/sound/fm2612.cpp index 7923e46ccbb..6d5f71dac55 100644 --- a/src/devices/sound/fm2612.cpp +++ b/src/devices/sound/fm2612.cpp @@ -2174,8 +2174,11 @@ static void init_tables(void) /*******************************************************************************/ /* Generate samples for one of the YM2612s */ -void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length) +void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length, u8 output_bits) { + // TODO : 'ladder' effects for Mega Drive/Genesis + const u8 output_shift = (output_bits > 14) ? 0 : (14 - output_bits); + const s32 output_nandmask = (1 << output_shift) - 1; ym2612_state *F2612 = (ym2612_state *)chip; fm2612_FM_OPN *OPN = &F2612->OPN; int32_t *out_fm = OPN->out_fm; @@ -2208,7 +2211,10 @@ void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length) refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); } - }else refresh_fc_eg_chan( OPN, cch[2] ); + } + else + refresh_fc_eg_chan( OPN, cch[2] ); + refresh_fc_eg_chan( OPN, cch[3] ); refresh_fc_eg_chan( OPN, cch[4] ); refresh_fc_eg_chan( OPN, cch[5] ); @@ -2239,7 +2245,7 @@ void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length) chan_calc(F2612, OPN, cch[3]); chan_calc(F2612, OPN, cch[4]); if( F2612->dacen ) - *cch[5]->connect4 += F2612->dacout; + *cch[5]->connect4 += F2612->dacout << 5; else chan_calc(F2612, OPN, cch[5]); @@ -2275,18 +2281,18 @@ void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length) else if (out_fm[5] < -8192) out_fm[5] = -8192; /* 6-channels mixing */ - lt = ((out_fm[0]>>0) & OPN->pan[0]); - rt = ((out_fm[0]>>0) & OPN->pan[1]); - lt += ((out_fm[1]>>0) & OPN->pan[2]); - rt += ((out_fm[1]>>0) & OPN->pan[3]); - lt += ((out_fm[2]>>0) & OPN->pan[4]); - rt += ((out_fm[2]>>0) & OPN->pan[5]); - lt += ((out_fm[3]>>0) & OPN->pan[6]); - rt += ((out_fm[3]>>0) & OPN->pan[7]); - lt += ((out_fm[4]>>0) & OPN->pan[8]); - rt += ((out_fm[4]>>0) & OPN->pan[9]); - lt += ((out_fm[5]>>0) & OPN->pan[10]); - rt += ((out_fm[5]>>0) & OPN->pan[11]); + lt = (((out_fm[0]) & OPN->pan[0]) & ~output_nandmask); + rt = (((out_fm[0]) & OPN->pan[1]) & ~output_nandmask); + lt += (((out_fm[1]) & OPN->pan[2]) & ~output_nandmask); + rt += (((out_fm[1]) & OPN->pan[3]) & ~output_nandmask); + lt += (((out_fm[2]) & OPN->pan[4]) & ~output_nandmask); + rt += (((out_fm[2]) & OPN->pan[5]) & ~output_nandmask); + lt += (((out_fm[3]) & OPN->pan[6]) & ~output_nandmask); + rt += (((out_fm[3]) & OPN->pan[7]) & ~output_nandmask); + lt += (((out_fm[4]) & OPN->pan[8]) & ~output_nandmask); + rt += (((out_fm[4]) & OPN->pan[9]) & ~output_nandmask); + lt += (((out_fm[5]) & OPN->pan[10]) & ~output_nandmask); + rt += (((out_fm[5]) & OPN->pan[11]) & ~output_nandmask); // Limit( lt, MAXOUT, MINOUT ); // Limit( rt, MAXOUT, MINOUT ); @@ -2328,7 +2334,7 @@ void ym2612_postload(void *chip) int r; /* DAC data & port */ - F2612->dacout = ((int)F2612->REGS[0x2a] - 0x80) << 6; /* level unknown */ + F2612->dacout = (((int)F2612->REGS[0x2a] - 0x80) << 1) | (BIT(F2612->REGS[0x2c], 3)); F2612->dacen = F2612->REGS[0x2b] & 0x80; /* OPN registers */ /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ @@ -2488,12 +2494,16 @@ int ym2612_write(void *chip, int a, uint8_t v) { case 0x2a: /* DAC data (YM2612) */ ym2612_device::update_request(F2612->OPN.ST.device); - F2612->dacout = ((int)v - 0x80) << 6; /* level unknown */ + F2612->dacout = (F2612->dacout & 0x001) | (((int)v - 0x80) << 1); break; case 0x2b: /* DAC Sel (YM2612) */ /* b7 = dac enable */ F2612->dacen = v & 0x80; break; + case 0x2c: /* Test (YM2612) */ + /* b3 = dac lowest bit */ + F2612->dacout = (F2612->dacout & ~0x001) | BIT(v, 3); + break; default: /* OPN section */ ym2612_device::update_request(F2612->OPN.ST.device); /* write register */ diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index 07fe59514ed..5537f3ffea6 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -2,15 +2,17 @@ // copyright-holders:cam900 /* Hudson HuC6230 SoundBox - HuC6280 PSG with ADPCM + PSG part of HuC6280 with ADPCM TODO: - Volume is linear? - Make it actually working - - Implement CDDA Volume + - Implement/Correct VCA (Voltage Controlled Amplifier) behavior Related patent: - https://patents.google.com/patent/US5692099 + - https://patents.google.com/patent/US6453286 + - https://patents.google.com/patent/US5548655A */ #include "emu.h" @@ -33,8 +35,8 @@ void huc6230_device::sound_stream_update(sound_stream &stream, stream_sample_t * if (!channel->m_playing) continue; - outputs[0][i] = clamp(outputs[0][i] + ((channel->m_output * channel->m_lvol) >> 2), -32768, 32767); - outputs[1][i] = clamp(outputs[1][i] + ((channel->m_output * channel->m_rvol) >> 2), -32768, 32767); + outputs[0][i] = clamp(outputs[0][i] + ((channel->m_output * channel->m_lvol) >> 3), -32768, 32767); + outputs[1][i] = clamp(outputs[1][i] + ((channel->m_output * channel->m_rvol) >> 3), -32768, 32767); } } } @@ -83,19 +85,19 @@ WRITE8_MEMBER( huc6230_device::write ) } else if (offset < 0x16) { - m_cdda_lvol = data & 0x3f; - m_cdda_cb(0, m_cdda_lvol); + m_pcm_lvol = data & 0x3f; + m_vca_cb(0, m_pcm_lvol); } else if (offset < 0x17) { - m_cdda_rvol = data & 0x3f; - m_cdda_cb(1, m_cdda_rvol); + m_pcm_rvol = data & 0x3f; + m_vca_cb(1, m_pcm_rvol); } } TIMER_CALLBACK_MEMBER(huc6230_device::adpcm_timer) { - int frq = (1 << m_adpcm_freq); + const unsigned frq = (1 << m_adpcm_freq); for (int adpcm = 0; adpcm < 2; adpcm++) { adpcm_channel *channel = &m_adpcm_channel[adpcm]; @@ -113,7 +115,7 @@ TIMER_CALLBACK_MEMBER(huc6230_device::adpcm_timer) channel->m_pos++; channel->m_input = m_adpcm_update_cb[adpcm](); - if (channel->m_pos > frq) + if (channel->m_pos >= frq) { channel->m_pos = 0; channel->m_prev_sample = channel->m_curr_sample; @@ -143,10 +145,10 @@ huc6230_device::huc6230_device(const machine_config &mconfig, const char *tag, d , m_stream(nullptr) , m_psg(*this, "psg") , m_adpcm_freq(0) - , m_cdda_lvol(0) - , m_cdda_rvol(0) + , m_pcm_lvol(0) + , m_pcm_rvol(0) , m_adpcm_update_cb{{*this}, {*this}} - , m_cdda_cb(*this) + , m_vca_cb(*this) { } @@ -169,9 +171,9 @@ void huc6230_device::device_start() for (auto &cb : m_adpcm_update_cb) cb.resolve_safe(0); - m_cdda_cb.resolve_safe(); + m_vca_cb.resolve_safe(); - m_stream = machine().sound().stream_alloc(*this, 2, 2, clock() / 96); + m_stream = machine().sound().stream_alloc(*this, 2, 2, clock() / 6); m_adpcm_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(huc6230_device::adpcm_timer),this)); for (int i = 0; i < 2; i++) @@ -196,13 +198,13 @@ void huc6230_device::device_start() save_item(NAME(m_adpcm_channel[i].m_input), i); } save_item(NAME(m_adpcm_freq)); - save_item(NAME(m_cdda_lvol)); - save_item(NAME(m_cdda_rvol)); + save_item(NAME(m_pcm_lvol)); + save_item(NAME(m_pcm_rvol)); } void huc6230_device::device_clock_changed() { - m_stream->set_sample_rate(clock() / 96); + m_stream->set_sample_rate(clock() / 6); attotime adpcm_period = clocks_to_attotime(682); m_adpcm_timer->adjust(adpcm_period, 0, adpcm_period); } diff --git a/src/devices/sound/huc6230.h b/src/devices/sound/huc6230.h index 6cd26955191..d94c59fcb26 100644 --- a/src/devices/sound/huc6230.h +++ b/src/devices/sound/huc6230.h @@ -11,10 +11,12 @@ class huc6230_device : public device_t, public device_sound_interface { public: + static constexpr feature_type imperfect_features() { return feature::SOUND; } // Incorrect ADPCM + huc6230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template <unsigned N> auto adpcm_update_cb() { return m_adpcm_update_cb[N].bind(); } - auto cdda_cb() { return m_cdda_cb.bind(); } + auto vca_callback() { return m_vca_cb.bind(); } // write only DECLARE_WRITE8_MEMBER( write ); @@ -48,13 +50,13 @@ private: required_device<c6280_device> m_psg; adpcm_channel m_adpcm_channel[2]; uint32_t m_adpcm_freq; - uint32_t m_cdda_lvol; - uint32_t m_cdda_rvol; + uint32_t m_pcm_lvol; + uint32_t m_pcm_rvol; TIMER_CALLBACK_MEMBER(adpcm_timer); devcb_read8 m_adpcm_update_cb[2]; - devcb_write8 m_cdda_cb; + devcb_write8 m_vca_cb; }; DECLARE_DEVICE_TYPE(HuC6230, huc6230_device) diff --git a/src/devices/sound/mea8000.cpp b/src/devices/sound/mea8000.cpp index d4d93ca4c8e..af330349fad 100644 --- a/src/devices/sound/mea8000.cpp +++ b/src/devices/sound/mea8000.cpp @@ -30,7 +30,7 @@ #include "emu.h" #include "mea8000.h" -#include <math.h> +#include <cmath> //#define VERBOSE 1 #include "logmacro.h" diff --git a/src/devices/sound/megd.cpp b/src/devices/sound/megd.cpp index 2790a7ca69c..47ff6dfdb3d 100644 --- a/src/devices/sound/megd.cpp +++ b/src/devices/sound/megd.cpp @@ -37,7 +37,7 @@ u32 meg_disassembler::b(u64 opc, u32 start, u32 count) return (opc >> start) & ((1 << count) - 1); } -void meg_disassembler::append(std::string &r, std::string e) +void meg_disassembler::append(std::string &r, const std::string &e) { if(r != "") r += " ; "; diff --git a/src/devices/sound/megd.h b/src/devices/sound/megd.h index 59a13aa0ea4..82bad8f4beb 100644 --- a/src/devices/sound/megd.h +++ b/src/devices/sound/megd.h @@ -33,7 +33,7 @@ private: std::string goffset(offs_t address) const; static inline u32 b(u64 opc, u32 start, u32 count); - static inline void append(std::string &r, std::string e); + static inline void append(std::string &r, const std::string &e); }; #endif diff --git a/src/devices/sound/saa1099.h b/src/devices/sound/saa1099.h index 3ffb3e9d3d5..c6b7382e38e 100644 --- a/src/devices/sound/saa1099.h +++ b/src/devices/sound/saa1099.h @@ -54,12 +54,15 @@ private: struct saa1099_noise { - saa1099_noise() { } + saa1099_noise() { (void)pad; } /* vars to simulate the noise generator output */ double counter = 0.0; - double freq = 0.0; + double freq = 0.0; u32 level = 0xffffffffU; // noise polynomial shifter + + private: + u32 pad; // pad out structure to multiple of sizeof(double) }; void envelope_w(int ch); diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp index b800f6a7b0e..f8ca2c2336d 100644 --- a/src/devices/sound/upd7759.cpp +++ b/src/devices/sound/upd7759.cpp @@ -287,7 +287,7 @@ void upd7756_device::device_start() void upd775x_device::device_reset() { m_pos = 0; - m_fifo_in = 0; + //m_fifo_in = 0; // this seems keeping state when /RESET line asserted (test case: konmedal.cpp games) m_state = STATE_IDLE; m_clocks_left = 0; m_nibbles_left = 0; @@ -699,6 +699,9 @@ void upd775x_device::port_w(u8 data) READ_LINE_MEMBER( upd775x_device::busy_r ) { + /* update the stream first */ + m_channel->update(); + /* return /BUSY */ return (m_state == STATE_IDLE); } diff --git a/src/devices/sound/vrender0.cpp b/src/devices/sound/vrender0.cpp index df934fcc834..833acdc46bb 100644 --- a/src/devices/sound/vrender0.cpp +++ b/src/devices/sound/vrender0.cpp @@ -3,20 +3,26 @@ #include "emu.h" #include "vrender0.h" -/*********************************** - VRENDER ZERO - AUDIO EMULATION -************************************/ -/************ -MISSING: -envelopes -reverb -interrupts -*************/ +/************************************************************************************* + VRENDER ZERO + AUDIO EMULATION + + TODO + - Envelope, Interrupt functions aren't verified from real hardware behavior. + - Reverb, Pingpong/Reversed loop, Most of Channel/Overall control registers + are Not implemented + - Sample Rate is unverified + +*************************************************************************************/ +static inline s32 sign_ext(s32 val, s32 bit) +{ + bit = 32 - bit; + return ((s32)(val << bit)) >> bit; +} //Correct table thanks to Evoga //they left a ulaw<->linear conversion tool inside the roms -static const unsigned short ULawTo16[]= +static const u16 ULawTo16[]= { 0x8000,0x8400,0x8800,0x8C00,0x9000,0x9400,0x9800,0x9C00, 0xA000,0xA400,0xA800,0xAC00,0xB000,0xB400,0xB800,0xBC00, @@ -52,26 +58,58 @@ static const unsigned short ULawTo16[]= 0xFFC0,0xFFC8,0xFFD0,0xFFD8,0xFFE0,0xFFE8,0xFFF0,0xFFF8, }; - -#define STATUS m_SOUNDREGS[0x404/4] -#define CURSADDR(chan) (m_SOUNDREGS[(0x20/4)*chan+0x00]) -#define DSADDR(chan) ((m_SOUNDREGS[(0x20/4)*chan+0x08/4]>>0)&0xffff) -#define LOOPBEGIN(chan) (m_SOUNDREGS[(0x20/4)*chan+0x0c/4]&0x3fffff) -#define LOOPEND(chan) (m_SOUNDREGS[(0x20/4)*chan+0x10/4]&0x3fffff) -#define ENVVOL(chan) (m_SOUNDREGS[(0x20/4)*chan+0x04/4]&0xffffff) - -/* -#define GETSOUNDREG16(Chan,Offs) space.read_word(m_reg_base+0x20*Chan+Offs) -#define GETSOUNDREG32(Chan,Offs) space.read_dword(m_reg_base+0x20*Chan+Offs) - -#define CURSADDR(chan) GETSOUNDREG32(chan,0x00) -#define DSADDR(chan) GETSOUNDREG16(chan,0x08) -#define LOOPBEGIN(chan) (GETSOUNDREG32(chan,0x0c)&0x3fffff) -#define LOOPEND(chan) (GETSOUNDREG32(chan,0x10)&0x3fffff) -#define ENVVOL(chan) (GETSOUNDREG32(chan,0x04)&0xffffff) -*/ - - +// 16 bit access only +void vr0sound_device::sound_map(address_map &map) +{ + map(0x000, 0x3ff).rw(FUNC(vr0sound_device::channel_r), FUNC(vr0sound_device::channel_w)); + + /* + Sound Control Registers + + fedcba98 76543210 + 404(R) xxxxxxxx xxxxxxxx Status (Low); Channel 0-15 + 406(R) xxxxxxxx xxxxxxxx Status (High); Channel 16-31 + 404(W) + 406(W) x------- -------- Status Assign (0 = Off, 1 = On) + -------- ---xxxxx Status Channel + 408(R) xxxxxxxx xxxxxxxx NoteOn (Low); Channel 0-15 + 40a(R) xxxxxxxx xxxxxxxx NoteOn (High); Channel 16-31 + 408(W) + 40a(W) x------- -------- NoteOn Assign (0 = Off, 1 = On) + -------- ---xxxxx NoteOn Channel + 410 -------- xxxxxxxx RevFactor + 412 -------- -xxxxxxx BufferSAddr (Top 7 bit of Reverb Buffer Start Address) + 420 ----xxxx xxxxxxxx BufferSize0 + 422 ----xxxx xxxxxxxx BufferSize1 + 440 ----xxxx xxxxxxxx BufferSize2 + 442 ----xxxx xxxxxxxx BufferSize3 + 480 ----xxxx xxxxxxxx IntMask (Low); Channel 0-15 + 482 ----xxxx xxxxxxxx IntMask (High); Channel 16-31 + 500 ----xxxx xxxxxxxx IntPend (Low); Channel 0-15 + 502 ----xxxx xxxxxxxx IntPend (High); Channel 16-31 + 600 ---xxxxx -------- MaxChn + -------- xxxxxxxx ChnClkNum (Clock Number per Channel) + 602 x------- -------- RS (Run Sound) + -------- --x----- TM (Texture Memory) + -------- ---x---- RE (Reverb Enable) + -------- -----x-- CW (32bit Adder Wait) + -------- ------x- AW (16bit Adder Wait) + -------- -------x MW (Multipler Wait) + */ + + map(0x404, 0x407).rw(FUNC(vr0sound_device::status_r), FUNC(vr0sound_device::status_w)); + map(0x408, 0x40b).rw(FUNC(vr0sound_device::noteon_r), FUNC(vr0sound_device::noteon_w)); + map(0x410, 0x411).rw(FUNC(vr0sound_device::revfactor_r), FUNC(vr0sound_device::revfactor_w)); + map(0x412, 0x413).rw(FUNC(vr0sound_device::buffersaddr_r), FUNC(vr0sound_device::buffersaddr_w)); + map(0x420, 0x421).rw(FUNC(vr0sound_device::buffersize0_r), FUNC(vr0sound_device::buffersize0_w)); + map(0x422, 0x423).rw(FUNC(vr0sound_device::buffersize1_r), FUNC(vr0sound_device::buffersize1_w)); + map(0x440, 0x441).rw(FUNC(vr0sound_device::buffersize2_r), FUNC(vr0sound_device::buffersize2_w)); + map(0x442, 0x443).rw(FUNC(vr0sound_device::buffersize3_r), FUNC(vr0sound_device::buffersize3_w)); + map(0x480, 0x483).rw(FUNC(vr0sound_device::intmask_r), FUNC(vr0sound_device::intmask_w)); + map(0x500, 0x503).rw(FUNC(vr0sound_device::intpend_r), FUNC(vr0sound_device::intpend_w)); + map(0x600, 0x601).rw(FUNC(vr0sound_device::chnnum_r), FUNC(vr0sound_device::chnnum_w)); + map(0x602, 0x603).rw(FUNC(vr0sound_device::ctrl_r), FUNC(vr0sound_device::ctrl_w)); +} //************************************************************************** // LIVE DEVICE @@ -83,12 +121,14 @@ DEFINE_DEVICE_TYPE(SOUND_VRENDER0, vr0sound_device, "vr0sound", "MagicEyes VRend // vr0sound_device - constructor //------------------------------------------------- -vr0sound_device::vr0sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, SOUND_VRENDER0, tag, owner, clock), - device_sound_interface(mconfig, *this), - m_TexBase(nullptr), - m_FBBase(nullptr), - m_stream(nullptr) +vr0sound_device::vr0sound_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, SOUND_VRENDER0, tag, owner, clock) + , device_sound_interface(mconfig, *this) + , device_memory_interface(mconfig, *this) + , m_texture_config("texture", ENDIANNESS_LITTLE, 16, 23) // 64 MBit (8 MB) Texture Memory Support + , m_frame_config("frame", ENDIANNESS_LITTLE, 16, 23) // 64 MBit (8 MB) Framebuffer Memory Support + , m_stream(nullptr) + , m_irq_cb(*this) { } @@ -99,15 +139,75 @@ vr0sound_device::vr0sound_device(const machine_config &mconfig, const char *tag, void vr0sound_device::device_start() { - memset(m_SOUNDREGS,0,sizeof(m_SOUNDREGS)); + m_irq_cb.resolve_safe(); + + // Find our direct access + m_texcache = space(AS_TEXTURE).cache<1, 0, ENDIANNESS_LITTLE>(); + m_fbcache = space(AS_FRAME).cache<1, 0, ENDIANNESS_LITTLE>(); + m_texcache_ctrl = m_fbcache; + for (auto &elem : m_channel) + elem.Cache = m_fbcache; + + m_stream = stream_alloc(0, 2, clock() / 972); // TODO : Correct source / divider? + + save_item(STRUCT_MEMBER(m_channel, CurSAddr)); + save_item(STRUCT_MEMBER(m_channel, EnvVol)); + save_item(STRUCT_MEMBER(m_channel, EnvStage)); + save_item(STRUCT_MEMBER(m_channel, dSAddr)); + save_item(STRUCT_MEMBER(m_channel, Modes)); + save_item(STRUCT_MEMBER(m_channel, LD)); + save_item(STRUCT_MEMBER(m_channel, LoopBegin)); + save_item(STRUCT_MEMBER(m_channel, LoopEnd)); + save_item(STRUCT_MEMBER(m_channel, LChnVol)); + save_item(STRUCT_MEMBER(m_channel, RChnVol)); + save_item(STRUCT_MEMBER(m_channel, EnvRate)); + save_item(STRUCT_MEMBER(m_channel, EnvTarget)); + save_item(NAME(m_Status)); + save_item(NAME(m_NoteOn)); + save_item(NAME(m_RevFactor)); + save_item(NAME(m_BufferAddr)); + save_item(NAME(m_BufferSize)); + save_item(NAME(m_IntMask)); + save_item(NAME(m_IntPend)); + save_item(NAME(m_MaxChn)); + save_item(NAME(m_ChnClkNum)); + save_item(NAME(m_Ctrl)); +} - m_stream = stream_alloc(0, 2, 44100); // TODO : Related to clock? +//------------------------------------------------- +// device_post_load - device-specific post-load +//------------------------------------------------- - save_item(NAME(m_SOUNDREGS)); +void vr0sound_device::device_post_load() +{ + device_clock_changed(); } //------------------------------------------------- +// device_clock_changed - called if the clock +// changes +//------------------------------------------------- + +void vr0sound_device::device_clock_changed() +{ + m_stream->set_sample_rate(clock() / 972); +} + +//------------------------------------------------- +// memory_space_config - return a description of +// any address spaces owned by this device +//------------------------------------------------- + +device_memory_interface::space_config_vector vr0sound_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_TEXTURE, &m_texture_config), + std::make_pair(AS_FRAME, &m_frame_config) + }; +} + +//------------------------------------------------- // sound_stream_update - handle update requests // for our sound stream //------------------------------------------------- @@ -117,133 +217,380 @@ void vr0sound_device::sound_stream_update(sound_stream &stream, stream_sample_t VR0_RenderAudio(samples, outputs[0], outputs[1]); } +u16 vr0sound_device::channel_r(offs_t offset) +{ + return m_channel[(offset >> 4) & 0x1f].read(offset & 0xf); +} +void vr0sound_device::channel_w(offs_t offset, u16 data, u16 mem_mask) +{ + channel_t *channel = &m_channel[(offset >> 4) & 0x1f]; + u16 old_mode = channel->Modes; + m_channel[(offset >> 4) & 0x1f].write(offset & 0xf, data, mem_mask); + if ((old_mode ^ channel->Modes) & MODE_TEXTURE) + { + channel->Cache = (channel->Modes & MODE_TEXTURE) ? m_texcache_ctrl : m_fbcache; + } +} -READ32_MEMBER(vr0sound_device::vr0_snd_read) +u16 vr0sound_device::status_r(offs_t offset) { - return m_SOUNDREGS[offset]; + return m_Status >> ((offset & 1) << 2); +} + +void vr0sound_device::status_w(offs_t offset, u16 data) +{ + const u32 c = data & 0x1f; + if (data & 0x8000) + { + m_Status |= 1 << c; + } + else + { + m_Status &= ~(1 << c); + } } +u16 vr0sound_device::noteon_r(offs_t offset) +{ + return m_NoteOn >> ((offset & 1) << 2); +} -WRITE32_MEMBER(vr0sound_device::vr0_snd_write) +void vr0sound_device::noteon_w(offs_t offset, u16 data) { - if(offset==0x404/4) + const u32 c = data & 0x1f; + if (data & 0x8000) { - data&=0xffff; - if(data&0x8000) - { - uint32_t c=data&0x1f; - STATUS|=1<<c; - CURSADDR(c)=0; - } - else - { - STATUS&=~(1<<(data&0x1f)); - } - return; + m_NoteOn |= 1 << c; } else { - COMBINE_DATA(&m_SOUNDREGS[offset]); + m_NoteOn &= ~(1 << c); } } +u16 vr0sound_device::revfactor_r(offs_t offset) +{ + return m_RevFactor & 0xff; +} -void vr0sound_device::set_areas(uint16_t *texture, uint16_t *frame) +void vr0sound_device::revfactor_w(offs_t offset, u16 data, u16 mem_mask) { - m_TexBase=(int16_t *)texture; - m_FBBase=(int16_t *)frame; + if (ACCESSING_BITS_0_7) + m_RevFactor = data & 0xff; } +/* + Buffer Address + 1 0 + fedcba9876543210 fedcba9876543210 + ----------0xxxxx x--------------- BufferSAddr + ---------------- -xxx------------ Buffer Select + ---------------- ----xxxxxxxxxxxx Buffer Pointer +*/ -void vr0sound_device::VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_sample_t *r) +u16 vr0sound_device::buffersaddr_r(offs_t offset) { - int16_t *SAMPLES; - uint32_t st=STATUS; - signed int lsample,rsample=0; - uint32_t CLK=(m_SOUNDREGS[0x600/4]>>0)&0xff; - uint32_t NCH=(m_SOUNDREGS[0x600/4]>>8)&0xff; - uint32_t CT1=(m_SOUNDREGS[0x600/4]>>16)&0xff; - uint32_t CT2=(m_SOUNDREGS[0x600/4]>>24)&0xff; - int div; - int s; + return (m_BufferAddr >> 14) & 0x7f; +} +void vr0sound_device::buffersaddr_w(offs_t offset, u16 data, u16 mem_mask) +{ + if (ACCESSING_BITS_0_7) + m_BufferAddr = (m_BufferAddr & ~(0x7f << 14)) | ((data & 0x7f) << 14); +} - if(CT1&0x20) - SAMPLES = m_TexBase; - else - SAMPLES = m_FBBase; +u16 vr0sound_device::buffersize0_r(offs_t offset) { return m_BufferSize[0] & 0xfff; } +u16 vr0sound_device::buffersize1_r(offs_t offset) { return m_BufferSize[1] & 0xfff; } +u16 vr0sound_device::buffersize2_r(offs_t offset) { return m_BufferSize[2] & 0xfff; } +u16 vr0sound_device::buffersize3_r(offs_t offset) { return m_BufferSize[3] & 0xfff; } + +void vr0sound_device::buffersize0_w(offs_t offset, u16 data, u16 mem_mask) { data &= 0xfff; COMBINE_DATA(&m_BufferSize[0]); } +void vr0sound_device::buffersize1_w(offs_t offset, u16 data, u16 mem_mask) { data &= 0xfff; COMBINE_DATA(&m_BufferSize[1]); } +void vr0sound_device::buffersize2_w(offs_t offset, u16 data, u16 mem_mask) { data &= 0xfff; COMBINE_DATA(&m_BufferSize[2]); } +void vr0sound_device::buffersize3_w(offs_t offset, u16 data, u16 mem_mask) { data &= 0xfff; COMBINE_DATA(&m_BufferSize[3]); } + +u16 vr0sound_device::intmask_r(offs_t offset) +{ + return m_IntMask >> ((offset & 1) << 2); +} - if(CLK) - div=((30<<16)|0x8000)/(CLK+1); +void vr0sound_device::intmask_w(offs_t offset, u16 data, u16 mem_mask) +{ + const int shift = ((offset & 1) << 2); + m_IntMask = (m_IntMask & ~(mem_mask << shift)) | ((data & mem_mask) << shift); +} + +u16 vr0sound_device::intpend_r(offs_t offset) +{ + return m_IntPend >> ((offset & 1) << 2); +} + +void vr0sound_device::intpend_w(offs_t offset, u16 data, u16 mem_mask) +{ + m_IntPend &= ~((data & mem_mask) << ((offset & 1) << 2)); + if (!m_IntPend) + m_irq_cb(false); +} + +u16 vr0sound_device::chnnum_r(offs_t offset) +{ + return ((m_MaxChn & 0x1f) << 8) | (m_ChnClkNum & 0xff); +} + +void vr0sound_device::chnnum_w(offs_t offset, u16 data, u16 mem_mask) +{ + if (ACCESSING_BITS_0_7) + m_ChnClkNum = data & 0xff; + if (ACCESSING_BITS_8_15) + m_MaxChn = (data >> 8) & 0x1f; +} + +u16 vr0sound_device::ctrl_r(offs_t offset) +{ + return m_Ctrl; +} + +void vr0sound_device::ctrl_w(offs_t offset, u16 data, u16 mem_mask) +{ + const u16 old_ctrl = m_Ctrl; + COMBINE_DATA(&m_Ctrl); + if ((old_ctrl ^ m_Ctrl) & CTRL_TM) + m_texcache_ctrl = (m_Ctrl & CTRL_TM) ? m_texcache : m_fbcache; +} + +/* +Channel Parameter Register (32 bytes for each channels) + + fedcba98 76543210 +00 xxxxxxxx xxxxxxxx CurSAddr (15:0) +02 xxxxxxxx xxxxxxxx CurSAddr (31:16) +04 xxxxxxxx xxxxxxxx EnvVol (15:0) +06 -11x---- -------- Loop Direction(LD) + -11-xxxx -------- EnvStage + -------- xxxxxxxx EnvVol (23:16) +08 xxxxxxxx xxxxxxxx DSAddr (15:0) +0a -xxxxxxx -------- Modes +0c xxxxxxxx xxxxxxxx LoopBegin (15:0) +0e -xxxxxxx -------- LChnVol + -------- --xxxxxx LoopBegin (21:16) +10 xxxxxxxx xxxxxxxx LoopEnd (15:0) +12 -xxxxxxx -------- RChnVol + -------- --xxxxxx LoopEnd (21:16) +14 xxxxxxxx xxxxxxxx EnvRate0 (15:0) +16 xxxxxxxx xxxxxxxx EnvRate1 (15:0) +18 xxxxxxxx xxxxxxxx EnvRate2 (15:0) +1a xxxxxxxx xxxxxxxx EnvRate3 (15:0) +1c x------- -------- EnvRate1 (16) + -xxxxxxx -------- EnvTarget1 + -------- x------- EnvRate0 (16) + -------- -xxxxxxx EnvTarget0 +1e x------- -------- EnvRate3 (16) + -xxxxxxx -------- EnvTarget3 + -------- x------- EnvRate2 (16) + -------- -xxxxxxx EnvTarget2 +*/ + +u16 vr0sound_device::channel_t::read(offs_t offset) +{ + u16 ret = 0; + + switch (offset) + { + case 0x00/2: + ret = CurSAddr & 0x0000ffff; + break; + case 0x02/2: + ret = (CurSAddr & 0xffff0000) >> 16; + break; + case 0x04/2: + ret = EnvVol & 0xffff; + break; + case 0x06/2: + ret = 0x6000 | (LD ? 0x1000 : 0) | ((EnvStage << 8) & 0x0f00) | ((EnvVol & 0xff0000) >> 16); + break; + case 0x08/2: + ret = dSAddr; + break; + case 0x0a/2: + ret = (Modes << 8) & 0x7f00; + break; + case 0x0c/2: + ret = LoopBegin & 0x00ffff; + break; + case 0x0e/2: + ret = ((LChnVol << 8) & 0x7f00) | ((LoopBegin & 0x3f0000) >> 16); + break; + case 0x10/2: + ret = LoopEnd & 0x00ffff; + break; + case 0x12/2: + ret = ((RChnVol << 8) & 0x7f00) | ((LoopEnd & 0x3f0000) >> 16); + break; + case 0x14/2: + case 0x16/2: + case 0x18/2: + case 0x1a/2: + ret = EnvRate[offset - (0x14/2)] & 0x0ffff; + break; + case 0x1c/2: + case 0x1e/2: + ret = (EnvTarget[((offset - (0x1c/2)) * 2) + 0] & 0x007f) | ((EnvTarget[((offset - (0x1c/2)) * 2) + 1] << 8) & 0x7f00); + ret |= ((EnvRate[((offset - (0x1c/2)) * 2) + 0] & 0x10000) >> 9) | ((EnvRate[((offset - (0x1c/2)) * 2) + 1] & 0x10000) >> 1); + break; + } + return ret; +} + +void vr0sound_device::channel_t::write(offs_t offset, u16 data, u16 mem_mask) +{ + u16 newdata = read(offset); + COMBINE_DATA(&newdata); + + data = newdata; + switch (offset) + { + case 0x00/2: + CurSAddr = (CurSAddr & 0xffff0000) | (data & 0x0000ffff); + break; + case 0x02/2: + CurSAddr = (CurSAddr & 0x0000ffff) | ((data << 16) & 0xffff0000); + break; + case 0x04/2: + EnvVol = (EnvVol & ~0xffff) | (data & 0xffff); + break; + case 0x06/2: + LD = data & 0x1000; + EnvStage = (data & 0x0f00) >> 8; + EnvVol = sign_ext((EnvVol & 0x00ffff) | ((data << 16) & 0xff0000), 24); + break; + case 0x08/2: + dSAddr = data & 0xffff; + break; + case 0x0a/2: + Modes = (data & 0x7f00) >> 8; + break; + case 0x0c/2: + LoopBegin = (LoopBegin & 0x3f0000) | (data & 0x00ffff); + break; + case 0x0e/2: + LChnVol = (data & 0x7f00) >> 8; + LoopBegin = (LoopBegin & 0x00ffff) | ((data << 16) & 0x3f0000); + break; + case 0x10/2: + LoopEnd = (LoopEnd & 0x3f0000) | (data & 0x00ffff); + break; + case 0x12/2: + RChnVol = (data & 0x7f00) >> 8; + LoopEnd = (LoopEnd & 0x00ffff) | ((data << 16) & 0x3f0000); + break; + case 0x14/2: + case 0x16/2: + case 0x18/2: + case 0x1a/2: + EnvRate[offset - (0x14/2)] = (EnvRate[offset - (0x14/2)] & ~0xffff) | (data & 0xffff); + break; + case 0x1c/2: + case 0x1e/2: + EnvTarget[((offset - (0x1c/2)) * 2) + 0] = (data & 0x007f); + EnvTarget[((offset - (0x1c/2)) * 2) + 1] = ((data & 0x7f00) >> 8); + EnvRate[((offset - (0x1c/2)) * 2) + 0] = sign_ext((EnvRate[((offset - (0x1c/2)) * 2) + 0] & 0xffff) | ((data & 0x0080) << 9), 17); + EnvRate[((offset - (0x1c/2)) * 2) + 1] = sign_ext((EnvRate[((offset - (0x1c/2)) * 2) + 1] & 0xffff) | ((data & 0x8000) << 1), 17); + break; + } +} + +void vr0sound_device::VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_sample_t *r) +{ + int div; + if (m_ChnClkNum) + div = ((30 << 16) | 0x8000) / (m_ChnClkNum + 1); // TODO : Verify algorithm else - div=1<<16; + div = 1 << 16; - for(s=0;s<nsamples;++s) + for (int s = 0; s < nsamples; s++) { - int i; - lsample=rsample=0; - for(i=0;i<=NCH;++i) + s32 lsample = 0, rsample = 0; + for (int i = 0; i <= m_MaxChn; i++) { - signed int sample; - uint32_t cur=CURSADDR(i); - uint32_t a=LOOPBEGIN(i)+(cur>>10); - uint8_t Mode=m_SOUNDREGS[(0x20/4)*i+0x8/4]>>24; - signed int LVOL=m_SOUNDREGS[(0x20/4)*i+0xc/4]>>24; - signed int RVOL=m_SOUNDREGS[(0x20/4)*i+0x10/4]>>24; - - int32_t DSADD=(DSADDR(i)*div)>>16; + channel_t *channel = &m_channel[i]; + s32 sample = 0; + const u32 loopbegin_scaled = channel->LoopBegin << 10; + const u32 loopend_scaled = channel->LoopEnd << 10; - if(!(st&(1<<i)) || !(CT2&0x80)) + if (!(m_Status & (1 << i)) || !(m_Ctrl & CTRL_RS)) continue; - if(Mode&0x10) //u-law + if (channel->Modes & MODE_ULAW) //u-law { - uint16_t s=SAMPLES[a]; - if((cur&0x200)) - s>>=8; - sample=(signed short)ULawTo16[s&0xff]; + sample = channel->Cache->read_byte(channel->CurSAddr >> 9); + sample = (s16)ULawTo16[sample & 0xff]; } else { - if(Mode&0x20) //8bit + if (channel->Modes & MODE_8BIT) //8bit { - uint16_t s=SAMPLES[a]; - if((cur&0x200)) - s>>=8; - sample=(signed short) (((signed char) (s&0xff))<<8); + sample = channel->Cache->read_byte(channel->CurSAddr >> 9); + sample = (s16)(((s8)(sample & 0xff)) << 8); } else //16bit { - sample=SAMPLES[a]; + sample = (s16)(channel->Cache->read_word((channel->CurSAddr >> 9) & ~1)); } } - CURSADDR(i)+=DSADD; - if(a>=LOOPEND(i)) + channel->CurSAddr += (channel->dSAddr * div) >> 16; + if (channel->CurSAddr >= loopend_scaled) { - if(Mode&1) //Loop - CURSADDR(i)=0;//LOOPBEGIN(i)<<10; + if (channel->Modes & MODE_LOOP) //Loop + channel->CurSAddr = (channel->CurSAddr - loopend_scaled) + loopbegin_scaled; else { - STATUS&=~(1<<(i&0x1f)); + m_Status &= ~(1 << (i & 0x1f)); + if (m_IntMask != 0xffffffff) // Interrupt, TODO : Partially implemented, Verify behavior from real hardware + { + const u32 old_pend = m_IntPend; + m_IntPend |= (~m_IntMask & (1 << (i & 0x1f))); // it's can be with loop? + if ((m_IntPend != 0) && (old_pend != m_IntPend)) + m_irq_cb(true); + } break; } } -// uint32_t v=(ENVVOL(i))>>8; -// sample=(sample*v)>>16; - lsample+=(sample*LVOL)>>8; - rsample+=(sample*RVOL)>>8; + + const s32 v = channel->EnvVol >> 16; + sample = (sample * v) >> 8; + + if (channel->Modes & MODE_ENVELOPE) // Envelope, TODO : Partially implemented, Verify behavior from real hardware + { + for (int level = 0; level < 4; level++) + { + if (BIT(channel->EnvStage, level)) + { + s32 RATE = (channel->EnvRate[level] * div) >> 16; + + channel->EnvVol += RATE; + if (RATE > 0) + { + if (((channel->EnvVol >> 16) & 0x7f) >= channel->EnvTarget[level]) + { + channel->EnvStage <<= 1; + } + } + else if (RATE < 0) + { + if (((channel->EnvVol >> 16) & 0x7f) <= channel->EnvTarget[level]) + { + channel->EnvStage <<= 1; + } + } + } + } + } + lsample += (sample * channel->LChnVol) >> 8; + rsample += (sample * channel->RChnVol) >> 8; } - if(lsample>32767) - lsample=32767; - if(lsample<-32768) - lsample=-32768; - l[s]=lsample; - if(rsample>32767) - rsample=32767; - if(rsample<-32768) - rsample=-32768; - r[s]=rsample; + l[s] = std::max(-32768, std::min(32767, lsample)); + r[s] = std::max(-32768, std::min(32767, rsample)); } } diff --git a/src/devices/sound/vrender0.h b/src/devices/sound/vrender0.h index a8af6da45c1..89432d4303b 100644 --- a/src/devices/sound/vrender0.h +++ b/src/devices/sound/vrender0.h @@ -5,6 +5,7 @@ #pragma once +#include <algorithm> //************************************************************************** // TYPE DEFINITIONS @@ -14,29 +15,142 @@ // ======================> vr0sound_device class vr0sound_device : public device_t, - public device_sound_interface + public device_sound_interface, + public device_memory_interface { public: - vr0sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + enum + { + AS_TEXTURE = 0, + AS_FRAME + }; - DECLARE_READ32_MEMBER( vr0_snd_read ); - DECLARE_WRITE32_MEMBER( vr0_snd_write ); + static constexpr feature_type imperfect_features() { return feature::SOUND; } - void set_areas(uint16_t *texture, uint16_t *frame); + vr0sound_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + auto irq_callback() { return m_irq_cb.bind(); } + + u16 channel_r(offs_t offset); + void channel_w(offs_t offset, u16 data, u16 mem_mask); + + u16 status_r(offs_t offset); + void status_w(offs_t offset, u16 data); + + u16 noteon_r(offs_t offset); + void noteon_w(offs_t offset, u16 data); + + u16 revfactor_r(offs_t offset); + void revfactor_w(offs_t offset, u16 data, u16 mem_mask); + + u16 buffersaddr_r(offs_t offset); + void buffersaddr_w(offs_t offset, u16 data, u16 mem_mask); + + u16 buffersize0_r(offs_t offset); + void buffersize0_w(offs_t offset, u16 data, u16 mem_mask); + + u16 buffersize1_r(offs_t offset); + void buffersize1_w(offs_t offset, u16 data, u16 mem_mask); + + u16 buffersize2_r(offs_t offset); + void buffersize2_w(offs_t offset, u16 data, u16 mem_mask); + + u16 buffersize3_r(offs_t offset); + void buffersize3_w(offs_t offset, u16 data, u16 mem_mask); + + u16 intmask_r(offs_t offset); + void intmask_w(offs_t offset, u16 data, u16 mem_mask); + + u16 intpend_r(offs_t offset); + void intpend_w(offs_t offset, u16 data, u16 mem_mask); + + u16 chnnum_r(offs_t offset); + void chnnum_w(offs_t offset, u16 data, u16 mem_mask); + + u16 ctrl_r(offs_t offset); + void ctrl_w(offs_t offset, u16 data, u16 mem_mask); + + void sound_map(address_map &map); protected: // device-level overrides virtual void device_start() override; + virtual void device_post_load() override; + virtual void device_clock_changed() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + // device_memory_interface configuration + virtual space_config_vector memory_space_config() const override; + + address_space_config m_texture_config; + address_space_config m_frame_config; private: - int16_t *m_TexBase; - int16_t *m_FBBase; - uint32_t m_SOUNDREGS[0x10000/4]; + enum + { + MODE_LOOP = (1 << 0), // Loop Enable + MODE_SUSTAIN = (1 << 1), // Run Sustain when Note Off (Not Implemented) + MODE_ENVELOPE = (1 << 2), // Enable Envelope + MODE_PINGPONG = (1 << 3), // Pingpong Loop (Not Implemented) + MODE_ULAW = (1 << 4), // u-Law + MODE_8BIT = (1 << 5), // 8 Bit (1) / 16 Bit (0) samples + MODE_TEXTURE = (1 << 6) // Wave Source (1 = Texture memory, 0 = Frame memory) + }; + + enum + { + CTRL_RS = (1 << 15), // Enable Sound + CTRL_TM = (1 << 5), // Texture Memory Select (1 = Texture memory, 0 = Frame memory) + CTRL_RE = (1 << 4), // Reverb Enable (Not Implemented) + CTRL_CW = (1 << 2), // 32bit Adder Wait (Not Implemented) + CTRL_AW = (1 << 1), // 16bit Adder Wait (Not Implemented) + CTRL_MW = (1 << 0) // Multiplier Wait (Not Implemented) + }; + + struct channel_t + { + channel_t() + { + std::fill(std::begin(EnvRate), std::end(EnvRate), 0); + std::fill(std::begin(EnvTarget), std::end(EnvTarget), 0); + } + + memory_access_cache<1, 0, ENDIANNESS_LITTLE> *Cache; + u32 CurSAddr = 0; // Current Address Pointer, 22.10 Fixed Point + s32 EnvVol = 0; // Envelope Volume (Overall Volume), S.7.16 Fixed Point + u8 EnvStage = 1; // Envelope Stage + u16 dSAddr = 0; // Frequency, 6.10 Fixed Point + u8 Modes = 0; // Modes + bool LD = true; // Loop Direction (Not Implemented) + u32 LoopBegin = 0; // Loop Start Pointer, High 22 Bits + u32 LoopEnd = 0; // Loop End Pointer, High 22 Bits + u8 LChnVol = 0; // Left Volume, 7 bit unsigned + u8 RChnVol = 0; // Right Volume, 7 bit unsigned + s32 EnvRate[4]; // Envenloe Rate per Each stages, S.16 Fixed Point + u8 EnvTarget[4]; // Envelope Target Volume per Each stages, High 7 Bits + u16 read(offs_t offset); + void write(offs_t offset, u16 data, u16 mem_mask); + }; + + memory_access_cache<1, 0, ENDIANNESS_LITTLE> *m_texcache; + memory_access_cache<1, 0, ENDIANNESS_LITTLE> *m_fbcache; + memory_access_cache<1, 0, ENDIANNESS_LITTLE> *m_texcache_ctrl; + + channel_t m_channel[32]; sound_stream *m_stream; + devcb_write_line m_irq_cb; + // Registers + u32 m_Status = 0; // Status (0 Idle, 1 Busy) + u32 m_NoteOn = 0; // Note On (0 Off, 1 On) (Not Implemented) + u8 m_RevFactor = 0; // Reverb Factor (Not Implemented) + u32 m_BufferAddr = 0; // 21bit Reverb Buffer Start Address (Not Implemented) + u16 m_BufferSize[4] = {0, 0, 0, 0}; // Reverb Buffer Size (Not Implemented) + u32 m_IntMask = 0; // Interrupt Mask (0 Enable, 1 Disable) + u32 m_IntPend = 0; // Interrupt Pending + u8 m_MaxChn = 0x1f; // Max Channels - 1 + u8 m_ChnClkNum = 0; // Clock Number per Channel + u16 m_Ctrl = 0; // 0x602 Control Functions void VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_sample_t *r); }; diff --git a/src/devices/sound/ymf278b.cpp b/src/devices/sound/ymf278b.cpp index ada4a5544c7..ab2b9c7fb9c 100644 --- a/src/devices/sound/ymf278b.cpp +++ b/src/devices/sound/ymf278b.cpp @@ -44,6 +44,8 @@ - accurate timing of envelopes - LFO (vibrato, tremolo) - integrate YMF262 mixing (used by Fuuki games, not used by Psikyo and Metro games) + - Envelope and LFO function is similar algorithm as multipcm.cpp (except Damp, Pseudo Reverb) + Can it be merged with/ported to this? */ #include "emu.h" diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp index 4957a0343fa..5e333d9eec5 100644 --- a/src/devices/video/fixfreq.cpp +++ b/src/devices/video/fixfreq.cpp @@ -4,7 +4,7 @@ fixfreq.h - 2013 Couriersud + 2013-2020 Couriersud Fixed frequency monochrome monitor emulation @@ -14,24 +14,51 @@ ***************************************************************************/ #include "emu.h" +#include "ui/uimain.h" #include "rendutil.h" #include "fixfreq.h" -//#define VERBOSE 1 +// for quick and dirty debugging +#define VERBOSE 0 +#define LOG_OUTPUT_FUNC printf #include "logmacro.h" #include <algorithm> -/*************************************************************************** +// -------------------------------------------------------------------------- +// Fixed frequency monitor +// -------------------------------------------------------------------------- - Fixed frequency monitor +// device type definition +DEFINE_DEVICE_TYPE(FIXFREQ, fixedfreq_device, "fixfreq", "Fixed-Frequency Monochrome Monitor") -***************************************************************************/ +// -------------------------------------------------------------------------- +// Port adjuster support +// -------------------------------------------------------------------------- +#define PORT_ADJUSTERX(_id, _name, _min, _max) \ + PORT_START(# _id) \ + configurer.field_alloc(IPT_ADJUSTER, (static_cast<fixedfreq_device &>(owner).monitor_val(_id)), 0xffff, ("Monitor - " _name)); \ + PORT_MINMAX(_min, _max) PORT_CHANGED_MEMBER(DEVICE_SELF, fixedfreq_device, port_changed, _id) \ + PORT_CONDITION("ENABLE", 0x01, EQUALS, 0x01) +#define IOPORT_ID(_id) ioport(# _id) -// device type definition -DEFINE_DEVICE_TYPE(FIXFREQ, fixedfreq_device, "fixfreq", "Fixed-Frequency Monochrome Monitor") +enum fixedfreq_tag_id_e +{ + HVISIBLE, + HFRONTPORCH, + HSYNC, + HBACKPORCH, + VVISIBLE, + VFRONTPORCH, + VSYNC, + VBACKPORCH, + SYNCTHRESHOLD, + VSYNCTHRESHOLD, + GAIN, + SCANLINE_HEIGHT +}; void fixedfreq_monitor_state::update_sync_channel(const time_type &time, const double newval) { @@ -40,59 +67,77 @@ void fixedfreq_monitor_state::update_sync_channel(const time_type &time, const d const int last_vsync = m_sig_vsync; const int last_comp = m_sig_composite; - m_vsync_filter += ((double) last_comp - m_vsync_filter) * (1.0 - exp(-delta_time * m_vsync_filter_timeconst)); + m_vsync_filter += ((double) last_comp - m_vsync_filter) * (1.0 - exp(-delta_time * m_desc.vsync_filter_timeconst())); m_sig_composite = (newval < m_desc.m_sync_threshold) ? 1 : 0 ; - m_sig_vsync = (m_vsync_filter > m_vsync_threshold) ? 1 : 0; + m_sig_vsync = (m_vsync_filter > m_desc.m_vsync_threshold) ? 1 : 0; if (!last_vsync && m_sig_vsync) { - //LOG("VSYNC %d %d\n", m_last_x, m_last_y + m_sig_field); - m_last_y = m_desc.m_vbackporch - m_desc.m_vsync; - m_intf.vsync_start_cb(std::max(time - m_last_vsync_time, m_min_frame_period)); + LOG("VSYNC UP %f %d\n", m_last_x, m_last_y); + m_intf.vsync_end_cb(time - m_last_vsync_time); + //auto d=time - m_last_vsync_time; + //printf("%f\n", 1.0 / d); m_last_vsync_time = time; + // FIXME: this is wrong: we need to count lines with half-scanline width + // to determine the field. + m_sig_field = last_comp; /* force false-progressive */ + m_sig_field = (m_sig_field ^ 1) ^ last_comp; /* if there is no field switch, auto switch */ + m_last_y = 0; //m_desc.vbackporch_width(); + + // discharge + //m_vsync_filter = 0.0; } else if (last_vsync && !m_sig_vsync) { - m_sig_field = last_comp; /* force false-progressive */ - m_sig_field = (m_sig_field ^ 1) ^ last_comp; /* if there is no field switch, auto switch */ + LOG("VSYNC DOWN %f %d\n", m_last_x, m_last_y); //LOG("Field: %d\n", m_sig_field); } if (!last_comp && m_sig_composite) { + if (m_sig_vsync) + LOG("Hsync in vsync\n"); /* TODO - time since last hsync and field detection */ //LOG("HSYNC up %d\n", m_last_x); - // FIXME: pixels > 50 filters some spurious hysnc on line 27 in breakout + // FIXME: pixels > 50 filters some spurious hysnc on line 23/24 in breakout + // The hsync signal transition from high to low is 7 pixels too + // early, goes up again after 6.8 pix and down after 7.2 pix. + // Therefore we need to filter early low to high transitions + // and base hsync on the start of the hsync signal. if (!m_sig_vsync && (m_last_x > m_desc.m_hscale * 100)) { m_last_y += m_desc.m_fieldcount; m_last_x = 0; - m_line_time = time; + m_line_time = time + 1.0 / m_desc.hsync_filter_timeconst(); } - //if (m_last_y == 27) printf("HSYNC up %d %d\n", m_last_y, pixels); + //if (!m_sig_vsync && (m_last_x < m_desc.m_hscale * 100)) + // printf("HSYNC up %d %f\n", m_last_y, m_last_x); } else if (last_comp && !m_sig_composite) { /* falling composite */ //LOG("HSYNC down %f %d %f\n", time * 1e6, m_last_x, m_sync_signal); } - - m_sync_signal = newval; + m_last_sync = newval; m_last_sync_time = time; } void fixedfreq_monitor_state::update_bm(const time_type &time) { - const float pixels = (time - m_line_time) * static_cast<time_type>(m_desc.m_hscale) / m_clock_period; + const float pixels = (time - m_line_time) * (double) m_desc.monitor_clock(); const int has_fields = (m_desc.m_fieldcount > 1) ? 1: 0; + const float fhscale(static_cast<float>(m_desc.m_hscale)); - uint32_t col(0xffff0000); // Mark sync areas - - if (m_sync_signal >= m_desc.m_sync_threshold) - col = m_col; + //uint32_t col(0xffff0000); // Mark sync areas + //if (m_last_sync >= m_desc.m_sync_threshold) + // col = m_col; - m_fragments.push_back({static_cast<float>(m_last_y + m_sig_field * has_fields), m_last_x, pixels, col}); + if (!m_sig_vsync && !m_sig_composite) + { + m_fragments.push_back({static_cast<float>(m_last_y + m_sig_field * has_fields), + m_last_x * fhscale, pixels * fhscale, m_col}); + } //m_intf.plot_hline(m_last_x, m_last_y + m_sig_field * has_fields, pixels, col); m_last_x = pixels; } @@ -102,11 +147,13 @@ void fixedfreq_monitor_state::update_composite_monochrome(const time_type &time, update_bm(time); update_sync_channel(time, data); - int colv = (int) ((data - m_desc.m_sync_threshold) * m_desc.m_gain * 255.0); + //int colv = (int) ((data - m_desc.m_sync_threshold) * m_desc.m_gain * 255.0); + int colv = (int) ((data - 1.5) * m_desc.m_gain * 255.0); if (colv > 255) colv = 255; if (colv < 0) - m_col = 0xffff0000; + //m_col = 0xffff0000; + m_col = 0x0000000; else m_col = 0xff000000 | (colv<<16) | (colv<<8) | colv; } @@ -159,9 +206,9 @@ void fixedfreq_monitor_state::update_sync(const time_type &time, const double da fixedfreq_device::fixedfreq_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_video_interface(mconfig, *this, false), - m_htotal(0), - m_vtotal(0), - m_refresh_period(time_type(0)), + m_enable(*this, "ENABLE"), + m_vector(*this, "VECTOR"), + m_scanline_height(1.0), m_monitor(), m_state(m_monitor, *this) { @@ -176,103 +223,193 @@ void fixedfreq_device::device_config_complete() { if (!has_screen()) return; - if (!screen().refresh_attoseconds()) - screen().set_raw(m_monitor.m_monitor_clock, m_monitor.m_hbackporch, 0, - m_monitor.m_hbackporch, m_monitor.m_vbackporch, 0, - m_monitor.m_vbackporch); - + screen().set_raw(m_monitor.m_monitor_clock, m_monitor.htotal(), 0, + m_monitor.htotal(), m_monitor.vtotal(), 0, + m_monitor.vtotal()); if (!screen().has_screen_update()) screen().set_screen_update(*this, FUNC(fixedfreq_device::screen_update)); + LOG("config complete\n"); } void fixedfreq_device::device_start() { - - m_refresh_period = time_type(0); - - m_htotal = m_monitor.m_hbackporch; - m_vtotal = m_monitor.m_vbackporch; - m_state.start(); // FIXME: will be done by netlist going forward - save_item(NAME(m_state.m_sync_signal)); + save_item(NAME(m_state.m_last_sync)); save_item(NAME(m_state.m_last_x)); save_item(NAME(m_state.m_last_y)); save_item(NAME(m_state.m_last_sync_time)); save_item(NAME(m_state.m_line_time)); save_item(NAME(m_state.m_last_hsync_time)); save_item(NAME(m_state.m_last_vsync_time)); - save_item(NAME(m_refresh_period)); - save_item(NAME(m_state.m_clock_period)); /* sync separator */ save_item(NAME(m_state.m_vsync_filter)); - save_item(NAME(m_state.m_vsync_threshold)); - save_item(NAME(m_state.m_vsync_filter_timeconst)); save_item(NAME(m_state.m_sig_vsync)); save_item(NAME(m_state.m_sig_composite)); save_item(NAME(m_state.m_sig_field)); + LOG("start\n"); } void fixedfreq_device::device_reset() { m_state.reset(); + LOG("Reset\n"); + //ioport("YYY")->field(0xffff)->live().value = 20; +#if 0 + //IOPORT_ID(HVISIBLE)->field(~0)->set_value(m_monitor.m_hvisible); + //IOPORT_ID(HVISIBLE)->update_defvalue(false); + IOPORT_ID(HVISIBLE)->live().defvalue = m_monitor.m_hvisible; + IOPORT_ID(HFRONTPORCH)->write(m_monitor.m_hsync); + IOPORT_ID(HSYNC)->write(m_monitor.m_hfrontporch); + IOPORT_ID(HBACKPORCH)->write(m_monitor.m_hbackporch); + IOPORT_ID(VVISIBLE)->write(m_monitor.m_vvisible); + IOPORT_ID(VFRONTPORCH)->write(m_monitor.m_vfrontporch); + IOPORT_ID(VSYNC)->write(m_monitor.m_vsync); + IOPORT_ID(VBACKPORCH)->write(m_monitor.m_vbackporch); + IOPORT_ID(SYNCTHRESHOLD)->write(m_monitor.m_sync_threshold * 1000.0); + IOPORT_ID(GAIN)->write(m_monitor.m_gain * 1000.0); +#endif } void fixedfreq_device::device_post_load() { //recompute_parameters(); + LOG("post load\n"); +} + +static uint32_t nom_col(uint32_t col) +{ + float r = ((col >> 16) & 0xff); + float g = ((col >> 8) & 0xff); + float b = ((col >> 0) & 0xff); + + float m = std::max(r, std::max(g,b)); + if (m == 0.0f) + return 0; + return (((uint32_t) m ) << 24) | (((uint32_t) (r/m*255.0f) ) << 16) + | (((uint32_t) (g/m*255.0f) ) << 8) | (((uint32_t) (b/m*255.0f) ) << 0); +} + +static void draw_testpat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + // Test pattern Grey scale + const int stripes = 255; + //auto va(screen.visible_area()); + auto &va(cliprect); + + for (int i = 0; i < stripes; i++) + { + int l = va.left() + (i * va.width() / stripes); + int w = (va.left() + (i+1) * va.width() / stripes) - l; + int v = (255 * i) / stripes; + bitmap.plot_box(l, va.top()+20, w, va.height()/2-20, rgb_t(0xff, v, v, v)); + } + + int l(va.left() + va.width() / 4); + int w(va.width() / 4); + int t(va.top() + va.height() / 2); + int h(va.height() / 2); + // 50% Test pattern + for (int i = t; i < t + h; i += 2) + { + bitmap.plot_box(l, i, w, i, rgb_t(0xff, 0xff, 0xff, 0xff)); + bitmap.plot_box(l, i + 1, w, i + 1, rgb_t(0xff, 0, 0, 0)); + } + l += va.width() / 4; + bitmap.plot_box(l, t, w, h, rgb_t(0xff, 0xc3, 0xc3, 0xc3)); // 195 } uint32_t fixedfreq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + //printf("%f %f\n", m_state.m_fragments[0].y, m_state.m_fragments[m_state.m_fragments.size()-1].y); + bool force_vector = screen.screen_type() == SCREEN_TYPE_VECTOR || (m_vector->read() & 1); + bool debug_timing = (m_enable->read() & 2) == 2; + bool test_pat = (m_enable->read() & 4) == 4; + rgb_t backcol = debug_timing ? rgb_t(0xff, 0xff, 0x00, 0x00) : rgb_t(0xff, 0x00, 0x00, 0x00); - if (screen.screen_type() == SCREEN_TYPE_RASTER) + if (!force_vector) { + screen.set_video_attributes(0); + bitmap.fill(backcol); for (auto &f : m_state.m_fragments) if (f.y < bitmap.height()) bitmap.plot_box(f.x, f.y, f.xr - f.x, 1, f.col); + + if (test_pat) + draw_testpat(screen, bitmap, cliprect); } - else if (screen.screen_type() == SCREEN_TYPE_VECTOR) + else { - constexpr const uint32_t flags(PRIMFLAG_ANTIALIAS(1) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_VECTOR(1)); + screen.set_video_attributes(VIDEO_SELF_RENDER); + + const uint32_t flags(PRIMFLAG_ANTIALIAS(1) + | PRIMFLAG_BLENDMODE(BLENDMODE_ADD) + | (screen.screen_type() == SCREEN_TYPE_VECTOR ? PRIMFLAG_VECTOR(1) : 0)); const rectangle &visarea = screen.visible_area(); - float xscale = 1.0f / visarea.width(); - float yscale = 1.0f / visarea.height(); + float xscale = 1.0f / (float)visarea.width(); + float yscale = 1.0f / (float)visarea.height(); float xoffs = (float)visarea.min_x; float yoffs = (float)visarea.min_y; screen.container().empty(); - screen.container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_VECTORBUF(1)); + screen.container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0x00,0x00,0x00), + PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) + | (screen.screen_type() == SCREEN_TYPE_VECTOR ? PRIMFLAG_VECTORBUF(1) : 0)); + float last_y = -1e6; for (auto &f : m_state.m_fragments) { const float x0((f.x - xoffs) * xscale); const float y0((f.y - yoffs) * yscale); const float x1((f.xr - xoffs) * xscale); - const float y1((f.y + 1.0f - yoffs) * yscale); - screen.container().add_rect( - x0, y0, x1, y1, - (0xff << 24) | (f.col & 0xffffff), - flags); + rgb_t col = (debug_timing && f.y < last_y) ? backcol : (rgb_t) f.col; + // FIXME: Debug check for proper vsync timing +#if 0 + auto w = m_scanline_height * xscale * 0.5; + screen.container().add_line( + x0+w, y0, x1-w, y0, m_scanline_height*yscale, + nom_col(f.col), +// (0xff << 24) | (f.col & 0xffffff), + flags); +#elif 1 + const float y1((f.y + m_scanline_height - yoffs) * yscale); + screen.container().add_rect( + x0, y0, x1, y1, + nom_col(col), +// (0xaf << 24) | (f.col & 0xffffff), + flags); +#else + const float y1((f.y + m_scanline_height - yoffs) * yscale); + // Crashes with bgfx + screen.container().add_quad( + x0, y0, x1, y1, + rgb_t(nom_col(f.col)), +// (0xaf << 24) | (f.col & 0xffffff), + m_texture, + flags); +#endif + last_y = f.y; } } m_state.m_fragments.clear(); return 0; } -void fixedfreq_device::vsync_start_cb(double refresh_time) +void fixedfreq_device::vsync_end_cb(double refresh_time) { - // toggle bitmap - //m_cur_bm ^= 1; + const auto expected_frame_period(m_monitor.clock_period() * m_monitor.vtotal() * m_monitor.htotal()); + + const auto refresh_limited(std::min(4.0 * expected_frame_period, + std::max(refresh_time, 0.25 * expected_frame_period))); rectangle visarea(m_monitor.minh(), m_monitor.maxh(), m_monitor.minv(), m_monitor.maxv()); - m_refresh_period = refresh_time; - screen().configure(m_htotal * m_monitor.m_hscale, m_vtotal, visarea, DOUBLE_TO_ATTOSECONDS(m_refresh_period)); + screen().configure(m_monitor.htotal_scaled(), m_monitor.vtotal(), visarea, DOUBLE_TO_ATTOSECONDS(refresh_limited)); + screen().reset_origin(m_state.m_last_y-(m_monitor.vsync_width() + m_monitor.vbackporch_width()), 0); } NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_composite_monochrome) @@ -316,3 +453,138 @@ NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_sync) } /***************************************************************************/ + +static INPUT_PORTS_START(fixedfreq_base_ports) + PORT_START("ENABLE") + PORT_CONFNAME( 0x01, 0x00, "Display Monitor sliders" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x01, DEF_STR( On ) ) + PORT_CONFNAME( 0x02, 0x00, "Visual Timing Debug" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x02, DEF_STR( On ) ) + PORT_CONFNAME( 0x04, 0x00, "Display gray test pattern" ) PORT_CONDITION("VECTOR", 0x01, EQUALS, 0x00) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x04, DEF_STR( On ) ) + + PORT_ADJUSTERX(HVISIBLE, "H Visible", 10, 1000) + PORT_ADJUSTERX(HFRONTPORCH, "H Front porch width", 1, 100) + PORT_ADJUSTERX(HSYNC, "H Sync width", 1, 100) + PORT_ADJUSTERX(HBACKPORCH, "H Back porch width", 1, 1000) + PORT_ADJUSTERX(VVISIBLE, "V Visible", 1, 1000) + PORT_ADJUSTERX(VFRONTPORCH, "V Front porch width", 0, 100) + PORT_ADJUSTERX(VSYNC, "V Sync width", 1, 100) + PORT_ADJUSTERX(VBACKPORCH, "V Back porch width", 1, 100) + PORT_ADJUSTERX(SYNCTHRESHOLD, "Sync threshold mV", 10, 2000) + PORT_ADJUSTERX(VSYNCTHRESHOLD, "V Sync threshold mV", 10, 1000) + PORT_ADJUSTERX(GAIN, "Signal Gain", 10, 1000) + PORT_ADJUSTERX(SCANLINE_HEIGHT, "Scanline Height", 10, 300) +INPUT_PORTS_END + + +static INPUT_PORTS_START(fixedfreq_raster_ports) + PORT_START("VECTOR") + PORT_CONFNAME( 0x01, 0x00, "Use vector rendering" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x01, DEF_STR( On ) ) + + PORT_INCLUDE(fixedfreq_base_ports) + +INPUT_PORTS_END + +static INPUT_PORTS_START(fixedfreq_vector_ports) + PORT_INCLUDE(fixedfreq_base_ports) +INPUT_PORTS_END + +ioport_constructor fixedfreq_device::device_input_ports() const +{ + LOG("input ports\n"); + if (has_screen()) + { + if (screen().screen_type() == SCREEN_TYPE_RASTER) + return INPUT_PORTS_NAME(fixedfreq_raster_ports); + else + return INPUT_PORTS_NAME(fixedfreq_vector_ports); + } + else + return nullptr; +} + +unsigned fixedfreq_device::monitor_val(unsigned param) const +{ + switch (param) + { + case HVISIBLE: + return m_monitor.hvisible_width(); + case HFRONTPORCH: + return m_monitor.hfrontporch_width(); + case HSYNC: + return m_monitor.hsync_width(); + case HBACKPORCH: + return m_monitor.hbackporch_width(); + case VVISIBLE: + return m_monitor.vvisible_width(); + case VFRONTPORCH: + return m_monitor.vfrontporch_width(); + case VSYNC: + return m_monitor.vsync_width(); + case VBACKPORCH: + return m_monitor.vbackporch_width(); + case SYNCTHRESHOLD: + return m_monitor.m_sync_threshold * 1000.0; + case VSYNCTHRESHOLD: + return m_monitor.m_vsync_threshold * 1000.0; + case GAIN: + return m_monitor.m_gain * 100.0; + case SCANLINE_HEIGHT: + return m_scanline_height * 100.0; + } + return 0; +} + +INPUT_CHANGED_MEMBER(fixedfreq_device::port_changed) +{ + auto &m(m_monitor); + + LOG("%d %d\n", param, newval); + switch (param) + { + case HVISIBLE: + m.set_h_rel(newval, m.hfrontporch_width(), m.hsync_width(), m.hbackporch_width()); + break; + case HFRONTPORCH: + m.set_h_rel(m.hvisible_width(), newval, m.hsync_width(), m.hbackporch_width()); + break; + case HSYNC: + m.set_h_rel(m.hvisible_width(), m.hfrontporch_width(), newval, m.hbackporch_width()); + break; + case HBACKPORCH: + m.set_h_rel(m.hvisible_width(), m.hfrontporch_width(), m.hsync_width(), newval); + break; + case VVISIBLE: + m.set_v_rel(newval, m.vfrontporch_width(), m.vsync_width(), m.vbackporch_width()); + break; + case VFRONTPORCH: + m.set_v_rel(m.vvisible_width(), newval, m.vsync_width(), m.vbackporch_width()); + break; + case VSYNC: + m.set_v_rel(m.vvisible_width(), m.vfrontporch_width(), newval, m.vbackporch_width()); + break; + case VBACKPORCH: + m.set_v_rel(m.vvisible_width(), m.vfrontporch_width(), m.vsync_width(), newval); + break; + case SYNCTHRESHOLD: + m.m_sync_threshold = static_cast<double>(newval) / 1000.0; + break; + case VSYNCTHRESHOLD: + m.m_vsync_threshold = static_cast<double>(newval) / 1000.0; + break; + case GAIN: + m.m_gain = static_cast<double>(newval) / 100.0; + break; + case SCANLINE_HEIGHT: + m_scanline_height = static_cast<double>(newval) / 100.0; + break; + } + machine().ui().popup_time(5, "Screen Dim %d x %d\n", m.htotal(), m.vtotal()); + //ioport("YYY")->update_defvalue(true); +} diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h index fdbf728f04a..6d1da4f22f7 100644 --- a/src/devices/video/fixfreq.h +++ b/src/devices/video/fixfreq.h @@ -22,6 +22,11 @@ struct fixedfreq_monitor_desc fixedfreq_monitor_desc() // default to NTSC "704x480@30i" : m_monitor_clock(13500000), + m_fieldcount(2), + m_sync_threshold(0.3), + m_gain(1.0 / 3.7), + m_hscale(1), + m_vsync_threshold(0.600), // trigger at 91% of vsync length 1-exp(-0.6) m_hvisible(704), m_hfrontporch(728), m_hsync(791), @@ -29,19 +34,64 @@ struct fixedfreq_monitor_desc m_vvisible(480), m_vfrontporch(486), m_vsync(492), - m_vbackporch(525), - m_fieldcount(2), - m_sync_threshold(0.3), - m_gain(1.0 / 3.7), - m_hscale(1) + m_vbackporch(525) {} - int minh() const { return (m_hbackporch - m_hfrontporch) * m_hscale; } - int maxh() const { return (m_hbackporch - m_hfrontporch + m_hvisible) * m_hscale - 1; } - int minv() const { return m_vbackporch - m_vfrontporch; } - int maxv() const { return m_vbackporch - m_vfrontporch + m_vvisible - 1; } + uint32_t monitor_clock() const noexcept { return m_monitor_clock; } + double clock_period() const noexcept { return 1.0 / (double) m_monitor_clock; }; + + int minh() const noexcept { return (m_hbackporch - m_hsync) * m_hscale; } + int maxh() const noexcept { return (m_hbackporch - m_hsync + m_hvisible) * m_hscale - 1; } + int minv() const noexcept { return m_vbackporch - m_vsync; } + int maxv() const noexcept { return m_vbackporch - m_vsync + m_vvisible - 1; } + + int htotal_scaled() const noexcept { return m_hbackporch * m_hscale; } + + int vbackporch_width() const noexcept { return m_vbackporch - m_vsync; } + int vsync_width() const noexcept { return m_vsync - m_vfrontporch; } + int vfrontporch_width() const noexcept { return m_vfrontporch - m_vvisible; } + int vvisible_width() const noexcept { return m_vvisible; } + int vtotal() const noexcept { return m_vbackporch; } + + int hbackporch_width() const noexcept { return m_hbackporch - m_hsync; } + int hsync_width() const noexcept { return m_hsync - m_hfrontporch; } + int hfrontporch_width() const noexcept { return m_hfrontporch - m_hvisible; } + int hvisible_width() const noexcept { return m_hvisible; } + int htotal() const noexcept { return m_hbackporch; } + + void set_h_rel(int vw, int fpw, int sw, int bpw) + { + m_hvisible = vw; + m_hfrontporch = m_hvisible + fpw; + m_hsync = m_hfrontporch + sw; + m_hbackporch = m_hsync + bpw; + } + + void set_v_rel(int vw, int fpw, int sw, int bpw) + { + m_vvisible = vw; + m_vfrontporch = m_vvisible + fpw; + m_vsync = m_vfrontporch + sw; + m_vbackporch = m_vsync + bpw; + } + + double vsync_filter_timeconst() const noexcept + { + return (double) (m_monitor_clock) / ((double) m_hbackporch * vsync_width()); + } + + double hsync_filter_timeconst() const noexcept + { + return (double) m_monitor_clock / (double) hsync_width(); + } uint32_t m_monitor_clock; + int m_fieldcount; + double m_sync_threshold; + double m_gain; + int m_hscale; + double m_vsync_threshold; +private: int m_hvisible; int m_hfrontporch; int m_hsync; @@ -50,16 +100,12 @@ struct fixedfreq_monitor_desc int m_vfrontporch; int m_vsync; int m_vbackporch; - int m_fieldcount; - double m_sync_threshold; - double m_gain; - int m_hscale; }; struct fixedfreq_monitor_intf { virtual ~fixedfreq_monitor_intf() = default; - virtual void vsync_start_cb(double refresh_time) = 0; + virtual void vsync_end_cb(double refresh_time) = 0; }; struct fixedfreq_monitor_line @@ -77,7 +123,7 @@ struct fixedfreq_monitor_state fixedfreq_monitor_state(fixedfreq_monitor_desc &desc, fixedfreq_monitor_intf &intf) : m_desc(desc), m_intf(intf), - m_sync_signal(0), + m_last_sync(0), m_col(0), m_last_x(0), m_last_y(0), @@ -85,14 +131,10 @@ struct fixedfreq_monitor_state m_line_time(time_type(0)), m_last_hsync_time(time_type(0)), m_last_vsync_time(time_type(0)), - m_clock_period(time_type(0)), m_vsync_filter(0), - m_vsync_threshold(0), - m_vsync_filter_timeconst(0), m_sig_vsync(0), m_sig_composite(0), - m_sig_field(0), - m_min_frame_period(time_type(0)) + m_sig_field(0) {} /*** @@ -103,7 +145,7 @@ struct fixedfreq_monitor_state // FIXME: once moved to netlist this may no longer be necessary. // Only copies constructor init - m_sync_signal = 0.0; + m_last_sync = 0.0; m_col = rgb_t(0,0,0); m_last_x = 0; m_last_y = 0; @@ -111,12 +153,9 @@ struct fixedfreq_monitor_state m_line_time = time_type(0); m_last_hsync_time = time_type(0); m_last_vsync_time = time_type(0); - m_clock_period = time_type(0); /* sync separator */ m_vsync_filter = 0.0; - m_vsync_threshold = 0.0; - m_vsync_filter_timeconst = 0.0; m_sig_vsync = 0; m_sig_composite = 0; @@ -127,22 +166,18 @@ struct fixedfreq_monitor_state /* sync separator */ - m_vsync_threshold = (exp(- 3.0/(3.0+3.0))) - exp(-1.0); - m_vsync_filter_timeconst = (double) (m_desc.m_monitor_clock) / (double) m_desc.m_hbackporch * 1.0; // / (3.0 + 3.0); - //LOG("trigger %f with len %f\n", m_vsync_threshold, 1e6 / m_vsync_filter_timeconst); - - m_clock_period = 1.0 / m_desc.m_monitor_clock; + //m_vsync_threshold = (exp(- 3.0/(3.0+3.0))) - exp(-1.0); + //printf("trigger %f with len %f\n", m_vsync_threshold, 1e6 / m_vsync_filter_timeconst); // Minimum frame period to be passed to video system ? - m_min_frame_period = 0.25 * m_clock_period * m_desc.m_vbackporch * m_desc.m_hbackporch; m_fragments.clear(); - m_intf.vsync_start_cb(m_min_frame_period); + m_intf.vsync_end_cb(m_desc.clock_period() * m_desc.vtotal() * m_desc.htotal()); } void reset() { - m_sync_signal = 0; + m_last_sync = 0; m_col = 0; m_last_x = 0; m_last_y = 0; @@ -171,7 +206,7 @@ struct fixedfreq_monitor_state const fixedfreq_monitor_desc &m_desc; fixedfreq_monitor_intf &m_intf; - double m_sync_signal; + double m_last_sync; uint32_t m_col; float m_last_x; int m_last_y; @@ -179,17 +214,13 @@ struct fixedfreq_monitor_state time_type m_line_time; time_type m_last_hsync_time; time_type m_last_vsync_time; - time_type m_clock_period; /* sync separator */ double m_vsync_filter; - double m_vsync_threshold; - double m_vsync_filter_timeconst; int m_sig_vsync; int m_sig_composite; int m_sig_field; - time_type m_min_frame_period; std::vector<fixedfreq_monitor_line> m_fragments; }; @@ -206,42 +237,48 @@ public: fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // inline configuration helpers - void set_monitor_clock(uint32_t clock) { m_monitor.m_monitor_clock = clock; } - void set_fieldcount(int count) { m_monitor.m_fieldcount = count; } - void set_threshold(double threshold) { m_monitor.m_sync_threshold = threshold; } - void set_gain(double gain) { m_monitor.m_gain = gain; } - void set_horz_params(int visible, int frontporch, int sync, int backporch) + fixedfreq_device &set_monitor_clock(uint32_t clock) { m_monitor.m_monitor_clock = clock; return *this;} + fixedfreq_device &set_fieldcount(int count) { m_monitor.m_fieldcount = count; return *this; } + fixedfreq_device &set_threshold(double threshold) { m_monitor.m_sync_threshold = threshold; return *this; } + fixedfreq_device &set_gain(double gain) { m_monitor.m_gain = gain; return *this; } + fixedfreq_device &set_horz_params(int visible, int frontporch, int sync, int backporch) { - m_monitor.m_hvisible = visible; - m_monitor.m_hfrontporch = frontporch; - m_monitor.m_hsync = sync; - m_monitor.m_hbackporch = backporch; + m_monitor.set_h_rel( + visible, + frontporch - visible, + sync - frontporch, + backporch - sync); + return *this; } - void set_vert_params(int visible, int frontporch, int sync, int backporch) + fixedfreq_device &set_vert_params(int visible, int frontporch, int sync, int backporch) { - m_monitor.m_vvisible = visible; - m_monitor.m_vfrontporch = frontporch; - m_monitor.m_vsync = sync; - m_monitor.m_vbackporch = backporch; + m_monitor.set_v_rel( + visible, + frontporch - visible, + sync - frontporch, + backporch - sync); + return *this; } - void set_horz_scale(int hscale) { m_monitor.m_hscale = hscale; } + fixedfreq_device &set_horz_scale(int hscale) { m_monitor.m_hscale = hscale; return *this;} // pre-defined configurations - void set_mode_ntsc720() //ModeLine "720x480@30i" 13.5 720 736 799 858 480 486 492 525 interlace -hsync -vsync + fixedfreq_device &set_mode_ntsc720() //ModeLine "720x480@30i" 13.5 720 736 799 858 480 486 492 525 interlace -hsync -vsync { set_monitor_clock(13500000); set_horz_params(720, 736, 799, 858); set_vert_params(480, 486, 492, 525); set_fieldcount(2); set_threshold(0.3); + return *this; } - void set_mode_ntsc704() //ModeLine "704x480@30i" 13.5 704 728 791 858 480 486 492 525 + fixedfreq_device &set_mode_ntsc704() //ModeLine "704x480@30i" 13.5 704 728 791 858 480 486 492 525 { set_monitor_clock(13500000); set_horz_params(704, 728, 791, 858); set_vert_params(480, 486, 492, 525); set_fieldcount(2); set_threshold(0.3); + return *this; } virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -252,6 +289,9 @@ public: NETDEV_ANALOG_CALLBACK_MEMBER(update_blue); NETDEV_ANALOG_CALLBACK_MEMBER(update_sync); + INPUT_CHANGED_MEMBER(port_changed); + + unsigned monitor_val(unsigned param) const; protected: @@ -264,14 +304,14 @@ protected: virtual void device_post_load() override; //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - void vsync_start_cb(double refresh_time) override; - -private: + virtual ioport_constructor device_input_ports() const override; - int m_htotal; - int m_vtotal; + void vsync_end_cb(double refresh_time) override; - time_type m_refresh_period; +private: + required_ioport m_enable; + required_ioport m_vector; + float m_scanline_height; /* adjustable by drivers */ fixedfreq_monitor_desc m_monitor; diff --git a/src/devices/video/hd44780.cpp b/src/devices/video/hd44780.cpp index f914cee1616..46291961f7b 100644 --- a/src/devices/video/hd44780.cpp +++ b/src/devices/video/hd44780.cpp @@ -6,7 +6,8 @@ TODO: - dump internal CGROM - - emulate osc pin, determine video timings and busy flag duration from it + - emulate osc pin, determine video timings and busy flag duration from it, + and if possible, remove m_busy_factor ***************************************************************************/ @@ -56,6 +57,7 @@ hd44780_device::hd44780_device(const machine_config &mconfig, const char *tag, d hd44780_device::hd44780_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_pixel_update_cb(*this) + , m_busy_factor(1.0) , m_cgrom(nullptr) , m_cgrom_region(*this, DEVICE_SELF) , m_rs_input(0) @@ -102,6 +104,7 @@ void hd44780_device::device_start() m_blink_timer->adjust(attotime::from_msec(409), 0, attotime::from_msec(409)); // state saving + save_item(NAME(m_busy_factor)); save_item(NAME(m_busy_flag)); save_item(NAME(m_ac)); save_item(NAME(m_dr)); @@ -191,7 +194,9 @@ void hd44780_device::set_charset_type(int type) void hd44780_device::set_busy_flag(uint16_t usec) { m_busy_flag = true; - m_busy_timer->adjust( attotime::from_usec( usec ) ); + + usec = float(usec) * m_busy_factor + 0.5; + m_busy_timer->adjust(attotime::from_usec(usec)); } void hd44780_device::correct_ac() diff --git a/src/devices/video/hd44780.h b/src/devices/video/hd44780.h index ec45d0005d1..71b88f6f6b4 100644 --- a/src/devices/video/hd44780.h +++ b/src/devices/video/hd44780.h @@ -32,6 +32,7 @@ public: // static configuration helpers void set_lcd_size(int lines, int chars) { m_lines = lines; m_chars = chars; } template <typename... T> void set_pixel_update_cb(T &&... args) { m_pixel_update_cb.set(std::forward<T>(args)...); } + void set_busy_factor(float f) { m_busy_factor = f; } // it's a workaround for inaccurate busy flag emulation // device interface void write(offs_t offset, u8 data); @@ -103,6 +104,7 @@ private: u8 m_chars; // chars for line pixel_update_delegate m_pixel_update_cb; // pixel update callback + float m_busy_factor; bool m_busy_flag; // busy flag u8 m_ddram[0x80]; // internal display data RAM u8 m_cgram[0x40]; // internal chargen RAM diff --git a/src/devices/video/huc6272.cpp b/src/devices/video/huc6272.cpp index b091b67afb9..88d71542d55 100644 --- a/src/devices/video/huc6272.cpp +++ b/src/devices/video/huc6272.cpp @@ -10,6 +10,8 @@ ADPCM related patents: - https://patents.google.com/patent/US5692099 + - https://patents.google.com/patent/US6453286 + - https://patents.google.com/patent/US5548655A ***************************************************************************/ @@ -497,9 +499,9 @@ uint8_t huc6272_device::adpcm_update(int chan) if (!m_adpcm.playing[chan]) return 0; - int rate = (1 << m_adpcm.rate); + const unsigned rate = (1 << m_adpcm.rate); m_adpcm.pos[chan]++; - if (m_adpcm.pos[chan] > rate) + if (m_adpcm.pos[chan] >= rate) { if (m_adpcm.input[chan] == -1) { @@ -541,6 +543,7 @@ uint8_t huc6272_device::adpcm_update(int chan) if (m_adpcm.nibble[chan] >= 28) m_adpcm.input[chan] = -1; } + m_adpcm.pos[chan] = 0; } return (m_adpcm.input[chan] >> m_adpcm.nibble[chan]) & 0xf; diff --git a/src/devices/video/huc6272.h b/src/devices/video/huc6272.h index 8d7f0583600..8380482f38b 100644 --- a/src/devices/video/huc6272.h +++ b/src/devices/video/huc6272.h @@ -27,6 +27,8 @@ class huc6272_device : public device_t, public device_memory_interface { public: + static constexpr feature_type imperfect_features() { return feature::SOUND | feature::GRAPHICS; } // Incorrect ADPCM and Graphics + // construction/destruction huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/devices/video/ims_cvc.cpp b/src/devices/video/ims_cvc.cpp index 14ae0901769..0c5b62dfff4 100644 --- a/src/devices/video/ims_cvc.cpp +++ b/src/devices/video/ims_cvc.cpp @@ -9,8 +9,6 @@ * * http://bitsavers.org/components/inmos/graphics/72-TRN-204-01_Graphics_Databook_Second_Edition_1990.pdf * - * TODO - * - cursor */ #include "emu.h" @@ -28,7 +26,7 @@ DEFINE_DEVICE_TYPE(G300, g300_device, "g300", "INMOS G300 Colour Video Controlle DEFINE_DEVICE_TYPE(G332, g332_device, "g332", "INMOS G332 Colour Video Controller") DEFINE_DEVICE_TYPE(G364, g364_device, "g364", "INMOS G364 Colour Video Controller") -ims_cvc_device::ims_cvc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +ims_cvc_device::ims_cvc_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) , device_palette_interface(mconfig, *this) , m_screen(*this, finder_base::DUMMY_TAG) @@ -36,23 +34,23 @@ ims_cvc_device::ims_cvc_device(const machine_config &mconfig, device_type type, { } -g300_device::g300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +g300_device::g300_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : ims_cvc_device(mconfig, G300, tag, owner, clock) { } -g332_device::g332_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +g332_device::g332_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) : ims_cvc_device(mconfig, type, tag, owner, clock) , m_microport(*this, "microport") { } -g332_device::g332_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +g332_device::g332_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : g332_device(mconfig, G332, tag, owner, clock) { } -g364_device::g364_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +g364_device::g364_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : g332_device(mconfig, G364, tag, owner, clock) { } @@ -65,7 +63,7 @@ void g332_device::device_add_mconfig(machine_config &config) void g300_device::map(address_map &map) { // datasheet gives unshifted addresses - const int shift = 2; + unsigned const shift = 2; // colour palette map(0x000 << shift, (0x0ff << shift) | 0x3).rw(FUNC(g300_device::colour_palette_r), FUNC(g300_device::colour_palette_w)); @@ -99,7 +97,7 @@ void g332_device::microport_map(address_map &map) { // datasheet uses unshifted addresses: configure the device map for 64 bit // address mode, bank device does handles additional shift for 32 bit mode - const int shift = 3; + unsigned const shift = 3; map(0x000 << shift, (0x000 << shift) | 0x7).w(FUNC(g332_device::boot_w)); @@ -129,11 +127,14 @@ void g332_device::microport_map(address_map &map) // checksum registers (0c0-0c2) + // cursor start (0c7) + map(0x0c7 << shift, (0x0c7 << shift) | 0x7).rw(FUNC(g332_device::cursor_start_r), FUNC(g332_device::cursor_start_w)); + // colour palette map(0x100 << shift, (0x1ff << shift) | 0x7).rw(FUNC(g332_device::colour_palette_r), FUNC(g332_device::colour_palette_w)); // cursor store (200-3ff) - // cursor position (0c7) + map(0x200 << shift, (0x3ff << shift) | 0x7).rw(FUNC(g332_device::cursor_store_r), FUNC(g332_device::cursor_store_w)); } void ims_cvc_device::device_start() @@ -153,6 +154,8 @@ void ims_cvc_device::device_start() save_item(NAME(m_mask)); save_item(NAME(m_tos)); save_item(NAME(m_boot)); + + save_item(NAME(m_swap)); } void ims_cvc_device::device_reset() @@ -170,11 +173,16 @@ void g332_device::device_start() { ims_cvc_device::device_start(); + m_cursor_store = std::make_unique<u16[]>(512); + save_item(NAME(m_vpreequalise)); save_item(NAME(m_vpostequalise)); save_item(NAME(m_linestart)); save_item(NAME(m_control_a)); save_item(NAME(m_control_b)); + save_item(NAME(m_cursor_start)); + + save_pointer(NAME(m_cursor_store), 512); } void g332_device::device_reset() @@ -182,18 +190,18 @@ void g332_device::device_reset() m_control_a = 0; } -u32 g300_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +u32 g300_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) { offs_t address = m_tos; for (int y = screen.visible_area().min_y; y <= screen.visible_area().max_y; y++) for (int x = screen.visible_area().min_x; x <= screen.visible_area().max_x; x++) - bitmap.pix(y, x) = pen_color(m_vram->read(address++) & m_mask); + bitmap.pix(y, x) = pen_color(m_vram->read(address++ ^ m_swap) & m_mask); return 0; } -u32 g332_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +u32 g332_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) { offs_t address = m_tos; @@ -203,7 +211,7 @@ u32 g332_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, cons for (int y = screen.visible_area().min_y; y <= screen.visible_area().max_y; y++) for (int x = screen.visible_area().min_x; x <= screen.visible_area().max_x; x += 8) { - u8 pixel_data = m_vram->read(address++); + u8 pixel_data = m_vram->read(address++ ^ m_swap); bitmap.pix(y, x + 0) = pen_color(pixel_data & 0x1 & m_mask); pixel_data >>= 1; bitmap.pix(y, x + 1) = pen_color(pixel_data & 0x1 & m_mask); pixel_data >>= 1; @@ -220,7 +228,7 @@ u32 g332_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, cons for (int y = screen.visible_area().min_y; y <= screen.visible_area().max_y; y++) for (int x = screen.visible_area().min_x; x <= screen.visible_area().max_x; x += 4) { - u8 pixel_data = m_vram->read(address++); + u8 pixel_data = m_vram->read(address++ ^ m_swap); bitmap.pix(y, x + 0) = pen_color(pixel_data & 0x3 & m_mask); pixel_data >>= 2; bitmap.pix(y, x + 1) = pen_color(pixel_data & 0x3 & m_mask); pixel_data >>= 2; @@ -233,7 +241,7 @@ u32 g332_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, cons for (int y = screen.visible_area().min_y; y <= screen.visible_area().max_y; y++) for (int x = screen.visible_area().min_x; x <= screen.visible_area().max_x; x += 2) { - u8 pixel_data = m_vram->read(address++); + u8 pixel_data = m_vram->read(address++ ^ m_swap); bitmap.pix(y, x + 0) = pen_color(pixel_data & 0xf & m_mask); pixel_data >>= 4; bitmap.pix(y, x + 1) = pen_color(pixel_data & 0xf & m_mask); @@ -243,34 +251,52 @@ u32 g332_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, cons case BPP_8: for (int y = screen.visible_area().min_y; y <= screen.visible_area().max_y; y++) for (int x = screen.visible_area().min_x; x <= screen.visible_area().max_x; x++) - bitmap.pix(y, x) = pen_color(m_vram->read(address++) & m_mask); + bitmap.pix(y, x) = pen_color(m_vram->read(address++ ^ m_swap) & m_mask); break; } - return 0; -} - -u32 ims_cvc_device::colour_palette_r(offs_t offset) -{ - return 0; -} - -void ims_cvc_device::colour_palette_w(offs_t offset, u32 data, u32 mem_mask) -{ - set_pen_color(offset >> 1, data >> 16, data >> 8, data >> 0); -} + if (!(m_control_a & CURSOR_DISABLE)) + { + // get cursor origin + int const cursor_x = screen.visible_area().min_x + (s32(m_cursor_start << 8) >> 20); + int const cursor_y = screen.visible_area().min_y + (s32(m_cursor_start << 20) >> 20); + + // intersect cursor with screen + rectangle cursor(cursor_x, cursor_x + 63, cursor_y, cursor_y + 63); + cursor &= bitmap.cliprect(); + + // check if any portion is visible + if (!cursor.empty()) + { + for (int y = 0; y < 64; y++) + { + // get screen y pixel coordinate + int const ypos = cursor_y + y; + + for (int x = 0; x < 8; x++) + { + // retrieve 8 pixels from cursor bitmap + u16 data = m_cursor_store[y * 8 + x]; + + // draw non-transparent pixels + for (int i = 0; data && i < 8; data >>= 2, i++) + { + // get screen x pixel coordinate + int const xpos = cursor_x + x * 8 + i; + + // draw pixel if visible + if ((data & 3) && cursor.contains(xpos, ypos)) + bitmap.pix(ypos, xpos) = pen_color(256 + (data & 3) - 1); + } + } + } + } + } -u32 g332_device::cursor_palette_r(offs_t offset) -{ return 0; } -void g332_device::cursor_palette_w(offs_t offset, u32 data, u32 mem_mask) -{ - set_pen_color(256 + (offset >> 1), data >> 16, data >> 8, data >> 0); -} - -void g332_device::boot_w(offs_t offset, u32 data, u32 mem_mask) +void g332_device::boot_w(u32 data) { LOG("boot_w %s clock, multiplier %d, %d bit alignment (%s)\n", (data & PLL_SELECT) ? "PLL" : "external", (data & PLL_MULTIPLIER), @@ -278,68 +304,69 @@ void g332_device::boot_w(offs_t offset, u32 data, u32 mem_mask) m_microport->set_shift((data & ALIGN_64) ? 0 : 1); - mem_mask &= 0x00ffffffU; - COMBINE_DATA(&m_boot); + m_boot = data & MASK24; } -void g332_device::control_a_w(offs_t offset, u32 data, u32 mem_mask) +void g332_device::control_a_w(u32 data) { LOG("control_a_w 0x%08x (%s)\n", data, machine().describe_context()); - mem_mask &= 0x00ffffffU; - COMBINE_DATA(&m_control_a); - - if (data & VTG_ENABLE) + if ((data ^ m_control_a) & MASK24) { - LOGMASKED(LOG_CONFIG, "VTG %s, %s, %s mode\n", - (data & VTG_ENABLE) ? "enabled" : "disabled", - (data & INTL_ENABLE) ? ((data & INTL_FORMAT) ? "interlaced (CCIR)" : "interlaced (EIA)") : "non-interlaced", - (data & SLAVE_MODE) ? "slave" : "master"); - - LOGMASKED(LOG_CONFIG, "%s sync, %s digital sync, analogue %s\n", - (data & SYNC_PATTERN) ? "plain" : "tesselated", - (data & SYNC_FORMAT) ? "separate" : "composite", - (data & VIDEO_FORMAT) ? "video only" : "composite video + sync"); - - LOGMASKED(LOG_CONFIG, "%s, CBlank is %s, %s, %s\n", - (data & BLANK_LEVEL) ? "blanking pedestal" : "no blank pedestal", - (data & BLANK_IO) ? "ouput" : "input", - (data & BLANK_FUNC) ? "undelayed ClkDisable" : "delayed CBlank", - (data & BLANK_FORCE) ? "screen blanked" : (data & BLANK_DISABLE) ? "blanking disabled" : "blanking enabled"); - - LOGMASKED(LOG_CONFIG, "address increment %d, DMA %s, sync delay %d cycles\n", - (data & ADDR_INC) == INC_1 ? 1 : - (data & ADDR_INC) == INC_256 ? (data & INTL_ENABLE) ? 2 : 256 : - (data & ADDR_INC) == INC_512 ? 512 : 1024, - (data & DMA_DISABLE) ? "disabled" : "enabled", - (data & SYNC_DELAY) >> 15); - - LOGMASKED(LOG_CONFIG, "interleave %s, pixel sampling %s, %s bits per pixel, cursor %s\n", - (data & INTERLEAVE) ? "enabled" : "disabled", - (data & SAMPLE_DELAY) ? "delayed" : "standard", - (data & PIXEL_BITS) == BPP_1 ? "1" : - (data & PIXEL_BITS) == BPP_2 ? "2" : - (data & PIXEL_BITS) == BPP_4 ? "4" : - (data & PIXEL_BITS) == BPP_8 ? "8" : - (data & PIXEL_BITS) == BPP_15 ? "15" : - (data & PIXEL_BITS) == BPP_16 ? "16" : "unknown", - (data & CURSOR_DISABLE) ? "disabled" : "enabled"); - - LOG("display %d vdisplay %d\n", m_display, m_vdisplay); - LOG("linetime %d halfsync %d backporch %d broadpulse %d\n", m_linetime, m_halfsync, m_backporch, m_broadpulse); - LOG("vsync %d vpreequalise %d vpostequalise %d vblank %d\n", m_vsync, m_vpreequalise, m_vpostequalise, m_vblank); - - int const hbend = (m_halfsync + m_halfsync + m_backporch) << 2; - int const vbend = (m_vpreequalise + m_vpostequalise + m_vsync + m_vblank) >> 1; - int const width = m_linetime << 2; - int const height = vbend + (m_vdisplay >> 1); - - rectangle const visarea(hbend, hbend + (m_display << 2) - 1, vbend, height - 1); - - u32 const dotclock = (m_boot & PLL_SELECT) ? clock() * (m_boot & PLL_MULTIPLIER) : clock(); - attotime const refresh = attotime::from_hz(dotclock / (width * height)); - - m_screen->configure(width, height, visarea, refresh.as_attoseconds()); - m_screen->reset_origin(); + m_control_a = data & MASK24; + + if (data & VTG_ENABLE) + { + LOGMASKED(LOG_CONFIG, "VTG %s, %s, %s mode\n", + (data & VTG_ENABLE) ? "enabled" : "disabled", + (data & INTL_ENABLE) ? ((data & INTL_FORMAT) ? "interlaced (CCIR)" : "interlaced (EIA)") : "non-interlaced", + (data & SLAVE_MODE) ? "slave" : "master"); + + LOGMASKED(LOG_CONFIG, "%s sync, %s digital sync, analogue %s\n", + (data & SYNC_PATTERN) ? "plain" : "tesselated", + (data & SYNC_FORMAT) ? "separate" : "composite", + (data & VIDEO_FORMAT) ? "video only" : "composite video + sync"); + + LOGMASKED(LOG_CONFIG, "%s, CBlank is %s, %s, %s\n", + (data & BLANK_LEVEL) ? "blanking pedestal" : "no blank pedestal", + (data & BLANK_IO) ? "ouput" : "input", + (data & BLANK_FUNC) ? "undelayed ClkDisable" : "delayed CBlank", + (data & BLANK_FORCE) ? "screen blanked" : (data & BLANK_DISABLE) ? "blanking disabled" : "blanking enabled"); + + LOGMASKED(LOG_CONFIG, "address increment %d, DMA %s, sync delay %d cycles\n", + (data & ADDR_INC) == INC_1 ? 1 : + (data & ADDR_INC) == INC_256 ? (data & INTL_ENABLE) ? 2 : 256 : + (data & ADDR_INC) == INC_512 ? 512 : 1024, + (data & DMA_DISABLE) ? "disabled" : "enabled", + (data & SYNC_DELAY) >> 15); + + LOGMASKED(LOG_CONFIG, "interleave %s, pixel sampling %s, %s bits per pixel, cursor %s\n", + (data & INTERLEAVE) ? "enabled" : "disabled", + (data & SAMPLE_DELAY) ? "delayed" : "standard", + (data & PIXEL_BITS) == BPP_1 ? "1" : + (data & PIXEL_BITS) == BPP_2 ? "2" : + (data & PIXEL_BITS) == BPP_4 ? "4" : + (data & PIXEL_BITS) == BPP_8 ? "8" : + (data & PIXEL_BITS) == BPP_15 ? "15" : + (data & PIXEL_BITS) == BPP_16 ? "16" : "unknown", + (data & CURSOR_DISABLE) ? "disabled" : "enabled"); + + LOG("display %d vdisplay %d\n", m_display, m_vdisplay); + LOG("linetime %d halfsync %d backporch %d broadpulse %d\n", m_linetime, m_halfsync, m_backporch, m_broadpulse); + LOG("vsync %d vpreequalise %d vpostequalise %d vblank %d\n", m_vsync, m_vpreequalise, m_vpostequalise, m_vblank); + + int const hbend = (m_halfsync + m_halfsync + m_backporch) << 2; + int const vbend = (m_vpreequalise + m_vpostequalise + m_vsync + m_vblank) >> 1; + int const width = m_linetime << 2; + int const height = vbend + (m_vdisplay >> 1); + + rectangle const visarea(hbend, hbend + (m_display << 2) - 1, vbend, height - 1); + + u32 const dotclock = (m_boot & PLL_SELECT) ? clock() * (m_boot & PLL_MULTIPLIER) : clock(); + attotime const refresh = attotime::from_hz(dotclock / (width * height)); + + m_screen->configure(width, height, visarea, refresh.as_attoseconds()); + m_screen->reset_origin(); + } } } diff --git a/src/devices/video/ims_cvc.h b/src/devices/video/ims_cvc.h index 82acfe5c6eb..b196272c059 100644 --- a/src/devices/video/ims_cvc.h +++ b/src/devices/video/ims_cvc.h @@ -13,17 +13,18 @@ class ims_cvc_device , public device_palette_interface { public: - static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } + static u32 const MASK24 = 0xffffffU; // configuration template <typename T> void set_screen(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); } template <typename T> void set_vram(T &&tag) { m_vram.set_tag(std::forward<T>(tag)); } virtual void map(address_map &map) = 0; - virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) = 0; + virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) = 0; + virtual void set_swapped(bool swapped) { m_swap = swapped ? 3 : 0; }; protected: - ims_cvc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + ims_cvc_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); // device_t overrides virtual void device_start() override; @@ -32,39 +33,41 @@ protected: // device_palette_interface overrides virtual u32 palette_entries() const override { return 256; } - u32 colour_palette_r(const offs_t offset); - void colour_palette_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU); + virtual void boot_w(u32 data) { m_boot = data & MASK24; } + + // register read handlers u32 halfsync_r() { return m_halfsync; } - void halfsync_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_halfsync); } u32 backporch_r() { return m_backporch; } - void backporch_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_backporch); } u32 display_r() { return m_display; } - void display_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_display); } u32 shortdisplay_r() { return m_shortdisplay; } - void shortdisplay_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_shortdisplay); } u32 broadpulse_r() { return m_broadpulse; } - void broadpulse_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_broadpulse); } u32 vsync_r() { return m_vsync; } - void vsync_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_vsync); } u32 vblank_r() { return m_vblank; } - void vblank_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_vblank); } u32 vdisplay_r() { return m_vdisplay; } - void vdisplay_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_vdisplay); } u32 linetime_r() { return m_linetime; } - void linetime_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_linetime); } - //u32 tos_r() { return m_tos; } - //void tos_w(const u32 data) { m_tos = data; } u32 meminit_r() { return m_meminit; } - void meminit_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_meminit); } u32 transferdelay_r() { return m_transferdelay; } - void transferdelay_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_transferdelay); } - u32 mask_r() { return m_mask; } - void mask_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_mask); } u32 tos_r() { return m_tos; } - void tos_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_tos); } - virtual void boot_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_boot); } + // register write handlers + void halfsync_w(u32 data) { m_halfsync = data & MASK24; } + void backporch_w(u32 data) { m_backporch = data & MASK24; } + void display_w(u32 data) { m_display = data & MASK24; } + void shortdisplay_w(u32 data) { m_shortdisplay = data & MASK24; } + void broadpulse_w(u32 data) { m_broadpulse = data & MASK24; } + void vsync_w(u32 data) { m_vsync = data & MASK24; } + void vblank_w(u32 data) { m_vblank = data & MASK24; } + void vdisplay_w(u32 data) { m_vdisplay = data & MASK24; } + void linetime_w(u32 data) { m_linetime = data & MASK24; } + void meminit_w(u32 data) { m_meminit = data & MASK24; } + void transferdelay_w(u32 data) { m_transferdelay = data & MASK24; } + void mask_w(u32 data) { m_mask = data & MASK24; } + void tos_w(u32 data) { m_tos = data & MASK24; } + + // colour palette handlers + u32 colour_palette_r(offs_t offset) { return u32(pen_color(offset >> 1)) & MASK24; } + void colour_palette_w(offs_t offset, u32 data) { set_pen_color(offset >> 1, data >> 16, data >> 8, data >> 0); } required_device<screen_device> m_screen; required_device<ram_device> m_vram; @@ -86,22 +89,24 @@ protected: u32 m_mask; u32 m_tos; u32 m_boot; + + unsigned m_swap = 0; }; class g300_device : public ims_cvc_device { public: - g300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + g300_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); virtual void map(address_map &map) override; - virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) override; protected: virtual void device_start() override; u32 control_r() { return m_control; } - void control_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_control); } + void control_w(u32 data) { m_control = data & MASK24; } private: u32 m_control; @@ -110,11 +115,11 @@ private: class g332_device : public ims_cvc_device { public: - g332_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + g332_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); virtual void map(address_map &map) override; - virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) override; enum boot_mask : u32 { @@ -163,7 +168,7 @@ public: }; protected: - g332_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + g332_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); // device_t overrides virtual void device_add_mconfig(machine_config &config) override; @@ -175,21 +180,29 @@ protected: virtual void microport_map(address_map &map); - virtual void boot_w(offs_t offset, u32 data, u32 mem_mask = 0x00ffffffU) override; - - u32 cursor_palette_r(const offs_t offset); - void cursor_palette_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU); + virtual void boot_w(u32 data) override; + // register read handlers u32 vpreequalise_r() { return m_vpreequalise; } - void vpreequalise_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_vpreequalise); } u32 vpostequalise_r() { return m_vpostequalise; } - void vpostequalise_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_vpostequalise); } u32 linestart_r() { return m_linestart; } - void linestart_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_linestart); } u32 control_a_r() { return m_control_a; } - void control_a_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU); u32 control_b_r() { return m_control_b; } - void control_b_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffffU) { COMBINE_DATA(&m_control_b); } + u32 cursor_start_r() { return m_cursor_start; } + + // register write handlers + void vpreequalise_w(u32 data) { m_vpreequalise = data & MASK24; } + void vpostequalise_w(u32 data) { m_vpostequalise = data & MASK24; } + void linestart_w(u32 data) { m_linestart = data & MASK24; } + void control_a_w(u32 data); + void control_b_w(u32 data) { m_control_b = data & MASK24; } + void cursor_start_w(u32 data) { m_cursor_start = data & MASK24; } + + // cursor handlers + u32 cursor_palette_r(offs_t offset) { return u32(pen_color(256 + (offset >> 1)))& MASK24; } + u32 cursor_store_r(offs_t offset) { return m_cursor_store[offset >> 1]; } + void cursor_palette_w(offs_t offset, u32 data) { set_pen_color(256 + (offset >> 1), data >> 16, data >> 8, data >> 0); } + void cursor_store_w(offs_t offset, u32 data) { m_cursor_store[offset >> 1] = u16(data); } private: required_device<address_map_bank_device> m_microport; @@ -199,12 +212,17 @@ private: u32 m_linestart; u32 m_control_a; u32 m_control_b; + u32 m_cursor_start; + + std::unique_ptr<u16[]> m_cursor_store; }; class g364_device : public g332_device { public: - g364_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + g364_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + + virtual void set_swapped(bool swapped) override { m_swap = swapped ? 7 : 0; }; }; DECLARE_DEVICE_TYPE(G300, g300_device) diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp index cc30d50bae7..f5a7f7148e9 100644 --- a/src/devices/video/pc_vga.cpp +++ b/src/devices/video/pc_vga.cpp @@ -1150,17 +1150,18 @@ uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma uint16_t cy = s3.cursor_y & 0x07ff; uint32_t bg_col; uint32_t fg_col; + int r,g,b; + uint32_t datax; if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE) return 0; // cursor only works in VGA or SVGA modes src = s3.cursor_start_addr * 1024; // start address is in units of 1024 bytes - if(cur_mode == RGB16_MODE) + switch(cur_mode) { - int r,g,b; - uint16_t datax; - + case RGB15_MODE: + case RGB16_MODE: datax = s3.cursor_bg[0]|s3.cursor_bg[1]<<8; r = (datax&0xf800)>>11; g = (datax&0x07e0)>>5; @@ -1178,11 +1179,25 @@ uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma g = (g << 2) | (g & 0x3); b = (b << 3) | (b & 0x7); fg_col = (0xff<<24)|(r<<16)|(g<<8)|(b<<0); - } - else /* TODO: other modes */ - { + break; + case RGB24_MODE: + datax = s3.cursor_bg[0]|s3.cursor_bg[1]<<8|s3.cursor_bg[2]<<16; + r = (datax&0xff0000)>>16; + g = (datax&0x00ff00)>>8; + b = (datax&0x0000ff)>>0; + bg_col = (0xff<<24)|(r<<16)|(g<<8)|(b<<0); + + datax = s3.cursor_fg[0]|s3.cursor_fg[1]<<8|s3.cursor_fg[2]<<16; + r = (datax&0xff0000)>>16; + g = (datax&0x00ff00)>>8; + b = (datax&0x0000ff)>>0; + fg_col = (0xff<<24)|(r<<16)|(g<<8)|(b<<0); + break; + case RGB8_MODE: + default: bg_col = pen(s3.cursor_bg[0]); fg_col = pen(s3.cursor_fg[0]); + break; } //popmessage("%08x %08x",(s3.cursor_bg[0])|(s3.cursor_bg[1]<<8)|(s3.cursor_bg[2]<<16)|(s3.cursor_bg[3]<<24) diff --git a/src/devices/video/poly.h b/src/devices/video/poly.h index c619c50c2a1..908a1954902 100644 --- a/src/devices/video/poly.h +++ b/src/devices/video/poly.h @@ -39,7 +39,7 @@ #include "screen.h" -#include <limits.h> +#include <climits> #include <atomic> diff --git a/src/devices/video/ppu2c0x_vt.cpp b/src/devices/video/ppu2c0x_vt.cpp index c91092d9ec1..f663d77992f 100644 --- a/src/devices/video/ppu2c0x_vt.cpp +++ b/src/devices/video/ppu2c0x_vt.cpp @@ -12,6 +12,7 @@ #include "emu.h" #include "video/ppu2c0x_vt.h" + /* constant definitions */ #define VISIBLE_SCREEN_WIDTH (32*8) /* Visible screen width */ @@ -19,14 +20,14 @@ DEFINE_DEVICE_TYPE(PPU_VT03, ppu_vt03_device, "ppu_vt03", "VT03 PPU (NTSC)") DEFINE_DEVICE_TYPE(PPU_VT03PAL, ppu_vt03pal_device, "ppu_vt03pal", "VT03 PPU (PAL)") -ppu_vt03_device::ppu_vt03_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : +ppu_vt03_device::ppu_vt03_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock) : ppu2c0x_device(mconfig, type, tag, owner, clock), m_is_pal(false), m_is_50hz(false), m_read_bg(*this), m_read_sp(*this) { - for(int i = 0; i < 6; i++) + for (int i = 0; i < 6; i++) m_2012_2017_descramble[i] = 2 + i; } @@ -36,7 +37,7 @@ ppu_vt03_device::ppu_vt03_device(const machine_config& mconfig, const char* tag, } -ppu_vt03pal_device::ppu_vt03pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : +ppu_vt03pal_device::ppu_vt03pal_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : ppu_vt03_device(mconfig, PPU_VT03PAL, tag, owner, clock) { m_scanlines_per_frame = PAL_SCANLINES_PER_FRAME; @@ -70,72 +71,86 @@ void ppu_vt03_device::set_201x_descramble(uint8_t reg0, uint8_t reg1, uint8_t re void ppu_vt03_device::set_new_pen(int i) { - if((i < 0x20) && ((i & 0x3) == 0)) { + if ((i < 0x20) && ((i & 0x3) == 0)) + { set_pen_color(i & 0x7f, rgb_t(0, 0, 0)); - } else { - if(m_pal_mode == PAL_MODE_NEW_RGB) { - uint16_t rgbval = (m_newpal[i&0x7f] & 0xff) | ((m_newpal[(i&0x7f)+0x80] & 0xff)<<8); + } + else + { + if (m_pal_mode == PAL_MODE_NEW_RGB) + { + uint16_t rgbval = (m_newpal[i & 0x7f] & 0xff) | ((m_newpal[(i & 0x7f) + 0x80] & 0xff) << 8); uint8_t blue = (rgbval & 0x001f) << 3; uint8_t green = (rgbval & 0x3e0) >> 2; - uint8_t red = (rgbval & 0x7C00) >> 7; + uint8_t red = (rgbval & 0x7C00) >> 7; set_pen_color(i & 0x7f, rgb_t(red, green, blue)); - } else if(m_pal_mode == PAL_MODE_NEW_RGB12) { - uint16_t rgbval = (m_newpal[i&0x7f] & 0x3f) | ((m_newpal[(i&0x7f)+0x80] & 0x3f)<<6); + } + else if (m_pal_mode == PAL_MODE_NEW_RGB12) + { + uint16_t rgbval = (m_newpal[i & 0x7f] & 0x3f) | ((m_newpal[(i & 0x7f) + 0x80] & 0x3f) << 6); uint8_t red = (rgbval & 0x000f) << 4; uint8_t green = (rgbval & 0x0f0); - uint8_t blue = (rgbval & 0xf00) >> 4; + uint8_t blue = (rgbval & 0xf00) >> 4; set_pen_color(i & 0x7f, rgb_t(red, green, blue)); - } else { + } + else + { // Credit to NewRisingSun - uint16_t palval = (m_newpal[i&0x7f] & 0x3f) | ((m_newpal[(i&0x7f)+0x80] & 0x3f)<<6); - int nPhase = (palval >>0) &0xF; - int nLuma = (palval >>4) &0xF; - int nChroma = (palval >>8) &0xF; + uint16_t palval = (m_newpal[i & 0x7f] & 0x3f) | ((m_newpal[(i & 0x7f) + 0x80] & 0x3f) << 6); + int nPhase = (palval >> 0) & 0xF; + int nLuma = (palval >> 4) & 0xF; + int nChroma = (palval >> 8) & 0xF; float phaseOffset = -11.0; //bool inverted = false; - if ((nLuma < (nChroma+1) >>1 || nLuma > 15 -(nChroma >>1)) && (m_pal_mode != PAL_MODE_NEW_VG)) { + if ((nLuma < (nChroma + 1) >> 1 || nLuma > 15 - (nChroma >> 1)) && (m_pal_mode != PAL_MODE_NEW_VG)) + { //inverted = true; // Strange color number wrap-around. Is this for protection reasons, or a bug of the original hardware? // The VT03 data sheet advises programmers that 4 <= nLuma*2 +nChroma <= 0x1F, which does not correspond exactly to this condition. - static const unsigned char altPhases[16] = { 13, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 0, 14, 15}; - static const float altPhaseOffset[16] = { -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, -5, -5, -5}; // Slight tweak in phase 6 for Z-Dog + static const unsigned char altPhases[16] = { 13, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 0, 14, 15 }; + static const float altPhaseOffset[16] = { -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, -5, -5, -5 }; // Slight tweak in phase 6 for Z-Dog phaseOffset += altPhaseOffset[nPhase]; // These "alternative" colors seem to be slightly shifted in addition to being wrapped-around, at least in EmuVT. nPhase = altPhases[nPhase]; - nChroma = 16 -nChroma; - nLuma = (nLuma -8) &0xF; + nChroma = 16 - nChroma; + nLuma = (nLuma - 8) & 0xF; } - float fLuma = (nLuma-4) /9.625; // Value determined from matching saturation =0 phases 1-12 - float fChroma = nChroma /18.975; // Value determined from matching phases 0 and 13 across all luminance and saturation levels - float fPhase = ((nPhase-2) *30.0 +phaseOffset) *M_PI /180.0; - if(m_pal_mode == PAL_MODE_NEW_VG) { - if(fPhase > 0 && fPhase < 13) { + + float fLuma = (nLuma - 4) / 9.625; // Value determined from matching saturation =0 phases 1-12 + float fChroma = nChroma / 18.975; // Value determined from matching phases 0 and 13 across all luminance and saturation levels + float fPhase = ((nPhase - 2) * 30.0 + phaseOffset) * M_PI / 180.0; + + if (m_pal_mode == PAL_MODE_NEW_VG) + { + if (fPhase > 0 && fPhase < 13) + { fLuma /= 1.5; fChroma /= 2; } } + float Y = fLuma; float C = fChroma; - if (nPhase == 0 || nPhase >12) C =0.0;// Phases 0 and 13-15 are grays + if (nPhase == 0 || nPhase > 12) C = 0.0;// Phases 0 and 13-15 are grays if (nPhase == 0) Y += fChroma; // Phase 0 is the upper bound of the waveform - if (nPhase ==13) Y -= fChroma; // Phase 13 is the lower bound of the waveform - if (nPhase >=14) Y = 0.0; // Phases 14 and 15 always black - - float V = sin(fPhase) *C *1.05; // 1.05 needed to get closer to EmuVT palette's color levels in phases 1-12 - float U = cos(fPhase) *C *1.05; - float R = Y + 1.1400*V + 0.0000*U; - float G = Y - 0.5807*V - 0.3940*U; - float B = Y - 0.0000*V + 2.0290*U; - if (R <0.0) R =0.0; - if (R >1.0) R =1.0; - if (G <0.0) G =0.0; - if (G >1.0) G =1.0; - if (B <0.0) B =0.0; - if (B >1.0) B =1.0; - int RV = R *255.0; - int GV = G *255.0; - int BV = B *255.0; - - set_pen_color(i & 0x7f, rgb_t(RV, GV ,BV)); + if (nPhase == 13) Y -= fChroma; // Phase 13 is the lower bound of the waveform + if (nPhase >= 14) Y = 0.0; // Phases 14 and 15 always black + + float V = sin(fPhase) * C * 1.05; // 1.05 needed to get closer to EmuVT palette's color levels in phases 1-12 + float U = cos(fPhase) * C * 1.05; + float R = Y + 1.1400 * V + 0.0000 * U; + float G = Y - 0.5807 * V - 0.3940 * U; + float B = Y - 0.0000 * V + 2.0290 * U; + if (R < 0.0) R = 0.0; + if (R > 1.0) R = 1.0; + if (G < 0.0) G = 0.0; + if (G > 1.0) G = 1.0; + if (B < 0.0) B = 0.0; + if (B > 1.0) B = 1.0; + int RV = R * 255.0; + int GV = G * 255.0; + int BV = B * 255.0; + + set_pen_color(i & 0x7f, rgb_t(RV, GV, BV)); } } @@ -150,26 +165,84 @@ WRITE8_MEMBER(ppu_vt03_device::palette_write) if (m_201x_regs[0] & pal_mask) { - m_newpal[offset&0xff] = data; + m_newpal[offset & 0xff] = data; set_new_pen(offset); } else { //if(m_pal_mode == PAL_MODE_NEW_VG) // ddrdismx writes the palette before setting the register but doesn't use 'PAL_MODE_NEW_VG', Konami logo is missing if you don't allow writes to be stored for when we switch - m_newpal[offset&0xff] = data; + m_newpal[offset & 0xff] = data; ppu2c0x_device::palette_write(space, offset, data); } } -READ8_MEMBER( ppu_vt03_device::read ) +READ8_MEMBER(ppu_vt03_device::read) { - if(offset <= 0xf) { - return ppu2c0x_device::read(space,offset); - } else if(offset <= 0x1f) { - return get_201x_reg(offset & 0x0f); - } else { - return 0; - } + if (offset <= 0xf) + { + return ppu2c0x_device::read(space, offset); + } + else if (offset <= 0x1f) + { + logerror("%s: read from reg %02x\n", machine().describe_context(), offset); + + switch (offset) + { + case 0x10: + return m_201x_regs[0x0]; + + case 0x11: + return m_201x_regs[0x1]; + + case 0x12: + return m_201x_regs[m_2012_2017_descramble[0]]; + + case 0x13: + return m_201x_regs[m_2012_2017_descramble[1]]; + + case 0x14: + return m_201x_regs[m_2012_2017_descramble[2]]; + + case 0x15: + return m_201x_regs[m_2012_2017_descramble[3]]; + + case 0x16: + return m_201x_regs[m_2012_2017_descramble[4]]; + + case 0x17: + return m_201x_regs[m_2012_2017_descramble[5]]; + + case 0x18: + return m_201x_regs[0x8]; + + case 0x19: + return 0x00; + + case 0x1a: + return m_201x_regs[0xa]; + + case 0x1b: + return 0x00; + + case 0x1c: + return 0x00; + + case 0x1d: + return 0x00; + + case 0x1e: + return 0x00; + + case 0x1f: + return 0x00; + } + } + else + { + return 0x00; + } + + return 0x00; } void ppu_vt03_device::init_palette() @@ -206,11 +279,11 @@ void ppu_vt03_device::device_reset() m_read_bg.resolve_safe(0); m_read_sp.resolve_safe(0); - for (int i = 0;i < 0xff;i++) + for (int i = 0; i < 0xff; i++) m_newpal[i] = 0x0; // todo: what are the actual defaults for these? - for (int i = 0;i < 0x20;i++) + for (int i = 0; i < 0x20; i++) set_201x_reg(i, 0x00); //m_201x_regs[0] = 0x86; // alt fix for ddrdismx would be to set the default palette mode here @@ -249,7 +322,7 @@ void ppu_vt03_device::read_sprite_plane_data(int address) } } -void ppu_vt03_device::make_sprite_pixel_data(uint8_t &pixel_data, int flipx) +void ppu_vt03_device::make_sprite_pixel_data(uint8_t& pixel_data, int flipx) { ppu2c0x_device::make_sprite_pixel_data(pixel_data, flipx); @@ -265,7 +338,8 @@ void ppu_vt03_device::make_sprite_pixel_data(uint8_t &pixel_data, int flipx) m_extplanebuf[0] = m_extplanebuf[0] >> 1; m_extplanebuf[1] = m_extplanebuf[1] >> 1; - if(is16pix) { + if (is16pix) + { uint8_t pix0 = pixel_data & 0x03; uint8_t pix1 = (pixel_data >> 5) & 0x03; pixel_data = pix1 | (pix0 << 5); @@ -280,7 +354,7 @@ void ppu_vt03_device::make_sprite_pixel_data(uint8_t &pixel_data, int flipx) } } -void ppu_vt03_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, uint8_t pixel_data, bitmap_rgb32 &bitmap) +void ppu_vt03_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, uint8_t pixel_data, bitmap_rgb32& bitmap) { int is4bpp = get_201x_reg(0x0) & 0x04; int is16pix = get_201x_reg(0x0) & 0x01; @@ -294,11 +368,11 @@ void ppu_vt03_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, u else { /* this mode makes use of the extra planes to increase sprite width instead - we probably need to split them out again and draw them at xpos+8 with a - cliprect - not seen used yet */ - if((pixel_data & 0x03) != 0) + we probably need to split them out again and draw them at xpos+8 with a + cliprect - not seen used yet */ + if ((pixel_data & 0x03) != 0) bitmap.pix32(m_scanline, sprite_xpos + pixel) = pen((pixel_data & 0x03) + (4 * color)); - if(((pixel_data >> 5) & 0x03) != 0) + if (((pixel_data >> 5) & 0x03) != 0) bitmap.pix32(m_scanline, sprite_xpos + pixel + 8) = pen(((pixel_data >> 5) & 0x03) + (4 * color)); //ppu2c0x_device::draw_sprite_pixel(sprite_xpos, color, pixel, pixel_data & 0x03, bitmap); //ppu2c0x_device::draw_sprite_pixel(sprite_xpos, color, pixel + 8, (pixel_data >> 5) & 0x03, bitmap); @@ -336,7 +410,7 @@ void ppu_vt03_device::read_tile_plane_data(int address, int color) } } -void ppu_vt03_device::shift_tile_plane_data(uint8_t &pix) +void ppu_vt03_device::shift_tile_plane_data(uint8_t& pix) { int is4bpp = get_201x_reg(0x0) & 0x02; @@ -350,7 +424,7 @@ void ppu_vt03_device::shift_tile_plane_data(uint8_t &pix) } } -void ppu_vt03_device::draw_tile_pixel(uint8_t pix, int color, pen_t back_pen, uint32_t *&dest, const pen_t *color_table) +void ppu_vt03_device::draw_tile_pixel(uint8_t pix, int color, pen_t back_pen, uint32_t*& dest, const pen_t* color_table) { int is4bpp = get_201x_reg(0x0) & 0x02; @@ -386,7 +460,7 @@ void ppu_vt03_device::draw_tile_pixel(uint8_t pix, int color, pen_t back_pen, ui void ppu_vt03_device::read_extra_sprite_bits(int sprite_index) { - m_extra_sprite_bits = (m_spriteram[sprite_index + 2] & 0x1c) >>2; + m_extra_sprite_bits = (m_spriteram[sprite_index + 2] & 0x1c) >> 2; } uint8_t ppu_vt03_device::get_speva2_speva0() @@ -409,14 +483,14 @@ void ppu_vt03_device::set_2010_reg(uint8_t data) { if (data & pal_mask) { - for (int i = 0;i < 256;i++) + for (int i = 0; i < 256; i++) { set_new_pen(i); } } else { - for (int i = 0;i < 256;i++) + for (int i = 0; i < 256; i++) { set_pen_indirect(i, i); } @@ -505,3 +579,4 @@ WRITE8_MEMBER(ppu_vt03_device::write) } } } + diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp index 6a689edf14f..e5bcad362d8 100644 --- a/src/devices/video/psx.cpp +++ b/src/devices/video/psx.cpp @@ -418,12 +418,12 @@ int psxgpu_device::DebugTextureDisplay( bitmap_rgb32 &bitmap ) void psxgpu_device::updatevisiblearea() { rectangle visarea; - float refresh; + double refresh; if( ( n_gpustatus & ( 1 << 0x14 ) ) != 0 ) { /* pal */ - refresh = 50; + refresh = 50; // TODO: it's not exactly 50Hz switch( ( n_gpustatus >> 0x13 ) & 1 ) { case 0: @@ -437,13 +437,16 @@ void psxgpu_device::updatevisiblearea() else { /* ntsc */ - refresh = 60; + // refresh rate derived from 53.693175MHz + // TODO: emulate display timings at lower level switch( ( n_gpustatus >> 0x13 ) & 1 ) { case 0: + refresh = 59.8260978565; n_screenheight = 240; break; case 1: + refresh = 59.9400523286; n_screenheight = 480; break; } diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index cc8121a923f..568347567dc 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -1112,6 +1112,7 @@ TIMER_CALLBACK_MEMBER(scn2674_device::scanline_timer) const bool mbc = (charrow == 0) && (m_buffer_mode_select == 3); const bool blink_on = (screen().frame_number() & (m_character_blink_rate_divisor >> 1)) != 0; + const uint16_t last_address = (m_display_buffer_last_address << 10) | 0x3ff; for (int i = 0; i < m_character_per_row; i++) { u8 charcode, attrcode = 0; @@ -1154,10 +1155,11 @@ TIMER_CALLBACK_MEMBER(scn2674_device::scanline_timer) blink_on); } - address = (address + 1) & 0xffff; - if (address > ((m_display_buffer_last_address << 10) | 0x3ff)) - address = m_display_buffer_first_address; + if ((address & 0x3fff) == last_address) + address = (address & 0xc000) | m_display_buffer_first_address; + else + address = (address + 1) & 0xffff; } if (!m_display_enabled) diff --git a/src/devices/video/virge_pci.cpp b/src/devices/video/virge_pci.cpp index c3d55f4cc62..6bebe26bc88 100644 --- a/src/devices/video/virge_pci.cpp +++ b/src/devices/video/virge_pci.cpp @@ -26,11 +26,19 @@ virgedx_pci_device::virgedx_pci_device(const machine_config &mconfig, const char void virge_pci_device::mmio_map(address_map& map) { + // image transfer ports + map(0x1000000,0x1007fff).w(m_vga, FUNC(s3virge_vga_device::image_xfer)); + // MMIO address map map(0x1008504,0x1008507).rw(m_vga, FUNC(s3virge_vga_device::s3d_sub_status_r), FUNC(s3virge_vga_device::s3d_sub_control_w)); + map(0x100850c,0x100850f).r(m_vga, FUNC(s3virge_vga_device::s3d_func_ctrl_r)); // S3D engine registers map(0x100a000,0x100b7ff).rw(m_vga, FUNC(s3virge_vga_device::s3d_register_r), FUNC(s3virge_vga_device::s3d_register_w)); + + // alternate image transfer ports + map(0x100d000,0x100efff).w(m_vga, FUNC(s3virge_vga_device::image_xfer)); + } void virge_pci_device::lfb_map(address_map& map) diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 8e4a6215b2f..2040f8dc148 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -5621,7 +5621,7 @@ void voodoo_device::device_start() /* create a multiprocessor work queue */ poly = poly_alloc(machine(), 64, sizeof(poly_extra_data), 0); - thread_stats = auto_alloc_array(machine(), stats_block, WORK_MAX_THREADS); + thread_stats = std::make_unique<stats_block[]>(WORK_MAX_THREADS); /* create a table of precomputed 1/n and log2(n) values */ /* n ranges from 1.0000 to 2.0000 */ @@ -5726,14 +5726,14 @@ void voodoo_device::device_start() if (vd_type <= TYPE_VOODOO_2) { /* separate FB/TMU memory */ - fbmem = auto_alloc_array(machine(), uint8_t, m_fbmem << 20); - tmumem[0] = auto_alloc_array(machine(), uint8_t, m_tmumem0 << 20); - tmumem[1] = (m_tmumem1 != 0) ? auto_alloc_array(machine(), uint8_t, m_tmumem1 << 20) : nullptr; + fbmem = (m_fbmem_alloc = std::make_unique<uint8_t[]>(m_fbmem << 20)).get(); + tmumem[0] = (m_tmumem_alloc[0] = std::make_unique<uint8_t[]>(m_tmumem0 << 20)).get(); + tmumem[1] = (m_tmumem1 != 0) ? (m_tmumem_alloc[1] = std::make_unique<uint8_t[]>(m_tmumem1 << 20)).get() : nullptr; } else { /* shared memory */ - tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(machine(), uint8_t, m_fbmem << 20); + tmumem[0] = tmumem[1] = fbmem = (m_fbmem_alloc = std::make_unique<uint8_t[]>(m_fbmem << 20)).get(); tmumem0 = m_fbmem; if (vd_type == TYPE_VOODOO_3) tmumem1 = m_fbmem; diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h index c8b74b90813..b6ef2abc8cf 100644 --- a/src/devices/video/voodoo.h +++ b/src/devices/video/voodoo.h @@ -1311,6 +1311,9 @@ public: optional_device<screen_device> m_screen_finder; // the screen we are acting on optional_device<cpu_device> m_cpu_finder; // the CPU we interact with + std::unique_ptr<uint8_t[]> m_fbmem_alloc; + std::unique_ptr<uint8_t[]> m_tmumem_alloc[2]; + uint8_t index; // index of board screen_device * m_screen; // the screen we are acting on cpu_device * m_cpu; // the CPU we interact with @@ -1335,7 +1338,7 @@ public: banshee_info banshee; // Banshee state legacy_poly_manager * poly; // polygon manager - stats_block * thread_stats; // per-thread statistics + std::unique_ptr<stats_block[]> thread_stats; // per-thread statistics voodoo_stats stats; // internal statistics diff --git a/src/emu/attotime.h b/src/emu/attotime.h index 945ed78a87a..f46dc795a7d 100644 --- a/src/emu/attotime.h +++ b/src/emu/attotime.h @@ -38,7 +38,7 @@ #include "emucore.h" #include "xtal.h" -#include <math.h> +#include <cmath> #undef min #undef max diff --git a/src/emu/config.cpp b/src/emu/config.cpp index 3574eb2d12e..81a486f73af 100644 --- a/src/emu/config.cpp +++ b/src/emu/config.cpp @@ -40,8 +40,8 @@ void configuration_manager::config_register(const char* nodename, config_load_de { config_element element; element.name = nodename; - element.load = load; - element.save = save; + element.load = std::move(load); + element.save = std::move(save); m_typelist.push_back(element); } @@ -60,7 +60,7 @@ int configuration_manager::load_settings() int loaded = 0; /* loop over all registrants and call their init function */ - for (auto type : m_typelist) + for (const auto &type : m_typelist) type.load(config_type::INIT, nullptr); /* now load the controller file */ @@ -93,7 +93,7 @@ int configuration_manager::load_settings() loaded = load_xml(file, config_type::GAME); /* loop over all registrants and call their final function */ - for (auto type : m_typelist) + for (const auto &type : m_typelist) type.load(config_type::FINAL, nullptr); /* if we didn't find a saved config, return 0 so the main core knows that it */ @@ -105,7 +105,7 @@ int configuration_manager::load_settings() void configuration_manager::save_settings() { /* loop over all registrants and call their init function */ - for (auto type : m_typelist) + for (const auto &type : m_typelist) type.save(config_type::INIT, nullptr); /* save the defaults file */ @@ -120,7 +120,7 @@ void configuration_manager::save_settings() save_xml(file, config_type::GAME); /* loop over all registrants and call their final function */ - for (auto type : m_typelist) + for (const auto &type : m_typelist) type.save(config_type::FINAL, nullptr); } @@ -204,7 +204,7 @@ int configuration_manager::load_xml(emu_file &file, config_type which_type) osd_printf_debug("Entry: %s -- processing\n", name); /* loop over all registrants and call their load function */ - for (auto type : m_typelist) + for (const auto &type : m_typelist) type.load(which_type, systemnode->get_child(type.name.c_str())); count++; } @@ -246,7 +246,7 @@ int configuration_manager::save_xml(emu_file &file, config_type which_type) /* create the input node and write it out */ /* loop over all registrants and call their save function */ - for (auto type : m_typelist) + for (const auto &type : m_typelist) { util::xml::data_node *const curnode = systemnode->add_child(type.name.c_str(), nullptr); if (!curnode) diff --git a/src/emu/debug/debugbuf.cpp b/src/emu/debug/debugbuf.cpp index 4e232ce16a0..85ec19d5fb9 100644 --- a/src/emu/debug/debugbuf.cpp +++ b/src/emu/debug/debugbuf.cpp @@ -179,6 +179,7 @@ void debug_disasm_buffer::debug_data_buffer::setup_methods() int shift = space->addr_shift(); int alignment = m_intf.opcode_alignment(); endianness_t endian = space->endianness(); + bool is_octal = space->is_octal(); m_pc_mask = space->logaddrmask(); @@ -954,44 +955,80 @@ void debug_disasm_buffer::debug_data_buffer::setup_methods() // Define the data -> string conversion switch(shift) { case -3: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i++) { - if(i) - out << ' '; - util::stream_format(out, "%016X", r64(pc)); - pc = m_next_pc_wrap(pc, 1); - } - return out.str(); - }; - break; - - case -2: - switch(alignment) { - case 1: + if(is_octal) m_data_to_string = [this](offs_t pc, offs_t size) { std::ostringstream out; for(offs_t i=0; i != size; i++) { if(i) out << ' '; - util::stream_format(out, "%08X", r32(pc)); + util::stream_format(out, "%022o", r64(pc)); pc = m_next_pc_wrap(pc, 1); } return out.str(); }; - break; - - case 2: + else m_data_to_string = [this](offs_t pc, offs_t size) { std::ostringstream out; - for(offs_t i=0; i != size; i += 2) { + for(offs_t i=0; i != size; i++) { if(i) out << ' '; util::stream_format(out, "%016X", r64(pc)); - pc = m_next_pc_wrap(pc, 2); + pc = m_next_pc_wrap(pc, 1); } return out.str(); }; + break; + + case -2: + switch(alignment) { + case 1: + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i++) { + if(i) + out << ' '; + util::stream_format(out, "%011o", r32(pc)); + pc = m_next_pc_wrap(pc, 1); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i++) { + if(i) + out << ' '; + util::stream_format(out, "%08X", r32(pc)); + pc = m_next_pc_wrap(pc, 1); + } + return out.str(); + }; + break; + + case 2: + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 2) { + if(i) + out << ' '; + util::stream_format(out, "%022o", r64(pc)); + pc = m_next_pc_wrap(pc, 2); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 2) { + if(i) + out << ' '; + util::stream_format(out, "%016X", r64(pc)); + pc = m_next_pc_wrap(pc, 2); + } + return out.str(); + }; break; } break; @@ -999,42 +1036,78 @@ void debug_disasm_buffer::debug_data_buffer::setup_methods() case -1: switch(alignment) { case 1: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i++) { - if(i) - out << ' '; - util::stream_format(out, "%04X", r16(pc)); - pc = m_next_pc_wrap(pc, 1); - } - return out.str(); - }; + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i++) { + if(i) + out << ' '; + util::stream_format(out, "%06o", r16(pc)); + pc = m_next_pc_wrap(pc, 1); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i++) { + if(i) + out << ' '; + util::stream_format(out, "%04X", r16(pc)); + pc = m_next_pc_wrap(pc, 1); + } + return out.str(); + }; break; case 2: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i += 2) { - if(i) + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 2) { + if(i) + out << ' '; + util::stream_format(out, "%011o", r32(pc)); + pc = m_next_pc_wrap(pc, 2); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 2) { + if(i) out << ' '; - util::stream_format(out, "%08X", r32(pc)); - pc = m_next_pc_wrap(pc, 2); - } - return out.str(); - }; + util::stream_format(out, "%08X", r32(pc)); + pc = m_next_pc_wrap(pc, 2); + } + return out.str(); + }; break; case 4: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i += 4) { - if(i) - out << ' '; - util::stream_format(out, "%016X", r64(pc)); - pc = m_next_pc_wrap(pc, 4); - } - return out.str(); - }; + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 4) { + if(i) + out << ' '; + util::stream_format(out, "%022o", r64(pc)); + pc = m_next_pc_wrap(pc, 4); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 4) { + if(i) + out << ' '; + util::stream_format(out, "%016X", r64(pc)); + pc = m_next_pc_wrap(pc, 4); + } + return out.str(); + }; break; } break; @@ -1042,70 +1115,130 @@ void debug_disasm_buffer::debug_data_buffer::setup_methods() case 0: switch(alignment) { case 1: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i++) { - if(i) - out << ' '; - util::stream_format(out, "%02X", r8(pc)); - pc = m_next_pc_wrap(pc, 1); - } - return out.str(); - }; + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i++) { + if(i) + out << ' '; + util::stream_format(out, "%03o", r8(pc)); + pc = m_next_pc_wrap(pc, 1); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i++) { + if(i) + out << ' '; + util::stream_format(out, "%02X", r8(pc)); + pc = m_next_pc_wrap(pc, 1); + } + return out.str(); + }; break; case 2: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i += 2) { - if(i) - out << ' '; - util::stream_format(out, "%04X", r16(pc)); - pc = m_next_pc_wrap(pc, 2); - } - return out.str(); - }; + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 2) { + if(i) + out << ' '; + util::stream_format(out, "%06o", r16(pc)); + pc = m_next_pc_wrap(pc, 2); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 2) { + if(i) + out << ' '; + util::stream_format(out, "%04X", r16(pc)); + pc = m_next_pc_wrap(pc, 2); + } + return out.str(); + }; break; case 4: + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 4) { + if(i) + out << ' '; + util::stream_format(out, "%011o", r32(pc)); + pc = m_next_pc_wrap(pc, 4); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 4) { + if(i) + out << ' '; + util::stream_format(out, "%08X", r32(pc)); + pc = m_next_pc_wrap(pc, 4); + } + return out.str(); + }; + break; + + case 8: + if(is_octal) + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 8) { + if(i) + out << ' '; + util::stream_format(out, "%022o", r64(pc)); + pc = m_next_pc_wrap(pc, 8); + } + return out.str(); + }; + else + m_data_to_string = [this](offs_t pc, offs_t size) { + std::ostringstream out; + for(offs_t i=0; i != size; i += 8) { + if(i) + out << ' '; + util::stream_format(out, "%016X", r64(pc)); + pc = m_next_pc_wrap(pc, 8); + } + return out.str(); + }; + break; + } + break; + + case 3: + if(is_octal) m_data_to_string = [this](offs_t pc, offs_t size) { std::ostringstream out; - for(offs_t i=0; i != size; i += 4) { + for(offs_t i=0; i != size; i += 16) { if(i) out << ' '; - util::stream_format(out, "%08X", r32(pc)); - pc = m_next_pc_wrap(pc, 4); + util::stream_format(out, "%06o", r16(pc)); + pc = m_next_pc_wrap(pc, 16); } return out.str(); }; - break; - - case 8: + else m_data_to_string = [this](offs_t pc, offs_t size) { std::ostringstream out; - for(offs_t i=0; i != size; i += 8) { + for(offs_t i=0; i != size; i += 16) { if(i) out << ' '; - util::stream_format(out, "%016X", r64(pc)); - pc = m_next_pc_wrap(pc, 8); + util::stream_format(out, "%04X", r16(pc)); + pc = m_next_pc_wrap(pc, 16); } return out.str(); }; - break; - } - break; - - case 3: - m_data_to_string = [this](offs_t pc, offs_t size) { - std::ostringstream out; - for(offs_t i=0; i != size; i += 16) { - if(i) - out << ' '; - util::stream_format(out, "%04X", r16(pc)); - pc = m_next_pc_wrap(pc, 16); - } - return out.str(); - }; break; } diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index fa65b327d6c..41ae0b698a1 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -20,7 +20,7 @@ #include "debugvw.h" #include "natkeyboard.h" #include "render.h" -#include <ctype.h> +#include <cctype> #include <algorithm> #include <fstream> @@ -3119,7 +3119,7 @@ void debugger_commands::execute_snap(int ref, const std::vector<std::string> &pa if (fname.find(".png") == -1) fname.append(".png"); emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - osd_file::error filerr = file.open(fname.c_str()); + osd_file::error filerr = file.open(fname); if (filerr != osd_file::error::NONE) { diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp index 7594a7e3527..9219df2f0ca 100644 --- a/src/emu/debug/debugcon.cpp +++ b/src/emu/debug/debugcon.cpp @@ -14,7 +14,7 @@ #include "debugvw.h" #include "textbuf.h" #include "debugger.h" -#include <ctype.h> +#include <cctype> #include <fstream> /*************************************************************************** @@ -95,7 +95,7 @@ void debugger_console::exit() ***************************************************************************/ debugger_console::debug_command::debug_command(const char *_command, u32 _flags, int _ref, int _minparams, int _maxparams, std::function<void(int, const std::vector<std::string> &)> _handler) - : params(nullptr), help(nullptr), handler(_handler), flags(_flags), ref(_ref), minparams(_minparams), maxparams(_maxparams) + : params(nullptr), help(nullptr), handler(std::move(_handler)), flags(_flags), ref(_ref), minparams(_minparams), maxparams(_maxparams) { strcpy(command, _command); } diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index 81885ab51e8..c94f97510cd 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -10,7 +10,7 @@ #include "emu.h" #include "debughlp.h" -#include <ctype.h> +#include <cctype> diff --git a/src/emu/debug/debugvw.cpp b/src/emu/debug/debugvw.cpp index 1a87cce5441..de7fcd95b0b 100644 --- a/src/emu/debug/debugvw.cpp +++ b/src/emu/debug/debugvw.cpp @@ -19,7 +19,7 @@ #include "dvwpoints.h" #include "debugcpu.h" #include "debugger.h" -#include <ctype.h> +#include <cctype> diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index 11932d6bab0..e4daaff1a80 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -15,7 +15,7 @@ #include "debugger.h" #include <algorithm> -#include <ctype.h> +#include <cctype> #include <tuple> diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp index 45fad747ab3..114ec589951 100644 --- a/src/emu/debug/express.cpp +++ b/src/emu/debug/express.cpp @@ -31,7 +31,7 @@ #include "emu.h" #include "express.h" -#include <ctype.h> +#include <cctype> @@ -252,8 +252,8 @@ integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::getter_func getter, symbol_table::setter_func setter, const std::string &format) : symbol_entry(table, SMT_INTEGER, name, format), - m_getter(getter), - m_setter(setter), + m_getter(std::move(getter)), + m_setter(std::move(setter)), m_value(0) { } @@ -305,7 +305,7 @@ function_symbol_entry::function_symbol_entry(symbol_table &table, const char *na : symbol_entry(table, SMT_FUNCTION, name, ""), m_minparams(minparams), m_maxparams(maxparams), - m_execute(execute) + m_execute(std::move(execute)) { } @@ -381,9 +381,9 @@ symbol_table::symbol_table(void *globalref, symbol_table *parent) void symbol_table::configure_memory(void *param, valid_func valid, read_func read, write_func write) { m_memory_param = param; - m_memory_valid = valid; - m_memory_read = read; - m_memory_write = write; + m_memory_valid = std::move(valid); + m_memory_read = std::move(read); + m_memory_write = std::move(write); } diff --git a/src/emu/debugger.cpp b/src/emu/debugger.cpp index b7ddea04137..f3a35a2a0bb 100644 --- a/src/emu/debugger.cpp +++ b/src/emu/debugger.cpp @@ -14,7 +14,7 @@ #include "debug/debugcmd.h" #include "debug/debugcon.h" #include "debug/debugvw.h" -#include <ctype.h> +#include <cctype> /*************************************************************************** GLOBAL VARIABLES diff --git a/src/emu/devcpu.cpp b/src/emu/devcpu.cpp index e75b621c6f0..c7163460b95 100644 --- a/src/emu/devcpu.cpp +++ b/src/emu/devcpu.cpp @@ -10,7 +10,7 @@ #include "emu.h" #include "emuopts.h" -#include <ctype.h> +#include <cctype> //************************************************************************** diff --git a/src/emu/device.cpp b/src/emu/device.cpp index cd7bc5918ec..055f0707135 100644 --- a/src/emu/device.cpp +++ b/src/emu/device.cpp @@ -13,7 +13,7 @@ #include "speaker.h" #include "debug/debugcpu.h" -#include <string.h> +#include <cstring> //************************************************************************** @@ -130,7 +130,7 @@ device_t::~device_t() memory_region *device_t::memregion(std::string _tag) const { // build a fully-qualified name and look it up - auto search = machine().memory().regions().find(subtag(_tag).c_str()); + auto search = machine().memory().regions().find(subtag(std::move(_tag))); if (search != machine().memory().regions().end()) return search->second.get(); else @@ -146,7 +146,7 @@ memory_region *device_t::memregion(std::string _tag) const memory_share *device_t::memshare(std::string _tag) const { // build a fully-qualified name and look it up - auto search = machine().memory().shares().find(subtag(_tag).c_str()); + auto search = machine().memory().shares().find(subtag(std::move(_tag))); if (search != machine().memory().shares().end()) return search->second.get(); else @@ -161,7 +161,7 @@ memory_share *device_t::memshare(std::string _tag) const memory_bank *device_t::membank(std::string _tag) const { - auto search = machine().memory().banks().find(subtag(_tag).c_str()); + auto search = machine().memory().banks().find(subtag(std::move(_tag))); if (search != machine().memory().banks().end()) return search->second.get(); else @@ -177,7 +177,7 @@ memory_bank *device_t::membank(std::string _tag) const ioport_port *device_t::ioport(std::string tag) const { // build a fully-qualified name and look it up - return machine().ioport().port(subtag(tag).c_str()); + return machine().ioport().port(subtag(std::move(tag)).c_str()); } diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index 5595ca809be..8cc849ee189 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -381,7 +381,7 @@ void device_image_interface::setup_working_directory() // get user-specified directory and make sure it exists m_working_directory = device().mconfig().options().sw_path(); // if multipath, get first - size_t i = m_working_directory.find_first_of(";"); + size_t i = m_working_directory.find_first_of(';'); if (i != std::string::npos) m_working_directory.resize(i); // validate directory @@ -448,7 +448,7 @@ u8 *device_image_interface::get_software_region(const char *tag) return nullptr; std::string full_tag = util::string_format("%s:%s", device().tag(), tag); - memory_region *region = device().machine().root_device().memregion(full_tag.c_str()); + memory_region *region = device().machine().root_device().memregion(full_tag); return region != nullptr ? region->base() : nullptr; } @@ -460,7 +460,7 @@ u8 *device_image_interface::get_software_region(const char *tag) u32 device_image_interface::get_software_region_length(const char *tag) { std::string full_tag = util::string_format("%s:%s", device().tag(), tag); - memory_region *region = device().machine().root_device().memregion(full_tag.c_str()); + memory_region *region = device().machine().root_device().memregion(full_tag); return region != nullptr ? region->bytes() : 0; } @@ -632,7 +632,7 @@ void device_image_interface::battery_load(void *buffer, int length, int fill) osd_file::error filerr; int bytes_read = 0; - std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext.c_str()).append(".nv"); + std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext).append(".nv"); /* try to open the battery file and read it in, if possible */ emu_file file(device().machine().options().nvram_directory(), OPEN_FLAG_READ); @@ -651,7 +651,7 @@ void device_image_interface::battery_load(void *buffer, int length, const void * osd_file::error filerr; int bytes_read = 0; - std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext.c_str()).append(".nv"); + std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext).append(".nv"); // try to open the battery file and read it in, if possible emu_file file(device().machine().options().nvram_directory(), OPEN_FLAG_READ); @@ -680,7 +680,7 @@ void device_image_interface::battery_save(const void *buffer, int length) if (!device().machine().options().nvram_save()) return; - std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext.c_str()).append(".nv"); + std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext).append(".nv"); // try to open the battery file and write it out, if possible emu_file file(device().machine().options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); @@ -930,7 +930,7 @@ bool device_image_interface::load_software(software_list_device &swlist, const c while (swinfo != nullptr) { locationtag.append(swinfo->shortname()).append(breakstr); - swinfo = !swinfo->parentname().empty() ? swlist.find(swinfo->parentname().c_str()) : nullptr; + swinfo = !swinfo->parentname().empty() ? swlist.find(swinfo->parentname()) : nullptr; } // strip the final '%' locationtag.erase(locationtag.length() - 1, 1); diff --git a/src/emu/disound.cpp b/src/emu/disound.cpp index 6135b4a2f64..a48ad44c40b 100644 --- a/src/emu/disound.cpp +++ b/src/emu/disound.cpp @@ -260,7 +260,7 @@ void device_sound_interface::interface_validity_check(validity_checker &valid) c // find a device with the requested tag device_t const *const target = route.m_base.get().subdevice(route.m_target.c_str()); if (!target) - osd_printf_error("Attempting to route sound to non-existent device '%s'\n", route.m_base.get().subtag(route.m_target.c_str())); + osd_printf_error("Attempting to route sound to non-existent device '%s'\n", route.m_base.get().subtag(route.m_target)); // if it's not a speaker or a sound device, error device_sound_interface const *sound; diff --git a/src/emu/drivenum.cpp b/src/emu/drivenum.cpp index 989a9cc8f46..5a29dcabd9a 100644 --- a/src/emu/drivenum.cpp +++ b/src/emu/drivenum.cpp @@ -14,7 +14,7 @@ #include <algorithm> -#include <ctype.h> +#include <cctype> diff --git a/src/emu/driver.cpp b/src/emu/driver.cpp index d13a4899136..7093b73615d 100644 --- a/src/emu/driver.cpp +++ b/src/emu/driver.cpp @@ -71,7 +71,7 @@ void driver_device::set_game_driver(const game_driver &game) void driver_device::static_set_callback(device_t &device, callback_type type, driver_callback_delegate callback) { - downcast<driver_device &>(device).m_callbacks[type] = callback; + downcast<driver_device &>(device).m_callbacks[type] = std::move(callback); } diff --git a/src/emu/emucore.h b/src/emu/emucore.h index ef6713c8d8f..4eef4c19f90 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -13,12 +13,12 @@ #pragma once // standard C includes -#include <assert.h> -#include <math.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <stdarg.h> +#include <cassert> +#include <cmath> +#include <cstdio> +#include <cstring> +#include <cstdlib> +#include <cstdarg> // some cleanups for Solaris for things defined in stdlib.h #if defined(__sun__) && defined(__svr4__) @@ -308,7 +308,7 @@ inline std::enable_if_t<!std::is_base_of<device_t, Source>::value> report_bad_ca template <typename Dest, typename Source> inline Dest downcast(Source *src) { -#if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST) +#if defined(MAME_DEBUG) Dest const chk(dynamic_cast<Dest>(src)); if (chk != src) report_bad_cast<std::remove_pointer_t<Dest>, Source>(src); #endif @@ -318,7 +318,7 @@ inline Dest downcast(Source *src) template<class Dest, class Source> inline Dest downcast(Source &src) { -#if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST) +#if defined(MAME_DEBUG) std::remove_reference_t<Dest> *const chk(dynamic_cast<std::remove_reference_t<Dest> *>(&src)); if (chk != &src) report_bad_cast<std::remove_reference_t<Dest>, Source>(&src); #endif diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index 691917bc4a5..f800d09c91f 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -1422,7 +1422,7 @@ void address_space::prepare_map() { // if we can't find it, add it to our map std::string fulltag = entry.m_devbase.subtag(entry.m_share); - if (m_manager.m_sharelist.find(fulltag.c_str()) == m_manager.m_sharelist.end()) + if (m_manager.m_sharelist.find(fulltag) == m_manager.m_sharelist.end()) { VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.c_str(), entry.m_addrend + 1 - entry.m_addrstart)); m_manager.m_sharelist.emplace(fulltag.c_str(), std::make_unique<memory_share>(m_config.data_width(), address_to_byte(entry.m_addrend + 1 - entry.m_addrstart), endianness())); @@ -1447,7 +1447,7 @@ void address_space::prepare_map() std::string fulltag = entry.m_devbase.subtag(entry.m_region); // find the region - memory_region *region = m_manager.machine().root_device().memregion(fulltag.c_str()); + memory_region *region = m_manager.machine().root_device().memregion(fulltag); if (region == nullptr) fatalerror("device '%s' %s space memory map entry %X-%X references nonexistent region \"%s\"\n", m_device.tag(), m_name, entry.m_addrstart, entry.m_addrend, entry.m_region); @@ -1463,7 +1463,7 @@ void address_space::prepare_map() std::string fulltag = entry.m_devbase.subtag(entry.m_region); // set the memory address - entry.m_memory = m_manager.machine().root_device().memregion(fulltag.c_str())->base() + entry.m_rgnoffs; + entry.m_memory = m_manager.machine().root_device().memregion(fulltag)->base() + entry.m_rgnoffs; } } } @@ -1774,7 +1774,7 @@ address_map_entry *address_space::block_assign_intersecting(offs_t addrstart, of if (entry.m_memory == nullptr && entry.m_share != nullptr) { std::string fulltag = entry.m_devbase.subtag(entry.m_share); - auto share = m_manager.shares().find(fulltag.c_str()); + auto share = m_manager.shares().find(fulltag); if (share != m_manager.shares().end() && share->second->ptr() != nullptr) { entry.m_memory = share->second->ptr(); @@ -1797,7 +1797,7 @@ address_map_entry *address_space::block_assign_intersecting(offs_t addrstart, of if (entry.m_memory != nullptr && entry.m_share != nullptr) { std::string fulltag = entry.m_devbase.subtag(entry.m_share); - auto share = m_manager.shares().find(fulltag.c_str()); + auto share = m_manager.shares().find(fulltag); if (share != m_manager.shares().end() && share->second->ptr() == nullptr) { share->second->set_ptr(entry.m_memory); @@ -2299,7 +2299,7 @@ bool address_space::needs_backing_store(const address_map_entry &entry) if (entry.m_share != nullptr) { std::string fulltag = entry.m_devbase.subtag(entry.m_share); - auto share = m_manager.shares().find(fulltag.c_str()); + auto share = m_manager.shares().find(fulltag); if (share != m_manager.shares().end() && share->second->ptr() == nullptr) return true; } @@ -2321,7 +2321,7 @@ bool address_space::needs_backing_store(const address_map_entry &entry) int address_space::add_change_notifier(std::function<void (read_or_write)> n) { int id = m_notifier_id++; - m_notifiers.emplace_back(notifier_t{ n, id }); + m_notifiers.emplace_back(notifier_t{ std::move(n), id }); return id; } @@ -2582,7 +2582,7 @@ void memory_bank::set_base(void *base) m_curentry = 0; } m_entries[m_curentry] = reinterpret_cast<u8 *>(base); - for(auto cb : m_alloc_notifier) + for(const auto &cb : m_alloc_notifier) cb(base); m_alloc_notifier.clear(); } @@ -2593,7 +2593,7 @@ void memory_bank::set_base(void *base) //------------------------------------------------- void memory_bank::add_notifier(std::function<void (void *)> cb) { - m_alloc_notifier.emplace_back(cb); + m_alloc_notifier.emplace_back(std::move(cb)); } //------------------------------------------------- diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 6f38f815dcb..a48a4f80811 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -140,7 +140,7 @@ const options_entry emu_options::s_option_entries[] = // input options { nullptr, nullptr, OPTION_HEADER, "CORE INPUT OPTIONS" }, - { OPTION_COIN_LOCKOUT ";coinlock", "1", OPTION_BOOLEAN, "ignore coin inputs if coin lockout ouput is active" }, + { OPTION_COIN_LOCKOUT ";coinlock", "1", OPTION_BOOLEAN, "ignore coin inputs if coin lockout output is active" }, { OPTION_CTRLR, nullptr, OPTION_STRING, "preconfigure for specified controller" }, { OPTION_MOUSE, "0", OPTION_BOOLEAN, "enable mouse input" }, { OPTION_JOYSTICK ";joy", "1", OPTION_BOOLEAN, "enable joystick input" }, diff --git a/src/emu/emupal.cpp b/src/emu/emupal.cpp index 536eff6577d..6c027ffe611 100644 --- a/src/emu/emupal.cpp +++ b/src/emu/emupal.cpp @@ -502,7 +502,7 @@ void palette_device::device_start() { // find the extended (split) memory, if present std::string tag_ext = std::string(tag()).append("_ext"); - const memory_share *share_ext = memshare(tag_ext.c_str()); + const memory_share *share_ext = memshare(tag_ext); // make sure we have specified a format if (m_raw_to_rgb.bytes_per_entry() <= 0) diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h index 834f5b16a43..2843e7a36c8 100644 --- a/src/emu/gamedrv.h +++ b/src/emu/gamedrv.h @@ -75,7 +75,7 @@ constexpr u64 MACHINE_NO_SOUND_HW = machine_flags::NO_SOUND_HW; constexpr u64 MACHINE_MECHANICAL = machine_flags::MECHANICAL; constexpr u64 MACHINE_IS_INCOMPLETE = machine_flags::IS_INCOMPLETE; -// flags taht map to device feature flags +// flags that map to device feature flags constexpr u64 MACHINE_UNEMULATED_PROTECTION = 0x00000001'00000000; // game's protection not fully emulated constexpr u64 MACHINE_WRONG_COLORS = 0x00000002'00000000; // colors are totally wrong constexpr u64 MACHINE_IMPERFECT_COLORS = 0x00000004'00000000; // colors are not 100% accurate, but close diff --git a/src/emu/http.cpp b/src/emu/http.cpp index 5b0dcca8d05..48599258aaa 100644 --- a/src/emu/http.cpp +++ b/src/emu/http.cpp @@ -127,7 +127,7 @@ public: std::size_t m_path_end; std::size_t m_query_end; - http_request_impl(std::shared_ptr<webpp::Request> request) : m_request(request) { + http_request_impl(std::shared_ptr<webpp::Request> request) : m_request(std::move(request)) { std::size_t len = m_request->path.length(); m_fragment = m_request->path.find('#'); @@ -195,7 +195,7 @@ struct http_response_impl : public http_manager::http_response { std::stringstream m_headers; std::stringstream m_body; - http_response_impl(std::shared_ptr<webpp::Response> response) : m_response(response) { } + http_response_impl(std::shared_ptr<webpp::Response> response) : m_response(std::move(response)) { } virtual ~http_response_impl() = default; @@ -238,10 +238,10 @@ struct websocket_endpoint_impl : public http_manager::websocket_endpoint { http_manager::websocket_close_handler on_close, http_manager::websocket_error_handler on_error) : m_endpoint(endpoint) { - this->on_open = on_open; - this->on_message = on_message; - this->on_close = on_close; - this->on_error = on_error; + this->on_open = std::move(on_open); + this->on_message = std::move(on_message); + this->on_close = std::move(on_close); + this->on_error = std::move(on_error); } }; @@ -295,8 +295,8 @@ http_manager::http_manager(bool active, short port, const char *root) } // Determine the file extension. - std::size_t last_slash_pos = path.find_last_of("/"); - std::size_t last_dot_pos = path.find_last_of("."); + std::size_t last_slash_pos = path.find_last_of('/'); + std::size_t last_dot_pos = path.find_last_of('.'); std::string extension; if (last_dot_pos != std::string::npos && last_dot_pos > last_slash_pos) { @@ -545,21 +545,21 @@ http_manager::websocket_endpoint_ptr http_manager::add_endpoint(const std::strin auto endpoint_impl = std::make_shared<websocket_endpoint_impl>(endpoint_ptr, on_open, on_message, on_close, on_error); endpoint.on_open = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection) { - this->on_open(endpoint_impl, connection); + this->on_open(endpoint_impl, std::move(connection)); }; endpoint.on_message = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection, std::shared_ptr<webpp::ws_server::Message> message) { std::string payload = message->string(); int opcode = message->fin_rsv_opcode & 0x0f; - this->on_message(endpoint_impl, connection, payload, opcode); + this->on_message(endpoint_impl, std::move(connection), payload, opcode); }; endpoint.on_close = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection, int status, const std::string& reason) { - this->on_close(endpoint_impl, connection, status, reason); + this->on_close(endpoint_impl, std::move(connection), status, reason); }; endpoint.on_error = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection, const std::error_code& error_code) { - this->on_error(endpoint_impl, connection, error_code); + this->on_error(endpoint_impl, std::move(connection), error_code); }; m_endpoints[path] = endpoint_impl; diff --git a/src/emu/http.h b/src/emu/http.h index 6c845757757..3bfe1bd9b18 100644 --- a/src/emu/http.h +++ b/src/emu/http.h @@ -18,7 +18,7 @@ HTTP server handling #define MAME_EMU_HTTP_H #include <thread> -#include <time.h> +#include <ctime> #include "server_http.hpp" #include "server_ws.hpp" diff --git a/src/emu/image.cpp b/src/emu/image.cpp index e2cf6d91c83..87d476056d7 100644 --- a/src/emu/image.cpp +++ b/src/emu/image.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ -#include <ctype.h> +#include <cctype> #include "emu.h" #include "emuopts.h" diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index e42aede5523..7efe86226ca 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -101,8 +101,8 @@ #include "osdepend.h" -#include <ctype.h> -#include <time.h> +#include <cctype> +#include <ctime> namespace { @@ -436,7 +436,7 @@ digital_joystick::digital_joystick(int player, int number) digital_joystick::direction_t digital_joystick::add_axis(ioport_field &field) { direction_t direction = direction_t((field.type() - (IPT_DIGITAL_JOYSTICK_FIRST + 1)) % 4); - m_field[direction].append(*global_alloc(simple_list_wrapper<ioport_field>(&field))); + m_field[direction].emplace_front(field); return direction; } @@ -456,10 +456,10 @@ void digital_joystick::frame_update() // read all the associated ports running_machine *machine = nullptr; for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; ++direction) - for (const simple_list_wrapper<ioport_field> &i : m_field[direction]) + for (const std::reference_wrapper<ioport_field> &i : m_field[direction]) { - machine = &i.object()->machine(); - if (machine->input().seq_pressed(i.object()->seq(SEQ_TYPE_STANDARD))) + machine = &i.get().machine(); + if (machine->input().seq_pressed(i.get().seq(SEQ_TYPE_STANDARD))) m_current |= 1 << direction; } @@ -2754,7 +2754,7 @@ void ioport_manager::timecode_init() filename.append(record_filename).append(".timecode"); osd_printf_info("Record input timecode file: %s\n", record_filename); - osd_file::error filerr = m_timecode_file.open(filename.c_str()); + osd_file::error filerr = m_timecode_file.open(filename); if (filerr != osd_file::error::NONE) throw emu_fatalerror("ioport_manager::timecode_init: Failed to open file for input timecode recording"); @@ -3028,7 +3028,7 @@ ioport_configurer& ioport_configurer::port_modify(const char *tag) std::string fulltag = m_owner.subtag(tag); // find the existing port - m_curport = m_portlist.find(fulltag.c_str())->second.get(); + m_curport = m_portlist.find(fulltag)->second.get(); if (m_curport == nullptr) throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.c_str()); diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 9976c6e91b8..4a2270c985a 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -21,7 +21,7 @@ #include <cstdint> #include <cstring> #include <vector> -#include <time.h> +#include <ctime> //************************************************************************** @@ -864,7 +864,7 @@ private: digital_joystick * m_next; // next joystick in the list int m_player; // player number represented int m_number; // joystick number represented - simple_list<simple_list_wrapper<ioport_field> > m_field[JOYDIR_COUNT]; // potential input fields for each direction + std::forward_list<std::reference_wrapper<ioport_field> > m_field[JOYDIR_COUNT]; // potential input fields for each direction u8 m_current; // current value u8 m_current4way; // current 4-way value u8 m_previous; // previous value diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index e6ef063a0ac..8ccb7b5907a 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -85,7 +85,7 @@ #include "romload.h" #include "tilemap.h" #include "ui/uimain.h" -#include <time.h> +#include <ctime> #include <rapidjson/writer.h> #include <rapidjson/stringbuffer.h> @@ -513,7 +513,7 @@ std::string running_machine::get_statename(const char *option) const if (pos != -1) { // if more %d are found, revert to default and ignore them all - if (statename_str.find(statename_dev.c_str(), pos + 3) != -1) + if (statename_str.find(statename_dev, pos + 3) != -1) statename_str.assign("%g"); // else if there is a single %d, try to create the correct snapname else @@ -521,8 +521,8 @@ std::string running_machine::get_statename(const char *option) const int name_found = 0; // find length of the device name - int end1 = statename_str.find("/", pos + 3); - int end2 = statename_str.find("%", pos + 3); + int end1 = statename_str.find('/', pos + 3); + int end2 = statename_str.find('%', pos + 3); int end; if ((end1 != -1) && (end2 != -1)) @@ -557,7 +557,7 @@ std::string running_machine::get_statename(const char *option) const std::string filename(image.basename_noext()); // setup snapname and remove the %d_ - strreplace(statename_str, devname_str.c_str(), filename.c_str()); + strreplace(statename_str, devname_str, filename); statename_str.erase(pos, 3); //printf("check image: %s\n", filename.c_str()); @@ -1240,7 +1240,7 @@ running_machine::notifier_callback_item::notifier_callback_item(machine_notify_d //------------------------------------------------- running_machine::logerror_callback_item::logerror_callback_item(logerror_callback func) - : m_func(func) + : m_func(std::move(func)) { } diff --git a/src/emu/machine.h b/src/emu/machine.h index 0c14f6acdb6..69223dd33af 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -19,7 +19,7 @@ #include <functional> -#include <time.h> +#include <ctime> //************************************************************************** // CONSTANTS diff --git a/src/emu/main.h b/src/emu/main.h index 2a088a3995d..71d7b951e4d 100644 --- a/src/emu/main.h +++ b/src/emu/main.h @@ -17,7 +17,7 @@ #define MAME_EMU_MAIN_H #include <thread> -#include <time.h> +#include <ctime> //************************************************************************** // CONSTANTS diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp index d6385c6d628..e80d0594a19 100644 --- a/src/emu/mconfig.cpp +++ b/src/emu/mconfig.cpp @@ -12,7 +12,7 @@ #include "emuopts.h" #include "screen.h" -#include <ctype.h> +#include <cctype> #include <cstring> #include <numeric> diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index 7d154787c0c..14b5e9578b4 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -350,9 +350,9 @@ natural_keyboard::natural_keyboard(running_machine &machine) void natural_keyboard::configure(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty) { // set the callbacks - m_queue_chars = queue_chars; - m_accept_char = accept_char; - m_charqueue_empty = charqueue_empty; + m_queue_chars = std::move(queue_chars); + m_accept_char = std::move(accept_char); + m_charqueue_empty = std::move(charqueue_empty); } @@ -385,29 +385,32 @@ void natural_keyboard::set_in_use(bool usage) //------------------------------------------------- -// post - post a single character +// post_char - post a single character //------------------------------------------------- -void natural_keyboard::post(char32_t ch) +void natural_keyboard::post_char(char32_t ch, bool normalize_crlf) { - // ignore any \n that are preceded by \r - if (m_last_cr && ch == '\n') + if (normalize_crlf) { - m_last_cr = false; - return; - } + // ignore any \n that are preceded by \r + if (m_last_cr && ch == '\n') + { + m_last_cr = false; + return; + } - // change all eolns to '\r' - if (ch == '\n') - ch = '\r'; - else - m_last_cr = (ch == '\r'); + // change all eolns to '\r' + if (ch == '\n') + ch = '\r'; + else + m_last_cr = (ch == '\r'); + } // logging if (LOG_NATURAL_KEYBOARD) { const keycode_map_entry *code = find_code(ch); - machine().logerror("natural_keyboard::post(): code=%i (%s) field.name='%s'\n", int(ch), unicode_to_string(ch).c_str(), (code != nullptr && code->field[0] != nullptr) ? code->field[0]->name() : "<null>"); + machine().logerror("natural_keyboard::post_char(): code=%i (%s) field.name='%s'\n", int(ch), unicode_to_string(ch).c_str(), (code != nullptr && code->field[0] != nullptr) ? code->field[0]->name() : "<null>"); } // can we post this key in the queue directly? @@ -447,7 +450,7 @@ void natural_keyboard::post(const char32_t *text, size_t length, const attotime while (length > 0 && !full()) { // fetch next character - post(*text++); + post_char(*text++, true); length--; } } @@ -479,7 +482,7 @@ void natural_keyboard::post_utf8(const char *text, size_t length, const attotime } // append to the buffer - post(uc); + post_char(uc, true); text += count; length -= count; } @@ -565,7 +568,7 @@ void natural_keyboard::post_coded(const char *text, size_t length, const attotim // if we got a code, post it if (ch != 0) - post(ch); + post_char(ch); curpos += increment; } } diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h index 41b33ace105..23abd9ac437 100644 --- a/src/emu/natkeyboard.h +++ b/src/emu/natkeyboard.h @@ -50,7 +50,7 @@ public: void set_in_use(bool usage); // posting - void post(char32_t ch); + void post_char(char32_t ch, bool normalize_crlf = false); void post(const char32_t *text, size_t length = 0, const attotime &rate = attotime::zero); void post_utf8(const char *text, size_t length = 0, const attotime &rate = attotime::zero); void post_utf8(const std::string &text, const attotime &rate = attotime::zero); diff --git a/src/emu/network.cpp b/src/emu/network.cpp index 259cca30efb..701db850b58 100644 --- a/src/emu/network.cpp +++ b/src/emu/network.cpp @@ -6,7 +6,7 @@ Core network functions and definitions. ***************************************************************************/ -#include <ctype.h> +#include <cctype> #include "emu.h" #include "network.h" diff --git a/src/emu/render.cpp b/src/emu/render.cpp index b25e18fa968..6e7067ea30e 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -2041,7 +2041,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename) // attempt to open the file; bail if we can't emu_file layoutfile(m_manager.machine().options().art_path(), OPEN_FLAG_READ); - osd_file::error const filerr(layoutfile.open(fname.c_str())); + osd_file::error const filerr(layoutfile.open(fname)); if (filerr != osd_file::error::NONE) return false; diff --git a/src/emu/render.h b/src/emu/render.h index 3a34066b096..ce4ea3c66df 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -48,7 +48,7 @@ #include "screen.h" -#include <math.h> +#include <cmath> #include <array> #include <map> #include <memory> diff --git a/src/emu/rendersw.hxx b/src/emu/rendersw.hxx index b1a032258d1..896d7dbfe18 100644 --- a/src/emu/rendersw.hxx +++ b/src/emu/rendersw.hxx @@ -603,12 +603,8 @@ private: // rasterization of a 16bpp palettized texture //------------------------------------------------- - static void draw_quad_palette16_none(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_palette16_none(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data &setup) { - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; - // ensure all parameters are valid assert(prim.texture.palette != nullptr); @@ -623,12 +619,12 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_palette16(prim.texture, curu, curv); + const u32 pix = get_texel_palette16(prim.texture, curu, curv); *dest++ = source32_to_dest(pix); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -653,16 +649,16 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_palette16(prim.texture, curu, curv); - u32 r = (source32_r(pix) * sr) >> 8; - u32 g = (source32_g(pix) * sg) >> 8; - u32 b = (source32_b(pix) * sb) >> 8; + const u32 pix = get_texel_palette16(prim.texture, curu, curv); + const u32 r = (source32_r(pix) * sr) >> 8; + const u32 g = (source32_g(pix) * sg) >> 8; + const u32 b = (source32_b(pix) * sb) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -689,17 +685,17 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_palette16(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; - u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; - u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; + const u32 pix = get_texel_palette16(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; + const u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; + const u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -711,12 +707,8 @@ private: // rasterization of a 16bpp palettized texture //------------------------------------------------- - static void draw_quad_palette16_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_palette16_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; - // ensure all parameters are valid assert(prim.texture.palette != nullptr); @@ -731,12 +723,12 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_palette16(prim.texture, curu, curv); + const u32 pix = get_texel_palette16(prim.texture, curu, curv); if ((pix & 0xffffff) != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = source32_r(pix) + dest_r(dpix); u32 g = source32_g(pix) + dest_g(dpix); u32 b = source32_b(pix) + dest_b(dpix); @@ -746,8 +738,8 @@ private: *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -772,12 +764,12 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_palette16(prim.texture, curu, curv); + const u32 pix = get_texel_palette16(prim.texture, curu, curv); if ((pix & 0xffffff) != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((source32_r(pix) * sr) >> 8) + dest_r(dpix); u32 g = ((source32_g(pix) * sg) >> 8) + dest_g(dpix); u32 b = ((source32_b(pix) * sb) >> 8) + dest_b(dpix); @@ -785,8 +777,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -804,12 +796,8 @@ private: // rasterization of a 16bpp YUY image //------------------------------------------------- - static void draw_quad_yuy16_none(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_yuy16_none(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; - // fast case: no coloring, no alpha if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { @@ -821,12 +809,12 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); *dest++ = source32_to_dest(pix); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -851,16 +839,16 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - u32 r = (source32_r(pix) * sr) >> 8; - u32 g = (source32_g(pix) * sg) >> 8; - u32 b = (source32_b(pix) * sb) >> 8; + const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + const u32 r = (source32_r(pix) * sr) >> 8; + const u32 g = (source32_g(pix) * sg) >> 8; + const u32 b = (source32_b(pix) * sb) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -887,17 +875,17 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; - u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; - u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; + const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; + const u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; + const u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -910,12 +898,8 @@ private: // conversion //------------------------------------------------- - static void draw_quad_yuy16_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_yuy16_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; - // simply can't do this without reading from the dest if (_NoDestRead) return; @@ -931,10 +915,10 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = source32_r(pix) + dest_r(dpix); u32 g = source32_g(pix) + dest_g(dpix); u32 b = source32_b(pix) + dest_b(dpix); @@ -942,8 +926,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -970,10 +954,10 @@ private: s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix); u32 g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix); u32 b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix); @@ -981,8 +965,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -998,12 +982,9 @@ private: // a 32bpp RGB texture //------------------------------------------------- - static void draw_quad_rgb32(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_rgb32(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { const rgb_t *palbase = prim.texture.palette; - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; // fast case: no coloring, no alpha if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) @@ -1019,12 +1000,12 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_rgb32(prim.texture, curu, curv); + const u32 pix = get_texel_rgb32(prim.texture, curu, curv); *dest++ = source32_to_dest(pix); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1032,16 +1013,16 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_rgb32(prim.texture, curu, curv); - u32 r = palbase[(pix >> 16) & 0xff] >> _SrcShiftR; - u32 g = palbase[(pix >> 8) & 0xff] >> _SrcShiftG; - u32 b = palbase[(pix >> 0) & 0xff] >> _SrcShiftB; + const u32 pix = get_texel_rgb32(prim.texture, curu, curv); + const u32 r = palbase[(pix >> 16) & 0xff] >> _SrcShiftR; + const u32 g = palbase[(pix >> 8) & 0xff] >> _SrcShiftG; + const u32 b = palbase[(pix >> 0) & 0xff] >> _SrcShiftB; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1070,16 +1051,16 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_rgb32(prim.texture, curu, curv); - u32 r = (source32_r(pix) * sr) >> 8; - u32 g = (source32_g(pix) * sg) >> 8; - u32 b = (source32_b(pix) * sb) >> 8; + const u32 pix = get_texel_rgb32(prim.texture, curu, curv); + const u32 r = (source32_r(pix) * sr) >> 8; + const u32 g = (source32_g(pix) * sg) >> 8; + const u32 b = (source32_b(pix) * sb) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1087,16 +1068,16 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_rgb32(prim.texture, curu, curv); - u32 r = (palbase[(pix >> 16) & 0xff] * sr) >> (8 + _SrcShiftR); - u32 g = (palbase[(pix >> 8) & 0xff] * sg) >> (8 + _SrcShiftG); - u32 b = (palbase[(pix >> 0) & 0xff] * sb) >> (8 + _SrcShiftB); + const u32 pix = get_texel_rgb32(prim.texture, curu, curv); + const u32 r = (palbase[(pix >> 16) & 0xff] * sr) >> (8 + _SrcShiftR); + const u32 g = (palbase[(pix >> 8) & 0xff] * sg) >> (8 + _SrcShiftG); + const u32 b = (palbase[(pix >> 0) & 0xff] * sb) >> (8 + _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1127,17 +1108,17 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_rgb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; - u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; - u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; + const u32 pix = get_texel_rgb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; + const u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; + const u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1145,17 +1126,17 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_rgb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr + dest_r(dpix) * invsa) >> 8; - u32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg + dest_g(dpix) * invsa) >> 8; - u32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb + dest_b(dpix) * invsa) >> 8; + const u32 pix = get_texel_rgb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr + dest_r(dpix) * invsa) >> 8; + const u32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg + dest_g(dpix) * invsa) >> 8; + const u32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1168,12 +1149,9 @@ private: // rasterization by using RGB add //------------------------------------------------- - static void draw_quad_rgb32_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_rgb32_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { const rgb_t *palbase = prim.texture.palette; - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1193,10 +1171,10 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = source32_r(pix) + dest_r(dpix); u32 g = source32_g(pix) + dest_g(dpix); u32 b = source32_b(pix) + dest_b(dpix); @@ -1204,8 +1182,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1213,10 +1191,10 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = (palbase[(pix >> 16) & 0xff] >> _SrcShiftR) + dest_r(dpix); u32 g = (palbase[(pix >> 8) & 0xff] >> _SrcShiftG) + dest_g(dpix); u32 b = (palbase[(pix >> 0) & 0xff] >> _SrcShiftB) + dest_b(dpix); @@ -1224,8 +1202,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1256,10 +1234,10 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix); u32 g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix); u32 b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix); @@ -1267,8 +1245,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1276,10 +1254,10 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((palbase[(pix >> 16) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_r(dpix); u32 g = ((palbase[(pix >> 8) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_g(dpix); u32 b = ((palbase[(pix >> 0) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_b(dpix); @@ -1287,8 +1265,8 @@ private: g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1301,12 +1279,9 @@ private: // rasterization using RGB multiply //------------------------------------------------- - static void draw_quad_rgb32_multiply(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_rgb32_multiply(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { const rgb_t *palbase = prim.texture.palette; - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1326,33 +1301,33 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (source32_r(pix) * dest_r(dpix)) >> (8 - _SrcShiftR); - u32 g = (source32_g(pix) * dest_g(dpix)) >> (8 - _SrcShiftG); - u32 b = (source32_b(pix) * dest_b(dpix)) >> (8 - _SrcShiftB); + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (source32_r(pix) * dest_r(dpix)) >> (8 - _SrcShiftR); + const u32 g = (source32_g(pix) * dest_g(dpix)) >> (8 - _SrcShiftG); + const u32 b = (source32_b(pix) * dest_b(dpix)) >> (8 - _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (palbase[(pix >> 16) & 0xff] * dest_r(dpix)) >> 8; - u32 g = (palbase[(pix >> 8) & 0xff] * dest_g(dpix)) >> 8; - u32 b = (palbase[(pix >> 0) & 0xff] * dest_b(dpix)) >> 8; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (palbase[(pix >> 16) & 0xff] * dest_r(dpix)) >> 8; + const u32 g = (palbase[(pix >> 8) & 0xff] * dest_g(dpix)) >> 8; + const u32 b = (palbase[(pix >> 0) & 0xff] * dest_b(dpix)) >> 8; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1381,33 +1356,33 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (source32_r(pix) * sr * dest_r(dpix)) >> (16 - _SrcShiftR); - u32 g = (source32_g(pix) * sg * dest_g(dpix)) >> (16 - _SrcShiftG); - u32 b = (source32_b(pix) * sb * dest_b(dpix)) >> (16 - _SrcShiftB); + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (source32_r(pix) * sr * dest_r(dpix)) >> (16 - _SrcShiftR); + const u32 g = (source32_g(pix) * sg * dest_g(dpix)) >> (16 - _SrcShiftG); + const u32 b = (source32_b(pix) * sb * dest_b(dpix)) >> (16 - _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 dpix = _NoDestRead ? 0 : *dest; - u32 r = (palbase[(pix >> 16) & 0xff] * sr * dest_r(dpix)) >> 16; - u32 g = (palbase[(pix >> 8) & 0xff] * sg * dest_g(dpix)) >> 16; - u32 b = (palbase[(pix >> 0) & 0xff] * sb * dest_b(dpix)) >> 16; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 r = (palbase[(pix >> 16) & 0xff] * sr * dest_r(dpix)) >> 16; + const u32 g = (palbase[(pix >> 8) & 0xff] * sg * dest_g(dpix)) >> 16; + const u32 b = (palbase[(pix >> 0) & 0xff] * sb * dest_b(dpix)) >> 16; *dest++ = dest_assemble_rgb(r, g, b); - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1424,12 +1399,9 @@ private: // rasterization using standard alpha blending //------------------------------------------------- - static void draw_quad_argb32_alpha(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_argb32_alpha(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { const rgb_t *palbase = prim.texture.palette; - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; // fast case: no coloring, no alpha if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) @@ -1445,23 +1417,23 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = pix >> 24; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = pix >> 24; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; - u32 invta = 0x100 - ta; - u32 r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; - u32 g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; - u32 b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 invta = 0x100 - ta; + const u32 r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; + const u32 g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; + const u32 b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1469,23 +1441,23 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = pix >> 24; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = pix >> 24; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; - u32 invta = 0x100 - ta; - u32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * ta + dest_r(dpix) * invta) >> 8; - u32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * ta + dest_g(dpix) * invta) >> 8; - u32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * ta + dest_b(dpix) * invta) >> 8; + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 invta = 0x100 - ta; + const u32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * ta + dest_r(dpix) * invta) >> 8; + const u32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * ta + dest_g(dpix) * invta) >> 8; + const u32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * ta + dest_b(dpix) * invta) >> 8; *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1516,23 +1488,23 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = (pix >> 24) * sa; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = (pix >> 24) * sa; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; - u32 invsta = (0x10000 - ta) << 8; - u32 r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; - u32 g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; - u32 b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 invsta = (0x10000 - ta) << 8; + const u32 r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; + const u32 g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; + const u32 b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1541,23 +1513,23 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = (pix >> 24) * sa; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = (pix >> 24) * sa; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; - u32 invsta = (0x10000 - ta) << 8; - u32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr * ta + dest_r(dpix) * invsta) >> 24; - u32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg * ta + dest_g(dpix) * invsta) >> 24; - u32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb * ta + dest_b(dpix) * invsta) >> 24; + const u32 dpix = _NoDestRead ? 0 : *dest; + const u32 invsta = (0x10000 - ta) << 8; + const u32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr * ta + dest_r(dpix) * invsta) >> 24; + const u32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg * ta + dest_g(dpix) * invsta) >> 24; + const u32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb * ta + dest_b(dpix) * invsta) >> 24; *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1570,12 +1542,9 @@ private: // rasterization by using RGB add //------------------------------------------------- - static void draw_quad_argb32_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) + static void draw_quad_argb32_add(const render_primitive &prim, _PixelType *dstdata, u32 pitch, const quad_setup_data&setup) { const rgb_t *palbase = prim.texture.palette; - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1595,13 +1564,13 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = pix >> 24; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = pix >> 24; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((source32_r(pix) * ta) >> 8) + dest_r(dpix); u32 g = ((source32_g(pix) * ta) >> 8) + dest_g(dpix); u32 b = ((source32_b(pix) * ta) >> 8) + dest_b(dpix); @@ -1611,8 +1580,8 @@ private: *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1620,13 +1589,13 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = pix >> 24; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = pix >> 24; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((palbase[(pix >> 16) & 0xff] * ta) >> (8 + _SrcShiftR)) + dest_r(dpix); u32 g = ((palbase[(pix >> 8) & 0xff] * ta) >> (8 + _SrcShiftG)) + dest_g(dpix); u32 b = ((palbase[(pix >> 0) & 0xff] * ta) >> (8 + _SrcShiftB)) + dest_b(dpix); @@ -1636,8 +1605,8 @@ private: *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } @@ -1668,13 +1637,13 @@ private: if (palbase == nullptr) { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = (pix >> 24) * sa; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = (pix >> 24) * sa; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((source32_r(pix) * sr * ta) >> 24) + dest_r(dpix); u32 g = ((source32_g(pix) * sg * ta) >> 24) + dest_g(dpix); u32 b = ((source32_b(pix) * sb * ta) >> 24) + dest_b(dpix); @@ -1684,8 +1653,8 @@ private: *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } @@ -1693,13 +1662,13 @@ private: else { // loop over cols - for (s32 x = setup.startx; x < endx; x++) + for (s32 x = setup.startx; x < setup.endx; x++) { - u32 pix = get_texel_argb32(prim.texture, curu, curv); - u32 ta = (pix >> 24) * sa; + const u32 pix = get_texel_argb32(prim.texture, curu, curv); + const u32 ta = (pix >> 24) * sa; if (ta != 0) { - u32 dpix = _NoDestRead ? 0 : *dest; + const u32 dpix = _NoDestRead ? 0 : *dest; u32 r = ((palbase[(pix >> 16) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_r(dpix); u32 g = ((palbase[(pix >> 8) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_g(dpix); u32 b = ((palbase[(pix >> 0) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_b(dpix); @@ -1709,8 +1678,8 @@ private: *dest = dest_assemble_rgb(r, g, b); } dest++; - curu += dudx; - curv += dvdx; + curu += setup.dudx; + curv += setup.dvdx; } } } diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index c5debb5f055..788f84a60ca 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -958,7 +958,7 @@ bool render_font::load_cached_bdf(const char *filename) // attempt to open the cached version of the font { emu_file cachefile(m_manager.machine().options().font_path(), OPEN_FLAG_READ); - filerr = cachefile.open(cachedname.c_str()); + filerr = cachefile.open(cachedname); if (filerr == osd_file::error::NONE) { // if we have a cached version, load it diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index f13d8aff77b..ea227b2c77b 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -18,7 +18,7 @@ #include "vecstream.h" #include "xmlfile.h" -#include <ctype.h> +#include <cctype> #include <algorithm> #include <cmath> #include <cstddef> @@ -2149,14 +2149,14 @@ public: // split out position names from string and figure out our number of symbols int location; m_numstops = 0; - location=symbollist.find(","); + location=symbollist.find(','); while (location!=-1) { m_stopnames[m_numstops] = symbollist; m_stopnames[m_numstops] = m_stopnames[m_numstops].substr(0, location); symbollist = symbollist.substr(location+1, symbollist.length()-(location-1)); m_numstops++; - location=symbollist.find(","); + location=symbollist.find(','); } m_stopnames[m_numstops++] = symbollist; @@ -2166,7 +2166,7 @@ public: for (int i=0;i<m_numstops;i++) { - location=m_stopnames[i].find(":"); + location=m_stopnames[i].find(':'); if (location!=-1) { m_imagefile[i] = m_stopnames[i]; @@ -3414,7 +3414,7 @@ void layout_view::item::resolve_tags() if (!m_input_tag.empty()) { - m_input_port = m_element->machine().root_device().ioport(m_input_tag.c_str()); + m_input_port = m_element->machine().root_device().ioport(m_input_tag); if (m_input_port) { for (ioport_field &field : m_input_port->fields()) diff --git a/src/emu/rendutil.cpp b/src/emu/rendutil.cpp index ab5770b86e1..7a1aa9193bb 100644 --- a/src/emu/rendutil.cpp +++ b/src/emu/rendutil.cpp @@ -559,7 +559,7 @@ void render_load_jpeg(bitmap_argb32 &bitmap, emu_file &file, const char *dirname else fname.assign(dirname).append(PATH_SEPARATOR).append(filename); - if (file.open(fname.c_str()) != osd_file::error::NONE) + if (file.open(fname) != osd_file::error::NONE) return; // define standard JPEG structures @@ -637,7 +637,7 @@ bool render_load_png(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, fname.assign(dirname).append(PATH_SEPARATOR).append(filename); else fname.assign(filename); - osd_file::error const filerr = file.open(fname.c_str()); + osd_file::error const filerr = file.open(fname); if (filerr != osd_file::error::NONE) return false; @@ -810,7 +810,7 @@ ru_imgformat render_detect_image(emu_file &file, const char *dirname, const char fname.assign(dirname).append(PATH_SEPARATOR).append(filename); else fname.assign(filename); - osd_file::error const filerr = file.open(fname.c_str()); + osd_file::error const filerr = file.open(fname); if (filerr != osd_file::error::NONE) return RENDUTIL_IMGFORMAT_ERROR; diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h index 1824fb0a34a..b5c06d6d0fc 100644 --- a/src/emu/rendutil.h +++ b/src/emu/rendutil.h @@ -15,7 +15,7 @@ #include "render.h" -#include <math.h> +#include <cmath> /* ----- image formats ----- */ diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp index a6610ec6c0c..67ef6cfb6aa 100644 --- a/src/emu/romload.cpp +++ b/src/emu/romload.cpp @@ -144,39 +144,6 @@ const rom_entry *rom_next_parameter(const rom_entry *romp) /*------------------------------------------------- - rom_region_name - return the appropriate name - for a rom region --------------------------------------------------*/ - -std::string rom_region_name(const device_t &device, const rom_entry *romp) -{ - return device.subtag(ROM_GETNAME(romp)); -} - - -/*------------------------------------------------- - rom_parameter_name - return the appropriate name - for a per-game parameter --------------------------------------------------*/ - -std::string rom_parameter_name(const device_t &device, const rom_entry *romp) -{ - return device.subtag(romp->name().c_str()); -} - - -/*------------------------------------------------- - rom_parameter_name - return the value for a - per-game parameter --------------------------------------------------*/ - -std::string rom_parameter_value(const rom_entry *romp) -{ - return romp->hashdata(); -} - - -/*------------------------------------------------- rom_file_size - return the expected size of a file given the ROM description -------------------------------------------------*/ @@ -447,7 +414,7 @@ void rom_load_manager::display_loading_rom_message(const char *name, bool from_l char buffer[200]; if (name != nullptr) - sprintf(buffer, "%s (%d%%)", from_list ? "Loading Software" : "Loading Machine", u32(100 * u64(m_romsloadedsize) / u64(m_romstotalsize))); + sprintf(buffer, "%s (%d%%)", from_list ? "Loading Software" : "Loading Machine", u32(100 * m_romsloadedsize / m_romstotalsize)); else sprintf(buffer, "Loading Complete"); @@ -488,12 +455,8 @@ void rom_load_manager::display_rom_load_results(bool from_list) byte swapping and inverting data as necessary -------------------------------------------------*/ -void rom_load_manager::region_post_process(const char *rgntag, bool invert) +void rom_load_manager::region_post_process(memory_region *region, bool invert) { - memory_region *region = machine().root_device().memregion(rgntag); - u8 *base; - int i, j; - // do nothing if no region if (region == nullptr) return; @@ -505,7 +468,8 @@ void rom_load_manager::region_post_process(const char *rgntag, bool invert) if (invert) { LOG("+ Inverting region\n"); - for (i = 0, base = region->base(); i < region->bytes(); i++) + u8 *base = region->base(); + for (int i = 0; i < region->bytes(); i++) *base++ ^= 0xff; } @@ -514,11 +478,12 @@ void rom_load_manager::region_post_process(const char *rgntag, bool invert) { LOG("+ Byte swapping region\n"); int datawidth = region->bytewidth(); - for (i = 0, base = region->base(); i < region->bytes(); i += datawidth) + u8 *base = region->base(); + for (int i = 0; i < region->bytes(); i += datawidth) { u8 temp[8]; memcpy(temp, base, datawidth); - for (j = datawidth - 1; j >= 0; j--) + for (int j = datawidth - 1; j >= 0; j--) *base++ = temp[j]; } } @@ -1128,7 +1093,7 @@ chd_error rom_load_manager::open_disk_diff(emu_options &options, const rom_entry /* try to open the diff */ LOG("Opening differencing image file: %s\n", fname.c_str()); emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE); - osd_file::error filerr = diff_file.open(fname.c_str()); + osd_file::error filerr = diff_file.open(fname); if (filerr == osd_file::error::NONE) { std::string fullpath(diff_file.fullpath()); @@ -1141,7 +1106,7 @@ chd_error rom_load_manager::open_disk_diff(emu_options &options, const rom_entry /* didn't work; try creating it instead */ LOG("Creating differencing image: %s\n", fname.c_str()); diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - filerr = diff_file.open(fname.c_str()); + filerr = diff_file.open(fname); if (filerr == osd_file::error::NONE) { std::string fullpath(diff_file.fullpath()); @@ -1285,7 +1250,6 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list { std::string locationtag(swlist.list_name()), breakstr("%"); const rom_entry *region; - std::string regiontag; m_errorstring.clear(); m_softwarningstring.clear(); @@ -1318,7 +1282,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list while (swinfo != nullptr) { locationtag.append(swinfo->shortname()).append(breakstr); - swinfo = !swinfo->parentname().empty() ? swlist.find(swinfo->parentname().c_str()) : nullptr; + swinfo = !swinfo->parentname().empty() ? swlist.find(swinfo->parentname()) : nullptr; } // strip the final '%' locationtag.erase(locationtag.length() - 1, 1); @@ -1330,7 +1294,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list { u32 regionlength = ROMREGION_GETLENGTH(region); - regiontag = device.subtag(ROMREGION_GETTAG(region)); + std::string regiontag = device.subtag(ROMREGION_GETTAG(region)); LOG("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength); /* the first entry must be a region */ @@ -1339,7 +1303,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list /* if this is a device region, override with the device width and endianness */ endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE; u8 width = ROMREGION_GETWIDTH(region) / 8; - memory_region *memregion = machine().root_device().memregion(regiontag.c_str()); + memory_region *memregion = machine().root_device().memregion(regiontag); if (memregion != nullptr) { normalize_flags_for_device(regiontag.c_str(), width, endianness); @@ -1382,10 +1346,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list /* now go back and post-process all the regions */ for (region = start_region; region != nullptr; region = rom_next_region(region)) - { - regiontag = device.subtag(ROMREGION_GETTAG(region)); - region_post_process(regiontag.c_str(), ROMREGION_ISINVERTED(region)); - } + region_post_process(device.memregion(ROMREGION_GETTAG(region)), ROMREGION_ISINVERTED(region)); /* display the results and exit */ display_rom_load_results(true); @@ -1398,8 +1359,6 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list void rom_load_manager::process_region_list() { - std::string regiontag; - /* loop until we hit the end */ device_iterator deviter(machine().root_device()); for (device_t &device : deviter) @@ -1407,7 +1366,7 @@ void rom_load_manager::process_region_list() { u32 regionlength = ROMREGION_GETLENGTH(region); - regiontag = rom_region_name(device, region); + std::string regiontag = device.subtag(ROM_GETNAME(region)); LOG("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength); /* the first entry must be a region */ @@ -1448,17 +1407,14 @@ void rom_load_manager::process_region_list() /* now go back and post-process all the regions */ for (device_t &device : deviter) for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region)) - { - regiontag = rom_region_name(device, region); - region_post_process(regiontag.c_str(), ROMREGION_ISINVERTED(region)); - } + region_post_process(device.memregion(ROM_GETNAME(region)), ROMREGION_ISINVERTED(region)); /* and finally register all per-game parameters */ for (device_t &device : deviter) for (const rom_entry *param = rom_first_parameter(device); param != nullptr; param = rom_next_parameter(param)) { - regiontag = rom_parameter_name(device, param); - machine().parameters().add(regiontag, rom_parameter_value(param)); + std::string regiontag = device.subtag(param->name()); + machine().parameters().add(regiontag, param->hashdata()); } } diff --git a/src/emu/romload.h b/src/emu/romload.h index ae78d409932..55ed3c25978 100644 --- a/src/emu/romload.h +++ b/src/emu/romload.h @@ -429,7 +429,7 @@ private: void verify_length_and_hash(const char *name, u32 explength, const util::hash_collection &hashes); void display_loading_rom_message(const char *name, bool from_list); void display_rom_load_results(bool from_list); - void region_post_process(const char *rgntag, bool invert); + void region_post_process(memory_region *region, bool invert); int open_rom_file(const char *regiontag, const rom_entry *romp, std::string &tried_file_names, bool from_list); int rom_fread(u8 *buffer, int length, const rom_entry *parent_region); int read_rom_data(const rom_entry *parent_region, const rom_entry *romp); @@ -451,8 +451,8 @@ private: int m_romsloaded; // current ROMs loaded count int m_romstotal; // total number of ROMs to read - u32 m_romsloadedsize; // total size of ROMs loaded so far - u32 m_romstotalsize; // total size of ROMs to read + u64 m_romsloadedsize; // total size of ROMs loaded so far + u64 m_romstotalsize; // total size of ROMs to read std::unique_ptr<emu_file> m_file; /* current file */ std::vector<std::unique_ptr<open_chd>> m_chd_list; /* disks */ @@ -483,21 +483,12 @@ const rom_entry *rom_next_file(const rom_entry *romp); /* return the expected size of a file given the ROM description */ u32 rom_file_size(const rom_entry *romp); -/* return the appropriate name for a rom region */ -std::string rom_region_name(const device_t &device, const rom_entry *romp); - /* return pointer to the first per-game parameter */ const rom_entry *rom_first_parameter(const device_t &device); /* return pointer to the next per-game parameter */ const rom_entry *rom_next_parameter(const rom_entry *romp); -/* return the appropriate name for a per-game parameter */ -std::string rom_parameter_name(const device_t &device, const rom_entry *romp); - -/* return the value for a per-game parameter */ -std::string rom_parameter_value(const rom_entry *romp); - // builds a rom_entry vector from a tiny_rom_entry array std::vector<rom_entry> rom_build_entries(const tiny_rom_entry *tinyentries); diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp index e177954b248..08befcd4e9e 100644 --- a/src/emu/softlist_dev.cpp +++ b/src/emu/softlist_dev.cpp @@ -15,7 +15,7 @@ #include "softlist_dev.h" #include "validity.h" -#include <ctype.h> +#include <cctype> //************************************************************************** @@ -282,7 +282,7 @@ void software_list_device::parse() m_errors.clear(); // attempt to open the file - osd_file::error filerr = m_file.open(m_list_name.c_str(), ".xml"); + osd_file::error filerr = m_file.open(m_list_name, ".xml"); if (filerr == osd_file::error::NONE) { // parse if no error @@ -489,7 +489,7 @@ void software_list_device::internal_validity_check(validity_checker &valid) } // make sure the parent exists - const software_info *swinfo2 = find(swinfo.parentname().c_str()); + const software_info *swinfo2 = find(swinfo.parentname()); if (swinfo2 == nullptr) osd_printf_error("%s: parent '%s' software for '%s' not found\n", filename(), swinfo.parentname(), shortname); diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 0957d25c4f0..fab04e8f162 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -1784,7 +1784,7 @@ void tilemap_device::device_start() // look for an extension entry std::string tag_ext = std::string(tag()).append("_ext"); - share = memshare(tag_ext.c_str()); + share = memshare(tag_ext); if (share != nullptr) m_extmem.set(*share, m_bytes_per_entry); } diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index a46639d882e..868f7c96935 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -15,7 +15,7 @@ #include "romload.h" #include "video/rgbutil.h" -#include <ctype.h> +#include <cctype> #include <type_traits> #include <typeinfo> @@ -222,7 +222,7 @@ bool validity_checker::check_all_matching(const char *string) bool validated_any = false; while (m_drivlist.next()) { - if (m_drivlist.matches(string, m_drivlist.driver().name)) + if (driver_list::matches(string, m_drivlist.driver().name)) { validate_one(m_drivlist.driver()); validated_any = true; @@ -1418,8 +1418,8 @@ void validity_checker::validate_driver() // determine if we are a clone bool is_clone = (strcmp(m_current_driver->parent, "0") != 0); - int clone_of = m_drivlist.clone(*m_current_driver); - if (clone_of != -1 && (m_drivlist.driver(clone_of).flags & machine_flags::IS_BIOS_ROOT)) + int clone_of = driver_list::clone(*m_current_driver); + if (clone_of != -1 && (driver_list::driver(clone_of).flags & machine_flags::IS_BIOS_ROOT)) is_clone = false; // if we have at least 100 drivers, validate the clone @@ -1428,11 +1428,11 @@ void validity_checker::validate_driver() osd_printf_error("Driver is a clone of nonexistent driver %s\n", m_current_driver->parent); // look for recursive cloning - if (clone_of != -1 && &m_drivlist.driver(clone_of) == m_current_driver) + if (clone_of != -1 && &driver_list::driver(clone_of) == m_current_driver) osd_printf_error("Driver is a clone of itself\n"); // look for clones that are too deep - if (clone_of != -1 && (clone_of = m_drivlist.non_bios_clone(clone_of)) != -1) + if (clone_of != -1 && (clone_of = driver_list::non_bios_clone(clone_of)) != -1) osd_printf_error("Driver is a clone of a clone\n"); // make sure the driver name is not too long @@ -1463,16 +1463,16 @@ void validity_checker::validate_driver() compatible_with = nullptr; // check for this driver being compatible with a nonexistent driver - if (compatible_with != nullptr && m_drivlist.find(m_current_driver->compatible_with) == -1) + if (compatible_with != nullptr && driver_list::find(m_current_driver->compatible_with) == -1) osd_printf_error("Driver is listed as compatible with nonexistent driver %s\n", m_current_driver->compatible_with); // check for clone_of and compatible_with being specified at the same time - if (m_drivlist.clone(*m_current_driver) != -1 && compatible_with != nullptr) + if (driver_list::clone(*m_current_driver) != -1 && compatible_with != nullptr) osd_printf_error("Driver cannot be both a clone and listed as compatible with another system\n"); // find any recursive dependencies on the current driver - for (int other_drv = m_drivlist.compatible_with(*m_current_driver); other_drv != -1; other_drv = m_drivlist.compatible_with(other_drv)) - if (m_current_driver == &m_drivlist.driver(other_drv)) + for (int other_drv = driver_list::compatible_with(*m_current_driver); other_drv != -1; other_drv = driver_list::compatible_with(other_drv)) + if (m_current_driver == &driver_list::driver(other_drv)) { osd_printf_error("Driver is recursively compatible with itself\n"); break; diff --git a/src/emu/video.cpp b/src/emu/video.cpp index fa0efb88a89..65ff20473c5 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -441,7 +441,7 @@ void video_manager::begin_recording_mng(const char *name, uint32_t index, screen full_name = name_buf; } - filerr = info.m_mng_file->open(full_name.c_str()); + filerr = info.m_mng_file->open(full_name); } else { @@ -451,7 +451,7 @@ void video_manager::begin_recording_mng(const char *name, uint32_t index, screen if (filerr == osd_file::error::NONE) { // start the capture - int rate = int(screen->frame_period().as_hz()); + int rate = int(screen ? screen->frame_period().as_hz() : screen_device::DEFAULT_FRAME_RATE); png_error pngerr = mng_capture_start(*info.m_mng_file, m_snap_bitmap, rate); if (pngerr != PNGERR_NONE) { @@ -487,7 +487,7 @@ void video_manager::begin_recording_avi(const char *name, uint32_t index, screen // build up information about this new movie avi_file::movie_info info; info.video_format = 0; - info.video_timescale = 1000 * screen->frame_period().as_hz(); + info.video_timescale = 1000 * (screen ? screen->frame_period().as_hz() : screen_device::DEFAULT_FRAME_RATE); info.video_sampletime = 1000; info.video_numsamples = 0; info.video_width = m_snap_bitmap.width(); @@ -518,7 +518,7 @@ void video_manager::begin_recording_avi(const char *name, uint32_t index, screen full_name = name_buf; } - filerr = tempfile.open(full_name.c_str()); + filerr = tempfile.open(full_name); } else { @@ -554,7 +554,14 @@ void video_manager::begin_recording(const char *name, movie_format format) // create a snapshot bitmap so we know what the target size is screen_device_iterator iterator = screen_device_iterator(machine().root_device()); screen_device_iterator::auto_iterator iter = iterator.begin(); - const uint32_t count = (uint32_t)iterator.count(); + uint32_t count = (uint32_t)iterator.count(); + const bool no_screens(!count); + + if (no_screens) + { + assert(!m_snap_native); + count = 1; + } switch (format) { @@ -1343,7 +1350,7 @@ osd_file::error video_manager::open_next(emu_file &file, const char *extension, if (pos != -1) { // if more %d are found, revert to default and ignore them all - if (snapstr.find(snapdev.c_str(), pos + 3) != -1) + if (snapstr.find(snapdev, pos + 3) != -1) snapstr.assign("%g/%i"); // else if there is a single %d, try to create the correct snapname else @@ -1351,8 +1358,8 @@ osd_file::error video_manager::open_next(emu_file &file, const char *extension, int name_found = 0; // find length of the device name - int end1 = snapstr.find("/", pos + 3); - int end2 = snapstr.find("%", pos + 3); + int end1 = snapstr.find('/', pos + 3); + int end2 = snapstr.find('%', pos + 3); int end; if ((end1 != -1) && (end2 != -1)) @@ -1390,7 +1397,7 @@ osd_file::error video_manager::open_next(emu_file &file, const char *extension, filename = filename.substr(0, filename.find_last_of('.')); // setup snapname and remove the %d_ - strreplace(snapstr, snapdevname.c_str(), filename.c_str()); + strreplace(snapstr, snapdevname, filename); snapstr.erase(pos, 3); //printf("check image: %s\n", filename.c_str()); @@ -1426,10 +1433,10 @@ osd_file::error video_manager::open_next(emu_file &file, const char *extension, { // build up the filename fname.assign(snapstr); - strreplace(fname, "%i", string_format("%04d", seq).c_str()); + strreplace(fname, "%i", string_format("%04d", seq)); // try to open the file; stop when we fail - osd_file::error filerr = file.open(fname.c_str()); + osd_file::error filerr = file.open(fname); if (filerr == osd_file::error::NOT_FOUND) { break; @@ -1439,7 +1446,7 @@ osd_file::error video_manager::open_next(emu_file &file, const char *extension, // create the final file file.set_openflags(origflags); - return file.open(fname.c_str()); + return file.open(fname); } diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 7b8084dfb98..2e02b4ab0e0 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -80,6 +80,7 @@ const double XTAL::known_xtals[] = { 2'097'152, /* 2.097152_MHz_XTAL Icatel 1995 - Brazilian public payphone */ 2'457'600, /* 2.4576_MHz_XTAL Atari ST MFP */ 2'500'000, /* 2.5_MHz_XTAL Janken Man units */ + 2'600'000, /* 2.6_MHz_XTAL Sharp PC-1500 */ 2'950'000, /* 2.95_MHz_XTAL Playmatic MPU-C, MPU-III & Sound-3 */ 3'000'000, /* 3_MHz_XTAL Probably only used to drive 68705 or similar MCUs on 80's Taito PCBs */ 3'072'000, /* 3.072_MHz_XTAL INS 8520 input clock rate */ @@ -88,6 +89,7 @@ const double XTAL::known_xtals[] = { 3'521'280, /* 3.52128_MHz_XTAL RCA COSMAC VIP */ 3'570'000, /* 3.57_MHz_XTAL Telmac TMC-600 */ 3'578'640, /* 3.57864_MHz_XTAL Atari Portfolio PCD3311T */ + 3'579'000, /* 3.579_MHz_XTAL BeebOPL */ 3'579'545, /* 3.579545_MHz_XTAL NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */ 3'686'400, /* 3.6864_MHz_XTAL Baud rate clock for MC68681 and similar UARTs */ 3'840'000, /* 3.84_MHz_XTAL Fairlight CMI Alphanumeric Keyboard */ @@ -139,6 +141,7 @@ const double XTAL::known_xtals[] = { 8'867'236, /* 8.867236_MHz_XTAL RCA CDP1869 PAL color clock (~2x PAL subcarrier) */ 8'867'238, /* 8.867238_MHz_XTAL ETI-660 (~2x PAL subcarrier) */ 8'945'000, /* 8.945_MHz_XTAL Hit Me */ + 9'000'000, /* 9_MHz_XTAL Homedata PCBs */ 9'216'000, /* 9.216_MHz_XTAL Univac UTS 20 */ 9'600'000, /* 9.6_MHz_XTAL WD37C65 second clock (for 300 KB/sec rate) */ 9'828'000, /* 9.828_MHz_XTAL Universal PCBs */ @@ -227,6 +230,7 @@ const double XTAL::known_xtals[] = { 15'700'000, /* 15.7_MHz_XTAL Motogonki */ 15'897'600, /* 15.8976_MHz_XTAL IAI Swyft */ 15'920'000, /* 15.92_MHz_XTAL HP Integral PC */ + 15'930'000, /* 15.93_MHz_XTAL ADM 12 */ 15'974'400, /* 15.9744_MHz_XTAL Osborne 1 (9600 * 52 * 32) */ 16'000'000, /* 16_MHz_XTAL Extremely common, used on 100's of PCBs */ 16'097'280, /* 16.09728_MHz_XTAL DEC VT240 (1024 * 262 * 60) */ @@ -284,6 +288,7 @@ const double XTAL::known_xtals[] = { 21'281'370, /* 21.28137_MHz_XTAL Radica Tetris (PAL) */ 21'300'000, /* 21.3_MHz_XTAL - */ 21'477'272, /* 21.477272_MHz_XTAL BMC bowling, some Data East 90's games, Vtech Socrates; (6x NTSC subcarrier) */ + 21'667'500, /* 21.6675_MHz_XTAL AT&T 610 (80-column display clock) */ 22'000'000, /* 22_MHz_XTAL - */ 22'032'000, /* 22.032_MHz_XTAL Intellec Series II I/O controller */ 22'096'000, /* 22.096_MHz_XTAL ADDS Viewpoint 122 */ @@ -323,6 +328,7 @@ const double XTAL::known_xtals[] = { 27'164'000, /* 27.164_MHz_XTAL Typically used on 90's Taito PCBs to drive the custom chips */ 27'210'900, /* 27.2109_MHz_XTAL LA Girl */ 27'562'000, /* 27.562_MHz_XTAL Visual 220 */ + 27'720'000, /* 27.72_MHz_XTAL AT&T 610 (132-column display clock) */ 28'000'000, /* 28_MHz_XTAL - */ 28'322'000, /* 28.322_MHz_XTAL Saitek RISC 2500, Mephisto Montreux */ 28'375'160, /* 28.37516_MHz_XTAL Amiga PAL systems */ @@ -408,6 +414,7 @@ const double XTAL::known_xtals[] = { 61'440'000, /* 61.44_MHz_XTAL Donkey Kong */ 64'000'000, /* 64_MHz_XTAL BattleToads */ 64'108'800, /* 64.1088_MHz_XTAL HP Topcat high-res */ + 66'000'000, /* 66_MHz_XTAL - */ 66'666'700, /* 66.6667_MHz_XTAL Later Midway games */ 67'737'600, /* 67.7376_MHz_XTAL PSX-based h/w, Sony ZN1-2-based */ 68'850'000, /* 68.85_MHz_XTAL Wyse WY-50 */ @@ -497,7 +504,7 @@ void XTAL::validate(const std::string &message) const fail(m_base_clock, message); } -void XTAL::fail(double base_clock, std::string message) +void XTAL::fail(double base_clock, const std::string &message) { std::string full_message = util::string_format("Unknown crystal value %.0f. ", base_clock); if(xtal_error_low && xtal_error_high) diff --git a/src/emu/xtal.h b/src/emu/xtal.h index f3e9b7d0cbd..b58f00943b2 100644 --- a/src/emu/xtal.h +++ b/src/emu/xtal.h @@ -69,7 +69,7 @@ private: static const double known_xtals[]; static double last_correct_value, xtal_error_low, xtal_error_high; - static void fail(double base_clock, std::string message); + static void fail(double base_clock, const std::string &message); static bool validate(double base_clock); static void check_ordering(); }; diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp index a33dd4bb52a..dbba78e20ec 100644 --- a/src/frontend/mame/audit.cpp +++ b/src/frontend/mame/audit.cpp @@ -220,14 +220,14 @@ media_auditor::summary media_auditor::audit_samples() // look for the files emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD); - path_iterator path(searchpath.c_str()); + path_iterator path(searchpath); std::string curpath; while (path.next(curpath, samplename)) { // attempt to access the file (.flac) or (.wav) - osd_file::error filerr = file.open(curpath.c_str(), ".flac"); + osd_file::error filerr = file.open(curpath, ".flac"); if (filerr != osd_file::error::NONE) - filerr = file.open(curpath.c_str(), ".wav"); + filerr = file.open(curpath, ".wav"); if (filerr == osd_file::error::NONE) { @@ -397,9 +397,9 @@ media_auditor::audit_record &media_auditor::audit_one_rom(const rom_entry *rom) // open the file if we can osd_file::error filerr; if (has_crc) - filerr = file.open(curpath.c_str(), crc); + filerr = file.open(curpath, crc); else - filerr = file.open(curpath.c_str()); + filerr = file.open(curpath); // if it worked, get the actual length and hashes, then stop if (filerr == osd_file::error::NONE) diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp index 0f8095cefbd..38676366a61 100644 --- a/src/frontend/mame/cheat.cpp +++ b/src/frontend/mame/cheat.cpp @@ -87,7 +87,7 @@ #include <iterator> #include <utility> -#include <ctype.h> +#include <cctype> diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 3316240ea9b..3a881c1f667 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -36,7 +36,7 @@ #include <algorithm> #include <new> -#include <ctype.h> +#include <cctype> //************************************************************************** @@ -1083,36 +1083,36 @@ const char cli_frontend::s_softlist_xml_dtd[] = "\t\t\t\t\t\t<!ATTLIST dipvalue default (yes|no) \"no\">\n" \ "]>\n\n"; -void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlistdev) +void cli_frontend::output_single_softlist(std::ostream &out, software_list_device &swlistdev) { - fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name().c_str(), util::xml::normalize_string(swlistdev.description().c_str())); + util::stream_format(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name(), util::xml::normalize_string(swlistdev.description().c_str())); for (const software_info &swinfo : swlistdev.get_info()) { - fprintf(out, "\t\t<software name=\"%s\"", swinfo.shortname().c_str()); + util::stream_format(out, "\t\t<software name=\"%s\"", util::xml::normalize_string(swinfo.shortname().c_str())); if (!swinfo.parentname().empty()) - fprintf(out, " cloneof=\"%s\"", swinfo.parentname().c_str()); + util::stream_format(out, " cloneof=\"%s\"", util::xml::normalize_string(swinfo.parentname().c_str())); if (swinfo.supported() == SOFTWARE_SUPPORTED_PARTIAL) - fprintf(out, " supported=\"partial\""); + out << " supported=\"partial\""; if (swinfo.supported() == SOFTWARE_SUPPORTED_NO) - fprintf(out, " supported=\"no\""); - fprintf(out, ">\n" ); - fprintf(out, "\t\t\t<description>%s</description>\n", util::xml::normalize_string(swinfo.longname().c_str())); - fprintf(out, "\t\t\t<year>%s</year>\n", util::xml::normalize_string(swinfo.year().c_str())); - fprintf(out, "\t\t\t<publisher>%s</publisher>\n", util::xml::normalize_string(swinfo.publisher().c_str())); + out << " supported=\"no\""; + out << ">\n"; + util::stream_format(out, "\t\t\t<description>%s</description>\n", util::xml::normalize_string(swinfo.longname().c_str())); + util::stream_format(out, "\t\t\t<year>%s</year>\n", util::xml::normalize_string(swinfo.year().c_str())); + util::stream_format(out, "\t\t\t<publisher>%s</publisher>\n", util::xml::normalize_string(swinfo.publisher().c_str())); for (const feature_list_item &flist : swinfo.other_info()) - fprintf( out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name().c_str(), util::xml::normalize_string( flist.value().c_str()) ); + util::stream_format(out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name().c_str(), util::xml::normalize_string(flist.value().c_str())); for (const software_part &part : swinfo.parts()) { - fprintf(out, "\t\t\t<part name=\"%s\"", part.name().c_str()); + util::stream_format(out, "\t\t\t<part name=\"%s\"", util::xml::normalize_string(part.name().c_str())); if (!part.interface().empty()) - fprintf(out, " interface=\"%s\"", part.interface().c_str()); + util::stream_format(out, " interface=\"%s\"", util::xml::normalize_string(part.interface().c_str())); - fprintf(out, ">\n"); + out << ">\n"; for (const feature_list_item &flist : part.featurelist()) - fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name().c_str(), util::xml::normalize_string(flist.value().c_str())); + util::stream_format(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name().c_str(), util::xml::normalize_string(flist.value().c_str())); // TODO: display ROM region information for (const rom_entry *region = part.romdata().data(); region; region = rom_next_region(region)) @@ -1120,84 +1120,86 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis int is_disk = ROMREGION_ISDISKDATA(region); if (!is_disk) - fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%d\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) ); + util::stream_format(out, "\t\t\t\t<dataarea name=\"%s\" size=\"%d\">\n", util::xml::normalize_string(ROMREGION_GETTAG(region)), ROMREGION_GETLENGTH(region)); else - fprintf( out, "\t\t\t\t<diskarea name=\"%s\">\n", ROMREGION_GETTAG(region) ); + util::stream_format(out, "\t\t\t\t<diskarea name=\"%s\">\n", util::xml::normalize_string(ROMREGION_GETTAG(region))); - for ( const rom_entry *rom = rom_first_file( region ); rom && !ROMENTRY_ISREGIONEND(rom); rom++ ) + for (const rom_entry *rom = rom_first_file(region); rom && !ROMENTRY_ISREGIONEND(rom); rom++) { - if ( ROMENTRY_ISFILE(rom) ) + if (ROMENTRY_ISFILE(rom)) { if (!is_disk) - fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", util::xml::normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) ); + util::stream_format(out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", util::xml::normalize_string(ROM_GETNAME(rom)), rom_file_size(rom)); else - fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", util::xml::normalize_string(ROM_GETNAME(rom)) ); + util::stream_format(out, "\t\t\t\t\t<disk name=\"%s\"", util::xml::normalize_string(ROM_GETNAME(rom))); - /* dump checksum information only if there is a known dump */ + // dump checksum information only if there is a known dump util::hash_collection hashes(ROM_GETHASHDATA(rom)); - if ( !hashes.flag(util::hash_collection::FLAG_NO_DUMP) ) - fprintf( out, " %s", hashes.attribute_string().c_str() ); + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP)) + util::stream_format(out, " %s", hashes.attribute_string()); else - fprintf( out, " status=\"nodump\"" ); + out << " status=\"nodump\""; if (is_disk) - fprintf( out, " writeable=\"%s\"", (ROM_GETFLAGS(rom) & DISK_READONLYMASK) ? "no" : "yes"); + util::stream_format(out, " writeable=\"%s\"", (ROM_GETFLAGS(rom) & DISK_READONLYMASK) ? "no" : "yes"); if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(1)) - fprintf( out, " loadflag=\"load16_byte\"" ); + out << " loadflag=\"load16_byte\""; if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(3)) - fprintf( out, " loadflag=\"load32_byte\"" ); + out << " loadflag=\"load32_byte\""; if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(2)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) { if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) - fprintf( out, " loadflag=\"load32_word\"" ); + out << " loadflag=\"load32_word\""; else - fprintf( out, " loadflag=\"load32_word_swap\"" ); + out << " loadflag=\"load32_word_swap\""; } if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(6)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) { if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) - fprintf( out, " loadflag=\"load64_word\"" ); + out << " loadflag=\"load64_word\""; else - fprintf( out, " loadflag=\"load64_word_swap\"" ); + out << " loadflag=\"load64_word_swap\""; } if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_NOSKIP) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) { if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) - fprintf( out, " loadflag=\"load32_dword\"" ); + out << " loadflag=\"load32_dword\""; else - fprintf( out, " loadflag=\"load16_word_swap\"" ); + out << " loadflag=\"load16_word_swap\""; } - fprintf( out, "/>\n" ); + out << "/>\n"; } - else if ( ROMENTRY_ISRELOAD(rom) ) + else if (ROMENTRY_ISRELOAD(rom)) { - fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); + util::stream_format(out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom)); } - else if ( ROMENTRY_ISFILL(rom) ) + else if (ROMENTRY_ISFILL(rom)) { - fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"fill\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); + util::stream_format(out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"fill\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom)); } } if (!is_disk) - fprintf( out, "\t\t\t\t</dataarea>\n" ); + out << "\t\t\t\t</dataarea>\n"; else - fprintf( out, "\t\t\t\t</diskarea>\n" ); + out << "\t\t\t\t</diskarea>\n"; } - fprintf( out, "\t\t\t</part>\n" ); + out << "\t\t\t</part>\n"; } - fprintf( out, "\t\t</software>\n" ); + out << "\t\t</software>\n"; } - fprintf(out, "\t</softwarelist>\n" ); + out << "\t</softwarelist>\n"; } + + /*------------------------------------------------- info_listsoftware - output the list of software supported by a given game or set of @@ -1207,38 +1209,35 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis void cli_frontend::listsoftware(const std::vector<std::string> &args) { - const char *gamename = args.empty() ? nullptr : args[0].c_str(); - - FILE *out = stdout; std::unordered_set<std::string> list_map; - bool isfirst = true; - - // determine which drivers to output; return an error if none found - driver_enumerator drivlist(m_options, gamename); - if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename); - - while (drivlist.next()) - { - for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config()->root_device())) - if (list_map.insert(swlistdev.list_name()).second) - if (!swlistdev.get_info().empty()) + bool firstlist(true); + apply_device_action( + args, + [this, &list_map, &firstlist] (device_t &root, char const *type, bool first) + { + for (software_list_device &swlistdev : software_list_device_iterator(root)) { - if (isfirst) + if (list_map.insert(swlistdev.list_name()).second) { - if (m_options.bool_value(CLIOPTION_DTD)) - fprintf(out, s_softlist_xml_dtd); - fprintf(out, "<softwarelists>\n"); - isfirst = false; + if (!swlistdev.get_info().empty()) + { + if (firstlist) + { + if (m_options.bool_value(CLIOPTION_DTD)) + std::cout << s_softlist_xml_dtd; + std::cout << "<softwarelists>\n"; + firstlist = false; + } + output_single_softlist(std::cout, swlistdev); + } } - output_single_softlist(out, swlistdev); } - } + }); - if (!isfirst) - fprintf( out, "</softwarelists>\n" ); + if (!firstlist) + std::cout << "</softwarelists>\n"; else - fprintf( out, "No software lists found for this system\n" ); + fprintf(stdout, "No software lists found for this system\n"); // TODO: should this go to stderr instead? } @@ -1325,32 +1324,35 @@ void cli_frontend::getsoftlist(const std::vector<std::string> &args) { const char *gamename = args.empty() ? "*" : args[0].c_str(); - FILE *out = stdout; std::unordered_set<std::string> list_map; - bool isfirst = true; - - driver_enumerator drivlist(m_options); - while (drivlist.next()) - { - for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config()->root_device())) - if (core_strwildcmp(gamename, swlistdev.list_name().c_str()) == 0 && list_map.insert(swlistdev.list_name()).second) - if (!swlistdev.get_info().empty()) + bool firstlist(true); + apply_device_action( + std::vector<std::string>(), + [this, gamename, &list_map, &firstlist] (device_t &root, char const *type, bool first) + { + for (software_list_device &swlistdev : software_list_device_iterator(root)) { - if (isfirst) + if (core_strwildcmp(gamename, swlistdev.list_name().c_str()) == 0 && list_map.insert(swlistdev.list_name()).second) { - if (m_options.bool_value(CLIOPTION_DTD)) - fprintf(out, s_softlist_xml_dtd); - fprintf(out, "<softwarelists>\n"); - isfirst = false; + if (!swlistdev.get_info().empty()) + { + if (firstlist) + { + if (m_options.bool_value(CLIOPTION_DTD)) + std::cout << s_softlist_xml_dtd; + std::cout << "<softwarelists>\n"; + firstlist = false; + } + output_single_softlist(std::cout, swlistdev); + } } - output_single_softlist(out, swlistdev); } - } + }); - if (!isfirst) - fprintf( out, "</softwarelists>\n" ); + if (!firstlist) + std::cout << "</softwarelists>\n"; else - fprintf( out, "No such software lists found\n" ); + fprintf(stdout, "No such software lists found\n"); // TODO: should this go to stderr instead? } diff --git a/src/frontend/mame/clifront.h b/src/frontend/mame/clifront.h index 84157f2a6d8..8a2ae059b6c 100644 --- a/src/frontend/mame/clifront.h +++ b/src/frontend/mame/clifront.h @@ -72,7 +72,7 @@ private: template <typename T> void apply_device_action(const std::vector<std::string> &args, T &&action); void execute_commands(const char *exename); void display_help(const char *exename); - void output_single_softlist(FILE *out, software_list_device &swlist); + void output_single_softlist(std::ostream &out, software_list_device &swlist); void start_execution(mame_machine_manager *manager, const std::vector<std::string> &args); static const info_command_struct *find_command(const std::string &s); diff --git a/src/frontend/mame/infoxml.cpp b/src/frontend/mame/infoxml.cpp index 0dc3aa5e4f6..926feffbc08 100644 --- a/src/frontend/mame/infoxml.cpp +++ b/src/frontend/mame/infoxml.cpp @@ -25,7 +25,7 @@ #include "xmlfile.h" -#include <ctype.h> +#include <cctype> #include <cstring> #include <unordered_set> #include <queue> @@ -239,8 +239,8 @@ static const char s_dtd_string[] = "\t\t\t\t<!ATTLIST slotoption devname CDATA #REQUIRED>\n" "\t\t\t\t<!ATTLIST slotoption default (yes|no) \"no\">\n" "\t\t<!ELEMENT softwarelist EMPTY>\n" -"\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n" "\t\t\t<!ATTLIST softwarelist tag CDATA #REQUIRED>\n" +"\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n" "\t\t\t<!ATTLIST softwarelist status (original|compatible) #REQUIRED>\n" "\t\t\t<!ATTLIST softwarelist filter CDATA #IMPLIED>\n" "\t\t<!ELEMENT ramoption (#PCDATA)>\n" @@ -1950,8 +1950,8 @@ void output_software_lists(std::ostream &out, device_t &root, const char *root_t std::string newtag(swlist.tag()), oldtag(":"); newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); - out << util::string_format("\t\t<softwarelist tag=\"%s\" name=\"%s\" status=\"%s\"", normalize_string(newtag.c_str()), normalize_string(swlist.list_name().c_str()), swlist.is_original() ? "original" : "compatible"); + if (swlist.filter()) out << util::string_format(" filter=\"%s\"", normalize_string(swlist.filter())); out << "/>\n"; diff --git a/src/frontend/mame/language.cpp b/src/frontend/mame/language.cpp index a5f2e9ce3a9..2740aed973f 100644 --- a/src/frontend/mame/language.cpp +++ b/src/frontend/mame/language.cpp @@ -68,7 +68,7 @@ void load_translation(emu_options &m_options) strreplace(name, "(", ""); strreplace(name, ")", ""); emu_file file(m_options.language_path(), OPEN_FLAG_READ); - if (file.open(name.c_str(), PATH_SEPARATOR "strings.mo") != osd_file::error::NONE) + if (file.open(name, PATH_SEPARATOR "strings.mo") != osd_file::error::NONE) { osd_printf_error("Error opening translation file %s\n", name); return; diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 2e1273bfcc1..411004676a9 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1227,13 +1227,13 @@ void lua_engine::initialize() if(e.type() != OPTION_FLOAT) luaL_error(m_lua_state, "Cannot set option to wrong type"); else - e.set_value(string_format("%f", val).c_str(), OPTION_PRIORITY_CMDLINE); + e.set_value(string_format("%f", val), OPTION_PRIORITY_CMDLINE); }, [this](core_options::entry &e, int val) { if(e.type() != OPTION_INTEGER) luaL_error(m_lua_state, "Cannot set option to wrong type"); else - e.set_value(string_format("%d", val).c_str(), OPTION_PRIORITY_CMDLINE); + e.set_value(string_format("%d", val), OPTION_PRIORITY_CMDLINE); }, [this](core_options::entry &e, const char *val) { if(e.type() != OPTION_STRING) @@ -1647,9 +1647,9 @@ void lua_engine::initialize() if(!item) break; name = &(strchr(item, '/')[1]); - if(name.substr(0, name.find("/")) == tag) + if(name.substr(0, name.find('/')) == tag) { - name = name.substr(name.find("/") + 1, std::string::npos); + name = name.substr(name.find('/') + 1, std::string::npos); table[name] = i; } } @@ -1669,12 +1669,17 @@ void lua_engine::initialize() * space:write_log_*(addr, val) * space:read_direct_*(addr) * space:write_direct_*(addr, val) + * space:read_range(first_addr, last_addr, width, [opt] step) - read range of addresses and + * return as a binary string * * space.name - address space name * space.shift - address bus shift, bitshift required for a bytewise address - * to map onto this space's addess resolution (addressing granularity). + * to map onto this space's address resolution (addressing granularity). * positive value means leftshift, negative means rightshift. * space.index + * space.address_mask + * space.data_width + * space.endianness * * space.map[] - table of address map entries (k=index, v=address_map_entry) */ @@ -1728,9 +1733,82 @@ void lua_engine::initialize() addr_space_type.set("write_direct_u32", &addr_space::direct_mem_write<uint32_t>); addr_space_type.set("write_direct_i64", &addr_space::direct_mem_write<int64_t>); addr_space_type.set("write_direct_u64", &addr_space::direct_mem_write<uint64_t>); + addr_space_type.set("read_range", [](addr_space &sp, sol::this_state s, u64 first, u64 last, int width, sol::object opt_step) { + lua_State *L = s; + luaL_Buffer buff; + offs_t space_size = sp.space.addrmask(); + u64 step = 1; + if (opt_step.is<u64>()) + { + step = opt_step.as<u64>(); + if (step < 1 || step > last - first) + { + luaL_error(L, "Invalid step"); + return sol::make_reference(L, nullptr); + } + } + if (first > space_size || last > space_size || last < first) + { + luaL_error(L, "Invalid offset"); + return sol::make_reference(L, nullptr); + } + int byte_count = width / 8 * (last - first + 1) / step; + switch (width) + { + case 8: + { + u8 *dest = (u8 *)luaL_buffinitsize(L, &buff, byte_count); + for(; first <= last; first += step) + *dest++ = sp.mem_read<u8>(first); + break; + } + case 16: + { + u16 *dest = (u16 *)luaL_buffinitsize(L, &buff, byte_count); + for(; first <= last; first += step) + *dest++ = sp.mem_read<u16>(first); + break; + } + case 32: + { + u32 *dest = (u32 *)luaL_buffinitsize(L, &buff, byte_count); + for(; first <= last; first += step) + *dest++ = sp.mem_read<u32>(first); + break; + } + case 64: + { + u64 *dest = (u64 *)luaL_buffinitsize(L, &buff, byte_count); + for(; first <= last; first += step) + *dest++ = sp.mem_read<u64>(first); + break; + } + default: + luaL_error(L, "Invalid width. Must be 8/16/32/64"); + return sol::make_reference(L, nullptr); + } + luaL_pushresultsize(&buff, byte_count); + return sol::make_reference(L, sol::stack_reference(L, -1)); + }); addr_space_type.set("name", sol::property([](addr_space &sp) { return sp.space.name(); })); addr_space_type.set("shift", sol::property([](addr_space &sp) { return sp.space.addr_shift(); })); addr_space_type.set("index", sol::property([](addr_space &sp) { return sp.space.spacenum(); })); + addr_space_type.set("address_mask", sol::property([](addr_space &sp) { return sp.space.addrmask(); })); + addr_space_type.set("data_width", sol::property([](addr_space &sp) { return sp.space.data_width(); })); + addr_space_type.set("endianness", sol::property([](addr_space &sp) { + std::string endianness; + switch (sp.space.endianness()) + { + case endianness_t::ENDIANNESS_BIG: + endianness = "big"; + break; + case endianness_t::ENDIANNESS_LITTLE: + endianness = "little"; + break; + } + return endianness; + })); + /* address_map_entry library * @@ -2595,9 +2673,9 @@ void lua_engine::initialize() * * manager:machine():memory() * - * memory.banks[] - table of memory banks - * memory.regions[] - table of memory regions - * memory.shares[] - table of memory shares + * memory.banks[] - table of memory banks (k=tag, v=memory_bank) + * memory.regions[] - table of memory regions (k=tag, v=memory_region) + * memory.shares[] - table of memory shares (k=tag, v=memory_share) */ auto memory_type = sol().registry().create_simple_usertype<memory_manager>("new", sol::no_constructor); diff --git a/src/frontend/mame/mame.cpp b/src/frontend/mame/mame.cpp index e0d45e504c1..88ccc4e1b80 100644 --- a/src/frontend/mame/mame.cpp +++ b/src/frontend/mame/mame.cpp @@ -17,7 +17,7 @@ #include "validity.h" #include "clifront.h" #include "luaengine.h" -#include <time.h> +#include <ctime> #include "ui/ui.h" #include "ui/selgame.h" #include "ui/simpleselgame.h" diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp index 1ab0b81874f..48df66a337e 100644 --- a/src/frontend/mame/mameopts.cpp +++ b/src/frontend/mame/mameopts.cpp @@ -18,7 +18,7 @@ #include "hashfile.h" #include "clifront.h" -#include <ctype.h> +#include <cctype> #include <stack> diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp index 48fd67a2a67..dfd206706b8 100644 --- a/src/frontend/mame/ui/custui.cpp +++ b/src/frontend/mame/ui/custui.cpp @@ -76,7 +76,7 @@ menu_custom_ui::~menu_custom_ui() ui().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE); if (!m_lang.empty()) { - machine().options().set_value(OPTION_LANGUAGE, m_lang[m_currlang].c_str(), OPTION_PRIORITY_CMDLINE); + machine().options().set_value(OPTION_LANGUAGE, m_lang[m_currlang], OPTION_PRIORITY_CMDLINE); load_translation(machine().options()); } ui_globals::reset = true; @@ -172,7 +172,7 @@ void menu_custom_ui::populate(float &customtop, float &custombottom) if (!m_lang.empty()) { arrow_flags = get_arrow_flags<std::uint16_t>(0, m_lang.size() - 1, m_currlang); - item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(uintptr_t)LANGUAGE_MENU); + item_append(_("Language"), m_lang[m_currlang], arrow_flags, (void *)(uintptr_t)LANGUAGE_MENU); } arrow_flags = get_arrow_flags<uint16_t>(0, HIDE_BOTH, ui_globals::panels_status); @@ -445,7 +445,7 @@ menu_colors_ui::~menu_colors_ui() for (int index = 1; index < MUI_RESTORE; index++) { dec_color = string_format("%x", (uint32_t)m_color_table[index].color); - ui().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE); + ui().options().set_value(m_color_table[index].option, dec_color, OPTION_PRIORITY_CMDLINE); } // refresh our cached colors diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp index 1d8166718f0..50afe928561 100644 --- a/src/frontend/mame/ui/dirmenu.cpp +++ b/src/frontend/mame/ui/dirmenu.cpp @@ -170,7 +170,7 @@ void menu_display_actual::populate(float &customtop, float &custombottom) else m_searchpath.assign(machine().options().value(s_folders[m_ref].option)); - path_iterator path(m_searchpath.c_str()); + path_iterator path(m_searchpath); std::string curpath; m_folders.clear(); while (path.next(curpath, nullptr)) @@ -226,7 +226,7 @@ menu_add_change_folder::menu_add_change_folder(mame_ui_manager &mui, render_cont else searchpath = mui.machine().options().value(s_folders[m_ref].option); - path_iterator path(searchpath.c_str()); + path_iterator path(searchpath); std::string curpath; while (path.next(curpath, nullptr)) m_folders.push_back(curpath); @@ -289,10 +289,10 @@ void menu_add_change_folder::handle() if (m_change) { if (ui().options().exists(s_folders[m_ref].option)) - ui().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE); + ui().options().set_value(s_folders[m_ref].option, m_current_path, OPTION_PRIORITY_CMDLINE); else if (strcmp(machine().options().value(s_folders[m_ref].option), m_current_path.c_str()) != 0) { - machine().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE); + machine().options().set_value(s_folders[m_ref].option, m_current_path, OPTION_PRIORITY_CMDLINE); } } else @@ -307,10 +307,10 @@ void menu_add_change_folder::handle() } if (ui().options().exists(s_folders[m_ref].option)) - ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE); + ui().options().set_value(s_folders[m_ref].option, tmppath, OPTION_PRIORITY_CMDLINE); else if (strcmp(machine().options().value(s_folders[m_ref].option), tmppath.c_str()) != 0) { - machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE); + machine().options().set_value(s_folders[m_ref].option, tmppath, OPTION_PRIORITY_CMDLINE); } } @@ -449,7 +449,7 @@ menu_remove_folder::menu_remove_folder(mame_ui_manager &mui, render_container &c else m_searchpath.assign(mui.machine().options().value(s_folders[m_ref].option)); - path_iterator path(m_searchpath.c_str()); + path_iterator path(m_searchpath); std::string curpath; while (path.next(curpath, nullptr)) m_folders.push_back(curpath); @@ -479,10 +479,10 @@ void menu_remove_folder::handle() } if (ui().options().exists(s_folders[m_ref].option)) - ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE); + ui().options().set_value(s_folders[m_ref].option, tmppath, OPTION_PRIORITY_CMDLINE); else if (strcmp(machine().options().value(s_folders[m_ref].option),tmppath.c_str())!=0) { - machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE); + machine().options().set_value(s_folders[m_ref].option, tmppath, OPTION_PRIORITY_CMDLINE); } reset_parent(reset_options::REMEMBER_REF); diff --git a/src/frontend/mame/ui/filecreate.cpp b/src/frontend/mame/ui/filecreate.cpp index 9928829ecf5..157b19bec9a 100644 --- a/src/frontend/mame/ui/filecreate.cpp +++ b/src/frontend/mame/ui/filecreate.cpp @@ -205,7 +205,7 @@ void menu_file_create::handle() if ((event->itemref == ITEMREF_CREATE) || (event->itemref == ITEMREF_NEW_IMAGE_NAME)) { std::string tmp_file(m_filename); - if (tmp_file.find(".") != -1 && tmp_file.find(".") < tmp_file.length() - 1) + if (tmp_file.find('.') != -1 && tmp_file.find('.') < tmp_file.length() - 1) { m_current_file = m_filename; stack_pop(); diff --git a/src/frontend/mame/ui/imgcntrl.cpp b/src/frontend/mame/ui/imgcntrl.cpp index 3312e5d54e7..8d3ef0974c1 100644 --- a/src/frontend/mame/ui/imgcntrl.cpp +++ b/src/frontend/mame/ui/imgcntrl.cpp @@ -95,7 +95,7 @@ void menu_control_device_image::test_create(bool &can_create, bool &need_confirm auto path = util::zippath_combine(m_current_directory, m_current_file); // does a file or a directory exist at the path - auto entry = osd_stat(path.c_str()); + auto entry = osd_stat(path); auto file_type = (entry != nullptr) ? entry->type : osd::directory::entry::entry_type::NONE; switch(file_type) @@ -211,7 +211,7 @@ void menu_control_device_image::handle() break; case SELECT_PARTLIST: - m_swi = m_sld->find(m_software_info_name.c_str()); + m_swi = m_sld->find(m_software_info_name); if (!m_swi) m_state = START_SOFTLIST; else if (m_swi->has_multiple_parts(m_image.image_interface())) diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index 4278e0efad9..55147b020ec 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -609,11 +609,11 @@ void menu_export::handle() { std::string filename("exported"); emu_file infile(ui().options().ui_path(), OPEN_FLAG_READ); - if (infile.open(filename.c_str(), ".xml") == osd_file::error::NONE) + if (infile.open(filename, ".xml") == osd_file::error::NONE) for (int seq = 0; ; ++seq) { std::string seqtext = string_format("%s_%04d", filename, seq); - if (infile.open(seqtext.c_str(), ".xml") != osd_file::error::NONE) + if (infile.open(seqtext, ".xml") != osd_file::error::NONE) { filename = seqtext; break; @@ -622,7 +622,7 @@ void menu_export::handle() // attempt to open the output file emu_file file(ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - if (file.open(filename.c_str(), ".xml") == osd_file::error::NONE) + if (file.open(filename, ".xml") == osd_file::error::NONE) { std::string fullpath(file.fullpath()); file.close(); @@ -654,11 +654,11 @@ void menu_export::handle() { std::string filename("exported"); emu_file infile(ui().options().ui_path(), OPEN_FLAG_READ); - if (infile.open(filename.c_str(), ".txt") == osd_file::error::NONE) + if (infile.open(filename, ".txt") == osd_file::error::NONE) for (int seq = 0; ; ++seq) { std::string seqtext = string_format("%s_%04d", filename, seq); - if (infile.open(seqtext.c_str(), ".txt") != osd_file::error::NONE) + if (infile.open(seqtext, ".txt") != osd_file::error::NONE) { filename = seqtext; break; @@ -667,7 +667,7 @@ void menu_export::handle() // attempt to open the output file emu_file file(ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - if (file.open(filename.c_str(), ".txt") == osd_file::error::NONE) + if (file.open(filename, ".txt") == osd_file::error::NONE) { // print the header std::ostringstream buffer; @@ -764,7 +764,7 @@ void menu_machine_configure::handle() { std::string filename(m_drv.name); emu_file file(machine().options().ini_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE); - osd_file::error filerr = file.open(filename.c_str(), ".ini"); + osd_file::error filerr = file.open(filename, ".ini"); if (filerr == osd_file::error::NONE) { std::string inistring = m_opts.output_ini(); diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index b7e621997ad..00113d8aeda 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -251,7 +251,7 @@ menu_select_game::menu_select_game(mame_ui_manager &mui, render_container &conta ui_globals::rpanel = std::min<int>(std::max<int>(moptions.last_right_panel(), RP_FIRST), RP_LAST); std::string tmp(moptions.last_used_filter()); - std::size_t const found = tmp.find_first_of(","); + std::size_t const found = tmp.find_first_of(','); std::string fake_ini; if (found == std::string::npos) { @@ -306,8 +306,8 @@ menu_select_game::~menu_select_game() ui_options &mopt = ui().options(); mopt.set_value(OPTION_LAST_RIGHT_PANEL, ui_globals::rpanel, OPTION_PRIORITY_CMDLINE); - mopt.set_value(OPTION_LAST_USED_FILTER, filter.c_str(), OPTION_PRIORITY_CMDLINE); - mopt.set_value(OPTION_LAST_USED_MACHINE, last_driver.c_str(), OPTION_PRIORITY_CMDLINE); + mopt.set_value(OPTION_LAST_USED_FILTER, filter, OPTION_PRIORITY_CMDLINE); + mopt.set_value(OPTION_LAST_USED_MACHINE, last_driver, OPTION_PRIORITY_CMDLINE); mopt.set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE); ui().save_ui_options(); } @@ -894,8 +894,8 @@ void menu_select_game::inkey_select_favorite(const event *menu_event) driver_enumerator drv(machine().options(), *ui_swinfo->driver); media_auditor auditor(drv); drv.next(); - software_list_device *swlist = software_list_device::find_by_name(*drv.config(), ui_swinfo->listname.c_str()); - const software_info *swinfo = swlist->find(ui_swinfo->shortname.c_str()); + software_list_device *swlist = software_list_device::find_by_name(*drv.config(), ui_swinfo->listname); + const software_info *swinfo = swlist->find(ui_swinfo->shortname); media_auditor::summary const summary = auditor.audit_software(swlist->list_name(), swinfo, AUDIT_VALIDATE_FAST); diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index bb3e5dc8c00..4fd71e2798e 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -346,8 +346,8 @@ void menu_select_launch::bios_selection::handle() machine().options().set_value(OPTION_BIOS, elem.second, OPTION_PRIORITY_CMDLINE); // oh dear, relying on this persisting through the part selection menu driver_enumerator drivlist(machine().options(), *ui_swinfo->driver); drivlist.next(); - software_list_device *swlist = software_list_device::find_by_name(*drivlist.config(), ui_swinfo->listname.c_str()); - const software_info *swinfo = swlist->find(ui_swinfo->shortname.c_str()); + software_list_device *swlist = software_list_device::find_by_name(*drivlist.config(), ui_swinfo->listname); + const software_info *swinfo = swlist->find(ui_swinfo->shortname); if (!select_part(ui(), container(), *swinfo, *ui_swinfo)) { reselect_last::reselect(true); @@ -693,7 +693,7 @@ void menu_select_launch::custom_render(void *selectedref, float top, float botto else { std::string copyright(emulator_info::get_copyright()); - size_t found = copyright.find("\n"); + size_t found = copyright.find('\n'); tempbuf[0].clear(); tempbuf[1] = string_format(_("%1$s %2$s"), emulator_info::get_appname(), build_version); @@ -1305,8 +1305,8 @@ void menu_select_launch::get_title_search(std::string &snaptext, std::string &se } std::string tmp(searchstr); - path_iterator path(tmp.c_str()); - path_iterator path_iter(addpath.c_str()); + path_iterator path(tmp); + path_iterator path_iter(addpath); std::string c_path, curpath; // iterate over path and add path for zipped formats diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 4133f238e08..3c689d19239 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -483,8 +483,8 @@ void menu_select_software::inkey_select(const event *menu_event) driver_enumerator drivlist(machine().options(), *ui_swinfo->driver); media_auditor auditor(drivlist); drivlist.next(); - software_list_device *swlist = software_list_device::find_by_name(*drivlist.config(), ui_swinfo->listname.c_str()); - const software_info *swinfo = swlist->find(ui_swinfo->shortname.c_str()); + software_list_device *swlist = software_list_device::find_by_name(*drivlist.config(), ui_swinfo->listname); + const software_info *swinfo = swlist->find(ui_swinfo->shortname); media_auditor::summary const summary = auditor.audit_software(swlist->list_name(), swinfo, AUDIT_VALIDATE_FAST); diff --git a/src/frontend/mame/ui/simpleselgame.cpp b/src/frontend/mame/ui/simpleselgame.cpp index 20ce36c9b2d..f74c064640e 100644 --- a/src/frontend/mame/ui/simpleselgame.cpp +++ b/src/frontend/mame/ui/simpleselgame.cpp @@ -24,7 +24,7 @@ #include "mame.h" #include "uiinput.h" -#include <ctype.h> +#include <cctype> namespace ui { diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index 77df1a003cf..aa3ebac7976 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -151,7 +151,7 @@ void menu_sliders::populate(float &customtop, float &custombottom) // add UI sliders std::vector<menu_item> ui_sliders = ui().get_slider_list(); - for (menu_item item : ui_sliders) + for (const menu_item &item : ui_sliders) { if (item.type == menu_item_type::SLIDER) { @@ -180,7 +180,7 @@ void menu_sliders::populate(float &customtop, float &custombottom) // add OSD options std::vector<menu_item> osd_sliders = machine().osd().get_slider_list(); - for (menu_item item : osd_sliders) + for (const menu_item &item : osd_sliders) { if (item.type == menu_item_type::SLIDER) { diff --git a/src/frontend/mame/ui/tapectrl.cpp b/src/frontend/mame/ui/tapectrl.cpp index 0784ed72d26..1517554efd9 100644 --- a/src/frontend/mame/ui/tapectrl.cpp +++ b/src/frontend/mame/ui/tapectrl.cpp @@ -87,7 +87,7 @@ void menu_tape_control::populate(float &customtop, float &custombottom) ? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? _("playing") : _("(playing)")) : ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? _("recording") : _("(recording)")) ), - timepos.c_str(), + timepos, tapeflags, TAPECMD_SLIDER); diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index baca4dd1bc7..b5b37a3450f 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -843,7 +843,7 @@ void mame_ui_manager::process_natural_keyboard() { // if this was a UI_EVENT_CHAR event, post it if (event.event_type == ui_event::IME_CHAR) - machine().ioport().natkeyboard().post(event.ch); + machine().ioport().natkeyboard().post_char(event.ch); } // process natural keyboard keys that don't get UI_EVENT_CHARs @@ -866,7 +866,7 @@ void mame_ui_manager::process_natural_keyboard() *key_down_ptr |= key_down_mask; // post the key - machine().ioport().natkeyboard().post(UCHAR_MAMEKEY_BEGIN + code.item_id()); + machine().ioport().natkeyboard().post_char(UCHAR_MAMEKEY_BEGIN + code.item_id()); } else if (!pressed && (*key_down_ptr & key_down_mask)) { diff --git a/src/lib/formats/a26_cas.cpp b/src/lib/formats/a26_cas.cpp index 5030c2bfe0f..0074da6aba3 100644 --- a/src/lib/formats/a26_cas.cpp +++ b/src/lib/formats/a26_cas.cpp @@ -6,7 +6,7 @@ Atari 2600 SuperCharger support */ -#include <assert.h> +#include <cassert> #include "formats/a26_cas.h" diff --git a/src/lib/formats/a5105_dsk.cpp b/src/lib/formats/a5105_dsk.cpp index 33d7f15e1fd..f44c8c5f263 100644 --- a/src/lib/formats/a5105_dsk.cpp +++ b/src/lib/formats/a5105_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/a5105_dsk.h" diff --git a/src/lib/formats/abc800_dsk.cpp b/src/lib/formats/abc800_dsk.cpp index e61a0a1d1ff..af1f92ec75c 100644 --- a/src/lib/formats/abc800_dsk.cpp +++ b/src/lib/formats/abc800_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/abc800_dsk.h" diff --git a/src/lib/formats/abcfd2_dsk.cpp b/src/lib/formats/abcfd2_dsk.cpp index 8cc87ae20cd..94684f0ef5d 100644 --- a/src/lib/formats/abcfd2_dsk.cpp +++ b/src/lib/formats/abcfd2_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/abcfd2_dsk.h" diff --git a/src/lib/formats/ace_tap.cpp b/src/lib/formats/ace_tap.cpp index 56b4bd877c8..522050f612a 100644 --- a/src/lib/formats/ace_tap.cpp +++ b/src/lib/formats/ace_tap.cpp @@ -10,7 +10,7 @@ For more information see: ********************************************************************/ -#include <assert.h> +#include <cassert> #include "ace_tap.h" diff --git a/src/lib/formats/acorn_dsk.cpp b/src/lib/formats/acorn_dsk.cpp index d8992b9ad5a..d0f0bdb93aa 100644 --- a/src/lib/formats/acorn_dsk.cpp +++ b/src/lib/formats/acorn_dsk.cpp @@ -45,6 +45,11 @@ int acorn_ssd_format::find_size(io_generic *io, uint32_t form_factor) if (memcmp(cat, "\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd", 4) == 0 && size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) return i; + // test for HADFS - test pattern at sector 70 + io_generic_read(io, cat, 0x04610, 8); + if (memcmp(cat, "\x00\x28\x43\x29\x4a\x47\x48\x00", 4) == 0 && size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) + return i; + // read sector count from side 0 catalogue io_generic_read(io, cat, 0x100, 8); sectors0 = ((cat[6] & 3) << 8) + cat[7]; @@ -170,6 +175,11 @@ int acorn_dsd_format::find_size(io_generic *io, uint32_t form_factor) if (memcmp(cat, "\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd", 4) == 0 && size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) return i; + // test for HADFS - test pattern at sector 70 + io_generic_read(io, cat, 0x08c10, 8); + if (memcmp(cat, "\x00\x28\x43\x29\x4a\x47\x48\x00", 4) == 0 && size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) + return i; + // read sector count from side 0 catalogue io_generic_read(io, cat, 0x100, 8); sectors0 = ((cat[6] & 3) << 8) + cat[7]; diff --git a/src/lib/formats/adam_cas.cpp b/src/lib/formats/adam_cas.cpp index 3de9413cb90..5d24eed2543 100644 --- a/src/lib/formats/adam_cas.cpp +++ b/src/lib/formats/adam_cas.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Curt Coder -#include <assert.h> +#include <cassert> #include "cassimg.h" #include "adam_cas.h" diff --git a/src/lib/formats/adam_dsk.cpp b/src/lib/formats/adam_dsk.cpp index e78e94a4763..3010aa309b2 100644 --- a/src/lib/formats/adam_dsk.cpp +++ b/src/lib/formats/adam_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/adam_dsk.h" diff --git a/src/lib/formats/agat840k_hle_dsk.cpp b/src/lib/formats/agat840k_hle_dsk.cpp index 52cdd4668be..682b0edd7ad 100644 --- a/src/lib/formats/agat840k_hle_dsk.cpp +++ b/src/lib/formats/agat840k_hle_dsk.cpp @@ -12,7 +12,7 @@ ************************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/agat840k_hle_dsk.h" diff --git a/src/lib/formats/aim_dsk.cpp b/src/lib/formats/aim_dsk.cpp index 3bc2c2b5b5f..5abc410d57c 100644 --- a/src/lib/formats/aim_dsk.cpp +++ b/src/lib/formats/aim_dsk.cpp @@ -12,7 +12,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "aim_dsk.h" diff --git a/src/lib/formats/ami_dsk.cpp b/src/lib/formats/ami_dsk.cpp index 8a757e6a4c9..ba04067f752 100644 --- a/src/lib/formats/ami_dsk.cpp +++ b/src/lib/formats/ami_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/ami_dsk.h" diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp index a2fa0ee188a..9e71303ece5 100644 --- a/src/lib/formats/ap2_dsk.cpp +++ b/src/lib/formats/ap2_dsk.cpp @@ -8,9 +8,9 @@ *********************************************************************/ -#include <stdlib.h> -#include <string.h> -#include <assert.h> +#include <cstdlib> +#include <cstring> +#include <cassert> #include "ap2_dsk.h" #include "basicdsk.h" @@ -496,19 +496,19 @@ static uint32_t apple2_get_track_size(floppy_image_legacy *floppy, int head, int LEGACY_FLOPPY_OPTIONS_START( apple2 ) LEGACY_FLOPPY_OPTION( apple2_do, "do,dsk,bin", "Apple ][ DOS order disk image", apple2_dsk_identify, apple2_do_construct, nullptr, HEADS([1]) - TRACKS([APPLE2_TRACK_COUNT]) + TRACKS([40]) // APPLE2_TRACK_COUNT SECTORS([16]) SECTOR_LENGTH([256]) FIRST_SECTOR_ID([0])) LEGACY_FLOPPY_OPTION( apple2_po, "po,dsk,bin", "Apple ][ ProDOS order disk image", apple2_dsk_identify, apple2_po_construct, nullptr, HEADS([1]) - TRACKS([APPLE2_TRACK_COUNT]) + TRACKS([40]) // APPLE2_TRACK_COUNT SECTORS([16]) SECTOR_LENGTH([256]) FIRST_SECTOR_ID([0])) LEGACY_FLOPPY_OPTION( apple2_nib, "dsk,nib", "Apple ][ Nibble order disk image", apple2_nib_identify, apple2_nib_construct, nullptr, HEADS([1]) - TRACKS([APPLE2_TRACK_COUNT]) + TRACKS([40]) // APPLE2_TRACK_COUNT SECTORS([16]) SECTOR_LENGTH([256]) FIRST_SECTOR_ID([0])) diff --git a/src/lib/formats/ap_dsk35.cpp b/src/lib/formats/ap_dsk35.cpp index c18ea8c65d4..677cfcc9463 100644 --- a/src/lib/formats/ap_dsk35.cpp +++ b/src/lib/formats/ap_dsk35.cpp @@ -98,8 +98,8 @@ *********************************************************************/ -#include <stdio.h> -#include <assert.h> +#include <cstdio> +#include <cassert> #include "emu.h" // logerror #include "ap_dsk35.h" diff --git a/src/lib/formats/apf_apt.cpp b/src/lib/formats/apf_apt.cpp index de919b0bddd..28793f0f853 100644 --- a/src/lib/formats/apf_apt.cpp +++ b/src/lib/formats/apf_apt.cpp @@ -34,7 +34,7 @@ e. A checksum byte (8-bit addition) ********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/apf_apt.h" diff --git a/src/lib/formats/apollo_dsk.cpp b/src/lib/formats/apollo_dsk.cpp index b2fef28be71..213286dd85b 100644 --- a/src/lib/formats/apollo_dsk.cpp +++ b/src/lib/formats/apollo_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/apollo_dsk.h" diff --git a/src/lib/formats/applix_dsk.cpp b/src/lib/formats/applix_dsk.cpp index 59a0d4c06f5..70a52c42ccb 100644 --- a/src/lib/formats/applix_dsk.cpp +++ b/src/lib/formats/applix_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/applix_dsk.h" diff --git a/src/lib/formats/asst128_dsk.cpp b/src/lib/formats/asst128_dsk.cpp index fe64cc725ee..e0c90636484 100644 --- a/src/lib/formats/asst128_dsk.cpp +++ b/src/lib/formats/asst128_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/asst128_dsk.h" diff --git a/src/lib/formats/atari_dsk.cpp b/src/lib/formats/atari_dsk.cpp index d73cbf8185f..4008ec32fe3 100644 --- a/src/lib/formats/atari_dsk.cpp +++ b/src/lib/formats/atari_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/atari_dsk.h" diff --git a/src/lib/formats/atom_tap.cpp b/src/lib/formats/atom_tap.cpp index 881433ef1a8..1c8c3642838 100644 --- a/src/lib/formats/atom_tap.cpp +++ b/src/lib/formats/atom_tap.cpp @@ -40,7 +40,7 @@ */ -#include <assert.h> +#include <cassert> #include "atom_tap.h" #include "csw_cas.h" diff --git a/src/lib/formats/basicdsk.cpp b/src/lib/formats/basicdsk.cpp index 9de079232e0..c654362309e 100644 --- a/src/lib/formats/basicdsk.cpp +++ b/src/lib/formats/basicdsk.cpp @@ -8,9 +8,9 @@ *********************************************************************/ -#include <stdlib.h> -#include <string.h> -#include <assert.h> +#include <cstdlib> +#include <cstring> +#include <cassert> #include "basicdsk.h" diff --git a/src/lib/formats/bw12_dsk.cpp b/src/lib/formats/bw12_dsk.cpp index 06c8be72347..407db641d9c 100644 --- a/src/lib/formats/bw12_dsk.cpp +++ b/src/lib/formats/bw12_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/bw12_dsk.h" diff --git a/src/lib/formats/bw2_dsk.cpp b/src/lib/formats/bw2_dsk.cpp index 3dc46e9b225..297f78f863f 100644 --- a/src/lib/formats/bw2_dsk.cpp +++ b/src/lib/formats/bw2_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/bw2_dsk.h" diff --git a/src/lib/formats/c3040_dsk.cpp b/src/lib/formats/c3040_dsk.cpp index 78786979953..b5c35f9d2e5 100644 --- a/src/lib/formats/c3040_dsk.cpp +++ b/src/lib/formats/c3040_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/c3040_dsk.h" diff --git a/src/lib/formats/c4040_dsk.cpp b/src/lib/formats/c4040_dsk.cpp index e6314f69261..69d371525c1 100644 --- a/src/lib/formats/c4040_dsk.cpp +++ b/src/lib/formats/c4040_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/c4040_dsk.h" diff --git a/src/lib/formats/camplynx_dsk.cpp b/src/lib/formats/camplynx_dsk.cpp index c58b12b9423..46cd4f2a55d 100644 --- a/src/lib/formats/camplynx_dsk.cpp +++ b/src/lib/formats/camplynx_dsk.cpp @@ -19,7 +19,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/camplynx_dsk.h" diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp index 816af2dccfd..4f5d9320754 100644 --- a/src/lib/formats/cassimg.cpp +++ b/src/lib/formats/cassimg.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "imageutl.h" #include "cassimg.h" diff --git a/src/lib/formats/cbm_tap.cpp b/src/lib/formats/cbm_tap.cpp index e621651f577..7ef8015c6f9 100644 --- a/src/lib/formats/cbm_tap.cpp +++ b/src/lib/formats/cbm_tap.cpp @@ -94,7 +94,7 @@ Unfortunately, I have no such a .tap file to test, so my implementation below could be not working. FP ] */ -#include <assert.h> +#include <cassert> #include "cbm_tap.h" diff --git a/src/lib/formats/cgen_cas.cpp b/src/lib/formats/cgen_cas.cpp index be4b9397f89..de47a45375d 100644 --- a/src/lib/formats/cgen_cas.cpp +++ b/src/lib/formats/cgen_cas.cpp @@ -19,7 +19,7 @@ We now support these three types below... ********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/cgen_cas.h" diff --git a/src/lib/formats/comx35_dsk.cpp b/src/lib/formats/comx35_dsk.cpp index aa8603f3c1c..a06f1a2dd6c 100644 --- a/src/lib/formats/comx35_dsk.cpp +++ b/src/lib/formats/comx35_dsk.cpp @@ -36,7 +36,7 @@ */ -#include <assert.h> +#include <cassert> #include "formats/comx35_dsk.h" diff --git a/src/lib/formats/concept_dsk.cpp b/src/lib/formats/concept_dsk.cpp index eea65064fc7..b8c010af852 100644 --- a/src/lib/formats/concept_dsk.cpp +++ b/src/lib/formats/concept_dsk.cpp @@ -10,7 +10,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "flopimg.h" #include "formats/concept_dsk.h" diff --git a/src/lib/formats/coupedsk.cpp b/src/lib/formats/coupedsk.cpp index 045e42b7bb5..967896195f1 100644 --- a/src/lib/formats/coupedsk.cpp +++ b/src/lib/formats/coupedsk.cpp @@ -8,7 +8,7 @@ **************************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/coupedsk.h" #include "flopimg.h" diff --git a/src/lib/formats/cqm_dsk.cpp b/src/lib/formats/cqm_dsk.cpp index e2bde8fcf8c..c38f06bde1c 100644 --- a/src/lib/formats/cqm_dsk.cpp +++ b/src/lib/formats/cqm_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "flopimg.h" #define CQM_HEADER_SIZE 133 diff --git a/src/lib/formats/csw_cas.cpp b/src/lib/formats/csw_cas.cpp index 84aab50d3b8..9edea5c3ff7 100644 --- a/src/lib/formats/csw_cas.cpp +++ b/src/lib/formats/csw_cas.cpp @@ -22,10 +22,10 @@ Offset Value Type Description */ -#include <string.h> +#include <cstring> #include <zlib.h> -#include <assert.h> +#include <cassert> #include "uef_cas.h" #include "csw_cas.h" diff --git a/src/lib/formats/d71_dsk.cpp b/src/lib/formats/d71_dsk.cpp index af1186948c6..16c8efea2e9 100644 --- a/src/lib/formats/d71_dsk.cpp +++ b/src/lib/formats/d71_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/d71_dsk.h" diff --git a/src/lib/formats/d80_dsk.cpp b/src/lib/formats/d80_dsk.cpp index e08ef22f6b9..d350411b159 100644 --- a/src/lib/formats/d80_dsk.cpp +++ b/src/lib/formats/d80_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/d80_dsk.h" diff --git a/src/lib/formats/d81_dsk.cpp b/src/lib/formats/d81_dsk.cpp index 714b9c3cd9e..a7f01c9c92e 100644 --- a/src/lib/formats/d81_dsk.cpp +++ b/src/lib/formats/d81_dsk.cpp @@ -73,7 +73,7 @@ PER SECTOR ORGANIZATION: */ -#include <assert.h> +#include <cassert> #include "formats/d81_dsk.h" diff --git a/src/lib/formats/d82_dsk.cpp b/src/lib/formats/d82_dsk.cpp index 00de1f5fd7c..0d79ad891ae 100644 --- a/src/lib/formats/d82_dsk.cpp +++ b/src/lib/formats/d82_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/d82_dsk.h" diff --git a/src/lib/formats/d88_dsk.cpp b/src/lib/formats/d88_dsk.cpp index c2bf9772e7d..30073d1874d 100644 --- a/src/lib/formats/d88_dsk.cpp +++ b/src/lib/formats/d88_dsk.cpp @@ -29,7 +29,7 @@ * */ - #include <assert.h> + #include <cassert> #include "flopimg.h" #include "imageutl.h" diff --git a/src/lib/formats/dcp_dsk.cpp b/src/lib/formats/dcp_dsk.cpp index 179552409f8..c245d4ff0e3 100644 --- a/src/lib/formats/dcp_dsk.cpp +++ b/src/lib/formats/dcp_dsk.cpp @@ -20,7 +20,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "dcp_dsk.h" diff --git a/src/lib/formats/dim_dsk.cpp b/src/lib/formats/dim_dsk.cpp index 67c04adc2bf..ac9930e4782 100644 --- a/src/lib/formats/dim_dsk.cpp +++ b/src/lib/formats/dim_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "dim_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/dip_dsk.cpp b/src/lib/formats/dip_dsk.cpp index 310eab56a73..573f3768072 100644 --- a/src/lib/formats/dip_dsk.cpp +++ b/src/lib/formats/dip_dsk.cpp @@ -14,7 +14,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "dip_dsk.h" diff --git a/src/lib/formats/dmk_dsk.cpp b/src/lib/formats/dmk_dsk.cpp index 5ca0a3b8781..4b3336b4bcb 100644 --- a/src/lib/formats/dmk_dsk.cpp +++ b/src/lib/formats/dmk_dsk.cpp @@ -13,7 +13,7 @@ TODO: *********************************************************************/ -#include <assert.h> +#include <cassert> #include "dmk_dsk.h" diff --git a/src/lib/formats/dmv_dsk.cpp b/src/lib/formats/dmv_dsk.cpp index 02469ed74d4..b64fea5b318 100644 --- a/src/lib/formats/dmv_dsk.cpp +++ b/src/lib/formats/dmv_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/dmv_dsk.h" diff --git a/src/lib/formats/ds9_dsk.cpp b/src/lib/formats/ds9_dsk.cpp index 0866d78d58f..cd241c3a319 100644 --- a/src/lib/formats/ds9_dsk.cpp +++ b/src/lib/formats/ds9_dsk.cpp @@ -14,7 +14,7 @@ ************************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/ds9_dsk.h" diff --git a/src/lib/formats/dsk_dsk.cpp b/src/lib/formats/dsk_dsk.cpp index db9d54920e5..7994f60f3ce 100644 --- a/src/lib/formats/dsk_dsk.cpp +++ b/src/lib/formats/dsk_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "imageutl.h" #include "flopimg.h" diff --git a/src/lib/formats/dvk_mx_dsk.cpp b/src/lib/formats/dvk_mx_dsk.cpp index 477dd07690f..37de4111948 100644 --- a/src/lib/formats/dvk_mx_dsk.cpp +++ b/src/lib/formats/dvk_mx_dsk.cpp @@ -18,7 +18,7 @@ ************************************************************************/ -#include <assert.h> +#include <cassert> #include "flopimg.h" #include "formats/dvk_mx_dsk.h" diff --git a/src/lib/formats/ep64_dsk.cpp b/src/lib/formats/ep64_dsk.cpp index 80981bf698e..f47615c76d9 100644 --- a/src/lib/formats/ep64_dsk.cpp +++ b/src/lib/formats/ep64_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/ep64_dsk.h" diff --git a/src/lib/formats/esq16_dsk.cpp b/src/lib/formats/esq16_dsk.cpp index 1f6e86f295f..72e27ebfad5 100644 --- a/src/lib/formats/esq16_dsk.cpp +++ b/src/lib/formats/esq16_dsk.cpp @@ -10,7 +10,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "flopimg.h" #include "formats/esq16_dsk.h" diff --git a/src/lib/formats/esq8_dsk.cpp b/src/lib/formats/esq8_dsk.cpp index c575fe0db2f..b7f69c85afc 100644 --- a/src/lib/formats/esq8_dsk.cpp +++ b/src/lib/formats/esq8_dsk.cpp @@ -12,7 +12,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "flopimg.h" #include "formats/esq8_dsk.h" diff --git a/src/lib/formats/excali64_dsk.cpp b/src/lib/formats/excali64_dsk.cpp index 5d41c39f4e6..cc255052800 100644 --- a/src/lib/formats/excali64_dsk.cpp +++ b/src/lib/formats/excali64_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/excali64_dsk.h" diff --git a/src/lib/formats/fc100_cas.cpp b/src/lib/formats/fc100_cas.cpp index 5004da147d3..42b99ad3f0e 100644 --- a/src/lib/formats/fc100_cas.cpp +++ b/src/lib/formats/fc100_cas.cpp @@ -10,7 +10,7 @@ it's all a guess. ********************************************************************/ -#include <assert.h> +#include <cassert> #include "fc100_cas.h" diff --git a/src/lib/formats/fdd_dsk.cpp b/src/lib/formats/fdd_dsk.cpp index 5e34c4ad7df..f5eb6ea19a5 100644 --- a/src/lib/formats/fdd_dsk.cpp +++ b/src/lib/formats/fdd_dsk.cpp @@ -31,7 +31,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "fdd_dsk.h" diff --git a/src/lib/formats/fdi_dsk.cpp b/src/lib/formats/fdi_dsk.cpp index c703f29cc69..57083f1230e 100644 --- a/src/lib/formats/fdi_dsk.cpp +++ b/src/lib/formats/fdi_dsk.cpp @@ -16,7 +16,7 @@ */ -#include <assert.h> +#include <cassert> #include "imageutl.h" #include "flopimg.h" diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp index ea812506f50..79d97b1bf71 100644 --- a/src/lib/formats/flopimg.cpp +++ b/src/lib/formats/flopimg.cpp @@ -8,12 +8,12 @@ *********************************************************************/ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> -#include <limits.h> -#include <assert.h> +#include <cstdlib> +#include <cstring> +#include <cstdio> +#include <cctype> +#include <climits> +#include <cassert> #include "emu.h" // emu_fatalerror #include "osdcore.h" diff --git a/src/lib/formats/fm7_cas.cpp b/src/lib/formats/fm7_cas.cpp index 32cd08e3b27..f275866d31b 100644 --- a/src/lib/formats/fm7_cas.cpp +++ b/src/lib/formats/fm7_cas.cpp @@ -4,7 +4,7 @@ * Fujitsu FM-7 series cassette handling */ -#include <assert.h> +#include <cassert> #include "fm7_cas.h" diff --git a/src/lib/formats/fmsx_cas.cpp b/src/lib/formats/fmsx_cas.cpp index 6da8fc47f81..3b00b81dc92 100644 --- a/src/lib/formats/fmsx_cas.cpp +++ b/src/lib/formats/fmsx_cas.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Sean Young -#include <assert.h> +#include <cassert> #include "formats/fmsx_cas.h" diff --git a/src/lib/formats/fmtowns_dsk.cpp b/src/lib/formats/fmtowns_dsk.cpp index 633b53fcd87..13d1408ba4b 100644 --- a/src/lib/formats/fmtowns_dsk.cpp +++ b/src/lib/formats/fmtowns_dsk.cpp @@ -8,7 +8,7 @@ * Created on: 23/03/2014 */ - #include <assert.h> + #include <cassert> #include "formats/fmtowns_dsk.h" diff --git a/src/lib/formats/gtp_cas.cpp b/src/lib/formats/gtp_cas.cpp index fd3a16932b3..0a5c34d140c 100644 --- a/src/lib/formats/gtp_cas.cpp +++ b/src/lib/formats/gtp_cas.cpp @@ -6,7 +6,7 @@ Miodrag Milanovic */ -#include <assert.h> +#include <cassert> #include "gtp_cas.h" diff --git a/src/lib/formats/hect_dsk.cpp b/src/lib/formats/hect_dsk.cpp index 4cd36008540..cf8fc2cacc4 100644 --- a/src/lib/formats/hect_dsk.cpp +++ b/src/lib/formats/hect_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/hect_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/hect_tap.cpp b/src/lib/formats/hect_tap.cpp index 4f823fb24e5..78f1bad2e42 100644 --- a/src/lib/formats/hect_tap.cpp +++ b/src/lib/formats/hect_tap.cpp @@ -14,7 +14,7 @@ You can find some *.K7 file on serveral server in France Updated 3/1/10 : use real value for timing. ********************************************************************/ -#include <assert.h> +#include <cassert> #include "hect_tap.h" diff --git a/src/lib/formats/hp_ipc_dsk.cpp b/src/lib/formats/hp_ipc_dsk.cpp index 8b9efce0120..66485b461be 100644 --- a/src/lib/formats/hp_ipc_dsk.cpp +++ b/src/lib/formats/hp_ipc_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/hp_ipc_dsk.h" diff --git a/src/lib/formats/hxcmfm_dsk.cpp b/src/lib/formats/hxcmfm_dsk.cpp index dcc4718c114..390e07ff3f8 100644 --- a/src/lib/formats/hxcmfm_dsk.cpp +++ b/src/lib/formats/hxcmfm_dsk.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include <assert.h> +#include <cassert> #include "hxcmfm_dsk.h" diff --git a/src/lib/formats/imageutl.cpp b/src/lib/formats/imageutl.cpp index 6ab427115e0..6bf2bbd3323 100644 --- a/src/lib/formats/imageutl.cpp +++ b/src/lib/formats/imageutl.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <ctype.h> +#include <cctype> #include "imageutl.h" int compute_log2(int val) diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp index 51337a7f890..4ae22724fb9 100644 --- a/src/lib/formats/imd_dsk.cpp +++ b/src/lib/formats/imd_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "flopimg.h" struct imddsk_tag diff --git a/src/lib/formats/img_dsk.cpp b/src/lib/formats/img_dsk.cpp new file mode 100644 index 00000000000..0dfcc7a359f --- /dev/null +++ b/src/lib/formats/img_dsk.cpp @@ -0,0 +1,378 @@ +// license:BSD-3-Clause +// copyright-holders: F. Ulivi +/********************************************************************* + + img_dsk.cpp + + "IMG" disk format + + This format is just a raw image of every sector on SSDD 8" floppy + disks as used in Intel MDS-II systems. + Files with this format have no header/trailer and are exactly + 512512 bytes in size (52 sectors, 1 head, 77 tracks, + 128 bytes per sector). + +*********************************************************************/ + +#include "emu.h" +#include "img_dsk.h" + +// Debugging +#define VERBOSE 0 +#define LOG(...) do { if (VERBOSE) printf(__VA_ARGS__); } while (false) + +constexpr unsigned CELL_SIZE = 1200; // Bit cell size (1 µs) +constexpr uint8_t INDEX_AM = 0x0c; // Index address mark +constexpr uint8_t ID_AM = 0x0e; // ID address mark +constexpr uint8_t DATA_AM = 0x0b; // Data address mark +constexpr uint8_t AM_CLOCK = 0x70; // Clock pattern of AM +constexpr unsigned PREIDX_GAP = 45; // Size of pre-index gap +constexpr unsigned SYNC_00_LEN = 18; // 00's in sync (gaps 1, 2, 3) +constexpr unsigned SYNC_FF_LEN = 10; // FF's in sync (gaps 1, 2, 3) +constexpr int ID_DATA_OFFSET = 35 * 16; // Nominal distance (in cells) between ID & DATA AM +// Size of image file +constexpr unsigned IMG_IMAGE_SIZE = IMG_TRACKS * IMG_HEADS * IMG_SECTORS * IMG_SECTOR_SIZE; +constexpr uint16_t CRC_POLY = 0x1021; // CRC-CCITT + +img_format::img_format() +{ +} + +int img_format::identify(io_generic *io, uint32_t form_factor) +{ + uint64_t size = io_generic_size(io); + + if (((form_factor == floppy_image::FF_8) || (form_factor == floppy_image::FF_UNKNOWN)) && + size == IMG_IMAGE_SIZE) { + return 50; + } else { + return 0; + } +} + +bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) +{ + uint64_t size = io_generic_size(io); + if (size != IMG_IMAGE_SIZE) { + return false; + } + image->set_variant(floppy_image::SSDD); + + // Suck in the whole image + std::vector<uint8_t> image_data(size); + io_generic_read(io, (void *)image_data.data(), 0, size); + + for (unsigned cyl = 0; cyl < IMG_TRACKS; cyl++) { + std::vector<uint32_t> track_data; + + write_gap(track_data, 0 , PREIDX_GAP); + write_mmfm_byte(track_data , INDEX_AM , AM_CLOCK); + + // Compute interleave factor and skew for current track + unsigned il_factor; + unsigned skew; + if (cyl == 0) { + il_factor = 1; + skew = 51; + } else if (cyl == 1) { + il_factor = 4; + skew = 48; + } else { + il_factor = 5; + skew = (47 + 45 * (cyl - 2)) % 52; + } + std::vector<uint8_t> sector_list = interleaved_sectors(il_factor); + + for (unsigned sector = 0; sector < IMG_SECTORS; sector++) { + unsigned real_sector = sector_list[ (sector + skew) % IMG_SECTORS ]; + unsigned offset_in_image = (real_sector - 1 + cyl * IMG_SECTORS) * IMG_SECTOR_SIZE; + write_sector(track_data , cyl , real_sector , &image_data[ offset_in_image ]); + } + fill_with_gap4(track_data); + generate_track_from_levels(cyl , 0 , track_data , 0 , image); + } + return true; +} + +bool img_format::save(io_generic *io, floppy_image *image) +{ + for (int cyl = 0; cyl < IMG_TRACKS; cyl++) { + uint8_t bitstream[ 21000 ]; + int bitstream_size; + generate_bitstream_from_track(cyl , 0 , CELL_SIZE , bitstream , bitstream_size , image , 0); + int pos = 0; + unsigned track_no , sector_no; + uint8_t sector_data[ IMG_SECTOR_SIZE ]; + while (get_next_sector(bitstream , bitstream_size , pos , track_no , sector_no , sector_data)) { + if (track_no == cyl && sector_no >= 1 && sector_no <= IMG_SECTORS) { + unsigned offset_in_image = (cyl * IMG_SECTORS + sector_no - 1) * IMG_SECTOR_SIZE; + io_generic_write(io, sector_data, offset_in_image, IMG_SECTOR_SIZE); + } + } + } + return true; +} + +const char *img_format::name() const +{ + return "img"; +} + +const char *img_format::description() const +{ + return "MDS-II floppy disk image"; +} + +const char *img_format::extensions() const +{ + return "img"; +} + +bool img_format::supports_save() const +{ + return true; +} + +std::vector<uint8_t> img_format::interleaved_sectors(unsigned il_factor) +{ + std::vector<uint8_t> out(IMG_SECTORS); + unsigned idx = 0; + for (unsigned s = 0; s < IMG_SECTORS; s++) { + while (out[ idx ] != 0) { + if (++idx >= IMG_SECTORS) { + idx = 0; + } + } + out[ idx ] = s + 1; + idx += il_factor; + if (idx >= IMG_SECTORS) { + idx -= IMG_SECTORS; + } + } + return out; +} + +void img_format::write_mmfm_bit(std::vector<uint32_t> &buffer , bool data_bit , bool clock_bit) +{ + bool had_transition = buffer.size() < 2 ? false : bit_r(buffer, buffer.size() - 1) || bit_r(buffer , buffer.size() - 2); + clock_bit = !data_bit && (clock_bit || !had_transition); + bit_w(buffer , clock_bit , CELL_SIZE); + bit_w(buffer , data_bit , CELL_SIZE); + + if (BIT(m_crc , 15) ^ data_bit) { + m_crc = (m_crc << 1) ^ CRC_POLY; + } else { + m_crc <<= 1; + } +} + +void img_format::write_mmfm_byte(std::vector<uint32_t> &buffer , uint8_t data , uint8_t clock) +{ + for (int i = 7; i >= 0; i--) { + write_mmfm_bit(buffer , BIT(data , i) , BIT(clock , i)); + } +} + +void img_format::write_sync(std::vector<uint32_t> &buffer) +{ + write_gap(buffer , SYNC_00_LEN , SYNC_FF_LEN); +} + +void img_format::write_crc(std::vector<uint32_t> &buffer , uint16_t crc) +{ + // Note that CRC is stored with MSB (x^15) first + for (unsigned i = 0; i < 16; i++) { + write_mmfm_bit(buffer , BIT(crc , 15 - i) , 0); + } +} + +void img_format::write_gap(std::vector<uint32_t> &buffer , unsigned size_00 , unsigned size_ff) +{ + for (unsigned i = 0; i < size_00; ++i) { + write_mmfm_byte(buffer, 0); + } + for (unsigned i = 0; i < size_ff; ++i) { + write_mmfm_byte(buffer, 0xff); + } +} + +void img_format::write_sector(std::vector<uint32_t> &buffer , uint8_t track_no , uint8_t sect_no , const uint8_t *sect_data) +{ + // **** On-disk format of a sector **** + // + // | Offset | Size | Value | Content | + // |--------+------+-------+----------------------| + // | 0 | 18 | 00 | Gap 1/3 | + // | 18 | 10 | ff | Gap 1/3 | + // | 28 | 1 | 0e | ID AM (clock = 70) | + // | 29 | 1 | xx | Track no. | + // | 30 | 1 | 00 | N/U | + // | 31 | 1 | xx | Sector no. | + // | 32 | 1 | 00 | N/U | + // | 33 | 2 | xx | ID CRC | + // | 35 | 18 | 00 | Gap 2 | + // | 53 | 10 | ff | Gap 2 | + // | 63 | 1 | 0b | Data AM (clock = 70) | + // | 64 | 128 | xx | Sector data | + // | 192 | 2 | xx | Data CRC | + // | 194 | | | | + + // Gap1 + write_sync(buffer); + // ID AM + m_crc = 0; + write_mmfm_byte(buffer , ID_AM , AM_CLOCK); + // Track # + write_mmfm_byte(buffer , track_no); + write_mmfm_byte(buffer , 0); + // Sector # + write_mmfm_byte(buffer , sect_no); + write_mmfm_byte(buffer , 0); + // ID CRC + write_crc(buffer , m_crc); + // Gap 2 + write_sync(buffer); + // Data AM + m_crc = 0; + write_mmfm_byte(buffer , DATA_AM , AM_CLOCK); + for (unsigned i = 0; i < IMG_SECTOR_SIZE; i++) { + // Data + write_mmfm_byte(buffer , sect_data[ i ]); + } + // Data CRC + write_crc(buffer , m_crc); +} + +void img_format::fill_with_gap4(std::vector<uint32_t> &buffer) +{ + // Cell count in a track (1 µs cells in a 1/6 s track) + unsigned cell_count = (500000 * 120) / 360; + unsigned cells_in_buffer = buffer.size(); + // Size of gap 4 + unsigned gap_4 = (cell_count - cells_in_buffer) / 16; + // Gap 4 + write_gap(buffer , gap_4 , 0); + // Last cell to round everything up to 2E+8 + if (buffer.size() * CELL_SIZE < 200000000) { + bit_w(buffer , false , 200000000 - buffer.size() * CELL_SIZE); + } +} + +std::vector<uint8_t> img_format::get_next_id_n_block(const uint8_t *bitstream , int bitstream_size , int& pos , int& start_pos) +{ + std::vector<uint8_t> res; + uint8_t data_sr; + uint8_t clock_sr; + + // Look for either sync + ID AM or sync + DATA AM + do { + unsigned cnt_trans = 0; + while (pos < bitstream_size && cnt_trans < 34) { + bool bit = BIT(bitstream[ pos >> 3 ] , ~pos & 7); + pos++; + if (cnt_trans < 32) { + if (!(BIT(cnt_trans , 0) ^ bit)) { + cnt_trans++; + } else { + cnt_trans = 0; + } + } else if (cnt_trans == 32) { + if (!bit) { + start_pos = pos; + cnt_trans++; + } else { + cnt_trans = 0; + } + } else if (!bit) { + cnt_trans++; + } else { + cnt_trans = 32; + } + } + + if (pos == bitstream_size) { + // End of track reached + return res; + } + + // Get AM + data_sr = clock_sr = 0; + for (unsigned i = 0; i < 7; ++i) { + bool bit = BIT(bitstream[ pos >> 3 ] , ~pos & 7); + pos++; + clock_sr = (clock_sr << 1) | bit; + bit = BIT(bitstream[ pos >> 3 ] , ~pos & 7); + pos++; + data_sr = (data_sr << 1) | bit; + } + if (pos >= bitstream_size) { + return res; + } + } while (clock_sr != AM_CLOCK); + + // ID blocks: Track no. + 0 + sector no. + 0 + CRC + // Data blocks: Sector data + CRC + res.push_back(data_sr); + unsigned to_dump; + if (data_sr == ID_AM) { + to_dump = 4; + } else if (data_sr == DATA_AM) { + to_dump = IMG_SECTOR_SIZE; + } else { + to_dump = 0; + } + + pos++; + for (unsigned i = 0; i < to_dump && pos < bitstream_size; i++) { + data_sr = 0; + unsigned j; + for (j = 0; j < 8 && pos < bitstream_size; j++) { + bool bit = BIT(bitstream[ pos >> 3 ] , ~pos & 7); + pos += 2; + data_sr = (data_sr << 1) | bit; + } + if (j == 8) { + res.push_back(data_sr); + } + } + return res; +} + +bool img_format::get_next_sector(const uint8_t *bitstream , int bitstream_size , int& pos , unsigned& track , unsigned& sector , uint8_t *sector_data) +{ + std::vector<uint8_t> block; + while (true) { + // Scan for ID block first + int id_pos = 0; + while (true) { + if (block.size() == 0) { + block = get_next_id_n_block(bitstream , bitstream_size , pos , id_pos); + if (block.size() == 0) { + return false; + } + } + if (block[ 0 ] == ID_AM && block.size() >= 5) { + track = block[ 1 ]; + sector = block[ 3 ]; + break; + } else { + block.clear(); + } + } + // Then for DATA block + int data_pos = 0; + block = get_next_id_n_block(bitstream , bitstream_size , pos , data_pos); + if (block.size() == 0) { + return false; + } + if (block[ 0 ] == DATA_AM && block.size() >= (IMG_SECTOR_SIZE + 1) && abs((data_pos - id_pos) - ID_DATA_OFFSET) <= 64) { + break; + } + } + + memcpy(sector_data , block.data() + 1 , IMG_SECTOR_SIZE); + + return true; +} + +const floppy_format_type FLOPPY_IMG_FORMAT = &floppy_image_format_creator<img_format>; diff --git a/src/lib/formats/img_dsk.h b/src/lib/formats/img_dsk.h new file mode 100644 index 00000000000..f1ac7aef3c0 --- /dev/null +++ b/src/lib/formats/img_dsk.h @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders: F. Ulivi +/********************************************************************* + + img_dsk.h + + "IMG" disk format for SSDD Intel MDS-II 8" disks + +*********************************************************************/ +#ifndef MAME_FORMATS_IMG_DSK_H +#define MAME_FORMATS_IMG_DSK_H + +#pragma once + +#include "flopimg.h" + +#include <vector> + +// Geometry constants +constexpr unsigned IMG_TRACKS = 77; +constexpr unsigned IMG_HEADS = 1; +constexpr unsigned IMG_SECTORS = 52; +constexpr unsigned IMG_SECTOR_SIZE = 128; + +class img_format : public floppy_image_format_t +{ +public: + img_format(); + + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; + virtual bool save(io_generic *io, floppy_image *image) override; + virtual const char *name() const override; + virtual const char *description() const override; + virtual const char *extensions() const override; + virtual bool supports_save() const override; + +private: + uint16_t m_crc; + + static std::vector<uint8_t> interleaved_sectors(unsigned il_factor); + void write_mmfm_bit(std::vector<uint32_t> &buffer , bool data_bit , bool clock_bit); + void write_mmfm_byte(std::vector<uint32_t> &buffer , uint8_t data , uint8_t clock = 0); + void write_sync(std::vector<uint32_t> &buffer); + void write_crc(std::vector<uint32_t> &buffer , uint16_t crc); + void write_gap(std::vector<uint32_t> &buffer , unsigned size_00 , unsigned size_ff); + void write_sector(std::vector<uint32_t> &buffer , uint8_t track_no , uint8_t sect_no , const uint8_t *sect_data); + void fill_with_gap4(std::vector<uint32_t> &buffer); + std::vector<uint8_t> get_next_id_n_block(const uint8_t *bitstream , int bitstream_size , int& pos , int& start_pos); + bool get_next_sector(const uint8_t *bitstream , int bitstream_size , int& pos , unsigned& track , unsigned& sector , uint8_t *sector_data); +}; + +extern const floppy_format_type FLOPPY_IMG_FORMAT; + +#endif // MAME_FORMATS_IMG_DSK_H diff --git a/src/lib/formats/ioprocs.cpp b/src/lib/formats/ioprocs.cpp index 69943c13dc0..34810153f9a 100644 --- a/src/lib/formats/ioprocs.cpp +++ b/src/lib/formats/ioprocs.cpp @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Nathan Woods -#include <stdio.h> -#include <string.h> -#include <assert.h> +#include <cstdio> +#include <cstring> +#include <cassert> #include "osdcore.h" #include "ioprocs.h" #include "corefile.h" diff --git a/src/lib/formats/ioprocs.h b/src/lib/formats/ioprocs.h index c569e52dd2b..5b45b4a1450 100644 --- a/src/lib/formats/ioprocs.h +++ b/src/lib/formats/ioprocs.h @@ -12,8 +12,8 @@ #pragma once -#include <stdint.h> -#include <stdlib.h> +#include <cstdint> +#include <cstdlib> diff --git a/src/lib/formats/ipf_dsk.cpp b/src/lib/formats/ipf_dsk.cpp index da50e850ea8..ed6505fd385 100644 --- a/src/lib/formats/ipf_dsk.cpp +++ b/src/lib/formats/ipf_dsk.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include <assert.h> +#include <cassert> #include "ipf_dsk.h" const floppy_format_type FLOPPY_IPF_FORMAT = &floppy_image_format_creator<ipf_format>; diff --git a/src/lib/formats/iq151_dsk.cpp b/src/lib/formats/iq151_dsk.cpp index dcffad85751..b085cca0d37 100644 --- a/src/lib/formats/iq151_dsk.cpp +++ b/src/lib/formats/iq151_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/iq151_dsk.h" diff --git a/src/lib/formats/itt3030_dsk.cpp b/src/lib/formats/itt3030_dsk.cpp index 305ab644233..4a4a795c7d3 100644 --- a/src/lib/formats/itt3030_dsk.cpp +++ b/src/lib/formats/itt3030_dsk.cpp @@ -10,7 +10,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/itt3030_dsk.h" diff --git a/src/lib/formats/jvc_dsk.cpp b/src/lib/formats/jvc_dsk.cpp index 5035e989f22..f5de872c672 100644 --- a/src/lib/formats/jvc_dsk.cpp +++ b/src/lib/formats/jvc_dsk.cpp @@ -150,8 +150,8 @@ bool jvc_format::parse_header(io_generic *io, int &header_size, int &tracks, int switch (header_size) { - case 5: emu_fatalerror("jvc_format: sector attribute flag unsupported\n"); - break; + case 5: + throw emu_fatalerror("jvc_format: sector attribute flag unsupported\n"); case 4: base_sector_id = header[3]; // no break case 3: sector_size = 128 << header[2]; @@ -184,7 +184,7 @@ bool jvc_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) // safety check if (sector_count * sector_size > 10000) - emu_fatalerror("jvc_format: incorrect track layout\n"); + throw emu_fatalerror("jvc_format: incorrect track layout\n"); int file_offset = header_size; @@ -253,7 +253,7 @@ bool jvc_format::save(io_generic *io, floppy_image *image) for (int i = 0; i < 18; i++) { if (sectors[1 + i].size != 256) - emu_fatalerror("jvc_format: invalid sector size: %d\n", sectors[1 + i].size); + throw emu_fatalerror("jvc_format: invalid sector size: %d\n", sectors[1 + i].size); io_generic_write(io, sectors[1 + i].data, file_offset, sectors[1 + i].size); file_offset += sectors[1 + i].size; diff --git a/src/lib/formats/kaypro_dsk.cpp b/src/lib/formats/kaypro_dsk.cpp index e9924ce11c9..6b3996d842c 100644 --- a/src/lib/formats/kaypro_dsk.cpp +++ b/src/lib/formats/kaypro_dsk.cpp @@ -16,7 +16,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/kaypro_dsk.h" diff --git a/src/lib/formats/kc85_dsk.cpp b/src/lib/formats/kc85_dsk.cpp index 84111ff1171..0648289af71 100644 --- a/src/lib/formats/kc85_dsk.cpp +++ b/src/lib/formats/kc85_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/kc85_dsk.h" diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp index 713def9ac83..ee3d392e86f 100644 --- a/src/lib/formats/kc_cas.cpp +++ b/src/lib/formats/kc_cas.cpp @@ -13,7 +13,7 @@ ********************************************************************/ -#include <assert.h> +#include <cassert> #include "kc_cas.h" diff --git a/src/lib/formats/kim1_cas.cpp b/src/lib/formats/kim1_cas.cpp index 1bfccc7f8a0..b7853ee967e 100644 --- a/src/lib/formats/kim1_cas.cpp +++ b/src/lib/formats/kim1_cas.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -#include <assert.h> +#include <cassert> #include "kim1_cas.h" diff --git a/src/lib/formats/lviv_lvt.cpp b/src/lib/formats/lviv_lvt.cpp index 09e91eac9fd..3a94114d421 100644 --- a/src/lib/formats/lviv_lvt.cpp +++ b/src/lib/formats/lviv_lvt.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Krzysztof Strzecha /* .LVT tape images */ -#include <assert.h> +#include <cassert> #include "lviv_lvt.h" diff --git a/src/lib/formats/m5_dsk.cpp b/src/lib/formats/m5_dsk.cpp index 9652eedbb72..764dfeea6f1 100644 --- a/src/lib/formats/m5_dsk.cpp +++ b/src/lib/formats/m5_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/m5_dsk.h" diff --git a/src/lib/formats/mbee_cas.cpp b/src/lib/formats/mbee_cas.cpp index 24024f66f5d..181bca6aac0 100644 --- a/src/lib/formats/mbee_cas.cpp +++ b/src/lib/formats/mbee_cas.cpp @@ -56,7 +56,7 @@ TAP - has an ID header of TAP_DGOS_BEE or MBEE, null terminated. ********************************************************************/ -#include <assert.h> +#include <cassert> #include "mbee_cas.h" diff --git a/src/lib/formats/mfi_dsk.cpp b/src/lib/formats/mfi_dsk.cpp index b6a8a18460a..0f118ce620f 100644 --- a/src/lib/formats/mfi_dsk.cpp +++ b/src/lib/formats/mfi_dsk.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include <assert.h> +#include <cassert> #include "mfi_dsk.h" #include <zlib.h> diff --git a/src/lib/formats/mm_dsk.cpp b/src/lib/formats/mm_dsk.cpp index 0634c0e3ede..0268b46bf89 100644 --- a/src/lib/formats/mm_dsk.cpp +++ b/src/lib/formats/mm_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/mm_dsk.h" diff --git a/src/lib/formats/ms0515_dsk.cpp b/src/lib/formats/ms0515_dsk.cpp index d16e8dbbf73..c89dae8018f 100644 --- a/src/lib/formats/ms0515_dsk.cpp +++ b/src/lib/formats/ms0515_dsk.cpp @@ -10,7 +10,7 @@ #include "formats/ms0515_dsk.h" -#include <assert.h> +#include <cassert> ms0515_format::ms0515_format() : wd177x_format(formats) { diff --git a/src/lib/formats/mz_cas.cpp b/src/lib/formats/mz_cas.cpp index cfcf9f36ed8..e7af23aafb4 100644 --- a/src/lib/formats/mz_cas.cpp +++ b/src/lib/formats/mz_cas.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Nathan Woods -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "mz_cas.h" #ifndef VERBOSE diff --git a/src/lib/formats/nanos_dsk.cpp b/src/lib/formats/nanos_dsk.cpp index 1536d0677c8..ef466f024a0 100644 --- a/src/lib/formats/nanos_dsk.cpp +++ b/src/lib/formats/nanos_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/nanos_dsk.h" diff --git a/src/lib/formats/naslite_dsk.cpp b/src/lib/formats/naslite_dsk.cpp index cea109c2dc2..fdd63ca0ecc 100644 --- a/src/lib/formats/naslite_dsk.cpp +++ b/src/lib/formats/naslite_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/naslite_dsk.h" diff --git a/src/lib/formats/nes_dsk.cpp b/src/lib/formats/nes_dsk.cpp index 60dbba5dafa..dd311862ca7 100644 --- a/src/lib/formats/nes_dsk.cpp +++ b/src/lib/formats/nes_dsk.cpp @@ -9,8 +9,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "formats/nes_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/nfd_dsk.cpp b/src/lib/formats/nfd_dsk.cpp index 4d9d8fab980..e677f4ff6f5 100644 --- a/src/lib/formats/nfd_dsk.cpp +++ b/src/lib/formats/nfd_dsk.cpp @@ -77,7 +77,7 @@ *********************************************************************/ - #include <assert.h> + #include <cassert> #include "nfd_dsk.h" diff --git a/src/lib/formats/orao_cas.cpp b/src/lib/formats/orao_cas.cpp index 2d0f96b2a14..9a2ac05547e 100644 --- a/src/lib/formats/orao_cas.cpp +++ b/src/lib/formats/orao_cas.cpp @@ -5,7 +5,7 @@ Tape support for Orao TAP format */ -#include <assert.h> +#include <cassert> #include "orao_cas.h" diff --git a/src/lib/formats/oric_tap.cpp b/src/lib/formats/oric_tap.cpp index c9f84dc7c2a..dcee2f0bd2d 100644 --- a/src/lib/formats/oric_tap.cpp +++ b/src/lib/formats/oric_tap.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Kevin Thacker -#include <assert.h> +#include <cassert> #include "oric_tap.h" diff --git a/src/lib/formats/p6001_cas.cpp b/src/lib/formats/p6001_cas.cpp index 37e1ffcfa2c..3319e377b3d 100644 --- a/src/lib/formats/p6001_cas.cpp +++ b/src/lib/formats/p6001_cas.cpp @@ -4,7 +4,7 @@ * NEC PC-6001 cassette format handling */ -#include <assert.h> +#include <cassert> #include "p6001_cas.h" diff --git a/src/lib/formats/pc98_dsk.cpp b/src/lib/formats/pc98_dsk.cpp index 3d85a4380dd..1add267da8f 100644 --- a/src/lib/formats/pc98_dsk.cpp +++ b/src/lib/formats/pc98_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "formats/pc98_dsk.h" diff --git a/src/lib/formats/pc98fdi_dsk.cpp b/src/lib/formats/pc98fdi_dsk.cpp index 5b37b1ede37..37cdae18ff7 100644 --- a/src/lib/formats/pc98fdi_dsk.cpp +++ b/src/lib/formats/pc98fdi_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "pc98fdi_dsk.h" pc98fdi_format::pc98fdi_format() diff --git a/src/lib/formats/pc_dsk.cpp b/src/lib/formats/pc_dsk.cpp index e4d7e02f47d..193291c8265 100644 --- a/src/lib/formats/pc_dsk.cpp +++ b/src/lib/formats/pc_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "formats/pc_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/phc25_cas.cpp b/src/lib/formats/phc25_cas.cpp index 2cc9ea013e6..197c3db50ae 100644 --- a/src/lib/formats/phc25_cas.cpp +++ b/src/lib/formats/phc25_cas.cpp @@ -29,7 +29,7 @@ enough to make it work. ********************************************************************/ -#include <assert.h> +#include <cassert> #include "phc25_cas.h" diff --git a/src/lib/formats/pmd_cas.cpp b/src/lib/formats/pmd_cas.cpp index 79e8820b4bb..a046580bc17 100644 --- a/src/lib/formats/pmd_cas.cpp +++ b/src/lib/formats/pmd_cas.cpp @@ -10,7 +10,7 @@ ********************************************************************/ -#include <assert.h> +#include <cassert> #include "pmd_cas.h" diff --git a/src/lib/formats/ppg_dsk.cpp b/src/lib/formats/ppg_dsk.cpp index dd08a841e00..0c844a753fc 100644 --- a/src/lib/formats/ppg_dsk.cpp +++ b/src/lib/formats/ppg_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/ppg_dsk.h" diff --git a/src/lib/formats/primoptp.cpp b/src/lib/formats/primoptp.cpp index 5c6779b6613..906a08239a6 100644 --- a/src/lib/formats/primoptp.cpp +++ b/src/lib/formats/primoptp.cpp @@ -3,7 +3,7 @@ /* .PTP Microkey Primo tape images */ -#include <assert.h> +#include <cassert> #include "primoptp.h" diff --git a/src/lib/formats/pyldin_dsk.cpp b/src/lib/formats/pyldin_dsk.cpp index de43ab1947b..89a75ce5555 100644 --- a/src/lib/formats/pyldin_dsk.cpp +++ b/src/lib/formats/pyldin_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/pyldin_dsk.h" pyldin_format::pyldin_format() : upd765_format(formats) diff --git a/src/lib/formats/ql_dsk.cpp b/src/lib/formats/ql_dsk.cpp index b3ceb233218..6be088439cc 100644 --- a/src/lib/formats/ql_dsk.cpp +++ b/src/lib/formats/ql_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/ql_dsk.h" diff --git a/src/lib/formats/rk_cas.cpp b/src/lib/formats/rk_cas.cpp index 18504fcb130..b522fea2f3b 100644 --- a/src/lib/formats/rk_cas.cpp +++ b/src/lib/formats/rk_cas.cpp @@ -5,7 +5,7 @@ Tape support for RK format */ -#include <assert.h> +#include <cassert> #include "rk_cas.h" diff --git a/src/lib/formats/rx50_dsk.cpp b/src/lib/formats/rx50_dsk.cpp index a58a8c5e59c..18bac995146 100644 --- a/src/lib/formats/rx50_dsk.cpp +++ b/src/lib/formats/rx50_dsk.cpp @@ -29,7 +29,7 @@ FORMAT A: /F:160 on DOS; turn MEDIACHK ON ************************************************************************/ -#include <assert.h> +#include <cassert> #include "flopimg.h" #include "formats/rx50_dsk.h" diff --git a/src/lib/formats/sc3000_bit.cpp b/src/lib/formats/sc3000_bit.cpp index c656b54ee95..6e3600b7aeb 100644 --- a/src/lib/formats/sc3000_bit.cpp +++ b/src/lib/formats/sc3000_bit.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "sc3000_bit.h" diff --git a/src/lib/formats/sdf_dsk.cpp b/src/lib/formats/sdf_dsk.cpp index b2cd4a4e7ab..a1a0c921da7 100644 --- a/src/lib/formats/sdf_dsk.cpp +++ b/src/lib/formats/sdf_dsk.cpp @@ -12,7 +12,7 @@ *********************************************************************/ #include "sdf_dsk.h" -#include <assert.h> +#include <cassert> sdf_format::sdf_format() { diff --git a/src/lib/formats/sf7000_dsk.cpp b/src/lib/formats/sf7000_dsk.cpp index 31d0c37ab15..8e063ceba35 100644 --- a/src/lib/formats/sf7000_dsk.cpp +++ b/src/lib/formats/sf7000_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/sf7000_dsk.h" diff --git a/src/lib/formats/smx_dsk.cpp b/src/lib/formats/smx_dsk.cpp index 9158a586c13..7ddcc1ae35f 100644 --- a/src/lib/formats/smx_dsk.cpp +++ b/src/lib/formats/smx_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/smx_dsk.h" diff --git a/src/lib/formats/sol_cas.cpp b/src/lib/formats/sol_cas.cpp index ac668535b51..4672ff95080 100644 --- a/src/lib/formats/sol_cas.cpp +++ b/src/lib/formats/sol_cas.cpp @@ -34,7 +34,7 @@ SVT - The full explanation may be found on the Solace web site, ********************************************************************/ -#include <assert.h> +#include <cassert> #include "sol_cas.h" diff --git a/src/lib/formats/sorc_cas.cpp b/src/lib/formats/sorc_cas.cpp index 10fb26197f1..50585d444c7 100644 --- a/src/lib/formats/sorc_cas.cpp +++ b/src/lib/formats/sorc_cas.cpp @@ -25,7 +25,7 @@ header and leader bytes. ********************************************************************/ -#include <assert.h> +#include <cassert> #include "sorc_cas.h" diff --git a/src/lib/formats/sorc_dsk.cpp b/src/lib/formats/sorc_dsk.cpp index 7a1b734f780..35d293be3fc 100644 --- a/src/lib/formats/sorc_dsk.cpp +++ b/src/lib/formats/sorc_dsk.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "sorc_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/sord_cas.cpp b/src/lib/formats/sord_cas.cpp index bc11c388915..145cd3c3221 100644 --- a/src/lib/formats/sord_cas.cpp +++ b/src/lib/formats/sord_cas.cpp @@ -8,8 +8,8 @@ **************************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "sord_cas.h" #define SORDM5_WAVESAMPLES_HEADER 1 diff --git a/src/lib/formats/spc1000_cas.cpp b/src/lib/formats/spc1000_cas.cpp index d13021b0047..2e48980da3d 100644 --- a/src/lib/formats/spc1000_cas.cpp +++ b/src/lib/formats/spc1000_cas.cpp @@ -21,7 +21,7 @@ IPL: This seems a quickload format containing RAM dump, not a real tape ********************************************************************/ -#include <assert.h> +#include <cassert> #include "spc1000_cas.h" diff --git a/src/lib/formats/st_dsk.cpp b/src/lib/formats/st_dsk.cpp index 9808dc56ff9..36fe9a01970 100644 --- a/src/lib/formats/st_dsk.cpp +++ b/src/lib/formats/st_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/st_dsk.h" diff --git a/src/lib/formats/svi_cas.cpp b/src/lib/formats/svi_cas.cpp index c681c36d9dd..fcb2142c4e3 100644 --- a/src/lib/formats/svi_cas.cpp +++ b/src/lib/formats/svi_cas.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Sean Young -#include <assert.h> +#include <cassert> #include "svi_cas.h" diff --git a/src/lib/formats/tandy2k_dsk.cpp b/src/lib/formats/tandy2k_dsk.cpp index e08865c9493..f811483251d 100644 --- a/src/lib/formats/tandy2k_dsk.cpp +++ b/src/lib/formats/tandy2k_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/tandy2k_dsk.h" diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp index b7c418af53c..4dc3ed53cbf 100644 --- a/src/lib/formats/td0_dsk.cpp +++ b/src/lib/formats/td0_dsk.cpp @@ -14,8 +14,8 @@ * Edited and translated to English by Kenji RIKITAKE */ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "pool.h" #include "flopimg.h" diff --git a/src/lib/formats/thom_cas.cpp b/src/lib/formats/thom_cas.cpp index 45f89ac2a29..a00c2c3234b 100644 --- a/src/lib/formats/thom_cas.cpp +++ b/src/lib/formats/thom_cas.cpp @@ -8,8 +8,8 @@ **********************************************************************/ -#include <math.h> -#include <assert.h> +#include <cmath> +#include <cassert> #include "pool.h" #include "cassimg.h" diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp index c8563fc1135..d525641c29f 100644 --- a/src/lib/formats/thom_dsk.cpp +++ b/src/lib/formats/thom_dsk.cpp @@ -10,8 +10,8 @@ *********************************************************************/ -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> #include "thom_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/ti99_dsk.cpp b/src/lib/formats/ti99_dsk.cpp index b248c9dd594..a82600feaa6 100644 --- a/src/lib/formats/ti99_dsk.cpp +++ b/src/lib/formats/ti99_dsk.cpp @@ -40,9 +40,9 @@ ********************************************************************/ -#include <string.h> -#include <time.h> -#include <assert.h> +#include <cstring> +#include <ctime> +#include <cassert> #include <iomanip> #include "emu.h" // osd_printf_* (in osdcore.h) diff --git a/src/lib/formats/tiki100_dsk.cpp b/src/lib/formats/tiki100_dsk.cpp index 2258f29c47a..9dd6555c9ff 100644 --- a/src/lib/formats/tiki100_dsk.cpp +++ b/src/lib/formats/tiki100_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/tiki100_dsk.h" diff --git a/src/lib/formats/trd_dsk.cpp b/src/lib/formats/trd_dsk.cpp index 4766a3426e3..fd823e4aaba 100644 --- a/src/lib/formats/trd_dsk.cpp +++ b/src/lib/formats/trd_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/trd_dsk.h" diff --git a/src/lib/formats/trs_cas.cpp b/src/lib/formats/trs_cas.cpp index a6701ed1263..582abf8869c 100644 --- a/src/lib/formats/trs_cas.cpp +++ b/src/lib/formats/trs_cas.cpp @@ -6,7 +6,7 @@ Support for TRS80 .cas cassette images ********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/trs_cas.h" diff --git a/src/lib/formats/tvc_cas.cpp b/src/lib/formats/tvc_cas.cpp index 9177491278c..3cea37cc1bf 100644 --- a/src/lib/formats/tvc_cas.cpp +++ b/src/lib/formats/tvc_cas.cpp @@ -8,7 +8,7 @@ ********************************************************************/ -#include <assert.h> +#include <cassert> #include "tvc_cas.h" diff --git a/src/lib/formats/tvc_dsk.cpp b/src/lib/formats/tvc_dsk.cpp index 8a2254cb7cc..303a5c2c09d 100644 --- a/src/lib/formats/tvc_dsk.cpp +++ b/src/lib/formats/tvc_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/tvc_dsk.h" diff --git a/src/lib/formats/tzx_cas.cpp b/src/lib/formats/tzx_cas.cpp index 28d363df433..a4b2b30ed81 100644 --- a/src/lib/formats/tzx_cas.cpp +++ b/src/lib/formats/tzx_cas.cpp @@ -27,7 +27,7 @@ TODO: */ -#include <assert.h> +#include <cassert> #include "tzx_cas.h" #include "formats/imageutl.h" diff --git a/src/lib/formats/uef_cas.cpp b/src/lib/formats/uef_cas.cpp index 78247887eb5..d19eb9b2e47 100644 --- a/src/lib/formats/uef_cas.cpp +++ b/src/lib/formats/uef_cas.cpp @@ -18,9 +18,9 @@ Not nice, but it works... */ -#include <string.h> -#include <math.h> -#include <assert.h> +#include <cstring> +#include <cmath> +#include <cassert> #include <zlib.h> #include "uef_cas.h" diff --git a/src/lib/formats/vg5k_cas.cpp b/src/lib/formats/vg5k_cas.cpp index 898507e7139..cb8ab9636c5 100644 --- a/src/lib/formats/vg5k_cas.cpp +++ b/src/lib/formats/vg5k_cas.cpp @@ -5,7 +5,7 @@ Support for VG-5000 .k7 cassette images ********************************************************************/ -#include <assert.h> +#include <cassert> #include "vg5k_cas.h" diff --git a/src/lib/formats/vt_cas.cpp b/src/lib/formats/vt_cas.cpp index 9dbc68f8074..a8c30f8d25f 100644 --- a/src/lib/formats/vt_cas.cpp +++ b/src/lib/formats/vt_cas.cpp @@ -1,6 +1,6 @@ // license:GPL-2.0+ // copyright-holders:Juergen Buchmueller -#include <assert.h> +#include <cassert> #include "formats/vt_cas.h" diff --git a/src/lib/formats/wavfile.cpp b/src/lib/formats/wavfile.cpp index 072be6c92a2..1408984079c 100644 --- a/src/lib/formats/wavfile.cpp +++ b/src/lib/formats/wavfile.cpp @@ -8,8 +8,8 @@ *********************************************************************/ -#include <stdio.h> -#include <assert.h> +#include <cstdio> +#include <cassert> #include "wavfile.h" #include "cassimg.h" diff --git a/src/lib/formats/x07_cas.cpp b/src/lib/formats/x07_cas.cpp index b49d7c8d643..131693f2da1 100644 --- a/src/lib/formats/x07_cas.cpp +++ b/src/lib/formats/x07_cas.cpp @@ -6,7 +6,7 @@ ********************************************************************/ -#include <assert.h> +#include <cassert> #include "x07_cas.h" diff --git a/src/lib/formats/x1_tap.cpp b/src/lib/formats/x1_tap.cpp index b4fe65b8e8c..88c962bf53b 100644 --- a/src/lib/formats/x1_tap.cpp +++ b/src/lib/formats/x1_tap.cpp @@ -21,7 +21,7 @@ * */ -#include <assert.h> +#include <cassert> #include "x1_tap.h" diff --git a/src/lib/formats/xdf_dsk.cpp b/src/lib/formats/xdf_dsk.cpp index c77d685d9be..698b8799abc 100644 --- a/src/lib/formats/xdf_dsk.cpp +++ b/src/lib/formats/xdf_dsk.cpp @@ -8,7 +8,7 @@ *********************************************************************/ -#include <assert.h> +#include <cassert> #include "formats/xdf_dsk.h" diff --git a/src/lib/formats/zx81_p.cpp b/src/lib/formats/zx81_p.cpp index 9fa5814385f..709bdccfc4c 100644 --- a/src/lib/formats/zx81_p.cpp +++ b/src/lib/formats/zx81_p.cpp @@ -31,7 +31,7 @@ medium transfer rate is approx. 307 bps (38 bytes/sec) for files that contain *****************************************************************************/ -#include <assert.h> +#include <cassert> #include "zx81_p.h" #include "tzx_cas.h" diff --git a/src/lib/netlist/analog/nld_fourterm.h b/src/lib/netlist/analog/nld_fourterm.h index dcd32744263..9f0d7760c3b 100644 --- a/src/lib/netlist/analog/nld_fourterm.h +++ b/src/lib/netlist/analog/nld_fourterm.h @@ -14,14 +14,17 @@ // Macros // ---------------------------------------------------------------------------------------- -#define VCCS(name) \ - NET_REGISTER_DEV(VCCS, name) +#define VCCS(name, G) \ + NET_REGISTER_DEVEXT(VCCS, G) -#define CCCS(name) \ - NET_REGISTER_DEV(CCCS, name) +#define CCCS(name, G) \ + NET_REGISTER_DEVEXT(CCCS, name, G) -#define VCVS(name) \ - NET_REGISTER_DEV(VCVS, name) +#define VCVS(name, G) \ + NET_REGISTER_DEVEXT(VCVS, name, G) + +#define CCVS(name, G) \ + NET_REGISTER_DEVEXT(CCVS, name, G) #define LVCCS(name) \ NET_REGISTER_DEV(LVCCS, name) diff --git a/src/lib/netlist/analog/nld_generic_models.h b/src/lib/netlist/analog/nld_generic_models.h index a5d035ed32b..799c28c5a28 100644 --- a/src/lib/netlist/analog/nld_generic_models.h +++ b/src/lib/netlist/analog/nld_generic_models.h @@ -138,11 +138,9 @@ namespace analog , m_Vmin(nlconst::zero()) // not used in MOS model , m_Is(nlconst::zero()) , m_logIs(nlconst::zero()) - , m_n(nlconst::zero()) , m_gmin(nlconst::magic(1e-15)) , m_VtInv(nlconst::zero()) , m_Vcrit(nlconst::zero()) - , m_name(name) { set_param( nlconst::magic(1e-15) @@ -153,16 +151,19 @@ namespace analog void update_diode(nl_fptype nVd) noexcept { - nl_fptype IseVDVt(nlconst::zero()); - if (TYPE == diode_e::BIPOLAR) { //printf("%s: %g %g\n", m_name.c_str(), nVd, (nl_fptype) m_Vd); if (nVd > m_Vcrit) { - const nl_fptype d = std::min(+fp_constants<nl_fptype>::DIODE_MAXDIFF(), nVd - m_Vd); + // if the old voltage is less than zero and new is above + // make sure we move enough so that matrix and current + // changes. + const nl_fptype old = std::max(nlconst::zero(), m_Vd()); + const nl_fptype d = std::min(+fp_constants<nl_fptype>::DIODE_MAXDIFF(), nVd - old); const nl_fptype a = plib::abs(d) * m_VtInv; - m_Vd = m_Vd + nlconst::magic(d < 0 ? -1.0 : 1.0) * plib::log1p(a) * m_Vt; + m_Vd = old + nlconst::magic(d < 0 ? -1.0 : 1.0) * plib::log1p(a) * m_Vt; + //printf("new VD: %g\n", (nl_fptype)m_Vd); } else m_Vd = std::max(-fp_constants<nl_fptype>::DIODE_MAXDIFF(), nVd); @@ -175,7 +176,7 @@ namespace analog } else { - IseVDVt = plib::exp(m_logIs + m_Vd * m_VtInv); + const auto IseVDVt = plib::exp(m_logIs + m_Vd * m_VtInv); m_Id = IseVDVt - m_Is; m_G = IseVDVt * m_VtInv + m_gmin; } @@ -191,7 +192,7 @@ namespace analog else // log stepping should already be done in mosfet { m_Vd = nVd; - IseVDVt = plib::exp(std::min(+fp_constants<nl_fptype>::DIODE_MAXVOLT(), m_logIs + m_Vd * m_VtInv)); + const auto IseVDVt = plib::exp(std::min(+fp_constants<nl_fptype>::DIODE_MAXVOLT(), m_logIs + m_Vd * m_VtInv)); m_Id = IseVDVt - m_Is; m_G = IseVDVt * m_VtInv + m_gmin; } @@ -202,10 +203,9 @@ namespace analog { m_Is = Is; m_logIs = plib::log(Is); - m_n = n; m_gmin = gmin; - m_Vt = m_n * temp * nlconst::k_b() / nlconst::Q_e(); + m_Vt = n * temp * nlconst::k_b() / nlconst::Q_e(); m_Vmin = nlconst::magic(-5.0) * m_Vt; @@ -231,13 +231,10 @@ namespace analog nl_fptype m_Vmin; nl_fptype m_Is; nl_fptype m_logIs; - nl_fptype m_n; nl_fptype m_gmin; nl_fptype m_VtInv; nl_fptype m_Vcrit; - - pstring m_name; }; diff --git a/src/lib/netlist/analog/nld_mosfet.cpp b/src/lib/netlist/analog/nld_mosfet.cpp index fff7b8d03eb..4817f6cc00c 100644 --- a/src/lib/netlist/analog/nld_mosfet.cpp +++ b/src/lib/netlist/analog/nld_mosfet.cpp @@ -476,7 +476,11 @@ namespace analog const nl_fptype Vctrl = (is_forward ? Vgs : Vgd) - Vth; - nl_fptype Ids(0), gm(0), gds(0), gmb(0); + nl_fptype Ids(0); + nl_fptype gm(0); + nl_fptype gds(0); + nl_fptype gmb(0); + const nl_fptype absVds = plib::abs(Vds); if (Vctrl <= nlconst::zero()) diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 6a1502dab00..8af6ab28170 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -112,7 +112,7 @@ namespace netlist if (m_type < 1 || m_type > 3) { log().fatal(MF_OPAMP_UNKNOWN_TYPE(m_type)); - plib::pthrow<nl_exception>(MF_OPAMP_UNKNOWN_TYPE(m_type)); + throw nl_exception(MF_OPAMP_UNKNOWN_TYPE(m_type)); } if (m_type == 1) diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp index 9861b4fd1e5..a5d68228af1 100644 --- a/src/lib/netlist/analog/nld_switches.cpp +++ b/src/lib/netlist/analog/nld_switches.cpp @@ -108,13 +108,13 @@ namespace netlist m_R1.set_R(R_OFF); m_R2.set_R(R_ON); } - - //m_R1.update_dev(time); - //m_R2.update_dev(time); } NETLIB_UPDATE_PARAM(switch2) { + // FIXME: We only need to update the net first if this is a time stepping net + m_R1.solve_now(); + m_R2.solve_now(); if (!m_POS()) { m_R1.set_R(R_ON); @@ -125,9 +125,8 @@ namespace netlist m_R1.set_R(R_OFF); m_R2.set_R(R_ON); } - - m_R1.solve_now(); - m_R2.solve_now(); + m_R1.solve_later(); + m_R2.solve_later(); } } //namespace analog diff --git a/src/lib/netlist/analog/nlid_fourterm.cpp b/src/lib/netlist/analog/nlid_fourterm.cpp index 8b1240c7f82..0478a73fb50 100644 --- a/src/lib/netlist/analog/nlid_fourterm.cpp +++ b/src/lib/netlist/analog/nlid_fourterm.cpp @@ -108,12 +108,26 @@ NETLIB_RESET(VCVS) m_ON2.set_conductivity(m_gfac); } +// ---------------------------------------------------------------------------------------- +// nld_CCVS +// ---------------------------------------------------------------------------------------- + +NETLIB_RESET(CCVS) +{ + m_gfac = plib::reciprocal(m_RO()); + NETLIB_NAME(VCCS)::reset(); + + m_OP2.set_conductivity(m_gfac); + m_ON2.set_conductivity(m_gfac); +} + } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, VCVS, "VCVS", "") - NETLIB_DEVICE_IMPL_NS(analog, VCCS, "VCCS", "") - NETLIB_DEVICE_IMPL_NS(analog, CCCS, "CCCS", "") + NETLIB_DEVICE_IMPL_NS(analog, VCVS, "VCVS", "G") + NETLIB_DEVICE_IMPL_NS(analog, VCCS, "VCCS", "G") + NETLIB_DEVICE_IMPL_NS(analog, CCCS, "CCCS", "G") + NETLIB_DEVICE_IMPL_NS(analog, CCVS, "CCVS", "G") NETLIB_DEVICE_IMPL_NS(analog, LVCCS, "LVCCS", "") } // namespace devices } // namespace netlist diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h index c7ec2524b9b..862fe8f79e5 100644 --- a/src/lib/netlist/analog/nlid_fourterm.h +++ b/src/lib/netlist/analog/nlid_fourterm.h @@ -36,9 +36,9 @@ namespace analog { NETLIB_OBJECT(VCCS) { public: - NETLIB_CONSTRUCTOR(VCCS) + NETLIB_CONSTRUCTOR_EX(VCCS, nl_fptype ari = nlconst::magic(1e9)) , m_G(*this, "G", nlconst::one()) - , m_RI(*this, "RI", nlconst::magic(1e9)) + , m_RI(*this, "RI", ari) , m_OP(*this, "OP", &m_IP) , m_ON(*this, "ON", &m_IP) , m_IP(*this, "IP", &m_IN) // <= this should be NULL and terminal be filtered out prior to solving... @@ -126,7 +126,7 @@ namespace analog { NETLIB_OBJECT_DERIVED(CCCS, VCCS) { public: - NETLIB_CONSTRUCTOR_DERIVED(CCCS, VCCS) + NETLIB_CONSTRUCTOR_DERIVED_PASS(CCCS, VCCS, nlconst::one()) { m_gfac = plib::reciprocal(m_RI()); } @@ -191,6 +191,57 @@ namespace analog { }; + // ---------------------------------------------------------------------------------------- + // nld_CCVS + // ---------------------------------------------------------------------------------------- + + // + // Voltage controlled voltage source + // + // Parameters: + // G Default: 1 + // RO Default: 1 (would be typically 50 for an op-amp + // + // IP ---+ +--+---- OP + // | | | + // RI I RO + // RI => G => I RO V(OP) - V(ON) = (V(IP)-V(IN)) / RI * G + // RI I RO + // | | | + // IN ---+ +--+---- ON + // + // G=1 ==> 1A ==> 1V + // + // RI = 1 + // + // Internal GI = G / RO + // + + NETLIB_OBJECT_DERIVED(CCVS, VCCS) + { + public: + NETLIB_CONSTRUCTOR_DERIVED_PASS(CCVS, VCCS, nlconst::one()) + , m_RO(*this, "RO", nlconst::one()) + , m_OP2(*this, "_OP2", &m_ON2) + , m_ON2(*this, "_ON2", &m_OP2) + { + connect(m_OP2, m_OP1); + connect(m_ON2, m_ON1); + } + + NETLIB_RESETI(); + + param_fp_t m_RO; + + private: + //NETLIB_UPDATEI(); + //NETLIB_UPDATE_PARAMI(); + + terminal_t m_OP2; + terminal_t m_ON2; + }; + + } // namespace analog } // namespace netlist diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index e06a9cf275a..5aa312bc64a 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -66,6 +66,7 @@ namespace analog NETLIB_UPDATE_PARAM(POT) { + // FIXME: We only need to update the net first if this is a time stepping net m_R1.solve_now(); m_R2.solve_now(); @@ -76,6 +77,8 @@ namespace analog v = nlconst::one() - v; m_R1.set_R(std::max(m_R() * v, exec().gmin())); m_R2.set_R(std::max(m_R() * (nlconst::one() - v), exec().gmin())); + m_R1.solve_later(); + m_R2.solve_later(); } @@ -97,6 +100,7 @@ namespace analog NETLIB_UPDATE_PARAM(POT2) { + // FIXME: We only need to update the net first if this is a time stepping net m_R1.solve_now(); nl_fptype v = m_Dial(); @@ -106,6 +110,7 @@ namespace analog if (m_Reverse()) v = nlconst::one() - v; m_R1.set_R(std::max(m_R() * v, exec().gmin())); + m_R1.solve_later(); } // ---------------------------------------------------------------------------------------- diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index 396b4e938c9..d869144cbe2 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -64,7 +64,7 @@ namespace analog { plib::unused_var(d1); if (b) - plib::pthrow<nl_exception>("bselect with netlist and b==true"); + throw nl_exception("bselect with netlist and b==true"); return d2; } @@ -167,8 +167,10 @@ namespace analog NETLIB_UPDATE_PARAMI() { + // FIXME: We only need to update the net first if this is a time stepping net solve_now(); set_R(std::max(m_R(), exec().gmin())); + solve_later(); } private: @@ -283,6 +285,7 @@ namespace analog protected: //NETLIB_UPDATEI(); + //FIXME: should be able to change NETLIB_UPDATE_PARAMI() { } private: @@ -484,13 +487,15 @@ namespace analog NETLIB_UPDATE_PARAMI() { + // FIXME: We only need to update the net first if this is a time stepping net + //FIXME: works only for CS without function solve_now(); const auto zero(nlconst::zero()); set_mat(zero, zero, -m_I(), zero, zero, m_I()); + solve_later(); } - private: state_var<nl_fptype> m_t; param_fp_t m_I; diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile index cc8b62ac287..af72486c46f 100644 --- a/src/lib/netlist/build/makefile +++ b/src/lib/netlist/build/makefile @@ -14,7 +14,7 @@ VSBUILD = $(SRC)/buildVS DOC = $(SRC)/documentation TIDY_DB = ../compile_commands.json -TIDY_FLAGSX = -checks=*,-google*,-hicpp*,-readability*,-fuchsia*,cert-*,-android-*, +TIDY_FLAGSX = -checks=*,-google*,-hicpp*,readability*,-fuchsia*,cert-*,-android-*, TIDY_FLAGSX += -llvm-header-guard,-cppcoreguidelines-pro-type-reinterpret-cast, TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-owning-memory, TIDY_FLAGSX += -modernize-use-default-member-init,-cppcoreguidelines-pro-bounds-constant-array-index, @@ -25,7 +25,8 @@ TIDY_FLAGSX += -cppcoreguidelines-non-private-member-variables-in-classes,-misc- TIDY_FLAGSX += -bugprone-macro-parentheses,-misc-macro-parentheses, TIDY_FLAGSX += -bugprone-too-small-loop-variable, TIDY_FLAGSX += -modernize-use-trailing-return-type, -TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-array-to-pointer-decay +TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-array-to-pointer-decay, +TIDY_FLAGSX += -readability-magic-numbers,-readability-implicit-bool-conversion,-readability-braces-around-statements space := space += @@ -106,6 +107,7 @@ NLOBJS := \ $(NLOBJ)/devices/nld_2102A.o \ $(NLOBJ)/devices/nld_2716.o \ $(NLOBJ)/devices/nld_tms4800.o \ + $(NLOBJ)/devices/nld_4006.o \ $(NLOBJ)/devices/nld_4020.o \ $(NLOBJ)/devices/nld_4066.o \ $(NLOBJ)/devices/nld_4316.o \ diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index db57f3f8b81..6685f6231d9 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -38,6 +38,7 @@ namespace devices LIB_ENTRY(VCVS) LIB_ENTRY(VCCS) LIB_ENTRY(CCCS) + LIB_ENTRY(CCVS) LIB_ENTRY(LVCCS) LIB_ENTRY(opamp) LIB_ENTRY(nc_pin) @@ -133,6 +134,8 @@ namespace devices LIB_ENTRY(9334) LIB_ENTRY(AM2847) // FIXME: duplicate? + LIB_ENTRY(CD4006) + LIB_ENTRY(CD4006_dip) LIB_ENTRY(CD4020_WI) LIB_ENTRY(CD4020) LIB_ENTRY(CD4066_GATE) diff --git a/src/lib/netlist/devices/net_lib.h b/src/lib/netlist/devices/net_lib.h index 159d1a24c36..bae49e160f2 100644 --- a/src/lib/netlist/devices/net_lib.h +++ b/src/lib/netlist/devices/net_lib.h @@ -43,13 +43,13 @@ #else #define SOLVER(name, freq) \ - NET_REGISTER_DEV(SOLVER, name) \ - PARAM(name.FREQ, freq) + NET_REGISTER_DEVEXT(SOLVER, name, freq) #include "nld_system.h" #include "nld_2102A.h" #include "nld_2716.h" +#include "nld_4006.h" #include "nld_4020.h" #include "nld_4066.h" #include "nld_74107.h" diff --git a/src/lib/netlist/devices/nld_2716.cpp b/src/lib/netlist/devices/nld_2716.cpp index 02fbec5b4d0..8455f6f6b6e 100644 --- a/src/lib/netlist/devices/nld_2716.cpp +++ b/src/lib/netlist/devices/nld_2716.cpp @@ -83,7 +83,7 @@ namespace netlist { unsigned a = 0; for (std::size_t i=0; i<11; i++) - a |= (m_A[i]() << i); + a |= (m_A[i]() << i); d = m_ROM[a]; diff --git a/src/lib/netlist/devices/nld_4006.cpp b/src/lib/netlist/devices/nld_4006.cpp new file mode 100644 index 00000000000..7948e0b92e4 --- /dev/null +++ b/src/lib/netlist/devices/nld_4006.cpp @@ -0,0 +1,100 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * nld_4006.c + * + */ + +#include "nld_4006.h" +#include "nlid_system.h" + +namespace netlist +{ + namespace devices + { + NETLIB_OBJECT(CD4006) + { + NETLIB_CONSTRUCTOR(CD4006) + NETLIB_FAMILY("CD4XXX") + , m_CLOCK(*this, "CLOCK") + , m_I(*this, {{"D1", "D2", "D3", "D4"}}) + , m_Q(*this, {{"D1P4", "D1P4S", "D2P4", "D2P5", "D3P4", "D4P4", "D3P5"}}) + , m_d(*this, "m_d", 0) + , m_last_clock(*this, "m_last_clock", 0) + , m_supply(*this, "VDD", "VSS") + { + } + + NETLIB_RESETI() + { + } + + NETLIB_UPDATEI() + { + if (m_last_clock && !m_CLOCK()) + { + m_d[0] >>= 1; + m_d[1] >>= 1; + m_d[2] >>= 1; + m_d[3] >>= 1; + // falling, output all but D1P4S + m_Q[0].push(m_d[0] & 1, netlist_time::from_nsec(200)); + m_Q[2].push((m_d[1] >> 1) & 1, netlist_time::from_nsec(200)); // D2 + 4 + m_Q[3].push( m_d[1] & 1, netlist_time::from_nsec(200)); // D2 + 5 + m_Q[4].push( m_d[2] & 1, netlist_time::from_nsec(200)); // D3 + 4 + m_Q[5].push((m_d[3] >> 1) & 1, netlist_time::from_nsec(200)); // D4 + 4 + m_Q[6].push( m_d[3] & 1, netlist_time::from_nsec(200)); // D5 + 5 + m_last_clock = m_CLOCK(); + } + else if (!m_last_clock && m_CLOCK()) + { + // rising, output D1P4S + m_Q[1].push(m_d[0] & 1, netlist_time::from_nsec(200)); + m_last_clock = m_CLOCK(); + } + else + { + m_d[0] = static_cast<uint8_t>((m_d[0] & 0x0f) | (m_I[0]() << 4)); + m_d[1] = static_cast<uint8_t>((m_d[1] & 0x1f) | (m_I[1]() << 5)); + m_d[2] = static_cast<uint8_t>((m_d[2] & 0x0f) | (m_I[2]() << 4)); + m_d[3] = static_cast<uint8_t>((m_d[3] & 0x1f) | (m_I[3]() << 5)); + } + } + + protected: + logic_input_t m_CLOCK; + object_array_t<logic_input_t, 4> m_I; + object_array_t<logic_output_t, 7> m_Q; + state_container<std::array<uint8_t, 4>> m_d; + state_var<netlist_sig_t> m_last_clock; + nld_power_pins m_supply; + }; + + NETLIB_OBJECT_DERIVED(CD4006_dip, CD4006) + { + NETLIB_CONSTRUCTOR_DERIVED(CD4006_dip, CD4006) + { + register_subalias("1", m_I[0]); + register_subalias("2", m_Q[1]); + register_subalias("3", m_CLOCK); + register_subalias("4", m_I[1]); + register_subalias("5", m_I[2]); + register_subalias("6", m_I[3]); + register_subalias("7", "VSS"); + + register_subalias("8", m_Q[5]); + register_subalias("9", m_Q[6]); + register_subalias("10", m_Q[4]); + register_subalias("11", m_Q[2]); + register_subalias("12", m_Q[3]); + register_subalias("13", m_Q[0]); + register_subalias("14", "VDD"); + + } + }; + + NETLIB_DEVICE_IMPL(CD4006, "CD4006", "+CLOCK,+D1,+D2,+D3,+D4,+D1P4,+D1P4S,+D2P4,+D2P5,+D3P4,+D4P4,+D3P5,@VCC,@GND") + NETLIB_DEVICE_IMPL(CD4006_dip, "CD4006_DIP", "") + + } //namespace devices +} // namespace netlist diff --git a/src/lib/netlist/devices/nld_4006.h b/src/lib/netlist/devices/nld_4006.h new file mode 100644 index 00000000000..77ff7528fc8 --- /dev/null +++ b/src/lib/netlist/devices/nld_4006.h @@ -0,0 +1,50 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * nld_4006.h + * + * CD4006: CMOS 18-Stage Static Register + * + * Description + * + * CD4006BMS types are composed of 4 separate shift register sections: two + * sections of four stages and two sections of five stages with an output tap + * at the fourth stage. Each section has an independent single-rail data path. + * + * A common clock signal is used for all stages. Data are shifted to the next + * stages on negative-going transitions of the clock. Through appropriate + * connections of inputs and outputs, multiple register sections of 4, 5, 8, + * and 9 stages or single register sections of 10, 12, 13, 14, 16, 17 and 18 + * stages can be implemented using one CD4006BMS package. Longer shift register + * sections can be assembled by using more than one CD4006BMS. + * + * To facilitate cascading stages when clock rise and fall times are slow, + * an optional output (D1 + 4’) that is delayed one-half clockcycle, is + * provided. + * + * +--------------+ + * D1 |1 ++ 14| VDD + * D1+4' |2 13| D1+4 + * CLOCK |3 12| D2+5 + * D2 |4 4006 11| D2+4 + * D3 |5 10| D3+4 + * D4 |6 9| D4+5 + * VSS |7 8| D4+4 + * +--------------+ + * + * + * Naming conventions follow SYC datasheet + * + * FIXME: Timing depends on VDD-VSS + * + */ + +#ifndef NLD_4006_H_ +#define NLD_4006_H_ + +#include "netlist/nl_setup.h" + +#define CD4006(name) \ + NET_REGISTER_DEV(CD4006, name) + +#endif /* NLD_4006_H_ */ diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp index 5fae0da4434..d545b59544a 100644 --- a/src/lib/netlist/devices/nld_4020.cpp +++ b/src/lib/netlist/devices/nld_4020.cpp @@ -5,7 +5,6 @@ * */ -//#include "nlid_cmos.h" #include "nld_4020.h" #include "nlid_system.h" diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index 70e687b56bb..a45b2ab9e22 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -23,6 +23,7 @@ namespace netlist , m_R(*this, "R") , m_control(*this, "CTL") , m_base_r(*this, "BASER", nlconst::magic(270.0)) + , m_last(*this, "m_last", false) { } @@ -34,7 +35,8 @@ namespace netlist analog::NETLIB_SUB(R_base) m_R; analog_input_t m_control; - param_fp_t m_base_r; + param_fp_t m_base_r; + state_var<bool> m_last; }; NETLIB_RESET(CD4066_GATE) @@ -53,6 +55,7 @@ namespace netlist nl_fptype in = m_control() - m_supply.GND().Q_Analog(); nl_fptype rON = m_base_r() * nlconst::magic(5.0) / sup; nl_fptype R = -nlconst::one(); + bool new_state(false); if (in < low) { @@ -61,9 +64,12 @@ namespace netlist else if (in > high) { R = rON; + new_state = true; } - if (R > nlconst::zero()) + //printf("%s %f %f %g\n", name().c_str(), sup, in, R); + if (R > nlconst::zero() && (m_last != new_state)) { + m_last = new_state; m_R.update(); m_R.set_R(R); m_R.solve_later(); diff --git a/src/lib/netlist/devices/nld_7485.cpp b/src/lib/netlist/devices/nld_7485.cpp index 7cf166a807d..60cf53e8bdb 100644 --- a/src/lib/netlist/devices/nld_7485.cpp +++ b/src/lib/netlist/devices/nld_7485.cpp @@ -86,7 +86,8 @@ namespace netlist update_outputs(1, 0, 0); return; } - else if (m_A[i]() < m_B[i]()) + + if (m_A[i]() < m_B[i]()) { update_outputs(0, 1, 0); return; diff --git a/src/lib/netlist/devices/nld_7493.cpp b/src/lib/netlist/devices/nld_7493.cpp index 855bd8a3770..48c2b179073 100644 --- a/src/lib/netlist/devices/nld_7493.cpp +++ b/src/lib/netlist/devices/nld_7493.cpp @@ -131,7 +131,7 @@ namespace netlist NETLIB_HANDLERI(updB) { - auto cnt = (++m_bcd &= 0x07); + const auto cnt(++m_bcd &= 0x07); m_QD.push((cnt >> 2) & 1, out_delay3); m_QC.push((cnt >> 1) & 1, out_delay2); m_QB.push(cnt & 1, out_delay); diff --git a/src/lib/netlist/devices/nld_82S126.cpp b/src/lib/netlist/devices/nld_82S126.cpp index 9ce6697c82e..44c2152dcb5 100644 --- a/src/lib/netlist/devices/nld_82S126.cpp +++ b/src/lib/netlist/devices/nld_82S126.cpp @@ -73,7 +73,7 @@ namespace netlist { unsigned a = 0; for (std::size_t i=0; i<8; i++) - a |= (m_A[i]() << i); + a |= (m_A[i]() << i); o = m_ROM[a]; diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp index 5dd06c9beca..03165a573ef 100644 --- a/src/lib/netlist/devices/nld_log.cpp +++ b/src/lib/netlist/devices/nld_log.cpp @@ -23,7 +23,7 @@ namespace netlist , m_writer(&m_strm) { if (m_strm.fail()) - plib::pthrow<plib::file_open_e>(plib::pfmt("{1}.log")(this->name())); + throw plib::file_open_e(plib::pfmt("{1}.log")(this->name())); m_strm.imbue(std::locale::classic()); } diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp index 8f2c62d2185..361652a373a 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.cpp +++ b/src/lib/netlist/devices/nld_r2r_dac.cpp @@ -39,12 +39,13 @@ namespace netlist NETLIB_UPDATE_PARAM(r2r_dac) { + // FIXME: We only need to update the net first if this is a time stepping net solve_now(); - nl_fptype V = m_VIN() / static_cast<nl_fptype>(1 << m_num()) * static_cast<nl_fptype>(m_val()); this->set_G_V_I(plib::reciprocal(m_R()), V, nlconst::zero()); + solve_later(); } } //namespace analog diff --git a/src/lib/netlist/devices/nld_r2r_dac.h b/src/lib/netlist/devices/nld_r2r_dac.h index 8a4257a3cbf..d440f999d67 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.h +++ b/src/lib/netlist/devices/nld_r2r_dac.h @@ -49,9 +49,6 @@ #include "netlist/nl_setup.h" #define R2R_DAC(name, p_VIN, p_R, p_N) \ - NET_REGISTER_DEV(R2R_DAC, name) \ - NETDEV_PARAMI(name, VIN, p_VIN) \ - NETDEV_PARAMI(name, R, p_R) \ - NETDEV_PARAMI(name, N, p_N) + NET_REGISTER_DEVEXT(R2R_DAC, name, p_VIN, p_R, p_N) #endif /* NLD_R2R_DAC_H_ */ diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index b4483b84ad7..8d8b090c5d0 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -47,7 +47,7 @@ namespace devices NETLIB_UPDATE(extclock) { - m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off); + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off()); m_off = netlist_time::zero(); if (++m_cnt >= m_size) m_cnt = 0; diff --git a/src/lib/netlist/devices/nlid_cmos.h b/src/lib/netlist/devices/nlid_cmos.h deleted file mode 100644 index 03e6e9dd01d..00000000000 --- a/src/lib/netlist/devices/nlid_cmos.h +++ /dev/null @@ -1,41 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_cmos.h - * - */ - -#ifndef NLID_CMOS_H_ -#define NLID_CMOS_H_ - -#include "netlist/nl_base.h" -#include "netlist/nl_setup.h" - -namespace netlist -{ -namespace devices -{ - // FIXME: this needs to be removed - NETLIB_OBJECT(vdd_vss) - { - NETLIB_CONSTRUCTOR(vdd_vss) - , m_vdd(*this, "VDD") - , m_vss(*this, "VSS") - { - } - - NETLIB_UPDATEI() {} - NETLIB_RESETI() {} - - public: - nl_fptype vdd() { return m_vdd(); } - nl_fptype vss() { return m_vss(); } - - analog_input_t m_vdd; - analog_input_t m_vss; - }; - -} //namespace devices -} // namespace netlist - -#endif /* NLID_CMOS_H_ */ diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp index 92db2af4d9b..68af102232b 100644 --- a/src/lib/netlist/devices/nlid_proxy.cpp +++ b/src/lib/netlist/devices/nlid_proxy.cpp @@ -39,9 +39,9 @@ namespace netlist if (tp_ct && tp_cn) { if (tp_ct && !tp_ct->is_analog()) - plib::pthrow<nl_exception>(plib::pfmt("Not an analog terminal: {1}")(tp_ct->name())); + throw nl_exception(plib::pfmt("Not an analog terminal: {1}")(tp_ct->name())); if (tp_cn && !tp_cn->is_analog()) - plib::pthrow<nl_exception>(plib::pfmt("Not an analog terminal: {1}")(tp_cn->name())); + throw nl_exception(plib::pfmt("Not an analog terminal: {1}")(tp_cn->name())); auto tp_t = static_cast<analog_t* >(tp_ct); auto tn_t = static_cast<analog_t *>(tp_cn); diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index fcba83f3a2e..ce9970df81e 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -84,6 +84,8 @@ namespace devices , m_feedback(*this, "FB") , m_Q(*this, "Q") , m_freq(*this, "FREQ", nlconst::magic(7159000.0 * 5.0)) + , m_FAMILY(*this, "FAMILY", "FAMILY(TYPE=TTL)") + , m_supply(*this) { m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); @@ -107,7 +109,10 @@ namespace devices param_fp_t m_freq; netlist_time m_inc; - }; + + param_model_t m_FAMILY; + NETLIB_NAME(power_pins) m_supply; +}; // ----------------------------------------------------------------------------- // varclock @@ -174,8 +179,6 @@ namespace devices netlist_time::mult_type total = 0; for (unsigned i=0; i<m_size; i++) { - // FIXME: use pstonum_ne - //pati[i] = plib::pstonum<decltype(pati[i])>(pat[i]); pati[i] = plib::pstonum<std::int64_t>(pat[i]); total += pati[i]; } @@ -230,7 +233,11 @@ namespace devices NETLIB_UPDATEI() { } NETLIB_RESETI() { m_Q.initial(0); } - NETLIB_UPDATE_PARAMI() { m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); } + NETLIB_UPDATE_PARAMI() + { + //printf("%s %d\n", name().c_str(), m_IN()); + m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); + } private: logic_output_t m_Q; @@ -335,7 +342,6 @@ namespace devices private: analog::NETLIB_NAME(twoterm) m_RIN; - // Fixme: only works if the device is time-stepped - need to rework analog::NETLIB_NAME(twoterm) m_ROUT; analog_input_t m_I; analog_output_t m_Q; @@ -346,8 +352,6 @@ namespace devices // ----------------------------------------------------------------------------- // nld_function - // - // FIXME: Currently a proof of concept to get congo bongo working // ----------------------------------------------------------------------------- */ NETLIB_OBJECT(function) @@ -428,7 +432,7 @@ namespace devices const nl_fptype R = state ? m_RON() : m_ROFF(); // FIXME: We only need to update the net first if this is a time stepping net - m_R.update(); + m_R.solve_now(); m_R.set_R(R); m_R.solve_later(); } diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp index 362784aec87..b213faea082 100644 --- a/src/lib/netlist/devices/nlid_truthtable.cpp +++ b/src/lib/netlist/devices/nlid_truthtable.cpp @@ -81,8 +81,8 @@ namespace devices return ret; } - static constexpr const pbitset all_bits() noexcept { return pbitset(~static_cast<T>(0)); } - static constexpr const pbitset no_bits() noexcept{ return pbitset(static_cast<T>(0)); } + static constexpr pbitset all_bits() noexcept { return pbitset(~static_cast<T>(0)); } + static constexpr pbitset no_bits() noexcept{ return pbitset(static_cast<T>(0)); } private: T m_bs; }; @@ -162,7 +162,7 @@ namespace devices void parseline(unsigned cur, std::vector<pstring> list, tt_bitset state, std::uint_least64_t val, std::vector<uint_least8_t> &timing_index); - tt_bitset calculate_ignored_inputs(tt_bitset i) const; + tt_bitset calculate_ignored_inputs(tt_bitset state) const; unsigned m_NO; unsigned m_NI; @@ -264,7 +264,7 @@ namespace devices m_family_desc = anetlist.setup().family_from_model(m_family_name); if (m_family_desc == nullptr) - plib::pthrow<nl_exception>("family description not found for {1}", m_family_name); + throw nl_exception("family description not found for {1}", m_family_name); return pool.make_unique<tt_type>(anetlist, name, *m_family_desc, *m_ttbl, m_desc); } @@ -372,7 +372,7 @@ void truthtable_parser::parseline(unsigned cur, std::vector<pstring> list, { // cutoff previous inputs and outputs for ignore if (m_out_state[nstate] != m_out_state.mask() && m_out_state[nstate] != val) - plib::pthrow<nl_exception>(plib::pfmt("Error in truthtable: State {1:04} already set, {2} != {3}\n") + throw nl_exception(plib::pfmt("Error in truthtable: State {1:04} already set, {2} != {3}\n") .x(nstate.as_uint())(m_out_state[nstate])(val) ); m_out_state.set(nstate, val); for (std::size_t j=0; j<m_NO; j++) @@ -468,7 +468,7 @@ void truthtable_parser::parse(const std::vector<pstring> &truthtable) for (size_t i=0; i<m_size; i++) { if (m_out_state[i] == m_out_state.mask()) - plib::pthrow<nl_exception>(plib::pfmt("truthtable: found element not set {1}\n").x(i) ); + throw nl_exception(plib::pfmt("truthtable: found element not set {1}\n").x(i) ); m_out_state.set(i, m_out_state[i] | (ign[i] << m_NO)); } } diff --git a/src/lib/netlist/devices/nlid_truthtable.h b/src/lib/netlist/devices/nlid_truthtable.h index 2677ce7433a..a8143f909a8 100644 --- a/src/lib/netlist/devices/nlid_truthtable.h +++ b/src/lib/netlist/devices/nlid_truthtable.h @@ -142,7 +142,7 @@ namespace devices template<bool doOUT> void process() noexcept { - netlist_time mt(netlist_time::zero()); + netlist_time_ext mt(netlist_time_ext::zero()); type_t nstate(0); type_t ign(m_ign); diff --git a/src/lib/netlist/examples/7400_astable.c b/src/lib/netlist/examples/7400_astable.c index 07748a0816a..d20ededb6f7 100644 --- a/src/lib/netlist/examples/7400_astable.c +++ b/src/lib/netlist/examples/7400_astable.c @@ -9,27 +9,27 @@ NETLIST_START(7400_astable) - /* - * Astable multivibrator using two 7400 gates (or inverters) - * - */ - - /* Standard stuff */ - - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-5) - - // astable NAND Multivibrator ==> f ~ 1.0 / (3 * R * C) - RES(R1, 4700) - CAP(C1, 0.22e-6) - TTL_7400_NAND(n1,R1.1,R1.1) - TTL_7400_NAND(n2,R1.2,R1.2) - NET_C(n1.Q, R1.2) - NET_C(n2.Q, C1.1) - NET_C(C1.2, R1.1) - - LOG(logC12, C1.2) - LOG(logn1Q, n1.Q) - LOG(logn2Q, n2.Q) + /* + * Astable multivibrator using two 7400 gates (or inverters) + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-5) + + // astable NAND Multivibrator ==> f ~ 1.0 / (3 * R * C) + RES(R1, 4700) + CAP(C1, 0.22e-6) + TTL_7400_NAND(n1,R1.1,R1.1) + TTL_7400_NAND(n2,R1.2,R1.2) + NET_C(n1.Q, R1.2) + NET_C(n2.Q, C1.1) + NET_C(C1.2, R1.1) + + LOG(logC12, C1.2) + LOG(logn1Q, n1.Q) + LOG(logn2Q, n2.Q) NETLIST_END() diff --git a/src/lib/netlist/examples/74123_mstable.c b/src/lib/netlist/examples/74123_mstable.c index aa21f4fe215..38e3f5f2072 100644 --- a/src/lib/netlist/examples/74123_mstable.c +++ b/src/lib/netlist/examples/74123_mstable.c @@ -9,39 +9,39 @@ NETLIST_START(74123_mstable) - /* - * Monoflog - * - */ + /* + * Monoflog + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) + SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) // 5V + ANALOG_INPUT(V5, 5) // 5V - /* Wiring up the 74123 */ + /* Wiring up the 74123 */ - CLOCK(clk, 50) - TTL_74123(mf) + CLOCK(clk, 50) + TTL_74123(mf) - RES(R, 10000) - CAP(C, 1e-6) + RES(R, 10000) + CAP(C, 1e-6) - NET_C(GND, mf.GND) - NET_C(V5, mf.VCC) + NET_C(GND, mf.GND) + NET_C(V5, mf.VCC) - NET_C(C.1, mf.C) - NET_C(mf.C, GND) - NET_C(C.2, mf.RC, R.2) - NET_C(R.1, V5) + NET_C(C.1, mf.C) + NET_C(mf.C, GND) + NET_C(C.2, mf.RC, R.2) + NET_C(R.1, V5) - NET_C(mf.CLRQ, V5) - NET_C(mf.B, V5) - NET_C(mf.A, clk.Q) + NET_C(mf.CLRQ, V5) + NET_C(mf.B, V5) + NET_C(mf.A, clk.Q) - LOG(log_C, C.2) - LOG(log_Q, mf.Q) - LOG(log_X, clk.Q) + LOG(log_C, C.2) + LOG(log_Q, mf.Q) + LOG(log_X, clk.Q) NETLIST_END() diff --git a/src/lib/netlist/examples/7414.cpp b/src/lib/netlist/examples/7414.cpp index 0fcfde9a7f4..e7c01ce85d3 100644 --- a/src/lib/netlist/examples/7414.cpp +++ b/src/lib/netlist/examples/7414.cpp @@ -9,17 +9,17 @@ NETLIST_START(7414_astable) - /* - * Simple oscillator with 74LS14 - * - * ./nltool -f nl_examples/7414.cpp -l C37.1 -l U4A1.Q - * - */ + /* + * Simple oscillator with 74LS14 + * + * ./nltool -f nl_examples/7414.cpp -l C37.1 -l U4A1.Q + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-8) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-8) TTL_74LS14_GATE(U4A1) //TTL_7404_GATE(U4A1) diff --git a/src/lib/netlist/examples/9602_mstable.c b/src/lib/netlist/examples/9602_mstable.c index 8e482c8dfb3..164241886b9 100644 --- a/src/lib/netlist/examples/9602_mstable.c +++ b/src/lib/netlist/examples/9602_mstable.c @@ -9,45 +9,45 @@ NETLIST_START(74123_mstable) - /* - * Monoflog - * - */ + /* + * Monoflog + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) + SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) // 5V + ANALOG_INPUT(V5, 5) // 5V - /* Wiring up the 74123 */ + /* Wiring up the 74123 */ - CLOCK(clk, 50) - TTL_9602_DIP(mf) + CLOCK(clk, 50) + TTL_9602_DIP(mf) - RES(R, 10000) - CAP(C, 1e-6) + RES(R, 10000) + CAP(C, 1e-6) - NET_C(GND, mf.8) // - NET_C(V5, mf.16) // + NET_C(GND, mf.8) // + NET_C(V5, mf.16) // - NET_C(C.1, mf.1) - NET_C(mf.1, GND) // Test - can be removed - NET_C(C.2, mf.2, R.2) - NET_C(R.1, V5) + NET_C(C.1, mf.1) + NET_C(mf.1, GND) // Test - can be removed + NET_C(C.2, mf.2, R.2) + NET_C(R.1, V5) - NET_C(mf.3, V5) // CLR - NET_C(mf.4, GND) // B - NET_C(mf.5, clk.Q) // A + NET_C(mf.3, V5) // CLR + NET_C(mf.4, GND) // B + NET_C(mf.5, clk.Q) // A - LOG(logC, C.2) - LOG(logQ, mf.6) //Q - LOG(logX, clk.Q) + LOG(logC, C.2) + LOG(logQ, mf.6) //Q + LOG(logX, clk.Q) - // avoid non connected inputs + // avoid non connected inputs - NET_C(mf.11, V5) - NET_C(mf.12, V5) - NET_C(mf.13, V5) + NET_C(mf.11, V5) + NET_C(mf.12, V5) + NET_C(mf.13, V5) NETLIST_END() diff --git a/src/lib/netlist/examples/LM3900_test.cpp b/src/lib/netlist/examples/LM3900_test.cpp index 0498b4d2f0b..32ceb066864 100644 --- a/src/lib/netlist/examples/LM3900_test.cpp +++ b/src/lib/netlist/examples/LM3900_test.cpp @@ -20,14 +20,14 @@ NETLIST_START(main) - /* Standard stuff */ - - //VARCLOCK(clk, "0.5 / pow(10, 1 + T * 4)") - //CLOCK(clk, 1000) - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-10) - PARAM(Solver.NR_LOOPS, 300) - PARAM(Solver.DYNAMIC_TS, 1) + /* Standard stuff */ + + //VARCLOCK(clk, "0.5 / pow(10, 1 + T * 4)") + //CLOCK(clk, 1000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-10) + PARAM(Solver.NR_LOOPS, 300) + PARAM(Solver.DYNAMIC_TS, 1) PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-7) VS(vs, 0) @@ -57,47 +57,47 @@ NETLIST_START(main) PARAM(vs.R, 0.1) ALIAS(clk, vs.1) NET_C(vs.2, GND) - ANALOG_INPUT(V9, 9) - ANALOG_INPUT(V12, 12) - ANALOG_INPUT(VM12, -12) + ANALOG_INPUT(V9, 9) + ANALOG_INPUT(V12, 12) + ANALOG_INPUT(VM12, -12) - //OPAMP(op, OPAMP_TEST) + //OPAMP(op, OPAMP_TEST) LM3900(op) - NET_C(op.GND, VM12) - NET_C(op.VCC, V12) + NET_C(op.GND, VM12) + NET_C(op.VCC, V12) - /* Opamp B wired as inverting amplifier connected to output of first opamp */ + /* Opamp B wired as inverting amplifier connected to output of first opamp */ - RES(R1, 50) - RES(RP, 500000) // Set to R2 * 2 if VPlus == VCC (see datasheet) - RES(R2, 500000) + RES(R1, 50) + RES(RP, 500000) // Set to R2 * 2 if VPlus == VCC (see datasheet) + RES(R2, 500000) - NET_C(op.PLUS, RP.1) + NET_C(op.PLUS, RP.1) //NET_C(RP.2, V9) NET_C(RP.2, GND) //NET_C(RP.2, V12) - NET_C(op.MINUS, R2.2) - NET_C(op.MINUS, R1.2) + NET_C(op.MINUS, R2.2) + NET_C(op.MINUS, R1.2) CAP(C, 10e-6) NET_C(clk, C.1) - NET_C(C.2, R1.1) - NET_C(op.OUT, R2.1) + NET_C(C.2, R1.1) + NET_C(op.OUT, R2.1) CAP(CL, 10.0e-6) - RES(RL, 2000) - NET_C(RL.2, GND) - NET_C(RL.1, CL.2) + RES(RL, 2000) + NET_C(RL.2, GND) + NET_C(RL.1, CL.2) NET_C(CL.1, op.OUT) AFUNC(f, 1, "A0 * 1000") NET_C(f.A0, RL.1) #if 1 - LOG(log_Y, R1.1) - LOG(log_Z, f) + LOG(log_Y, R1.1) + LOG(log_Z, f) #endif NETLIST_END() diff --git a/src/lib/netlist/examples/bjt.c b/src/lib/netlist/examples/bjt.c index 7222ced4445..f28c070910a 100644 --- a/src/lib/netlist/examples/bjt.c +++ b/src/lib/netlist/examples/bjt.c @@ -9,38 +9,38 @@ #include "netlist/devices/net_lib.h" NETLIST_START(bjt) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) - ANALOG_INPUT(V3, 3.5) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) - /* NPN - example */ + /* NPN - example */ - QBJT_SW(Q, "BC237B") - RES(RB, 1000) - RES(RC, 1000) + QBJT_SW(Q, "BC237B") + RES(RB, 1000) + RES(RC, 1000) - NET_C(RC.1, V5) - NET_C(RC.2, Q.C) - NET_C(RB.1, clk) - NET_C(RB.2, Q.B) - NET_C(Q.E, GND) + NET_C(RC.1, V5) + NET_C(RC.2, Q.C) + NET_C(RB.1, clk) + NET_C(RB.2, Q.B) + NET_C(Q.E, GND) - /* PNP - example */ + /* PNP - example */ - QBJT_SW(Q1, "BC556B") - RES(RB1, 1000) - RES(RC1, 1000) + QBJT_SW(Q1, "BC556B") + RES(RB1, 1000) + RES(RC1, 1000) - NET_C(RC1.1, GND) - NET_C(RC1.2, Q1.C) - NET_C(RB1.1, clk) - NET_C(RB1.2, Q1.B) - NET_C(Q1.E, V3) + NET_C(RC1.1, GND) + NET_C(RC1.2, Q1.C) + NET_C(RB1.1, clk) + NET_C(RB1.2, Q1.B) + NET_C(Q1.E, V3) - LOG(logB, Q.B) - LOG(logC, Q.C) + LOG(logB, Q.B) + LOG(logC, Q.C) NETLIST_END() diff --git a/src/lib/netlist/examples/bjt_eb.c b/src/lib/netlist/examples/bjt_eb.c index f21735c36ec..a42def2df3b 100644 --- a/src/lib/netlist/examples/bjt_eb.c +++ b/src/lib/netlist/examples/bjt_eb.c @@ -10,35 +10,35 @@ #include "netlist/analog/nld_twoterm.h" NETLIST_START(bjt) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 10000) // 10000 Hz - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-6) - PARAM(Solver.RESCHED_LOOPS, 30) - ANALOG_INPUT(V5, 5) - ANALOG_INPUT(V3, 3.5) + CLOCK(clk, 10000) // 10000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + PARAM(Solver.RESCHED_LOOPS, 30) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) - /* NPN - example */ + /* NPN - example */ - QBJT_EB(Q, "BC237B") - RES(RB, 1000) - RES(RC, 1000) + QBJT_EB(Q, "BC237B") + RES(RB, 1000) + RES(RC, 1000) - NET_C(RC.1, V5) - NET_C(RC.2, Q.C) - NET_C(RB.1, clk) - //NET_C(RB.1, V3) - NET_C(RB.2, Q.B) - NET_C(Q.E, GND) + NET_C(RC.1, V5) + NET_C(RC.2, Q.C) + NET_C(RB.1, clk) + //NET_C(RB.1, V3) + NET_C(RB.2, Q.B) + NET_C(Q.E, GND) - // put some load on Q.C + // put some load on Q.C - RES(RCE, 150000) - NET_C(RCE.1, Q.C) - NET_C(RCE.2, GND) + RES(RCE, 150000) + NET_C(RCE.1, Q.C) + NET_C(RCE.2, GND) - //LOG(logB, Q.B) - //LOG(logC, Q.C) + //LOG(logB, Q.B) + //LOG(logC, Q.C) NETLIST_END() diff --git a/src/lib/netlist/examples/bjt_eb_pnp.c b/src/lib/netlist/examples/bjt_eb_pnp.c index 10169b6bd3f..7ca43466300 100644 --- a/src/lib/netlist/examples/bjt_eb_pnp.c +++ b/src/lib/netlist/examples/bjt_eb_pnp.c @@ -9,27 +9,27 @@ #include "netlist/devices/net_lib.h" NETLIST_START(bjt) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) - ANALOG_INPUT(V3, 3.5) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) - /* PNP - example */ + /* PNP - example */ - QBJT_EB(Q1, "BC556B") - RES(RB1, 1000) - RES(RC1, 1000) + QBJT_EB(Q1, "BC556B") + RES(RB1, 1000) + RES(RC1, 1000) - NET_C(RC1.1, GND) - NET_C(RC1.2, Q1.C) - NET_C(RB1.1, clk) - NET_C(RB1.2, Q1.B) - NET_C(Q1.E, V3) + NET_C(RC1.1, GND) + NET_C(RC1.2, Q1.C) + NET_C(RB1.1, clk) + NET_C(RB1.2, Q1.B) + NET_C(Q1.E, V3) - LOG(logA, clk) - LOG(logB, Q1.B) - LOG(logC, Q1.C) + LOG(logA, clk) + LOG(logB, Q1.B) + LOG(logC, Q1.C) NETLIST_END() diff --git a/src/lib/netlist/examples/breakout.c b/src/lib/netlist/examples/breakout.c index 591ffaf3414..c5919af5e5a 100644 --- a/src/lib/netlist/examples/breakout.c +++ b/src/lib/netlist/examples/breakout.c @@ -9,45 +9,45 @@ //2 555 timers static Astable555Desc b2_555_desc(OHM(560.0), M_OHM(1.8), U_FARAD(0.1)); -static Mono555Desc c9_555_desc(OHM(47.0), U_FARAD(1.0)); // R33, C21 +static Mono555Desc c9_555_desc(OHM(47.0), U_FARAD(1.0)); // R33, C21 //check these values //static Paddle1HorizontalDesc pad1_desc(15047.0, 47.0, &c9_555_desc); static CapacitorDesc c32_desc(U_FARAD(0.1)); -static CapacitorDesc c36_desc(N_FARAD(1.0)); //0.001uF = 1nF +static CapacitorDesc c36_desc(N_FARAD(1.0)); //0.001uF = 1nF static CapacitorDesc c37_desc(P_FARAD(330.0)); static BufferDesc pad_en_buf_desc(DELAY_NS(15.0), DELAY_NS(15.0)); // Prevents 12ns glitch on PAD_EN_n signal from resetting C9. TODO: is this accurate? #if 0 static VIDEO_DESC( breakout ) - VIDEO_RESISTANCE(1, K_OHM(0.0)) - VIDEO_RESISTANCE(2, K_OHM(3.9)) - VIDEO_RESISTANCE(3, K_OHM(3.9)) - VIDEO_RESISTANCE(4, K_OHM(3.9)) - VIDEO_RESISTANCE(5, K_OHM(3.9)) - VIDEO_RESISTANCE(6, K_OHM(3.9)) - //VIDEO_RESISTANCE(Video::HBLANK_PIN, K_OHM(0.0)) - VIDEO_ORIENTATION(ROTATE_90) - VIDEO_CONTRAST(4.0) - - // Values guessed based on screenshots. TODO: Make more accurate - // X, Y, W, H, R, G, B - VIDEO_OVERLAY( 15.570e-6, 0.0, 1.911e-6, -1.0, 0.80, 0.15, 0.05 ) // Red Bricks - VIDEO_OVERLAY( 17.481e-6, 0.0, 1.956e-6, -1.0, 0.95, 0.65, 0.05 ) // Amber Bricks - VIDEO_OVERLAY( 19.437e-6, 0.0, 1.956e-6, -1.0, 0.05, 0.65, 0.25 ) // Green Bricks - VIDEO_OVERLAY( 21.393e-6, 0.0, 1.955e-6, -1.0, 0.95, 0.95, 0.20 ) // Yellow Bricks - VIDEO_OVERLAY( 51.345e-6, 0.0, 1.956e-6, -1.0, 0.05, 0.65, 0.95 ) // Blue Paddle - - // TODO: Different overlays for cocktail cabinet + VIDEO_RESISTANCE(1, K_OHM(0.0)) + VIDEO_RESISTANCE(2, K_OHM(3.9)) + VIDEO_RESISTANCE(3, K_OHM(3.9)) + VIDEO_RESISTANCE(4, K_OHM(3.9)) + VIDEO_RESISTANCE(5, K_OHM(3.9)) + VIDEO_RESISTANCE(6, K_OHM(3.9)) + //VIDEO_RESISTANCE(Video::HBLANK_PIN, K_OHM(0.0)) + VIDEO_ORIENTATION(ROTATE_90) + VIDEO_CONTRAST(4.0) + + // Values guessed based on screenshots. TODO: Make more accurate + // X, Y, W, H, R, G, B + VIDEO_OVERLAY( 15.570e-6, 0.0, 1.911e-6, -1.0, 0.80, 0.15, 0.05 ) // Red Bricks + VIDEO_OVERLAY( 17.481e-6, 0.0, 1.956e-6, -1.0, 0.95, 0.65, 0.05 ) // Amber Bricks + VIDEO_OVERLAY( 19.437e-6, 0.0, 1.956e-6, -1.0, 0.05, 0.65, 0.25 ) // Green Bricks + VIDEO_OVERLAY( 21.393e-6, 0.0, 1.955e-6, -1.0, 0.95, 0.95, 0.20 ) // Yellow Bricks + VIDEO_OVERLAY( 51.345e-6, 0.0, 1.956e-6, -1.0, 0.05, 0.65, 0.95 ) // Blue Paddle + + // TODO: Different overlays for cocktail cabinet VIDEO_DESC_END static AUDIO_DESC( breakout ) - AUDIO_RESISTANCE(1, K_OHM(47.0)) - AUDIO_RESISTANCE(2, K_OHM(47.0)) - AUDIO_RESISTANCE(3, K_OHM(47.0)) - AUDIO_RESISTANCE(4, K_OHM(47.0)) - AUDIO_GAIN(3.0) + AUDIO_RESISTANCE(1, K_OHM(47.0)) + AUDIO_RESISTANCE(2, K_OHM(47.0)) + AUDIO_RESISTANCE(3, K_OHM(47.0)) + AUDIO_RESISTANCE(4, K_OHM(47.0)) + AUDIO_GAIN(3.0) VIDEO_DESC_END #endif @@ -63,26 +63,26 @@ static Dipswitch53137Desc dipswitch1_desc("bonus_credit", "Bonus Credit", 3, "No //static DipswitchDesc dipswitch4_desc("ball_count", "Ball Count", 0, "3", "5"); CIRCUIT_LAYOUT( breakout ) - CHIP("S1", 53137, &dipswitch1_desc) + CHIP("S1", 53137, &dipswitch1_desc) CHIP("S2", DIPSWITCH, &dipswitch2_desc) CHIP("S3", DIPSWITCH, &dipswitch3_desc) CHIP("S4", DIPSWITCH, &dipswitch4_desc) - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-7) // works and is sufficient - //CHIP("CLOCK", CLOCK_14_318_MHZ) - MAINCLOCK(Y1, 14318000.0) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-7) // works and is sufficient + //CHIP("CLOCK", CLOCK_14_318_MHZ) + MAINCLOCK(Y1, 14318000.0) - ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V5, 5) #define VCC "V5", Q #define GND "GND", Q - //CHIP("Y1", CLOCK_14_318_MHZ) //Y1 + //CHIP("Y1", CLOCK_14_318_MHZ) //Y1 CHIP_CAPACITOR(C32, &c32_desc) CHIP_CAPACITOR(C36, &c36_desc) - CHIP_CAPACITOR(C37, &c37_desc) - CHIP("PAD_EN_BUF", BUFFER, &pad_en_buf_desc) + CHIP_CAPACITOR(C37, &c37_desc) + CHIP("PAD_EN_BUF", BUFFER, &pad_en_buf_desc) CHIP("A3", 7474) CHIP("A4", 7408) @@ -91,7 +91,7 @@ CIRCUIT_LAYOUT( breakout ) CHIP_9602_Mono(A7, &a7_desc) CHIP_9602_Mono(A8, &a8_desc) - CHIP_555_Astable(B2, &b2_555_desc) + CHIP_555_Astable(B2, &b2_555_desc) CHIP("B3", 7402) CHIP("B4", 9316) CHIP("B5", 74193) @@ -107,7 +107,7 @@ CIRCUIT_LAYOUT( breakout ) CHIP("C6", 7486) CHIP("C7", 9316) CHIP("C8", 9316) - CHIP_555_Mono(C9, &c9_555_desc) + CHIP_555_Mono(C9, &c9_555_desc) CHIP("D2", 7432) CHIP("D3", 7474) @@ -116,7 +116,7 @@ CIRCUIT_LAYOUT( breakout ) CHIP("D6", 7408) CHIP("D7", 7411) CHIP("D8", 7400) -// CHIP("D9", 4016) //quad bilateral switch +// CHIP("D9", 4016) //quad bilateral switch CHIP("E1", 7404) CHIP("E2", 7486) @@ -144,7 +144,7 @@ CIRCUIT_LAYOUT( breakout ) CHIP("H4", 7400) CHIP("H5", 9312) CHIP("H6", 9310) - CHIP("H7", 7408) //sometimes looks like N7 on schematic + CHIP("H7", 7408) //sometimes looks like N7 on schematic CHIP("H8", 7474) CHIP("H9", 7474) @@ -165,18 +165,18 @@ CIRCUIT_LAYOUT( breakout ) CHIP("K5", 9312) CHIP("K6", 9310) CHIP("K7", 7486) - CHIP("K8", 7474) //TODO: one more than bom? + CHIP("K8", 7474) //TODO: one more than bom? CHIP("K9", 74107) CHIP("L1", 9316) CHIP("L2", 7486) - CHIP("L3", 82S16) //RAM + CHIP("L3", 82S16) //RAM CHIP("L4", 7411) CHIP("L5", 9312) CHIP("L6", 9310) CHIP("L7", 7486) CHIP("L8", 74193) - CHIP("L9", 7400) //TODO: 1 more chip than on bom? + CHIP("L9", 7400) //TODO: 1 more chip than on bom? CHIP("M1", 9316) CHIP("M2", 7483) @@ -193,232 +193,232 @@ CIRCUIT_LAYOUT( breakout ) CHIP("N4", 7411) CHIP("N5", 9312) CHIP("N6", 9310) - CHIP("N7", 7408) //sometimes looks like H7 on schematic + CHIP("N7", 7408) //sometimes looks like H7 on schematic CHIP_9602_Mono(N8, &n8_desc) CHIP("N9", 74192) - //LM380 //speaker amplifier - //LM323 //regulator + //LM380 //speaker amplifier + //LM323 //regulator // CHIP("CREDIT_LIGHT1", LAMP) // CHIP("CREDIT_LIGHT2", LAMP) // CHIP("SERVE_LIGHT", LAMP) - CHIP("PAD1", PADDLE1_HORIZONTAL_INPUT, &pad1_desc) - PADDLE_CONNECTION("PAD1", "C9") + CHIP("PAD1", PADDLE1_HORIZONTAL_INPUT, &pad1_desc) + PADDLE_CONNECTION("PAD1", "C9") - CHIP_LATCH(LATCH) - CHIP("COIN1", COIN_INPUT) + CHIP_LATCH(LATCH) + CHIP("COIN1", COIN_INPUT) - //CHIP("COIN2", COIN_INPUT) + //CHIP("COIN2", COIN_INPUT) - CHIP("START", START_INPUT) + CHIP("START", START_INPUT) - CHIP("SERVE", BUTTONS1_INPUT) + CHIP("SERVE", BUTTONS1_INPUT) - //TODO: coin2 and start 2 + //TODO: coin2 and start 2 - VIDEO(breakout) - AUDIO(breakout) + VIDEO(breakout) + AUDIO(breakout) #ifdef DEBUG CHIP("LOG1", VCD_LOG, &vcd_log_desc) #endif //HSYNC and VSYNC - #define H1_d "L1", 14 - #define H2_d "L1", 13 - #define H4_d "L1", 12 - #define H8_d "L1", 11 - #define H8_n "J2", 2 - #define H16_d "K1", 14 - #define H16_n "J2", 6 - #define H32_d "K1", 13 - #define H32_n "J2", 4 - #define H64_d "K1", 12 - #define H128_d "K1", 11 - - #define V1_d "M1", 14 - #define V2_d "M1", 13 - #define V4_d "M1", 12 - #define V8_d "M1", 11 - #define V16_d "N1", 14 - #define V16_n "J2", 10 - #define V32_d "N1", 13 - #define V64_d "N1", 12 - #define V64I "H7", 11 - #define V64_n "M9", 10 - #define V128_d "N1", 11 - - #define H1 "L2", 8 - #define H2 "L2", 11 - #define H4 "L2", 3 - #define H8 "L2", 6 - #define H16 "K2", 8 - #define H32 "K2", 11 - #define H64 "K2", 3 - #define H128 "K2", 6 + #define H1_d "L1", 14 + #define H2_d "L1", 13 + #define H4_d "L1", 12 + #define H8_d "L1", 11 + #define H8_n "J2", 2 + #define H16_d "K1", 14 + #define H16_n "J2", 6 + #define H32_d "K1", 13 + #define H32_n "J2", 4 + #define H64_d "K1", 12 + #define H128_d "K1", 11 + + #define V1_d "M1", 14 + #define V2_d "M1", 13 + #define V4_d "M1", 12 + #define V8_d "M1", 11 + #define V16_d "N1", 14 + #define V16_n "J2", 10 + #define V32_d "N1", 13 + #define V64_d "N1", 12 + #define V64I "H7", 11 + #define V64_n "M9", 10 + #define V128_d "N1", 11 + + #define H1 "L2", 8 + #define H2 "L2", 11 + #define H4 "L2", 3 + #define H8 "L2", 6 + #define H16 "K2", 8 + #define H32 "K2", 11 + #define H64 "K2", 3 + #define H128 "K2", 6 //#define V1 - #define V2 "M3", 3 - #define V4 "M3", 6 - #define V8 "M3", 11 - #define V16 "N3", 8 - #define V32 "N3", 3 - #define V64 "N3", 6 - #define V128 "N3", 11 - - #define HSYNC "J1", 2 - #define HSYNC_n "J1", 3 - #define VSYNC "J1", 7 - #define VSYNC_n "J1", 6 - #define PSYNC "J1", 11 - #define PSYNC_n "J1", 10 - #define BSYNC "J1", 15 - #define BSYNC_n "J1", 14 - - #define BALL "D7", 6 + #define V2 "M3", 3 + #define V4 "M3", 6 + #define V8 "M3", 11 + #define V16 "N3", 8 + #define V32 "N3", 3 + #define V64 "N3", 6 + #define V128 "N3", 11 + + #define HSYNC "J1", 2 + #define HSYNC_n "J1", 3 + #define VSYNC "J1", 7 + #define VSYNC_n "J1", 6 + #define PSYNC "J1", 11 + #define PSYNC_n "J1", 10 + #define BSYNC "J1", 15 + #define BSYNC_n "J1", 14 + + #define BALL "D7", 6 #define BALL_DISPLAY "A4", 6 - #define PLAYFIELD "H4", 3 - #define SCORE "D3", 5 - #define VERT_TRIG_n "H1", 8 + #define PLAYFIELD "H4", 3 + #define SCORE "D3", 5 + #define VERT_TRIG_n "H1", 8 - #define CLOCK "H1", 11 - #define SCLOCK "K1", 15 - #define CKBH "F1", 13 + #define CLOCK "H1", 11 + #define SCLOCK "K1", 15 + #define CKBH "F1", 13 - #define PAD_n "K3", 8 - #define PAD_EN_n "C2", 8 + #define PAD_n "K3", 8 + #define PAD_EN_n "C2", 8 //#define P VCC #define P "V5", Q - #define COIN "L9", 6 - #define COIN1_n "F8", 5 - #define COIN2_n "H9", 5 - #define CREDIT_1_OR_2 "L9", 3 - #define CREDIT_1_OR_2_n "F9", 8 - #define CREDIT2 "F9", 6 - #define CREDIT2_n "M8", 8 - #define CR_START1 "E8", 5 - #define CR_START1_n "E8", 6 //Schematic shows E8.6 as positive CR_START1, but this can't be right? - #define CR_START2 "E8", 9 - #define CR_START2_n "E8", 8 - #define CSW1 "F9", 12 - #define CSW2 "F9", 2 - - #define P2_CONDITIONAL "H1", 3 - #define P2_CONDITIONAL_dash "H7", 8 - #define PLAYER_2 "B4", 14 - #define PLAYER_2_n "M9", 8 - - #define START_GAME "D8", 6 - #define START_GAME1_n "M9", 4 - #define START_GAME_n "M9", 6 - - #define BG1_n "K8", 9 - #define BG1 "K8", 8 - #define BG2_n "K8", 5 - #define BG2 "K8", 6 - - #define FREE_GAME_TONE "N7", 3 - #define BONUS_COIN "L9", 11 + #define COIN "L9", 6 + #define COIN1_n "F8", 5 + #define COIN2_n "H9", 5 + #define CREDIT_1_OR_2 "L9", 3 + #define CREDIT_1_OR_2_n "F9", 8 + #define CREDIT2 "F9", 6 + #define CREDIT2_n "M8", 8 + #define CR_START1 "E8", 5 + #define CR_START1_n "E8", 6 //Schematic shows E8.6 as positive CR_START1, but this can't be right? + #define CR_START2 "E8", 9 + #define CR_START2_n "E8", 8 + #define CSW1 "F9", 12 + #define CSW2 "F9", 2 + + #define P2_CONDITIONAL "H1", 3 + #define P2_CONDITIONAL_dash "H7", 8 + #define PLAYER_2 "B4", 14 + #define PLAYER_2_n "M9", 8 + + #define START_GAME "D8", 6 + #define START_GAME1_n "M9", 4 + #define START_GAME_n "M9", 6 + + #define BG1_n "K8", 9 + #define BG1 "K8", 8 + #define BG2_n "K8", 5 + #define BG2 "K8", 6 + + #define FREE_GAME_TONE "N7", 3 + #define BONUS_COIN "L9", 11 //#define Q "E9", 6 - #define LAT_Q "E9", 6 - #define Q_n "LATCH", 3 - #define SBD_n "D2", 11 + #define LAT_Q "E9", 6 + #define Q_n "LATCH", 3 + #define SBD_n "D2", 11 - #define PLAY_CP "D2", 8 - #define PLGM2_n "F7", 7 - #define VB_HIT_n "A5", 6 + #define PLAY_CP "D2", 8 + #define PLGM2_n "F7", 7 + #define VB_HIT_n "A5", 6 - #define SERVE_n "SERVE", 1 - #define SERVE_WAIT "A3", 9 + #define SERVE_n "SERVE", 1 + #define SERVE_WAIT "A3", 9 #define SERVE_WAIT_n "A3", 8 - #define BRICK_DISPLAY "E3", 1 - #define BRICK_HIT "E6", 5 - #define BRICK_HIT_n "E6", 6 - - //#define EGL "A4", 3 - #define EGL "C37" , 2 - #define EGL_n "C5", 2 - - #define RAM_PLAYER1 "E7", 4 - #define A1 "H6", 14 - #define B1 "H6", 13 - #define C1 "H6", 12 - #define D1 "H6", 11 - #define E1 "J6", 14 - #define F1 "J6", 13 - #define G1 "J6", 12 - #define H01 "J6", 11 - #define I1 "K6", 14 - #define J1 "K6", 13 - #define K1 "K6", 12 - #define L1 "K6", 11 - #define A2 "N6", 14 - #define B2 "N6", 13 - #define C2 "N6", 12 - #define D2 "N6", 11 - #define E2 "M6", 14 - #define F2 "M6", 13 - #define G2 "M6", 12 - #define H02 "M6", 11 //TODO: better name for these signals - #define I2 "L6", 14 - #define J2 "L6", 13 - #define K2 "L6", 12 - #define L2 "L6", 11 - - #define CX0 "C6", 11 - #define CX1 "C6", 6 - #define X0 "C5", 10 - #define X1 "B6", 3 - #define X2 "C6", 3 - #define Y0 "B6", 11 - #define Y1 "B6", 6 - #define Y2 "A6", 6 - #define DN "C4", 3 - #define PC "D4", 12 - #define PD "D4", 11 - #define SU_n "D5", 8 - #define V_SLOW "C5", 8 - - #define PLNR "E3", 4 - #define SCI_n "H4", 6 - #define SFL_n "E9", 12 //score flash - #define TOP_n "E9", 2 - - #define BP_HIT_n "A5", 8 - #define BTB_HIT_n "C3", 3 - - #define SET_BRICKS "D3", 9 + #define BRICK_DISPLAY "E3", 1 + #define BRICK_HIT "E6", 5 + #define BRICK_HIT_n "E6", 6 + + //#define EGL "A4", 3 + #define EGL "C37" , 2 + #define EGL_n "C5", 2 + + #define RAM_PLAYER1 "E7", 4 + #define A1 "H6", 14 + #define B1 "H6", 13 + #define C1 "H6", 12 + #define D1 "H6", 11 + #define E1 "J6", 14 + #define F1 "J6", 13 + #define G1 "J6", 12 + #define H01 "J6", 11 + #define I1 "K6", 14 + #define J1 "K6", 13 + #define K1 "K6", 12 + #define L1 "K6", 11 + #define A2 "N6", 14 + #define B2 "N6", 13 + #define C2 "N6", 12 + #define D2 "N6", 11 + #define E2 "M6", 14 + #define F2 "M6", 13 + #define G2 "M6", 12 + #define H02 "M6", 11 //TODO: better name for these signals + #define I2 "L6", 14 + #define J2 "L6", 13 + #define K2 "L6", 12 + #define L2 "L6", 11 + + #define CX0 "C6", 11 + #define CX1 "C6", 6 + #define X0 "C5", 10 + #define X1 "B6", 3 + #define X2 "C6", 3 + #define Y0 "B6", 11 + #define Y1 "B6", 6 + #define Y2 "A6", 6 + #define DN "C4", 3 + #define PC "D4", 12 + #define PD "D4", 11 + #define SU_n "D5", 8 + #define V_SLOW "C5", 8 + + #define PLNR "E3", 4 + #define SCI_n "H4", 6 + #define SFL_n "E9", 12 //score flash + #define TOP_n "E9", 2 + + #define BP_HIT_n "A5", 8 + #define BTB_HIT_n "C3", 3 + + #define SET_BRICKS "D3", 9 #define SET_BRICKS_n "D3", 8 - #define BALL_A "B4", 13 - #define BALL_B "B4", 12 - #define BALL_C "B4", 11 + #define BALL_A "B4", 13 + #define BALL_B "B4", 12 + #define BALL_C "B4", 11 - #define FPD1 "F3", 10 - #define FPD1_n "F3", 9 - #define FPD2 "F3", 6 - #define FPD2_n "F3", 7 + #define FPD1 "F3", 10 + #define FPD1_n "F3", 9 + #define FPD2 "F3", 6 + #define FPD2_n "F3", 7 - #define COUNT "N7", 11 - #define COUNT_1 "N7", 8 - #define COUNT_2 "N7", 6 + #define COUNT "N7", 11 + #define COUNT_1 "N7", 8 + #define COUNT_2 "N7", 6 - #define ATTRACT "E6", 8 - #define ATTRACT_n "E6", 9 + #define ATTRACT "E6", 8 + #define ATTRACT_n "E6", 9 - #define BRICK_SOUND "B8", 14 - #define P_HIT_SOUND "B7", 12 + #define BRICK_SOUND "B8", 14 + #define P_HIT_SOUND "B7", 12 #define VB_HIT_SOUND "B7", 11 - #define LH_SIDE "J3", 13 - #define RH_SIDE "H2", 3 - #define TOP_BOUND "K4", 6 + #define LH_SIDE "J3", 13 + #define RH_SIDE "H2", 3 + #define TOP_BOUND "K4", 6 // CONNECTION(CREDIT_1_OR_2, "CREDIT_LIGHT1", 1) // CONNECTION(CREDIT2, "CREDIT_LIGHT2", 1) @@ -1065,7 +1065,7 @@ CIRCUIT_LAYOUT( breakout ) //COIN2 circuit //CONNECTION("COIN2", 1, "F9", 1) - CONNECTION(GND, "F9", 1) //TODO: coin2 not implemented + CONNECTION(GND, "F9", 1) //TODO: coin2 not implemented CONNECTION(CSW2, "F9", 3) CONNECTION(CSW2, "H9", 10) @@ -1132,10 +1132,10 @@ CIRCUIT_LAYOUT( breakout ) //TODO: hows this whole latch stuff work? what about Q_n going to COIN1_n and COIN2_n CONNECTION(CREDIT_1_OR_2_n, "D8", 13) CONNECTION(EGL, "D8", 12) - CONNECTION("LATCH", 1, "D8", 11) //set - CONNECTION("LATCH", 2, COIN1_n) //reset - //CONNECTION("LATCH", 3, COIN2_n) //set //TODO: coin2 here - CONNECTION( "LATCH", 3, "E9", 5) //output + CONNECTION("LATCH", 1, "D8", 11) //set + CONNECTION("LATCH", 2, COIN1_n) //reset + //CONNECTION("LATCH", 3, COIN2_n) //set //TODO: coin2 here + CONNECTION( "LATCH", 3, "E9", 5) //output CONNECTION(LAT_Q, "D6", 1) @@ -1441,21 +1441,21 @@ CIRCUIT_LAYOUT( breakout ) #ifdef DEBUG - // RAM access - /*CONNECTION("LOG1", 3, H4) //A - CONNECTION("LOG1", 4, H8) //B - CONNECTION("LOG1", 5, H16) //C - CONNECTION("LOG1", 6, V32) //D - CONNECTION("LOG1", 7, V64) //E - CONNECTION("LOG1", 8, V128) //F - CONNECTION("LOG1", 9, V16) //G - CONNECTION("LOG1", 10, RAM_PLAYER1) //H - CONNECTION("LOG1", 11, H32) //I - CONNECTION("LOG1", 12, H128) //J - CONNECTION("LOG1", 13, "H4", 8) //K - CONNECTION("LOG1", 14, "E1", 4) //L - CONNECTION("LOG1", 15, "F2", 12) //M - CONNECTION("LOG1", 16, "L3", 6)*/ //N + // RAM access + /*CONNECTION("LOG1", 3, H4) //A + CONNECTION("LOG1", 4, H8) //B + CONNECTION("LOG1", 5, H16) //C + CONNECTION("LOG1", 6, V32) //D + CONNECTION("LOG1", 7, V64) //E + CONNECTION("LOG1", 8, V128) //F + CONNECTION("LOG1", 9, V16) //G + CONNECTION("LOG1", 10, RAM_PLAYER1) //H + CONNECTION("LOG1", 11, H32) //I + CONNECTION("LOG1", 12, H128) //J + CONNECTION("LOG1", 13, "H4", 8) //K + CONNECTION("LOG1", 14, "E1", 4) //L + CONNECTION("LOG1", 15, "F2", 12) //M + CONNECTION("LOG1", 16, "L3", 6)*/ //N #endif CIRCUIT_LAYOUT_END diff --git a/src/lib/netlist/examples/cccs.c b/src/lib/netlist/examples/cccs.c index a1244677d20..2c7833b19f3 100644 --- a/src/lib/netlist/examples/cccs.c +++ b/src/lib/netlist/examples/cccs.c @@ -10,24 +10,24 @@ NETLIST_START(cccs) - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-12) - PARAM(Solver.METHOD, "MAT_CR") + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.METHOD, "MAT_CR") - CCCS(VV) - PARAM(VV.G, 1) - PARAM(VV.RI, 1e-3) + CCCS(VV) + PARAM(VV.G, 1) + PARAM(VV.RI, 1e-3) RES(R2, 1000) RES(R1, 1000) - NET_C(clk, VV.IP) - NET_C(VV.IN, R1.1) + NET_C(clk, VV.IP) + NET_C(VV.IN, R1.1) NET_C(R1.2, GND) - NET_C(R2.1, VV.OP) - NET_C(R2.2, GND) - NET_C(VV.ON, GND) + NET_C(R2.1, VV.OP) + NET_C(R2.2, GND) + NET_C(VV.ON, GND) /* Simple current source */ diff --git a/src/lib/netlist/examples/cd4066.c b/src/lib/netlist/examples/cd4066.c index c77e6438c0f..1917c1909fc 100644 --- a/src/lib/netlist/examples/cd4066.c +++ b/src/lib/netlist/examples/cd4066.c @@ -9,38 +9,38 @@ #include "netlist/devices/net_lib.h" NETLIST_START(cd4066) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V5, 5) - CD_4066_DIP(SW) - RES(R1, 1000) + CD_4066_DIP(SW) + RES(R1, 1000) - NET_C(SW.7, GND) - NET_C(SW.14, V5) + NET_C(SW.7, GND) + NET_C(SW.14, V5) - NET_C(SW.13, clk) - NET_C(SW.1, V5) + NET_C(SW.13, clk) + NET_C(SW.1, V5) - NET_C(SW.2, R1.1) - NET_C(R1.2, GND) + NET_C(SW.2, R1.1) + NET_C(R1.2, GND) - // ground anything else + // ground anything else - NET_C(SW.3, GND) - NET_C(SW.4, GND) - NET_C(SW.5, GND) - NET_C(SW.6, GND) - NET_C(SW.8, GND) - NET_C(SW.9, GND) - NET_C(SW.10, GND) - NET_C(SW.11, GND) - NET_C(SW.12, GND) + NET_C(SW.3, GND) + NET_C(SW.4, GND) + NET_C(SW.5, GND) + NET_C(SW.6, GND) + NET_C(SW.8, GND) + NET_C(SW.9, GND) + NET_C(SW.10, GND) + NET_C(SW.11, GND) + NET_C(SW.12, GND) - LOG(logB, clk) - LOG(logC, R1.1) + LOG(logB, clk) + LOG(logC, R1.1) NETLIST_END() diff --git a/src/lib/netlist/examples/cdelay.c b/src/lib/netlist/examples/cdelay.c index 5f4f8d04440..273a9fcfab7 100644 --- a/src/lib/netlist/examples/cdelay.c +++ b/src/lib/netlist/examples/cdelay.c @@ -9,11 +9,11 @@ NETLIST_START(perf) - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-20) - MAINCLOCK(clk, 50000000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-20) + MAINCLOCK(clk, 50000000) - TTL_7400_NAND(n1,clk,clk) + TTL_7400_NAND(n1,clk,clk) NETLIST_END() @@ -27,27 +27,27 @@ NETLIST_END() NETLIST_START(cap_delay) - /* - * delay circuit - * - */ + /* + * delay circuit + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, P_FREQ) - PARAM(Solver.ACCURACY, 1e-20) + SOLVER(Solver, P_FREQ) + PARAM(Solver.ACCURACY, 1e-20) PARAM(Solver.DYNAMIC_TS, P_DTS) PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-6) - CLOCK(clk, 5000) + CLOCK(clk, 5000) - TTL_7400_NAND(n1,clk,clk) - CAP(C, 1e-6) - NET_C(n1.Q, C.2) - NET_C(GND, C.1) - TTL_7400_NAND(n2,n1.Q, n1.Q) + TTL_7400_NAND(n1,clk,clk) + CAP(C, 1e-6) + NET_C(n1.Q, C.2) + NET_C(GND, C.1) + TTL_7400_NAND(n2,n1.Q, n1.Q) - LOG(logclk, clk) - LOG(logn1Q, C.2) - LOG(logn2Q, n1.Q) + LOG(logclk, clk) + LOG(logn1Q, C.2) + LOG(logn2Q, n1.Q) NETLIST_END() diff --git a/src/lib/netlist/examples/cmos_inverter.cpp b/src/lib/netlist/examples/cmos_inverter.cpp index e0936bfd3bc..02ea330cb77 100644 --- a/src/lib/netlist/examples/cmos_inverter.cpp +++ b/src/lib/netlist/examples/cmos_inverter.cpp @@ -10,19 +10,19 @@ #include "netlist/analog/nld_twoterm.h" NETLIST_START(cmos_inverter) - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-7) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-7) PARAM(Solver.NR_LOOPS, 5000) PARAM(Solver.METHOD, "MAT_CR") - ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V5, 5) VS(IN, 5) PARAM(IN.FUNC, "T 5 *") - MOSFET(P, "PMOS(VTO=-1.0 KP=2e-3 LAMBDA=2E-2)") - MOSFET(M, "NMOS(VTO=1.0 KP=2e-3 LAMBDA=2E-2)") + MOSFET(P, "PMOS(VTO=-1.0 KP=2e-3 LAMBDA=2E-2)") + MOSFET(M, "NMOS(VTO=1.0 KP=2e-3 LAMBDA=2E-2)") NET_C(P.S, V5) NET_C(P.D, M.D) @@ -36,7 +36,7 @@ NETLIST_START(cmos_inverter) NET_C(M.D, C.1) NET_C(M.S, C.2) #endif - LOG(log_G, M.G) - LOG(log_D, M.D) + LOG(log_G, M.G) + LOG(log_D, M.D) NETLIST_END() diff --git a/src/lib/netlist/examples/cmos_inverter_clk.cpp b/src/lib/netlist/examples/cmos_inverter_clk.cpp index 8b70c46e715..32dbb25a33b 100644 --- a/src/lib/netlist/examples/cmos_inverter_clk.cpp +++ b/src/lib/netlist/examples/cmos_inverter_clk.cpp @@ -12,19 +12,19 @@ #define USE_CLOCK (1) NETLIST_START(cmos_inverter_clk) - /* Standard stuff */ + /* Standard stuff */ //SOLVER(Solver, 480000) SOLVER(Solver, 1e5) //SOLVER(Solver, 100000000000) - PARAM(Solver.ACCURACY, 1e-6 ) + PARAM(Solver.ACCURACY, 1e-6 ) PARAM(Solver.NR_LOOPS, 500000) PARAM(Solver.DYNAMIC_TS, 1) PARAM(Solver.DYNAMIC_LTE, 1e-5) PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 2e-9) - ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V5, 5) -// CLOCK(clk, 0.5e6) +// CLOCK(clk, 0.5e6) #if (USE_CLOCK) CLOCK(V, 5000) @@ -35,8 +35,8 @@ NETLIST_START(cmos_inverter_clk) PARAM(V.FUNC, "T * 5e6") #endif - MOSFET(P, "PMOS(VTO=-0.5 GAMMA=0.5 TOX=20n)") - MOSFET(M, "NMOS(VTO=0.5 GAMMA=0.5 TOX=20n)") + MOSFET(P, "PMOS(VTO=-0.5 GAMMA=0.5 TOX=20n)") + MOSFET(M, "NMOS(VTO=0.5 GAMMA=0.5 TOX=20n)") RES(RG, 1) NET_C(P.S, V5) @@ -57,8 +57,8 @@ NETLIST_START(cmos_inverter_clk) NET_C(M.S, C.2) #endif #if 1 - LOG(log_G, M.G) - LOG(log_D, M.D) + LOG(log_G, M.G) + LOG(log_D, M.D) LOGD(log_X, RG.1, RG.2) #endif NETLIST_END() diff --git a/src/lib/netlist/examples/congo_bongo.c b/src/lib/netlist/examples/congo_bongo.c index 3ad52e7dced..9c5db529d6c 100644 --- a/src/lib/netlist/examples/congo_bongo.c +++ b/src/lib/netlist/examples/congo_bongo.c @@ -10,8 +10,8 @@ /* set to 1 to use optimizations increasing performance significantly */ -#define USE_OPTMIZATIONS 1 -#define USE_FRONTIERS 1 +#define USE_OPTMIZATIONS 1 +#define USE_FRONTIERS 1 /* ---------------------------------------------------------------------------- * Library section header START @@ -19,7 +19,7 @@ #ifndef __PLIB_PREPROCESSOR__ -#define LM358_DIP(_name) \ +#define LM358_DIP(_name) \ NET_REGISTER_DEV_X(LM358_DIP, _name) #define G501534_DIP(_name) \ @@ -391,8 +391,8 @@ NETLIST_START(G501534_DIP) * 12: VCC * 4: GND * 1: IN - * 3: OUT - * 13: CV + * 3: OUT + * 13: CV * 2: RDL - connected via Capacitor to ground */ diff --git a/src/lib/netlist/examples/cs.cpp b/src/lib/netlist/examples/cs.cpp index 8229c5bc032..f9b9741e0ff 100644 --- a/src/lib/netlist/examples/cs.cpp +++ b/src/lib/netlist/examples/cs.cpp @@ -10,14 +10,14 @@ NETLIST_START(cs) - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-12) - PARAM(Solver.METHOD, "MAT_CR") + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.METHOD, "MAT_CR") /* Positive current flows into pin 1 of the current source * Thus we observe a negative voltage on R1.1 ! */ - CS(CS1, 1e-3) + CS(CS1, 1e-3) RES(R1, 1000) NET_C(CS1.1, R1.1) diff --git a/src/lib/netlist/examples/diode.c b/src/lib/netlist/examples/diode.c index 9a2196c6f24..b628a18af4a 100644 --- a/src/lib/netlist/examples/diode.c +++ b/src/lib/netlist/examples/diode.c @@ -7,25 +7,25 @@ #include "netlist/devices/net_lib.h" NETLIST_START(diode) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48) - ANALOG_INPUT(V5, 5) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48) + ANALOG_INPUT(V5, 5) //DIODE(D, "1N914") - DIODE(D, "D(IS=1e-15)") + DIODE(D, "D(IS=1e-15)") - RES(R, RES_K(10)) - RES(R1, RES_K(10)) + RES(R, RES_K(10)) + RES(R1, RES_K(10)) - NET_C(clk, D.K) - NET_C(D.A, R.1) - NET_C(R.2, V5) - NET_C(R1.2, GND) - NET_C(R.1, R1.1) + NET_C(clk, D.K) + NET_C(D.A, R.1) + NET_C(R.2, V5) + NET_C(R1.2, GND) + NET_C(R.1, R1.1) - LOG(logB, clk) - LOG(logC, D.A) + LOG(logB, clk) + LOG(logC, D.A) NETLIST_END() diff --git a/src/lib/netlist/examples/kidniki.c b/src/lib/netlist/examples/kidniki.c index edbcf5ce203..b05a3b52d9f 100644 --- a/src/lib/netlist/examples/kidniki.c +++ b/src/lib/netlist/examples/kidniki.c @@ -67,7 +67,7 @@ NETLIST_START(dummy) TTL_INPUT(I_BD0, 1) //CLOCK(I_BD0, 5) TTL_INPUT(I_CH0, 1) - //CLOCK(I_CH0, 5 ) + //CLOCK(I_CH0, 5 ) //TTL_INPUT(I_OH0, 1) CLOCK(I_OH0, 5) TTL_INPUT(I_SOUNDIC0, 1) @@ -351,68 +351,68 @@ NETLIST_END() NETLIST_START(opamp) - /* Opamp model from - * - * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm - * - * Bandwidth 1Mhz - * - */ + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * Bandwidth 1Mhz + * + */ - /* Terminal definitions for calling netlists */ + /* Terminal definitions for calling netlists */ - ALIAS(PLUS, G1.IP) // Positive input - ALIAS(MINUS, G1.IN) // Negative input - ALIAS(OUT, EBUF.OP) // Opamp output ... + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G1.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... - ALIAS(GND, EBUF.ON) // GND terminal - ALIAS(VCC, DUMMY.I) // VCC terminal - DUMMY_INPUT(DUMMY) + ALIAS(GND, EBUF.ON) // GND terminal + ALIAS(VCC, DUMMY.I) // VCC terminal + DUMMY_INPUT(DUMMY) - /* The opamp model */ + /* The opamp model */ - VCCS(G1) - PARAM(G1.RI, RES_K(1000)) + VCCS(G1) + PARAM(G1.RI, RES_K(1000)) #if 1 - PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000 - RES(RP1, 1000) - CAP(CP1, 1.59e-5) // <== change to 1.59e-3 for 10Khz bandwidth + PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000 + RES(RP1, 1000) + CAP(CP1, 1.59e-5) // <== change to 1.59e-3 for 10Khz bandwidth #else - PARAM(G1.G, 1) // typical OP-AMP amplification 100 * 1000 = 100000 - RES(RP1, 100000) - CAP(CP1, 1.59e-7) // <== change to 1.59e-3 for 10Khz bandwidth + PARAM(G1.G, 1) // typical OP-AMP amplification 100 * 1000 = 100000 + RES(RP1, 100000) + CAP(CP1, 1.59e-7) // <== change to 1.59e-3 for 10Khz bandwidth #endif - VCVS(EBUF) - PARAM(EBUF.RO, 50) - PARAM(EBUF.G, 1) + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) // PARAM(EBUF.RI, 1e20) // NET_C(EBUF.ON, GND) - NET_C(G1.ON, GND) - NET_C(RP1.2, GND) - NET_C(CP1.2, GND) - NET_C(EBUF.IN, GND) + NET_C(G1.ON, GND) + NET_C(RP1.2, GND) + NET_C(CP1.2, GND) + NET_C(EBUF.IN, GND) - NET_C(RP1.1, G1.OP) - NET_C(CP1.1, RP1.1) + NET_C(RP1.1, G1.OP) + NET_C(CP1.1, RP1.1) - DIODE(DP,"1N914") - DIODE(DN,"1N914") + DIODE(DP,"1N914") + DIODE(DN,"1N914") - NET_C(DP.K, VCC) + NET_C(DP.K, VCC) #if 1 - NET_C(DP.A, DN.K, RP1.1) + NET_C(DP.A, DN.K, RP1.1) #else - RES(RDP, 1000) - RES(RDN, 1000) - NET_C(RDP.1, DP.A) - NET_C(RDN.1, DN.K) - NET_C(RDP.2, RDN.2, RP1.1) + RES(RDP, 1000) + RES(RDN, 1000) + NET_C(RDP.1, DP.A) + NET_C(RDN.1, DN.K) + NET_C(RDP.2, RDN.2, RP1.1) #endif - NET_C(DN.A, GND) + NET_C(DN.A, GND) - NET_C(EBUF.IP, RP1.1) + NET_C(EBUF.IP, RP1.1) NETLIST_END() diff --git a/src/lib/netlist/examples/mm5837_noise.c b/src/lib/netlist/examples/mm5837_noise.c index dff1966e1eb..c5237274af0 100644 --- a/src/lib/netlist/examples/mm5837_noise.c +++ b/src/lib/netlist/examples/mm5837_noise.c @@ -9,24 +9,24 @@ NETLIST_START(ne555_astable) - /* - * Astable ne555 - * - */ + /* + * Astable ne555 + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) + SOLVER(Solver, 48000) - ANALOG_INPUT(V12, 12) // 5V + ANALOG_INPUT(V12, 12) // 5V - /* Wiring up the ne555 */ + /* Wiring up the ne555 */ - // astable NE555, 1.13 ms period + // astable NE555, 1.13 ms period - MM5837_DIP(NOISE) + MM5837_DIP(NOISE) - RES(R, 10000) + RES(R, 10000) NET_C(NOISE.1, NOISE.2, R.2, GND) NET_C(NOISE.4, V12) diff --git a/src/lib/netlist/examples/msx_mixer_stage.c b/src/lib/netlist/examples/msx_mixer_stage.c index 445777eb9cf..413ad271e08 100644 --- a/src/lib/netlist/examples/msx_mixer_stage.c +++ b/src/lib/netlist/examples/msx_mixer_stage.c @@ -9,57 +9,57 @@ #include "netlist/devices/net_lib.h" NETLIST_START(msx) - /* The BJT is used as an amplifier. RESCHED_LOOPS must be relatively high to - * allow Newton-Raphson to finish. */ + /* The BJT is used as an amplifier. RESCHED_LOOPS must be relatively high to + * allow Newton-Raphson to finish. */ - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-5) - //PARAM(Solver.CONVERG, 0.3) - PARAM(Solver.GS_LOOPS, 50) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-5) + //PARAM(Solver.CONVERG, 0.3) + PARAM(Solver.GS_LOOPS, 50) - RES(RAY8910, 2345) // Max Voltage + RES(RAY8910, 2345) // Max Voltage - ANALOG_INPUT(V5, 5) - ANALOG_INPUT(V12, 12) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V12, 12) - ANALOG_INPUT(SOUND, 5) - ANALOG_INPUT(SND, 5) + ANALOG_INPUT(SOUND, 5) + ANALOG_INPUT(SND, 5) - NET_MODEL("ss9014 NPN(is=2.87599e-14 bf=377.5 vaf=123 ikf=1.1841 ise=4.7863e-15 ne=1.5 br=4.79 var=11.29 ikr=0.275423 isc=1.44544e-14 nc=1.5 rb=200 irb=1e-5 rbm=10 re=0.56 rc=5 cje=1.7205e-11 vje=0.6905907 mje=0.3193434 tf=5.89463e-10 cjc=6.2956p vjc=0.4164212 mjc=0.2559546 xcjc=0.451391 xtb=1.8881 eg=1.2415 xti=3 fc=0.5 Vceo=45 Icrating=0.1 mfg=Fairchild)") + NET_MODEL("ss9014 NPN(is=2.87599e-14 bf=377.5 vaf=123 ikf=1.1841 ise=4.7863e-15 ne=1.5 br=4.79 var=11.29 ikr=0.275423 isc=1.44544e-14 nc=1.5 rb=200 irb=1e-5 rbm=10 re=0.56 rc=5 cje=1.7205e-11 vje=0.6905907 mje=0.3193434 tf=5.89463e-10 cjc=6.2956p vjc=0.4164212 mjc=0.2559546 xcjc=0.451391 xtb=1.8881 eg=1.2415 xti=3 fc=0.5 Vceo=45 Icrating=0.1 mfg=Fairchild)") - RES(R24, RES_K(51)) - RES(R23, RES_K(5)) - RES(R21, RES_K(51)) - RES(R20, RES_K(1)) - RES(R9, RES_K(10)) - RES(R8, 330) + RES(R24, RES_K(51)) + RES(R23, RES_K(5)) + RES(R21, RES_K(51)) + RES(R20, RES_K(1)) + RES(R9, RES_K(10)) + RES(R8, 330) - CAP(C55, CAP_U(5)) // Guessed + CAP(C55, CAP_U(5)) // Guessed - //NET_C(RAY8910.1, SND) - NET_C(RAY8910.1, clk) + //NET_C(RAY8910.1, SND) + NET_C(RAY8910.1, clk) - //NET_C(C55.1, SOUND) - NET_C(C55.1, V5) - NET_C(C55.2, R24.1) - NET_C(R24.2, R23.2) - NET_C(R23.1, RAY8910.2) - NET_C(R23.1, R20.1) - NET_C(R20.2, GND) + //NET_C(C55.1, SOUND) + NET_C(C55.1, V5) + NET_C(C55.2, R24.1) + NET_C(R24.2, R23.2) + NET_C(R23.1, RAY8910.2) + NET_C(R23.1, R20.1) + NET_C(R20.2, GND) - NET_C(R21.1, V5) - NET_C(R21.2, R23.2) + NET_C(R21.1, V5) + NET_C(R21.2, R23.2) - QBJT_EB(T2, "ss9014") + QBJT_EB(T2, "ss9014") - NET_C(R9.1, V12) - NET_C(R9.2, T2.C) - NET_C(R21.2, T2.B) - NET_C(R8.1, T2.E) - NET_C(R8.2, GND) + NET_C(R9.1, V12) + NET_C(R9.2, T2.C) + NET_C(R21.2, T2.B) + NET_C(R8.1, T2.E) + NET_C(R8.2, GND) - //LOG(logB, T2.B) - LOG(logC, T2.C) + //LOG(logB, T2.B) + LOG(logC, T2.C) NETLIST_END() diff --git a/src/lib/netlist/examples/ne555_astable.c b/src/lib/netlist/examples/ne555_astable.c index 0348d3ae4d3..f71076b4e96 100644 --- a/src/lib/netlist/examples/ne555_astable.c +++ b/src/lib/netlist/examples/ne555_astable.c @@ -11,43 +11,43 @@ NETLIST_START(ne555_astable) - /* - * Astable ne555 - * - */ + /* + * Astable ne555 + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) + SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) // 5V + ANALOG_INPUT(V5, 5) // 5V - /* Wiring up the ne555 */ + /* Wiring up the ne555 */ - // astable NE555, 1.13 ms period + // astable NE555, 1.13 ms period - RES(RA, 5000) - RES(RB, 3000) - CAP(C, 0.15e-6) - NE555(555) + RES(RA, 5000) + RES(RB, 3000) + CAP(C, 0.15e-6) + NE555(555) - NET_C(GND, 555.GND) - NET_C(V5, 555.VCC) - NET_C(V5, 555.RESET) + NET_C(GND, 555.GND) + NET_C(V5, 555.VCC) + NET_C(V5, 555.RESET) - NET_C(RA.1, 555.VCC) - NET_C(RA.2, 555.DISCH) + NET_C(RA.1, 555.VCC) + NET_C(RA.2, 555.DISCH) - NET_C(RB.1, 555.DISCH) - NET_C(RB.2, 555.TRIG) + NET_C(RB.1, 555.DISCH) + NET_C(RB.2, 555.TRIG) - NET_C(RB.2, 555.THRESH) + NET_C(RB.2, 555.THRESH) - NET_C(555.TRIG, C.1) - NET_C(C.2, GND) + NET_C(555.TRIG, C.1) + NET_C(C.2, GND) - LOG(log2, C.1) - LOG(log3, 555.OUT) + LOG(log2, C.1) + LOG(log3, 555.OUT) NETLIST_END() //! [ne555_example] diff --git a/src/lib/netlist/examples/nmos_fet.cpp b/src/lib/netlist/examples/nmos_fet.cpp index 53c6b4a6fc9..5bec1a97411 100644 --- a/src/lib/netlist/examples/nmos_fet.cpp +++ b/src/lib/netlist/examples/nmos_fet.cpp @@ -10,37 +10,37 @@ #include "netlist/analog/nld_twoterm.h" NETLIST_START(nmos) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 100) // 100 Hz - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-9) + CLOCK(clk, 100) // 100 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-9) PARAM(Solver.NR_LOOPS, 50000) PARAM(Solver.DYNAMIC_TS, 1) PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-9) - ANALOG_INPUT(V5, 5) - ANALOG_INPUT(V3, 3.5) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) - /* NMOS - example */ + /* NMOS - example */ NET_MODEL("MM NMOS(VTO=1.0 KP=2e-3 LAMBDA=2E-2)") - MOSFET(M, "MM") + MOSFET(M, "MM") - RES(RB, 1000) - RES(RC, 10000) + RES(RB, 1000) + RES(RC, 10000) - NET_C(RC.1, V5) - NET_C(RC.2, M.D) - NET_C(RB.1, clk) - //NET_C(RB.1, V3) - NET_C(RB.2, M.G) - NET_C(M.S, GND) + NET_C(RC.1, V5) + NET_C(RC.2, M.D) + NET_C(RB.1, clk) + //NET_C(RB.1, V3) + NET_C(RB.2, M.G) + NET_C(M.S, GND) - // put some load on M.D + // put some load on M.D - RES(RCE, 150000) - NET_C(RCE.1, M.D) - NET_C(RCE.2, GND) + RES(RCE, 150000) + NET_C(RCE.1, M.D) + NET_C(RCE.2, GND) // capacitance over G - S @@ -48,7 +48,7 @@ NETLIST_START(nmos) NET_C(M.D, C.1) NET_C(M.S, C.2) - LOG(log_G, M.G) - LOG(log_D, M.D) + LOG(log_G, M.G) + LOG(log_D, M.D) NETLIST_END() diff --git a/src/lib/netlist/examples/norton_opamp.c b/src/lib/netlist/examples/norton_opamp.c index 8e077a91df2..a6cf52ce152 100644 --- a/src/lib/netlist/examples/norton_opamp.c +++ b/src/lib/netlist/examples/norton_opamp.c @@ -8,119 +8,119 @@ NETLIST_START(main) - /* Standard stuff */ - - CLOCK(clk, 10000) // 1000 Hz - SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) - PARAM(Solver.ACCURACY, 1e-6) - PARAM(Solver.DYNAMIC_TS, 0) - PARAM(Solver.SOR_FACTOR, 1.0) - //PARAM(Solver.CONVERG, 1.0) - PARAM(Solver.GS_LOOPS, 5) - - SUBMODEL(op1, opamp_fast) - /* Wired as non - inverting amplifier like in LM3900 datasheet */ - - RES(R1, 25000) - RES(R2, 100000) - RES(R3, 200000) - CAP(C1, CAP_U(0.05)) - - NET_C(clk, C1.1) - NET_C(C1.2, R1.1) - - NET_C(op1.VM, GND) - NET_C(op1.VP, V5 ) - NET_C(op1.PLUS, R1.2, R3.1) - NET_C(R3.2, V5) - //NET_C(R3.2, GND) - NET_C(op1.MINUS, R2.2) - NET_C(op1.OUT, R2.1) - - RES(RL, 10000) - NET_C(RL.2, GND) - NET_C(RL.1, op1.OUT) - - LOG(logX, op1.OUT) - LOG(logY, clk) + /* Standard stuff */ + + CLOCK(clk, 10000) // 1000 Hz + SOLVER(Solver, 48000) + ANALOG_INPUT(V5, 5) + PARAM(Solver.ACCURACY, 1e-6) + PARAM(Solver.DYNAMIC_TS, 0) + PARAM(Solver.SOR_FACTOR, 1.0) + //PARAM(Solver.CONVERG, 1.0) + PARAM(Solver.GS_LOOPS, 5) + + SUBMODEL(op1, opamp_fast) + /* Wired as non - inverting amplifier like in LM3900 datasheet */ + + RES(R1, 25000) + RES(R2, 100000) + RES(R3, 200000) + CAP(C1, CAP_U(0.05)) + + NET_C(clk, C1.1) + NET_C(C1.2, R1.1) + + NET_C(op1.VM, GND) + NET_C(op1.VP, V5 ) + NET_C(op1.PLUS, R1.2, R3.1) + NET_C(R3.2, V5) + //NET_C(R3.2, GND) + NET_C(op1.MINUS, R2.2) + NET_C(op1.OUT, R2.1) + + RES(RL, 10000) + NET_C(RL.2, GND) + NET_C(RL.1, op1.OUT) + + LOG(logX, op1.OUT) + LOG(logY, clk) NETLIST_END() NETLIST_START(opamp) - /* Opamp model from - * - * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm - * - * Bandwidth 10Mhz - * - */ - - /* Terminal definitions for calling netlists */ - - ALIAS(PLUS, G1.IP) // Positive input - ALIAS(MINUS, G2.IN) // Negative input - ALIAS(OUT, EBUF.OP) // Opamp output ... - ALIAS(VM, EBUF.ON) // V- terminal - ALIAS(VP, DUMMY.I) // V+ terminal - - DUMMY_INPUT(DUMMY) - - /* The opamp model */ - - CCCS(G1) - CCCS(G2) - //PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000 - PARAM(G1.G, 1000000) // typical OP-AMP amplification 100 * 1000 = 100000 - PARAM(G2.G, 1000000) // typical OP-AMP amplification 100 * 1000 = 100000 - RES(RP1, 1000) - CAP(CP1, 1.59e-6) // <== change to 1.59e-3 for 10Khz bandwidth - VCVS(EBUF) - PARAM(EBUF.RO, 50) - PARAM(EBUF.G, 1) + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * Bandwidth 10Mhz + * + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G2.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... + ALIAS(VM, EBUF.ON) // V- terminal + ALIAS(VP, DUMMY.I) // V+ terminal + + DUMMY_INPUT(DUMMY) + + /* The opamp model */ + + CCCS(G1) + CCCS(G2) + //PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000 + PARAM(G1.G, 1000000) // typical OP-AMP amplification 100 * 1000 = 100000 + PARAM(G2.G, 1000000) // typical OP-AMP amplification 100 * 1000 = 100000 + RES(RP1, 1000) + CAP(CP1, 1.59e-6) // <== change to 1.59e-3 for 10Khz bandwidth + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) // NET_C(EBUF.ON, GND) - NET_C(G1.ON, GND) - NET_C(G2.ON, GND) - NET_C(RP1.2, GND) - NET_C(CP1.2, GND) - NET_C(EBUF.IN, GND) + NET_C(G1.ON, GND) + NET_C(G2.ON, GND) + NET_C(RP1.2, GND) + NET_C(CP1.2, GND) + NET_C(EBUF.IN, GND) - NET_C(G1.IN, G2.IP, GND) + NET_C(G1.IN, G2.IP, GND) - NET_C(RP1.1, G1.OP) - NET_C(RP1.1, G2.OP) - NET_C(CP1.1, RP1.1) - NET_C(EBUF.IP, RP1.1) + NET_C(RP1.1, G1.OP) + NET_C(RP1.1, G2.OP) + NET_C(CP1.1, RP1.1) + NET_C(EBUF.IP, RP1.1) NETLIST_END() NETLIST_START(opamp_fast) - /* - * Fast norton opamp model without bandwidth - */ + /* + * Fast norton opamp model without bandwidth + */ - /* Terminal definitions for calling netlists */ + /* Terminal definitions for calling netlists */ - ALIAS(PLUS, R1.1) // Positive input - ALIAS(MINUS, R2.1) // Negative input - ALIAS(OUT, G1.OP) // Opamp output ... - ALIAS(VM, G1.ON) // V- terminal - ALIAS(VP, DUMMY.I) // V+ terminal + ALIAS(PLUS, R1.1) // Positive input + ALIAS(MINUS, R2.1) // Negative input + ALIAS(OUT, G1.OP) // Opamp output ... + ALIAS(VM, G1.ON) // V- terminal + ALIAS(VP, DUMMY.I) // V+ terminal - DUMMY_INPUT(DUMMY) + DUMMY_INPUT(DUMMY) - /* The opamp model */ + /* The opamp model */ - RES(R1, 1) - RES(R2, 1) - NET_C(R1.1, G1.IP) - NET_C(R2.1, G1.IN) - NET_C(R1.2, R2.2, G1.ON) - VCVS(G1) - PARAM(G1.G, 1000000) - PARAM(G1.RO, RES_K(8)) + RES(R1, 1) + RES(R2, 1) + NET_C(R1.1, G1.IP) + NET_C(R2.1, G1.IN) + NET_C(R1.2, R2.2, G1.ON) + VCVS(G1) + PARAM(G1.G, 1000000) + PARAM(G1.RO, RES_K(8)) NETLIST_END() diff --git a/src/lib/netlist/examples/opamp.c b/src/lib/netlist/examples/opamp.c index b13d92dab67..b3730b29b51 100644 --- a/src/lib/netlist/examples/opamp.c +++ b/src/lib/netlist/examples/opamp.c @@ -10,91 +10,91 @@ NETLIST_START(main) - /* Standard stuff */ + /* Standard stuff */ - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 480000) - PARAM(Solver.ACCURACY, 1e-10) - PARAM(Solver.NR_LOOPS, 30000 ) - //PARAM(Solver.CONVERG, 1.0) - PARAM(Solver.GS_LOOPS, 30) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 480000) + PARAM(Solver.ACCURACY, 1e-10) + PARAM(Solver.NR_LOOPS, 30000 ) + //PARAM(Solver.CONVERG, 1.0) + PARAM(Solver.GS_LOOPS, 30) - // Tie up +5 to opamps thought it's not currently needed - // Stay compatible - ANALOG_INPUT(V5, 5) - NET_C(op.VCC, V5) - NET_C(op1.VCC, V5) + // Tie up +5 to opamps thought it's not currently needed + // Stay compatible + ANALOG_INPUT(V5, 5) + NET_C(op.VCC, V5) + NET_C(op1.VCC, V5) - /* Opamp wired as impedance changer */ - SUBMODEL(opamp, op) + /* Opamp wired as impedance changer */ + SUBMODEL(opamp, op) - NET_C(op.GND, GND) - NET_C(op.PLUS, clk) - NET_C(op.MINUS, op.OUT) + NET_C(op.GND, GND) + NET_C(op.PLUS, clk) + NET_C(op.MINUS, op.OUT) - SUBMODEL(opamp, op1) - /* Wired as inverting amplifier connected to output of first opamp */ + SUBMODEL(opamp, op1) + /* Wired as inverting amplifier connected to output of first opamp */ - RES(R1, 100000) - RES(R2, 200000) + RES(R1, 100000) + RES(R2, 200000) - NET_C(op1.GND, GND) - NET_C(op1.PLUS, GND) - NET_C(op1.MINUS, R2.2) - NET_C(op1.MINUS, R1.2) + NET_C(op1.GND, GND) + NET_C(op1.PLUS, GND) + NET_C(op1.MINUS, R2.2) + NET_C(op1.MINUS, R1.2) - NET_C(op.OUT, R1.1) - NET_C(op1.OUT, R2.1) + NET_C(op.OUT, R1.1) + NET_C(op1.OUT, R2.1) - RES(RL, 1000) - NET_C(RL.2, GND) - NET_C(RL.1, op1.OUT) + RES(RL, 1000) + NET_C(RL.2, GND) + NET_C(RL.1, op1.OUT) - LOG(log_X, op1.OUT) - LOG(log_Y, clk) + LOG(log_X, op1.OUT) + LOG(log_Y, clk) NETLIST_END() NETLIST_START(opamp) - /* Opamp model from - * - * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm - * - * Bandwidth 10Mhz - * - */ + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * Bandwidth 10Mhz + * + */ - /* Terminal definitions for calling netlists */ + /* Terminal definitions for calling netlists */ - ALIAS(PLUS, G1.IP) // Positive input - ALIAS(MINUS, G1.IN) // Negative input - ALIAS(OUT, EBUF.OP) // Opamp output ... + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G1.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... - ALIAS(GND, EBUF.ON) // GND terminal - ALIAS(VCC, DUMMY.I) // VCC terminal - DUMMY_INPUT(DUMMY) + ALIAS(GND, EBUF.ON) // GND terminal + ALIAS(VCC, DUMMY.I) // VCC terminal + DUMMY_INPUT(DUMMY) - /* The opamp model */ + /* The opamp model */ - LVCCS(G1) - PARAM(G1.G, 0.0021) + LVCCS(G1) + PARAM(G1.G, 0.0021) PARAM(G1.CURLIM, 0.002) - RES(RP1, 1e7) - CAP(CP1, 0.00333e-6) - VCVS(EBUF) - PARAM(EBUF.RO, 50) - PARAM(EBUF.G, 1) + RES(RP1, 1e7) + CAP(CP1, 0.00333e-6) + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) // NET_C(EBUF.ON, GND) - NET_C(G1.ON, GND) - NET_C(RP1.2, GND) - NET_C(CP1.2, GND) - NET_C(EBUF.IN, GND) + NET_C(G1.ON, GND) + NET_C(RP1.2, GND) + NET_C(CP1.2, GND) + NET_C(EBUF.IN, GND) - NET_C(RP1.1, G1.OP) - NET_C(CP1.1, RP1.1) - NET_C(EBUF.IP, RP1.1) + NET_C(RP1.1, G1.OP) + NET_C(CP1.1, RP1.1) + NET_C(EBUF.IP, RP1.1) NETLIST_END() @@ -110,12 +110,12 @@ NETLIST_START(opamp_mod) * * Simple Opamp Model Calculation * - * First Pole Frequency 5 Hz - * Unity Gain Frequency 11,000 Hz - * RP 100,000 Ohm - * DC Gain / Aol 2200 - * CP 0.318 uF - * KG 0.022 + * First Pole Frequency 5 Hz + * Unity Gain Frequency 11,000 Hz + * RP 100,000 Ohm + * DC Gain / Aol 2200 + * CP 0.318 uF + * KG 0.022 * */ diff --git a/src/lib/netlist/examples/opamp_amplification_curve.cpp b/src/lib/netlist/examples/opamp_amplification_curve.cpp index e1665244b0e..ed5d1709985 100644 --- a/src/lib/netlist/examples/opamp_amplification_curve.cpp +++ b/src/lib/netlist/examples/opamp_amplification_curve.cpp @@ -22,14 +22,14 @@ NETLIST_START(main) - /* Standard stuff */ - - //VARCLOCK(clk, "0.5 / pow(10, 1 + T * 4)") - //CLOCK(clk, 1000) - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-7) - PARAM(Solver.NR_LOOPS, 300) - PARAM(Solver.DYNAMIC_TS, 1) + /* Standard stuff */ + + //VARCLOCK(clk, "0.5 / pow(10, 1 + T * 4)") + //CLOCK(clk, 1000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-7) + PARAM(Solver.NR_LOOPS, 300) + PARAM(Solver.DYNAMIC_TS, 1) PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-7) VS(vs, 0) @@ -59,36 +59,36 @@ NETLIST_START(main) PARAM(vs.R, 0.001) ALIAS(clk, vs.1) NET_C(vs.2, GND) - ANALOG_INPUT(V12, 12) - ANALOG_INPUT(VM12, -12) + ANALOG_INPUT(V12, 12) + ANALOG_INPUT(VM12, -12) - OPAMP(op, OPAMP_TEST) + OPAMP(op, OPAMP_TEST) - NET_C(op.GND, VM12) - NET_C(op.VCC, V12) + NET_C(op.GND, VM12) + NET_C(op.VCC, V12) - /* Opamp B wired as inverting amplifier connected to output of first opamp */ + /* Opamp B wired as inverting amplifier connected to output of first opamp */ - RES(R1, 100) - RES(RP, 100) - RES(R2, 10000000) + RES(R1, 100) + RES(RP, 100) + RES(R2, 10000000) - NET_C(op.PLUS, RP.1) + NET_C(op.PLUS, RP.1) NET_C(RP.2, GND) - NET_C(op.MINUS, R2.2) - NET_C(op.MINUS, R1.2) + NET_C(op.MINUS, R2.2) + NET_C(op.MINUS, R1.2) - NET_C(clk, R1.1) - NET_C(op.OUT, R2.1) + NET_C(clk, R1.1) + NET_C(op.OUT, R2.1) - RES(RL, 2000) - NET_C(RL.2, GND) - NET_C(RL.1, op.OUT) + RES(RL, 2000) + NET_C(RL.2, GND) + NET_C(RL.1, op.OUT) AFUNC(f, 1, "A0 * 1000") NET_C(f.A0, op.OUT) #if 1 - LOG(log_Y, R1.1) - LOG(log_Z, f) + LOG(log_Y, R1.1) + LOG(log_Z, f) #endif NETLIST_END() diff --git a/src/lib/netlist/examples/rc.c b/src/lib/netlist/examples/rc.c index 1850da313da..140440011b9 100644 --- a/src/lib/netlist/examples/rc.c +++ b/src/lib/netlist/examples/rc.c @@ -7,25 +7,25 @@ NETLIST_START(rc) - /* - * delay circuit - * - */ + /* + * delay circuit + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-6) - CLOCK(clk, 20000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + CLOCK(clk, 20000) - CAP(C1, 0.022e-6) - RES(R1, 10000) - RES(R2, 20000) + CAP(C1, 0.022e-6) + RES(R1, 10000) + RES(R2, 20000) - NET_C(clk, R2.1) - NET_C(R2.2, R1.1, C1.1) - NET_C(C1.2, R1.2, GND) + NET_C(clk, R2.1) + NET_C(R2.2, R1.1, C1.1) + NET_C(C1.2, R1.2, GND) - LOG(tt, C1.1) + LOG(tt, C1.1) NETLIST_END() diff --git a/src/lib/netlist/examples/rl.c b/src/lib/netlist/examples/rl.c index 2848348c440..b9f4e4e64c0 100644 --- a/src/lib/netlist/examples/rl.c +++ b/src/lib/netlist/examples/rl.c @@ -7,26 +7,26 @@ NETLIST_START(lr) - /* - * delay circuit - * - */ + /* + * delay circuit + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-6) - CLOCK(clk, 50) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + CLOCK(clk, 50) PARAM(Solver.METHOD, "MAT_CR") - IND(L1, 10) - RES(R1, 10000) - - NET_C(clk, L1.1) - NET_C(L1.2, R1.1) - NET_C(R1.2, GND) + IND(L1, 10) + RES(R1, 10000) - //LOG(log_1, R1.1) - //LOG(log_2, clk) + NET_C(clk, L1.1) + NET_C(L1.2, R1.1) + NET_C(R1.2, GND) + + //LOG(log_1, R1.1) + //LOG(log_2, clk) NETLIST_END() diff --git a/src/lib/netlist/examples/sn74ls629_osc.c b/src/lib/netlist/examples/sn74ls629_osc.c index f40c464f55c..3f797d9474d 100644 --- a/src/lib/netlist/examples/sn74ls629_osc.c +++ b/src/lib/netlist/examples/sn74ls629_osc.c @@ -9,26 +9,26 @@ NETLIST_START(ls629) - /* - * Astable ne555 - * - */ + /* + * Astable ne555 + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) + SOLVER(Solver, 48000) - ANALOG_INPUT(V5, 5) // 5V - ANALOG_INPUT(VF, 2.5) // 5V - ANALOG_INPUT(VR, 5) // 5V + ANALOG_INPUT(V5, 5) // 5V + ANALOG_INPUT(VF, 2.5) // 5V + ANALOG_INPUT(VR, 5) // 5V - SN74LS629(OSC, 0.022e-6) + SN74LS629(OSC, 0.022e-6) - NET_C(GND, OSC.GND) - NET_C(VR, OSC.RNG) - NET_C(VF, OSC.FC) - NET_C(GND, OSC.ENQ) + NET_C(GND, OSC.GND) + NET_C(VR, OSC.RNG) + NET_C(VF, OSC.FC) + NET_C(GND, OSC.ENQ) - LOG(log2, OSC.Y) + LOG(log2, OSC.Y) NETLIST_END() diff --git a/src/lib/netlist/examples/test.c b/src/lib/netlist/examples/test.c index 9a75dd3ad91..bee32494710 100644 --- a/src/lib/netlist/examples/test.c +++ b/src/lib/netlist/examples/test.c @@ -10,78 +10,78 @@ #include "netlist/devices/net_lib.h" NETLIST_START(bjt) - /* Standard stuff */ - - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - - ANALOG_INPUT(V3, 3) - ANALOG_INPUT(STOPG, 0) - ALIAS(SRSTQ, RYf.2) - ALIAS(SRST, RYc.2) - NET_C(antenna, GND) - ALIAS(runQ, Q1.C) - - TTL_7404_INVERT(e4d, STOPG) - - RES(RYf, 50) // output impedance - RES(RYc, 50) // output impedance - - TTL_7404_INVERT(c9f, RYc.2) - TTL_7404_INVERT(c9c, RYf.2) - NET_C(c9f.Q, RYf.1) - NET_C(c9c.Q, RYc.1) - - SWITCH2(coinsw, RYc.2, RYf.2) - - NET_C(coinsw.Q, GND) - - /* Antenna circuit */ - /* Also has a diode to clamp negative voltages - omitted here */ - NETDEV_QNPN(Q3, BC237B) - ALIAS(antenna, Q3.B) - NET_C(GND, Q3.E) - RES(RX5, 100) - CAP(CX1, 100) - NET_C(RX5.1, CX1.1) - NET_C(RX5.1, Q3.C) - NET_C(RX5.2, GND) - NET_C(CX1.2, GND) - NETDEV_QNPN(Q1, BC237B) - NET_C(Q1.B, RX5.1) - NET_C(Q1.E, GND) - - DIODE(D3, 1N914) - NET_C(D3.A, Q1.C) - NET_C(D3.K, SRSTQ) - - DIODE(D2, 1N914) - RES(RX4, 220) - NET_C(D2.K, e4d.Q) - NET_C(D2.A, RX4.1) - NET_C(RX4.2, Q3.C) - - RES(RX1, 100) - RES(RX2, 100) - RES(RX3, 330) - CAP(CX2, CAP_U(0.1)) - - NET_C(RX3.2, D3.A) - NET_C(RX3.1, RX1.2) - NET_C(RX1.1, V3) - - NET_C(RX1.1, CX2.1) - NET_C(RX1.2, CX2.2) - - NETDEV_QPNP(Q2, BC556B) - NET_C(Q2.E, V3) - NET_C(Q2.B, RX1.2) - NET_C(Q2.C, RX2.2) - - NET_C(RX2.1, D2.A) - - - //LOG(logB, Q1.B) - //LOG(logC, Q1.C) + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + + ANALOG_INPUT(V3, 3) + ANALOG_INPUT(STOPG, 0) + ALIAS(SRSTQ, RYf.2) + ALIAS(SRST, RYc.2) + NET_C(antenna, GND) + ALIAS(runQ, Q1.C) + + TTL_7404_INVERT(e4d, STOPG) + + RES(RYf, 50) // output impedance + RES(RYc, 50) // output impedance + + TTL_7404_INVERT(c9f, RYc.2) + TTL_7404_INVERT(c9c, RYf.2) + NET_C(c9f.Q, RYf.1) + NET_C(c9c.Q, RYc.1) + + SWITCH2(coinsw, RYc.2, RYf.2) + + NET_C(coinsw.Q, GND) + + /* Antenna circuit */ + /* Also has a diode to clamp negative voltages - omitted here */ + NETDEV_QNPN(Q3, BC237B) + ALIAS(antenna, Q3.B) + NET_C(GND, Q3.E) + RES(RX5, 100) + CAP(CX1, 100) + NET_C(RX5.1, CX1.1) + NET_C(RX5.1, Q3.C) + NET_C(RX5.2, GND) + NET_C(CX1.2, GND) + NETDEV_QNPN(Q1, BC237B) + NET_C(Q1.B, RX5.1) + NET_C(Q1.E, GND) + + DIODE(D3, 1N914) + NET_C(D3.A, Q1.C) + NET_C(D3.K, SRSTQ) + + DIODE(D2, 1N914) + RES(RX4, 220) + NET_C(D2.K, e4d.Q) + NET_C(D2.A, RX4.1) + NET_C(RX4.2, Q3.C) + + RES(RX1, 100) + RES(RX2, 100) + RES(RX3, 330) + CAP(CX2, CAP_U(0.1)) + + NET_C(RX3.2, D3.A) + NET_C(RX3.1, RX1.2) + NET_C(RX1.1, V3) + + NET_C(RX1.1, CX2.1) + NET_C(RX1.2, CX2.2) + + NETDEV_QPNP(Q2, BC556B) + NET_C(Q2.E, V3) + NET_C(Q2.B, RX1.2) + NET_C(Q2.C, RX2.2) + + NET_C(RX2.1, D2.A) + + + //LOG(logB, Q1.B) + //LOG(logC, Q1.C) NETLIST_END() diff --git a/src/lib/netlist/examples/todo.c b/src/lib/netlist/examples/todo.c index 62c713e86fd..6e9257f5410 100644 --- a/src/lib/netlist/examples/todo.c +++ b/src/lib/netlist/examples/todo.c @@ -43,47 +43,47 @@ NETLIST_END() #if 0 - RES(R1, 10) - RES(R2, 10) - RES(R3, 10) - NET_C(V5,R1.1) - NET_C(R1.2, R2.1) - NET_C(R2.2, R3.1) - NET_C(R3.2, GND) + RES(R1, 10) + RES(R2, 10) + RES(R3, 10) + NET_C(V5,R1.1) + NET_C(R1.2, R2.1) + NET_C(R2.2, R3.1) + NET_C(R3.2, GND) #endif #if 0 - RES(R4, 1000) - CAP(C1, 1e-6) - NET_C(V5,R4.1) - NET_C(R4.2, C1.1) - NET_C(C1.2, GND) - //LOG(log1, C1.1) + RES(R4, 1000) + CAP(C1, 1e-6) + NET_C(V5,R4.1) + NET_C(R4.2, C1.1) + NET_C(C1.2, GND) + //LOG(log1, C1.1) #endif #if 0 - RES(R5, 1000) - NETDEV_1N914(D1) - NET_C(V5, R5.1) - NET_C(R5.2, D1.A) - NET_C(D1.K, GND) - //LOG(log1, D1.A) + RES(R5, 1000) + NETDEV_1N914(D1) + NET_C(V5, R5.1) + NET_C(R5.2, D1.A) + NET_C(D1.K, GND) + //LOG(log1, D1.A) #endif #if 0 #endif #if 0 - NETDEV_VCVS(VV) - RES(R1, 1000) - RES(R2, 10000) - - NET_C(V5, R1.1) - NET_C(R1.2, VV.IN) - NET_C(R2.1, VV.OP) - NET_C(R2.2, VV.IN) - NET_C(VV.ON, GND) - NET_C(VV.IP, GND) - LOG(logX, VV.OP) + NETDEV_VCVS(VV) + RES(R1, 1000) + RES(R2, 10000) + + NET_C(V5, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R2.2, VV.IN) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) #endif @@ -91,50 +91,50 @@ NETLIST_END() #endif #if 0 - NETDEV_VCVS(VV) - PARAM(VV.G, 100000) // typical OP-AMP amplification - PARAM(VV.RO, 50) // typical OP-AMP amplification - RES(R1, 1000) - RES(R3, 10000) // ==> 10x amplification (inverting) - - NET_C(4V, R1.1) - NET_C(R1.2, VV.IN) - NET_C(R3.1, VV.IN) - NET_C(R3.2, VV.OP) - NET_C(VV.ON, GND) - NET_C(VV.IP, GND) - LOG(logX, VV.OP) - LOG(logY, 4V) + NETDEV_VCVS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + PARAM(VV.RO, 50) // typical OP-AMP amplification + RES(R1, 1000) + RES(R3, 10000) // ==> 10x amplification (inverting) + + NET_C(4V, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R3.1, VV.IN) + NET_C(R3.2, VV.OP) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + LOG(logY, 4V) #endif #if 0 - // Impedance converter with resistor - NETDEV_VCVS(VV) - PARAM(VV.G, 100000) // typical OP-AMP amplification - PARAM(VV.RO, 50) // typical OP-AMP amplification - RES(R3, 10000) - - NET_C(4V, VV.IP) - NET_C(R3.1, VV.IN) - NET_C(R3.2, VV.OP) - NET_C(VV.ON, GND) - LOG(logX, VV.OP) - LOG(logY, 4V) + // Impedance converter with resistor + NETDEV_VCVS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + PARAM(VV.RO, 50) // typical OP-AMP amplification + RES(R3, 10000) + + NET_C(4V, VV.IP) + NET_C(R3.1, VV.IN) + NET_C(R3.2, VV.OP) + NET_C(VV.ON, GND) + LOG(logX, VV.OP) + LOG(logY, 4V) #endif #if 0 - // Impedance converter without resistor - NETDEV_VCVS(VV) - PARAM(VV.G, 100000) // typical OP-AMP amplification - PARAM(VV.RO, 50) // typical OP-AMP amplification - - NET_C(4V, VV.IP) - NET_C(VV.IN, VV.OP) - NET_C(VV.ON, GND) - LOG(logX, VV.OP) - LOG(logY, 4V) + // Impedance converter without resistor + NETDEV_VCVS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + PARAM(VV.RO, 50) // typical OP-AMP amplification + + NET_C(4V, VV.IP) + NET_C(VV.IN, VV.OP) + NET_C(VV.ON, GND) + LOG(logX, VV.OP) + LOG(logY, 4V) #endif diff --git a/src/lib/netlist/examples/vccs.c b/src/lib/netlist/examples/vccs.c index 27ebf5a64e0..0e76ba6b219 100644 --- a/src/lib/netlist/examples/vccs.c +++ b/src/lib/netlist/examples/vccs.c @@ -10,21 +10,21 @@ NETLIST_START(vccs) - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-12) - PARAM(Solver.GS_LOOPS, 10000) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.GS_LOOPS, 10000) - VCCS(VV) - PARAM(VV.G, 100) // typical OP-AMP amplification - RES(R2, 1) + VCCS(VV) + PARAM(VV.G, 100) // typical OP-AMP amplification + RES(R2, 1) - NET_C(clk, VV.IN) - NET_C(R2.1, VV.OP) - NET_C(R2.2, GND) - NET_C(VV.ON, GND) - NET_C(VV.IP, GND) - LOG(logX, VV.OP) - LOG(logY, clk) + NET_C(clk, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R2.2, GND) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + LOG(logY, clk) NETLIST_END() diff --git a/src/lib/netlist/examples/vccs1.c b/src/lib/netlist/examples/vccs1.c index 7e6dd1ea48c..b3513b325b7 100644 --- a/src/lib/netlist/examples/vccs1.c +++ b/src/lib/netlist/examples/vccs1.c @@ -10,26 +10,26 @@ NETLIST_START(vccs) - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-6) - - - VCCS(VV) - PARAM(VV.G, 100000) // typical OP-AMP amplification - RES(R1, 10000) - RES(R2, 1) - RES(R3, 1000) - - NET_C(clk, R1.1) - NET_C(R1.2, VV.IN) - NET_C(R2.1, VV.OP) - NET_C(R3.1, VV.IN) - NET_C(R3.2, VV.OP) - NET_C(R2.2, GND) - NET_C(VV.ON, GND) - NET_C(VV.IP, GND) - LOG(logX, VV.OP) - LOG(logY, clk) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + + + VCCS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + RES(R1, 10000) + RES(R2, 1) + RES(R3, 1000) + + NET_C(clk, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R3.1, VV.IN) + NET_C(R3.2, VV.OP) + NET_C(R2.2, GND) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + LOG(logY, clk) NETLIST_END() diff --git a/src/lib/netlist/examples/vs.c b/src/lib/netlist/examples/vs.c index 7d72398e297..583b94d7c4f 100644 --- a/src/lib/netlist/examples/vs.c +++ b/src/lib/netlist/examples/vs.c @@ -11,10 +11,10 @@ NETLIST_START(vs) - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 480) - PARAM(Solver.ACCURACY, 1e-6) + SOLVER(Solver, 480) + PARAM(Solver.ACCURACY, 1e-6) PARAM(Solver.METHOD, "MAT_CR") PARAM(Solver.DYNAMIC_TS, 1) @@ -26,7 +26,7 @@ NETLIST_START(vs) NET_C(R1.2, VS1.N) NET_C(GND, VS1.N) - //LOG(tt, VS1.P) - //LOG(tt1, R1.1) + //LOG(tt, VS1.P) + //LOG(tt1, R1.1) NETLIST_END() diff --git a/src/lib/netlist/examples/vs_cs.c b/src/lib/netlist/examples/vs_cs.c index 9b39106a540..252eb9cad3f 100644 --- a/src/lib/netlist/examples/vs_cs.c +++ b/src/lib/netlist/examples/vs_cs.c @@ -11,20 +11,20 @@ NETLIST_START(rc) - /* - * delay circuit - * - */ + /* + * delay circuit + * + */ - /* Standard stuff */ + /* Standard stuff */ - SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-6) - CLOCK(clk, 20000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + CLOCK(clk, 20000) /* Voltage source. Inner resistance will make clock visible */ - RES(R1, 1000) + RES(R1, 1000) VS(VS1, 1) NET_C(R1.1, clk) NET_C(R1.2, VS1.P) @@ -34,8 +34,8 @@ NETLIST_START(rc) * need negative current */ - RES(R2, 1000) - RES(R3, 1000) + RES(R2, 1000) + RES(R3, 1000) CS(CS1, -0.001) NET_C(CS1.P, R2.1) NET_C(R2.2, R3.1) @@ -46,7 +46,7 @@ NETLIST_START(rc) NET_C(C1.2, R3.2) - LOG(tt, VS1.P) - LOG(tx, R2.2) + LOG(tt, VS1.P) + LOG(tx, R2.2) NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_base.cpp b/src/lib/netlist/macro/nlm_base.cpp index 79a6a358fa7..e04d98e59ad 100644 --- a/src/lib/netlist/macro/nlm_base.cpp +++ b/src/lib/netlist/macro/nlm_base.cpp @@ -75,11 +75,11 @@ NETLIST_END() * ---------------------------------------------------------------------------*/ static NETLIST_START(family_models) - NET_MODEL("FAMILY _(TYPE=CUSTOM FV=5 IVL=0.16 IVH=0.4 OVL=0.1 OVH=1.0 ORL=1.0 ORH=130.0)") + NET_MODEL("FAMILY _(TYPE=CUSTOM IVL=0.16 IVH=0.4 OVL=0.1 OVH=1.0 ORL=1.0 ORH=130.0)") NET_MODEL("OPAMP _()") NET_MODEL("SCHMITT_TRIGGER _()") - NET_MODEL("74XXOC FAMILY(FV=5 IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") + NET_MODEL("74XXOC FAMILY(IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") NET_MODEL("74XX FAMILY(TYPE=TTL)") NET_MODEL("CD4XXX FAMILY(TYPE=CD4XXX)") NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_cd4xxx.cpp b/src/lib/netlist/macro/nlm_cd4xxx.cpp index 8844b3f8154..595045f66da 100644 --- a/src/lib/netlist/macro/nlm_cd4xxx.cpp +++ b/src/lib/netlist/macro/nlm_cd4xxx.cpp @@ -152,6 +152,45 @@ static NETLIST_START(CD4016_DIP) ) NETLIST_END() +/* + * DM7486: Quad 2-Input Exclusive-OR Gates + * + * Y = A+B + * +---+---++---+ + * | A | B || Y | + * +===+===++===+ + * | 0 | 0 || 0 | + * | 0 | 1 || 1 | + * | 1 | 0 || 1 | + * | 1 | 1 || 0 | + * +---+---++---+ + * + * Naming conventions follow National Semiconductor datasheet + * + */ + +static NETLIST_START(CD4070_DIP) + CD4070_GATE(A) + CD4070_GATE(B) + CD4070_GATE(C) + CD4070_GATE(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( /* +--------------+ */ + A.A, /* A1 |1 ++ 14| VCC */ A.VCC, + A.B, /* B1 |2 13| B4 */ D.B, + A.Q, /* Y1 |3 12| A4 */ D.A, + B.Q, /* Y2 |4 7486 11| Y4 */ D.Q, + B.A, /* A2 |5 10| Y3 */ C.Q, + B.B, /* B2 |6 9| B3 */ C.B, + A.GND,/* GND |7 8| A3 */ C.A + /* +--------------+ */ + ) +NETLIST_END() + + static NETLIST_START(CD4316_DIP) CD4316_GATE(A) CD4316_GATE(B) @@ -191,7 +230,17 @@ NETLIST_START(CD4XXX_lib) TT_FAMILY("CD4XXX") TRUTHTABLE_END() + TRUTHTABLE_START(CD4070_GATE, 2, 1, "") + TT_HEAD("A,B|Q ") + TT_LINE("0,0|0|15") + TT_LINE("0,1|1|22") + TT_LINE("1,0|1|22") + TT_LINE("1,1|0|15") + TT_FAMILY("CD4XXX") + TRUTHTABLE_END() + LOCAL_LIB_ENTRY(CD4001_DIP) + LOCAL_LIB_ENTRY(CD4070_DIP) /* DIP ONLY */ LOCAL_LIB_ENTRY(CD4020_DIP) diff --git a/src/lib/netlist/macro/nlm_cd4xxx.h b/src/lib/netlist/macro/nlm_cd4xxx.h index afb78706ea6..efa7f33d586 100644 --- a/src/lib/netlist/macro/nlm_cd4xxx.h +++ b/src/lib/netlist/macro/nlm_cd4xxx.h @@ -33,6 +33,12 @@ #define CD4001_DIP(name) \ NET_REGISTER_DEV(CD4001_DIP, name) +#define CD4070_GATE(name) \ + NET_REGISTER_DEV(CD4070_GATE, name) + +#define CD4070_DIP(name) \ + NET_REGISTER_DEV(CD4070_DIP, name) + /* ---------------------------------------------------------------------------- * DIP only macros * ---------------------------------------------------------------------------*/ diff --git a/src/lib/netlist/macro/nlm_opamp.cpp b/src/lib/netlist/macro/nlm_opamp.cpp index 31a52f74a96..e06be8a5e00 100644 --- a/src/lib/netlist/macro/nlm_opamp.cpp +++ b/src/lib/netlist/macro/nlm_opamp.cpp @@ -69,21 +69,17 @@ NETLIST_END() /* * Generic layout with 1 opamp, VCC+ on pin 7, VCC- on pin 4 and compensation + * // FIXME: Offset inputs are not supported! */ static NETLIST_START(opamp_layout_1_7_4) - DIPPINS( /* +--------------+ */ - OFFSET.N1, /* |1 ++ 8| */ NC, - MINUS, /* |2 7| */ VCC.PLUS, - PLUS, /* |3 6| */ OUT, - VCC.MINUS, /* |4 5| */ OFFSET.N2 - /* +--------------+ */ + DIPPINS( /* +--------------+ */ + NC /* OFFSET */, /* |1 ++ 8| */ NC, + A.MINUS, /* |2 7| */ A.VCC, + A.PLUS, /* |3 6| */ A.OUT, + A.GND, /* |4 5| */ NC /* OFFSET */ + /* +--------------+ */ ) - NET_C(A.GND, VCC.MINUS) - NET_C(A.VCC, VCC.PLUS) - NET_C(A.MINUS, MINUS) - NET_C(A.PLUS, PLUS) - NET_C(A.OUT, OUT) NETLIST_END() /* @@ -138,6 +134,16 @@ static NETLIST_START(MB3614_DIP) NETLIST_END() +static NETLIST_START(TL084_DIP) + OPAMP(A, "TL084") + OPAMP(B, "TL084") + OPAMP(C, "TL084") + OPAMP(D, "TL084") + + INCLUDE(opamp_layout_4_4_11) + +NETLIST_END() + static NETLIST_START(LM324_DIP) OPAMP(A, "LM324") OPAMP(B, "LM324") @@ -219,9 +225,10 @@ static NETLIST_START(LM3900) ALIAS(MINUS, R2.1) // Negative input ALIAS(OUT, G1.OP) // Opamp output ... ALIAS(GND, G1.ON) // V- terminal - ALIAS(VCC, DUMMY.I) // V+ terminal + ALIAS(VCC, DUMMY.1) // V+ terminal - DUMMY_INPUT(DUMMY) + RES(DUMMY, RES_K(1)) + NET_C(DUMMY.2, GND) /* The opamp model */ @@ -347,13 +354,18 @@ NETLIST_START(OPAMP_lib) LOCAL_LIB_ENTRY(opamp_layout_1_8_5) LOCAL_LIB_ENTRY(opamp_layout_1_11_6) + // FIXME: JFET Opamp may need better model + // VLL and VHH for +-6V RI=10^12 (for numerical stability 10^9 is used below + // RO from data sheet + NET_MODEL("TL084 OPAMP(TYPE=3 VLH=0.75 VLL=0.75 FPF=10 UGF=3000k SLEW=13M RI=1000M RO=192 DAB=0.0014)") + NET_MODEL("LM324 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.3M RI=1000k RO=50 DAB=0.00075)") NET_MODEL("LM358 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.3M RI=1000k RO=50 DAB=0.001)") NET_MODEL("MB3614 OPAMP(TYPE=3 VLH=1.4 VLL=0.02 FPF=10 UGF=1000k SLEW=0.6M RI=1000k RO=50 DAB=0.002)") NET_MODEL("UA741 OPAMP(TYPE=3 VLH=1.0 VLL=1.0 FPF=5 UGF=1000k SLEW=0.5M RI=2000k RO=75 DAB=0.0017)") NET_MODEL("LM747 OPAMP(TYPE=3 VLH=1.0 VLL=1.0 FPF=5 UGF=1000k SLEW=0.5M RI=2000k RO=50 DAB=0.0017)") NET_MODEL("LM747A OPAMP(TYPE=3 VLH=2.0 VLL=2.0 FPF=5 UGF=1000k SLEW=0.7M RI=6000k RO=50 DAB=0.0015)") - // TI and Motorola Datasheets differ - below are Motorola values values SLEW is average of LH and HL + // TI and Motorola Datasheets differ - below are Motorola values, SLEW is average of LH and HL NET_MODEL("LM3900 OPAMP(TYPE=3 VLH=1.0 VLL=0.03 FPF=2k UGF=4M SLEW=10M RI=10M RO=2k DAB=0.0015)") #if USE_LM3900_MODEL == 1 @@ -361,6 +373,7 @@ NETLIST_START(OPAMP_lib) NET_MODEL("LM3900_PNP1 PNP(IS=1E-14 BF=40 TF=1E-7 CJC=1E-12 CJE=1E-12 VAF=150 RB=100 RE=5)") #endif LOCAL_LIB_ENTRY(MB3614_DIP) + LOCAL_LIB_ENTRY(TL084_DIP) LOCAL_LIB_ENTRY(LM324_DIP) LOCAL_LIB_ENTRY(LM358_DIP) LOCAL_LIB_ENTRY(LM2902_DIP) diff --git a/src/lib/netlist/macro/nlm_opamp.h b/src/lib/netlist/macro/nlm_opamp.h index a7a001a710d..c0a1486aa2f 100644 --- a/src/lib/netlist/macro/nlm_opamp.h +++ b/src/lib/netlist/macro/nlm_opamp.h @@ -24,6 +24,9 @@ #define LM324_DIP(name) \ NET_REGISTER_DEV(LM324_DIP, name) +#define TL084_DIP(name) \ + NET_REGISTER_DEV(TL084_DIP, name) + #define LM2902_DIP(name) \ NET_REGISTER_DEV(LM2902_DIP, name) @@ -33,6 +36,21 @@ #define LM3900(name) \ NET_REGISTER_DEV(LM3900, name) +#define UA741_DIP8(name) \ + NET_REGISTER_DEV(UA741_DIP8, name) + +#define UA741_DIP10(name) \ + NET_REGISTER_DEV(UA741_DIP10, name) + +#define UA741_DIP14(name) \ + NET_REGISTER_DEV(UA741_DIP14, name) + +#define LM747_DIP(name) \ + NET_REGISTER_DEV(LM747_DIP, name) + +#define LM747A_DIP(name) \ + NET_REGISTER_DEV(LM747A_DIP, name) + #endif // NL_AUTO_DEVICES /* ---------------------------------------------------------------------------- diff --git a/src/lib/netlist/macro/nlm_other.cpp b/src/lib/netlist/macro/nlm_other.cpp index befbc99a364..873f3ad84c5 100644 --- a/src/lib/netlist/macro/nlm_other.cpp +++ b/src/lib/netlist/macro/nlm_other.cpp @@ -48,7 +48,7 @@ NETLIST_START(otheric_lib) TT_LINE(" 0 | 1 |100") TT_LINE(" 1 | 0 |100") // 2.1V negative going and 2.7V positive going at 5V - TT_FAMILY("FAMILY(FV=0 IVL=0.42 IVH=0.54 OVL=0.05 OVH=0.05 ORL=10.0 ORH=10.0)") + TT_FAMILY("FAMILY(IVL=0.42 IVH=0.54 OVL=0.05 OVH=0.05 ORL=10.0 ORH=10.0)") TRUTHTABLE_END() LOCAL_LIB_ENTRY(MC14584B_DIP) diff --git a/src/lib/netlist/macro/nlm_ttl74xx.cpp b/src/lib/netlist/macro/nlm_ttl74xx.cpp index 9e0fa15c582..e96c32f66cf 100644 --- a/src/lib/netlist/macro/nlm_ttl74xx.cpp +++ b/src/lib/netlist/macro/nlm_ttl74xx.cpp @@ -897,7 +897,7 @@ NETLIST_START(TTL74XX_lib) NET_MODEL("DM7414 SCHMITT_TRIGGER(VTP=1.7 VTM=0.9 VI=4.35 RI=6.15k VOH=3.5 ROH=120 VOL=0.1 ROL=37.5 TPLH=15 TPHL=15)") NET_MODEL("TTL_7414_GATE SCHMITT_TRIGGER(VTP=1.7 VTM=0.9 VI=4.35 RI=6.15k VOH=3.5 ROH=120 VOL=0.1 ROL=37.5 TPLH=15 TPHL=15)") NET_MODEL("DM74LS14 SCHMITT_TRIGGER(VTP=1.6 VTM=0.8 VI=4.4 RI=19.3k VOH=3.45 ROH=130 VOL=0.1 ROL=31.2 TPLH=15 TPHL=15)") - //NET_MODEL("DM7414 FAMILY(FV=5 IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") + //NET_MODEL("DM7414 FAMILY(IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") TRUTHTABLE_START(TTL_7400_GATE, 2, 1, "") diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 84762b39901..336f6783e8f 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -5,6 +5,7 @@ #include "solver/nld_solver.h" #include "plib/palloc.h" +#include "plib/pfmtlog.h" #include "plib/pmempool.h" #include "plib/putil.h" @@ -34,7 +35,6 @@ namespace netlist public: logic_family_ttl_t() : logic_family_desc_t() { - m_fixed_V = nlconst::magic(5.0); m_low_thresh_PCNT = nlconst::magic(0.8 / 5.0); m_high_thresh_PCNT = nlconst::magic(2.0 / 5.0); // m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications. @@ -61,7 +61,6 @@ namespace netlist public: logic_family_cd4xxx_t() : logic_family_desc_t() { - m_fixed_V = nlconst::magic(0.0); m_low_thresh_PCNT = nlconst::magic(1.5 / 5.0); m_high_thresh_PCNT = nlconst::magic(3.5 / 5.0); // m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications. @@ -101,7 +100,7 @@ namespace netlist // ---------------------------------------------------------------------------------------- detail::queue_t::queue_t(netlist_t &nl) - : timed_queue<plib::pqentry_t<net_t *, netlist_time>, false>(512) + : timed_queue<plib::pqentry_t<net_t *, netlist_time_ext>, false>(512) , netlist_ref(nl) , m_qsize(0) , m_times(512) @@ -128,7 +127,6 @@ namespace netlist } } - void detail::queue_t::on_post_load(plib::state_manager_t &manager) { plib::unused_var(manager); @@ -136,7 +134,7 @@ namespace netlist for (std::size_t i = 0; i < m_qsize; i++ ) { detail::net_t *n = state().nets()[m_net_ids[i]].get(); - this->push<false>(queue_t::entry_t(netlist_time::from_raw(m_times[i]),n)); + this->push<false>(queue_t::entry_t(netlist_time_ext::from_raw(m_times[i]),n)); } } @@ -161,18 +159,16 @@ namespace netlist { if (dynamic_cast<const terminal_t *>(this) != nullptr) return terminal_type::TERMINAL; - else if (dynamic_cast<const logic_input_t *>(this) != nullptr + if (dynamic_cast<const logic_input_t *>(this) != nullptr || dynamic_cast<const analog_input_t *>(this) != nullptr) return terminal_type::INPUT; - else if (dynamic_cast<const logic_output_t *>(this) != nullptr + if (dynamic_cast<const logic_output_t *>(this) != nullptr || dynamic_cast<const analog_output_t *>(this) != nullptr) return terminal_type::OUTPUT; - else - { - state().log().fatal(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); - plib::pthrow<nl_exception>(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); - //return terminal_type::TERMINAL; // please compiler - } + + state().log().fatal(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); + throw nl_exception(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); + //return terminal_type::TERMINAL; // please compiler } // ---------------------------------------------------------------------------------------- @@ -182,7 +178,7 @@ namespace netlist netlist_t::netlist_t(netlist_state_t &state) : m_state(state) , m_solver(nullptr) - , m_time(netlist_time::zero()) + , m_time(netlist_time_ext::zero()) , m_mainclock(nullptr) , m_queue(*this) , m_use_stats(false) @@ -198,10 +194,10 @@ namespace netlist netlist_state_t::netlist_state_t(const pstring &aname, plib::unique_ptr<callbacks_t> &&callbacks) : m_name(aname) - , m_state() , m_callbacks(std::move(callbacks)) // Order is important here , m_log(*m_callbacks) , m_extended_validation(false) + , m_dummy_version(1) { pstring libpath = plib::util::environment("NL_BOOSTLIB", plib::util::buildpath({".", "nlboost.so"})); m_lib = plib::make_unique<plib::dynlib>(libpath); @@ -210,7 +206,26 @@ namespace netlist // create the run interface m_netlist = m_pool.make_unique<netlist_t>(*this); + // Make sure save states are invalidated when a new version is deployed + + m_state.save_item(this, m_dummy_version, pstring("V") + version()); + + // Initialize factory devices::initialize_factory(m_setup->factory()); + + // Add default include file + using a = plib::psource_str_t<plib::psource_t>; + const pstring content = + "#define RES_R(res) (res) \n" + "#define RES_K(res) ((res) * 1e3) \n" + "#define RES_M(res) ((res) * 1e6) \n" + "#define CAP_U(cap) ((cap) * 1e-6) \n" + "#define CAP_N(cap) ((cap) * 1e-9) \n" + "#define CAP_P(cap) ((cap) * 1e-12) \n" + "#define IND_U(ind) ((ind) * 1e-6) \n" + "#define IND_N(ind) ((ind) * 1e-9) \n" + "#define IND_P(ind) ((ind) * 1e-12) \n"; + setup().add_include(plib::make_unique<a>("netlist/devices/net_lib.h", content)); NETLIST_NAME(base)(*m_setup); } @@ -241,19 +256,19 @@ namespace netlist return std::numeric_limits<std::size_t>::max(); } - - void netlist_state_t::rebuild_lists() { for (auto & net : m_nets) net->rebuild_list(); } - void netlist_state_t::compile_defines(std::vector<std::pair<pstring, pstring>> &defs) { #define ENTRY(x) if (pstring(#x) != PSTRINGIFY(x)) defs.emplace_back(std::pair<pstring, pstring>(#x, PSTRINGIFY(x))); - ENTRY(PHAS_RDTSCP) + ENTRY(NL_VERSION_MAJOR) + ENTRY(NL_VERSION_MINOR) + ENTRY(NL_VERSION_PATCHLEVEL) + ENTRY(PUSE_ACCURATE_STATS) ENTRY(PHAS_INT128) ENTRY(PUSE_ALIGNED_OPTIMIZATIONS) @@ -300,6 +315,16 @@ namespace netlist #undef ENTRY } + pstring netlist_state_t::version() + { + return plib::pfmt("{1}.{2}")(NL_VERSION_MAJOR, NL_VERSION_MINOR); + } + + pstring netlist_state_t::version_patchlevel() + { + return plib::pfmt("{1}.{2}.{3}")(NL_VERSION_MAJOR, NL_VERSION_MINOR, NL_VERSION_PATCHLEVEL); + } + void netlist_t::reset() { log().debug("Searching for mainclock\n"); @@ -308,10 +333,10 @@ namespace netlist log().debug("Searching for solver\n"); m_solver = m_state.get_single_device<devices::NETLIB_NAME(solver)>("solver"); - m_time = netlist_time::zero(); + m_time = netlist_time_ext::zero(); m_queue.clear(); if (m_mainclock != nullptr) - m_mainclock->m_Q.net().set_next_scheduled_time(netlist_time::zero()); + m_mainclock->m_Q.net().set_next_scheduled_time(netlist_time_ext::zero()); //if (m_solver != nullptr) // m_solver->reset(); @@ -426,7 +451,7 @@ namespace netlist for (auto & j : index) { auto entry = m_state.m_devices[j].second.get(); - auto stats = m_state.m_devices[j].second.get()->m_stats.get(); + auto stats = entry->m_stats.get(); log().verbose("Device {1:20} : {2:12} {3:12} {4:15} {5:12}", entry->name(), stats->m_stat_call_count(), stats->m_stat_total_time.count(), stats->m_stat_total_time.total(), stats->m_stat_inc_active()); @@ -502,10 +527,9 @@ namespace netlist if (ret != nullptr) { m_log.fatal(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); - plib::pthrow<nl_exception>(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); + throw nl_exception(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); } - else - ret = d.second.get(); + ret = d.second.get(); } } return ret; @@ -518,7 +542,6 @@ namespace netlist core_device_t::core_device_t(netlist_state_t &owner, const pstring &name) : object_t(name) - , logic_family_t() , netlist_ref(owner.exec()) , m_hint_deactivate(false) , m_active_outputs(*this, "m_active_outputs", 1) @@ -531,7 +554,6 @@ namespace netlist core_device_t::core_device_t(core_device_t &owner, const pstring &name) : object_t(owner.name() + "." + name) - , logic_family_t() , netlist_ref(owner.state().exec()) , m_hint_deactivate(false) , m_active_outputs(*this, "m_active_outputs", 1) @@ -603,7 +625,7 @@ namespace netlist if (!state().setup().connect(t1, t2)) { log().fatal(MF_ERROR_CONNECTING_1_TO_2(t1.name(), t2.name())); - plib::pthrow<nl_exception>(MF_ERROR_CONNECTING_1_TO_2(t1.name(), t2.name())); + throw nl_exception(MF_ERROR_CONNECTING_1_TO_2(t1.name(), t2.name())); } } @@ -637,7 +659,7 @@ namespace netlist , m_new_Q(*this, "m_new_Q", 0) , m_cur_Q (*this, "m_cur_Q", 0) , m_in_queue(*this, "m_in_queue", queue_status::DELIVERED) - , m_next_scheduled_time(*this, "m_time", netlist_time::zero()) + , m_next_scheduled_time(*this, "m_time", netlist_time_ext::zero()) , m_railterminal(railterminal) { } @@ -658,7 +680,7 @@ namespace netlist void detail::net_t::reset() noexcept { - m_next_scheduled_time = netlist_time::zero(); + m_next_scheduled_time = netlist_time_ext::zero(); m_in_queue = queue_status::DELIVERED; m_new_Q = 0; @@ -687,7 +709,7 @@ namespace netlist if (t == &terminal) { state().log().fatal(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name())); - plib::pthrow<nl_exception>(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name())); + throw nl_exception(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name())); } terminal.set_net(this); @@ -705,7 +727,7 @@ namespace netlist else { state().log().fatal(MF_REMOVE_TERMINAL_1_FROM_NET_2(terminal.name(), this->name())); - plib::pthrow<nl_exception>(MF_REMOVE_TERMINAL_1_FROM_NET_2(terminal.name(), this->name())); + throw nl_exception(MF_REMOVE_TERMINAL_1_FROM_NET_2(terminal.name(), this->name())); } } @@ -743,7 +765,6 @@ namespace netlist detail::core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const state_e state, nldelegate delegate) : device_object_t(dev, dev.name() + "." + aname) - , plib::linkedlist_t<core_terminal_t>::element_t() #if NL_USE_COPY_INSTEAD_OF_REFERENCE , m_Q(*this, "m_Q", 0) #endif @@ -762,7 +783,6 @@ namespace netlist logic_t::logic_t(core_device_t &dev, const pstring &aname, const state_e state, nldelegate delegate) : core_terminal_t(dev, aname, state, delegate) - , logic_family_t() { } @@ -775,9 +795,8 @@ namespace netlist , m_Idr1(nullptr) , m_go1(nullptr) , m_gt1(nullptr) - , m_connected_terminal(otherterm) { - state().setup().register_term(*this); + state().setup().register_term(*this, *otherterm); } void terminal_t::solve_now() @@ -881,19 +900,17 @@ namespace netlist { if (dynamic_cast<const param_str_t *>(this) != nullptr) return STRING; - else if (dynamic_cast<const param_fp_t *>(this) != nullptr) + if (dynamic_cast<const param_fp_t *>(this) != nullptr) return DOUBLE; - else if (dynamic_cast<const param_int_t *>(this) != nullptr) + if (dynamic_cast<const param_int_t *>(this) != nullptr) return INTEGER; - else if (dynamic_cast<const param_logic_t *>(this) != nullptr) + if (dynamic_cast<const param_logic_t *>(this) != nullptr) return LOGIC; - else if (dynamic_cast<const param_ptr_t *>(this) != nullptr) + if (dynamic_cast<const param_ptr_t *>(this) != nullptr) return POINTER; - else - { - state().log().fatal(MF_UNKNOWN_PARAM_TYPE(name())); - plib::pthrow<nl_exception>(MF_UNKNOWN_PARAM_TYPE(name())); - } + + state().log().fatal(MF_UNKNOWN_PARAM_TYPE(name())); + throw nl_exception(MF_UNKNOWN_PARAM_TYPE(name())); } diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index fc0416a3dbb..0f8feea9faf 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -62,11 +62,18 @@ class NETLIB_NAME(name) : public device_t public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \ : NETLIB_NAME(pclass)(owner, name) +// FIXME: Only used by diode #define NETLIB_CONSTRUCTOR_DERIVED_EX(cname, pclass, ...) \ private: detail::family_setter_t m_famsetter; \ public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name, __VA_ARGS__) \ : NETLIB_NAME(pclass)(owner, name) +#define NETLIB_CONSTRUCTOR_DERIVED_PASS(cname, pclass, ...) \ + private: detail::family_setter_t m_famsetter; \ + public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \ + : NETLIB_NAME(pclass)(owner, name, __VA_ARGS__) + + /// \brief Used to define the constructor of a netlist device. /// Use this to define the constructor of a netlist device. Please refer to /// #NETLIB_OBJECT for an example. @@ -135,7 +142,7 @@ class NETLIB_NAME(name) : public device_t /// Please see \ref NETLIB_IS_TIMESTEP for an example. #define NETLIB_TIMESTEPI() \ - public: virtual void timestep(const nl_fptype step) noexcept override + public: virtual void timestep(nl_fptype step) noexcept override /// \brief Used to implement the body of the time stepping code. /// @@ -258,8 +265,6 @@ namespace netlist virtual unique_pool_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const = 0; - // FIXME: remove fixed_V() - nl_fptype fixed_V() const noexcept{return m_fixed_V; } nl_fptype low_thresh_V(nl_fptype VN, nl_fptype VP) const noexcept{ return VN + (VP - VN) * m_low_thresh_PCNT; } nl_fptype high_thresh_V(nl_fptype VN, nl_fptype VP) const noexcept{ return VN + (VP - VN) * m_high_thresh_PCNT; } nl_fptype low_offset_V() const noexcept{ return m_low_VO; } @@ -273,7 +278,6 @@ namespace netlist bool is_below_low_thresh_V(nl_fptype V, nl_fptype VN, nl_fptype VP) const noexcept { return (V - VN) < low_thresh_V(VN, VP); } - nl_fptype m_fixed_V; //!< For variable voltage families, specify 0. For TTL this would be 5. nl_fptype m_low_thresh_PCNT; //!< low input threshhold offset. If the input voltage is below this value times supply voltage, a "0" input is signalled nl_fptype m_high_thresh_PCNT; //!< high input threshhold offset. If the input voltage is above the value times supply voltage, a "0" input is signalled nl_fptype m_low_VO; //!< low output voltage offset. This voltage is output if the ouput is "0" @@ -350,6 +354,10 @@ namespace netlist C14CONSTEXPR operator T & () noexcept { return m_value; } //! Return const value of state variable. constexpr operator const T & () const noexcept { return m_value; } + //! Return non-const value of state variable. + C14CONSTEXPR T & operator ()() noexcept { return m_value; } + //! Return const value of state variable. + constexpr const T & operator ()() const noexcept { return m_value; } //! Return pointer to state variable. C14CONSTEXPR T * ptr() noexcept { return &m_value; } //! Return const pointer to state variable. @@ -565,33 +573,39 @@ namespace netlist public plib::linkedlist_t<core_terminal_t>::element_t { public: + /// \brief Number of signal bits + /// + /// Going forward setting this to 8 will allow 8-bit signal + /// busses to be used in netlist, e.g. for more complex memory + /// arrangements. + static constexpr const unsigned int INP_BITS = 1; + static constexpr const unsigned int INP_MASK = (1 << INP_BITS) - 1; static constexpr const unsigned int INP_HL_SHIFT = 0; - static constexpr const unsigned int INP_LH_SHIFT = 1; + static constexpr const unsigned int INP_LH_SHIFT = INP_BITS; enum state_e { STATE_INP_PASSIVE = 0, - STATE_INP_HL = (1 << INP_HL_SHIFT), - STATE_INP_LH = (1 << INP_LH_SHIFT), + STATE_INP_HL = (INP_MASK << INP_HL_SHIFT), + STATE_INP_LH = (INP_MASK << INP_LH_SHIFT), STATE_INP_ACTIVE = STATE_INP_HL | STATE_INP_LH, - STATE_OUT = 128, - STATE_BIDIR = 256 + STATE_OUT = (1 << (2*INP_BITS)), + STATE_BIDIR = (1 << (2*INP_BITS + 1)) }; core_terminal_t(core_device_t &dev, const pstring &aname, - const state_e state, nldelegate delegate = nldelegate()); + state_e state, nldelegate delegate = nldelegate()); virtual ~core_terminal_t() noexcept = default; COPYASSIGNMOVE(core_terminal_t, delete) /// \brief The object type. /// \returns type of the object - terminal_type type() const noexcept(false); + /// \brief Checks if object is of specified type. /// \param atype type to check object against. /// \returns true if object is of specified type else false. - bool is_type(const terminal_type atype) const noexcept(false) { return (type() == atype); } void set_net(net_t *anet) noexcept { m_net = anet; } @@ -622,13 +636,13 @@ namespace netlist state_var_sig m_Q; #else - void set_copied_input(netlist_sig_t val) const noexcept { plib::unused_var(val); } + void set_copied_input(netlist_sig_t val) noexcept { plib::unused_var(val); } #endif void set_delegate(const nldelegate &delegate) noexcept { m_delegate = delegate; } nldelegate &delegate() noexcept { return m_delegate; } const nldelegate &delegate() const noexcept { return m_delegate; } - void run_delegate() noexcept { m_delegate(); } + inline void run_delegate() noexcept { m_delegate(); } private: nldelegate m_delegate; net_t * m_net; @@ -674,8 +688,8 @@ namespace netlist template <bool KEEP_STATS> void update_devs() noexcept; - netlist_time next_scheduled_time() const noexcept { return m_next_scheduled_time; } - void set_next_scheduled_time(netlist_time ntime) noexcept { m_next_scheduled_time = ntime; } + netlist_time_ext next_scheduled_time() const noexcept { return m_next_scheduled_time; } + void set_next_scheduled_time(netlist_time_ext ntime) noexcept { m_next_scheduled_time = ntime; } bool isRailNet() const noexcept { return !(m_railterminal == nullptr); } core_terminal_t & railterminal() const noexcept { return *m_railterminal; } @@ -733,7 +747,7 @@ namespace netlist } // only used for logic nets - void set_Q_time(netlist_sig_t newQ, netlist_time at) noexcept + void set_Q_time(netlist_sig_t newQ, netlist_time_ext at) noexcept { if (newQ != m_new_Q) { @@ -756,10 +770,10 @@ namespace netlist netlist_sig_t *Q_state_ptr() noexcept { return m_cur_Q.ptr(); } private: - state_var<netlist_sig_t> m_new_Q; - state_var<netlist_sig_t> m_cur_Q; - state_var<queue_status> m_in_queue; // 0: not in queue, 1: in queue, 2: last was taken - state_var<netlist_time> m_next_scheduled_time; + state_var<netlist_sig_t> m_new_Q; + state_var<netlist_sig_t> m_cur_Q; + state_var<queue_status> m_in_queue; + state_var<netlist_time_ext> m_next_scheduled_time; core_terminal_t * m_railterminal; plib::linkedlist_t<core_terminal_t> m_list_active; @@ -778,7 +792,7 @@ namespace netlist { public: - analog_t(core_device_t &dev, const pstring &aname, const state_e state, + analog_t(core_device_t &dev, const pstring &aname, state_e state, nldelegate delegate = nldelegate()); const analog_net_t & net() const noexcept; @@ -809,7 +823,7 @@ namespace netlist void set_go_gt_I(nl_fptype GO, nl_fptype GT, nl_fptype I) const noexcept { - // FIXME: is this check still needed? + // Check for rail nets ... if (m_go1 != nullptr) { *m_Idr1 = I; @@ -822,16 +836,12 @@ namespace netlist void schedule_solve_after(netlist_time after) noexcept; void set_ptrs(nl_fptype *gt, nl_fptype *go, nl_fptype *Idr) noexcept(false); - - terminal_t *connected_terminal() const noexcept { return m_connected_terminal; } private: nl_fptype *m_Idr1; // drive current nl_fptype *m_go1; // conductance for Voltage from other term nl_fptype *m_gt1; // conductance for total conductance - terminal_t *m_connected_terminal; // FIXME: only used during setup - }; @@ -843,7 +853,7 @@ namespace netlist { public: logic_t(core_device_t &dev, const pstring &aname, - const state_e state, nldelegate delegate = nldelegate()); + state_e state, nldelegate delegate = nldelegate()); logic_net_t & net() noexcept; const logic_net_t & net() const noexcept; @@ -956,7 +966,7 @@ namespace netlist m_my_net.set_Q_and_push(newQ, delay); // take the shortcut } - void set_Q_time(netlist_sig_t newQ, netlist_time at) noexcept + void set_Q_time(netlist_sig_t newQ, netlist_time_ext at) noexcept { m_my_net.set_Q_time(newQ, at); // take the shortcut } @@ -1081,7 +1091,7 @@ namespace netlist void connect(const pstring &t1, const pstring &t2); void connect(const detail::core_terminal_t &t1, const detail::core_terminal_t &t2); - void connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2); + void connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2) noexcept(false); protected: NETLIB_UPDATEI() { } @@ -1142,7 +1152,7 @@ namespace netlist class param_num_t final: public param_t { public: - param_num_t(device_t &device, const pstring &name, const T val); + param_num_t(device_t &device, const pstring &name, T val) noexcept(false); T operator()() const noexcept { return m_param; } operator T() const noexcept { return m_param; } @@ -1156,7 +1166,7 @@ namespace netlist class param_enum_t final: public param_t { public: - param_enum_t(device_t &device, const pstring &name, const T val); + param_enum_t(device_t &device, const pstring &name, T val) noexcept(false); T operator()() const noexcept { return T(m_param); } operator T() const noexcept { return T(m_param); } @@ -1245,7 +1255,7 @@ namespace netlist protected: void changed() noexcept override; private: -}; + }; // ----------------------------------------------------------------------------- // data parameter @@ -1304,11 +1314,9 @@ namespace netlist using timed_queue = plib::timed_queue_linear<T, TS>; // Use timed_queue_heap to use stdc++ heap functions instead of linear processing. - /// This slows down processing by about 25% on a Kaby Lake. - - - //template <class T, bool TS> - //using timed_queue = timed_queue_heap<T, TS>; + // This slows down processing by about 25% on a Kaby Lake. + // template <class T, bool TS> + // using timed_queue = plib::timed_queue_heap<T, TS>; // ----------------------------------------------------------------------------- // queue_t @@ -1319,13 +1327,13 @@ namespace netlist class queue_t : //public timed_queue<pqentry_t<net_t *, netlist_time>, false, NL_KEEP_STATISTICS>, - public timed_queue<plib::pqentry_t<net_t *, netlist_time>, false>, + public timed_queue<plib::pqentry_t<net_t *, netlist_time_ext>, false>, public netlist_ref, public plib::state_manager_t::callback_t { public: - using base_queue = timed_queue<plib::pqentry_t<net_t *, netlist_time>, false>; - using entry_t = plib::pqentry_t<net_t *, netlist_time>; + using entry_t = plib::pqentry_t<net_t *, netlist_time_ext>; + using base_queue = timed_queue<entry_t, false>; explicit queue_t(netlist_t &nl); ~queue_t() noexcept override = default; @@ -1342,7 +1350,7 @@ namespace netlist private: std::size_t m_qsize; - std::vector<netlist_time::internal_type> m_times; + std::vector<netlist_time_ext::internal_type> m_times; std::vector<std::size_t> m_net_ids; }; @@ -1380,7 +1388,7 @@ namespace netlist return dynamic_cast<C *>(p) != nullptr; } - core_device_t *get_single_device(const pstring &classname, bool (*cc)(core_device_t *)) const; + core_device_t *get_single_device(const pstring &classname, bool (*cc)(core_device_t *)) const noexcept(false); /// \brief Get single device filtered by class and name /// @@ -1477,7 +1485,7 @@ namespace netlist { dev.release(); log().fatal(MF_DUPLICATE_NAME_DEVICE_LIST(name)); - plib::pthrow<nl_exception>(MF_DUPLICATE_NAME_DEVICE_LIST(name)); + throw nl_exception(MF_DUPLICATE_NAME_DEVICE_LIST(name)); } //m_devices.push_back(std::move(dev)); m_devices.insert(m_devices.end(), { name, std::move(dev) }); @@ -1521,6 +1529,8 @@ namespace netlist void rebuild_lists(); // must be called after post_load ! static void compile_defines(std::vector<std::pair<pstring, pstring>> &defs); + static pstring version(); + static pstring version_patchlevel(); nets_collection_type & nets() noexcept { return m_nets; } const nets_collection_type & nets() const noexcept { return m_nets; } @@ -1575,6 +1585,9 @@ namespace netlist // sole use is to manage lifetime of net objects devices_collection_type m_devices; bool m_extended_validation; + + // dummy version + int m_dummy_version; }; namespace devices @@ -1594,7 +1607,7 @@ namespace netlist NETLIB_RESETI() { - m_Q.net().set_next_scheduled_time(netlist_time::zero()); + m_Q.net().set_next_scheduled_time(netlist_time_ext::zero()); } NETLIB_UPDATE_PARAMI() @@ -1615,6 +1628,7 @@ namespace netlist param_fp_t m_freq; }; } // namespace devices + // ----------------------------------------------------------------------------- // netlist_t // ----------------------------------------------------------------------------- @@ -1631,9 +1645,9 @@ namespace netlist // run functions - netlist_time time() const noexcept { return m_time; } + netlist_time_ext time() const noexcept { return m_time; } - void process_queue(netlist_time delta) noexcept; + void process_queue(netlist_time_ext delta) noexcept; void abort_current_queue_slice() noexcept { if (!NL_USE_QUEUE_STATS || !m_use_stats) @@ -1692,20 +1706,19 @@ namespace netlist private: template <bool KEEP_STATS> - void process_queue_stats(netlist_time delta) noexcept; + void process_queue_stats(netlist_time_ext delta) noexcept; netlist_state_t & m_state; devices::NETLIB_NAME(solver) * m_solver; // mostly rw PALIGNAS_CACHELINE() - netlist_time m_time; + netlist_time_ext m_time; devices::NETLIB_NAME(mainclock) * m_mainclock; PALIGNAS_CACHELINE() detail::queue_t m_queue; bool m_use_stats; - // performance plib::pperftime_t<true> m_stat_mainloop; plib::pperfcount_t<true> m_perf_out_processed; @@ -1765,7 +1778,7 @@ namespace netlist auto valx = func.evaluate(); if (std::is_integral<T>::value) if (plib::abs(valx - plib::trunc(valx)) > nlconst::magic(1e-6)) - plib::pthrow<nl_exception>(MF_INVALID_NUMBER_CONVERSION_1_2(device.name() + "." + name, p)); + throw nl_exception(MF_INVALID_NUMBER_CONVERSION_1_2(device.name() + "." + name, p)); m_param = static_cast<T>(valx); } else @@ -1787,7 +1800,7 @@ namespace netlist if (!ok) { device.state().log().fatal(MF_INVALID_ENUM_CONVERSION_1_2(name, p)); - plib::pthrow<nl_exception>(MF_INVALID_ENUM_CONVERSION_1_2(name, p)); + throw nl_exception(MF_INVALID_ENUM_CONVERSION_1_2(name, p)); } m_param = temp; } @@ -1851,7 +1864,7 @@ namespace netlist { m_next_scheduled_time = exec().time() + delay; - if (is_queued()) + if (!!is_queued()) exec().qremove(this); if (!m_list_active.empty()) @@ -1921,14 +1934,12 @@ namespace netlist if (!(gt && go && Idr) && (gt || go || Idr)) { state().log().fatal("Inconsistent nullptrs for terminal {}", name()); - plib::pthrow<nl_exception>("Inconsistent nullptrs for terminal {}", name()); - } - else - { - m_gt1 = gt; - m_go1 = go; - m_Idr1 = Idr; + throw nl_exception("Inconsistent nullptrs for terminal {}", name()); } + + m_gt1 = gt; + m_go1 = go; + m_Idr1 = Idr; } inline logic_net_t & logic_t::net() noexcept @@ -2021,7 +2032,7 @@ namespace netlist // ----------------------------------------------------------------------------- template <bool KEEP_STATS, typename T> - inline void detail::net_t::process(const T mask, netlist_sig_t sig) noexcept + inline void detail::net_t::process(T mask, netlist_sig_t sig) noexcept { m_cur_Q = sig; @@ -2062,57 +2073,63 @@ namespace netlist } template <bool KEEP_STATS> - inline void netlist_t::process_queue_stats(const netlist_time delta) noexcept + inline void netlist_t::process_queue_stats(const netlist_time_ext delta) noexcept { - netlist_time stop(m_time + delta); + netlist_time_ext stop(m_time + delta); qpush(detail::queue_t::entry_t(stop, nullptr)); if (m_mainclock == nullptr) { - detail::queue_t::entry_t e(m_queue.pop()); - m_time = e.exec_time(); - while (e.object() != nullptr) + m_time = m_queue.top().exec_time(); + detail::net_t *obj(m_queue.top().object()); + m_queue.pop(); + + while (obj != nullptr) { - e.object()->template update_devs<KEEP_STATS>(); + obj->template update_devs<KEEP_STATS>(); if (KEEP_STATS) m_perf_out_processed.inc(); - e = m_queue.pop(); - m_time = e.exec_time(); + const detail::queue_t::entry_t *top = &m_queue.top(); + m_time = top->exec_time(); + obj = top->object(); + m_queue.pop(); } } else { logic_net_t &mc_net(m_mainclock->m_Q.net()); const netlist_time inc(m_mainclock->m_inc); - netlist_time mc_time(mc_net.next_scheduled_time()); + netlist_time_ext mc_time(mc_net.next_scheduled_time()); do { - while (m_queue.top().exec_time() > mc_time) + const detail::queue_t::entry_t *top = &m_queue.top(); + while (top->exec_time() > mc_time) { m_time = mc_time; mc_net.toggle_new_Q(); mc_net.update_devs<KEEP_STATS>(); + top = &m_queue.top(); mc_time += inc; } - detail::queue_t::entry_t e(m_queue.pop()); - m_time = e.exec_time(); - if (e.object() != nullptr) - { - e.object()->template update_devs<KEEP_STATS>(); - if (KEEP_STATS) - m_perf_out_processed.inc(); - } + m_time = top->exec_time(); + const auto obj(top->object()); + m_queue.pop(); + if (obj != nullptr) + obj->template update_devs<KEEP_STATS>(); else break; - } while (true); //while (e.m_object != nullptr); + if (KEEP_STATS) + m_perf_out_processed.inc(); + } while (true); + mc_net.set_next_scheduled_time(mc_time); } } - inline void netlist_t::process_queue(netlist_time delta) noexcept + inline void netlist_t::process_queue(netlist_time_ext delta) noexcept { if (!m_use_stats) process_queue_stats<false>(delta); diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h index ed6f5ec4d74..a6aa74381e4 100644 --- a/src/lib/netlist/nl_config.h +++ b/src/lib/netlist/nl_config.h @@ -10,6 +10,19 @@ #include "plib/pconfig.h" #include "plib/pexception.h" +/// +/// \brief Version - Major. +/// +#define NL_VERSION_MAJOR 0 +/// +/// \brief Version - Minor. +/// +#define NL_VERSION_MINOR 11 +/// \brief Version - Patch level. +/// +#define NL_VERSION_PATCHLEVEL 0 + +/// /// \addtogroup compiledefine /// \{ @@ -47,7 +60,7 @@ /// This approach is stricter and should identify bugs in /// the netlist core faster. /// By default it is disabled since it is not as fast as -/// the default approach. It is up to 10% slower. +/// the default approach. It is up to 20% slower. /// #ifndef NL_USE_COPY_INSTEAD_OF_REFERENCE @@ -111,20 +124,40 @@ //#define NL_DEBUG (true) #endif +/// +/// \} +/// + //============================================================ // Time resolution //============================================================ /// \brief Resolution as clocks per second for timing /// -/// Uses nano-second resolution - Sufficient for now +/// Uses 100 pico second resolution. This is aligned to MAME's +/// attotime resolution. +/// +/// The table below shows the maximum run times depending on +/// time type size and resolution. +/// +/// | Bits | Res | Seconds | Days | Years | +/// | ====-| ===-| =======-| ====-| =====-| +/// | 63 | 1,000,000,000 | 9,223,372,037 | 106,752| 292.3 | +/// | 63 | 10,000,000,000 | 922,337,204 | 10,675| 29.2 | +/// | 63 | 100,000,000,000 | 92,233,720 | 1,068| 2.9 | +/// | 63 | 1,000,000,000,000 | 9,223,372 | 107| 0.3 | +/// -static constexpr const auto NETLIST_INTERNAL_RES = 1000000000; +static constexpr const auto NETLIST_INTERNAL_RES = 10'000'000'000LL; -// FIXME: Belongs into MAME netlist.h -static constexpr const auto NETLIST_CLOCK = NETLIST_INTERNAL_RES; +/// \brief Recommended clock to be used +/// +/// This is the recommended clock to be used in fixed clock applications limited +/// to 32 bit clock resolution. The MAME code (netlist.cpp) contains code +/// illustrating how to deal with remainders if \ref NETLIST_INTERNAL_RES is +/// bigger than NETLIST_CLOCK. -/// \} +static constexpr const int NETLIST_CLOCK = 1'000'000'000; /// \brief Floating point types used /// @@ -185,11 +218,11 @@ namespace netlist template <> struct fp_constants<float> { - static inline constexpr float DIODE_MAXDIFF() noexcept { return 1e20f; } - static inline constexpr float DIODE_MAXVOLT() noexcept { return 90.0f; } + static inline constexpr float DIODE_MAXDIFF() noexcept { return 1e20F; } + static inline constexpr float DIODE_MAXVOLT() noexcept { return 90.0F; } - static inline constexpr float TIMESTEP_MAXDIFF() noexcept { return 1e30f; } - static inline constexpr float TIMESTEP_MINDIV() noexcept { return 1e-8f; } + static inline constexpr float TIMESTEP_MAXDIFF() noexcept { return 1e30F; } + static inline constexpr float TIMESTEP_MINDIV() noexcept { return 1e-8F; } static inline constexpr const char * name() noexcept { return "float"; } static inline constexpr const char * suffix() noexcept { return "f"; } diff --git a/src/lib/netlist/nl_errstr.h b/src/lib/netlist/nl_errstr.h index a6bf39374d7..f0cd3233856 100644 --- a/src/lib/netlist/nl_errstr.h +++ b/src/lib/netlist/nl_errstr.h @@ -13,9 +13,9 @@ namespace netlist { - static constexpr const char sHINT_NO_DEACTIVATE[] = ".HINT_NO_DEACTIVATE"; - static constexpr const char sPowerGND[] = "GND"; - static constexpr const char sPowerVCC[] = "VCC"; + static constexpr const char sHINT_NO_DEACTIVATE[] = ".HINT_NO_DEACTIVATE"; // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + static constexpr const char sPowerGND[] = "GND"; // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + static constexpr const char sPowerVCC[] = "VCC"; // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) // nl_base.cpp diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp index 4e53903971d..7577a9e7dc8 100644 --- a/src/lib/netlist/nl_factory.cpp +++ b/src/lib/netlist/nl_factory.cpp @@ -55,7 +55,7 @@ namespace factory { if (e->name() == factory->name()) { m_log.fatal(MF_FACTORY_ALREADY_CONTAINS_1(factory->name())); - plib::pthrow<nl_exception>(MF_FACTORY_ALREADY_CONTAINS_1(factory->name())); + throw nl_exception(MF_FACTORY_ALREADY_CONTAINS_1(factory->name())); } push_back(std::move(factory)); } @@ -69,7 +69,7 @@ namespace factory { } m_log.fatal(MF_CLASS_1_NOT_FOUND(devname)); - plib::pthrow<nl_exception>(MF_CLASS_1_NOT_FOUND(devname)); + throw nl_exception(MF_CLASS_1_NOT_FOUND(devname)); } // ----------------------------------------------------------------------------- diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h index b9d00b4bcd6..3abe7b49958 100644 --- a/src/lib/netlist/nl_factory.h +++ b/src/lib/netlist/nl_factory.h @@ -110,9 +110,9 @@ namespace factory { register_device(plib::make_unique<device_element_t<device_class>>(name, classname, def_param)); } - void register_device(plib::unique_ptr<element_t> &&factory); + void register_device(plib::unique_ptr<element_t> &&factory) noexcept(false); - element_t * factory_by_name(const pstring &devname); + element_t * factory_by_name(const pstring &devname) noexcept(false); template <class C> bool is_class(element_t *f) noexcept diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index e4d68c20c40..04cfd43c635 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -15,7 +15,7 @@ namespace netlist void parser_t::verror(const pstring &msg) { m_setup.log().fatal("{1}", msg); - plib::pthrow<nl_exception>(plib::pfmt("{1}")(msg)); + throw nl_exception(plib::pfmt("{1}")(msg)); } bool parser_t::parse(const pstring &nlname) @@ -86,8 +86,9 @@ bool parser_t::parse(const pstring &nlname) { parse_netlist(name.str()); return true; - } else - in_nl = true; + } + + in_nl = true; } } } @@ -235,10 +236,12 @@ void parser_t::frontier() // don't do much pstring attachat = get_identifier(); require_token(m_tok_comma); - nl_fptype r_IN = eval_param(get_token()); - require_token(m_tok_comma); - nl_fptype r_OUT = eval_param(get_token()); - require_token(m_tok_paren_right); + auto tok = get_token(); + auto r_IN = stringify_expression(tok); + require_token(tok, m_tok_comma); + tok = get_token(); + auto r_OUT = stringify_expression(tok); + require_token(tok, m_tok_paren_right); m_setup.register_frontier(attachat, r_IN, r_OUT); } @@ -334,14 +337,15 @@ void parser_t::netdev_param() { m_setup.log().debug("Parser: Param: {1} {2}\n", param, tok.str()); m_setup.register_param(param, tok.str()); + require_token(m_tok_paren_right); } else { - nl_fptype val = eval_param(tok); + auto val = stringify_expression(tok); m_setup.log().debug("Parser: Param: {1} {2}\n", param, val); m_setup.register_param(param, val); + require_token(tok, m_tok_paren_right); } - require_token(m_tok_paren_right); } void parser_t::netdev_hint() @@ -350,7 +354,7 @@ void parser_t::netdev_hint() pstring dev(get_identifier()); require_token(m_tok_comma); pstring hint(get_identifier()); - m_setup.register_param(dev + ".HINT_" + hint, 1); + m_setup.register_param_val(dev + ".HINT_" + hint, 1); require_token(m_tok_paren_right); } @@ -369,18 +373,15 @@ void parser_t::device(const pstring &dev_type) { tok = get_token(); if (tok.is_type(token_type::IDENTIFIER) || tok.is_type(token_type::STRING)) + { params.push_back(tok.str()); + tok = get_token(); + } else { - // FIXME: Do we really need this? - nl_fptype value = eval_param(tok); - if (plib::abs(value - plib::floor(value)) > nlconst::magic(1e-30) - || plib::abs(value) > nlconst::magic(1e9)) - params.push_back(plib::pfmt("{1:.9}").e(value)); - else - params.push_back(plib::pfmt("{1}")(static_cast<long>(value))); + auto value = stringify_expression(tok); + params.push_back(value); } - tok = get_token(); } require_token(tok, m_tok_paren_right); @@ -392,39 +393,24 @@ void parser_t::device(const pstring &dev_type) // private // ---------------------------------------------------------------------------------------- -nl_fptype parser_t::eval_param(const token_t &tok) +pstring parser_t::stringify_expression(token_t &tok) { - static std::array<pstring, 7> macs = {"", "RES_R", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"}; - static std::array<nl_fptype, 7> facs = { - nlconst::magic(1.0), - nlconst::magic(1.0), - nlconst::magic(1e3), - nlconst::magic(1e6), - nlconst::magic(1e-6), - nlconst::magic(1e-9), - nlconst::magic(1e-12) - }; - std::size_t f=0; - nl_fptype ret(0); - - for (std::size_t i=1; i<macs.size();i++) - if (tok.str() == macs[i]) - f = i; - if (f>0) - { - require_token(m_tok_paren_left); - ret = static_cast<nl_fptype>(get_number_double()); - require_token(m_tok_paren_right); - } - else + int pc(0); + pstring ret; + while (!tok.is(m_tok_comma)) { - bool err(false); - ret = plib::pstonum_ne<nl_fptype>(tok.str(), err); - if (err) - error(MF_PARAM_NOT_FP_1(tok.str())); + if (tok.is(m_tok_paren_left)) + pc++; + else if (tok.is(m_tok_paren_right)) + { + if (pc<=0) + break; + pc--; + } + ret += tok.str(); + tok = get_token(); } - return ret * facs[f]; - + return ret; } } // namespace netlist diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h index e747f2dac28..524f2cfeed8 100644 --- a/src/lib/netlist/nl_parser.h +++ b/src/lib/netlist/nl_parser.h @@ -43,9 +43,7 @@ namespace netlist void verror(const pstring &msg) override; private: - - nl_fptype eval_param(const token_t &tok); - + pstring stringify_expression(token_t &tok); token_id_t m_tok_paren_left; token_id_t m_tok_paren_right; token_id_t m_tok_comma; diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index 21b2c0e8999..5cda3e03d64 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -36,10 +36,10 @@ namespace netlist void nlparse_t::register_dip_alias_arr(const pstring &terms) { std::vector<pstring> list(plib::psplit(terms,", ")); - if (list.size() == 0 || (list.size() % 2) == 1) + if (list.empty() || (list.size() % 2) == 1) { log().fatal(MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1(build_fqn(""))); - plib::pthrow<nl_exception>(MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1(build_fqn(""))); + throw nl_exception(MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1(build_fqn(""))); } std::size_t n = list.size(); for (std::size_t i = 0; i < n / 2; i++) @@ -80,7 +80,7 @@ namespace netlist register_dev(classname, name); - if (params_and_connections.size() > 0) + if (!params_and_connections.empty()) { auto ptok(params_and_connections.begin()); auto ptok_end(params_and_connections.end()); @@ -94,7 +94,7 @@ namespace netlist { auto err(MF_PARAM_COUNT_MISMATCH_2(name, params_and_connections.size())); log().fatal(err); - plib::pthrow<nl_exception>(err); + throw nl_exception(err); //break; } pstring output_name = *ptok; @@ -116,16 +116,14 @@ namespace netlist { auto err(MF_PARAM_COUNT_MISMATCH_2(name, params_and_connections.size())); log().fatal(err); - plib::pthrow<nl_exception>(err); + throw nl_exception(err); } pstring paramfq = name + "." + tp; log().debug("Defparam: {1}\n", paramfq); - // remove quotes - if (plib::startsWith(*ptok, "\"") && plib::endsWith(*ptok, "\"")) - register_param(paramfq, ptok->substr(1, ptok->length() - 2)); - else - register_param(paramfq, *ptok); + + register_param(paramfq, *ptok); + ++ptok; } } @@ -133,7 +131,7 @@ namespace netlist { auto err(MF_PARAM_COUNT_EXCEEDED_2(name, params_and_connections.size())); log().fatal(err); - plib::pthrow<nl_exception>(err); + throw nl_exception(err); } } } @@ -144,21 +142,19 @@ namespace netlist if (f == nullptr) { log().fatal(MF_CLASS_1_NOT_FOUND(classname)); - plib::pthrow<nl_exception>(MF_CLASS_1_NOT_FOUND(classname)); + throw nl_exception(MF_CLASS_1_NOT_FOUND(classname)); } - else + + // make sure we parse macro library entries + f->macro_actions(*this, name); + pstring key = build_fqn(name); + if (device_exists(key)) { - // make sure we parse macro library entries - f->macro_actions(*this, name); - pstring key = build_fqn(name); - if (device_exists(key)) - { - log().fatal(MF_DEVICE_ALREADY_EXISTS_1(name)); - plib::pthrow<nl_exception>(MF_DEVICE_ALREADY_EXISTS_1(name)); - } - else - m_device_factory.insert(m_device_factory.end(), {key, f}); + log().fatal(MF_DEVICE_ALREADY_EXISTS_1(name)); + throw nl_exception(MF_DEVICE_ALREADY_EXISTS_1(name)); } + + m_device_factory.insert(m_device_factory.end(), {key, f}); } void nlparse_t::register_link(const pstring &sin, const pstring &sout) @@ -172,7 +168,7 @@ namespace netlist if (list.size() < 2) { log().fatal(MF_NET_C_NEEDS_AT_LEAST_2_TERMINAL()); - plib::pthrow<nl_exception>(MF_NET_C_NEEDS_AT_LEAST_2_TERMINAL()); + throw nl_exception(MF_NET_C_NEEDS_AT_LEAST_2_TERMINAL()); } for (std::size_t i = 1; i < list.size(); i++) { @@ -188,7 +184,7 @@ namespace netlist })) return; log().fatal(MF_NOT_FOUND_IN_SOURCE_COLLECTION(netlist_name)); - plib::pthrow<nl_exception>(MF_NOT_FOUND_IN_SOURCE_COLLECTION(netlist_name)); + throw nl_exception(MF_NOT_FOUND_IN_SOURCE_COLLECTION(netlist_name)); } @@ -218,21 +214,26 @@ namespace netlist void nlparse_t::register_param(const pstring ¶m, const pstring &value) { pstring fqn = build_fqn(param); + pstring val(value); + + // strip " from stringified strings + if (plib::startsWith(value, "\"") && plib::endsWith(value, "\"")) + val = value.substr(1, value.length() - 2); auto idx = m_param_values.find(fqn); if (idx == m_param_values.end()) { - if (!m_param_values.insert({fqn, value}).second) + if (!m_param_values.insert({fqn, val}).second) { log().fatal(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param)); - plib::pthrow<nl_exception>(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param)); + throw nl_exception(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param)); } } else { log().warning(MW_OVERWRITING_PARAM_1_OLD_2_NEW_3(fqn, idx->second, - value)); - m_param_values[fqn] = value; + val)); + m_param_values[fqn] = val; } } @@ -241,7 +242,7 @@ namespace netlist m_factory.register_device(plib::make_unique<factory::library_element_t>(name, name, "", sourcefile)); } - void nlparse_t::register_frontier(const pstring &attach, const nl_fptype r_IN, const nl_fptype r_OUT) + void nlparse_t::register_frontier(const pstring &attach, const pstring &r_IN, const pstring &r_OUT) { pstring frontier_name = plib::pfmt("frontier_{1}")(m_frontier_cnt); m_frontier_cnt++; @@ -268,7 +269,7 @@ namespace netlist if (!found) { log().fatal(MF_FOUND_NO_OCCURRENCE_OF_1(attach)); - plib::pthrow<nl_exception>(MF_FOUND_NO_OCCURRENCE_OF_1(attach)); + throw nl_exception(MF_FOUND_NO_OCCURRENCE_OF_1(attach)); } register_link(attach, frontier_name + ".Q"); } @@ -281,11 +282,8 @@ namespace netlist pstring nlparse_t::build_fqn(const pstring &obj_name) const { - if (m_namespace_stack.empty()) - //return netlist().name() + "." + obj_name; - return obj_name; - else - return m_namespace_stack.top() + "." + obj_name; + return (m_namespace_stack.empty()) ? obj_name + : m_namespace_stack.top() + "." + obj_name; } void nlparse_t::register_alias_nofqn(const pstring &alias, const pstring &out) @@ -293,7 +291,7 @@ namespace netlist if (!m_alias.insert({alias, out}).second) { log().fatal(MF_ADDING_ALI1_TO_ALIAS_LIST(alias)); - plib::pthrow<nl_exception>(MF_ADDING_ALI1_TO_ALIAS_LIST(alias)); + throw nl_exception(MF_ADDING_ALI1_TO_ALIAS_LIST(alias)); } } @@ -343,7 +341,7 @@ setup_t::setup_t(netlist_state_t &nlstate) { } -pstring setup_t::termtype_as_str(detail::core_terminal_t &in) const +pstring setup_t::termtype_as_str(detail::core_terminal_t &in) { switch (in.type()) { @@ -362,10 +360,7 @@ pstring setup_t::termtype_as_str(detail::core_terminal_t &in) const pstring setup_t::get_initial_param_val(const pstring &name, const pstring &def) const { auto i = m_param_values.find(name); - if (i != m_param_values.end()) - return i->second; - else - return def; + return (i != m_param_values.end()) ? i->second : def; } void setup_t::register_term(detail::core_terminal_t &term) @@ -374,10 +369,16 @@ void setup_t::register_term(detail::core_terminal_t &term) if (!m_terminals.insert({term.name(), &term}).second) { log().fatal(MF_ADDING_1_2_TO_TERMINAL_LIST(termtype_as_str(term), term.name())); - plib::pthrow<nl_exception>(MF_ADDING_1_2_TO_TERMINAL_LIST(termtype_as_str(term), term.name())); + throw nl_exception(MF_ADDING_1_2_TO_TERMINAL_LIST(termtype_as_str(term), term.name())); } } +void setup_t::register_term(terminal_t &term, terminal_t &other_term) +{ + this->register_term(term); + m_connected_terminals.insert({&term, &other_term}); +} + void setup_t::remove_connections(const pstring &pin) { pstring pinfn = build_fqn(pin); @@ -397,7 +398,7 @@ void setup_t::remove_connections(const pstring &pin) if (!found) { log().fatal(MF_FOUND_NO_OCCURRENCE_OF_1(pin)); - plib::pthrow<nl_exception>(MF_FOUND_NO_OCCURRENCE_OF_1(pin)); + throw nl_exception(MF_FOUND_NO_OCCURRENCE_OF_1(pin)); } } @@ -406,7 +407,7 @@ void setup_t::register_param_t(const pstring &name, param_t ¶m) if (!m_params.insert({param.name(), param_ref_t(param.name(), param.device(), param)}).second) { log().fatal(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(name)); - plib::pthrow<nl_exception>(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(name)); + throw nl_exception(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(name)); } } @@ -502,7 +503,7 @@ detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool if (term == nullptr && required) { log().fatal(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); - plib::pthrow<nl_exception>(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); + throw nl_exception(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); } if (term != nullptr) { @@ -527,7 +528,7 @@ detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, if (ret == m_terminals.end() && required) { log().fatal(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); - plib::pthrow<nl_exception>(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); + throw nl_exception(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); } detail::core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); @@ -536,10 +537,10 @@ detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, if (required) { log().fatal(MF_OBJECT_1_2_WRONG_TYPE(terminal_in, tname)); - plib::pthrow<nl_exception>(MF_OBJECT_1_2_WRONG_TYPE(terminal_in, tname)); + throw nl_exception(MF_OBJECT_1_2_WRONG_TYPE(terminal_in, tname)); } - else - term = nullptr; + + term = nullptr; } if (term != nullptr) log().debug("Found input {1}\n", tname); @@ -556,7 +557,7 @@ param_t *setup_t::find_param(const pstring ¶m_in, bool required) const if (ret == m_params.end() && required) { log().fatal(MF_PARAMETER_1_2_NOT_FOUND(param_in_fqn, outname)); - plib::pthrow<nl_exception>(MF_PARAMETER_1_2_NOT_FOUND(param_in_fqn, outname)); + throw nl_exception(MF_PARAMETER_1_2_NOT_FOUND(param_in_fqn, outname)); } if (ret != m_params.end()) log().debug("Found parameter {1}\n", outname); @@ -570,39 +571,38 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(detail::core_terminal_t &out) auto &out_cast = static_cast<logic_output_t &>(out); auto iter_proxy(m_proxies.find(&out)); - if (iter_proxy == m_proxies.end()) - { - // create a new one ... - pstring x = plib::pfmt("proxy_da_{1}_{2}")(out.name())(m_proxy_cnt); - auto new_proxy = - out_cast.logic_family()->create_d_a_proxy(m_nlstate, x, &out_cast); - m_proxy_cnt++; - // connect all existing terminals to new net + if (iter_proxy != m_proxies.end()) + return iter_proxy->second; - for (auto & p : out.net().core_terms()) + // create a new one ... + pstring x = plib::pfmt("proxy_da_{1}_{2}")(out.name())(m_proxy_cnt); + auto new_proxy = + out_cast.logic_family()->create_d_a_proxy(m_nlstate, x, &out_cast); + m_proxy_cnt++; + // connect all existing terminals to new net + + for (auto & p : out.net().core_terms()) + { + p->clear_net(); // de-link from all nets ... + if (!connect(new_proxy->proxy_term(), *p)) { - p->clear_net(); // de-link from all nets ... - if (!connect(new_proxy->proxy_term(), *p)) - { - log().fatal(MF_CONNECTING_1_TO_2( - new_proxy->proxy_term().name(), (*p).name())); - plib::pthrow<nl_exception>(MF_CONNECTING_1_TO_2( - new_proxy->proxy_term().name(), (*p).name())); - } + log().fatal(MF_CONNECTING_1_TO_2( + new_proxy->proxy_term().name(), (*p).name())); + throw nl_exception(MF_CONNECTING_1_TO_2( + new_proxy->proxy_term().name(), (*p).name())); } - out.net().core_terms().clear(); + } + out.net().core_terms().clear(); - out.net().add_terminal(new_proxy->in()); + out.net().add_terminal(new_proxy->in()); - auto proxy(new_proxy.get()); - if (!m_proxies.insert({&out, proxy}).second) - plib::pthrow<nl_exception>(MF_DUPLICATE_PROXY_1(out.name())); + auto proxy(new_proxy.get()); + if (!m_proxies.insert({&out, proxy}).second) + throw nl_exception(MF_DUPLICATE_PROXY_1(out.name())); + + m_nlstate.register_device(new_proxy->name(), std::move(new_proxy)); + return proxy; - m_nlstate.register_device(new_proxy->name(), std::move(new_proxy)); - return proxy; - } - else - return iter_proxy->second; } devices::nld_base_proxy *setup_t::get_a_d_proxy(detail::core_terminal_t &inp) @@ -615,42 +615,40 @@ devices::nld_base_proxy *setup_t::get_a_d_proxy(detail::core_terminal_t &inp) if (iter_proxy != m_proxies.end()) return iter_proxy->second; - else - { - log().debug("connect_terminal_input: connecting proxy\n"); - pstring x = plib::pfmt("proxy_ad_{1}_{2}")(inp.name())(m_proxy_cnt); - auto new_proxy = incast.logic_family()->create_a_d_proxy(m_nlstate, x, &incast); - //auto new_proxy = plib::owned_ptr<devices::nld_a_to_d_proxy>::Create(netlist(), x, &incast); - auto ret(new_proxy.get()); + log().debug("connect_terminal_input: connecting proxy\n"); + pstring x = plib::pfmt("proxy_ad_{1}_{2}")(inp.name())(m_proxy_cnt); + auto new_proxy = incast.logic_family()->create_a_d_proxy(m_nlstate, x, &incast); + //auto new_proxy = plib::owned_ptr<devices::nld_a_to_d_proxy>::Create(netlist(), x, &incast); - if (!m_proxies.insert({&inp, ret}).second) - plib::pthrow<nl_exception>(MF_DUPLICATE_PROXY_1(inp.name())); + auto ret(new_proxy.get()); - m_proxy_cnt++; + if (!m_proxies.insert({&inp, ret}).second) + throw nl_exception(MF_DUPLICATE_PROXY_1(inp.name())); - // connect all existing terminals to new net + m_proxy_cnt++; - if (inp.has_net()) + // connect all existing terminals to new net + + if (inp.has_net()) + { + for (auto & p : inp.net().core_terms()) { - for (auto & p : inp.net().core_terms()) + p->clear_net(); // de-link from all nets ... + if (!connect(ret->proxy_term(), *p)) { - p->clear_net(); // de-link from all nets ... - if (!connect(ret->proxy_term(), *p)) - { - log().fatal(MF_CONNECTING_1_TO_2( - ret->proxy_term().name(), (*p).name())); - plib::pthrow<nl_exception>(MF_CONNECTING_1_TO_2( - ret->proxy_term().name(), (*p).name())); + log().fatal(MF_CONNECTING_1_TO_2( + ret->proxy_term().name(), (*p).name())); + throw nl_exception(MF_CONNECTING_1_TO_2( + ret->proxy_term().name(), (*p).name())); - } } - inp.net().core_terms().clear(); // clear the list } - ret->out().net().add_terminal(inp); - m_nlstate.register_device(new_proxy->name(), std::move(new_proxy)); - return ret; + inp.net().core_terms().clear(); // clear the list } + ret->out().net().add_terminal(inp); + m_nlstate.register_device(new_proxy->name(), std::move(new_proxy)); + return ret; } detail::core_terminal_t &setup_t::resolve_proxy(detail::core_terminal_t &term) @@ -677,7 +675,7 @@ void setup_t::merge_nets(detail::net_t &thisnet, detail::net_t &othernet) if (thisnet.isRailNet() && othernet.isRailNet()) { log().fatal(MF_MERGE_RAIL_NETS_1_AND_2(thisnet.name(), othernet.name())); - plib::pthrow<nl_exception>(MF_MERGE_RAIL_NETS_1_AND_2(thisnet.name(), othernet.name())); + throw nl_exception(MF_MERGE_RAIL_NETS_1_AND_2(thisnet.name(), othernet.name())); } if (othernet.isRailNet()) @@ -737,7 +735,7 @@ void setup_t::connect_terminal_input(terminal_t &term, detail::core_terminal_t & else { log().fatal(MF_OBJECT_INPUT_TYPE_1(inp.name())); - plib::pthrow<nl_exception>(MF_OBJECT_INPUT_TYPE_1(inp.name())); + throw nl_exception(MF_OBJECT_INPUT_TYPE_1(inp.name())); } } @@ -762,7 +760,7 @@ void setup_t::connect_terminal_output(terminal_t &in, detail::core_terminal_t &o else { log().fatal(MF_OBJECT_OUTPUT_TYPE_1(out.name())); - plib::pthrow<nl_exception>(MF_OBJECT_OUTPUT_TYPE_1(out.name())); + throw nl_exception(MF_OBJECT_OUTPUT_TYPE_1(out.name())); } } @@ -844,7 +842,7 @@ bool setup_t::connect(detail::core_terminal_t &t1_in, detail::core_terminal_t &t if (t2.has_net() && t2.net().isRailNet()) { log().fatal(MF_INPUT_1_ALREADY_CONNECTED(t2.name())); - plib::pthrow<nl_exception>(MF_INPUT_1_ALREADY_CONNECTED(t2.name())); + throw nl_exception(MF_INPUT_1_ALREADY_CONNECTED(t2.name())); } connect_input_output(t2, t1); } @@ -853,7 +851,7 @@ bool setup_t::connect(detail::core_terminal_t &t1_in, detail::core_terminal_t &t if (t1.has_net() && t1.net().isRailNet()) { log().fatal(MF_INPUT_1_ALREADY_CONNECTED(t1.name())); - plib::pthrow<nl_exception>(MF_INPUT_1_ALREADY_CONNECTED(t1.name())); + throw nl_exception(MF_INPUT_1_ALREADY_CONNECTED(t1.name())); } connect_input_output(t1, t2); } @@ -895,7 +893,7 @@ void setup_t::resolve_inputs() // after all other terminals were connected. unsigned tries = m_netlist_params->m_max_link_loops(); - while (m_links.size() > 0 && tries > 0) + while (!m_links.empty() > 0 && tries > 0) { for (auto li = m_links.begin(); li != m_links.end(); ) @@ -919,7 +917,7 @@ void setup_t::resolve_inputs() log().warning(MF_CONNECTING_1_TO_2(setup().de_alias(link.first), setup().de_alias(link.second))); log().fatal(MF_LINK_TRIES_EXCEEDED(m_netlist_params->m_max_link_loops())); - plib::pthrow<nl_exception>(MF_LINK_TRIES_EXCEEDED(m_netlist_params->m_max_link_loops())); + throw nl_exception(MF_LINK_TRIES_EXCEEDED(m_netlist_params->m_max_link_loops())); } log().verbose("deleting empty nets ..."); @@ -964,7 +962,7 @@ void setup_t::resolve_inputs() if (err) { log().fatal(MF_TERMINALS_WITHOUT_NET()); - plib::pthrow<nl_exception>(MF_TERMINALS_WITHOUT_NET()); + throw nl_exception(MF_TERMINALS_WITHOUT_NET()); } } @@ -1006,11 +1004,11 @@ void models_t::register_model(const pstring &model_in) { auto pos = model_in.find(' '); if (pos == pstring::npos) - plib::pthrow<nl_exception>(MF_UNABLE_TO_PARSE_MODEL_1(model_in)); + throw nl_exception(MF_UNABLE_TO_PARSE_MODEL_1(model_in)); pstring model = plib::ucase(plib::trim(plib::left(model_in, pos))); pstring def = plib::trim(model_in.substr(pos + 1)); if (!m_models.insert({model, def}).second) - plib::pthrow<nl_exception>(MF_MODEL_ALREADY_EXISTS_1(model_in)); + throw nl_exception(MF_MODEL_ALREADY_EXISTS_1(model_in)); } void models_t::model_parse(const pstring &model_in, model_map_t &map) @@ -1027,7 +1025,7 @@ void models_t::model_parse(const pstring &model_in, model_map_t &map) key = plib::ucase(model); auto i = m_models.find(key); if (i == m_models.end()) - plib::pthrow<nl_exception>(MF_MODEL_NOT_FOUND(model)); + throw nl_exception(MF_MODEL_NOT_FOUND(model)); model = i->second; } pstring xmodel = plib::left(model, pos); @@ -1040,12 +1038,12 @@ void models_t::model_parse(const pstring &model_in, model_map_t &map) if (i != m_models.end()) model_parse(xmodel, map); else - plib::pthrow<nl_exception>(MF_MODEL_NOT_FOUND(model_in)); + throw nl_exception(MF_MODEL_NOT_FOUND(model_in)); } pstring remainder = plib::trim(model.substr(pos + 1)); if (!plib::endsWith(remainder, ")")) - plib::pthrow<nl_exception>(MF_MODEL_ERROR_1(model)); + throw nl_exception(MF_MODEL_ERROR_1(model)); // FIMXE: Not optimal remainder = plib::left(remainder, remainder.size() - 1); @@ -1054,7 +1052,7 @@ void models_t::model_parse(const pstring &model_in, model_map_t &map) { auto pose = pe.find('='); if (pose == pstring::npos) - plib::pthrow<nl_exception>(MF_MODEL_ERROR_ON_PAIR_1(model)); + throw nl_exception(MF_MODEL_ERROR_ON_PAIR_1(model)); map[plib::ucase(plib::left(pe, pose))] = pe.substr(pose + 1); } } @@ -1073,26 +1071,22 @@ pstring models_t::value_str(const pstring &model, const pstring &entity) { model_map_t &map = m_cache[model]; - if (map.size() == 0) + if (map.empty()) model_parse(model , map); - pstring ret; - if (entity != plib::ucase(entity)) - plib::pthrow<nl_exception>(MF_MODEL_PARAMETERS_NOT_UPPERCASE_1_2(entity, model_string(map))); + throw nl_exception(MF_MODEL_PARAMETERS_NOT_UPPERCASE_1_2(entity, model_string(map))); if (map.find(entity) == map.end()) - plib::pthrow<nl_exception>(MF_ENTITY_1_NOT_FOUND_IN_MODEL_2(entity, model_string(map))); - else - ret = map[entity]; + throw nl_exception(MF_ENTITY_1_NOT_FOUND_IN_MODEL_2(entity, model_string(map))); - return ret; + return map[entity]; } nl_fptype models_t::value(const pstring &model, const pstring &entity) { model_map_t &map = m_cache[model]; - if (map.size() == 0) + if (map.empty()) model_parse(model , map); pstring tmp = value_str(model, entity); @@ -1112,7 +1106,7 @@ nl_fptype models_t::value(const pstring &model, const pstring &entity) case 'a': factor = nlconst::magic(1e-18); break; default: if (*p < '0' || *p > '9') - plib::pthrow<nl_exception>(MF_UNKNOWN_NUMBER_FACTOR_IN_1(entity)); + throw nl_exception(MF_UNKNOWN_NUMBER_FACTOR_IN_1(entity)); } if (factor != nlconst::one()) tmp = plib::left(tmp, tmp.size() - 1); @@ -1121,7 +1115,7 @@ nl_fptype models_t::value(const pstring &model, const pstring &entity) bool err(false); auto val = plib::pstonum_ne<nl_fptype>(tmp, err); if (err) - plib::pthrow<nl_exception>(MF_MODEL_NUMBER_CONVERSION_ERROR(entity, tmp, "double", model)); + throw nl_exception(MF_MODEL_NUMBER_CONVERSION_ERROR(entity, tmp, "double", model)); return val * factor; } @@ -1159,7 +1153,6 @@ const logic_family_desc_t *setup_t::family_from_model(const pstring &model) auto ret = plib::make_unique<logic_family_std_proxy_t>(); - ret->m_fixed_V = m_models.value(model, "FV"); ret->m_low_thresh_PCNT = m_models.value(model, "IVL"); ret->m_high_thresh_PCNT = m_models.value(model, "IVH"); ret->m_low_VO = m_models.value(model, "OVL"); @@ -1204,8 +1197,7 @@ void setup_t::delete_empty_nets() x->state().run_state_manager().remove_save_items(x.get()); return true; } - else - return false; + return false; }), m_nlstate.nets().end()); } @@ -1269,7 +1261,7 @@ void setup_t::prepare_to_run() } } - bool use_deactivate = m_netlist_params->m_use_deactivate() ? true : false; + const bool use_deactivate = m_netlist_params->m_use_deactivate(); for (auto &d : m_nlstate.devices()) { @@ -1284,7 +1276,7 @@ void setup_t::prepare_to_run() if (err || plib::abs(v - plib::floor(v)) > nlconst::magic(1e-6) ) { log().fatal(MF_HND_VAL_NOT_SUPPORTED(p->second)); - plib::pthrow<nl_exception>(MF_HND_VAL_NOT_SUPPORTED(p->second)); + throw nl_exception(MF_HND_VAL_NOT_SUPPORTED(p->second)); } // FIXME comparison with zero d.second->set_hint_deactivate(v == nlconst::zero()); @@ -1318,7 +1310,7 @@ void setup_t::prepare_to_run() if (p->is_analog()) { log().fatal(MF_NO_SOLVER()); - plib::pthrow<nl_exception>(MF_NO_SOLVER()); + throw nl_exception(MF_NO_SOLVER()); } } else @@ -1340,10 +1332,7 @@ void setup_t::prepare_to_run() bool source_netlist_t::parse(nlparse_t &setup, const pstring &name) { auto strm(stream(name)); - if (strm) - return setup.parse_stream(std::move(strm), name); - else - return false; + return (strm) ? setup.parse_stream(std::move(strm), name) : false; } source_string_t::stream_ptr source_string_t::stream(const pstring &name) @@ -1366,10 +1355,7 @@ source_file_t::stream_ptr source_file_t::stream(const pstring &name) { plib::unused_var(name); auto ret(plib::make_unique<std::ifstream>(plib::filesystem::u8path(m_filename))); - if (ret->is_open()) - return std::move(ret); - else - return stream_ptr(nullptr); + return (ret->is_open()) ? std::move(ret) : stream_ptr(nullptr); } bool source_proc_t::parse(nlparse_t &setup, const pstring &name) @@ -1379,8 +1365,8 @@ bool source_proc_t::parse(nlparse_t &setup, const pstring &name) m_setup_func(setup); return true; } - else - return false; + + return false; } source_proc_t::stream_ptr source_proc_t::stream(const pstring &name) diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index c8f1b4b2250..42a517e20a2 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -53,10 +53,10 @@ setup.register_link_arr( # term1 ", " # __VA_ARGS__); #define PARAM(name, val) \ - setup.register_param(# name, val); + setup.register_param(# name, # val); #define HINT(name, val) \ - setup.register_param(# name ".HINT_" # val, 1); + setup.register_param(# name ".HINT_" # val, "1"); #define NETDEV_PARAMI(name, param, val) \ setup.register_param(# name "." # param, val); @@ -88,7 +88,7 @@ void NETLIST_NAME(name)(netlist::nlparse_t &setup) \ setup.namespace_pop(); #define OPTIMIZE_FRONTIER(attach, r_in, r_out) \ - setup.register_frontier(# attach, r_in, r_out); + setup.register_frontier(# attach, PSTRINGIFY_VA(r_in), PSTRINGIFY_VA(r_out)); // ----------------------------------------------------------------------------- // truthtable defines @@ -184,9 +184,7 @@ namespace netlist friend class setup_t; - source_netlist_t() - : plib::psource_t() - {} + source_netlist_t() = default; COPYASSIGNMOVE(source_netlist_t, delete) ~source_netlist_t() noexcept override = default; @@ -200,9 +198,7 @@ namespace netlist friend class setup_t; - source_data_t() - : plib::psource_t() - {} + source_data_t() = default; COPYASSIGNMOVE(source_data_t, delete) ~source_data_t() noexcept override = default; @@ -243,7 +239,7 @@ namespace netlist public: using link_t = std::pair<pstring, pstring>; - nlparse_t(setup_t &netlist, log_type &log); + nlparse_t(setup_t &setup, log_type &log); void register_model(const pstring &model_in) { m_models.register_model(model_in); } void register_alias(const pstring &alias, const pstring &out); @@ -261,11 +257,11 @@ namespace netlist void register_param(const pstring ¶m, const pstring &value); // FIXME: quick hack - void register_param_x(const pstring ¶m, const nl_fptype value); + void register_param_x(const pstring ¶m, nl_fptype value); template <typename T> typename std::enable_if<std::is_floating_point<T>::value || std::is_integral<T>::value>::type - register_param(const pstring ¶m, T value) + register_param_val(const pstring ¶m, T value) { register_param_x(param, static_cast<nl_fptype>(value)); } @@ -278,7 +274,7 @@ namespace netlist #endif void register_lib_entry(const pstring &name, const pstring &sourcefile); - void register_frontier(const pstring &attach, const nl_fptype r_IN, const nl_fptype r_OUT); + void register_frontier(const pstring &attach, const pstring &r_IN, const pstring &r_OUT); // register a source void register_source(plib::unique_ptr<plib::psource_t> &&src) @@ -385,6 +381,13 @@ namespace netlist pstring get_initial_param_val(const pstring &name, const pstring &def) const; void register_term(detail::core_terminal_t &term); + void register_term(terminal_t &term, terminal_t &other_term); + + terminal_t *get_connected_terminal(const terminal_t &term) const noexcept + { + auto ret(m_connected_terminals.find(&term)); + return (ret != m_connected_terminals.end()) ? ret->second : nullptr; + } void remove_connections(const pstring &pin); @@ -414,7 +417,7 @@ namespace netlist const log_type &log() const; // needed by proxy - detail::core_terminal_t *find_terminal(const pstring &outname_in, const detail::terminal_type atype, bool required = true) const; + detail::core_terminal_t *find_terminal(const pstring &terminal_in, detail::terminal_type atype, bool required = true) const; detail::core_terminal_t *find_terminal(const pstring &terminal_in, bool required = true) const; // core net handling @@ -436,13 +439,14 @@ namespace netlist bool connect_input_input(detail::core_terminal_t &t1, detail::core_terminal_t &t2); // helpers - pstring termtype_as_str(detail::core_terminal_t &in) const; + static pstring termtype_as_str(detail::core_terminal_t &in); devices::nld_base_proxy *get_d_a_proxy(detail::core_terminal_t &out); devices::nld_base_proxy *get_a_d_proxy(detail::core_terminal_t &inp); detail::core_terminal_t &resolve_proxy(detail::core_terminal_t &term); std::unordered_map<pstring, detail::core_terminal_t *> m_terminals; + std::unordered_map<const terminal_t *, terminal_t *> m_connected_terminals; netlist_state_t &m_nlstate; devices::nld_netlistparams *m_netlist_params; @@ -462,7 +466,7 @@ namespace netlist public: explicit source_string_t(const pstring &source) - : source_netlist_t(), m_str(source) + : m_str(source) { } @@ -478,7 +482,7 @@ namespace netlist public: explicit source_file_t(const pstring &filename) - : source_netlist_t(), m_filename(filename) + : m_filename(filename) { } @@ -493,7 +497,7 @@ namespace netlist { public: explicit source_mem_t(const char *mem) - : source_netlist_t(), m_str(mem) + : m_str(mem) { } @@ -508,9 +512,8 @@ namespace netlist { public: source_proc_t(const pstring &name, void (*setup_func)(nlparse_t &)) - : source_netlist_t(), - m_setup_func(setup_func), - m_setup_func_name(name) + : m_setup_func(setup_func) + , m_setup_func_name(name) { } diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h index af3ccd5828b..3794c160a57 100644 --- a/src/lib/netlist/nltypes.h +++ b/src/lib/netlist/nltypes.h @@ -100,19 +100,22 @@ namespace netlist } // namespace detail #if (PHAS_INT128) - using netlist_time = ptime<INT128, NETLIST_INTERNAL_RES>; + //using netlist_time = plib::ptime<INT128, NETLIST_INTERNAL_RES>; + using netlist_time = plib::ptime<std::int64_t, NETLIST_INTERNAL_RES>; + using netlist_time_ext = plib::ptime<INT128, NETLIST_INTERNAL_RES>; #else using netlist_time = plib::ptime<std::int64_t, NETLIST_INTERNAL_RES>; - static_assert(noexcept(netlist_time::from_nsec(1)) == true, "Not evaluated as constexpr"); + using netlist_time_ext = netlist_time; #endif + static_assert(noexcept(netlist_time::from_nsec(1)), "Not evaluated as constexpr"); //============================================================ // MACROS //============================================================ - template <typename T> inline constexpr const netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); } - template <typename T> inline constexpr const netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); } - template <typename T> inline constexpr const netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); } + template <typename T> inline constexpr netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); } + template <typename T> inline constexpr netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); } + template <typename T> inline constexpr netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); } } // namespace netlist diff --git a/src/lib/netlist/plib/gmres.h b/src/lib/netlist/plib/gmres.h index c1c03ea7bd9..d8d8bc63bbb 100644 --- a/src/lib/netlist/plib/gmres.h +++ b/src/lib/netlist/plib/gmres.h @@ -296,8 +296,7 @@ namespace plib vec_add_mult_scalar(n, x, m_v[i], m_y[i]); return true; } - else - return false; + return false; } template <int k, typename OPS, typename VT> diff --git a/src/lib/netlist/plib/mat_cr.h b/src/lib/netlist/plib/mat_cr.h index 3208ceeed3f..e97da4e33d1 100644 --- a/src/lib/netlist/plib/mat_cr.h +++ b/src/lib/netlist/plib/mat_cr.h @@ -110,11 +110,11 @@ namespace plib template <typename M> void build_from_fill_mat(const M &f, std::size_t max_fill = FILL_INFINITY - 1, - std::size_t band_width = FILL_INFINITY) + std::size_t band_width = FILL_INFINITY) noexcept(false) { C nz = 0; if (nz_num != 0) - pthrow<pexception>("build_from_mat only allowed on empty CR matrix"); + throw pexception("build_from_mat only allowed on empty CR matrix"); for (std::size_t k=0; k < size(); k++) { row_idx[k] = nz; @@ -177,7 +177,7 @@ namespace plib // throws error if P(source)>P(destination) template <typename LUMAT> - void slim_copy_from(LUMAT & src) + void slim_copy_from(LUMAT & src) noexcept(false) { for (std::size_t r=0; r<src.size(); r++) { @@ -188,7 +188,7 @@ namespace plib while (col_idx[dp] < src.col_idx[sp]) A[dp++] = 0; if (row_idx[r+1] <= dp || col_idx[dp] != src.col_idx[sp]) - pthrow<pexception>("slim_copy_from error"); + throw pexception("slim_copy_from error"); A[dp++] = src.A[sp]; } // fill remaining elements in row @@ -337,8 +337,8 @@ namespace plib void gaussian_elimination_parallel(V & RHS) { //printf("omp: %ld %d %d\n", m_ge_par.size(), nz_num, (int)m_ge_par[m_ge_par.size()-2].size()); - for (auto l = 0ul; l < m_ge_par.size(); l++) - plib::omp::for_static(base::nz_num, 0ul, m_ge_par[l].size(), [this, &RHS, &l] (unsigned ll) + for (auto l = 0UL; l < m_ge_par.size(); l++) + plib::omp::for_static(base::nz_num, 0UL, m_ge_par[l].size(), [this, &RHS, &l] (unsigned ll) { auto &i = m_ge_par[l][ll]; { diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index 5262d0c569d..035fbdb749d 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -9,6 +9,7 @@ /// #include "pconfig.h" +#include "pmath.h" #include "pstring.h" #include "ptypes.h" @@ -281,6 +282,9 @@ namespace plib { static inline void *allocate( size_t alignment, size_t size ) { + m_stat_cur_alloc() += size; + m_stat_max_alloc() = std::max(m_stat_max_alloc(), m_stat_cur_alloc()); + #if (PUSE_ALIGNED_ALLOCATION) #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) return _aligned_malloc(size, alignment); @@ -301,7 +305,8 @@ namespace plib { static inline void deallocate( void *ptr, size_t size ) noexcept { - unused_var(size); + //unused_var(size); + m_stat_cur_alloc() -= size; #if (PUSE_ALIGNED_ALLOCATION) // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) free(ptr); @@ -342,12 +347,32 @@ namespace plib { } } + template<typename T, typename... Args> + static T *alloc(Args&&... args) + { + auto *p = allocate(alignof(T), sizeof(T)); + return new(p) T(std::forward<Args>(args)...); + } + + template<typename T> + static void free(T *ptr) noexcept + { + ptr->~T(); + aligned_arena::deallocate(ptr, sizeof(T)); + } + bool operator ==(const aligned_arena &rhs) const noexcept { plib::unused_var(rhs); return true; } + size_type cur_alloc() const noexcept { return m_stat_cur_alloc(); } // NOLINT(readability-convert-member-functions-to-static) + size_type max_alloc() const noexcept { return m_stat_max_alloc(); } // NOLINT(readability-convert-member-functions-to-static) + private: + static size_t &m_stat_cur_alloc() noexcept { static size_t val = 0; return val; } + static size_t &m_stat_max_alloc() noexcept { static size_t val = 0; return val; } + }; template <typename T, std::size_t ALIGN> @@ -377,29 +402,13 @@ namespace plib { #endif } - // FIXME: remove - template<typename T, typename... Args> - inline T *pnew(Args&&... args) - { - auto *p = aligned_arena::allocate(alignof(T), sizeof(T)); - return new(p) T(std::forward<Args>(args)...); - } - - template<typename T> - inline void pdelete(T *ptr) noexcept - { - ptr->~T(); - aligned_arena::deallocate(ptr, sizeof(T)); - } - - template <typename T> - using unique_ptr = std::unique_ptr<T, arena_deleter<aligned_arena, T>>; + using unique_ptr = aligned_arena::unique_pool_ptr<T>; template<typename T, typename... Args> plib::unique_ptr<T> make_unique(Args&&... args) { - return plib::unique_ptr<T>(pnew<T>(std::forward<Args>(args)...)); + return aligned_arena::instance().make_unique<T>(std::forward<Args>(args)...); } template <class T, std::size_t ALIGN = alignof(T)> diff --git a/src/lib/netlist/plib/parray.h b/src/lib/netlist/plib/parray.h index c60698d10e1..05f3b0ce3f4 100644 --- a/src/lib/netlist/plib/parray.h +++ b/src/lib/netlist/plib/parray.h @@ -76,21 +76,21 @@ namespace plib { } template <int X = SIZE > - parray(size_type size, typename std::enable_if<(X != 0), int>::type = 0) + parray(size_type size, typename std::enable_if<(X != 0), int>::type = 0) noexcept(false) : m_size(size) { if ((SIZE < 0 && size > SIZEABS()) || (SIZE > 0 && size != SIZEABS())) - pthrow<pexception>("parray: size error " + plib::to_string(size) + ">" + plib::to_string(SIZE)); + throw pexception("parray: size error " + plib::to_string(size) + ">" + plib::to_string(SIZE)); } template <int X = SIZE > - parray(size_type size, FT val, typename std::enable_if<(X != 0), int>::type = 0) + parray(size_type size, FT val, typename std::enable_if<(X != 0), int>::type = 0) noexcept(false) : m_size(size) { if ((SIZE < 0 && size > SIZEABS()) || (SIZE > 0 && size != SIZEABS())) - pthrow<plib::pexception>("parray: size error " + plib::to_string(size) + ">" + plib::to_string(SIZE)); + throw pexception("parray: size error " + plib::to_string(size) + ">" + plib::to_string(SIZE)); m_a.fill(val); } @@ -107,13 +107,13 @@ namespace plib { parray(const parray &rhs) : m_a(rhs.m_a), m_size(rhs.m_size) {} parray(parray &&rhs) noexcept : m_a(std::move(rhs.m_a)), m_size(std::move(rhs.m_size)) {} - parray &operator=(const parray &rhs) noexcept + parray &operator=(const parray &rhs) noexcept // NOLINT(bugprone-unhandled-self-assignment, cert-oop54-cpp) { - if (this != &rhs) - { - m_a = rhs.m_a; - m_size = rhs.m_size; - } + if (this == &rhs) + return *this; + + m_a = rhs.m_a; + m_size = rhs.m_size; return *this; } diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h index f08c9c025ea..115eafd2196 100644 --- a/src/lib/netlist/plib/pconfig.h +++ b/src/lib/netlist/plib/pconfig.h @@ -25,7 +25,7 @@ /// \brief System supports INT128 /// /// Set this to one if you want to use 128 bit int for ptime. -/// This is about 5% slower on a kaby lake processor. +/// This is about 10% slower on a skylake processor for pongf. /// #ifndef PHAS_INT128 #define PHAS_INT128 (0) diff --git a/src/lib/netlist/plib/pexception.h b/src/lib/netlist/plib/pexception.h index 22b67925b7e..703e407eae7 100644 --- a/src/lib/netlist/plib/pexception.h +++ b/src/lib/netlist/plib/pexception.h @@ -30,19 +30,6 @@ namespace plib { [[noreturn]] void passert_fail(const char *assertion, const char *file, int lineno, const char *msg) noexcept; - /// \brief throw an exception. - /// - /// throws an exception E. The purpose is to clearly identify exception - /// throwing in the code - /// - /// \tparam E Type of exception to be thrown - /// - template<typename E, typename... Args> - [[noreturn]] static inline void pthrow(Args&&... args) noexcept(false) - { - throw E(std::forward<Args>(args)...); - } - //============================================================ // exception base //============================================================ diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h index 86761096caf..f73e83c2ca2 100644 --- a/src/lib/netlist/plib/pfmtlog.h +++ b/src/lib/netlist/plib/pfmtlog.h @@ -412,7 +412,7 @@ namespace plib { struct perrmsg { template<std::size_t N, typename... Args> - explicit perrmsg(const char (&fmt)[N], Args&&... args) + explicit perrmsg(const char (&fmt)[N], Args&&... args) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) : m_msg(plib::pfmt(fmt)(std::forward<Args>(args)...)) { } operator pstring const & () const noexcept { return m_msg; } diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index dee38f86416..f05a92ad339 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -15,7 +15,7 @@ namespace plib { template <typename NT> - void pfunction<NT>::compile(const pstring &expr, const std::vector<pstring> &inputs) + void pfunction<NT>::compile(const pstring &expr, const std::vector<pstring> &inputs) noexcept(false) { if (plib::startsWith(expr, "rpn:")) compile_postfix(expr.substr(4), inputs); @@ -24,7 +24,7 @@ namespace plib { } template <typename NT> - void pfunction<NT>::compile_postfix(const pstring &expr, const std::vector<pstring> &inputs) + void pfunction<NT>::compile_postfix(const pstring &expr, const std::vector<pstring> &inputs) noexcept(false) { std::vector<pstring> cmds(plib::psplit(expr, " ")); compile_postfix(inputs, cmds, expr); @@ -32,7 +32,7 @@ namespace plib { template <typename NT> void pfunction<NT>::compile_postfix(const std::vector<pstring> &inputs, - const std::vector<pstring> &cmds, const pstring &expr) + const std::vector<pstring> &cmds, const pstring &expr) noexcept(false) { m_precompiled.clear(); int stk = 0; @@ -76,38 +76,38 @@ namespace plib { bool err(false); rc.m_param = plib::pstonum_ne<decltype(rc.m_param)>(cmd, err); if (err) - pthrow<pexception>(plib::pfmt("pfunction: unknown/misformatted token <{1}> in <{2}>")(cmd)(expr)); + throw pexception(plib::pfmt("pfunction: unknown/misformatted token <{1}> in <{2}>")(cmd)(expr)); stk += 1; } } if (stk < 1) - pthrow<pexception>(plib::pfmt("pfunction: stack underflow on token <{1}> in <{2}>")(cmd)(expr)); + throw pexception(plib::pfmt("pfunction: stack underflow on token <{1}> in <{2}>")(cmd)(expr)); m_precompiled.push_back(rc); } if (stk != 1) - pthrow<pexception>(plib::pfmt("pfunction: stack count different to one on <{2}>")(expr)); + throw pexception(plib::pfmt("pfunction: stack count different to one on <{2}>")(expr)); } static int get_prio(const pstring &v) { if (v == "(" || v == ")") return 1; - else if (plib::left(v, 1) >= "a" && plib::left(v, 1) <= "z") + if (plib::left(v, 1) >= "a" && plib::left(v, 1) <= "z") return 0; - else if (v == "*" || v == "/") + if (v == "*" || v == "/") return 20; - else if (v == "+" || v == "-") + if (v == "+" || v == "-") return 10; - else if (v == "^") + if (v == "^") return 30; - else - return -1; + + return -1; } - static pstring pop_check(std::stack<pstring> &stk, const pstring &expr) + static pstring pop_check(std::stack<pstring> &stk, const pstring &expr) noexcept(false) { - if (stk.size() == 0) - pthrow<pexception>(plib::pfmt("pfunction: stack underflow during infix parsing of: <{1}>")(expr)); + if (stk.empty()) + throw pexception(plib::pfmt("pfunction: stack underflow during infix parsing of: <{1}>")(expr)); pstring res = stk.top(); stk.pop(); return res; @@ -183,7 +183,7 @@ namespace plib { postfix.push_back(x); x = pop_check(opstk, expr); } - if (opstk.size() > 0 && get_prio(opstk.top()) == 0) + if (!opstk.empty() && get_prio(opstk.top()) == 0) postfix.push_back(pop_check(opstk, expr)); } else if (s==",") @@ -200,7 +200,7 @@ namespace plib { int p = get_prio(s); if (p>0) { - if (opstk.size() == 0) + if (opstk.empty()) opstk.push(s); else { @@ -211,7 +211,7 @@ namespace plib { } else if (p == 0) // Function or variable { - if (sexpr[i+1] == "(") + if ((i+1<sexpr.size()) && sexpr[i+1] == "(") opstk.push(s); else postfix.push_back(s); @@ -220,7 +220,7 @@ namespace plib { postfix.push_back(s); } } - while (opstk.size() > 0) + while (!opstk.empty()) { postfix.push_back(opstk.top()); opstk.pop(); @@ -238,8 +238,8 @@ namespace plib { std::uint16_t lsb = lfsr & 1; lfsr >>= 1; if (lsb) - lfsr ^= 0xB400u; // taps 15, 13, 12, 10 - return static_cast<NT>(lfsr) / static_cast<NT>(0xffffu); + lfsr ^= 0xB400U; // taps 15, 13, 12, 10 + return static_cast<NT>(lfsr) / static_cast<NT>(0xffffU); } template <typename NT> @@ -249,7 +249,7 @@ namespace plib { std::uint16_t lsb = lfsr & 1; lfsr >>= 1; if (lsb) - lfsr ^= 0xB400u; // taps 15, 13, 12, 10 + lfsr ^= 0xB400U; // taps 15, 13, 12, 10 return static_cast<NT>(lfsr); } diff --git a/src/lib/netlist/plib/pfunction.h b/src/lib/netlist/plib/pfunction.h index c6e94614856..cab5a78a983 100644 --- a/src/lib/netlist/plib/pfunction.h +++ b/src/lib/netlist/plib/pfunction.h @@ -58,7 +58,7 @@ namespace plib { /// /// pfunction(const pstring &name, const void *owner, state_manager_t &state_manager) - : m_lfsr(0xACE1u) + : m_lfsr(0xace1U) { state_manager.save_item(owner, m_lfsr, name + ".lfsr"); } @@ -66,7 +66,7 @@ namespace plib { /// \brief Constructor without state saving support /// pfunction() - : m_lfsr(0xACE1u) + : m_lfsr(0xace1U) { } @@ -76,21 +76,21 @@ namespace plib { /// to be prefixed with rpn, e.g. "rpn:A B + 1.3 /" /// \param inputs Vector of input variables, e.g. {"A","B"} /// - void compile(const pstring &expr, const std::vector<pstring> &inputs); + void compile(const pstring &expr, const std::vector<pstring> &inputs) noexcept(false); /// \brief Compile a rpn expression /// /// \param expr Reverse polish notation expression, e.g. "A B + 1.3 /" /// \param inputs Vector of input variables, e.g. {"A","B"} /// - void compile_postfix(const pstring &expr, const std::vector<pstring> &inputs); + void compile_postfix(const pstring &expr, const std::vector<pstring> &inputs) noexcept(false); /// \brief Compile an infix expression /// /// \param expr Infix expression, e.g. "(A+B)/1.3" /// \param inputs Vector of input variables, e.g. {"A","B"} /// - void compile_infix(const pstring &expr, const std::vector<pstring> &inputs); + void compile_infix(const pstring &expr, const std::vector<pstring> &inputs) noexcept(false); /// \brief Evaluate the expression /// diff --git a/src/lib/netlist/plib/plists.h b/src/lib/netlist/plib/plists.h index 5f2c7b6706d..a5340193b3c 100644 --- a/src/lib/netlist/plib/plists.h +++ b/src/lib/netlist/plib/plists.h @@ -133,10 +133,12 @@ namespace plib { constexpr iter_t(iter_t &rhs) noexcept : p(rhs.p) { } iter_t(iter_t &&rhs) noexcept { std::swap(*this, rhs); } - iter_t& operator=(const iter_t &rhs) noexcept + iter_t& operator=(const iter_t &rhs) noexcept // NOLINT(bugprone-unhandled-self-assignment, cert-oop54-cpp) { - if (this != &rhs) - p = rhs.p; + if (this == &rhs) + return *this; + + p = rhs.p; return *this; } @@ -156,7 +158,7 @@ namespace plib { C14CONSTEXPR LC* operator->() const noexcept { return p; } }; - constexpr linkedlist_t() : m_head(nullptr) {} + constexpr linkedlist_t() noexcept : m_head(nullptr) {} constexpr iter_t begin() const noexcept { return iter_t(m_head); } constexpr iter_t end() const noexcept { return iter_t(nullptr); } @@ -326,7 +328,7 @@ namespace plib { m_prof_call.inc(); } - T pop() noexcept { return *(--m_end); } + void pop() noexcept { --m_end; } const T &top() const noexcept { return *(m_end-1); } template <bool KEEPSTAT, class R> @@ -461,8 +463,7 @@ namespace plib { if (*i == elem) { m_end--; - for (;i < m_end; i++) - *i = std::move(*(i+1)); + *i = *m_end; std::make_heap(&m_list[0], m_end, compare()); return; } diff --git a/src/lib/netlist/plib/pmain.cpp b/src/lib/netlist/plib/pmain.cpp index d603baeb474..b002d4dcb5e 100644 --- a/src/lib/netlist/plib/pmain.cpp +++ b/src/lib/netlist/plib/pmain.cpp @@ -5,7 +5,7 @@ #ifdef _WIN32 #include <windows.h> -#include <string.h> +#include <cstring> #include <tchar.h> #endif @@ -26,8 +26,7 @@ namespace plib { #endif app::app() - : options() - , pout(&std::cout) + : pout(&std::cout) , perr(&std::cerr) { diff --git a/src/lib/netlist/plib/pmath.h b/src/lib/netlist/plib/pmath.h index 9738994770d..e995c3a6c27 100644 --- a/src/lib/netlist/plib/pmath.h +++ b/src/lib/netlist/plib/pmath.h @@ -9,6 +9,7 @@ /// #include "pconfig.h" +#include "ptypes.h" #include <algorithm> #include <cmath> @@ -75,7 +76,7 @@ namespace plib /// later. /// template <typename V> - static inline constexpr const T magic(V &&v) noexcept { return static_cast<T>(v); } + static inline constexpr T magic(V &&v) noexcept { return static_cast<T>(v); } }; /// \brief typesafe reciprocal function @@ -329,7 +330,92 @@ namespace plib #endif - static_assert(noexcept(constants<double>::one()) == true, "Not evaluated as constexpr"); + /// \brief is argument a power of two? + /// + /// \tparam T type of the argument + /// \param v argument to be checked + /// \return true if argument is a power of two + /// + template <typename T> + constexpr bool is_pow2(T v) noexcept + { + static_assert(is_integral<T>::value, "is_pow2 needs integer arguments"); + return !(v & (v-1)); + } + + /// \brief return absolute value of signed argument + /// + /// \tparam T type of the argument + /// \param v argument + /// \return absolute value of argument + /// + template<typename T> + constexpr + typename std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value, T>::type + abs(T v) noexcept + { + return v < 0 ? -v : v; + } + + /// \brief return absolute value of unsigned argument + /// + /// \tparam T type of the argument + /// \param v argument + /// \return argument since it has no sign + /// + template<typename T> + constexpr + typename std::enable_if<std::is_integral<T>::value && std::is_unsigned<T>::value, T>::type + abs(T v) noexcept + { + return v; + } + + /// \brief return greatest common denominator + /// + /// Function returns the greatest common denominator of m and n. For known + /// arguments, this function also works at compile time. + /// + /// \tparam M type of the first argument + /// \tparam N type of the second argument + /// \param m first argument + /// \param n first argument + /// \return greatest common denominator of m and n + /// + template<typename M, typename N> + constexpr typename std::common_type<M, N>::type + gcd(M m, N n) noexcept + { + static_assert(std::is_integral<M>::value, "gcd: M must be an integer"); + static_assert(std::is_integral<N>::value, "gcd: N must be an integer"); + + return m == 0 ? plib::abs(n) + : n == 0 ? plib::abs(m) + : gcd(n, m % n); + } + + /// \brief return least common multiple + /// + /// Function returns the least common multiple of m and n. For known + /// arguments, this function also works at compile time. + /// + /// \tparam M type of the first argument + /// \tparam N type of the second argument + /// \param m first argument + /// \param n first argument + /// \return least common multiple of m and n + /// + template<typename M, typename N> + constexpr typename std::common_type<M, N>::type + lcm(M m, N n) noexcept + { + static_assert(std::is_integral<M>::value, "lcm: M must be an integer"); + static_assert(std::is_integral<N>::value, "lcm: N must be an integer"); + + return (m != 0 && n != 0) ? (plib::abs(m) / gcd(m, n)) * plib::abs(n) : 0; + } + + static_assert(noexcept(constants<double>::one()), "Not evaluated as constexpr"); } // namespace plib diff --git a/src/lib/netlist/plib/pmempool.h b/src/lib/netlist/plib/pmempool.h index 1e197fdfc82..a06c67acd8e 100644 --- a/src/lib/netlist/plib/pmempool.h +++ b/src/lib/netlist/plib/pmempool.h @@ -59,7 +59,7 @@ namespace plib { plib::perrlogger("Found {} info blocks\n", sinfo().size()); plib::perrlogger("Found block with {} dangling allocations\n", b->m_num_alloc); } - plib::pdelete(b); + aligned_arena::free(b); //::operator delete(b->m_data); } } @@ -126,7 +126,7 @@ namespace plib { plib::terminate("mempool::free - block not found"); mp.m_blocks.erase(itb); - plib::pdelete(b); + aligned_arena::free(b); } sinfo().erase(it); } @@ -222,15 +222,13 @@ namespace plib { size_type m_pos; }; - block * new_block(size_type min_bytes) { - auto *b = plib::pnew<block>(*this, min_bytes); + auto *b = aligned_arena::alloc<block>(*this, min_bytes); m_blocks.push_back(b); return b; } - static std::unordered_map<void *, info> &sinfo() { static std::unordered_map<void *, info> spinfo; diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index 6f6ace0599c..fd683d888d8 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -75,15 +75,13 @@ namespace plib { { if (m_other_args != nullptr) { - pthrow<pexception>("other args can only be specified once!"); - } - else - { - m_other_args = ov; + throw pexception("other args can only be specified once!"); } + + m_other_args = ov; } else - pthrow<pexception>("found option with neither short or long tag!" ); + throw pexception("found option with neither short or long tag!" ); } } } @@ -105,7 +103,7 @@ namespace plib { if (!seen_other_args && plib::startsWith(arg, "--")) { auto v = psplit(arg.substr(2),"="); - if (v.size() && v[0] != "") + if (!v.empty() && v[0] != "") { opt = getopt_long(v[0]); has_equal_arg = (v.size() > 1); diff --git a/src/lib/netlist/plib/poptions.h b/src/lib/netlist/plib/poptions.h index 15f43e0330e..26edebb727e 100644 --- a/src/lib/netlist/plib/poptions.h +++ b/src/lib/netlist/plib/poptions.h @@ -139,8 +139,8 @@ namespace plib { m_val = static_cast<T>(raw); return 0; } - else - return 1; + + return 1; } private: @@ -236,7 +236,7 @@ namespace plib { static pstring split_paragraphs(const pstring &text, unsigned width, unsigned indent, unsigned firstline_indent); - void check_consistency(); + void check_consistency() noexcept(false); template <typename T> T *getopt_type() const diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h index bbbe95ded05..a9df2f6b4aa 100644 --- a/src/lib/netlist/plib/ppmf.h +++ b/src/lib/netlist/plib/ppmf.h @@ -273,7 +273,7 @@ namespace plib { #endif } template<typename O> - R call(O *obj, Targs... args) const noexcept(true) + R call(O *obj, Targs&&... args) const noexcept(true) { using function_ptr = MEMBER_ABI R (*)(O *obj, Targs... args); return (reinterpret_cast<function_ptr>(m_func))(obj, std::forward<Targs>(args)...); @@ -311,7 +311,7 @@ namespace plib { m_obj = reinterpret_cast<generic_class *>(object); } - inline R operator()(Targs ... args) const noexcept(true) + inline R operator()(Targs... args) const noexcept(true) { return this->call(m_obj, std::forward<Targs>(args)...); } diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp index 377c37d9fca..74d32fcd477 100644 --- a/src/lib/netlist/plib/ppreprocessor.cpp +++ b/src/lib/netlist/plib/ppreprocessor.cpp @@ -56,14 +56,14 @@ namespace plib { pstring e = plib::pfmt("{1}:{2}:0: error: {3}\n") (m_stack.back().m_name, m_stack.back().m_lineno, err); m_stack.pop_back(); - while (m_stack.size() > 0) + while (!m_stack.empty()) { if (m_stack.size() == 1) trail = trail_first; s = trail + plib::pfmt("{1}:{2}:0\n")(m_stack.back().m_name, m_stack.back().m_lineno) + s; m_stack.pop_back(); } - pthrow<pexception>("\n" + s + e + " " + m_line + "\n"); + throw pexception("\n" + s + e + " " + m_line + "\n"); } template <typename PP, typename L = ppreprocessor::string_list> @@ -226,7 +226,6 @@ namespace plib { { pstring s(STR); pi++; - // FIXME : \" while (pi < tmp.size() && tmp[pi] != STR) { s += tmp[pi]; @@ -236,38 +235,51 @@ namespace plib { tmpret.push_back(s); } else - if (!remove_ws || (tmp[pi] != " " && tmp[pi] != "\t")) - tmpret.push_back(tmp[pi]); + { + pstring tok=tmp[pi]; + if (tok.size() >= 2 && pi < tmp.size() - 2 ) + { + auto sc=tok.substr(0,1); + auto ec=tok.substr(tok.size()-1, 1); + if ((sc == "." || (sc>="0" && sc<="9")) && (ec=="e" || ec=="E")) + { + // looks like an incomplete float due splitting by - or + + tok = tok + tmp[pi+1] + tmp[pi+2]; + pi += 2; + } + } + if (!remove_ws || (tok != " " && tok != "\t")) + tmpret.push_back(tok); + } pi++; } + if (!concat) return tmpret; - else + + // FIXME: error if concat at beginning or end + string_list ret; + pi = 0; + while (pi<tmpret.size()) { - // FIXME: error if concat at beginning or end - string_list ret; - pi = 0; - while (pi<tmpret.size()) + if (tmpret[pi] == "##") { - if (tmpret[pi] == "##") - { - while (ret.back() == " " || ret.back() == "\t") - ret.pop_back(); - pstring cc = ret.back(); + while (ret.back() == " " || ret.back() == "\t") ret.pop_back(); - pi++; - while (pi < tmpret.size() && (tmpret[pi] == " " || tmpret[pi] == "\t")) - pi++; - if (pi == tmpret.size()) - error("## found at end of sequence"); - ret.push_back(cc + tmpret[pi]); - } - else - ret.push_back(tmpret[pi]); + pstring cc = ret.back(); + ret.pop_back(); pi++; + while (pi < tmpret.size() && (tmpret[pi] == " " || tmpret[pi] == "\t")) + pi++; + if (pi == tmpret.size()) + error("## found at end of sequence"); + ret.push_back(cc + tmpret[pi]); } - return ret; + else + ret.push_back(tmpret[pi]); + pi++; } + return ret; } bool ppreprocessor::is_valid_token(const pstring &str) @@ -441,7 +453,6 @@ namespace plib { line = process_comments(m_line); pstring lt = plib::trim(plib::replace_all(line, "\t", " ")); - // FIXME ... revise and extend macro handling if (plib::startsWith(lt, "#")) { string_list lti(psplit(lt, " ", true)); @@ -449,7 +460,6 @@ namespace plib { { m_if_level++; lt = replace_macros(lt); - //std::vector<pstring> t(psplit(replace_all(lt.substr(3), " ", ""), m_expr_sep)); auto t(simple_iter<ppreprocessor>(this, tokenize(lt.substr(3), m_expr_sep, true, true))); auto val = static_cast<int>(prepro_expr(t, 255)); t.skip_ws(); diff --git a/src/lib/netlist/plib/ppreprocessor.h b/src/lib/netlist/plib/ppreprocessor.h index 892015b7f5a..fe498fc1148 100644 --- a/src/lib/netlist/plib/ppreprocessor.h +++ b/src/lib/netlist/plib/ppreprocessor.h @@ -77,7 +77,7 @@ namespace plib { return *this; } - [[noreturn]] void error(const pstring &err); + [[noreturn]] void error(const pstring &err) noexcept(false); protected: diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h index 71db3b97bb6..d4156d09b02 100644 --- a/src/lib/netlist/plib/pstate.h +++ b/src/lib/netlist/plib/pstate.h @@ -162,7 +162,7 @@ public: } } - const std::vector<const entry_t *> save_list() const + std::vector<const entry_t *> save_list() const { std::vector<const entry_t *> ret; for (auto &i : m_save) diff --git a/src/lib/netlist/plib/pstonum.h b/src/lib/netlist/plib/pstonum.h index eed69e85883..737dca9f471 100644 --- a/src/lib/netlist/plib/pstonum.h +++ b/src/lib/netlist/plib/pstonum.h @@ -95,7 +95,7 @@ namespace plib #endif template<typename T, typename S> - T pstonum(const S &arg, const std::locale &loc = std::locale::classic()) + T pstonum(const S &arg, const std::locale &loc = std::locale::classic()) noexcept(false) { decltype(arg.c_str()) cstr = arg.c_str(); std::size_t idx(0); @@ -106,11 +106,11 @@ namespace plib //&& (ret == T(0) || plib::abs(ret) >= std::numeric_limits<T>::min() )) { if (cstr[idx] != 0) - pthrow<pexception>(pstring("Continuation after numeric value ends: ") + pstring(cstr)); + throw pexception(pstring("Continuation after numeric value ends: ") + pstring(cstr)); } else { - pthrow<pexception>(pstring("Out of range: ") + pstring(cstr)); + throw pexception(pstring("Out of range: ") + pstring(cstr)); } return static_cast<T>(ret); } diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h index 4425842882c..ea19d673931 100644 --- a/src/lib/netlist/plib/pstream.h +++ b/src/lib/netlist/plib/pstream.h @@ -69,7 +69,7 @@ public: { if (c == 10) break; - else if (c != 13) // ignore CR + if (c != 13) // ignore CR m_linebuf += putf8string(1, c); if (!this->readcode(c)) break; @@ -83,9 +83,7 @@ public: if (m_strm->eof()) return false; m_strm->read(&b, 1); - if (m_strm->eof()) - return false; - return true; + return (!m_strm->eof()); } bool readcode(putf8string::traits_type::code_t &c) @@ -170,8 +168,7 @@ class putf8_fmt_writer : public pfmt_writer_t<putf8_fmt_writer>, public putf8_wr public: explicit putf8_fmt_writer(std::ostream *strm) - : pfmt_writer_t() - , putf8_writer(strm) + : putf8_writer(strm) { } diff --git a/src/lib/netlist/plib/pstring.cpp b/src/lib/netlist/plib/pstring.cpp index b6ec39c25ed..a7b18cd7e17 100644 --- a/src/lib/netlist/plib/pstring.cpp +++ b/src/lib/netlist/plib/pstring.cpp @@ -14,9 +14,9 @@ int pstring_t<F>::compare(const pstring_t &right) const noexcept { if (mem_t_size() == 0 && right.mem_t_size() == 0) return 0; - else if (right.mem_t_size() == 0) + if (right.mem_t_size() == 0) return 1; - else if (mem_t_size() == 0) + if (mem_t_size() == 0) return -1; auto si = this->begin(); @@ -29,9 +29,9 @@ int pstring_t<F>::compare(const pstring_t &right) const noexcept if (si != this->end() && ri != right.end()) return static_cast<int>(*si) - static_cast<int>(*ri); - else if (this->mem_t_size() > right.mem_t_size()) + if (this->mem_t_size() > right.mem_t_size()) return 1; - else if (this->mem_t_size() < right.mem_t_size()) + if (this->mem_t_size() < right.mem_t_size()) return -1; return 0; } diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index 4a9d99300bb..86b041cadaf 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -111,7 +111,7 @@ public: template<typename C, std::size_t N, class = typename std::enable_if<std::is_same<C, const mem_t>::value>::type> - pstring_t(C (&string)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + pstring_t(C (&string)[N]) noexcept(false) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) { static_assert(N > 0,"pstring from array of length 0"); // need std::exception since pexception depends on pstring @@ -174,7 +174,7 @@ public: size_type length() const noexcept { return traits_type::len(m_str); } size_type size() const noexcept { return traits_type::len(m_str); } - bool empty() const noexcept { return m_str.size() == 0; } + bool empty() const noexcept { return m_str.empty(); } pstring_t substr(size_type start, size_type nlen = npos) const; int compare(const pstring_t &right) const noexcept; @@ -186,8 +186,8 @@ public: pstring_t& operator+=(const pstring_t &string) { m_str.append(string.m_str); return *this; } pstring_t& operator+=(const code_t c) { traits_type::encode(c, m_str); return *this; } friend pstring_t operator+(const pstring_t &lhs, const pstring_t &rhs) { return pstring_t(lhs) += rhs; } - friend pstring_t operator+(const pstring_t &lhs, const code_t rhs) { return pstring_t(lhs) += rhs; } - friend pstring_t operator+(const code_t lhs, const pstring_t &rhs) { return pstring_t(1, lhs) += rhs; } + friend pstring_t operator+(const pstring_t &lhs, code_t rhs) { return pstring_t(lhs) += rhs; } + friend pstring_t operator+(code_t lhs, const pstring_t &rhs) { return pstring_t(1, lhs) += rhs; } // comparison operators bool operator==(const pstring_t &string) const noexcept { return (compare(string) == 0); } @@ -317,7 +317,9 @@ struct putf8_traits const mem_t *p1 = p; std::size_t i = n; while (i-- > 0) + { p1 += codelen(p1); + } return p1; } }; @@ -336,7 +338,9 @@ struct putf16_traits // FIXME: check that size is equal auto c = static_cast<uint16_t>(*i++); if (!((c & 0xd800) == 0xd800)) + { ret++; + } } return ret; } @@ -347,10 +351,7 @@ struct putf16_traits } static std::size_t codelen(const code_t c) noexcept { - if (c < 0x10000) - return 1; - else // U+10000 U+1FFFFF - return 2; + return (c < 0x10000) ? 1 : 2; // U+10000 U+1FFFFF } static code_t code(const mem_t *p) noexcept { @@ -381,7 +382,9 @@ struct putf16_traits { std::size_t i = n; while (i-- > 0) + { p += codelen(p); + } return p; } }; diff --git a/src/lib/netlist/plib/ptime.h b/src/lib/netlist/plib/ptime.h index 214f121c2df..7168477f49f 100644 --- a/src/lib/netlist/plib/ptime.h +++ b/src/lib/netlist/plib/ptime.h @@ -8,6 +8,8 @@ /// \file ptime.h /// +#include <type_traits> + #include "pconfig.h" #include "pmath.h" // std::floor #include "ptypes.h" @@ -19,6 +21,19 @@ namespace plib { + template <typename T, typename U> + struct ptime_le + { + const static bool value = sizeof(T) <= sizeof(U); + }; + +#if 0 + template<typename T, typename U> + struct ptime_res { + using type = typename std::conditional<sizeof(T) >= sizeof(U), T, U>::type; + }; +#endif + template <typename TYPE, TYPE RES> struct ptime final { @@ -27,6 +42,9 @@ namespace plib using internal_type = TYPE; using mult_type = TYPE; + template <typename altTYPE, altTYPE altRES> + friend struct ptime; + constexpr ptime() noexcept : m_time(0) {} ~ptime() noexcept = default; @@ -43,56 +61,88 @@ namespace plib constexpr explicit ptime(const internal_type nom, const internal_type den) noexcept : m_time(nom * (RES / den)) { } - C14CONSTEXPR ptime &operator+=(const ptime &rhs) noexcept { m_time += rhs.m_time; return *this; } - C14CONSTEXPR ptime &operator-=(const ptime &rhs) noexcept { m_time -= rhs.m_time; return *this; } - C14CONSTEXPR ptime &operator*=(const mult_type factor) noexcept { m_time *= static_cast<internal_type>(factor); return *this; } + // FIXME: check for overflow + template <typename O> + constexpr explicit ptime(const ptime<O, RES> &rhs) noexcept + : m_time(rhs.m_time) { } - friend constexpr const ptime operator-(ptime lhs, const ptime rhs) noexcept + template <typename O> + C14CONSTEXPR ptime &operator+=(const ptime<O, RES> &rhs) noexcept + { + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + m_time += rhs.m_time; + return *this; + } + template <typename O> + C14CONSTEXPR ptime &operator-=(const ptime<O, RES> &rhs) noexcept { - return ptime(lhs.m_time - rhs.m_time); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + m_time -= rhs.m_time; + return *this; } - friend constexpr const ptime operator+(ptime lhs, const ptime rhs) noexcept + template <typename M> + C14CONSTEXPR ptime &operator*=(const M &factor) noexcept { - return ptime(lhs.m_time + rhs.m_time); + static_assert(plib::is_integral<M>::value, "Factor must be an integral type"); + m_time *= factor; + return *this; } - friend constexpr const ptime operator*(ptime lhs, const mult_type factor) noexcept + template <typename O> + constexpr ptime operator-(const ptime<O, RES> &rhs) const noexcept { - return ptime(lhs.m_time * factor); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return ptime(m_time - rhs.m_time); } - friend constexpr mult_type operator/(const ptime lhs, const ptime rhs) noexcept + template <typename O> + constexpr ptime operator+(const ptime<O, RES> &rhs) const noexcept { - return static_cast<mult_type>(lhs.m_time / rhs.m_time); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return ptime(m_time + rhs.m_time); } - friend constexpr bool operator<(const ptime lhs, const ptime rhs) noexcept + template <typename M> + constexpr ptime operator*(const M &factor) const noexcept + { + static_assert(plib::is_integral<M>::value, "Factor must be an integral type"); + return ptime(m_time * static_cast<mult_type>(factor)); + } + + template <typename O> + constexpr mult_type operator/(const ptime<O, RES> &rhs) const noexcept + { + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return static_cast<mult_type>(m_time / rhs.m_time); + } + + friend constexpr bool operator<(const ptime &lhs, const ptime &rhs) noexcept { return (lhs.m_time < rhs.m_time); } - friend constexpr bool operator>(const ptime lhs, const ptime rhs) noexcept + friend constexpr bool operator>(const ptime &lhs, const ptime &rhs) noexcept { return (rhs < lhs); } - friend constexpr bool operator<=(const ptime lhs, const ptime rhs) noexcept + friend constexpr bool operator<=(const ptime &lhs, const ptime &rhs) noexcept { return !(lhs > rhs); } - friend constexpr bool operator>=(const ptime lhs, const ptime rhs) noexcept + friend constexpr bool operator>=(const ptime &lhs, const ptime &rhs) noexcept { return !(lhs < rhs); } - friend constexpr bool operator==(const ptime lhs, const ptime rhs) noexcept + friend constexpr bool operator==(const ptime &lhs, const ptime &rhs) noexcept { return lhs.m_time == rhs.m_time; } - friend constexpr bool operator!=(const ptime lhs, const ptime rhs) noexcept + friend constexpr bool operator!=(const ptime &lhs, const ptime &rhs) noexcept { return !(lhs == rhs); } @@ -118,37 +168,41 @@ namespace plib constexpr double as_float() const noexcept { return as_fp<float>(); } constexpr double as_long_double() const noexcept { return as_fp<long double>(); } + + constexpr ptime shl(unsigned shift) const noexcept { return ptime(m_time << shift); } + constexpr ptime shr(unsigned shift) const noexcept { return ptime(m_time >> shift); } + // for save states .... C14CONSTEXPR internal_type *get_internaltype_ptr() noexcept { return &m_time; } - static constexpr const ptime from_nsec(const internal_type ns) noexcept { return ptime(ns, UINT64_C(1000000000)); } - static constexpr const ptime from_usec(const internal_type us) noexcept { return ptime(us, UINT64_C( 1000000)); } - static constexpr const ptime from_msec(const internal_type ms) noexcept { return ptime(ms, UINT64_C( 1000)); } - static constexpr const ptime from_sec(const internal_type s) noexcept { return ptime(s, UINT64_C( 1)); } - static constexpr const ptime from_hz(const internal_type hz) noexcept { return ptime(1 , hz); } - static constexpr const ptime from_raw(const internal_type raw) noexcept { return ptime(raw); } + static constexpr ptime from_nsec(internal_type ns) noexcept { return ptime(ns, UINT64_C(1000000000)); } + static constexpr ptime from_usec(internal_type us) noexcept { return ptime(us, UINT64_C( 1000000)); } + static constexpr ptime from_msec(internal_type ms) noexcept { return ptime(ms, UINT64_C( 1000)); } + static constexpr ptime from_sec(internal_type s) noexcept { return ptime(s, UINT64_C( 1)); } + static constexpr ptime from_hz(internal_type hz) noexcept { return ptime(1 , hz); } + static constexpr ptime from_raw(internal_type raw) noexcept { return ptime(raw); } template <typename FT> - static constexpr const typename std::enable_if<std::is_floating_point<FT>::value + static constexpr typename std::enable_if<std::is_floating_point<FT>::value #if PUSE_FLOAT128 || std::is_same<FT, __float128>::value #endif , ptime>::type - from_fp(const FT t) noexcept { return ptime(static_cast<internal_type>(plib::floor(t * static_cast<FT>(RES) + static_cast<FT>(0.5))), RES); } + from_fp(FT t) noexcept { return ptime(static_cast<internal_type>(plib::floor(t * static_cast<FT>(RES) + static_cast<FT>(0.5))), RES); } - static constexpr const ptime from_double(const double t) noexcept + static constexpr ptime from_double(double t) noexcept { return from_fp<double>(t); } - static constexpr const ptime from_float(const float t) noexcept + static constexpr ptime from_float(float t) noexcept { return from_fp<float>(t); } - static constexpr const ptime from_long_double(const long double t) noexcept + static constexpr ptime from_long_double(long double t) noexcept { return from_fp<long double>(t); } - static constexpr const ptime zero() noexcept { return ptime(0, RES); } - static constexpr const ptime quantum() noexcept { return ptime(1, RES); } - static constexpr const ptime never() noexcept { return ptime(plib::numeric_limits<internal_type>::max(), RES); } - static constexpr const internal_type resolution() noexcept { return RES; } + static constexpr ptime zero() noexcept { return ptime(0, RES); } + static constexpr ptime quantum() noexcept { return ptime(1, RES); } + static constexpr ptime never() noexcept { return ptime(plib::numeric_limits<internal_type>::max(), RES); } + static constexpr internal_type resolution() noexcept { return RES; } constexpr internal_type in_nsec() const noexcept { return m_time / (RES / UINT64_C(1000000000)); } constexpr internal_type in_usec() const noexcept { return m_time / (RES / UINT64_C( 1000000)); } @@ -161,7 +215,6 @@ namespace plib internal_type m_time; }; - } // namespace plib diff --git a/src/lib/netlist/plib/ptokenizer.cpp b/src/lib/netlist/plib/ptokenizer.cpp index a29b3342333..7ccb0ff8ca2 100644 --- a/src/lib/netlist/plib/ptokenizer.cpp +++ b/src/lib/netlist/plib/ptokenizer.cpp @@ -292,7 +292,7 @@ namespace plib { pstring e = plib::pfmt("{1}:{2}:0: error: {3}\n") (m_source_location.back().file_name(), m_source_location.back().line(), errs()); m_source_location.pop_back(); - while (m_source_location.size() > 0) + while (!m_source_location.empty()) { if (m_source_location.size() == 1) trail = trail_first; diff --git a/src/lib/netlist/plib/ptokenizer.h b/src/lib/netlist/plib/ptokenizer.h index 773df365bed..42858aa76e4 100644 --- a/src/lib/netlist/plib/ptokenizer.h +++ b/src/lib/netlist/plib/ptokenizer.h @@ -66,11 +66,11 @@ namespace plib { struct token_t { explicit token_t(token_type type) - : m_type(type), m_id(), m_token("") + : m_type(type), m_token("") { } token_t(token_type type, const pstring &str) - : m_type(type), m_id(), m_token(str) + : m_type(type), m_token(str) { } token_t(const token_id_t &id, const pstring &str) diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h index 7619faa1348..32ec6e7f9bf 100644 --- a/src/lib/netlist/plib/ptypes.h +++ b/src/lib/netlist/plib/ptypes.h @@ -82,58 +82,6 @@ namespace plib template<typename... Ts> inline void unused_var(Ts&&...) noexcept {} - //============================================================ - // is_pow2 - //============================================================ - template <typename T> - constexpr bool is_pow2(T v) noexcept - { - static_assert(is_integral<T>::value, "is_pow2 needs integer arguments"); - return !(v & (v-1)); - } - - //============================================================ - // abs, lcd, gcm - //============================================================ - - template<typename T> - constexpr - typename std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value, T>::type - abs(T v) noexcept - { - return v < 0 ? -v : v; - } - - template<typename T> - constexpr - typename std::enable_if<std::is_integral<T>::value && std::is_unsigned<T>::value, T>::type - abs(T v) noexcept - { - return v; - } - - template<typename M, typename N> - constexpr typename std::common_type<M, N>::type - gcd(M m, N n) noexcept - { - static_assert(std::is_integral<M>::value, "gcd: M must be an integer"); - static_assert(std::is_integral<N>::value, "gcd: N must be an integer"); - - return m == 0 ? plib::abs(n) - : n == 0 ? plib::abs(m) - : gcd(n, m % n); - } - - template<typename M, typename N> - constexpr typename std::common_type<M, N>::type - lcm(M m, N n) noexcept - { - static_assert(std::is_integral<M>::value, "lcm: M must be an integer"); - static_assert(std::is_integral<N>::value, "lcm: N must be an integer"); - - return (m != 0 && n != 0) ? (plib::abs(m) / gcd(m, n)) * plib::abs(n) : 0; - } - } // namespace plib //============================================================ diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp index 986f5eb75ec..3ab92b97162 100644 --- a/src/lib/netlist/plib/putil.cpp +++ b/src/lib/netlist/plib/putil.cpp @@ -23,10 +23,7 @@ namespace plib pstring basename(const pstring &filename) { auto p=find_last_of(filename, pstring(1, PATH_SEP)); - if (p == pstring::npos) - return filename; - else - return filename.substr(p+1); + return (p == pstring::npos) ? filename : filename.substr(p+1); } pstring path(const pstring &filename) @@ -34,10 +31,10 @@ namespace plib auto p=find_last_of(filename, pstring(1, PATH_SEP)); if (p == pstring::npos) return ""; - else if (p == 0) // root case + if (p == 0) // root case return filename.substr(0, 1); - else - return filename.substr(0, p); + + return filename.substr(0, p); } pstring buildpath(std::initializer_list<pstring> list ) @@ -55,10 +52,8 @@ namespace plib pstring environment(const pstring &var, const pstring &default_val) { - if (std::getenv(var.c_str()) == nullptr) - return default_val; - else - return pstring(std::getenv(var.c_str())); + return (std::getenv(var.c_str()) == nullptr) ? default_val + : pstring(std::getenv(var.c_str())); } } // namespace util @@ -94,7 +89,7 @@ namespace plib std::vector<std::string> result; std::size_t splits = 0; - while(str.size()) + while(!str.empty()) { std::size_t index = str.rfind(token); bool found = index!=std::string::npos; @@ -104,7 +99,7 @@ namespace plib { result.push_back(str.substr(index+token.size())); str = str.substr(0, index); - if (str.size()==0) + if (str.empty()) result.push_back(str); } else diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h index 22abf637f87..b5fe06efb61 100644 --- a/src/lib/netlist/plib/putil.h +++ b/src/lib/netlist/plib/putil.h @@ -19,12 +19,31 @@ #define PSTRINGIFY_HELP(y) # y #define PSTRINGIFY(x) PSTRINGIFY_HELP(x) -#define PNARGS_(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, N, ...) N -#define PNARGS(...) PNARGS_(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) +// Discussion and background of this MSVC bug: https://github.com/mamedev/mame/issues/6106 +/// +/// \brief Macro to work around a bug in MSVC treatment of __VA_ARGS__ +/// +#define PMSVC_VARARG_BUG(MACRO, ARGS) MACRO ARGS -#define PCONCAT_(a, b) a ## b +/// \brief Determine number of arguments in __VA_ARGS__ +/// +/// This macro works up to 16 arguments in __VA_ARGS__ +/// +/// \returns Number of arguments +/// +#define PNARGS(...) PNARGS_1(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + +#define PNARGS_2(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, N, ...) N +#define PNARGS_1(...) PMSVC_VARARG_BUG(PNARGS_2, (__VA_ARGS__)) + +/// \brief Concatenate two arguments after expansion +/// +/// \returns Concatenated expanded arguments +/// #define PCONCAT(a, b) PCONCAT_(a, b) +#define PCONCAT_(a, b) a ## b + #define PSTRINGIFY_1(x) #x #define PSTRINGIFY_2(x, x2) #x, #x2 #define PSTRINGIFY_3(x, ...) #x, PSTRINGIFY_2(__VA_ARGS__) @@ -42,7 +61,13 @@ #define PSTRINGIFY_15(x, ...) #x, PSTRINGIFY_14(__VA_ARGS__) #define PSTRINGIFY_16(x, ...) #x, PSTRINGIFY_15(__VA_ARGS__) -#define PSTRINGIFY_VA(...) PCONCAT(PSTRINGIFY_, PNARGS(__VA_ARGS__))(__VA_ARGS__) +/// \brief Individually stringify up to 16 arguments +/// +/// PSTRINGIFY_VA(a, b, c) will be expanded to "a", "b", "c" +/// +/// \returns List of stringified individual arguments +/// +#define PSTRINGIFY_VA(...) PMSVC_VARARG_BUG(PCONCAT, (PSTRINGIFY_, PNARGS(__VA_ARGS__)))(__VA_ARGS__) // FIXME:: __FUNCTION__ may be not be supported by all compilers. @@ -131,10 +156,8 @@ namespace plib typename TS::stream_ptr stream(const pstring &name) override { - if (name == m_name) - return plib::make_unique<std::stringstream>(m_str); - else - return typename TS::stream_ptr(nullptr); + return (name == m_name) ? + plib::make_unique<std::stringstream>(m_str) : typename TS::stream_ptr(nullptr); } private: pstring m_name; @@ -254,7 +277,7 @@ namespace plib std::vector<pstring> psplit(const pstring &str, const std::vector<pstring> &onstrl); std::vector<std::string> psplit_r(const std::string &stri, const std::string &token, - const std::size_t maxsplit); + std::size_t maxsplit); //============================================================ // penum - strongly typed enumeration @@ -276,7 +299,8 @@ namespace plib template <typename T> explicit ename(T val) { m_v = static_cast<E>(val); } \ bool set_from_string (const pstring &s) { \ int f = from_string_int(strings(), s); \ - if (f>=0) { m_v = static_cast<E>(f); return true; } else { return false; } \ + if (f>=0) { m_v = static_cast<E>(f); return true; } \ + return false;\ } \ operator E() const noexcept {return m_v;} \ bool operator==(const ename &rhs) const noexcept {return m_v == rhs.m_v;} \ diff --git a/src/lib/netlist/plib/vector_ops.h b/src/lib/netlist/plib/vector_ops.h index a34a9bf8a54..71cb540fcc9 100644 --- a/src/lib/netlist/plib/vector_ops.h +++ b/src/lib/netlist/plib/vector_ops.h @@ -76,15 +76,13 @@ namespace plib return value; } - else - { - using b8 = std::array<T, 8>; - PALIGNAS_VECTOROPT() b8 value = {0}; - for (std::size_t i = 0; i < n ; i++ ) - value[i & 7] += v[i]; - return ((value[0] + value[1]) + (value[2] + value[3])) + ((value[4] + value[5]) + (value[6] + value[7])); - } + using b8 = std::array<T, 8>; + PALIGNAS_VECTOROPT() b8 value = {0}; + for (std::size_t i = 0; i < n ; i++ ) + value[i & 7] += v[i]; + + return ((value[0] + value[1]) + (value[2] + value[3])) + ((value[4] + value[5]) + (value[6] + value[7])); } template<typename VV, typename T, typename VR> diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 440c958711d..0f9d1088076 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -23,8 +23,6 @@ #include <ios> #include <iostream> // scanf -#define NLTOOL_VERSION 20190420 - class tool_app_t : public plib::app { public: @@ -121,7 +119,7 @@ public: { pstring res = plib::pfmt(fmt)(std::forward<ARGS>(args)...); auto lines(plib::psplit(res, "\n", false)); - if (lines.size() == 0) + if (lines.empty()) pout(prefix + "\n"); else for (auto &l : lines) @@ -136,7 +134,7 @@ private: void convert(); void static_compile(); - void mac_out(const pstring &s, const bool cont = true); + void mac_out(const pstring &s, bool cont = true); void header_entry(const netlist::factory::element_t *e); void mac(const netlist::factory::element_t *e); @@ -165,8 +163,7 @@ class netlist_data_folder_t : public netlist::source_data_t { public: explicit netlist_data_folder_t(const pstring &folder) - : netlist::source_data_t() - , m_folder(folder) + : m_folder(folder) { } @@ -176,11 +173,9 @@ public: auto strm(plib::make_unique<std::ifstream>(plib::filesystem::u8path(name))); if (strm->fail()) return stream_ptr(nullptr); - else - { - strm->imbue(std::locale::classic()); - return std::move(strm); - } + + strm->imbue(std::locale::classic()); + return std::move(strm); } private: @@ -191,8 +186,7 @@ class netlist_tool_callbacks_t : public netlist::callbacks_t { public: explicit netlist_tool_callbacks_t(tool_app_t &app) - : netlist::callbacks_t() - , m_app(app) + : m_app(app) { } void vlog(const plib::plog_level &l, const pstring &ls) const noexcept override; @@ -224,8 +218,24 @@ public: for (auto & r : roms) setup().register_source(plib::make_unique<netlist_data_folder_t>(r)); +#if 0 using a = plib::psource_str_t<plib::psource_t>; +#if USE_EVAL + const pstring content = + "#define RES_R(res) (res) \n" + "#define RES_K(res) ((res) * 1e3) \n" + "#define RES_M(res) ((res) * 1e6) \n" + "#define CAP_U(cap) ((cap) * 1e-6) \n" + "#define CAP_N(cap) ((cap) * 1e-9) \n" + "#define CAP_P(cap) ((cap) * 1e-12) \n" + "#define IND_U(ind) ((ind) * 1e-6) \n" + "#define IND_N(ind) ((ind) * 1e-9) \n" + "#define IND_P(ind) ((ind) * 1e-12) \n"; + setup().add_include(plib::make_unique<a>("netlist/devices/net_lib.h", content)); +#else setup().add_include(plib::make_unique<a>("netlist/devices/net_lib.h","")); +#endif +#endif for (auto & i : includes) setup().add_include(plib::make_unique<netlist_data_folder_t>(i)); @@ -277,7 +287,7 @@ public: size += s->dt().size() * s->count(); if (buf.size() != size) - plib::pthrow<netlist::nl_exception>("Size different during load state."); + throw netlist::nl_exception("Size different during load state."); char *p = buf.data(); @@ -323,9 +333,9 @@ struct input_t // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) int e = std::sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &val); if (e != 3) - plib::pthrow<netlist::nl_exception>(plib::pfmt("error {1} scanning line {2}\n")(e)(line)); + throw netlist::nl_exception(plib::pfmt("error {1} scanning line {2}\n")(e)(line)); m_value = static_cast<nl_fptype>(val); - m_time = netlist::netlist_time::from_fp(t); + m_time = netlist::netlist_time_ext::from_fp(t); m_param = setup.find_param(pstring(buf.data()), true); } @@ -335,7 +345,7 @@ struct input_t { case netlist::param_t::STRING: case netlist::param_t::POINTER: - plib::pthrow<netlist::nl_exception>(plib::pfmt("param {1} is not numeric\n")(m_param->name())); + throw netlist::nl_exception(plib::pfmt("param {1} is not numeric\n")(m_param->name())); case netlist::param_t::DOUBLE: static_cast<netlist::param_fp_t*>(m_param)->setTo(m_value); break; @@ -348,7 +358,7 @@ struct input_t } } - netlist::netlist_time m_time; + netlist::netlist_time_ext m_time; netlist::param_t *m_param; nl_fptype m_value; }; @@ -360,7 +370,7 @@ static std::vector<input_t> read_input(const netlist::setup_t &setup, const pstr { plib::putf8_reader r = plib::putf8_reader(std::ifstream(plib::filesystem::u8path(fname))); if (r.stream().fail()) - plib::pthrow<netlist::nl_exception>(netlist::MF_FILE_OPEN_ERROR(fname)); + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(fname)); r.stream().imbue(std::locale::classic()); pstring l; while (r.readline(l)) @@ -379,7 +389,7 @@ void tool_app_t::run() { plib::chrono::timer<plib::chrono::system_ticks> t; std::vector<input_t> inps; - netlist::netlist_time ttr; + netlist::netlist_time_ext ttr; netlist_tool_t nt(*this, "netlist"); { @@ -400,7 +410,7 @@ void tool_app_t::run() nt.exec().reset(); inps = read_input(nt.setup(), opt_inp()); - ttr = netlist::netlist_time::from_fp(opt_ttr()); + ttr = netlist::netlist_time_ext::from_fp(opt_ttr()); } @@ -408,7 +418,7 @@ void tool_app_t::run() t.reset(); - netlist::netlist_time nlt = nt.exec().time(); + netlist::netlist_time_ext nlt = nt.exec().time(); { auto t_guard(t.guard()); @@ -417,7 +427,7 @@ void tool_app_t::run() { std::ifstream strm(plib::filesystem::u8path(opt_loadstate())); if (strm.fail()) - plib::pthrow<netlist::nl_exception>(netlist::MF_FILE_OPEN_ERROR(opt_loadstate())); + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_loadstate())); strm.imbue(std::locale::classic()); plib::pbinary_reader reader(strm); std::vector<char> loadstate; @@ -455,7 +465,7 @@ void tool_app_t::run() auto savestate = nt.save_state(); std::ofstream strm(plib::filesystem::u8path(opt_savestate()), std::ios_base::binary); if (strm.fail()) - plib::pthrow<plib::file_open_e>(opt_savestate()); + throw plib::file_open_e(opt_savestate()); strm.imbue(std::locale::classic()); plib::pbinary_writer writer(strm); @@ -503,14 +513,14 @@ void tool_app_t::validate() //pout("Validation errors: {}\n", m_errors); if (m_warnings + m_errors > 0) - plib::pthrow<netlist::nl_exception>("validation: {1} errors {2} warnings", m_errors, m_warnings); + throw netlist::nl_exception("validation: {1} errors {2} warnings", m_errors, m_warnings); } void tool_app_t::static_compile() { if (!opt_dir.was_specified()) - plib::pthrow<netlist::nl_exception>("--dir option needs to be specified"); + throw netlist::nl_exception("--dir option needs to be specified"); netlist_tool_t nt(*this, "netlist"); @@ -570,7 +580,7 @@ static doc_ext read_docsrc(const pstring &fname, const pstring &id) //printf("file %s\n", fname.c_str()); plib::putf8_reader r = plib::putf8_reader(std::ifstream(plib::filesystem::u8path(fname))); if (r.stream().fail()) - plib::pthrow<netlist::nl_exception>(netlist::MF_FILE_OPEN_ERROR(fname)); + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(fname)); r.stream().imbue(std::locale::classic()); doc_ext ret; @@ -586,8 +596,8 @@ static doc_ext read_docsrc(const pstring &fname, const pstring &id) if (l != "") { auto a(plib::psplit(l, ":", true)); - if ((a.size() < 1) || (a.size() > 2)) - plib::pthrow<netlist::nl_exception>(l+" size mismatch"); + if (a.empty() || (a.size() > 2)) + throw netlist::nl_exception(l+" size mismatch"); pstring n(plib::trim(a[0])); pstring v(a.size() < 2 ? "" : plib::trim(a[1])); if (n == "Identifier") @@ -623,11 +633,11 @@ static doc_ext read_docsrc(const pstring &fname, const pstring &id) else if (n == "Example") { ret.example = plib::psplit(plib::trim(v),",",true); - if (ret.example.size() != 2 && ret.example.size() != 0) - plib::pthrow<netlist::nl_exception>("Example requires 2 parameters, but found {1}", ret.example.size()); + if (ret.example.size() != 2 && !ret.example.empty()) + throw netlist::nl_exception("Example requires 2 parameters, but found {1}", ret.example.size()); } else - plib::pthrow<netlist::nl_exception>(n); + throw netlist::nl_exception(n); } } } @@ -677,16 +687,12 @@ void tool_app_t::header_entry(const netlist::factory::element_t *e) for (const auto &s : v) { - pstring r(plib::replace_all(plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"), "@","")); - if (plib::startsWith(s, "+")) - vs += ", p" + r; - else if (plib::startsWith(s, "@")) + if (!plib::startsWith(s, "@")) { - // automatically connected - //mac_out("\tNET_CONNECT(name, " + r + ", " + r + ")"); - } - else + // @ gets automatically connected + const pstring r(plib::replace_all(plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"), "@","")); vs += ", p" + r; + } } mac_out("\tNET_REGISTER_DEVEXT(" + e->name() +", name" + vs + ")", false); @@ -702,7 +708,7 @@ void tool_app_t::mac(const netlist::factory::element_t *e) vs += ", " + plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"); pout("{1}(name{2})\n", e->name(), vs); - if (v.size() > 0) + if (!v.empty()) { pout("/*\n"); for (const auto &s : v) @@ -833,7 +839,7 @@ void tool_app_t::create_docheader() poutprefix("///", " @section {}_2 Connection Diagram", d.id); poutprefix("///", ""); - if (d.pinalias.size() > 0) + if (!d.pinalias.empty()) { poutprefix("///", " <pre>"); if (d.package == "DIP") @@ -863,7 +869,7 @@ void tool_app_t::create_docheader() poutprefix("///", " @section {}_4 Limitations", d.id); poutprefix("///", ""); poutprefix("///", " {}", d.limitations); - if (d.example.size() > 0) + if (!d.example.empty()) { poutprefix("///", ""); poutprefix("///", " @section {}_5 Example", d.id); @@ -917,7 +923,7 @@ void tool_app_t::listdevices() } out += ")"; pout("{}\n", out); - if (terms.size() > 0) + if (!terms.empty()) { pstring t = ""; for (auto & j : terms) @@ -945,7 +951,7 @@ void tool_app_t::convert() { std::ifstream strm(plib::filesystem::u8path(opt_file())); if (strm.fail()) - plib::pthrow<netlist::nl_exception>(netlist::MF_FILE_OPEN_ERROR(opt_file())); + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_file())); strm.imbue(std::locale::classic()); plib::copystream(ostrm, strm); } @@ -1008,12 +1014,12 @@ int tool_app_t::execute() if (opt_version()) { pout( - "nltool (netlist) " PSTRINGIFY(NLTOOL_VERSION) "\n" - "Copyright (C) 2019 Couriersud\n" + "nltool (netlist) {1}\n" + "Copyright (C) 2020 Couriersud\n" "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n\n" - "Written by Couriersud.\n"); + "Written by Couriersud.\n", netlist::netlist_state_t::version()); if (opt_verb()) { std::vector<std::pair<pstring, pstring>> defs; @@ -1027,7 +1033,7 @@ int tool_app_t::execute() } m_defines = opt_defines(); - m_defines.emplace_back("NLTOOL_VERSION=" PSTRINGIFY(NLTOOL_VERSION)); + m_defines.emplace_back("NLTOOL_VERSION=" + netlist::netlist_state_t::version()); if (opt_prepro()) m_defines.emplace_back("__PREPROCESSOR_DEBUG__=1"); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 84e32bfc04a..93a6d6e24a5 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -63,7 +63,7 @@ public: m_f.write(reinterpret_cast<const std::ostream::char_type *>(&val), sizeof(T)); } - void write_sample(int *sample) + void write_sample(const int *sample) { m_data.len += m_fmt.block_align; for (std::size_t i = 0; i < channels(); i++) @@ -494,8 +494,6 @@ void nlwav_app::convert(std::ostream &ostrm) int nlwav_app::execute() { - for (auto &i : opt_args()) - pout("Hello : " + i + "\n"); if (opt_help()) { pout(usage()); @@ -506,7 +504,7 @@ int nlwav_app::execute() { pout( "nlwav (netlist) 0.1\n" - "Copyright (C) 2019 Couriersud\n" + "Copyright (C) 2020 Couriersud\n" "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n\n" @@ -534,7 +532,7 @@ int nlwav_app::execute() { auto outstrm(std::ofstream(plib::filesystem::u8path(opt_out()))); if (outstrm.fail()) - plib::pthrow<plib::file_open_e>(opt_out()); + throw plib::file_open_e(opt_out()); outstrm.imbue(std::locale::classic()); convert(outstrm); } diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp index 679632cfc15..f6d9c0c579b 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.cpp +++ b/src/lib/netlist/solver/nld_matrix_solver.cpp @@ -2,6 +2,7 @@ // copyright-holders:Couriersud #include "nld_matrix_solver.h" +#include "nl_setup.h" #include "plib/putil.h" namespace netlist @@ -45,7 +46,7 @@ namespace solver , m_stat_calculations(*this, "m_stat_calculations", 0) , m_stat_newton_raphson(*this, "m_stat_newton_raphson", 0) , m_stat_vsolver_calls(*this, "m_stat_vsolver_calls", 0) - , m_last_step(*this, "m_last_step", netlist_time::zero()) + , m_last_step(*this, "m_last_step", netlist_time_ext::zero()) , m_fb_sync(*this, "FB_sync") , m_Q_sync(*this, "Q_sync") , m_ops(0) @@ -57,6 +58,11 @@ namespace solver setup_matrix(); } + analog_net_t *matrix_solver_t::get_connected_net(terminal_t *term) + { + return &state().setup().get_connected_terminal(*term)->net(); + } + void matrix_solver_t::setup_base(const analog_net_t::list_t &nets) { log().debug("New solver setup\n"); @@ -121,7 +127,7 @@ namespace solver break; case detail::terminal_type::OUTPUT: log().fatal(MF_UNHANDLED_ELEMENT_1_FOUND(p->name())); - plib::pthrow<nl_exception>(MF_UNHANDLED_ELEMENT_1_FOUND(p->name())); + throw nl_exception(MF_UNHANDLED_ELEMENT_1_FOUND(p->name())); } } } @@ -211,7 +217,7 @@ namespace solver for (std::size_t i = 0; i < term.count(); i++) //FIXME: this is weird if (other[i] != -1) - other[i] = get_net_idx(&term.terms()[i]->connected_terminal()->net()); + other[i] = get_net_idx(get_connected_net(term.terms()[i])); } } @@ -342,6 +348,36 @@ namespace solver } } + void matrix_solver_t::set_pointers() + { + const std::size_t iN = this->m_terms.size(); + + std::size_t max_count = 0; + std::size_t max_rail = 0; + for (std::size_t k = 0; k < iN; k++) + { + max_count = std::max(max_count, m_terms[k].count()); + max_rail = std::max(max_rail, m_terms[k].railstart()); + } + + m_gtn.resize(iN, max_count); + m_gonn.resize(iN, max_count); + m_Idrn.resize(iN, max_count); + m_connected_net_Vn.resize(iN, max_count); + + for (std::size_t k = 0; k < iN; k++) + { + auto count = m_terms[k].count(); + + for (std::size_t i = 0; i < count; i++) + { + m_terms[k].terms()[i]->set_ptrs(&m_gtn[k][i], &m_gonn[k][i], &m_Idrn[k][i]); + //m_connected_net_Vn[k][i] = m_terms[k].terms()[i]->connected_terminal()->net().Q_Analog_state_ptr(); + m_connected_net_Vn[k][i] = get_connected_net(m_terms[k].terms()[i])->Q_Analog_state_ptr(); + } + } + } + void matrix_solver_t::update_inputs() { // avoid recursive calls. Inputs are updated outside this call @@ -358,7 +394,7 @@ namespace solver void matrix_solver_t::reset() { - m_last_step = netlist_time::zero(); + m_last_step = netlist_time_ext::zero(); } void matrix_solver_t::update() noexcept @@ -397,18 +433,18 @@ namespace solver d->timestep(dd); } - const netlist_time matrix_solver_t::solve(netlist_time now) + netlist_time matrix_solver_t::solve(netlist_time_ext now) { - const netlist_time delta = now - m_last_step; + const netlist_time_ext delta = now - m_last_step(); // We are already up to date. Avoid oscillations. // FIXME: Make this a parameter! - if (delta < netlist_time::quantum()) + if (delta < netlist_time_ext::quantum()) return netlist_time::zero(); // update all terminals for new time step m_last_step = now; - step(delta); + step(static_cast<netlist_time>(delta)); ++m_stat_vsolver_calls; if (has_dynamic_devices()) @@ -438,9 +474,7 @@ namespace solver this->vsolve_non_dynamic(false); } - const netlist_time next_time_step = compute_next_timestep(delta.as_fp<nl_fptype>()); - - return next_time_step; + return compute_next_timestep(delta.as_fp<nl_fptype>()); } int matrix_solver_t::get_net_idx(const analog_net_t *net) const noexcept @@ -468,7 +502,7 @@ namespace solver for (std::size_t i = 0; i < term.count(); i++) { - auto col = get_net_idx(&term.terms()[i]->connected_terminal()->net()); + auto col = get_net_idx(get_connected_net(term.terms()[i])); if (col != -1) { if (col==row) col = diag; @@ -496,7 +530,7 @@ namespace solver auto &term = m_terms[row]; for (std::size_t i = 0; i < term.count(); i++) { - auto col = get_net_idx(&term.terms()[i]->connected_terminal()->net()); + auto col = get_net_idx(get_connected_net(term.terms()[i])); if (col >= 0) { auto colu = static_cast<std::size_t>(col); @@ -510,29 +544,27 @@ namespace solver } } } - return weight; // / static_cast<nl_fptype>(term.railstart()); + return weight; } } void matrix_solver_t::add_term(std::size_t net_idx, terminal_t *term) { - if (term->connected_terminal()->net().isRailNet()) + if (get_connected_net(term)->isRailNet()) { m_rails_temp[net_idx].add_terminal(term, -1, false); } else { - int ot = get_net_idx(&term->connected_terminal()->net()); + int ot = get_net_idx(get_connected_net(term)); if (ot>=0) { m_terms[net_idx].add_terminal(term, ot, true); } - // Should this be allowed ? - else // if (ot<0) + else { - m_rails_temp[net_idx].add_terminal(term, ot, true); log().fatal(MF_FOUND_TERM_WITH_MISSING_OTHERNET(term->name())); - plib::pthrow<nl_exception>(MF_FOUND_TERM_WITH_MISSING_OTHERNET(term->name())); + throw nl_exception(MF_FOUND_TERM_WITH_MISSING_OTHERNET(term->name())); } } } diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h index f1a4cf928ab..a6b3c6774fd 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.h +++ b/src/lib/netlist/solver/nld_matrix_solver.h @@ -77,7 +77,6 @@ namespace solver // special , m_use_gabs(parent, "USE_GABS", true) - , m_use_linear_prediction(parent, "USE_LINEAR_PREDICTION", false) // // savings are eaten up by effort { m_min_timestep = m_dynamic_min_ts(); @@ -112,7 +111,6 @@ namespace solver param_enum_t<matrix_sort_type_e> m_sort_type; param_logic_t m_use_gabs; - param_logic_t m_use_linear_prediction; nl_fptype m_min_timestep; nl_fptype m_max_timestep; @@ -179,11 +177,11 @@ namespace solver // after every call to solve, update inputs must be called. // this can be done as well as a batch to ease parallel processing. - const netlist_time solve(netlist_time now); + netlist_time solve(netlist_time_ext now); void update_inputs(); - bool has_dynamic_devices() const noexcept { return m_dynamic_devices.size() > 0; } - bool has_timestep_devices() const noexcept { return m_step_devices.size() > 0; } + bool has_dynamic_devices() const noexcept { return !m_dynamic_devices.empty(); } + bool has_timestep_devices() const noexcept { return !m_step_devices.empty(); } void update_forced(); void update_after(netlist_time after) noexcept @@ -206,16 +204,15 @@ namespace solver std::size_t ops() { return m_ops; } protected: + template <typename T> + using aligned_alloc = plib::aligned_allocator<T, PALIGN_VECTOROPT>; matrix_solver_t(netlist_state_t &anetlist, const pstring &name, const analog_net_t::list_t &nets, const solver_parameters_t *params); - virtual unsigned vsolve_non_dynamic(const bool newton_raphson) = 0; - virtual netlist_time compute_next_timestep(const nl_fptype cur_ts) = 0; - - template <typename T> - using aligned_alloc = plib::aligned_allocator<T, PALIGN_VECTOROPT>; + virtual unsigned vsolve_non_dynamic(bool newton_raphson) = 0; + virtual netlist_time compute_next_timestep(nl_fptype cur_ts) = 0; plib::pmatrix2d<nl_fptype, aligned_alloc<nl_fptype>> m_gonn; plib::pmatrix2d<nl_fptype, aligned_alloc<nl_fptype>> m_gtn; @@ -238,7 +235,7 @@ namespace solver state_var<std::size_t> m_stat_newton_raphson; state_var<std::size_t> m_stat_vsolver_calls; - state_var<netlist_time> m_last_step; + state_var<netlist_time_ext> m_last_step; std::vector<core_device_t *> m_step_devices; std::vector<core_device_t *> m_dynamic_devices; @@ -248,7 +245,7 @@ namespace solver std::size_t m_ops; // base setup - called from constructor - void setup_base(const analog_net_t::list_t &nets); + void setup_base(const analog_net_t::list_t &nets) noexcept(false); void sort_terms(matrix_sort_type_e sort); @@ -259,39 +256,15 @@ namespace solver std::pair<int, int> get_left_right_of_diag(std::size_t irow, std::size_t idiag); nl_fptype get_weight_around_diag(std::size_t row, std::size_t diag); - void add_term(std::size_t net_idx, terminal_t *term); + void add_term(std::size_t net_idx, terminal_t *term) noexcept(false); // calculate matrix void setup_matrix(); - void set_pointers() - { - const std::size_t iN = this->m_terms.size(); - - std::size_t max_count = 0; - std::size_t max_rail = 0; - for (std::size_t k = 0; k < iN; k++) - { - max_count = std::max(max_count, m_terms[k].count()); - max_rail = std::max(max_rail, m_terms[k].railstart()); - } - - m_gtn.resize(iN, max_count); - m_gonn.resize(iN, max_count); - m_Idrn.resize(iN, max_count); - m_connected_net_Vn.resize(iN, max_count); - - for (std::size_t k = 0; k < iN; k++) - { - auto count = m_terms[k].count(); + void set_pointers(); - for (std::size_t i = 0; i < count; i++) - { - m_terms[k].terms()[i]->set_ptrs(&m_gtn[k][i], &m_gonn[k][i], &m_Idrn[k][i]); - m_connected_net_Vn[k][i] = m_terms[k].terms()[i]->connected_terminal()->net().Q_Analog_state_ptr(); - } - } - } + private: + analog_net_t *get_connected_net(terminal_t *term); }; @@ -451,12 +424,13 @@ namespace solver { for (std::size_t k = 0; k < size(); k++) { - auto &t = m_terms[k]; - //const nl_fptype DD_n = (n->Q_Analog() - t->m_last_V); + const auto &t = m_terms[k]; + const auto v(t.template getV<nl_fptype>()); // avoid floating point exceptions - const nl_fptype DD_n = std::max(-fp_constants<nl_fptype>::TIMESTEP_MAXDIFF(), - std::min(+fp_constants<nl_fptype>::TIMESTEP_MAXDIFF(),(t.template getV<nl_fptype>() - m_last_V[k]))); + std::min(+fp_constants<nl_fptype>::TIMESTEP_MAXDIFF(),(v - m_last_V[k]))); + + m_last_V[k] = v; const nl_fptype hn = cur_ts; //printf("%g %g %g %g\n", DD_n, hn, t.m_DD_n_m_1, t.m_h_n_m_1); @@ -470,25 +444,15 @@ namespace solver else new_net_timestep = m_params.m_max_timestep; - if (new_net_timestep < new_solver_timestep) - new_solver_timestep = new_net_timestep; - - m_last_V[k] = t.template getV<nl_fptype>(); - } - if (new_solver_timestep < m_params.m_min_timestep) - { - new_solver_timestep = m_params.m_min_timestep; + new_solver_timestep = std::min(new_net_timestep, new_solver_timestep); } + new_solver_timestep = std::max(new_solver_timestep, m_params.m_min_timestep); } - //if (new_solver_timestep > 10.0 * hn) - // new_solver_timestep = 10.0 * hn; - // - // FIXME: Factor 2 below is important. Without, we get timing issues. This must be a bug elsewhere. + // FIXME: Factor 2 below is important. Without, we get timing issues. This must be a bug elsewhere. return std::max(netlist_time::from_fp(new_solver_timestep), netlist_time::quantum() * 2); } - template <typename M> void build_mat_ptr(M &mat) { diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h index cd808c2ee3c..fbb8e4a8250 100644 --- a/src/lib/netlist/solver/nld_ms_direct.h +++ b/src/lib/netlist/solver/nld_ms_direct.h @@ -30,7 +30,7 @@ namespace solver matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const analog_net_t::list_t &nets, - const solver_parameters_t *params, const std::size_t size); + const solver_parameters_t *params, std::size_t size); void reset() override { matrix_solver_t::reset(); } @@ -42,8 +42,8 @@ namespace solver static constexpr const std::size_t SIZEABS = plib::parray<FT, SIZE>::SIZEABS(); static constexpr const std::size_t m_pitch_ABS = (((SIZEABS + 0) + 7) / 8) * 8; - unsigned vsolve_non_dynamic(const bool newton_raphson) override; - unsigned solve_non_dynamic(const bool newton_raphson); + unsigned vsolve_non_dynamic(bool newton_raphson) override; + unsigned solve_non_dynamic(bool newton_raphson); void LE_solve(); @@ -158,7 +158,7 @@ namespace solver } template <typename FT, int SIZE> - unsigned matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(bool newton_raphson) { this->LE_solve(); this->LE_back_subst(this->m_new_V); @@ -171,7 +171,7 @@ namespace solver } template <typename FT, int SIZE> - unsigned matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { // populate matrix this->clear_square_mat(m_A); @@ -184,7 +184,7 @@ namespace solver matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const analog_net_t::list_t &nets, const solver_parameters_t *params, - const std::size_t size) + std::size_t size) : matrix_solver_ext_t<FT, SIZE>(anetlist, name, nets, params, size) , m_pitch(m_pitch_ABS ? m_pitch_ABS : (((size + 0) + 7) / 8) * 8) , m_A(size, m_pitch) diff --git a/src/lib/netlist/solver/nld_ms_direct1.h b/src/lib/netlist/solver/nld_ms_direct1.h index 3a4e3778208..c0e6d63719c 100644 --- a/src/lib/netlist/solver/nld_ms_direct1.h +++ b/src/lib/netlist/solver/nld_ms_direct1.h @@ -32,7 +32,7 @@ namespace solver // ---------------------------------------------------------------------------------------- // matrix_solver - Direct1 // ---------------------------------------------------------------------------------------- - unsigned vsolve_non_dynamic(const bool newton_raphson) override + unsigned vsolve_non_dynamic(bool newton_raphson) override { this->clear_square_mat(this->m_A); this->fill_matrix_and_rhs(); diff --git a/src/lib/netlist/solver/nld_ms_direct2.h b/src/lib/netlist/solver/nld_ms_direct2.h index 3e2b9727776..aa2f8d17eb9 100644 --- a/src/lib/netlist/solver/nld_ms_direct2.h +++ b/src/lib/netlist/solver/nld_ms_direct2.h @@ -32,7 +32,7 @@ namespace solver const solver_parameters_t *params) : matrix_solver_direct_t<FT, 2>(anetlist, name, nets, params, 2) {} - unsigned vsolve_non_dynamic(const bool newton_raphson) override + unsigned vsolve_non_dynamic(bool newton_raphson) override { this->clear_square_mat(this->m_A); this->fill_matrix_and_rhs(); diff --git a/src/lib/netlist/solver/nld_ms_direct_lu.h b/src/lib/netlist/solver/nld_ms_direct_lu.h index 1e1f7f1f158..5a8cbffbda6 100644 --- a/src/lib/netlist/solver/nld_ms_direct_lu.h +++ b/src/lib/netlist/solver/nld_ms_direct_lu.h @@ -38,12 +38,12 @@ public: unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } - int vsolve_non_dynamic(const bool newton_raphson); + int vsolve_non_dynamic(bool newton_raphson); protected: virtual void add_term(int net_idx, terminal_t *term) override; - int solve_non_dynamic(const bool newton_raphson); + int solve_non_dynamic(bool newton_raphson); void build_LE_A(); void build_LE_RHS(nl_double * RESTRICT rhs); @@ -565,7 +565,7 @@ void matrix_solver_direct_t<m_N, storage_N>::store( template <unsigned m_N, unsigned storage_N> -unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(bool newton_raphson) { nl_double new_V[storage_N]; // = { 0.0 }; @@ -587,7 +587,7 @@ unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool ne } template <unsigned m_N, unsigned storage_N> -int matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +int matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(bool newton_raphson) { this->build_LE_A(); this->build_LE_RHS(m_RHS); diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h index e72a645b33e..be3fd5fa524 100644 --- a/src/lib/netlist/solver/nld_ms_gcr.h +++ b/src/lib/netlist/solver/nld_ms_gcr.h @@ -110,7 +110,7 @@ namespace solver } } - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned vsolve_non_dynamic(bool newton_raphson) override; std::pair<pstring, pstring> create_solver_code() override; @@ -146,7 +146,7 @@ namespace solver { const auto &nzbd = this->m_terms[i].m_nzbd; - if (nzbd.size() > 0) + if (!nzbd.empty()) { std::size_t pi = mat.diag[i]; @@ -226,7 +226,7 @@ namespace solver } template <typename FT, int SIZE> - unsigned matrix_solver_GCR_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_GCR_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { // populate matrix mat.set_scalar(plib::constants<FT>::zero()); diff --git a/src/lib/netlist/solver/nld_ms_gmres.h b/src/lib/netlist/solver/nld_ms_gmres.h index 6900f7f8f28..586a0ef8c26 100644 --- a/src/lib/netlist/solver/nld_ms_gmres.h +++ b/src/lib/netlist/solver/nld_ms_gmres.h @@ -78,7 +78,7 @@ namespace solver } } - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned vsolve_non_dynamic(bool newton_raphson) override; private: @@ -95,7 +95,7 @@ namespace solver // ---------------------------------------------------------------------------------------- template <typename FT, int SIZE> - unsigned matrix_solver_GMRES_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_GMRES_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { const std::size_t iN = this->size(); diff --git a/src/lib/netlist/solver/nld_ms_sm.h b/src/lib/netlist/solver/nld_ms_sm.h index c3aae29b798..bb7057c9687 100644 --- a/src/lib/netlist/solver/nld_ms_sm.h +++ b/src/lib/netlist/solver/nld_ms_sm.h @@ -67,8 +67,8 @@ namespace solver void reset() override { matrix_solver_t::reset(); } protected: - unsigned vsolve_non_dynamic(const bool newton_raphson) override; - unsigned solve_non_dynamic(const bool newton_raphson); + unsigned vsolve_non_dynamic(bool newton_raphson) override; + unsigned solve_non_dynamic(bool newton_raphson); void LE_invert(); @@ -197,7 +197,7 @@ namespace solver } template <typename FT, int SIZE> - unsigned matrix_solver_sm_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_sm_t<FT, SIZE>::solve_non_dynamic(bool newton_raphson) { static constexpr const bool incremental = true; const std::size_t iN = this->size(); @@ -283,7 +283,7 @@ namespace solver } template <typename FT, int SIZE> - unsigned matrix_solver_sm_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_sm_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { this->clear_square_mat(this->m_A); diff --git a/src/lib/netlist/solver/nld_ms_sor.h b/src/lib/netlist/solver/nld_ms_sor.h index a5ac1fc7fc2..666025db260 100644 --- a/src/lib/netlist/solver/nld_ms_sor.h +++ b/src/lib/netlist/solver/nld_ms_sor.h @@ -39,7 +39,7 @@ namespace solver { } - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned vsolve_non_dynamic(bool newton_raphson) override; private: state_var<float_type> m_lp_fact; @@ -52,7 +52,7 @@ namespace solver // ---------------------------------------------------------------------------------------- template <typename FT, int SIZE> - unsigned matrix_solver_SOR_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_SOR_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { const std::size_t iN = this->size(); bool resched = false; diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h index 68632b82be9..3772c78b689 100644 --- a/src/lib/netlist/solver/nld_ms_sor_mat.h +++ b/src/lib/netlist/solver/nld_ms_sor_mat.h @@ -36,78 +36,22 @@ namespace solver const analog_net_t::list_t &nets, const solver_parameters_t *params, std::size_t size) : matrix_solver_direct_t<FT, SIZE>(anetlist, name, nets, params, size) - , m_Vdelta(*this, "m_Vdelta", std::vector<float_type>(size)) , m_omega(*this, "m_omega", static_cast<float_type>(params->m_gs_sor)) - , m_lp_fact(*this, "m_lp_fact", 0) { } - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned vsolve_non_dynamic(bool newton_raphson) override; private: - //state_var<float_type[storage_N]> m_Vdelta; - state_var<std::vector<float_type>> m_Vdelta; - state_var<float_type> m_omega; - state_var<float_type> m_lp_fact; - }; // ---------------------------------------------------------------------------------------- // matrix_solver - Gauss - Seidel // ---------------------------------------------------------------------------------------- - #if 0 - //FIXME: move to solve_base - template <unsigned m_N, unsigned storage_N> - float_type matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve() - { - // - // enable linear prediction on first newton pass - // - - if (this->m_params->use_linear_prediction) - for (unsigned k = 0; k < this->size(); k++) - { - this->m_last_V[k] = this->m_nets[k]->m_cur_Analog; - this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact; - } - else - for (unsigned k = 0; k < this->size(); k++) - { - this->m_last_V[k] = this->m_nets[k]->m_cur_Analog; - } - - this->solve_base(this); - - if (this->m_params->use_linear_prediction) - { - float_type sq = 0; - float_type sqo = 0; - const float_type rez_cts = plib::reciprocal(this->current_timestep()); - for (unsigned k = 0; k < this->size(); k++) - { - const analog_net_t *n = this->m_nets[k]; - const float_type nv = (n->Q_Analog() - this->m_last_V[k]) * rez_cts ; - sq += nv * nv; - sqo += this->m_Vdelta[k] * this->m_Vdelta[k]; - this->m_Vdelta[k] = nv; - } - - // FIXME: used to be 1e90, but this would not be compatible with float - if (sqo > NL_FCONST(1e-20)) - m_lp_fact = std::min(std::sqrt(sq/sqo), (float_type) 2.0); - else - m_lp_fact = NL_FCONST(0.0); - } - - - return this->compute_next_timestep(); - } - #endif - template <typename FT, int SIZE> - unsigned matrix_solver_SOR_mat_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_SOR_mat_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { // The matrix based code looks a lot nicer but actually is 30% slower than // the optimized code which works directly on the data structures. diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h index 5a78b668e62..345b7a13d2a 100644 --- a/src/lib/netlist/solver/nld_ms_w.h +++ b/src/lib/netlist/solver/nld_ms_w.h @@ -75,8 +75,8 @@ namespace solver void reset() override { matrix_solver_t::reset(); } protected: - unsigned vsolve_non_dynamic(const bool newton_raphson) override; - unsigned solve_non_dynamic(const bool newton_raphson); + unsigned vsolve_non_dynamic(bool newton_raphson) override; + unsigned solve_non_dynamic(bool newton_raphson); void LE_invert(); @@ -208,7 +208,7 @@ namespace solver template <typename FT, int SIZE> - unsigned matrix_solver_w_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_w_t<FT, SIZE>::solve_non_dynamic(bool newton_raphson) { const auto iN = this->size(); @@ -351,7 +351,7 @@ namespace solver } template <typename FT, int SIZE> - unsigned matrix_solver_w_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + unsigned matrix_solver_w_t<FT, SIZE>::vsolve_non_dynamic(bool newton_raphson) { this->clear_square_mat(this->m_A); this->fill_matrix_and_rhs(); diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 4b24e003d52..977b6ae7b20 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -27,6 +27,7 @@ #endif #include "netlist/nl_factory.h" +#include "netlist/nl_setup.h" // FIXME: only needed for splitter code #include "nld_matrix_solver.h" #include "nld_ms_direct.h" #include "nld_ms_direct1.h" @@ -68,10 +69,10 @@ namespace devices if (m_params.m_dynamic_ts) return; - netlist_time now(exec().time()); + netlist_time_ext now(exec().time()); // force solving during start up if there are no time-step devices // FIXME: Needs a more elegant solution - bool force_solve = (now < netlist_time::from_fp<decltype(m_params.m_max_timestep)>(2 * m_params.m_max_timestep)); + bool force_solve = (now < netlist_time_ext::from_fp<decltype(m_params.m_max_timestep)>(2 * m_params.m_max_timestep)); std::size_t nthreads = std::min(static_cast<std::size_t>(m_params.m_parallel()), plib::omp::get_max_threads()); @@ -252,36 +253,55 @@ namespace devices struct net_splitter { - bool already_processed(const analog_net_t &n) const + bool already_processed(const analog_net_t &n) { // no need to process rail nets - these are known variables if (n.isRailNet()) return true; + // First check if it is in a previous group. + // In this case we need to merge this group into the current group + if (groupspre.size() > 1) + { + for (std::size_t i = 0; i<groupspre.size() - 1; i++) + if (plib::container::contains(groupspre[i], &n)) + { + // copy all nets + for (auto & cn : groupspre[i]) + if (!plib::container::contains(groupspre.back(), cn)) + groupspre.back().push_back(cn); + // clear + groupspre[i].clear(); + return true; + } + } // if it's already processed - no need to continue - for (auto & grp : groups) - if (plib::container::contains(grp, &n)) - return true; + if (!groupspre.empty() && plib::container::contains(groupspre.back(), &n)) + return true; return false; } - void process_net(analog_net_t &n) + void process_net(netlist_state_t &netlist, analog_net_t &n) { // ignore empty nets. FIXME: print a warning message + netlist.log().verbose("Net {}", n.name()); if (n.num_cons() == 0) return; // add the net - groups.back().push_back(&n); + groupspre.back().push_back(&n); // process all terminals connected to this net for (auto &term : n.core_terms()) { + netlist.log().verbose("Term {} {}", term->name(), static_cast<int>(term->type())); // only process analog terminals if (term->is_type(detail::terminal_type::TERMINAL)) { auto *pt = static_cast<terminal_t *>(term); // check the connected terminal - analog_net_t &connected_net = pt->connected_terminal()->net(); + // analog_net_t &connected_net = pt->connected_terminal()->net(); + analog_net_t &connected_net = netlist.setup().get_connected_terminal(*pt)->net(); + netlist.log().verbose(" Connected net {}", connected_net.name()); if (!already_processed(connected_net)) - process_net(connected_net); + process_net(netlist, connected_net); } } } @@ -290,22 +310,29 @@ namespace devices { for (auto & net : netlist.nets()) { - netlist.log().debug("processing {1}\n", net->name()); + netlist.log().debug("processing {1}", net->name()); + netlist.log().verbose("processing {1}", net->name()); if (!net->isRailNet() && net->num_cons() > 0) { - netlist.log().debug(" ==> not a rail net\n"); + netlist.log().debug(" ==> not a rail net"); + netlist.log().verbose(" ==> not a rail net"); // Must be an analog net auto &n = *static_cast<analog_net_t *>(net.get()); if (!already_processed(n)) { - groups.emplace_back(analog_net_t::list_t()); - process_net(n); + groupspre.emplace_back(analog_net_t::list_t()); + process_net(netlist, n); } } } + for (auto &g : groupspre) + if (!g.empty()) + groups.push_back(g); } std::vector<analog_net_t::list_t> groups; + private: + std::vector<analog_net_t::list_t> groupspre; }; void NETLIB_NAME(solver)::post_start() diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index 28cf290d97c..dfc98598a97 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -9,12 +9,15 @@ #include <algorithm> #include <unordered_map> +#include <vector> // FIXME: temporarily defined here - should be in a file // FIXME: family logic in netlist is convoluted, create // define a model param on core device // Format: external name,netlist device,model + +// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) static constexpr const char s_lib_map[] = "SN74LS00D, TTL_7400_DIP, 74LSXX\n" "SN74LS04D, TTL_7404_DIP, 74LSXX\n" @@ -58,7 +61,7 @@ static lib_map_t read_lib_map(const pstring &lm) nl_convert_base_t::nl_convert_base_t() : out(&m_buf) - , m_numberchars("0123456789-+e.") + , m_numberchars("0123456789-+Ee.") { m_buf.imbue(std::locale::classic()); m_units = { @@ -81,6 +84,14 @@ nl_convert_base_t::nl_convert_base_t() {"MIL", "{1}", 25.4e-6} }; + dev_map = + { + { "VCCS", {"OP", "ON", "IP", "IN"} }, + { "VCVS", {"OP", "ON", "IP", "IN"} }, + { "CCCS", {"OP", "ON", "IP", "IN"} }, + { "CCVS", {"OP", "ON", "IP", "IN"} }, + { "VS", {"1", "2"} }, + }; } nl_convert_base_t::~nl_convert_base_t() @@ -147,8 +158,65 @@ void nl_convert_base_t::add_term(const pstring &netname, const pstring &termname net->terminals().push_back(termname); } +void nl_convert_base_t::add_term(const pstring &netname, const pstring &devname, unsigned term) +{ + auto e = dev_map.find(get_device(devname)->type()); + if (e == dev_map.end()) + out("// ERROR: No terminals found for device {}\n", devname); + else + { + if (term >= e->second.size()) + out("// ERROR: {} : Term {} exceeds number of terminals {}\n", netname, devname, term); + else + add_term(netname, devname + "." + e->second[term]); + } +} + +void nl_convert_base_t::add_device_extra_s(const pstring &devname, const pstring &extra) +{ + auto dev = get_device(devname); + if (dev == nullptr) + out("// ERROR: Device {} not found\n", devname); + else + { + dev->add_extra(extra); + } +} + + + void nl_convert_base_t::dump_nl() { + // do replacements + for (auto &r : m_replace) + { + // Get the device entry + auto *d = get_device(r.m_ce); + if (d == nullptr) + { + out("ERROR: Can not find <{}>\n", r.m_ce); + continue; + } + + auto e = dev_map.find(d->type()); + if (e == dev_map.end()) + { + out("ERROR: Can not find type {}\n", d->type()); + continue; + } + pstring term1 = r.m_ce + "." + e->second[0]; + // scan all nets + for (auto &n : m_nets) + { + for (auto &t : n.second->terminals()) + { + if (t == term1) + t = r.m_repterm; + } + } + add_term(r.m_net, term1); + } + for (auto & alias : m_ext_alias) { net_t *net = m_nets[alias].get(); @@ -178,6 +246,9 @@ void nl_convert_base_t::dump_nl() else out("{}({})\n", m_devs[j]->type().c_str(), m_devs[j]->name().c_str()); + for (auto &e : m_devs[j]->extra()) + out("{}\n", e); + } // print nets for (auto & i : m_nets) @@ -193,13 +264,14 @@ void nl_convert_base_t::dump_nl() out(")\n"); } } + m_replace.clear(); m_devs.clear(); m_nets.clear(); m_pins.clear(); m_ext_alias.clear(); } -const pstring nl_convert_base_t::get_nl_val(const double val) +pstring nl_convert_base_t::get_nl_val(double val) { for (auto &e : m_units) { @@ -291,6 +363,22 @@ static pstring rem(const std::vector<pstring> &vps, std::size_t start) return r; } +static int npoly(const pstring &s) +{ + // Brute force + if (s=="POLY(1)") + return 1; + if (s=="POLY(2)") + return 2; + if (s=="POLY(3)") + return 3; + if (s=="POLY(4)") + return 4; + if (s=="POLY(5)") + return 5; + return -1; +} + void nl_convert_spice_t::process_line(const pstring &line) { if (line != "") @@ -384,24 +472,105 @@ void nl_convert_spice_t::process_line(const pstring &line) add_term(tt[2], tt[0] + ".N"); break; case 'E': - add_device("VCVS", tt[0]); + { + auto n=npoly(tt[3]); + if (n<0) + { + add_device("VCVS", tt[0]); + add_term(tt[1], tt[0], 0); + add_term(tt[2], tt[0], 1); + add_term(tt[3], tt[0], 2); + add_term(tt[4], tt[0], 3); + add_device_extra(tt[0], "PARAM({}, {})", tt[0] + ".G", tt[5]); + } + else + { + unsigned sce(4); + auto scoeff(static_cast<unsigned>(5 + n)); + if ((tt.size() != 5 + 2 * static_cast<unsigned>(n)) || (tt[scoeff-1] != "0")) + { + out("// IGNORED {}: {}\n", tt[0].c_str(), line.c_str()); + break; + } + pstring lastnet = tt[1]; + for (std::size_t i=0; i < static_cast<std::size_t>(n); i++) + { + pstring devname = tt[0] + plib::pfmt("{}")(i); + pstring nextnet = (i<static_cast<std::size_t>(n)-1) ? tt[1] + "a" + plib::pfmt("{}")(i) : tt[2]; + auto net2 = plib::psplit(plib::replace_all(plib::replace_all(tt[sce+i],")",""),"(",""),","); + add_device("VCVS", devname); + add_term(lastnet, devname, 0); + add_term(nextnet, devname, 1); + add_term(net2[0], devname, 2); + add_term(net2[1], devname, 3); + add_device_extra(devname, "PARAM({}, {})", devname + ".G", tt[scoeff+i]); + lastnet = nextnet; + //printf("xxx %d %s %s\n", (int) net2.size(), net2[0].c_str(), net2[1].c_str()); +#if 0 + pstring extranetname = devname + "net"; + m_replace.push_back({, devname + ".IP", extranetname }); + add_term(extranetname, devname + ".IN"); + add_device_extra(devname, "PARAM({}, {})", devname + ".G", tt[scoeff+i]); +#endif + } + } + } + break; + case 'F': + { + auto n=npoly(tt[3]); + unsigned sce(4); + unsigned scoeff(5 + static_cast<unsigned>(n)); + if (n<0) + { + sce = 3; + scoeff = 4; + n = 1; + } + else + { + if ((tt.size() != 5 + 2 * static_cast<unsigned>(n)) || (tt[scoeff-1] != "0")) + { + out("// IGNORED {}: {}\n", tt[0].c_str(), line.c_str()); + break; + } + } + for (std::size_t i=0; i < static_cast<std::size_t>(n); i++) + { + pstring devname = tt[0] + plib::pfmt("{}")(i); + add_device("CCCS", devname); + add_term(tt[1], devname, 0); + add_term(tt[2], devname, 1); + + pstring extranetname = devname + "net"; + m_replace.push_back({tt[sce+i], devname + ".IP", extranetname }); + add_term(extranetname, devname + ".IN"); + add_device_extra(devname, "PARAM({}, {})", devname + ".G", tt[scoeff+i]); + } + } + break; + case 'H': + add_device("CCVS", tt[0]); add_term(tt[1], tt[0] + ".OP"); add_term(tt[2], tt[0] + ".ON"); - add_term(tt[3], tt[0] + ".IP"); - add_term(tt[4], tt[0] + ".IN"); - out("PARAM({}, {})\n", tt[0] + ".G", tt[5]); + m_replace.push_back({tt[3], tt[0] + ".IP", tt[2] + "a" }); + add_term(tt[2] + "a", tt[0] + ".IN"); + add_device_extra(tt[0], "PARAM({}, {})", tt[0] + ".G", tt[4]); + break; + case 'G': + add_device("VCCS", tt[0]); + add_term(tt[1], tt[0], 0); + add_term(tt[2], tt[0], 1); + add_term(tt[3], tt[0], 2); + add_term(tt[4], tt[0], 3); + add_device_extra(tt[0], "PARAM({}, {})", tt[0] + ".G", tt[5]); break; case 'V': - // just simple Voltage sources .... - if (tt[2] == "0") - { - val = get_sp_val(tt[3]); - add_device("ANALOG_INPUT", tt[0], val); - add_term(tt[1], tt[0] + ".Q"); - //add_term(tt[2], tt[0] + ".2"); - } - else - plib::perrlogger("Voltage Source {} not connected to GND\n", tt[0]); + // only DC Voltage sources .... + val = get_sp_val(tt[3] == "DC" ? tt[4] : tt[3]); + add_device("VS", tt[0], val); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); break; #if 0 // This is wrong ... Need to use something else for inputs! @@ -415,7 +584,7 @@ void nl_convert_spice_t::process_line(const pstring &line) #else case 'I': { - val = get_sp_val(tt[3]); + val = get_sp_val(tt[3] == "DC" ? tt[4] : tt[3]); add_device("CS", tt[0], val); add_term(tt[1], tt[0] + ".1"); add_term(tt[2], tt[0] + ".2"); @@ -423,10 +592,11 @@ void nl_convert_spice_t::process_line(const pstring &line) break; #endif case 'D': - add_device("DIODE", tt[0], tt[3]); - // FIXME ==> does Kicad use different notation from LTSPICE - add_term(tt[1], tt[0] + ".K"); - add_term(tt[2], tt[0] + ".A"); + add_device("DIODE", tt[0], m_subckt + tt[3]); + // Spice D Anode Kathode model + // FIXME ==> does Kicad use different notation from LTSPICE ? + add_term(tt[1], tt[0] + ".A"); + add_term(tt[2], tt[0] + ".K"); break; case 'U': case 'X': @@ -499,7 +669,8 @@ void nl_convert_eagle_t::convert(const pstring &contents) out("NETLIST_END()\n"); return; } - else if (token.is(tok.m_tok_SEMICOLON)) + + if (token.is(tok.m_tok_SEMICOLON)) { // ignore empty statements token = tok.get_token(); @@ -646,7 +817,8 @@ void nl_convert_rinf_t::convert(const pstring &contents) out("NETLIST_END()\n"); return; } - else if (token.is(tok.m_tok_HEA)) + + if (token.is(tok.m_tok_HEA)) { // seems to be start token - ignore token = tok.get_token(); diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h index ac1597bf628..4d32eb7e2a6 100644 --- a/src/lib/netlist/tools/nl_convert.h +++ b/src/lib/netlist/tools/nl_convert.h @@ -22,6 +22,7 @@ class nl_convert_base_t { public: + using str_list = std::vector<pstring>; COPYASSIGNMOVE(nl_convert_base_t, delete) @@ -42,16 +43,34 @@ protected: void add_device(const pstring &atype, const pstring &aname, double aval); void add_device(const pstring &atype, const pstring &aname); + void add_device_extra_s(const pstring &devname, const pstring &extra); + + template<typename... Args> + void add_device_extra(const pstring &devname, const pstring &fmt, Args&&... args) + { + add_device_extra_s(devname, plib::pfmt(fmt)(std::forward<Args>(args)...)); + } + void add_term(const pstring &netname, const pstring &termname); + void add_term(const pstring &netname, const pstring &devname, unsigned term); void dump_nl(); - const pstring get_nl_val(const double val); + pstring get_nl_val(double val); double get_sp_unit(const pstring &unit); double get_sp_val(const pstring &sin); plib::putf8_fmt_writer out; + + struct replace_t + { + pstring m_ce; // controlling element - must be twoterm + pstring m_repterm; // replace with terminal + pstring m_net; // connect to net + }; + std::vector<replace_t> m_replace; + private: struct net_t @@ -102,16 +121,19 @@ private: const pstring &type() const { return m_type;} const pstring &model() const { return m_model;} double value() const { return m_val;} + const str_list &extra() const { return m_extra;} bool has_model() const { return m_model != ""; } bool has_value() const { return m_has_val; } + void add_extra(const pstring &s) { m_extra.push_back(s); } private: pstring m_type; pstring m_name; pstring m_model; double m_val; bool m_has_val; + str_list m_extra; }; struct unit_t { @@ -133,9 +155,17 @@ private: pstring m_alias; }; + private: void add_device(plib::unique_ptr<dev_t> dev); + dev_t *get_device(const pstring &name) + { + for (auto &e : m_devs) + if (e->name() == name) + return e.get(); + return nullptr; + } std::stringstream m_buf; @@ -147,13 +177,15 @@ private: std::vector<unit_t> m_units; pstring m_numberchars; + std::unordered_map<pstring, str_list> dev_map; + }; class nl_convert_spice_t : public nl_convert_base_t { public: - nl_convert_spice_t() : nl_convert_base_t() {} + nl_convert_spice_t() = default; void convert(const pstring &contents) override; @@ -169,7 +201,7 @@ class nl_convert_eagle_t : public nl_convert_base_t { public: - nl_convert_eagle_t() : nl_convert_base_t() {} + nl_convert_eagle_t() = default; class tokenizer : public plib::ptokenizer { @@ -202,7 +234,7 @@ class nl_convert_rinf_t : public nl_convert_base_t { public: - nl_convert_rinf_t() : nl_convert_base_t() {} + nl_convert_rinf_t() = default; class tokenizer : public plib::ptokenizer { diff --git a/src/lib/util/avhuff.cpp b/src/lib/util/avhuff.cpp index 9975287f4c1..73a41df50d7 100644 --- a/src/lib/util/avhuff.cpp +++ b/src/lib/util/avhuff.cpp @@ -58,14 +58,14 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "avhuff.h" #include "huffman.h" #include "chd.h" -#include <math.h> -#include <stdlib.h> +#include <cmath> +#include <cstdlib> #include <new> @@ -679,18 +679,6 @@ uint16_t *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const uint8_t * //************************************************************************** /** - * @fn avhuff_decoder::avhuff_decoder() - * - * @brief ------------------------------------------------- - * avhuff_decoder - constructor - * -------------------------------------------------. - */ - -avhuff_decoder::avhuff_decoder() -{ -} - -/** * @fn void avhuff_decoder::configure(const avhuff_decompress_config &config) * * @brief ------------------------------------------------- diff --git a/src/lib/util/avhuff.h b/src/lib/util/avhuff.h index 90ef43e977f..d14046e1f62 100644 --- a/src/lib/util/avhuff.h +++ b/src/lib/util/avhuff.h @@ -144,7 +144,7 @@ class avhuff_decoder { public: // construction/destruction - avhuff_decoder(); + avhuff_decoder() = default; // configuration void configure(const avhuff_decompress_config &config); diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp index c66f706b6e2..067f81fef27 100644 --- a/src/lib/util/aviio.cpp +++ b/src/lib/util/aviio.cpp @@ -298,7 +298,7 @@ public: std::uint32_t width = info.video_width; std::uint32_t height = info.video_height; - std::uint32_t integal_multiple = std::uint32_t(AVI_INTEGRAL_MULTIPLE); + auto integal_multiple = std::uint32_t(AVI_INTEGRAL_MULTIPLE); if (integal_multiple > 1) { width = width - (width % integal_multiple); @@ -720,8 +720,8 @@ inline void put_64bits(std::uint8_t *data, std::uint64_t value) inline void u64toa(std::uint64_t val, char *output) { - std::uint32_t lo = std::uint32_t(val & 0xffffffff); - std::uint32_t hi = std::uint32_t(val >> 32); + auto lo = std::uint32_t(val & 0xffffffff); + auto hi = std::uint32_t(val >> 32); if (hi != 0) sprintf(output, "%X%08X", hi, lo); else @@ -1055,7 +1055,7 @@ avi_file::error avi_stream::rgb32_compress_to_rgb(const bitmap_rgb32 &bitmap, st avi_file::error avi_stream::yuv_decompress_to_yuy16(const std::uint8_t *data, std::uint32_t numbytes, bitmap_yuy16 &bitmap) const { - std::uint16_t const *const dataend = reinterpret_cast<const std::uint16_t *>(data + numbytes); + auto const *const dataend = reinterpret_cast<const std::uint16_t *>(data + numbytes); int x, y; /* compressed video */ @@ -1107,7 +1107,7 @@ avi_file::error avi_stream::yuv_decompress_to_yuy16(const std::uint8_t *data, st avi_file::error avi_stream::yuy16_compress_to_yuy(const bitmap_yuy16 &bitmap, std::uint8_t *data, std::uint32_t numbytes) const { - std::uint16_t *const dataend = reinterpret_cast<std::uint16_t *>(data + numbytes); + auto *const dataend = reinterpret_cast<std::uint16_t *>(data + numbytes); int x, y; /* compressed video */ @@ -1871,7 +1871,7 @@ avi_file::error avi_file_impl::read_sound_samples(int channel, std::uint32_t fir /* extract 16-bit samples from the chunk */ if (stream->samplebits() == 16) { - const std::int16_t *base = reinterpret_cast<const std::int16_t *>(&m_tempbuffer[8]); + const auto *base = reinterpret_cast<const std::int16_t *>(&m_tempbuffer[8]); base += stream->channels() * (firstsample - chunkbase) + offset; for (sampnum = 0; sampnum < samples_this_chunk; sampnum++) { @@ -3803,13 +3803,3 @@ const char *avi_file::error_string(error err) default: return "undocumented error"; } } - - -avi_file::avi_file() -{ -} - - -avi_file::~avi_file() -{ -} diff --git a/src/lib/util/aviio.h b/src/lib/util/aviio.h index c951f71b22f..8aa36d80b8b 100644 --- a/src/lib/util/aviio.h +++ b/src/lib/util/aviio.h @@ -111,7 +111,7 @@ public: static error open(std::string const &filename, ptr &file); static error create(std::string const &filename, movie_info const &info, ptr &file); - virtual ~avi_file(); + virtual ~avi_file() = default; virtual void printf_chunks() = 0; static const char *error_string(error err); @@ -128,7 +128,7 @@ public: virtual error append_sound_samples(int channel, std::int16_t const *samples, std::uint32_t numsamples, std::uint32_t sampleskip) = 0; protected: - avi_file(); + avi_file() = default; }; #endif // MAME_LIB_UTIL_AVIIO_H diff --git a/src/lib/util/bitmap.cpp b/src/lib/util/bitmap.cpp index 87cf8a27b76..ed814aae218 100644 --- a/src/lib/util/bitmap.cpp +++ b/src/lib/util/bitmap.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "bitmap.h" diff --git a/src/lib/util/cdrom.cpp b/src/lib/util/cdrom.cpp index c2cded9f9aa..94efa870d8d 100644 --- a/src/lib/util/cdrom.cpp +++ b/src/lib/util/cdrom.cpp @@ -16,11 +16,11 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "cdrom.h" -#include <stdlib.h> +#include <cstdlib> #include "chdcd.h" @@ -558,7 +558,7 @@ uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uin /* return 2352 byte mode 1 raw sector from 2048 bytes of mode 1 data */ if ((datatype == CD_TRACK_MODE1_RAW) && (tracktype == CD_TRACK_MODE1)) { - uint8_t *bufptr = (uint8_t *)buffer; + auto *bufptr = (uint8_t *)buffer; uint32_t msf = lba_to_msf(lbasector); static const uint8_t syncbytes[12] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}; @@ -1247,7 +1247,7 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) return err; /* reconstruct the TOC from it */ - uint32_t *mrp = reinterpret_cast<uint32_t *>(&oldmetadata[0]); + auto *mrp = reinterpret_cast<uint32_t *>(&oldmetadata[0]); toc->numtrks = *mrp++; for (i = 0; i < CD_MAX_TRACKS; i++) diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 3b61d044cd3..daad423147a 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "chd.h" #include "avhuff.h" @@ -17,9 +17,9 @@ #include "cdrom.h" #include "coretmpl.h" #include <zlib.h> -#include <time.h> -#include <stddef.h> -#include <stdlib.h> +#include <ctime> +#include <cstddef> +#include <cstdlib> #include <new> #include "eminline.h" @@ -888,7 +888,7 @@ chd_error chd_file::read_hunk(uint32_t hunknum, void *buffer) uint32_t blocklen; util::crc32_t blockcrc; uint8_t *rawmap; - uint8_t *dest = reinterpret_cast<uint8_t *>(buffer); + auto *dest = reinterpret_cast<uint8_t *>(buffer); switch (m_version) { // v3/v4 map entries @@ -1045,7 +1045,7 @@ chd_error chd_file::write_hunk(uint32_t hunknum, const void *buffer) { // first make sure we need to allocate it bool all_zeros = true; - const uint32_t *scan = reinterpret_cast<const uint32_t *>(buffer); + const auto *scan = reinterpret_cast<const uint32_t *>(buffer); for (uint32_t index = 0; index < m_hunkbytes / 4; index++) if (scan[index] != 0) { @@ -1140,7 +1140,7 @@ chd_error chd_file::read_bytes(uint64_t offset, void *buffer, uint32_t bytes) // iterate over hunks uint32_t first_hunk = offset / m_hunkbytes; uint32_t last_hunk = (offset + bytes - 1) / m_hunkbytes; - uint8_t *dest = reinterpret_cast<uint8_t *>(buffer); + auto *dest = reinterpret_cast<uint8_t *>(buffer); for (uint32_t curhunk = first_hunk; curhunk <= last_hunk; curhunk++) { // determine start/end boundaries @@ -1193,7 +1193,7 @@ chd_error chd_file::write_bytes(uint64_t offset, const void *buffer, uint32_t by // iterate over hunks uint32_t first_hunk = offset / m_hunkbytes; uint32_t last_hunk = (offset + bytes - 1) / m_hunkbytes; - const uint8_t *source = reinterpret_cast<const uint8_t *>(buffer); + const auto *source = reinterpret_cast<const uint8_t *>(buffer); for (uint32_t curhunk = first_hunk; curhunk <= last_hunk; curhunk++) { // determine start/end boundaries @@ -2947,7 +2947,7 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); m_total_out += item.m_complen; m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - } while (0); + } while (false); // reset the item and advance item.m_status = WS_READY; @@ -3010,7 +3010,7 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio void *chd_file_compressor::async_walk_parent_static(void *param, int threadid) { - work_item *item = reinterpret_cast<work_item *>(param); + auto *item = reinterpret_cast<work_item *>(param); item->m_compressor->async_walk_parent(*item); return nullptr; } @@ -3052,7 +3052,7 @@ void chd_file_compressor::async_walk_parent(work_item &item) void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid) { - work_item *item = reinterpret_cast<work_item *>(param); + auto *item = reinterpret_cast<work_item *>(param); item->m_compressor->async_compress_hunk(*item, threadid); return nullptr; } diff --git a/src/lib/util/chdcd.cpp b/src/lib/util/chdcd.cpp index 85bd7cdad27..b2b0e141499 100644 --- a/src/lib/util/chdcd.cpp +++ b/src/lib/util/chdcd.cpp @@ -7,9 +7,9 @@ ***************************************************************************/ -#include <ctype.h> -#include <stdlib.h> -#include <assert.h> +#include <cctype> +#include <cstdlib> +#include <cassert> #include "osdcore.h" #include "chd.h" #include "chdcd.h" @@ -262,7 +262,7 @@ static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs) } /* seek until we find a format tag */ - while (1) + while (true) { file->read(buf, offset, 4, actual); offset += actual; @@ -329,7 +329,7 @@ static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs) offset += length - 16; /* seek until we find a data tag */ - while (1) + while (true) { file->read(buf, offset, 4, actual); offset += actual; diff --git a/src/lib/util/chdcodec.cpp b/src/lib/util/chdcodec.cpp index 71763163a87..3f76af302bd 100644 --- a/src/lib/util/chdcodec.cpp +++ b/src/lib/util/chdcodec.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "chd.h" #include "hashing.h" @@ -124,7 +124,7 @@ class chd_lzma_compressor : public chd_compressor public: // construction/destruction chd_lzma_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); - ~chd_lzma_compressor(); + ~chd_lzma_compressor() = default; // core functionality virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; @@ -497,15 +497,6 @@ chd_codec::chd_codec(chd_file &chd, uint32_t hunkbytes, bool lossy) //------------------------------------------------- -// ~chd_codec - destructor -//------------------------------------------------- - -chd_codec::~chd_codec() -{ -} - - -//------------------------------------------------- // configure - configuration //------------------------------------------------- @@ -760,7 +751,7 @@ void chd_zlib_allocator::install(z_stream &stream) voidpf chd_zlib_allocator::fast_alloc(voidpf opaque, uInt items, uInt size) { - chd_zlib_allocator *codec = reinterpret_cast<chd_zlib_allocator *>(opaque); + auto *codec = reinterpret_cast<chd_zlib_allocator *>(opaque); // compute the size, rounding to the nearest 1k size = (size * items + 0x3ff) & ~0x3ff; @@ -778,7 +769,7 @@ voidpf chd_zlib_allocator::fast_alloc(voidpf opaque, uInt items, uInt size) } // alloc a new one and put it into the list - uint32_t *ptr = reinterpret_cast<uint32_t *>(new uint8_t[size + sizeof(uint32_t)]); + auto *ptr = reinterpret_cast<uint32_t *>(new uint8_t[size + sizeof(uint32_t)]); for (int scan = 0; scan < MAX_ZLIB_ALLOCS; scan++) if (codec->m_allocptr[scan] == nullptr) { @@ -799,7 +790,7 @@ voidpf chd_zlib_allocator::fast_alloc(voidpf opaque, uInt items, uInt size) void chd_zlib_allocator::fast_free(voidpf opaque, voidpf address) { - chd_zlib_allocator *codec = reinterpret_cast<chd_zlib_allocator *>(opaque); + auto *codec = reinterpret_cast<chd_zlib_allocator *>(opaque); // find the hunk uint32_t *ptr = reinterpret_cast<uint32_t *>(address) - 1; @@ -980,7 +971,7 @@ chd_lzma_allocator::~chd_lzma_allocator() void *chd_lzma_allocator::fast_alloc(void *p, size_t size) { - chd_lzma_allocator *codec = reinterpret_cast<chd_lzma_allocator *>(p); + auto *codec = reinterpret_cast<chd_lzma_allocator *>(p); // compute the size, rounding to the nearest 1k size = (size + 0x3ff) & ~0x3ff; @@ -998,7 +989,7 @@ void *chd_lzma_allocator::fast_alloc(void *p, size_t size) } // alloc a new one and put it into the list - uint32_t *ptr = reinterpret_cast<uint32_t *>(new uint8_t[size + sizeof(uint32_t)]); + auto *ptr = reinterpret_cast<uint32_t *>(new uint8_t[size + sizeof(uint32_t)]); for (int scan = 0; scan < MAX_LZMA_ALLOCS; scan++) if (codec->m_allocptr[scan] == nullptr) { @@ -1022,7 +1013,7 @@ void chd_lzma_allocator::fast_free(void *p, void *address) if (address == nullptr) return; - chd_lzma_allocator *codec = reinterpret_cast<chd_lzma_allocator *>(p); + auto *codec = reinterpret_cast<chd_lzma_allocator *>(p); // find the hunk uint32_t *ptr = reinterpret_cast<uint32_t *>(address) - 1; @@ -1054,15 +1045,6 @@ chd_lzma_compressor::chd_lzma_compressor(chd_file &chd, uint32_t hunkbytes, bool //------------------------------------------------- -// ~chd_lzma_compressor - destructor -//------------------------------------------------- - -chd_lzma_compressor::~chd_lzma_compressor() -{ -} - - -//------------------------------------------------- // compress - compress data using the LZMA codec //------------------------------------------------- diff --git a/src/lib/util/chdcodec.h b/src/lib/util/chdcodec.h index e688b41a108..8be99b2e710 100644 --- a/src/lib/util/chdcodec.h +++ b/src/lib/util/chdcodec.h @@ -50,7 +50,7 @@ protected: public: // allow public deletion - virtual ~chd_codec(); + virtual ~chd_codec() = default; // accessors chd_file &chd() const { return m_chd; } diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index 222b1428307..5d1f055e19b 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -15,7 +15,7 @@ #include "osdcore.h" -#include <stdlib.h> +#include <cstdlib> #include <cstddef> #include <cstring> diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index 78a484c5511..d241dac6ed1 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -20,7 +20,7 @@ #include <cstring> #include <iterator> -#include <ctype.h> +#include <cctype> namespace util { @@ -143,7 +143,7 @@ class core_proxy_file : public core_file { public: core_proxy_file(core_file &file) : m_file(file) { } - virtual ~core_proxy_file() override { } + virtual ~core_proxy_file() override = default; virtual osd_file::error compress(int level) override { return m_file.compress(level); } virtual int seek(std::int64_t offset, int whence) override { return m_file.seek(offset, whence); } @@ -395,7 +395,7 @@ int core_text_file::getc() // fetch the next character char16_t utf16_buffer[UTF16_CHAR_MAX]; - char32_t uchar = char32_t(~0); + auto uchar = char32_t(~0); switch (m_text_type) { default: @@ -647,7 +647,7 @@ bool core_in_memory_file::eof() const { // check for buffered chars if (has_putback()) - return 0; + return false; // if the offset == length, we're at EOF return (m_offset >= m_length); @@ -1233,15 +1233,6 @@ osd_file::error core_file::load(std::string const &filename, std::vector<uint8_t return osd_file::error::NONE; } - -/*------------------------------------------------- - protected constructor --------------------------------------------------*/ - -core_file::core_file() -{ -} - } // namespace util diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h index d286cb866ac..99496b964e8 100644 --- a/src/lib/util/corefile.h +++ b/src/lib/util/corefile.h @@ -128,7 +128,7 @@ public: protected: - core_file(); + core_file() = default; }; diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp index d0d5b576890..d4fc15b1bce 100644 --- a/src/lib/util/corestr.cpp +++ b/src/lib/util/corestr.cpp @@ -14,8 +14,8 @@ #include <algorithm> #include <memory> -#include <ctype.h> -#include <stdlib.h> +#include <cctype> +#include <cstdlib> /*------------------------------------------------- diff --git a/src/lib/util/corestr.h b/src/lib/util/corestr.h index 1791ae6d226..ee319d69deb 100644 --- a/src/lib/util/corestr.h +++ b/src/lib/util/corestr.h @@ -18,7 +18,7 @@ #include <string> -#include <string.h> +#include <cstring> /*************************************************************************** diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h index 6c8ac39b45c..8b6bafa30fb 100644 --- a/src/lib/util/coretmpl.h +++ b/src/lib/util/coretmpl.h @@ -45,7 +45,7 @@ template<typename T> constexpr T make_bitmask(unsigned int N) // a simple_list is a singly-linked list whose 'next' pointer is owned // by the object -template<class _ElementType> +template<class ElementType> class simple_list final { public: @@ -53,36 +53,31 @@ public: { public: typedef int difference_type; - typedef _ElementType value_type; - typedef _ElementType *pointer; - typedef _ElementType &reference; + typedef ElementType value_type; + typedef ElementType *pointer; + typedef ElementType &reference; typedef std::forward_iterator_tag iterator_category; // construction/destruction auto_iterator() noexcept : m_current(nullptr) { } - auto_iterator(_ElementType *ptr) noexcept : m_current(ptr) { } + auto_iterator(ElementType *ptr) noexcept : m_current(ptr) { } // required operator overloads bool operator==(const auto_iterator &iter) const noexcept { return m_current == iter.m_current; } bool operator!=(const auto_iterator &iter) const noexcept { return m_current != iter.m_current; } - _ElementType &operator*() const noexcept { return *m_current; } - _ElementType *operator->() const noexcept { return m_current; } - // note that _ElementType::next() must not return a const ptr + ElementType &operator*() const noexcept { return *m_current; } + ElementType *operator->() const noexcept { return m_current; } + // note that ElementType::next() must not return a const ptr auto_iterator &operator++() noexcept { m_current = m_current->next(); return *this; } auto_iterator operator++(int) noexcept { auto_iterator result(*this); m_current = m_current->next(); return result; } private: // private state - _ElementType *m_current; + ElementType *m_current; }; // construction/destruction - simple_list() noexcept - : m_head(nullptr) - , m_tail(nullptr) - , m_count(0) - { - } + simple_list() noexcept { } ~simple_list() noexcept { reset(); } // we don't support deep copying @@ -90,18 +85,19 @@ public: simple_list &operator=(const simple_list &) = delete; // but we do support cheap swap/move - simple_list(simple_list &&list) : simple_list() { operator=(std::move(list)); } + simple_list(simple_list &&list) noexcept { operator=(std::move(list)); } simple_list &operator=(simple_list &&list) { using std::swap; swap(m_head, list.m_head); swap(m_tail, list.m_tail); swap(m_count, list.m_count); + return *this; } // simple getters - _ElementType *first() const noexcept { return m_head; } - _ElementType *last() const noexcept { return m_tail; } + ElementType *first() const noexcept { return m_head; } + ElementType *last() const noexcept { return m_tail; } int count() const noexcept { return m_count; } bool empty() const noexcept { return m_count == 0; } @@ -117,7 +113,7 @@ public: } // add the given object to the head of the list - _ElementType &prepend(_ElementType &object) noexcept + ElementType &prepend(ElementType &object) noexcept { object.m_next = m_head; m_head = &object; @@ -128,13 +124,13 @@ public: } // add the given list to the head of the list - void prepend_list(simple_list<_ElementType> &list) noexcept + void prepend_list(simple_list<ElementType> &list) noexcept { int count = list.count(); if (count == 0) return; - _ElementType *tail = list.last(); - _ElementType *head = list.detach_all(); + ElementType *tail = list.last(); + ElementType *head = list.detach_all(); tail->m_next = m_head; m_head = head; if (m_tail == nullptr) @@ -143,7 +139,7 @@ public: } // add the given object to the tail of the list - _ElementType &append(_ElementType &object) noexcept + ElementType &append(ElementType &object) noexcept { object.m_next = nullptr; if (m_tail != nullptr) @@ -155,13 +151,13 @@ public: } // add the given list to the tail of the list - void append_list(simple_list<_ElementType> &list) noexcept + void append_list(simple_list<ElementType> &list) noexcept { int count = list.count(); if (count == 0) return; - _ElementType *tail = list.last(); - _ElementType *head = list.detach_all(); + ElementType *tail = list.last(); + ElementType *head = list.detach_all(); if (m_tail != nullptr) m_tail->m_next = head; else @@ -171,7 +167,7 @@ public: } // insert the given object after a particular object (nullptr means prepend) - _ElementType &insert_after(_ElementType &object, _ElementType *insert_after) noexcept + ElementType &insert_after(ElementType &object, ElementType *insert_after) noexcept { if (insert_after == nullptr) return prepend(object); @@ -184,11 +180,11 @@ public: } // insert the given object before a particular object (nullptr means append) - _ElementType &insert_before(_ElementType &object, _ElementType *insert_before) noexcept + ElementType &insert_before(ElementType &object, ElementType *insert_before) noexcept { if (insert_before == nullptr) return append(object); - for (_ElementType **curptr = &m_head; *curptr != nullptr; curptr = &(*curptr)->m_next) + for (ElementType **curptr = &m_head; *curptr != nullptr; curptr = &(*curptr)->m_next) if (*curptr == insert_before) { object.m_next = insert_before; @@ -202,10 +198,10 @@ public: } // replace an item in the list at the same location, and remove it - _ElementType &replace_and_remove(_ElementType &object, _ElementType &toreplace) noexcept + ElementType &replace_and_remove(ElementType &object, ElementType &toreplace) noexcept { - _ElementType *prev = nullptr; - for (_ElementType *cur = m_head; cur != nullptr; prev = cur, cur = cur->m_next) + ElementType *prev = nullptr; + for (ElementType *cur = m_head; cur != nullptr; prev = cur, cur = cur->m_next) if (cur == &toreplace) { if (prev != nullptr) @@ -222,9 +218,9 @@ public: } // detach the head item from the list, but don't free its memory - _ElementType *detach_head() noexcept + ElementType *detach_head() noexcept { - _ElementType *result = m_head; + ElementType *result = m_head; if (result != nullptr) { m_head = result->m_next; @@ -236,10 +232,10 @@ public: } // detach the given item from the list, but don't free its memory - _ElementType &detach(_ElementType &object) noexcept + ElementType &detach(ElementType &object) noexcept { - _ElementType *prev = nullptr; - for (_ElementType *cur = m_head; cur != nullptr; prev = cur, cur = cur->m_next) + ElementType *prev = nullptr; + for (ElementType *cur = m_head; cur != nullptr; prev = cur, cur = cur->m_next) if (cur == &object) { if (prev != nullptr) @@ -255,34 +251,34 @@ public: } // detach the entire list, returning the head, but don't free memory - _ElementType *detach_all() noexcept + ElementType *detach_all() noexcept { - _ElementType *result = m_head; + ElementType *result = m_head; m_head = m_tail = nullptr; m_count = 0; return result; } // remove the given object and free its memory - void remove(_ElementType &object) noexcept + void remove(ElementType &object) noexcept { global_free(&detach(object)); } // find an object by index in the list - _ElementType *find(int index) const noexcept + ElementType *find(int index) const noexcept { - for (_ElementType *cur = m_head; cur != nullptr; cur = cur->m_next) + for (ElementType *cur = m_head; cur != nullptr; cur = cur->m_next) if (index-- == 0) return cur; return nullptr; } // return the index of the given object in the list - int indexof(const _ElementType &object) const noexcept + int indexof(const ElementType &object) const noexcept { int index = 0; - for (_ElementType *cur = m_head; cur != nullptr; cur = cur->m_next) + for (ElementType *cur = m_head; cur != nullptr; cur = cur->m_next) { if (cur == &object) return index; @@ -293,49 +289,16 @@ public: private: // internal state - _ElementType * m_head; // head of the singly-linked list - _ElementType * m_tail; // tail of the singly-linked list - int m_count; // number of objects in the list -}; - - -// ======================> simple_list_wrapper - -// a simple_list_wrapper wraps an existing object with a next pointer so it -// can live in a simple_list without requiring the object to have a next -// pointer -template<class _ObjectType> -class simple_list_wrapper -{ -public: - template<class U> friend class simple_list; - - // construction/destruction - simple_list_wrapper(_ObjectType *object) - : m_next(nullptr), - m_object(object) { } - - // operators - operator _ObjectType *() { return m_object; } - operator _ObjectType *() const { return m_object; } - _ObjectType *operator *() { return m_object; } - _ObjectType *operator *() const { return m_object; } - - // getters - simple_list_wrapper *next() const { return m_next; } - _ObjectType *object() const { return m_object; } - -private: - // internal state - simple_list_wrapper * m_next; - _ObjectType * m_object; + ElementType * m_head = nullptr; // head of the singly-linked list + ElementType * m_tail = nullptr; // tail of the singly-linked list + int m_count = 0; // number of objects in the list }; // ======================> fixed_allocator // a fixed_allocator is a simple class that maintains a free pool of objects -template<class _ItemType> +template<class ItemType> class fixed_allocator { // we don't support deep copying @@ -347,24 +310,24 @@ public: fixed_allocator() { } // allocate a new item, either by recycling an old one, or by allocating a new one - _ItemType *alloc() + ItemType *alloc() { - _ItemType *result = m_freelist.detach_head(); + ItemType *result = m_freelist.detach_head(); if (result == nullptr) - result = global_alloc(_ItemType); + result = global_alloc(ItemType); return result; } // reclaim an item by adding it to the free list - void reclaim(_ItemType *item) { if (item != nullptr) m_freelist.append(*item); } - void reclaim(_ItemType &item) { m_freelist.append(item); } + void reclaim(ItemType *item) { if (item != nullptr) m_freelist.append(*item); } + void reclaim(ItemType &item) { m_freelist.append(item); } // reclaim all items from a list - void reclaim_all(simple_list<_ItemType> &_list) { m_freelist.append_list(_list); } + void reclaim_all(simple_list<ItemType> &_list) { m_freelist.append_list(_list); } private: // internal state - simple_list<_ItemType> m_freelist; // list of free objects + simple_list<ItemType> m_freelist; // list of free objects }; @@ -798,6 +761,7 @@ public: m_mapping.insert(it); assert(m_elements.size() == m_size); assert(m_mapping.size() == m_size); + return *this; } private: diff --git a/src/lib/util/coreutil.cpp b/src/lib/util/coreutil.cpp index d973080e354..94ec6dec273 100644 --- a/src/lib/util/coreutil.cpp +++ b/src/lib/util/coreutil.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "coreutil.h" -#include <assert.h> +#include <cassert> #include <zlib.h> diff --git a/src/lib/util/delegate.cpp b/src/lib/util/delegate.cpp index 7b4ee8df76e..1ba81916030 100644 --- a/src/lib/util/delegate.cpp +++ b/src/lib/util/delegate.cpp @@ -8,9 +8,9 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include <cstdint> -#include <stdio.h> +#include <cstdio> #include "delegate.h" diff --git a/src/lib/util/flac.cpp b/src/lib/util/flac.cpp index 54a589ee2a2..9030249a7d0 100644 --- a/src/lib/util/flac.cpp +++ b/src/lib/util/flac.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "flac.h" #include <new> @@ -559,7 +559,7 @@ void flac_decoder::metadata_callback_static(const FLAC__StreamDecoder *decoder, return; // parse out the data we care about - flac_decoder *fldecoder = reinterpret_cast<flac_decoder *>(client_data); + auto *fldecoder = reinterpret_cast<flac_decoder *>(client_data); fldecoder->m_sample_rate = metadata->data.stream_info.sample_rate; fldecoder->m_bits_per_sample = metadata->data.stream_info.bits_per_sample; fldecoder->m_channels = metadata->data.stream_info.channels; diff --git a/src/lib/util/harddisk.cpp b/src/lib/util/harddisk.cpp index 5db97e3417b..e91759c44f2 100644 --- a/src/lib/util/harddisk.cpp +++ b/src/lib/util/harddisk.cpp @@ -8,10 +8,10 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "harddisk.h" #include "osdcore.h" -#include <stdlib.h> +#include <cstdlib> /*************************************************************************** TYPE DEFINITIONS diff --git a/src/lib/util/hash.cpp b/src/lib/util/hash.cpp index ddb6f52ac5c..5808163b6b9 100644 --- a/src/lib/util/hash.cpp +++ b/src/lib/util/hash.cpp @@ -12,7 +12,7 @@ #include "hash.h" #include "hashing.h" -#include <ctype.h> +#include <cctype> namespace util { diff --git a/src/lib/util/hashing.cpp b/src/lib/util/hashing.cpp index 448cdc5d6ec..a5946f1ace8 100644 --- a/src/lib/util/hashing.cpp +++ b/src/lib/util/hashing.cpp @@ -284,7 +284,7 @@ void crc16_creator::append(const void *data, uint32_t length) 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; - const uint8_t *src = reinterpret_cast<const uint8_t *>(data); + const auto *src = reinterpret_cast<const uint8_t *>(data); // fetch the current value into a local and rip through the source data uint16_t crc = m_accum.m_raw; diff --git a/src/lib/util/huffman.cpp b/src/lib/util/huffman.cpp index d3a73315ea9..d8900b45e17 100644 --- a/src/lib/util/huffman.cpp +++ b/src/lib/util/huffman.cpp @@ -96,8 +96,8 @@ ***************************************************************************/ -#include <stdlib.h> -#include <assert.h> +#include <cstdlib> +#include <cassert> #include "coretmpl.h" #include "huffman.h" @@ -431,7 +431,7 @@ huffman_error huffman_context_base::compute_tree_from_histo() // binary search to achieve the optimum encoding uint32_t lowerweight = 0; uint32_t upperweight = sdatacount * 2; - while (1) + while (true) { // build a tree using the current weight uint32_t curweight = (upperweight + lowerweight) / 2; @@ -678,14 +678,6 @@ void huffman_context_base::build_lookup_table() // 8-BIT ENCODER //************************************************************************** -//------------------------------------------------- -// huffman_8bit_encoder - constructor -//------------------------------------------------- - -huffman_8bit_encoder::huffman_8bit_encoder() -{ -} - //------------------------------------------------- // encode - encode a full buffer @@ -722,14 +714,6 @@ huffman_error huffman_8bit_encoder::encode(const uint8_t *source, uint32_t sleng // 8-BIT DECODER //************************************************************************** -//------------------------------------------------- -// huffman_8bit_decoder - constructor -//------------------------------------------------- - -huffman_8bit_decoder::huffman_8bit_decoder() -{ -} - /** * @fn huffman_error huffman_8bit_decoder::decode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t dlength) * diff --git a/src/lib/util/huffman.h b/src/lib/util/huffman.h index 0eac393f380..233146e8e20 100644 --- a/src/lib/util/huffman.h +++ b/src/lib/util/huffman.h @@ -149,7 +149,7 @@ class huffman_8bit_encoder : public huffman_encoder<> { public: // construction/destruction - huffman_8bit_encoder(); + huffman_8bit_encoder() = default; // operations huffman_error encode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t destlength, uint32_t &complength); @@ -163,7 +163,7 @@ class huffman_8bit_decoder : public huffman_decoder<> { public: // construction/destruction - huffman_8bit_decoder(); + huffman_8bit_decoder() = default; // operations huffman_error decode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t destlength); diff --git a/src/lib/util/jedparse.cpp b/src/lib/util/jedparse.cpp index f7b252861a2..14cc503f18f 100644 --- a/src/lib/util/jedparse.cpp +++ b/src/lib/util/jedparse.cpp @@ -16,10 +16,10 @@ ***************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> #include "jedparse.h" @@ -189,7 +189,7 @@ static void process_field(jed_data *data, const uint8_t *cursrc, const uint8_t * int jed_parse(const void *data, size_t length, jed_data *result) { - const uint8_t *cursrc = (const uint8_t *)data; + const auto *cursrc = (const uint8_t *)data; const uint8_t *srcend = cursrc + length; const uint8_t *scan; jed_parse_info pinfo; @@ -283,7 +283,7 @@ int jed_parse(const void *data, size_t length, jed_data *result) size_t jed_output(const jed_data *data, void *result, size_t length) { - uint8_t *curdst = (uint8_t *)result; + auto *curdst = (uint8_t *)result; uint8_t *dstend = curdst + length; int i, zeros, ones; char tempbuf[256]; @@ -379,7 +379,7 @@ size_t jed_output(const jed_data *data, void *result, size_t length) int jedbin_parse(const void *data, size_t length, jed_data *result) { - const uint8_t *cursrc = (const uint8_t *)data; + const auto *cursrc = (const uint8_t *)data; /* initialize the output */ memset(result, 0, sizeof(*result)); @@ -439,7 +439,7 @@ int jedbin_parse(const void *data, size_t length, jed_data *result) size_t jedbin_output(const jed_data *data, void *result, size_t length) { - uint8_t *curdst = (uint8_t *)result; + auto *curdst = (uint8_t *)result; /* ensure we have enough room */ if (length >= 4 + (data->numfuses + 7) / 8) diff --git a/src/lib/util/md5.cpp b/src/lib/util/md5.cpp index 712bd4a23f3..3e26d0c5b07 100644 --- a/src/lib/util/md5.cpp +++ b/src/lib/util/md5.cpp @@ -22,7 +22,7 @@ * Still in the public domain. */ -#include <string.h> /* for memcpy() */ +#include <cstring> /* for memcpy() */ #include "md5.h" diff --git a/src/lib/util/opresolv.cpp b/src/lib/util/opresolv.cpp index 05b8a5e8898..210dde4f224 100644 --- a/src/lib/util/opresolv.cpp +++ b/src/lib/util/opresolv.cpp @@ -8,10 +8,10 @@ ****************************************************************************/ -#include <ctype.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> +#include <cctype> +#include <cstdlib> +#include <cstring> +#include <cassert> #include "pool.h" #include "corestr.h" @@ -63,15 +63,6 @@ option_resolution::option_resolution(const option_guide &guide) // ------------------------------------------------- -// dtor -// ------------------------------------------------- - -option_resolution::~option_resolution() -{ -} - - -// ------------------------------------------------- // lookup_in_specification // ------------------------------------------------- diff --git a/src/lib/util/opresolv.h b/src/lib/util/opresolv.h index 52030dc4336..a102dcd8c83 100644 --- a/src/lib/util/opresolv.h +++ b/src/lib/util/opresolv.h @@ -43,7 +43,7 @@ #pragma once -#include <stdlib.h> +#include <cstdlib> #include <vector> #include <string> @@ -243,7 +243,7 @@ public: // ctor/dtor option_resolution(const option_guide &guide); - ~option_resolution(); + ~option_resolution() = default; // sets a specification void set_specification(const std::string &specification); diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index 65aac4a8883..fd0783ccaae 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -15,10 +15,10 @@ #include <locale> #include <string> -#include <assert.h> -#include <ctype.h> -#include <stdarg.h> -#include <stdlib.h> +#include <cassert> +#include <cctype> +#include <cstdarg> +#include <cstdlib> const int core_options::MAX_UNADORNED_OPTIONS; @@ -423,15 +423,6 @@ const char *core_options::simple_entry::maximum() const noexcept //************************************************************************** //------------------------------------------------- -// core_options - constructor -//------------------------------------------------- - -core_options::core_options() -{ -} - - -//------------------------------------------------- // ~core_options - destructor //------------------------------------------------- @@ -520,7 +511,7 @@ void core_options::add_entry(const options_entry &opt, bool override_existing) { for (const std::string &name : names) { - existing_entry = get_entry(name.c_str()); + existing_entry = get_entry(name); if (existing_entry) break; } @@ -657,7 +648,7 @@ void core_options::parse_command_line(const std::vector<std::string> &args, int // special case - collect unadorned arguments after commands into a special place if (is_unadorned && !m_command.empty()) { - m_command_arguments.push_back(std::move(args[arg])); + m_command_arguments.push_back(args[arg]); command_argument_processed(); continue; } diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 457ec08dd1d..a28720a0373 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -147,7 +147,7 @@ public: }; // construction/destruction - core_options(); + core_options() = default; core_options(const core_options &) = delete; core_options(core_options &&) = default; core_options& operator=(const core_options &) = delete; @@ -213,7 +213,7 @@ private: simple_entry(simple_entry &&) = delete; simple_entry& operator=(const simple_entry &) = delete; simple_entry& operator=(simple_entry &&) = delete; - ~simple_entry(); + virtual ~simple_entry(); // getters virtual const char *value() const noexcept override; diff --git a/src/lib/util/palette.cpp b/src/lib/util/palette.cpp index 488f7f8a2d2..47fa06c05bd 100644 --- a/src/lib/util/palette.cpp +++ b/src/lib/util/palette.cpp @@ -8,11 +8,11 @@ ******************************************************************************/ -#include <assert.h> +#include <cassert> #include "palette.h" -#include <stdlib.h> -#include <math.h> +#include <cstdlib> +#include <cmath> #include <algorithm> @@ -256,15 +256,6 @@ palette_t::palette_t(uint32_t numcolors, uint32_t numgroups) // palette_t - destructor //------------------------------------------------- -palette_t::~palette_t() -{ -} - - -//------------------------------------------------- -// palette_t - destructor -//------------------------------------------------- - void palette_t::deref() { if (--m_refcount == 0) diff --git a/src/lib/util/palette.h b/src/lib/util/palette.h index ff2c7bb80c9..0407a87c29b 100644 --- a/src/lib/util/palette.h +++ b/src/lib/util/palette.h @@ -191,7 +191,7 @@ public: private: // construction/destruction palette_t(uint32_t numcolors, uint32_t numgroups = 1); - ~palette_t(); + ~palette_t() = default; // internal helpers rgb_t adjust_palette_entry(rgb_t entry, float brightness, float contrast, const uint8_t *gamma_map); diff --git a/src/lib/util/plaparse.cpp b/src/lib/util/plaparse.cpp index d1e7c679f97..756d29f46da 100644 --- a/src/lib/util/plaparse.cpp +++ b/src/lib/util/plaparse.cpp @@ -10,10 +10,10 @@ ***************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> #include "jedparse.h" #include "plaparse.h" @@ -308,7 +308,7 @@ static bool process_field(jed_data *data, const uint8_t **src, const uint8_t *sr int pla_parse(const void *data, size_t length, jed_data *result) { - const uint8_t *src = (const uint8_t *)data; + const auto *src = (const uint8_t *)data; const uint8_t *srcend = src + length; parse_info pinfo; diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp index 6b13f4f9593..6eb5293da53 100644 --- a/src/lib/util/png.cpp +++ b/src/lib/util/png.cpp @@ -21,8 +21,8 @@ #include <cmath> #include <new> -#include <math.h> -#include <stdlib.h> +#include <cmath> +#include <cstdlib> @@ -201,7 +201,7 @@ private: stream.next_out = pnginfo.image.get(); stream.avail_out = expected; stream.avail_in = 0; - std::list<image_data_chunk>::const_iterator it = idata.begin(); + auto it = idata.begin(); while ((idata.end() != it) && ((Z_OK == zerr) || (Z_BUF_ERROR == zerr)) && !stream.avail_in) { stream.avail_in = it->length; @@ -1042,7 +1042,7 @@ static png_error convert_bitmap_to_image_palette(png_info &pnginfo, const bitmap /* copy in the pixels, specifying a nullptr filter */ for (y = 0; y < pnginfo.height; y++) { - uint16_t *src = reinterpret_cast<uint16_t *>(bitmap.raw_pixptr(y)); + auto *src = reinterpret_cast<uint16_t *>(bitmap.raw_pixptr(y)); uint8_t *dst = &pnginfo.image[y * (rowbytes + 1)]; /* store the filter byte, then copy the data */ @@ -1088,7 +1088,7 @@ static png_error convert_bitmap_to_image_rgb(png_info &pnginfo, const bitmap_t & /* 16bpp palettized format */ if (bitmap.format() == BITMAP_FORMAT_IND16) { - uint16_t *src16 = reinterpret_cast<uint16_t *>(bitmap.raw_pixptr(y)); + auto *src16 = reinterpret_cast<uint16_t *>(bitmap.raw_pixptr(y)); for (x = 0; x < pnginfo.width; x++) { rgb_t color = palette[*src16++]; @@ -1101,7 +1101,7 @@ static png_error convert_bitmap_to_image_rgb(png_info &pnginfo, const bitmap_t & /* 32-bit RGB direct */ else if (bitmap.format() == BITMAP_FORMAT_RGB32) { - uint32_t *src32 = reinterpret_cast<uint32_t *>(bitmap.raw_pixptr(y)); + auto *src32 = reinterpret_cast<uint32_t *>(bitmap.raw_pixptr(y)); for (x = 0; x < pnginfo.width; x++) { rgb_t raw = *src32++; @@ -1114,7 +1114,7 @@ static png_error convert_bitmap_to_image_rgb(png_info &pnginfo, const bitmap_t & /* 32-bit ARGB direct */ else if (bitmap.format() == BITMAP_FORMAT_ARGB32) { - uint32_t *src32 = reinterpret_cast<uint32_t *>(bitmap.raw_pixptr(y)); + auto *src32 = reinterpret_cast<uint32_t *>(bitmap.raw_pixptr(y)); for (x = 0; x < pnginfo.width; x++) { rgb_t raw = *src32++; diff --git a/src/lib/util/pool.cpp b/src/lib/util/pool.cpp index 606a7aea4b6..6bf049db03d 100644 --- a/src/lib/util/pool.cpp +++ b/src/lib/util/pool.cpp @@ -8,9 +8,9 @@ ***************************************************************************/ -#include <stdarg.h> -#include <stddef.h> -#include <stdlib.h> +#include <cstdarg> +#include <cstddef> +#include <cstdlib> #include "pool.h" #include "coreutil.h" @@ -578,7 +578,7 @@ static void memory_error(const char *message) * @return An int. */ -bool test_memory_pools(void) +bool test_memory_pools() { object_pool *pool; void *ptrs[16]; diff --git a/src/lib/util/sha1.cpp b/src/lib/util/sha1.cpp index fcda6ff9995..abc073cb6e8 100644 --- a/src/lib/util/sha1.cpp +++ b/src/lib/util/sha1.cpp @@ -27,9 +27,9 @@ #include "sha1.h" -#include <assert.h> -#include <stdlib.h> -#include <string.h> +#include <cassert> +#include <cstdlib> +#include <cstring> static unsigned int READ_UINT32(const uint8_t* data) { diff --git a/src/lib/util/unicode.h b/src/lib/util/unicode.h index 46e1aec3496..9c727041db8 100644 --- a/src/lib/util/unicode.h +++ b/src/lib/util/unicode.h @@ -23,7 +23,7 @@ #include <string> -#include <stdlib.h> +#include <cstdlib> diff --git a/src/lib/util/unzip.cpp b/src/lib/util/unzip.cpp index 836d67f1113..a659445e1cc 100644 --- a/src/lib/util/unzip.cpp +++ b/src/lib/util/unzip.cpp @@ -1159,7 +1159,7 @@ archive_file::error zip_file_impl::decompress_data_type_8(std::uint64_t offset, } // loop until we're done - while (1) + while (true) { // read in the next chunk of data std::uint32_t read_length(0); diff --git a/src/lib/util/vbiparse.cpp b/src/lib/util/vbiparse.cpp index bfd145dd99f..6b790ec7180 100644 --- a/src/lib/util/vbiparse.cpp +++ b/src/lib/util/vbiparse.cpp @@ -10,7 +10,7 @@ #include "osdcore.h" #include "vbiparse.h" -#include <math.h> +#include <cmath> #include <algorithm> diff --git a/src/lib/util/wavwrite.cpp b/src/lib/util/wavwrite.cpp index 93b4b0a6ca7..56a7cd4e43b 100644 --- a/src/lib/util/wavwrite.cpp +++ b/src/lib/util/wavwrite.cpp @@ -23,7 +23,7 @@ wav_file *wav_open(const char *filename, int sample_rate, int channels) std::uint16_t temp16; // allocate memory for the wav struct - wav_file *const wav = new (std::nothrow) wav_file; + auto *const wav = new (std::nothrow) wav_file; if (!wav) return nullptr; diff --git a/src/lib/util/xmlfile.cpp b/src/lib/util/xmlfile.cpp index 1014a7b245c..8ba2cec92c3 100644 --- a/src/lib/util/xmlfile.cpp +++ b/src/lib/util/xmlfile.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <assert.h> +#include <cassert> #include "xmlfile.h" @@ -68,9 +68,6 @@ static void expat_element_end(void *data, const XML_Char *name); XML FILE OBJECTS ***************************************************************************/ -file::file() { } -file::~file() { } - /*------------------------------------------------- create - create a new, empty XML file @@ -757,7 +754,7 @@ const char *normalize_string(const char *string) static void *expat_malloc(size_t size) { - uint32_t *result = (uint32_t *)malloc(size + 4 * sizeof(uint32_t)); + auto *result = (uint32_t *)malloc(size + 4 * sizeof(uint32_t)); *result = size; return &result[4]; } @@ -840,7 +837,7 @@ static bool expat_setup_parser(parse_info &info, parse_options const *opts) static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes) { - parse_info *info = (parse_info *) data; + auto *info = (parse_info *) data; data_node **curnode = &info->curnode; data_node *newnode; int attr; @@ -869,7 +866,7 @@ static void expat_element_start(void *data, const XML_Char *name, const XML_Char static void expat_data(void *data, const XML_Char *s, int len) { - parse_info *info = (parse_info *) data; + auto *info = (parse_info *) data; data_node **curnode = &info->curnode; (*curnode)->append_value(s, len); } @@ -882,7 +879,7 @@ static void expat_data(void *data, const XML_Char *s, int len) static void expat_element_end(void *data, const XML_Char *name) { - parse_info *info = (parse_info *) data; + auto *info = (parse_info *) data; data_node **curnode = &info->curnode; /* strip leading/trailing spaces from the value data */ diff --git a/src/lib/util/xmlfile.h b/src/lib/util/xmlfile.h index 8d09b2b7e1e..659ad59ae31 100644 --- a/src/lib/util/xmlfile.h +++ b/src/lib/util/xmlfile.h @@ -215,7 +215,7 @@ public: using ptr = std::unique_ptr<file>; - ~file(); + ~file() = default; // create a new, empty XML file static ptr create(); @@ -231,7 +231,7 @@ public: private: - file(); + file() = default; }; diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp index d8e90de11ff..760c64fd066 100644 --- a/src/lib/util/zippath.cpp +++ b/src/lib/util/zippath.cpp @@ -13,7 +13,7 @@ #include "corestr.h" #include "osdcore.h" -#include <stdlib.h> +#include <cstdlib> #include <cassert> #include <cctype> @@ -264,7 +264,7 @@ osd_file::error zippath_resolve(const char *path, osd::directory::entry::entry_t apath = zippath_parent(apath); } } - while ((current_entry_type == osd::directory::entry::entry_type::NONE) && !is_root(apath.c_str())); + while ((current_entry_type == osd::directory::entry::entry_type::NONE) && !is_root(apath)); // if we did not find anything, then error out if (current_entry_type == osd::directory::entry::entry_type::NONE) diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt index a237648d20c..247f1f7675f 100644 --- a/src/mame/arcade.flt +++ b/src/mame/arcade.flt @@ -324,6 +324,7 @@ destroyr.cpp dfruit.cpp dgpix.cpp dietgo.cpp +dinoking.cpp discoboy.cpp divebomb.cpp diverboy.cpp @@ -395,6 +396,7 @@ fastlane.cpp fcombat.cpp fcrash.cpp feversoc.cpp +ffantasy_ms.cpp fgoal.cpp finalizr.cpp fireball.cpp @@ -624,6 +626,7 @@ kncljoe.cpp koftball.cpp koikoi.cpp konamigq.cpp +konamigs.cpp konamigv.cpp konamigx.cpp konamim2.cpp @@ -739,6 +742,7 @@ mephistp.cpp merit.cpp merit3xx.cpp meritm.cpp +merits.cpp mermaid.cpp metalmx.cpp metlclsh.cpp @@ -1123,6 +1127,7 @@ simple_st0016.cpp simpsons.cpp skeetsht.cpp skimaxx.cpp +skopro.cpp skullxbo.cpp skyarmy.cpp skydiver.cpp @@ -1264,6 +1269,7 @@ tattack.cpp taxidriv.cpp tbowl.cpp tceptor.cpp +teamjocs.cpp techno.cpp tecmo.cpp tecmo16.cpp diff --git a/src/mame/audio/galaxian.cpp b/src/mame/audio/galaxian.cpp index 57277decfd6..4485c26104a 100644 --- a/src/mame/audio/galaxian.cpp +++ b/src/mame/audio/galaxian.cpp @@ -25,6 +25,7 @@ TODO: #include "emu.h" #include "audio/galaxian.h" #include "includes/galaxian.h" +#include "speaker.h" /************************************* * @@ -243,7 +244,7 @@ static const discrete_op_amp_filt_info galaxian_bandpass_desc = *************************************/ -DISCRETE_SOUND_START(galaxian_discrete) +static DISCRETE_SOUND_START(galaxian_discrete) /************************************************/ /* Input register mapping for galaxian */ @@ -375,7 +376,7 @@ DISCRETE_SOUND_START(galaxian_discrete) DISCRETE_SOUND_END -DISCRETE_SOUND_START(mooncrst_discrete) +static DISCRETE_SOUND_START(mooncrst_discrete) DISCRETE_IMPORT(galaxian_discrete) /************************************************/ @@ -386,13 +387,18 @@ DISCRETE_SOUND_START(mooncrst_discrete) DISCRETE_MIXER7(NODE_280, 1, NODE_133_00, NODE_133_02, NODE_133_02,NODE_133_03, NODE_120, NODE_157, NODE_182, &mooncrst_mixer_desc) DISCRETE_SOUND_END -DEFINE_DEVICE_TYPE(GALAXIAN, galaxian_sound_device, "galaxian_sound", "Galaxian Custom Sound") +DEFINE_DEVICE_TYPE(GALAXIAN_SOUND, galaxian_sound_device, "galaxian_sound", "Galaxian Custom Sound") +DEFINE_DEVICE_TYPE(MOONCRST_SOUND, mooncrst_sound_device, "mooncrst_sound", "Mooncrst Custom Sound") galaxian_sound_device::galaxian_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, GALAXIAN, tag, owner, clock) - , device_sound_interface(mconfig, *this) - , m_lfo_val(0) - , m_discrete(*this, "^" GAL_AUDIO) +: galaxian_sound_device(mconfig, GALAXIAN_SOUND, tag, owner, clock) +{ +} + +galaxian_sound_device::galaxian_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +: device_t(mconfig, type, tag, owner, clock) +, m_discrete(*this, "discrete") +, m_lfo_val(0) { } @@ -407,6 +413,17 @@ void galaxian_sound_device::device_start() save_item(NAME(m_lfo_val)); } +//------------------------------------------------- +// machine_add_config - add device configuration +//------------------------------------------------- + +void galaxian_sound_device::device_add_mconfig(machine_config &config) +{ + // sound hardware + DISCRETE(config, m_discrete).add_route(ALL_OUTPUTS, ":speaker", 1.0); + m_discrete->set_intf(galaxian_discrete); +} + /************************************* * * Write handlers @@ -480,10 +497,13 @@ WRITE8_MEMBER( galaxian_sound_device::sound_w ) } } -//------------------------------------------------- -// sound_stream_update - handle a stream update -//------------------------------------------------- +mooncrst_sound_device::mooncrst_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +: galaxian_sound_device(mconfig, MOONCRST_SOUND, tag, owner, clock) +{ +} -void galaxian_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +void mooncrst_sound_device::device_add_mconfig(machine_config &config) { + galaxian_sound_device::device_add_mconfig(config); + m_discrete->set_intf(mooncrst_discrete); } diff --git a/src/mame/audio/galaxian.h b/src/mame/audio/galaxian.h index 7165ca6d011..fe84309fd67 100644 --- a/src/mame/audio/galaxian.h +++ b/src/mame/audio/galaxian.h @@ -7,12 +7,11 @@ #include "sound/discrete.h" -#define GAL_AUDIO "discrete" - -class galaxian_sound_device : public device_t, public device_sound_interface +class galaxian_sound_device : public device_t { public: galaxian_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + galaxian_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( sound_w ); DECLARE_WRITE8_MEMBER( pitch_w ); @@ -25,19 +24,32 @@ public: protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; // sound stream update overrides - virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + // virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + required_device<discrete_device> m_discrete; private: // internal state uint8_t m_lfo_val; - required_device<discrete_device> m_discrete; }; -DECLARE_DEVICE_TYPE(GALAXIAN, galaxian_sound_device) +class mooncrst_sound_device : public galaxian_sound_device +{ +public: + mooncrst_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + +}; + +DECLARE_DEVICE_TYPE(GALAXIAN_SOUND, galaxian_sound_device) +DECLARE_DEVICE_TYPE(MOONCRST_SOUND, mooncrst_sound_device) -DISCRETE_SOUND_EXTERN(galaxian_discrete); -DISCRETE_SOUND_EXTERN(mooncrst_discrete); +//DISCRETE_SOUND_EXTERN(galaxian_discrete); +//DISCRETE_SOUND_EXTERN(mooncrst_discrete); #endif // MAME_AUDIO_GALAXIAN_H diff --git a/src/mame/audio/nl_konami.cpp b/src/mame/audio/nl_konami.cpp new file mode 100644 index 00000000000..af1bec71882 --- /dev/null +++ b/src/mame/audio/nl_konami.cpp @@ -0,0 +1,202 @@ +// license:CC0 +// copyright-holders:Couriersud +#include "netlist/devices/net_lib.h" + +#ifdef NLBASE_H_ +#error Somehow nl_base.h made it into the include chain. +#endif + +/* + * M51516L pins: + * + * pin + * 9 - power, + * 8 - output 1, + * 7 - output 2, + * 6 - ground (large signal), + * 5 - feedback 2, + * 4 - feedback 1, + * 3 - muting, + * 2 - ground (small signal), + * 1 - input + * + * on the block diagram, box to the right of pin 3 says "Muting" + * and then to the right of that "ASO protection, surge protection, heat barrier" + * + */ + +static NETLIST_START(filter) + CD4066_GATE(G1) + PARAM(G1.BASER, 270.0) + CD4066_GATE(G2) + PARAM(G2.BASER, 270.0) + RES(RI, RES_K(1)) + RES(RO, RES_K(5)) + CAP(C1, CAP_U(0.22)) + CAP(C2, CAP_U(0.047)) + NET_C(RI.2, RO.1, G1.R.1, G2.R.1) + NET_C(G1.R.2, C1.1) + NET_C(G2.R.2, C2.1) + + NET_C(C1.2, C2.2, G1.VSS, G2.VSS) + NET_C(G1.VDD, G2.VDD) + + ALIAS(I, RI.1) + ALIAS(O, RO.2) + + ALIAS(CTL1, G1.CTL) + ALIAS(CTL2, G2.CTL) + + ALIAS(VDD, G1.VDD) + ALIAS(VSS, G1.VSS) +NETLIST_END() + +static NETLIST_START(amp) + + UA741_DIP8(X3A) + RES(R1, RES_K(2.2)) + RES(R2, RES_K(4.7)) + RES(VR, 200) // Actually a potentiometer + CAP(C1, CAP_U(0.15)) + RES(RI, RES_K(100)) + + NET_C(X3A.2, R1.1) + NET_C(X3A.6, R1.2, R2.1) + NET_C(R2.2, VR.1) + NET_C(VR.1, C1.1) // 100% pot position + NET_C(C1.2, RI.1) + + NET_C(GND, VR.2, RI.2) + + // Amplifier M51516L, assume input RI 100k + + ALIAS(OPAMP, X3A.2) + ALIAS(OUT, RI.1) + ALIAS(VP, X3A.7) + ALIAS(VM, X3A.4) + ALIAS(GND, X3A.3) + +NETLIST_END() + +static NETLIST_START(AY1) + TTL_INPUT(CTL0, 0) + TTL_INPUT(CTL1, 0) + TTL_INPUT(CTL2, 0) + TTL_INPUT(CTL3, 0) + TTL_INPUT(CTL4, 0) + TTL_INPUT(CTL5, 0) + /* AY 8910 internal resistors */ + RES(R_AY3D_A, 1000) + RES(R_AY3D_B, 1000) + RES(R_AY3D_C, 1000) + NET_C(VP5, R_AY3D_A.1, R_AY3D_B.1, R_AY3D_C.1) + + SUBMODEL(filter, FCHA1) + NET_C(FCHA1.I, R_AY3D_A.2) + SUBMODEL(filter, FCHB1) + NET_C(FCHB1.I, R_AY3D_B.2) + SUBMODEL(filter, FCHC1) + NET_C(FCHC1.I, R_AY3D_C.2) + + NET_C(FCHA1.CTL1, CTL0) + NET_C(FCHA1.CTL2, CTL1) + NET_C(FCHB1.CTL1, CTL2) + NET_C(FCHB1.CTL2, CTL3) + NET_C(FCHC1.CTL1, CTL4) + NET_C(FCHC1.CTL2, CTL5) + + NET_C(VP5, FCHA1.VDD, FCHB1.VDD, FCHC1.VDD) + NET_C(GND, FCHA1.VSS, FCHB1.VSS, FCHC1.VSS) + + NET_C(VP5, CTL0.VCC, CTL1.VCC, CTL2.VCC, CTL3.VCC, CTL4.VCC, CTL5.VCC) + NET_C(GND, CTL0.GND, CTL1.GND, CTL2.GND, CTL3.GND, CTL4.GND, CTL5.GND) + +NETLIST_END() + +static NETLIST_START(AY2) + TTL_INPUT(CTL6, 0) + TTL_INPUT(CTL7, 0) + TTL_INPUT(CTL8, 0) + TTL_INPUT(CTL9, 0) + TTL_INPUT(CTL10, 0) + TTL_INPUT(CTL11, 0) + /* AY 8910 internal resistors */ + RES(R_AY3C_A, 1000) + RES(R_AY3C_B, 1000) + RES(R_AY3C_C, 1000) + NET_C(VP5, R_AY3C_A.1, R_AY3C_B.1, R_AY3C_C.1) + + SUBMODEL(filter, FCHA2) + NET_C(FCHA2.I, R_AY3C_A.2) + SUBMODEL(filter, FCHB2) + NET_C(FCHB2.I, R_AY3C_B.2) + SUBMODEL(filter, FCHC2) + NET_C(FCHC2.I, R_AY3C_C.2) + + NET_C(FCHA2.CTL1, CTL6) + NET_C(FCHA2.CTL2, CTL7) + NET_C(FCHB2.CTL1, CTL8) + NET_C(FCHB2.CTL2, CTL9) + NET_C(FCHC2.CTL1, CTL10) + NET_C(FCHC2.CTL2, CTL11) + + NET_C(VP5, FCHA2.VDD, FCHB2.VDD, FCHC2.VDD) + NET_C(GND, FCHA2.VSS, FCHB2.VSS, FCHC2.VSS) + + NET_C(VP5, CTL6.VCC, CTL7.VCC, CTL8.VCC, CTL9.VCC, CTL10.VCC, CTL11.VCC) + NET_C(GND, CTL6.GND, CTL7.GND, CTL8.GND, CTL9.GND, CTL10.GND, CTL11.GND) + +NETLIST_END() + +NETLIST_START(konami2x) + + SOLVER(Solver, 48000) + + ANALOG_INPUT(VP5, 5) + ANALOG_INPUT(VM5, -5) + + LOCAL_SOURCE(filter) + LOCAL_SOURCE(amp) + LOCAL_SOURCE(AY1) + LOCAL_SOURCE(AY2) + + INCLUDE(AY1) + INCLUDE(AY2) + + NET_C(FCHA1.O, FCHB1.O, FCHC1.O, FCHA2.O, FCHB2.O, FCHC2.O) + + SUBMODEL(amp, AMP) + + NET_C(VP5, AMP.VP) + NET_C(GND, AMP.GND) + NET_C(VM5, AMP.VM) + NET_C(FCHA1.O, AMP.OPAMP) + + ALIAS(OUT, AMP.OUT) +NETLIST_END() + +NETLIST_START(konami1x) + + SOLVER(Solver, 48000) + + ANALOG_INPUT(VP5, 5) + ANALOG_INPUT(VM5, -5) + + LOCAL_SOURCE(filter) + LOCAL_SOURCE(amp) + LOCAL_SOURCE(AY1) + LOCAL_SOURCE(AY2) + + INCLUDE(AY1) + + NET_C(FCHA1.O, FCHB1.O, FCHC1.O) + + SUBMODEL(amp, AMP) + + NET_C(VP5, AMP.VP) + NET_C(GND, AMP.GND) + NET_C(VM5, AMP.VM) + NET_C(FCHA1.O, AMP.OPAMP) + + ALIAS(OUT, AMP.OUT) +NETLIST_END() diff --git a/src/mame/audio/nl_konami.h b/src/mame/audio/nl_konami.h new file mode 100644 index 00000000000..12f93e89af6 --- /dev/null +++ b/src/mame/audio/nl_konami.h @@ -0,0 +1,7 @@ +// license:CC0 +// copyright-holders:Couriersud + +#include "netlist/nl_setup.h" + +NETLIST_EXTERNAL(konami1x) +NETLIST_EXTERNAL(konami2x) diff --git a/src/mame/audio/nl_segas16b.cpp b/src/mame/audio/nl_segas16b.cpp new file mode 100644 index 00000000000..21c2ae3bdfb --- /dev/null +++ b/src/mame/audio/nl_segas16b.cpp @@ -0,0 +1,172 @@ +// license:CC0 +// copyright-holders:Couriersud +#include "netlist/devices/net_lib.h" + +#ifdef NLBASE_H_ +#error Somehow nl_base.h made it into the include chain. +#endif + +NETLIST_START(segas16b_audio) + SOLVER(Solver, 48000) + //PARAM(Solver.DYNAMIC_TS, 1) + + ANALOG_INPUT(VP5, 5) + ANALOG_INPUT(VP12, 12) + + /* UPD7759 has resistor of 47K on reference pin + * ==> IREF ~30 uA + * According to datasheet maximum current sink + * is 34 * IREF. + * + * MAME must provide range of 0 to 1020 uA to the current sink. + * + */ +#if 0 + CLOCK(T0, 10) + NET_C(GND, T0.GND) + NET_C(VP5, T0.VCC) + RES(T0R, RES_M(10000000)) + NET_C(T0, T0R.1) + + CS(T1, 0.0) + //PARAM(T1.FUNC, "0.001020 * (0.5 + 0.5 * sin(6280 * T))") + RES(T2, 1000) + NET_C(GND, T2.2, T1.2) + NET_C(T1.1, T2.1, T0R.2) +#endif + + CS(SPEECH, 0) + //PARAM(SPEECH.FUNC, "0.001020 * (0.5 + 0.5 * sin(6280 * T))") + NET_C(SPEECH.2, GND) + + ANALOG_INPUT(CH1, 0) + ANALOG_INPUT(CH2, 0) + +#if 0 + VS(CH1VS, 0) + PARAM(CH1VS.FUNC, "2.5 + 1.25 * sin(6280 * T)") + NET_C(CH1VS.2, GND) + ALIAS(CH2, CH1VS.1) +#endif + + /* The YM3012 uses only one dac for the two channels. + * Sample-and-hold is used to two toggle between the two channels. + * This is not emulated here since the YM2151 signals are provided + * externally. + * + * Therefore two RCOM resistors are used for now directly connected + * to the channels. + * + * The YM3012 datasheet gives a formula for digital to VOUT: + * VOUT = 0.5 VDD + 0.25 * VDD *(-1 + D9 + d8/2 .. + d0/512 + 1/1024)/pow(2,N) + * N= S2Q*4+S1Q*2+S0Q + * 3 bits ignored (I0,I1,I2) + * Serial data stream: I0,I1,I2,D0,..., D9,S0,S1,S2 + * + * Basically output is between 0.25 * VDD and 0.75 * VDD. + * This needs to be done in MAME interface + */ + + TL084_DIP(D20) + LM324_DIP(XC20) + + RES(RCOM1, 390) + RES(RCOM2, 390) + + CAP(C21, CAP_U(2.2)) + CAP(C22, CAP_U(2.2)) // Needs verification + CAP(C27, CAP_P(1500)) + CAP(C28, CAP_P(1500)) + + // ------------------------------------ + // YM2151/YM3012 inputs + // ------------------------------------ + + NET_C(CH1, RCOM1.1) + NET_C(RCOM1.2, C27.1, D20.5) + NET_C(D20.7, D20.6, C22.1) + + NET_C(CH2, RCOM2.1) + NET_C(RCOM2.2, C28.1, D20.10) + NET_C(D20.8, D20.9, C21.1) + + NET_C(GND, C27.2, C28.2) + + // OPAMPS, no information on schematics, assume 12V since + // TL084 with 5V would be outside specifications + // No negative voltages found on schematics + + NET_C(VP12, XC20.4, D20.4) + NET_C(GND, XC20.11, D20.11) + + // ------------------------------------ + // Speech inputs + // ------------------------------------ + + RES(R11, RES_K(1)) + RES(R14, RES_K(5.6)) + RES(R16, RES_K(6.8)) + RES(R15, RES_K(12)) + RES(R12, RES_K(1.3)) + RES(R13, RES_K(6.2)) + CAP(C25, CAP_U(0.0022)) + CAP(C26, CAP_U(0.022)) + CAP(C23, CAP_U(0.022)) + CAP(C29, CAP_U(0.01)) + CAP(C62, CAP_U(2.2)) + + NET_C(VP5, R11.1) + NET_C(SPEECH.1, R11.2, R14.1) + NET_C(R14.2, R16.1, C26.1, R15.1) + NET_C(R15.2, C25.1, XC20.5) + NET_C(XC20.7, XC20.6, C26.2, R12.1) + + NET_C(R12.2, C23.1, R13.1) + NET_C(R13.2, C29.1, XC20.3) + NET_C(XC20.1, XC20.2, C23.2, C62.1) + + NET_C(GND, R16.2, C25.2, C29.2) + + // ------------------------------------ + // Mixing and pre amplifier + // ------------------------------------ + + RES(R6, RES_K(10)) + RES(R9, RES_K(47)) + RES(R10, RES_K(47)) + RES(R4, RES_K(10)) + RES(R7, RES_K(47)) + RES(R3, RES_K(10)) + RES(R5, RES_K(10)) + RES(VR1, RES_K(2)) // FIXME: Actually a potentiometer + CAP(C12, CAP_U(10)) + CAP(C63, CAP_U(2.2)) + CAP(C20, CAP_P(1000)) + CAP(C19, CAP_U(47)) // FIXME: Needs verification + RES(AMP_IN, RES_K(100)) + + NET_C(C62.2, R6.1) + NET_C(C22.2, R9.1) + NET_C(C21.2, R10.1) + NET_C(R6.2, R9.2, R10.2, XC20.9, C20.1, R7.1) // FIXME: Schematics read "9" (XC20.9) - other AMP? + NET_C(R7.2, C20.2, C63.1, XC20.8) // FIXME: Schematics read "7" (XC20.7) - other AMP? + + NET_C(VP5, R4.1) + NET_C(R4.2, C19.1, R5.1, XC20.10) // FIXME: Schematics read "8" (XC20.8) - other AMP? + + NET_C(C63.2, R3.1) + NET_C(R3.2, VR1.1, C12.1) + NET_C(C12.2, AMP_IN.1) + + NET_C(GND, VR1.2, C19.2, R5.2, AMP_IN.2) + + // OUTPUT + + ALIAS(OUT, AMP_IN.1) + + // Not connected + + NET_C(GND, XC20.13, XC20.12, D20.13, D20.12, D20.2, D20.3) + NET_C(GND, XC20.14, D20.14, D20.1) +NETLIST_END() + diff --git a/src/mame/audio/nl_segas16b.h b/src/mame/audio/nl_segas16b.h new file mode 100644 index 00000000000..a31546fb200 --- /dev/null +++ b/src/mame/audio/nl_segas16b.h @@ -0,0 +1,4 @@ +// license:CC0 +// copyright-holders:Couriersud + +NETLIST_EXTERNAL(segas16b_audio) diff --git a/src/mame/audio/nl_zac1b11142.cpp b/src/mame/audio/nl_zac1b11142.cpp index 4d3dcf51c6c..06933f97694 100644 --- a/src/mame/audio/nl_zac1b11142.cpp +++ b/src/mame/audio/nl_zac1b11142.cpp @@ -16,12 +16,11 @@ NETLIST_START(zac1b11142_schematics) TTL_7474_DIP(U3A) // FIXME: need 74LS family model (higher input impedance, half the sink capability) CD4016_DIP(U5D) - NET_C(VCC, /*U3A.14,*/ U5D.14) // 7474 model doesn't have Vcc pin - NET_C(GND, /*U3A.7,*/ U5D.7) // 7474 model doesn't have GND pin + NET_C(VCC, U3A.14, U5D.14) + NET_C(GND, U3A.7, U5D.7) NET_C(VCC, U3A.10, U3A.11, U3A.12, U3A.13) // only half of this chip is used in this audio section - tie up the other inputs - // ANAL1/IOA3/IOA4 -> RULLANTE/CASSA CAP(C61, CAP_U(10)) @@ -427,9 +426,6 @@ NETLIST_START(zac1b11142) * Power terminals * -----------------------------------------------------------------------*/ - NET_C(VCC, U3A.14) - NET_C(GND, U3A.7) - // Reverse so that volume raises with raising percentage in ui PARAM(P1.REVERSE, 1) PARAM(P2.REVERSE, 1) diff --git a/src/mame/drivers/30test.cpp b/src/mame/drivers/30test.cpp index 4a9c4c0f4b3..39bcb9487c3 100644 --- a/src/mame/drivers/30test.cpp +++ b/src/mame/drivers/30test.cpp @@ -2,14 +2,20 @@ // copyright-holders:Angelo Salese, hap /*************************************************************************** - 30 Test (Remake) (c) 1997 Namco +30 Test (サーティテスト) (c) 1997 Namco, game code M125 +This is a remake, the original version was from 1970 and didn't have a CPU. - driver by Angelo Salese +driver by Angelo Salese - TODO: - - portd meaning is a mystery - - inputs are annoying to map; - - EEPROM +Hardware notes: +- MC68HC11K1 +- M6295 +- X1 1.056MHz +- OSC1 16.000MHz + +TODO: +- inputs are annoying to map (just use the clickable artwork) +- EEPROM in MCU ============================================================================ @@ -17,29 +23,22 @@ cheats: - [0xb0-0xb3] timer lamps: -?OK???!! = really OK! (91+) (0x81) -???????? = pretty good (80+) (0x82) -???~??? = not bad (70+) (0x84) -??? = normal (55+) (0x88) -????? = pretty bad (40+) (0x90) -???~ = worst (39 or less) (0xa0) -??????? = game over (0xe0) - - -============================================================================ - -30-TEST (Remake) -NAMCO 1997 -GAME CODE M125 - -MC68HC11K1 -M6295 -X1 1.056MHz -OSC1 16.000MHz - - -cabinet photo -http://blogs.yahoo.co.jp/nadegatayosoyuki/59285865.html +- [0x81] really OK! (91+) - 超OKっすよ!! +- [0x82] pretty good (80+) - かなりィ⤴っすヨ +- [0x84] not bad (70+) - あっい〜じゃん +- [0x88] normal (55+) - ふつう +- [0x90] pretty bad (40+) - ちょいたり +- [0xa0] worst (39 or less) - サイテ〜 +- [0xe0] game over - ゲームオーバー + +settings stored in EEPROM: +- [0xd90] coins per credit (default 0x01) +- [0xd91] games per credit (default 0x02) +- [0xd99] time per game (default 0x0c, 12 seconds) +- [0xda9] language (default 0x03) - 0 = English, 1 = Chinese, 2 = Korean, 3 = Japanese + +0xd90-0xda8 can also be changed in-game by holding service coin and then entering +testmode (hold 9, press F2). Voice language cannot be changed here though. ***************************************************************************/ @@ -50,20 +49,20 @@ http://blogs.yahoo.co.jp/nadegatayosoyuki/59285865.html #include "30test.lh" -#define MAIN_CLOCK XTAL(16'000'000) class namco_30test_state : public driver_device { public: - namco_30test_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_oki(*this, "oki") - , m_digits(*this, "digit%u", 0U) - , m_lamps(*this, "lamp%u", 0U) - { } + namco_30test_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_oki(*this, "oki"), + m_inputs(*this, "IN%u", 0), + m_digits(*this, "digit%u", 0U), + m_lamps(*this, "lamp%u", 0U) + { } - void _30test(machine_config &config); + void namco_30test(machine_config &config); protected: virtual void machine_start() override; @@ -71,188 +70,209 @@ protected: private: required_device<mc68hc11_cpu_device> m_maincpu; required_device<okim6295_device> m_oki; + required_ioport_array<4> m_inputs; output_finder<72> m_digits; output_finder<8> m_lamps; - uint8_t m_mux_data; - uint8_t m_oki_bank; + void main_map(address_map &map); - DECLARE_WRITE8_MEMBER(namco_30test_led_w); - DECLARE_WRITE8_MEMBER(namco_30test_led_rank_w); - DECLARE_WRITE8_MEMBER(namco_30test_lamps_w); - DECLARE_READ8_MEMBER(namco_30test_mux_r); - DECLARE_WRITE8_MEMBER(hc11_mux_w); - DECLARE_WRITE8_MEMBER(hc11_okibank_w); + void output_digit(int i, u8 data); + DECLARE_WRITE8_MEMBER(led_w); + DECLARE_WRITE8_MEMBER(led_rank_w); + DECLARE_WRITE8_MEMBER(lamps_w); + DECLARE_READ8_MEMBER(mux_r); + DECLARE_WRITE8_MEMBER(coin_w); + DECLARE_WRITE8_MEMBER(mux_w); + DECLARE_WRITE8_MEMBER(okibank_w); - void namco_30test_map(address_map &map); + u8 m_mux_data = 0; }; +void namco_30test_state::machine_start() +{ + m_digits.resolve(); + m_lamps.resolve(); + + save_item(NAME(m_mux_data)); +} -static const uint8_t led_map[16] = - { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x00 }; -WRITE8_MEMBER(namco_30test_state::namco_30test_led_w) + +/****************************************************************************** + I/O +******************************************************************************/ + +void namco_30test_state::output_digit(int i, u8 data) { - m_digits[offset * 2] = led_map[data >> 4]; - m_digits[1 + offset * 2] = led_map[data & 0x0f]; + // assume it's using a 7448 + static const u8 led_map[16] = + { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; + + m_digits[i] = led_map[data & 0xf]; } -WRITE8_MEMBER(namco_30test_state::namco_30test_led_rank_w) +WRITE8_MEMBER(namco_30test_state::led_w) { - if (offset < 4) - { - m_digits[64 + offset * 2] = led_map[data >> 4]; - m_digits[65 + offset * 2] = led_map[data & 0x0f]; - } + // 0-29: playfield + // 30,31: time + output_digit(offset * 2, data >> 4); + output_digit(1 + offset * 2, data & 0x0f); +} + +WRITE8_MEMBER(namco_30test_state::led_rank_w) +{ + // 0: 1st place + // 1: 2nd place + // 2: 3rd place + // 3: current / last play score + output_digit(64 + offset * 2, data >> 4); + output_digit(65 + offset * 2, data & 0x0f); } -WRITE8_MEMBER(namco_30test_state::namco_30test_lamps_w) +WRITE8_MEMBER(namco_30test_state::lamps_w) { // d0-d5: ranking, d6: game over, d7: assume marquee lamp for (int i = 0; i < 8; i++) m_lamps[i] = BIT(data, i); } -READ8_MEMBER(namco_30test_state::namco_30test_mux_r) +WRITE8_MEMBER(namco_30test_state::coin_w) { - uint8_t res = 0xff; + // d2: coincounter + machine().bookkeeping().coin_counter_w(0, BIT(data, 2)); - switch(m_mux_data) + // d3/d4: ticket dispenser + // other: ? +} + +READ8_MEMBER(namco_30test_state::mux_r) +{ + u8 data = 0xff; + + for (int i = 0; i < 4; i++) { - case 0x01: res = ioport("IN0")->read(); break; - case 0x02: res = ioport("IN1")->read(); break; - case 0x04: res = ioport("IN2")->read(); break; - case 0x08: res = ioport("IN3")->read(); break; + if (BIT(m_mux_data, i)) + data &= m_inputs[i]->read(); } - return res; + return data; } -WRITE8_MEMBER(namco_30test_state::hc11_mux_w) +WRITE8_MEMBER(namco_30test_state::mux_w) { m_mux_data = data; } -WRITE8_MEMBER(namco_30test_state::hc11_okibank_w) +WRITE8_MEMBER(namco_30test_state::okibank_w) { - m_oki_bank = data; m_oki->set_rom_bank(data & 1); } -void namco_30test_state::namco_30test_map(address_map &map) + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void namco_30test_state::main_map(address_map &map) { map(0x0d80, 0x0dbf).ram(); // EEPROM read-back data goes there map(0x2000, 0x2000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - /* 0x401e-0x401f: time */ - map(0x4000, 0x401f).w(FUNC(namco_30test_state::namco_30test_led_w)); // 7-seg leds - /* 0x6000: 1st place 7-seg led */ - /* 0x6001: 2nd place 7-seg led */ - /* 0x6002: 3rd place 7-seg led */ - /* 0x6003: current / last play score */ - /* 0x6004: lamps */ - map(0x6000, 0x6003).w(FUNC(namco_30test_state::namco_30test_led_rank_w)); - map(0x6004, 0x6004).w(FUNC(namco_30test_state::namco_30test_lamps_w)); + map(0x4000, 0x401f).w(FUNC(namco_30test_state::led_w)); + map(0x6000, 0x6003).w(FUNC(namco_30test_state::led_rank_w)); + map(0x6004, 0x6004).w(FUNC(namco_30test_state::lamps_w)); map(0x8000, 0xffff).rom(); } + +/****************************************************************************** + Input Ports +******************************************************************************/ + static INPUT_PORTS_START( 30test ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-1") PORT_CODE(KEYCODE_1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-2") PORT_CODE(KEYCODE_2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-3") PORT_CODE(KEYCODE_3) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-4") PORT_CODE(KEYCODE_4) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-5") PORT_CODE(KEYCODE_5) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-6") PORT_CODE(KEYCODE_6) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-1") PORT_CODE(KEYCODE_Q) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-2") PORT_CODE(KEYCODE_W) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-3") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-4") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-5") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 1-6") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-1") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-2") PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-3") PORT_CODE(KEYCODE_E) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-4") PORT_CODE(KEYCODE_R) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-5") PORT_CODE(KEYCODE_T) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-6") PORT_CODE(KEYCODE_Y) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-1") PORT_CODE(KEYCODE_A) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-2") PORT_CODE(KEYCODE_S) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-3") PORT_CODE(KEYCODE_D) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-4") PORT_CODE(KEYCODE_F) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-3") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-4") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-5") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 2-6") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-1") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-2") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-3") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-4") PORT_START("IN2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-5") PORT_CODE(KEYCODE_G) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-6") PORT_CODE(KEYCODE_H) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-1") PORT_CODE(KEYCODE_Z) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-2") PORT_CODE(KEYCODE_X) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-3") PORT_CODE(KEYCODE_C) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-4") PORT_CODE(KEYCODE_V) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-5") PORT_CODE(KEYCODE_B) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-6") PORT_CODE(KEYCODE_N) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-5") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 3-6") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-1") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-2") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-3") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-4") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-5") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 4-6") PORT_START("IN3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-1") PORT_CODE(KEYCODE_LSHIFT) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-2") PORT_CODE(KEYCODE_LCONTROL) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-3") PORT_CODE(KEYCODE_LALT) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-4") PORT_CODE(KEYCODE_SPACE) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-5") PORT_CODE(KEYCODE_RALT) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-6") PORT_CODE(KEYCODE_RCONTROL) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-3") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-4") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-5") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Button 5-6") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("SYSTEM") PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CODE(KEYCODE_7) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CODE(KEYCODE_8) - PORT_DIPNAME( 0x08, 0x08, "UNK3" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "UNK4" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "UNK5" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "UNK6" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "UNK7" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin + also used in testmode + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ticket dispenser + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) // used in testmode to advance test + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -void namco_30test_state::machine_start() -{ - m_digits.resolve(); - m_lamps.resolve(); - save_item(NAME(m_mux_data)); - save_item(NAME(m_oki_bank)); -} -void namco_30test_state::_30test(machine_config &config) +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void namco_30test_state::namco_30test(machine_config &config) { /* basic machine hardware */ - MC68HC11K1(config, m_maincpu, MAIN_CLOCK); - m_maincpu->set_addrmap(AS_PROGRAM, &namco_30test_state::namco_30test_map); - m_maincpu->in_pa_callback().set(FUNC(namco_30test_state::namco_30test_mux_r)); - //m_maincpu->in_pd_callback().set_ram(); + MC68HC11K1(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &namco_30test_state::main_map); + m_maincpu->in_pa_callback().set(FUNC(namco_30test_state::mux_r)); + m_maincpu->out_pd_callback().set(FUNC(namco_30test_state::coin_w)); m_maincpu->in_pe_callback().set_ioport("SYSTEM"); - m_maincpu->out_pg_callback().set(FUNC(namco_30test_state::hc11_okibank_w)); - m_maincpu->out_ph_callback().set(FUNC(namco_30test_state::hc11_mux_w)); + m_maincpu->out_pg_callback().set(FUNC(namco_30test_state::okibank_w)); + m_maincpu->out_ph_callback().set(FUNC(namco_30test_state::mux_w)); /* no video hardware */ /* sound hardware */ SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, 1056000, okim6295_device::PIN7_HIGH); + OKIM6295(config, m_oki, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); } -/*************************************************************************** - Game driver(s) -***************************************************************************/ +/****************************************************************************** + ROM Definitions +******************************************************************************/ ROM_START( 30test ) ROM_REGION( 0x10000, "maincpu", 0 ) @@ -262,4 +282,11 @@ ROM_START( 30test ) ROM_LOAD( "tt1-voi0.7p", 0x0000, 0x80000, CRC(b4fc5921) SHA1(92a88d5adb50dae48715847f12e88a35e37ef78c) ) ROM_END -GAMEL( 1997, 30test, 0, _30test, 30test, namco_30test_state, empty_init, ROT0, "Namco", "30 Test (Remake)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK, layout_30test ) + + +/****************************************************************************** + Drivers +******************************************************************************/ + +/* YEAR NAME PARENT MACHINE INPUT CLASS INIT MONITOR COMPANY, FULLNAME, FLAGS */ +GAMEL( 1997, 30test, 0, namco_30test, 30test, namco_30test_state, empty_init, ROT0, "Namco", "30 Test (remake)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK, layout_30test ) diff --git a/src/mame/drivers/actions_atj2279b.cpp b/src/mame/drivers/actions_atj2279b.cpp new file mode 100644 index 00000000000..fa28e4d122a --- /dev/null +++ b/src/mame/drivers/actions_atj2279b.cpp @@ -0,0 +1,98 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/****************************************************************************** + + System is fairly barebones + Main PCB has the SoC, RAM, ROM + connects to other PCBs with various types of slots (USB, SD etc.) + (ADD FULL DETAILS) + + TODO: everything - emulate the SoC + + Presumably has an internal bootstrap (at least) to boot from the NAND + + -- + + reviews for this device were less than favourable with many comments + about how the SNES and Arcade games often did not run at full speed + and how the overall quality of emulation was unremarkable + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/arm7/arm7.h" + +#include "speaker.h" +#include "screen.h" + + +class actions_atj2279b_state : public driver_device +{ +public: + actions_atj2279b_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "arm7") + { } + + void actions_atj2279b(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + + void atj2279b_map(address_map &map); + + required_device<arm7_cpu_device> m_maincpu; +}; + +void actions_atj2279b_state::atj2279b_map(address_map &map) +{ +} + +void actions_atj2279b_state::machine_start() +{ +} + +void actions_atj2279b_state::machine_reset() +{ +} + +static INPUT_PORTS_START( actions_atj2279b ) +INPUT_PORTS_END + + +uint32_t actions_atj2279b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void actions_atj2279b_state::actions_atj2279b(machine_config &config) +{ + ARM7_BE(config, m_maincpu, 100'000'000); // unknown ARM type in SoC (are there any documents?) probably much newer than this + m_maincpu->set_addrmap(AS_PROGRAM, &actions_atj2279b_state::atj2279b_map); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(640, 480); + screen.set_visarea(0, 640-1, 0, 480-1); + screen.set_screen_update(FUNC(actions_atj2279b_state::screen_update)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); +} + +ROM_START( rbitgen ) + ROM_REGION32_BE( 0x21000000, "nand", 0 ) // NAND dump + //TOSHIBA + // TC58NVG2S3?A00 (there is a yellow stripe on the label before A00 obscuring the text) + ROM_LOAD16_WORD_SWAP( "nand.bin", 0x000000, 0x21000000, CRC(92576add) SHA1(1fe61ef1d2dd24e5b5d48c477846ef0c83ec6568) ) +ROM_END + + +// year, name, parent, compat, machine, input, class, init, company, fullname, flags +CONS( 2016, rbitgen, 0, 0, actions_atj2279b, actions_atj2279b, actions_atj2279b_state, empty_init, "Retro-Bit", "Generations (Retro-Bit)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/adm11.cpp b/src/mame/drivers/adm11.cpp new file mode 100644 index 00000000000..98b87d21fd4 --- /dev/null +++ b/src/mame/drivers/adm11.cpp @@ -0,0 +1,196 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for ADM 11 and related terminals by Lear Siegler, Inc. + + * ADM 11 (June 1983): LSI's first terminal to use the "High Touch" + enclosure shared by the rest of its family and other LSI terminals. + Its detachable typewriter-style keyboard has only 4 function keys + (8 with shifting). Display is one 24x80 page plus a status line. + Font supports "business graphics" as well as ASCII characters. + * ADM 12 (March 1984): Expanded version of ADM 11 implementing block + mode and many more editing functions. 2 pages of text are available + in 80x24 mode, and there are also 80x48 and 158x24 modes. + * ADM 11G & ADM 12G (March 1984): ADM 11 and ADM 12 enhanced with + Tektronix Plot 10-like graphics. + * ADM 1178 (March 1984): Emulates the keyboard and communications of the + IBM 3278, though an external protocol converter is also required for + network compatibility. + * ADM 1278 (March 1984): Block mode version of the ADM 1178. + * ADM 12plus (February 1985): Later version of the ADM 12, with 132- + column and horizontal split display options. Up to 4 pages of display + memory are supported. + * ADM 11plus (June 1985): Later version of ADM 11 with more function + keys and character and line insertion/deletion. + +****************************************************************************/ + +#include "emu.h" +//#include "bus/rs232/rs232.h" +#include "cpu/mcs51/mcs51.h" +#include "machine/eeprompar.h" +#include "video/scn2674.h" +#include "screen.h" + +class adm11_state : public driver_device +{ +public: + adm11_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_avdc(*this, "avdc") + , m_charram(*this, "charram") + , m_attrram(*this, "attrram") + , m_chargen(*this, "chargen") + , m_mbc(false) + , m_latched_attr(0) + { + } + + void adm12(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + void prog_map(address_map &map); + void ext_map(address_map &map); + void char_map(address_map &map); + void attr_map(address_map &map); + + SCN2674_DRAW_CHARACTER_MEMBER(draw_character); + DECLARE_WRITE_LINE_MEMBER(mbc_w); + + u8 p1_r(); + void p1_w(u8 data); + void char_latched_attr_w(offs_t offset, u8 data); + void attr_latch_w(u8 data); + + required_device<mcs51_cpu_device> m_maincpu; + required_device<scn2674_device> m_avdc; + required_shared_ptr<u8> m_charram; + required_shared_ptr<u8> m_attrram; + required_region_ptr<u8> m_chargen; + + bool m_mbc; + u8 m_latched_attr; +}; + + +void adm11_state::machine_start() +{ + save_item(NAME(m_mbc)); +} + +SCN2674_DRAW_CHARACTER_MEMBER(adm11_state::draw_character) +{ + u16 dots = m_chargen[charcode << 4 | linecount]; + dots |= (dots & 0x80) << 1; + + if (BIT(attrcode, 2)) + dots ^= 0x1ff; + + for (int i = 0; i < 9; i++) + { + bitmap.pix32(y, x++) = BIT(dots, 8) ? rgb_t::white() : rgb_t::black(); + dots <<= 1; + } +} + +WRITE_LINE_MEMBER(adm11_state::mbc_w) +{ + m_mbc = state; +} + +u8 adm11_state::p1_r() +{ + // Bit 0 low = display busy? + return 0xfe | (m_mbc ? 0 : 1); +} + +void adm11_state::p1_w(u8 data) +{ +} + +void adm11_state::char_latched_attr_w(offs_t offset, u8 data) +{ + m_charram[offset] = data; + m_attrram[offset] = m_latched_attr; +} + +void adm11_state::attr_latch_w(u8 data) +{ + m_latched_attr = data; +} + +void adm11_state::prog_map(address_map &map) +{ + map(0x0000, 0x1fff).rom().region("program", 0); +} + +void adm11_state::ext_map(address_map &map) +{ + map(0x0000, 0x07ff).ram(); + map(0x2000, 0x21ff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)); + map(0x4000, 0x4fff).mirror(0x1000).ram().share("charram"); + map(0x6000, 0x6fff).mirror(0x1000).w(FUNC(adm11_state::char_latched_attr_w)); + map(0x8000, 0x8fff).mirror(0x1000).ram().share("attrram"); + map(0xa000, 0xa000).mirror(0x1fff).w(FUNC(adm11_state::attr_latch_w)); + map(0xe000, 0xe007).rw(m_avdc, FUNC(scn2674_device::read), FUNC(scn2674_device::write)); +} + +void adm11_state::char_map(address_map &map) +{ + map.global_mask(0x0fff); + map(0x0000, 0x0fff).ram().share("charram"); +} + +void adm11_state::attr_map(address_map &map) +{ + map.global_mask(0x0fff); + map(0x0000, 0x0fff).ram().share("attrram"); +} + + +static INPUT_PORTS_START(adm12) +INPUT_PORTS_END + +void adm11_state::adm12(machine_config &config) +{ + I8031(config, m_maincpu, 11.0592_MHz_XTAL); // P8031AH + m_maincpu->set_addrmap(AS_PROGRAM, &adm11_state::prog_map); + m_maincpu->set_addrmap(AS_IO, &adm11_state::ext_map); + m_maincpu->port_in_cb<1>().set(FUNC(adm11_state::p1_r)); + m_maincpu->port_out_cb<1>().set(FUNC(adm11_state::p1_w)); + // TODO: RXD/TXD are serial communications; INT0 is serial keyboard data + + EEPROM_2804(config, "eeprom"); // X2804AP + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_color(rgb_t::green()); + screen.set_raw(15.93_MHz_XTAL, 900, 0, 720, 295, 0, 275); // 17.7 kHz horizontal + screen.set_screen_update("avdc", FUNC(scn2674_device::screen_update)); + + SCN2674(config, m_avdc, 15.93_MHz_XTAL / 9); // SCN2674B + m_avdc->set_screen("screen"); + m_avdc->set_character_width(9); // 6 in 158-column mode? + m_avdc->set_addrmap(0, &adm11_state::char_map); + m_avdc->set_addrmap(1, &adm11_state::attr_map); + m_avdc->set_display_callback(FUNC(adm11_state::draw_character)); + m_avdc->intr_callback().set_inputline(m_maincpu, MCS51_INT1_LINE); + m_avdc->mbc_callback().set(FUNC(adm11_state::mbc_w)); +} + +// "MEM2764" silkscreened next to all memories, only one of which is an actual 2764 (most are SY2128-4 SRAMs) +ROM_START(adm12) + ROM_REGION(0x2000, "program", 0) + ROM_LOAD("u13.bin", 0x0000, 0x2000, CRC(3c928176) SHA1(dd741c620da2ced9979456296c2af0387461cdf1)) // MBM2764-30 + + // Keyboard MCU might be a COP420, as with the ADM 11 + + ROM_REGION(0x1000, "chargen", 0) + ROM_LOAD("u35.bin", 0x0000, 0x1000, CRC(66d7bc44) SHA1(cd839839f29657207098d85900cb570285be91a6)) // HN462732-P +ROM_END + +COMP(1984, adm12, 0, 0, adm12, adm12, adm11_state, empty_init, "Lear Siegler", "ADM 12 Video Display Terminal", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp index 40379901a65..0c1ee42e98e 100644 --- a/src/mame/drivers/aerofgt.cpp +++ b/src/mame/drivers/aerofgt.cpp @@ -69,6 +69,7 @@ Verification still needed for the other PCBs. #include "machine/vs9209.h" #include "sound/2610intf.h" #include "sound/3812intf.h" +#include "sound/ym2151.h" #include "video/vsystem_gga.h" #include "screen.h" #include "speaker.h" @@ -202,7 +203,7 @@ void aerofgt_state::spikes91_map(address_map &map) map(0xfff002, 0xfff003).portr("IN1"); map(0xfff003, 0xfff003).w(FUNC(aerofgt_state::pspikes_gfxbank_w)); map(0xfff004, 0xfff005).portr("DSW").w(FUNC(aerofgt_state::scrolly_w<0>)); - map(0xfff006, 0xfff007).noprw(); + map(0xfff007, 0xfff007).r(FUNC(aerofgt_state::pending_command_r)).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask16(0x00ff); map(0xfff008, 0xfff009).w(FUNC(aerofgt_state::spikes91_lookup_w)); } @@ -546,6 +547,15 @@ void aerofgt_state::kickball_sound_portmap(address_map &map) map(0xc0, 0xc0).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w)); } +void aerofgt_state::spikes91_sound_map(address_map &map) +{ + map(0x0000, 0xdfff).rom(); + map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xe800, 0xe800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + //map(0xf000, 0xf000) // OKI M5205? + //map(0xf400, 0xf400) // OKI M5205? + map(0xf800, 0xffff).ram(); +} void aerofgt_state::oki_map(address_map &map) { //only for aerfboot for now @@ -1520,11 +1530,15 @@ void aerofgt_state::spikes91(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &aerofgt_state::spikes91_map); m_maincpu->set_vblank_int("screen", FUNC(aerofgt_state::irq1_line_hold)); /* all irq vectors are the same */ - /* + Z80 for sound */ + Z80(config, m_audiocpu, 24000000/8); // ? + m_audiocpu->set_addrmap(AS_PROGRAM, &aerofgt_state::spikes91_sound_map); MCFG_MACHINE_START_OVERRIDE(aerofgt_state,common) MCFG_MACHINE_RESET_OVERRIDE(aerofgt_state,common) + GENERIC_LATCH_8(config, m_soundlatch); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); + /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); @@ -1541,12 +1555,12 @@ void aerofgt_state::spikes91(machine_config &config) MCFG_VIDEO_START_OVERRIDE(aerofgt_state,pspikes) - /* sound hardware */ - /* the sound hardware is completely different on this: - 1x YM2151 (sound)(ic150) - 1x OKI M5205 (sound)(ic145) - 2x LM324N (sound)(ic152, ic153) - */ + SPEAKER(config, "mono").front_center(); + + ym2151_device &ymsnd(YM2151(config, "ymsnd", 24000000/8)); + ymsnd.add_route(ALL_OUTPUTS, "mono", 0.50); + + // TODO: OKI M5205 } void aerofgt_state::pspikesb(machine_config &config) @@ -2374,9 +2388,9 @@ ROM_START( spikes91 ) ROM_LOAD16_BYTE( "10.ic104", 0x00000, 0x10000, CRC(769ade77) SHA1(9cb581d02592c69f37d4b5a902d3515f40915ec4) ) ROM_LOAD16_BYTE( "9.ic103", 0x00001, 0x10000, CRC(201cb748) SHA1(f78d384e4e9c5996a278f76fb4d5f28812a27de5) ) - ROM_REGION( 0x20000, "cpu1", 0 ) /* Z80 Sound CPU + M5205 Samples */ - ROM_LOAD( "1.ic140", 0x00000, 0x10000, CRC(e3065b1d) SHA1(c4a3a95ba7f43cdf1b0c574f41de06d007ad2bd8) ) - ROM_LOAD( "2.ic141", 0x10000, 0x10000, CRC(5dd8bf22) SHA1(d1a12894fe8ca47e47b4a1e911cabf20dd41eda4) ) + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Sound CPU + M5205 Samples */ + ROM_LOAD( "1.ic140", 0x00000, 0x10000, CRC(e3065b1d) SHA1(c4a3a95ba7f43cdf1b0c574f41de06d007ad2bd8) ) // matches svolleybl in rpunch.cpp + ROM_LOAD( "2.ic141", 0x10000, 0x10000, CRC(5dd8bf22) SHA1(d1a12894fe8ca47e47b4a1e911cabf20dd41eda4) ) // 1ST AND 2ND HALF IDENTICAL, matches svolleybl in rpunch.cpp when halved ROM_REGION( 0x1000, "user2", 0 ) /* ? */ ROM_LOAD( "ep910pc.ic7", 0x00000, 0x884, CRC(e7a3913a) SHA1(6f18f55ecdc94a416baecd16fe7c6698b1ec9d87) ) @@ -2403,9 +2417,9 @@ ROM_START( spikes91b ) // todo, check how this differs, only 1 of the 68k pair a ROM_LOAD16_BYTE( "10.ic104", 0x00000, 0x8000, CRC(b6fe4e57) SHA1(6b62936ff9d0f39fd02c3db488d53bc035c2272d) ) // sldh ROM_LOAD16_BYTE( "9.ic103", 0x00001, 0x8000, CRC(5479ed35) SHA1(ca26289318352901841fcdf26d9b43e797ac39b6) ) // sldh - ROM_REGION( 0x20000, "cpu1", 0 ) /* Z80 Sound CPU + M5205 Samples */ - ROM_LOAD( "1.ic140", 0x00000, 0x10000, CRC(e3065b1d) SHA1(c4a3a95ba7f43cdf1b0c574f41de06d007ad2bd8) ) - ROM_LOAD( "2.ic141", 0x10000, 0x10000, CRC(5dd8bf22) SHA1(d1a12894fe8ca47e47b4a1e911cabf20dd41eda4) ) + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Sound CPU + M5205 Samples */ + ROM_LOAD( "1.ic140", 0x00000, 0x10000, CRC(e3065b1d) SHA1(c4a3a95ba7f43cdf1b0c574f41de06d007ad2bd8) ) // matches svolleybl in rpunch.cpp + ROM_LOAD( "2.ic141", 0x10000, 0x10000, CRC(5dd8bf22) SHA1(d1a12894fe8ca47e47b4a1e911cabf20dd41eda4) ) // 1ST AND 2ND HALF IDENTICAL, matches svolleybl in rpunch.cpp when halved ROM_REGION( 0x1000, "user2", 0 ) /* ? */ ROM_LOAD( "ep910pc.ic7", 0x00000, 0x884, CRC(e7a3913a) SHA1(6f18f55ecdc94a416baecd16fe7c6698b1ec9d87) ) @@ -3159,8 +3173,8 @@ GAME( 1991, pspikesu, pspikes, pspikes, pspikes, aerofgt_state, empty_in GAME( 1991, svolly91, pspikes, pspikes, pspikes, aerofgt_state, empty_init, ROT0, "Video System Co.", "Super Volley '91 (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) GAME( 1991, pspikesb, pspikes, pspikesb, pspikesb, aerofgt_state, empty_init, ROT0, "bootleg", "Power Spikes (bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) GAME( 1991, pspikesba, pspikes, pspikesb, pspikesb, aerofgt_state, empty_init, ROT0, "bootleg (Playmark?)", "Power Spikes (Italian bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) -GAME( 1991, spikes91, pspikes, spikes91, pspikes, aerofgt_state, empty_init, ROT0, "bootleg", "1991 Spikes (Italian bootleg, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL ) -GAME( 1991, spikes91b, pspikes, spikes91, pspikes, aerofgt_state, empty_init, ROT0, "bootleg", "1991 Spikes (Italian bootleg, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL ) +GAME( 1991, spikes91, pspikes, spikes91, pspikes, aerofgt_state, empty_init, ROT0, "bootleg", "1991 Spikes (Italian bootleg, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NO_COCKTAIL ) // OKI M5205 not hooked up yet +GAME( 1991, spikes91b, pspikes, spikes91, pspikes, aerofgt_state, empty_init, ROT0, "bootleg", "1991 Spikes (Italian bootleg, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NO_COCKTAIL ) // OKI M5205 not hooked up yet GAME( 1991, pspikesc, pspikes, pspikesc, pspikesc, aerofgt_state, empty_init, ROT0, "bootleg", "Power Spikes (China)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND ) GAME( 1997, wbbc97, 0, wbbc97, wbbc97, aerofgt_state, empty_init, ROT0, "Comad", "Beach Festival World Championship 1997", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // based on power spikes codebase GAME( 1998, kickball, 0, kickball, pspikes, aerofgt_state, init_kickball, ROT0, "Seoung Youn", "Kick Ball", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) // based on power spikes codebase, wrong priorities diff --git a/src/mame/drivers/aid80f.cpp b/src/mame/drivers/aid80f.cpp new file mode 100644 index 00000000000..874eecfc044 --- /dev/null +++ b/src/mame/drivers/aid80f.cpp @@ -0,0 +1,142 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + AID-80F was Mostek's development system for the Z80 and 3870 families. + It was later advertised as the development system for the MATRIX-80 + (MDX) STD bus microcomputer. + + Boards available for this modular system included: + * SDB-80E/OEM-80E CPU Module + * FLP-80E Floppy Controller + * CRT-80E Video Terminal Controller + * PPG-8/16 2708/2758/2716 PROM Programmer + * AIM-80 Z80 Application Interface Module + — later replaced by AIM-Z80AE (4 MHz) and AIM-Z80BE (6 MHz) + * AIM-72 3870 Application Interface Module + — later replaced by AIM-7XE + +****************************************************************************/ + +#include "emu.h" +#include "cpu/z80/z80.h" +#include "machine/ram.h" +#include "machine/wd_fdc.h" +#include "machine/z80ctc.h" +#include "machine/z80pio.h" +#include "machine/z80sio.h" + +class aid80f_state : public driver_device +{ +public: + aid80f_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ram(*this, RAM_TAG) + , m_monitor(*this, "monitor") + { + } + + void aid80f(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + u8 ram_r(offs_t offset); + void ram_w(offs_t offset, u8 data); + u8 monitor_r(offs_t offset); + + void mem_map(address_map &map); + void io_map(address_map &map); + + required_device<z80_device> m_maincpu; + required_device<ram_device> m_ram; + required_region_ptr<u8> m_monitor; + + bool m_ram_enabled; +}; + +void aid80f_state::machine_start() +{ + save_item(NAME(m_ram_enabled)); +} + +void aid80f_state::machine_reset() +{ + m_ram_enabled = false; +} + +u8 aid80f_state::ram_r(offs_t offset) +{ + if (m_ram_enabled) + return m_ram->read(offset); + else + return m_monitor[offset & 0xfff]; +} + +void aid80f_state::ram_w(offs_t offset, u8 data) +{ + if (m_ram_enabled) + m_ram->write(offset, data); +} + +u8 aid80f_state::monitor_r(offs_t offset) +{ + if (!machine().side_effects_disabled()) + m_ram_enabled = true; + return m_monitor[offset]; +} + +void aid80f_state::mem_map(address_map &map) +{ + map(0x0000, 0xffff).rw(FUNC(aid80f_state::ram_r), FUNC(aid80f_state::ram_w)); + map(0xe000, 0xefff).r(FUNC(aid80f_state::monitor_r)); +} + +void aid80f_state::io_map(address_map &map) +{ + map.global_mask(0xff); + map(0xd8, 0xdb).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); + map(0xdc, 0xdf).rw("pio", FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); + map(0xe4, 0xe7).rw("fdc", FUNC(fd1771_device::read), FUNC(fd1771_device::write)); +} + +static INPUT_PORTS_START(aid80f) +INPUT_PORTS_END + +static const z80_daisy_config daisy_chain[] = +{ + { "ctc" }, + { "pio" }, + { "sio" }, + { nullptr } +}; + +void aid80f_state::aid80f(machine_config &config) +{ + Z80(config, m_maincpu, 4.9152_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &aid80f_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &aid80f_state::io_map); + m_maincpu->set_daisy_config(daisy_chain); + + RAM(config, m_ram).set_default_size("64K"); + + Z80CTC(config, "ctc", 4.9152_MHz_XTAL / 2); + Z80PIO(config, "pio", 4.9152_MHz_XTAL / 2); + Z80SIO(config, "sio", 4.9152_MHz_XTAL / 2); + + FD1771(config, "fdc", 4_MHz_XTAL / 4); +} + +ROM_START(aid80f) + ROM_REGION(0x1000, "monitor", 0) + ROM_LOAD("ddt1.u48", 0x0000, 0x0400, CRC(c9e5dc59) SHA1(3143bca7472900e7255ec0e39ca4121d1cb74c5f)) + ROM_LOAD("ddt2.u49", 0x0400, 0x0400, CRC(dd37f628) SHA1(6da130a3678fd84070dd4ae3487c5212db5604ef)) + ROM_LOAD("ddt3.u50", 0x0800, 0x0400, CRC(646d5fd2) SHA1(b9d0a4b3658835c5d724d709ca3cd70d69474caa)) + ROM_LOAD("ddt4.u51", 0x0c00, 0x0400, CRC(c78e34c2) SHA1(5f3a4631d0b806a077b817f566ebbddd77ad7ba5)) + // U52 socket is empty +ROM_END + +COMP(1978, aid80f, 0, 0, aid80f, aid80f, aid80f_state, empty_init, "Mostek", "AID-80F Development System", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp index 96a37710280..7114e815d52 100644 --- a/src/mame/drivers/alpha68k.cpp +++ b/src/mame/drivers/alpha68k.cpp @@ -33,6 +33,11 @@ TODO: - Sky Adventure, probably others: sprite drawing is off-sync, cfr. notes in video file; - Gold Medalist: attract mode has missing finger on button 1, may be btanb; - Gold Medalist: incorrect blank effect on shooting pistol for dash events (cfr. alpha68k_palette_device); +- Gold Medalist: dash events timers relies on MCU irq timings. + Previous emulation of 180 Hz was making it way too hard, and the timer was updating at 0.03 secs (-> 30 Hz refresh rate). + Using a timer of 100 Hz seems a better approximation compared to a stopwatch, of course fine tuning + this approximation needs HW probing and/or a MCU decap. +- Gold Medalist: MCU irq routine has an event driven path that is never taken into account, what is it for? - Super Champion Baseball: enables opacity bit on fix layer, those are transparent on SNK Arcade Classics 0 but actually opaque on a reference shot, sounds like a btanb; - Fix layer tilemap should be a common device between this, snk68.cpp and other Alpha/SNK-based games; @@ -327,7 +332,11 @@ u16 alpha68k_II_state::alpha_II_trigger_r(offs_t offset) else { if (m_microcontroller_id == 0x8803) /* Gold Medalist */ - m_microcontroller_data = 0x21; // timer + { + // TODO: dash events increments timer at 0x16c0 in irq routine (event driven?) + // There's also another unemulated event path if this is 0x5b, unknown purpose + m_microcontroller_data = 0x21; + } else m_microcontroller_data = 0x00; m_shared_ram[0x29] = (source & 0xff00) | m_microcontroller_data; @@ -1310,6 +1319,7 @@ void alpha68k_II_state::btlfieldb(machine_config &config) { alpha68k_II(config); m_maincpu->set_vblank_int("screen", FUNC(alpha68k_II_state::irq1_line_hold)); + // TODO: timing m_maincpu->set_periodic_int(FUNC(alpha68k_II_state::irq2_line_hold), attotime::from_hz(60*4)); // MCU irq } @@ -1317,7 +1327,8 @@ void goldmedal_II_state::goldmedal(machine_config &config) { alpha68k_II(config); m_maincpu->set_vblank_int("screen", FUNC(goldmedal_II_state::irq1_line_hold)); - m_maincpu->set_periodic_int(FUNC(goldmedal_II_state::irq2_line_hold), attotime::from_hz(60*3)); // MCU irq + // TODO: dash events relies on MCU irq timings + m_maincpu->set_periodic_int(FUNC(goldmedal_II_state::irq2_line_hold), attotime::from_hz(100)); // MCU irq } void alpha68k_III_state::alpha68k_III(machine_config &config) @@ -1344,7 +1355,8 @@ void alpha68k_III_state::alpha68k_III(machine_config &config) void goldmedal_III_state::goldmedal(machine_config &config) { alpha68k_III_state::alpha68k_III(config); - m_maincpu->set_periodic_int(FUNC(goldmedal_III_state::irq2_line_hold), attotime::from_hz(60*3)); // MCU irq + // TODO: dash events relies on MCU irq timings + m_maincpu->set_periodic_int(FUNC(goldmedal_III_state::irq2_line_hold), attotime::from_hz(100)); // MCU irq } void alpha68k_V_state::alpha68k_V(machine_config &config) @@ -2136,11 +2148,11 @@ GAME( 1988, skysoldr, 0, alpha68k_II, skysoldr, alpha68k_II_state, i GAME( 1988, skysoldrbl,skysoldr, alpha68k_II, skysoldr, alpha68k_II_state, init_skysoldr, ROT90, "bootleg", "Sky Soldiers (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, goldmedl, 0, goldmedal, goldmedl, goldmedal_II_state, init_goldmedl, ROT0, "SNK", "Gold Medalist (set 1, Alpha68k II PCB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, goldmedl, 0, goldmedal, goldmedl, goldmedal_II_state, init_goldmedl, ROT0, "SNK", "Gold Medalist (set 1, Alpha68k II PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Alpha III HW -GAME( 1988, goldmedla, goldmedl, goldmedal, goldmedl, goldmedal_III_state, init_goldmedla, ROT0, "SNK", "Gold Medalist (set 2, Alpha68k III PCB)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, goldmedlb, goldmedl, goldmedal, goldmedl, goldmedal_III_state, init_goldmedla, ROT0, "bootleg", "Gold Medalist (bootleg, Alpha68k III PCB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, goldmedla, goldmedl, goldmedal, goldmedl, goldmedal_III_state, init_goldmedla, ROT0, "SNK", "Gold Medalist (set 2, Alpha68k III PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) +GAME( 1988, goldmedlb, goldmedl, goldmedal, goldmedl, goldmedal_III_state, init_goldmedla, ROT0, "bootleg", "Gold Medalist (bootleg, Alpha68k III PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Alpha V HW GAME( 1989, skyadvnt, 0, skyadventure, skyadvnt, skyadventure_state, init_skyadvnt, ROT90, "Alpha Denshi Co.", "Sky Adventure (World)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp index 6f1f0302514..dcceb8eb6ba 100644 --- a/src/mame/drivers/apollo.cpp +++ b/src/mame/drivers/apollo.cpp @@ -967,7 +967,7 @@ void apollo_state::init_dn3500() // MLOG1(("driver_init_dn3500")); /* hook the RESET line, which resets a slew of other components */ - m_maincpu->set_reset_callback(FUNC(apollo_state::apollo_reset_instr_callback)); + m_maincpu->set_reset_callback(*this, FUNC(apollo_state::apollo_reset_instr_callback)); ram_base_address = DN3500_RAM_BASE; ram_end_address = DN3500_RAM_END; diff --git a/src/mame/drivers/armedf.cpp b/src/mame/drivers/armedf.cpp index 92926c1cb33..1752e49f5f8 100644 --- a/src/mame/drivers/armedf.cpp +++ b/src/mame/drivers/armedf.cpp @@ -346,11 +346,10 @@ Notes: ---- ---- ---- --x- coin counter 1 ---- ---- ---- ---x coin counter 0 */ -WRITE16_MEMBER(armedf_state::terraf_io_w) +void armedf_state::terraf_io_w(offs_t offset, u16 data, u16 mem_mask) { - if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition - m_nb1414m4->exec((m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram.get(),m_fg_scrollx,m_fg_scrolly,m_tx_tilemap); - + if (data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition + m_nb1414m4->exec((m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram.target(),m_fg_scrollx,m_fg_scrolly,m_tx_tilemap); COMBINE_DATA(&m_vreg); @@ -360,9 +359,9 @@ WRITE16_MEMBER(armedf_state::terraf_io_w) flip_screen_set(m_vreg & 0x1000); } -WRITE16_MEMBER(armedf_state::terrafjb_io_w) +void armedf_state::terrafjb_io_w(offs_t offset, u16 data, u16 mem_mask) { - if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition + if (data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition m_extra->set_input_line(0, HOLD_LINE); COMBINE_DATA(&m_vreg); @@ -373,13 +372,9 @@ WRITE16_MEMBER(armedf_state::terrafjb_io_w) flip_screen_set(m_vreg & 0x1000); } -WRITE16_MEMBER(armedf_state::bootleg_io_w) +void armedf_state::armedf_io_w(offs_t offset, u16 data, u16 mem_mask) { - if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition - { - // NOP - } - + // no NB1414M4 present COMBINE_DATA(&m_vreg); machine().bookkeeping().coin_counter_w(0, (data & 1) >> 0); @@ -388,26 +383,26 @@ WRITE16_MEMBER(armedf_state::bootleg_io_w) flip_screen_set(m_vreg & 0x1000); } -WRITE16_MEMBER(armedf_state::sound_command_w) +void armedf_state::sound_command_w(u8 data) { - if (ACCESSING_BITS_0_7) - m_soundlatch->write(((data & 0x7f) << 1) | 1); + m_soundlatch->write(((data & 0x7f) << 1) | 1); } -READ8_MEMBER(armedf_state::soundlatch_clear_r) +u8 armedf_state::soundlatch_clear_r() { - m_soundlatch->clear_w(); + if (!machine().side_effects_disabled()) + m_soundlatch->clear_w(); return 0; } -WRITE16_MEMBER(armedf_state::irq_lv1_ack_w) +void armedf_state::irq_lv1_ack_w(u16 data) { if (m_nb1414m4 != nullptr) m_nb1414m4->vblank_trigger(); m_maincpu->set_input_line(1, CLEAR_LINE); } -WRITE16_MEMBER(armedf_state::irq_lv2_ack_w) +void armedf_state::irq_lv2_ack_w(u16 data) { if (m_nb1414m4 != nullptr) m_nb1414m4->vblank_trigger(); @@ -415,7 +410,6 @@ WRITE16_MEMBER(armedf_state::irq_lv2_ack_w) } - /************************************* * * Address maps @@ -426,36 +420,57 @@ void armedf_state::common_map(address_map &map) { map(0x000000, 0x05ffff).rom(); map(0x064000, 0x064fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x068000, 0x069fff).rw(FUNC(armedf_state::nb1414m4_text_videoram_r), FUNC(armedf_state::nb1414m4_text_videoram_w)).umask16(0x00ff); + map(0x068000, 0x069fff).rw(FUNC(armedf_state::text_videoram_r), FUNC(armedf_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); map(0x06a000, 0x06a9ff).ram(); map(0x06c000, 0x06cfff).ram().share("spr_pal_clut"); - map(0x070000, 0x070fff).ram().w(FUNC(armedf_state::armedf_fg_videoram_w)).share("fg_videoram"); - map(0x074000, 0x074fff).ram().w(FUNC(armedf_state::armedf_bg_videoram_w)).share("bg_videoram"); + map(0x070000, 0x070fff).ram().w(FUNC(armedf_state::fg_videoram_w)).share("fg_videoram"); + map(0x074000, 0x074fff).ram().w(FUNC(armedf_state::bg_videoram_w)).share("bg_videoram"); map(0x078000, 0x078001).portr("P1"); map(0x078002, 0x078003).portr("P2"); map(0x078004, 0x078005).portr("DSW1"); map(0x078006, 0x078007).portr("DSW2"); // map(0x07c000, 0x07c001).w(FUNC(armedf_state::terraf_io_w)); handled in DRIVER_INIT - map(0x07c002, 0x07c003).w(FUNC(armedf_state::armedf_bg_scrollx_w)); - map(0x07c004, 0x07c005).w(FUNC(armedf_state::armedf_bg_scrolly_w)); - map(0x07c00a, 0x07c00b).w(FUNC(armedf_state::sound_command_w)); + map(0x07c002, 0x07c003).w(FUNC(armedf_state::bg_scrollx_w)); + map(0x07c004, 0x07c005).w(FUNC(armedf_state::bg_scrolly_w)); + map(0x07c00b, 0x07c00b).w(FUNC(armedf_state::sound_command_w)); map(0x07c00c, 0x07c00d).nopw(); /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ map(0x07c00e, 0x07c00f).w(FUNC(armedf_state::irq_lv1_ack_w)); } -void armedf_state::terraf_map(address_map &map) +void armedf_state::terraf_common_map(address_map &map) { common_map(map); map(0x060000, 0x0603ff).ram().share("spriteram"); map(0x060400, 0x063fff).ram(); } +void armedf_state::terraf_map(address_map &map) +{ + terraf_common_map(map); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::terraf_io_w)); +} + +void armedf_state::terrafb_map(address_map &map) +{ + terraf_common_map(map); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::armedf_io_w)); + map(0x07c006, 0x07c006).w(FUNC(armedf_state::terrafb_fg_scrolly_w)); + map(0x07c008, 0x07c008).w(FUNC(armedf_state::terrafb_fg_scrollx_w)); + map(0x0c0000, 0x0c0000).w(FUNC(armedf_state::terrafb_fg_scroll_msb_arm_w)); +} + +void armedf_state::terrafjb_map(address_map &map) +{ + terraf_common_map(map); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::terrafjb_io_w)); +} + void armedf_state::kozure_map(address_map &map) { common_map(map); map(0x060000, 0x060fff).ram().share("spriteram"); map(0x061000, 0x063fff).ram(); -// map(0x07c000, 0x07c001).w(FUNC(armedf_state::kozure_io_w)); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::terraf_io_w)); // map(0x0c0000, 0x0c0001).nopw(); /* watchdog? */ // map(0xffd000, 0xffd001).nopw(); /* passes crc ROM information to MCU, I guess */ } @@ -466,19 +481,19 @@ void armedf_state::cclimbr2_map(address_map &map) map(0x060000, 0x060fff).ram().share("spriteram"); map(0x061000, 0x063fff).ram(); map(0x064000, 0x064fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x068000, 0x069fff).rw(FUNC(armedf_state::nb1414m4_text_videoram_r), FUNC(armedf_state::nb1414m4_text_videoram_w)).umask16(0x00ff); + map(0x068000, 0x069fff).rw(FUNC(armedf_state::text_videoram_r), FUNC(armedf_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); map(0x06a000, 0x06a9ff).ram(); map(0x06c000, 0x06cfff).ram().share("spr_pal_clut"); - map(0x070000, 0x070fff).ram().w(FUNC(armedf_state::armedf_fg_videoram_w)).share("fg_videoram"); - map(0x074000, 0x074fff).ram().w(FUNC(armedf_state::armedf_bg_videoram_w)).share("bg_videoram"); + map(0x070000, 0x070fff).ram().w(FUNC(armedf_state::fg_videoram_w)).share("fg_videoram"); + map(0x074000, 0x074fff).ram().w(FUNC(armedf_state::bg_videoram_w)).share("bg_videoram"); map(0x078000, 0x078001).portr("P1"); map(0x078002, 0x078003).portr("P2"); map(0x078004, 0x078005).portr("DSW1"); map(0x078006, 0x078007).portr("DSW2"); -// map(0x07c000, 0x07c001).w(FUNC(armedf_state::io_w)); - map(0x07c002, 0x07c003).w(FUNC(armedf_state::armedf_bg_scrollx_w)); - map(0x07c004, 0x07c005).w(FUNC(armedf_state::armedf_bg_scrolly_w)); - map(0x07c00a, 0x07c00b).w(FUNC(armedf_state::sound_command_w)); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::terraf_io_w)); + map(0x07c002, 0x07c003).w(FUNC(armedf_state::bg_scrollx_w)); + map(0x07c004, 0x07c005).w(FUNC(armedf_state::bg_scrolly_w)); + map(0x07c00b, 0x07c00b).w(FUNC(armedf_state::sound_command_w)); map(0x07c00c, 0x07c00d).nopw(); /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ map(0x07c00e, 0x07c00f).w(FUNC(armedf_state::irq_lv2_ack_w)); } @@ -491,15 +506,15 @@ void armedf_state::legion_common_map(address_map &map) map(0x064000, 0x064fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x06a000, 0x06a9ff).ram(); map(0x06c000, 0x06cfff).ram().share("spr_pal_clut"); - map(0x070000, 0x070fff).ram().w(FUNC(armedf_state::armedf_fg_videoram_w)).share("fg_videoram"); - map(0x074000, 0x074fff).ram().w(FUNC(armedf_state::armedf_bg_videoram_w)).share("bg_videoram"); + map(0x070000, 0x070fff).ram().w(FUNC(armedf_state::fg_videoram_w)).share("fg_videoram"); + map(0x074000, 0x074fff).ram().w(FUNC(armedf_state::bg_videoram_w)).share("bg_videoram"); map(0x078000, 0x078001).portr("P1"); map(0x078002, 0x078003).portr("P2"); map(0x078004, 0x078005).portr("DSW1"); map(0x078006, 0x078007).portr("DSW2"); - map(0x07c002, 0x07c003).w(FUNC(armedf_state::armedf_bg_scrollx_w)); - map(0x07c004, 0x07c005).w(FUNC(armedf_state::armedf_bg_scrolly_w)); - map(0x07c00a, 0x07c00b).w(FUNC(armedf_state::sound_command_w)); + map(0x07c002, 0x07c003).w(FUNC(armedf_state::bg_scrollx_w)); + map(0x07c004, 0x07c005).w(FUNC(armedf_state::bg_scrolly_w)); + map(0x07c00b, 0x07c00b).w(FUNC(armedf_state::sound_command_w)); map(0x07c00c, 0x07c00d).nopw(); /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ map(0x07c00e, 0x07c00f).w(FUNC(armedf_state::irq_lv2_ack_w)); } @@ -508,13 +523,13 @@ void armedf_state::legion_map(address_map &map) { legion_common_map(map); - map(0x068000, 0x069fff).rw(FUNC(armedf_state::nb1414m4_text_videoram_r), FUNC(armedf_state::nb1414m4_text_videoram_w)).umask16(0x00ff); + map(0x068000, 0x069fff).rw(FUNC(armedf_state::text_videoram_r), FUNC(armedf_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); map(0x07c000, 0x07c001).w(FUNC(armedf_state::terraf_io_w)); } -WRITE8_MEMBER(armedf_state::legionjb_fg_scroll_w) +void armedf_state::legionjb_fg_scroll_w(offs_t offset, u8 data) { - if(offset >= 0xb && offset < 0xf) + if (offset >= 0xb && offset < 0xf) m_legion_cmd[offset-0xb] = data & 0xff; m_fg_scrollx = (m_legion_cmd[0x02] & 0xff) | ((m_legion_cmd[0x03] & 0x3) << 8); @@ -526,8 +541,8 @@ void armedf_state::legionjb_map(address_map &map) legion_common_map(map); map(0x040000, 0x04003f).w(FUNC(armedf_state::legionjb_fg_scroll_w)).umask16(0x00ff); - map(0x068000, 0x069fff).rw(FUNC(armedf_state::armedf_text_videoram_r), FUNC(armedf_state::armedf_text_videoram_w)).umask16(0x00ff); - map(0x07c000, 0x07c001).w(FUNC(armedf_state::bootleg_io_w)); + map(0x068000, 0x069fff).rw(FUNC(armedf_state::text_videoram_r), FUNC(armedf_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::armedf_io_w)); } void armedf_state::legionjb2_map(address_map &map) @@ -535,8 +550,8 @@ void armedf_state::legionjb2_map(address_map &map) legion_common_map(map); map(0x000000, 0x00003f).w(FUNC(armedf_state::legionjb_fg_scroll_w)).umask16(0x00ff); - map(0x068000, 0x069fff).rw(FUNC(armedf_state::armedf_text_videoram_r), FUNC(armedf_state::armedf_text_videoram_w)).umask16(0x00ff); - map(0x07c000, 0x07c001).w(FUNC(armedf_state::bootleg_io_w)); + map(0x068000, 0x069fff).rw(FUNC(armedf_state::text_videoram_r), FUNC(armedf_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); + map(0x07c000, 0x07c001).w(FUNC(armedf_state::armedf_io_w)); //also writes to 7c0010 / 70c020 / 70c030. These could possibly be the scroll registers on this bootleg and the writes to 000000 - 00003f could just be leftovers. } @@ -545,9 +560,9 @@ void armedf_state::armedf_map(address_map &map) map(0x000000, 0x05ffff).rom(); map(0x060000, 0x060fff).ram().share("spriteram"); map(0x061000, 0x065fff).ram(); - map(0x066000, 0x066fff).ram().w(FUNC(armedf_state::armedf_bg_videoram_w)).share("bg_videoram"); - map(0x067000, 0x067fff).ram().w(FUNC(armedf_state::armedf_fg_videoram_w)).share("fg_videoram"); - map(0x068000, 0x069fff).rw(FUNC(armedf_state::armedf_text_videoram_r), FUNC(armedf_state::armedf_text_videoram_w)).umask16(0x00ff); + map(0x066000, 0x066fff).ram().w(FUNC(armedf_state::bg_videoram_w)).share("bg_videoram"); + map(0x067000, 0x067fff).ram().w(FUNC(armedf_state::fg_videoram_w)).share("fg_videoram"); + map(0x068000, 0x069fff).rw(FUNC(armedf_state::text_videoram_r), FUNC(armedf_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); map(0x06a000, 0x06afff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x06b000, 0x06bfff).ram().share("spr_pal_clut"); map(0x06c000, 0x06c7ff).ram(); @@ -555,33 +570,34 @@ void armedf_state::armedf_map(address_map &map) map(0x06c002, 0x06c003).portr("P2"); map(0x06c004, 0x06c005).portr("DSW1"); map(0x06c006, 0x06c007).portr("DSW2"); - map(0x06d000, 0x06d001).w(FUNC(armedf_state::terraf_io_w)); - map(0x06d002, 0x06d003).w(FUNC(armedf_state::armedf_bg_scrollx_w)); - map(0x06d004, 0x06d005).w(FUNC(armedf_state::armedf_bg_scrolly_w)); - map(0x06d006, 0x06d007).w(FUNC(armedf_state::armedf_fg_scrollx_w)); - map(0x06d008, 0x06d009).w(FUNC(armedf_state::armedf_fg_scrolly_w)); - map(0x06d00a, 0x06d00b).w(FUNC(armedf_state::sound_command_w)); + map(0x06d000, 0x06d001).w(FUNC(armedf_state::armedf_io_w)); + map(0x06d002, 0x06d003).w(FUNC(armedf_state::bg_scrollx_w)); + map(0x06d004, 0x06d005).w(FUNC(armedf_state::bg_scrolly_w)); + map(0x06d006, 0x06d007).w(FUNC(armedf_state::fg_scrollx_w)); + map(0x06d008, 0x06d009).w(FUNC(armedf_state::fg_scrolly_w)); + map(0x06d00b, 0x06d00b).w(FUNC(armedf_state::sound_command_w)); map(0x06d00c, 0x06d00d).nopw(); //watchdog? map(0x06d00e, 0x06d00f).w(FUNC(armedf_state::irq_lv1_ack_w)); } -READ16_MEMBER(bigfghtr_state::latch_r) +u16 bigfghtr_state::latch_r() { - m_mcu->set_input_line(MCS51_INT0_LINE, HOLD_LINE); + if (!machine().side_effects_disabled()) + m_mcu->set_input_line(MCS51_INT0_LINE, HOLD_LINE); return 0; } -READ8_MEMBER(bigfghtr_state::main_sharedram_r) +u8 bigfghtr_state::main_sharedram_r(offs_t offset) { return m_sharedram[offset]; } -WRITE8_MEMBER(bigfghtr_state::main_sharedram_w) +void bigfghtr_state::main_sharedram_w(offs_t offset, u8 data) { m_sharedram[offset] = data; } -WRITE8_MEMBER(bigfghtr_state::mcu_spritelist_w) +void bigfghtr_state::mcu_spritelist_w(offs_t offset, u8 data) { // add a warning in case it happens for now. popmessage("MCU access spritelist %04x = %02x, contact MAMEdev",offset,data); @@ -593,21 +609,21 @@ void bigfghtr_state::bigfghtr_map(address_map &map) map(0x080000, 0x0805ff).ram().share("spriteram"); map(0x080600, 0x083fff).rw(FUNC(bigfghtr_state::main_sharedram_r), FUNC(bigfghtr_state::main_sharedram_w)); map(0x084000, 0x085fff).ram(); //work ram - map(0x086000, 0x086fff).ram().w(FUNC(bigfghtr_state::armedf_bg_videoram_w)).share("bg_videoram"); - map(0x087000, 0x087fff).ram().w(FUNC(bigfghtr_state::armedf_fg_videoram_w)).share("fg_videoram"); - map(0x088000, 0x089fff).rw(FUNC(bigfghtr_state::armedf_text_videoram_r), FUNC(bigfghtr_state::armedf_text_videoram_w)).umask16(0x00ff); + map(0x086000, 0x086fff).ram().w(FUNC(bigfghtr_state::bg_videoram_w)).share("bg_videoram"); + map(0x087000, 0x087fff).ram().w(FUNC(bigfghtr_state::fg_videoram_w)).share("fg_videoram"); + map(0x088000, 0x089fff).rw(FUNC(bigfghtr_state::text_videoram_r), FUNC(bigfghtr_state::text_videoram_w)).umask16(0x00ff).share("text_videoram"); map(0x08a000, 0x08afff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08b000, 0x08bfff).ram().share("spr_pal_clut"); map(0x08c000, 0x08c001).portr("P1"); map(0x08c002, 0x08c003).portr("P2"); map(0x08c004, 0x08c005).portr("DSW0"); map(0x08c006, 0x08c007).portr("DSW1"); - map(0x08d000, 0x08d001).w(FUNC(bigfghtr_state::terraf_io_w)); //807b0 - map(0x08d002, 0x08d003).w(FUNC(bigfghtr_state::armedf_bg_scrollx_w)); - map(0x08d004, 0x08d005).w(FUNC(bigfghtr_state::armedf_bg_scrolly_w)); - map(0x08d006, 0x08d007).w(FUNC(bigfghtr_state::armedf_fg_scrollx_w)); - map(0x08d008, 0x08d009).w(FUNC(bigfghtr_state::armedf_fg_scrolly_w)); - map(0x08d00a, 0x08d00b).w(FUNC(bigfghtr_state::sound_command_w)); + map(0x08d000, 0x08d001).w(FUNC(bigfghtr_state::armedf_io_w)); //807b0 + map(0x08d002, 0x08d003).w(FUNC(bigfghtr_state::bg_scrollx_w)); + map(0x08d004, 0x08d005).w(FUNC(bigfghtr_state::bg_scrolly_w)); + map(0x08d006, 0x08d007).w(FUNC(bigfghtr_state::fg_scrollx_w)); + map(0x08d008, 0x08d009).w(FUNC(bigfghtr_state::fg_scrolly_w)); + map(0x08d00b, 0x08d00b).w(FUNC(bigfghtr_state::sound_command_w)); map(0x08d00c, 0x08d00d).nopw(); //watchdog map(0x08d00e, 0x08d00f).w(FUNC(bigfghtr_state::irq_lv1_ack_w)); @@ -637,28 +653,24 @@ void armedf_state::cclimbr2_soundmap(address_map &map) map(0xc000, 0xffff).ram(); } -READ8_MEMBER(armedf_state::blitter_txram_r) -{ - return m_text_videoram[offset]; -} - -WRITE8_MEMBER(armedf_state::blitter_txram_w) +void armedf_state::blitter_txram_w(offs_t offset, u8 data) { m_text_videoram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset); + if (offset < 0x1000) + m_tx_tilemap->mark_tile_dirty(offset & 0x7ff); } -WRITE8_MEMBER(armedf_state::fg_scrollx_w) +void armedf_state::terrafjb_fg_scrollx_w(u8 data) { m_fg_scrollx = (data & 0xff) | (m_fg_scrollx & 0x300); } -WRITE8_MEMBER(armedf_state::fg_scrolly_w) +void armedf_state::terrafjb_fg_scrolly_w(u8 data) { m_fg_scrolly = (data & 0xff) | (m_fg_scrolly & 0x300); } -WRITE8_MEMBER(armedf_state::fg_scroll_msb_w) +void armedf_state::terrafjb_fg_scroll_msb_w(u8 data) { m_fg_scrolly = (((data & 0x03) >> 0) << 8) | (m_fg_scrolly & 0xff); m_fg_scrollx = (((data & 0x0c) >> 2) << 8) | (m_fg_scrollx & 0xff); @@ -668,16 +680,16 @@ WRITE8_MEMBER(armedf_state::fg_scroll_msb_w) void armedf_state::terrafjb_extraz80_map(address_map &map) { map(0x0000, 0x3fff).rom(); - map(0x4000, 0x5fff).rw(FUNC(armedf_state::blitter_txram_r), FUNC(armedf_state::blitter_txram_w)); + map(0x4000, 0x5fff).ram().w(FUNC(armedf_state::blitter_txram_w)).share("text_videoram"); map(0x8000, 0x87ff).ram(); } void armedf_state::terrafjb_extraz80_portmap(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(armedf_state::fg_scrollx_w)); - map(0x01, 0x01).w(FUNC(armedf_state::fg_scrolly_w)); - map(0x02, 0x02).w(FUNC(armedf_state::fg_scroll_msb_w)); + map(0x00, 0x00).w(FUNC(armedf_state::terrafjb_fg_scrollx_w)); + map(0x01, 0x01).w(FUNC(armedf_state::terrafjb_fg_scrolly_w)); + map(0x02, 0x02).w(FUNC(armedf_state::terrafjb_fg_scroll_msb_w)); } void armedf_state::sound_portmap(address_map &map) @@ -1037,52 +1049,14 @@ INPUT_PORTS_END * *************************************/ -static const gfx_layout char_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4, 0, 12, 8, 20, 16, 28, 24}, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - -static const gfx_layout tile_layout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4, 0, 12, 8, 20, 16, 28, 24, - 32+4, 32+0, 32+12, 32+8, 32+20, 32+16, 32+28, 32+24 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 -}; - -static const gfx_layout sprite_layout = -{ - 16,16, - RGN_FRAC(1,2), - 4, - { 0, 1, 2, 3 }, - { 4, 0, RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 12, 8, RGN_FRAC(1,2)+12, RGN_FRAC(1,2)+8, - 20, 16, RGN_FRAC(1,2)+20, RGN_FRAC(1,2)+16, 28, 24, RGN_FRAC(1,2)+28, RGN_FRAC(1,2)+24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 }, - 64*8 -}; - static GFXDECODE_START( gfx_armedf ) - GFXDECODE_ENTRY( "gfx1", 0, char_layout, 0*16, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, tile_layout, 64*16, 32 ) - GFXDECODE_ENTRY( "gfx3", 0, tile_layout, 96*16, 32 ) - GFXDECODE_ENTRY( "gfx4", 0, sprite_layout, 32*16, 32 ) + GFXDECODE_ENTRY( "text", 0, gfx_8x8x4_packed_lsb, 0*16, 32 ) + GFXDECODE_ENTRY( "foreground", 0, gfx_16x16x4_packed_lsb, 64*16, 32 ) + GFXDECODE_ENTRY( "background", 0, gfx_16x16x4_packed_lsb, 96*16, 32 ) + GFXDECODE_ENTRY( "sprite", 0, gfx_16x16x4_packed_lsb, 32*16, 32 ) GFXDECODE_END - /************************************* * * Machine driver @@ -1119,9 +1093,9 @@ void armedf_state::video_config(machine_config &config, int hchar_start, int vst // assume all games on this HW running at ~59.1358Hz (trusted for Big Fighter) // TODO: recheck if visible area isn't just 320x240 for everything (overscan may be masked by the text layer). // TODO: bootlegs may not run at this speed - m_screen->set_raw(XTAL(16'000'000)/2,531,hchar_start*8,(64-hchar_start)*8, 255, vstart, vend); + m_screen->set_raw(XTAL(16'000'000)/2,531,hchar_start*8,(64-hchar_start)*8, 255, vstart, vend); m_screen->set_palette(m_palette); - m_screen->set_screen_update(FUNC(armedf_state::screen_update_armedf)); + m_screen->set_screen_update(FUNC(armedf_state::screen_update)); m_screen->screen_vblank().set(m_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_armedf); @@ -1168,7 +1142,7 @@ void armedf_state::terraf(machine_config &config) void armedf_state::terrafjb(machine_config &config) { M68000(config, m_maincpu, XTAL(16'000'000)/2); // 8mhz - m_maincpu->set_addrmap(AS_PROGRAM, &armedf_state::terraf_map); + m_maincpu->set_addrmap(AS_PROGRAM, &armedf_state::terrafjb_map); m_maincpu->set_vblank_int("screen", FUNC(armedf_state::irq1_line_assert)); z80_device &audiocpu(Z80(config, "audiocpu", XTAL(24'000'000)/6)); // 4mhz @@ -1200,6 +1174,7 @@ void armedf_state::terrafjb(machine_config &config) void armedf_state::terrafb(machine_config &config) { terraf(config); + m_maincpu->set_addrmap(AS_PROGRAM, &armedf_state::terrafb_map); config.device_remove("nb1414m4"); } @@ -1344,7 +1319,7 @@ void bigfghtr_state::bigfghtr(machine_config &config) mcu.port_in_cb<1>().set_constant(0xdf); // bit 5: bus contention related? video_config(config, 12, 8, 248); - MCFG_VIDEO_START_OVERRIDE(armedf_state,armedf) + MCFG_VIDEO_START_OVERRIDE(bigfghtr_state,armedf) sound_config(config); } @@ -1366,19 +1341,19 @@ ROM_START( legion ) ROM_LOAD( "legion.1h", 0x00000, 0x04000, CRC(2ca4f7f0) SHA1(7cf997af9dd74ced9d28c047069ccfb67d72e257) ) // lg9 ROM_LOAD( "legion.1i", 0x04000, 0x08000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) // lg10 - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "lg8.bin", 0x00000, 0x08000, CRC(e0596570) SHA1(68ddc950efc55a16e6abc699e3bad18ea19d579f) ) - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "legion.1e", 0x00000, 0x10000, CRC(a9d70faf) SHA1(8b8b60ae49c55e931d6838e863463f6b2bf7adb0) ) // lg5 ROM_LOAD( "legion.1f", 0x18000, 0x08000, CRC(f018313b) SHA1(860bc9937202dc3a40c9fa7caad11c2c2aa19f5c) ) // lg6 - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "legion.1l", 0x00000, 0x10000, CRC(29b8adaa) SHA1(10338ebe7324960683de1f796dd311ed662e42b4) ) // lg13 - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) // lg12 - ROM_LOAD( "legion.1j", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) // lg11 + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) // lg12 + ROM_LOAD16_BYTE( "legion.1j", 0x000001, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) // lg11 ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD ( "lg7.bin", 0x0000, 0x4000, CRC(533e2b58) SHA1(a13ea4a530038760ffa87713903c59a932452717) ) @@ -1395,19 +1370,19 @@ ROM_START( legionj ) ROM_LOAD( "legion.1h", 0x00000, 0x04000, CRC(2ca4f7f0) SHA1(7cf997af9dd74ced9d28c047069ccfb67d72e257) ) ROM_LOAD( "legion.1i", 0x04000, 0x08000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "legion.1g", 0x00000, 0x08000, CRC(c50b0125) SHA1(83b5e9707152d97777fb65fa8820ba34ec2fac8d) ) - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "legion.1e", 0x00000, 0x10000, CRC(a9d70faf) SHA1(8b8b60ae49c55e931d6838e863463f6b2bf7adb0) ) ROM_LOAD( "legion.1f", 0x18000, 0x08000, CRC(f018313b) SHA1(860bc9937202dc3a40c9fa7caad11c2c2aa19f5c) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "legion.1l", 0x00000, 0x10000, CRC(29b8adaa) SHA1(10338ebe7324960683de1f796dd311ed662e42b4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) - ROM_LOAD( "legion.1j", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) + ROM_LOAD16_BYTE( "legion.1j", 0x000001, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD ( "lg7.bin", 0x0000, 0x4000, CRC(533e2b58) SHA1(a13ea4a530038760ffa87713903c59a932452717) ) @@ -1424,19 +1399,19 @@ ROM_START( legionjb ) ROM_LOAD( "legion.1h", 0x00000, 0x04000, CRC(2ca4f7f0) SHA1(7cf997af9dd74ced9d28c047069ccfb67d72e257) ) ROM_LOAD( "legion.1i", 0x04000, 0x08000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "legion.1g", 0x00000, 0x08000, CRC(c50b0125) SHA1(83b5e9707152d97777fb65fa8820ba34ec2fac8d) ) - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "legion.1e", 0x00000, 0x10000, CRC(a9d70faf) SHA1(8b8b60ae49c55e931d6838e863463f6b2bf7adb0) ) ROM_LOAD( "legion.1f", 0x18000, 0x08000, CRC(f018313b) SHA1(860bc9937202dc3a40c9fa7caad11c2c2aa19f5c) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "legion.1l", 0x00000, 0x10000, CRC(29b8adaa) SHA1(10338ebe7324960683de1f796dd311ed662e42b4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) - ROM_LOAD( "legion.1j", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) + ROM_LOAD16_BYTE( "legion.1j", 0x000001, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) ROM_END ROM_START( legionjb2 ) @@ -1450,19 +1425,19 @@ ROM_START( legionjb2 ) ROM_LOAD( "9-legion-24128.h15", 0x00000, 0x04000, CRC(2ca4f7f0) SHA1(7cf997af9dd74ced9d28c047069ccfb67d72e257) ) ROM_LOAD( "8-legion-24256.h17", 0x04000, 0x08000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "7-legion-24256.c9", 0x00000, 0x08000, CRC(c50b0125) SHA1(83b5e9707152d97777fb65fa8820ba34ec2fac8d) ) - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "2-legion-27512.e12", 0x00000, 0x10000, CRC(a9d70faf) SHA1(8b8b60ae49c55e931d6838e863463f6b2bf7adb0) ) ROM_LOAD( "1-legion-24256.e14", 0x18000, 0x08000, CRC(f018313b) SHA1(860bc9937202dc3a40c9fa7caad11c2c2aa19f5c) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "10-legion-27512.e15", 0x00000, 0x10000, CRC(29b8adaa) SHA1(10338ebe7324960683de1f796dd311ed662e42b4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "11-legion-27512.e10", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) - ROM_LOAD( "12-legion-27512.e7", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "11-legion-27512.e10", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) + ROM_LOAD16_BYTE( "12-legion-27512.e7", 0x000001, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) ROM_END ROM_START( terraf ) @@ -1477,20 +1452,20 @@ ROM_START( terraf ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "11.17k", 0x00000, 0x10000, CRC(4407d475) SHA1(96e86c7ef4dc997812436f7d0ddea332b4e6cb2b) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "12.7d", 0x00000, 0x10000, CRC(2d1f2ceb) SHA1(77544e1c4bda06feac135a96bb76af7c79278dc0) ) /* sprites */ - ROM_LOAD( "13.9d", 0x10000, 0x10000, CRC(1d2f92d6) SHA1(e842c6bf95a5958a6ca2c85e68b9bc3cc15211a4) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "12.7d", 0x00000, 0x10000, CRC(2d1f2ceb) SHA1(77544e1c4bda06feac135a96bb76af7c79278dc0) ) /* sprites */ + ROM_LOAD16_BYTE( "13.9d", 0x00001, 0x10000, CRC(1d2f92d6) SHA1(e842c6bf95a5958a6ca2c85e68b9bc3cc15211a4) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD( "10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) @@ -1511,20 +1486,20 @@ ROM_START( terrafu ) /* Bootleg of the USA version?, uses some roms common to bo ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "tf-001.17k", 0x00000, 0x10000, CRC(eb6b4138) SHA1(04c53bf46d87a156d3fad86f051985d0df79bd20) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "tf-003.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ - ROM_LOAD( "tf-002.9d", 0x10000, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "tf-003.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ + ROM_LOAD16_BYTE( "tf-002.9d", 0x00001, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD( "10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) @@ -1545,20 +1520,20 @@ ROM_START( terrafj ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "11.17k", 0x00000, 0x10000, CRC(4407d475) SHA1(96e86c7ef4dc997812436f7d0ddea332b4e6cb2b) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "tfj-12.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ - ROM_LOAD( "tfj-13.9d", 0x10000, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "tfj-12.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ + ROM_LOAD16_BYTE( "tfj-13.9d", 0x00001, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD( "10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) @@ -1612,20 +1587,20 @@ ROM_START( terrafjb ) ROM_REGION( 0x4000, "extra", 0 ) /* z80 program (replacement mcu/blitter) */ ROM_LOAD( "tfb-10.bin", 0x0000, 0x4000, CRC(3f9aa367) SHA1(8278fb357b2d68869e39efa01ff19005807b41f8) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "tfj-12.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ - ROM_LOAD( "tfj-13.9d", 0x10000, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "tfj-12.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ + ROM_LOAD16_BYTE( "tfj-13.9d", 0x00001, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) ROM_REGION( 0x0100, "proms", 0 ) /* Unknown use */ ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ @@ -1659,20 +1634,20 @@ ROM_START( terrafb ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "f-1.1a", 0x00000, 0x10000, CRC(eb6b4138) SHA1(04c53bf46d87a156d3fad86f051985d0df79bd20) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "f-11.4g", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "f-6.3c", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ ROM_LOAD( "f-7.3e", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "f-4.9k", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ ROM_LOAD( "f-5.9m", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) - ROM_REGION( 0x20000, "gfx4", 0 ) - ROM_LOAD( "f-3.6l", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ - ROM_LOAD( "f-2.6j", 0x10000, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) + ROM_REGION( 0x20000, "sprite", 0 ) + ROM_LOAD16_BYTE( "f-3.6l", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ + ROM_LOAD16_BYTE( "f-2.6j", 0x00001, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) ROM_END ROM_START( kozure ) @@ -1687,19 +1662,19 @@ ROM_START( kozure ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "kozure11.17k", 0x00000, 0x10000, CRC(dba51e2d) SHA1(49e799d39d298cd3e01602ae5a2d123dfbfa9134) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "kozure9.11e", 0x00000, 0x08000, CRC(e041356e) SHA1(3e4c8564e7a8c940bbe72db11759903aa295287f) ) /* characters */ - ROM_REGION( 0x40000, "gfx2", 0 ) + ROM_REGION( 0x40000, "foreground", 0 ) ROM_LOAD( "kozure5.15h", 0x00000, 0x20000, CRC(0b510258) SHA1(e7ec89faa574b755605ddb67d6c908a9f5f2d6ac) ) /* foreground tiles */ ROM_LOAD( "kozure4.14h", 0x20000, 0x10000, CRC(fb8e13e6) SHA1(f2eafcf6d7362dc62e808f582a7bd2970e5e1ad1) ) - ROM_REGION( 0x10000, "gfx3", 0 ) + ROM_REGION( 0x10000, "background", 0 ) ROM_LOAD( "kozure14.8a", 0x00000, 0x10000, CRC(94a9c3d0) SHA1(7a5d810ea370d158b2099c17f4d656fbd3deeac8) ) /* background tiles */ - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "kozure12.8d", 0x00000, 0x20000, CRC(15f4021d) SHA1(b2ba6fda1a7bdaae97de4b0157b9b656b4385e08) ) /* sprites */ - ROM_LOAD( "kozure13.9d", 0x20000, 0x20000, CRC(b3b6c753) SHA1(9ad061cac9558320b5cfd1ac1ac8d7f1788270cc) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "kozure12.8d", 0x00000, 0x20000, CRC(15f4021d) SHA1(b2ba6fda1a7bdaae97de4b0157b9b656b4385e08) ) /* sprites */ + ROM_LOAD16_BYTE( "kozure13.9d", 0x00001, 0x20000, CRC(b3b6c753) SHA1(9ad061cac9558320b5cfd1ac1ac8d7f1788270cc) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD( "kozure10.11c", 0x0000, 0x4000, CRC(f48be21d) SHA1(5d6db049f30cab98f672814a86a06609c1fa8fb4) ) @@ -1721,22 +1696,22 @@ ROM_START( cclimbr2 ) ROM_LOAD( "11.bin", 0x00000, 0x04000, CRC(fe0175be) SHA1(5c50fa07d8fa61d58a825bbc2cc5a7b85ff3e42e) ) ROM_LOAD( "12.bin", 0x04000, 0x08000, CRC(5ddf18f2) SHA1(b66da5ad400d00b07160986e4841a309a3572bd1) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "10.bin", 0x00000, 0x08000, CRC(7f475266) SHA1(73d544731fcfd7266bca451880120c555d19ea5d) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "7.bin", 0x00000, 0x10000, CRC(cbdd3906) SHA1(0525599a5981f1e25ec6faf008e547da7a9ee2cb) ) /* foreground tiles */ ROM_LOAD( "8.bin", 0x10000, 0x10000, CRC(b2a613c0) SHA1(1d92b85a0dd4b7e533677c454ec23359867defda) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "17.bin", 0x00000, 0x10000, CRC(e24bb2d7) SHA1(8f4b8410b77a50ae735d72f2f37e63784ebc10d9) ) /* background tiles */ ROM_LOAD( "18.bin", 0x10000, 0x10000, CRC(56834554) SHA1(6d579c32fb57eb4eddc062cb2cc78b546f6607b2) ) - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "15.bin", 0x00000, 0x10000, CRC(4bf838be) SHA1(6b1d7448caf406e47268a1276225bb0619b80cc9) ) /* sprites */ - ROM_LOAD( "16.bin", 0x10000, 0x10000, CRC(21a265c5) SHA1(a2b3a1e5aa545030d933c0f058f4f9a18e1af1c9) ) - ROM_LOAD( "13.bin", 0x20000, 0x10000, CRC(6b6ec999) SHA1(7749ce435f497732bd1b6958974cd95e960fc9fe) ) - ROM_LOAD( "14.bin", 0x30000, 0x10000, CRC(f426a4ad) SHA1(facccb21ca73c560d3a38e05e677782516d5b0c0) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "15.bin", 0x00000, 0x10000, CRC(4bf838be) SHA1(6b1d7448caf406e47268a1276225bb0619b80cc9) ) /* sprites */ + ROM_LOAD16_BYTE( "13.bin", 0x00001, 0x10000, CRC(6b6ec999) SHA1(7749ce435f497732bd1b6958974cd95e960fc9fe) ) + ROM_LOAD16_BYTE( "16.bin", 0x20000, 0x10000, CRC(21a265c5) SHA1(a2b3a1e5aa545030d933c0f058f4f9a18e1af1c9) ) + ROM_LOAD16_BYTE( "14.bin", 0x20001, 0x10000, CRC(f426a4ad) SHA1(facccb21ca73c560d3a38e05e677782516d5b0c0) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD( "9.bin", 0x0000, 0x4000, CRC(740d260f) SHA1(5b4487930c7a1fb0a796aec2243bec631b1b5104) ) @@ -1755,22 +1730,22 @@ ROM_START( cclimbr2a ) ROM_LOAD( "11.bin", 0x00000, 0x04000, CRC(fe0175be) SHA1(5c50fa07d8fa61d58a825bbc2cc5a7b85ff3e42e) ) ROM_LOAD( "12.bin", 0x04000, 0x08000, CRC(5ddf18f2) SHA1(b66da5ad400d00b07160986e4841a309a3572bd1) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "10.bin", 0x00000, 0x08000, CRC(7f475266) SHA1(73d544731fcfd7266bca451880120c555d19ea5d) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "7.bin", 0x00000, 0x10000, CRC(cbdd3906) SHA1(0525599a5981f1e25ec6faf008e547da7a9ee2cb) ) /* foreground tiles */ ROM_LOAD( "8.bin", 0x10000, 0x10000, CRC(b2a613c0) SHA1(1d92b85a0dd4b7e533677c454ec23359867defda) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "17.bin", 0x00000, 0x10000, CRC(e24bb2d7) SHA1(8f4b8410b77a50ae735d72f2f37e63784ebc10d9) ) /* background tiles */ ROM_LOAD( "18.bin", 0x10000, 0x10000, CRC(56834554) SHA1(6d579c32fb57eb4eddc062cb2cc78b546f6607b2) ) - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "15.bin", 0x00000, 0x10000, CRC(4bf838be) SHA1(6b1d7448caf406e47268a1276225bb0619b80cc9) ) /* sprites */ - ROM_LOAD( "16.bin", 0x10000, 0x10000, CRC(21a265c5) SHA1(a2b3a1e5aa545030d933c0f058f4f9a18e1af1c9) ) - ROM_LOAD( "13.bin", 0x20000, 0x10000, CRC(6b6ec999) SHA1(7749ce435f497732bd1b6958974cd95e960fc9fe) ) - ROM_LOAD( "14.bin", 0x30000, 0x10000, CRC(f426a4ad) SHA1(facccb21ca73c560d3a38e05e677782516d5b0c0) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "15.bin", 0x00000, 0x10000, CRC(4bf838be) SHA1(6b1d7448caf406e47268a1276225bb0619b80cc9) ) /* sprites */ + ROM_LOAD16_BYTE( "13.bin", 0x00001, 0x10000, CRC(6b6ec999) SHA1(7749ce435f497732bd1b6958974cd95e960fc9fe) ) + ROM_LOAD16_BYTE( "16.bin", 0x20000, 0x10000, CRC(21a265c5) SHA1(a2b3a1e5aa545030d933c0f058f4f9a18e1af1c9) ) + ROM_LOAD16_BYTE( "14.bin", 0x20001, 0x10000, CRC(f426a4ad) SHA1(facccb21ca73c560d3a38e05e677782516d5b0c0) ) ROM_REGION( 0x4000, "nb1414m4", 0 ) /* data for mcu/blitter */ ROM_LOAD( "9.bin", 0x0000, 0x4000, CRC(740d260f) SHA1(5b4487930c7a1fb0a796aec2243bec631b1b5104) ) @@ -1788,20 +1763,20 @@ ROM_START( armedf ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "af_10.rom", 0x00000, 0x10000, CRC(c5eacb87) SHA1(33af84b48fbda26729975b02cfb70f23c0bce6a2) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "09.11c", 0x00000, 0x08000, CRC(5c6993d5) SHA1(3991851e5c4d2b3d72c372afdfbb710796874c15) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "af_04.rom", 0x00000, 0x10000, CRC(44d3af4f) SHA1(0c2cb54357c314e43cec6f959fe9d4a2c8bc8834) ) /* foreground tiles */ ROM_LOAD( "af_05.rom", 0x10000, 0x10000, CRC(92076cab) SHA1(f47424817373a6735da2b2049b53da5b38178cec) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "af_14.rom", 0x00000, 0x10000, CRC(8c5dc5a7) SHA1(758140ddb9e60fb3950fe58bf53c7aea769a1a94) ) /* background tiles */ ROM_LOAD( "af_13.rom", 0x10000, 0x10000, CRC(136a58a3) SHA1(5481e3ce404881a0470f8740f0de6e42283bedf2) ) - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "af_11.rom", 0x00000, 0x20000, CRC(b46c473c) SHA1(d8573225e2d8b133b3bdd4fa5a12d445c71d5e0e) ) /* sprites */ - ROM_LOAD( "af_12.rom", 0x20000, 0x20000, CRC(23cb6bfe) SHA1(34cb013827206bea71f5336b308ba92bee688506) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "af_11.rom", 0x00000, 0x20000, CRC(b46c473c) SHA1(d8573225e2d8b133b3bdd4fa5a12d445c71d5e0e) ) /* sprites */ + ROM_LOAD16_BYTE( "af_12.rom", 0x00001, 0x20000, CRC(23cb6bfe) SHA1(34cb013827206bea71f5336b308ba92bee688506) ) ROM_END ROM_START( armedff ) @@ -1816,20 +1791,20 @@ ROM_START( armedff ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ ROM_LOAD( "af_10.rom", 0x00000, 0x10000, CRC(c5eacb87) SHA1(33af84b48fbda26729975b02cfb70f23c0bce6a2) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "af_09.rom", 0x00000, 0x08000, CRC(7025e92d) SHA1(e590682092c25bbfb674afeccbfc0e613c51d188) ) /* characters */ - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "foreground", 0 ) ROM_LOAD( "af_04.rom", 0x00000, 0x10000, CRC(44d3af4f) SHA1(0c2cb54357c314e43cec6f959fe9d4a2c8bc8834) ) /* foreground tiles */ ROM_LOAD( "af_05.rom", 0x10000, 0x10000, CRC(92076cab) SHA1(f47424817373a6735da2b2049b53da5b38178cec) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "af_14.rom", 0x00000, 0x10000, CRC(8c5dc5a7) SHA1(758140ddb9e60fb3950fe58bf53c7aea769a1a94) ) /* background tiles */ ROM_LOAD( "af_13.rom", 0x10000, 0x10000, CRC(136a58a3) SHA1(5481e3ce404881a0470f8740f0de6e42283bedf2) ) - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "af_11.rom", 0x00000, 0x20000, CRC(b46c473c) SHA1(d8573225e2d8b133b3bdd4fa5a12d445c71d5e0e) ) /* sprites */ - ROM_LOAD( "af_12.rom", 0x20000, 0x20000, CRC(23cb6bfe) SHA1(34cb013827206bea71f5336b308ba92bee688506) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "af_11.rom", 0x00000, 0x20000, CRC(b46c473c) SHA1(d8573225e2d8b133b3bdd4fa5a12d445c71d5e0e) ) /* sprites */ + ROM_LOAD16_BYTE( "af_12.rom", 0x00001, 0x20000, CRC(23cb6bfe) SHA1(34cb013827206bea71f5336b308ba92bee688506) ) ROM_END ROM_START( skyrobo ) @@ -1846,20 +1821,20 @@ ROM_START( skyrobo ) // coming from Tatakae Big Fighter, might or might not be correct for this version ROM_LOAD( "i8751.bin", 0x00000, 0x1000, BAD_DUMP CRC(64a0d225) SHA1(ccc5c33c0c412bf9e3a4f7de5e39b042e00c41dd) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "7", 0x00000, 0x08000, CRC(f556ef28) SHA1(2acb83cdf23356091056f2cfbbc2b9828ee25b6f) ) /* Rom location 11C */ - ROM_REGION( 0x30000, "gfx2", 0 ) + ROM_REGION( 0x30000, "foreground", 0 ) ROM_LOAD( "5.13f", 0x00000, 0x20000, CRC(d440a29f) SHA1(9e6ea7c9903e5e3e8e10ac7680c6120e1aa27250) ) ROM_LOAD( "6.15f", 0x20000, 0x10000, CRC(27469a76) SHA1(ebf2c60e1f70a589680c05adf10771ac2097b9d0) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "12.8a", 0x00000, 0x10000, CRC(a5694ea9) SHA1(ea94174495b3a65b3797932074a94df3b55fa0a2) ) ROM_LOAD( "11.6a", 0x10000, 0x10000, CRC(10b74e2c) SHA1(e3ec68726e7f277dc2043424f2e4d863eb01b3dc) ) - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "9.8d", 0x00000, 0x20000, CRC(fe67800e) SHA1(0d3c4c3cb185270260fa691a97cddf082d6a056e) ) - ROM_LOAD( "10.9d", 0x20000, 0x20000, CRC(dcb828c4) SHA1(607bc86580a6fe6e15e91131532b0eecd8b7a0cb) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "9.8d", 0x00000, 0x20000, CRC(fe67800e) SHA1(0d3c4c3cb185270260fa691a97cddf082d6a056e) ) + ROM_LOAD16_BYTE( "10.9d", 0x00001, 0x20000, CRC(dcb828c4) SHA1(607bc86580a6fe6e15e91131532b0eecd8b7a0cb) ) ROM_REGION( 0x0100, "proms", 0 ) ROM_LOAD( "tf.13h", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* Prom is a N82S129AN type */ @@ -1878,20 +1853,20 @@ ROM_START( bigfghtr ) ROM_REGION( 0x10000, "mcu", 0 ) /* Intel C8751 read protected MCU */ ROM_LOAD( "i8751.bin", 0x00000, 0x1000, CRC(64a0d225) SHA1(ccc5c33c0c412bf9e3a4f7de5e39b042e00c41dd) ) - ROM_REGION( 0x08000, "gfx1", 0 ) + ROM_REGION( 0x08000, "text", 0 ) ROM_LOAD( "7.11c", 0x00000, 0x08000, CRC(1809e79f) SHA1(730547771f803857acb552a84a8bc21bd3bda33f) ) - ROM_REGION( 0x30000, "gfx2", 0 ) + ROM_REGION( 0x30000, "foreground", 0 ) ROM_LOAD( "5.13f", 0x00000, 0x20000, CRC(d440a29f) SHA1(9e6ea7c9903e5e3e8e10ac7680c6120e1aa27250) ) ROM_LOAD( "6.15f", 0x20000, 0x10000, CRC(27469a76) SHA1(ebf2c60e1f70a589680c05adf10771ac2097b9d0) ) - ROM_REGION( 0x20000, "gfx3", 0 ) + ROM_REGION( 0x20000, "background", 0 ) ROM_LOAD( "12.8a", 0x00000, 0x10000, CRC(a5694ea9) SHA1(ea94174495b3a65b3797932074a94df3b55fa0a2) ) ROM_LOAD( "11.6a", 0x10000, 0x10000, CRC(10b74e2c) SHA1(e3ec68726e7f277dc2043424f2e4d863eb01b3dc) ) - ROM_REGION( 0x40000, "gfx4", 0 ) - ROM_LOAD( "9.8d", 0x00000, 0x20000, CRC(fe67800e) SHA1(0d3c4c3cb185270260fa691a97cddf082d6a056e) ) - ROM_LOAD( "10.9d", 0x20000, 0x20000, CRC(dcb828c4) SHA1(607bc86580a6fe6e15e91131532b0eecd8b7a0cb) ) + ROM_REGION( 0x40000, "sprite", 0 ) + ROM_LOAD16_BYTE( "9.8d", 0x00000, 0x20000, CRC(fe67800e) SHA1(0d3c4c3cb185270260fa691a97cddf082d6a056e) ) + ROM_LOAD16_BYTE( "10.9d", 0x00001, 0x20000, CRC(dcb828c4) SHA1(607bc86580a6fe6e15e91131532b0eecd8b7a0cb) ) ROM_REGION( 0x0100, "proms", 0 ) ROM_LOAD( "tf.13h", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* Prom is a N82S129AN type */ @@ -1906,25 +1881,6 @@ ROM_END void armedf_state::init_terraf() { m_scroll_type = 0; - - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(*this, FUNC(armedf_state::bootleg_io_w))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c006, 0x07c007, write16_delegate(*this, FUNC(armedf_state::terraf_fg_scrolly_w))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c008, 0x07c009, write16_delegate(*this, FUNC(armedf_state::terraf_fg_scrollx_w))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0c0001, write16_delegate(*this, FUNC(armedf_state::terraf_fg_scroll_msb_arm_w))); -} - -void armedf_state::init_terrafu() -{ - m_scroll_type = 0; - - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(*this, FUNC(armedf_state::terraf_io_w))); -} - -void armedf_state::init_terrafjb() -{ - m_scroll_type = 0; - - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(*this, FUNC(armedf_state::terrafjb_io_w))); } void armedf_state::init_armedf() @@ -1932,19 +1888,15 @@ void armedf_state::init_armedf() m_scroll_type = 1; } - void armedf_state::init_kozure() { - uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); + u16 *ROM = (u16 *)memregion("maincpu")->base(); /* patch "time over" bug, see notes on top. */ ROM[0x1016c/2] = 0x4e71; /* ROM check at POST. */ ROM[0x04fc6/2] = 0x4e71; m_scroll_type = 0; - - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(*this, FUNC(armedf_state::terraf_io_w))); - } void armedf_state::init_legion() @@ -1952,7 +1904,7 @@ void armedf_state::init_legion() #if LEGION_HACK /* This is a hack to allow you to use the extra features of 3 of the "Unused" Dip Switches (see notes above). */ - uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); + u16 *ROM = (u16 *)memregion("maincpu")->base(); RAM[0x0001d6 / 2] = 0x0001; /* To avoid checksum error */ RAM[0x000488 / 2] = 0x4e71; @@ -1966,7 +1918,7 @@ void armedf_state::init_legionjb() #if LEGION_HACK /* This is a hack to allow you to use the extra features of 3 of the "Unused" Dip Switches (see notes above). */ - uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); + u16 *RAM = (u16 *)memregion("maincpu")->base(); RAM[0x0001d6/2] = 0x0001; /* No need to patch the checksum routine (see notes) ! */ #endif @@ -1978,8 +1930,6 @@ void armedf_state::init_legionjb() void armedf_state::init_cclimbr2() { - m_maincpu->space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(*this, FUNC(armedf_state::terraf_io_w))); - m_scroll_type = 3; } @@ -1995,10 +1945,10 @@ GAME( 1987, legionj, legion, legion, legion, armedf_state, init_legio GAME( 1987, legionjb, legion, legionjb, legion, armedf_state, init_legionjb, ROT270, "bootleg", "Chouji Meikyuu Legion (Japan ver 1.05, bootleg set 1)", MACHINE_SUPPORTS_SAVE) /* blitter protection removed */ GAME( 1987, legionjb2, legion, legionjb2, legion, armedf_state, init_legionjb, ROT270, "bootleg", "Chouji Meikyuu Legion (Japan ver 1.05, bootleg set 2)", MACHINE_SUPPORTS_SAVE) -GAME( 1987, terraf, 0, terraf, terraf, armedf_state, init_terrafu, ROT0, "Nichibutsu", "Terra Force", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, terrafu, terraf, terraf, terraf, armedf_state, init_terrafu, ROT0, "Nichibutsu USA", "Terra Force (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, terrafj, terraf, terraf, terraf, armedf_state, init_terrafu, ROT0, "Nichibutsu Japan", "Terra Force (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, terrafjb, terraf, terrafjb, terraf, armedf_state, init_terrafjb, ROT0, "bootleg", "Terra Force (Japan, bootleg with additional Z80)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, terraf, 0, terraf, terraf, armedf_state, init_terraf, ROT0, "Nichibutsu", "Terra Force", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, terrafu, terraf, terraf, terraf, armedf_state, init_terraf, ROT0, "Nichibutsu USA", "Terra Force (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, terrafj, terraf, terraf, terraf, armedf_state, init_terraf, ROT0, "Nichibutsu Japan", "Terra Force (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, terrafjb, terraf, terrafjb, terraf, armedf_state, init_terraf, ROT0, "bootleg", "Terra Force (Japan, bootleg with additional Z80)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, terrafb, terraf, terrafb, terraf, armedf_state, init_terraf, ROT0, "bootleg", "Terra Force (Japan, bootleg set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, kozure, 0, kozure, kozure, armedf_state, init_kozure, ROT0, "Nichibutsu", "Kozure Ookami (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp index 0b29c6cd8cd..491a3483298 100644 --- a/src/mame/drivers/at.cpp +++ b/src/mame/drivers/at.cpp @@ -624,11 +624,32 @@ void at_state::at386l(machine_config &config) void at_state::at486(machine_config &config) { - at386(config); - i486_device &maincpu(I486(config.replace(), m_maincpu, 25'000'000)); + i486_device &maincpu(I486(config, m_maincpu, 25'000'000)); maincpu.set_addrmap(AS_PROGRAM, &at_state::at32_map); maincpu.set_addrmap(AS_IO, &at_state::at32_io); maincpu.set_irq_acknowledge_callback("mb:pic8259_master", FUNC(pic8259_device::inta_cb)); + + AT_MB(config, m_mb, 0).at_softlists(config); + + config.set_maximum_quantum(attotime::from_hz(60)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + // on-board devices + ISA16_SLOT(config, "board1", 0, "mb:isabus", pc_isa16_cards, "fdcsmc", true); // FIXME: deteremine ISA bus clock + ISA16_SLOT(config, "board2", 0, "mb:isabus", pc_isa16_cards, "comat", true); + ISA16_SLOT(config, "board3", 0, "mb:isabus", pc_isa16_cards, "ide", true); + ISA16_SLOT(config, "board4", 0, "mb:isabus", pc_isa16_cards, "lpt", true); + // ISA cards + ISA16_SLOT(config, "isa1", 0, "mb:isabus", pc_isa16_cards, "svga_et4k", false); + ISA16_SLOT(config, "isa2", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa3", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa4", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + ISA16_SLOT(config, "isa5", 0, "mb:isabus", pc_isa16_cards, nullptr, false); + PC_KBDC_SLOT(config, "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL).set_pc_kbdc_slot(subdevice("mb:pc_kbdc")); + + /* internal ram */ + RAM(config, m_ram).set_default_size("4M").set_extra_options("1M,2M,8M,16M,20M,32M,64M,128M"); } void at_state::at486l(machine_config &config) @@ -1589,6 +1610,9 @@ ROM_START( atturbo ) // 11: BIOS-String: DG22-6080-091991-K0 / 286-BIOS (C) 1989 American Megatrends Inc / (C) 1991 TriGem Corporation ROM_SYSTEM_BIOS(11, "tg286m", "TG286M") ROMX_LOAD( "ami.bin", 0x10000, 0x10000, CRC(5751542a) SHA1(0fa0e86a0599e8500bb9ca9efa77cfc9c82a9dc0), ROM_BIOS(11)) + // 12: BIOS-String: 286 Modular BIOS Version B3.11.03 - REFRESH TIMING ERROR + ROM_SYSTEM_BIOS(12, "cl286", "CL286") + ROMX_LOAD( "award.bin", 0x10000, 0x10000, CRC(839a30b3) SHA1(c40a15c2636cf734e83ddf22213f637766f6456e), ROM_BIOS(12)) ROM_END // Chips & Technologies CS8221 NEAT chipset: P82C211 + P82C212 + P82C215 + P82C206 @@ -1891,7 +1915,7 @@ ROM_START( ht12a ) ROM_END -// ***** 286 motherboards using the 5 chip SUNTAC chipset +// ***** motherboards using the six chip SUNTAC chipset: ST62BC001-B, ST62BC002-B, ST62BC003-B, ST62C006, ST62BC004-B1, ST62BC005-B // Magitronic B233 (8 ISA slots) // SUNTAC Chipset, http://toastytech.com/manuals/Magitronic%20B233%20Manual.pdf @@ -1919,14 +1943,6 @@ ROM_START( aubam12s2 ) ROMX_LOAD( "st-ph-h.rom", 0x00000, 0x10000, CRC(5b4fd7ee) SHA1(821fe868da5c7ff28f2c7b9bae03d0b8a76af796), ROM_SKIP(1)) ROM_END -// BIOS ROMs are marked TCI, Award 286 Modular BIOS Version 3.03HLS -// complains about "refresh timing error, but works - BIOS release date:: 15-11-1985 -ROM_START( suntac5 ) - ROM_REGION16_LE(0x20000, "bios", 0) - ROMX_LOAD( "suntac_80286_lo.bin", 0x18000, 0x4000, CRC(f7bf6c49) SHA1(d8e813c264008f096006f46b90769c0927e44da9), ROM_SKIP(1)) - ROMX_LOAD( "suntac_80286_hi.bin", 0x18001, 0x4000, CRC(5f382e78) SHA1(8ba222df9d7028513e37978598d8139906e8834c), ROM_SKIP(1)) -ROM_END - // HLB-286 MBA-009 - BIOS: 286 Modular BIOS Version 3.03 HL - HLB-286 System // SUNTAC ST62BC002-B, ST62BC005-B, ST62BC003-B, ST62BC001-B, ST62C00B, ST62BC004-B1 ROM_START( mba009 ) @@ -1949,6 +1965,38 @@ ROM_START( ev1815 ) ROMX_LOAD( "award_v3.03gs_ev1815_odd.bin", 0x10001, 0x8000, CRC(5bcd9421) SHA1(f32e5a39da593c6982f964fb05b0802d54c3de45), ROM_SKIP(1) | ROM_BIOS(1) ) ROM_END +// Mintek BAY-1000C V1.01 - Chipset: SUNTAC ST62BC002-B, ST62C005-B, ST62BC001-B, ST62BC003-B, ST62BC004-B1, ST62C008 +// CPU: AMD N80L286-12/S - RAM: 4xSIMM30, 18x18pin/16pin, 8x20pin, 4x16pin - OSC: 12.000, 14.31818, 25.000MHz - ISA8: 2, ISA16: 6 +// BIOS-String: Phoenix 80286 ROM BIOS PLUS Version 3.10 00 / LYI-CHENG ENTERPRISE CO., LTD. +ROM_START( bay1000c ) + ROM_REGION16_LE( 0x20000, "bios", 0) + ROM_LOAD16_BYTE( "286-suntac_bay-1000c-ic22_32k.bin", 0x10000, 0x8000, CRC(105d3257) SHA1(cf10d09db57f65fee649adcb39058d9d9aefe9e9)) + ROM_LOAD16_BYTE( "286-suntac_bay-1000c-ic23_32k.bin", 0x10001, 0x8000, CRC(3b997bb1) SHA1(70d3bb9e57624c9f64d70bc5f3c00305a08a8b2e)) +ROM_END + +ROM_START( suntac6 ) + ROM_REGION16_LE(0x20000, "bios", 0) + // CPU: AMD N80L286-12/S - RAM: 36 sockets 18pin/16pin, fitted: 36x41C256P-8 - BIOS: Award 286 - Keyboard-BIOS: M5L8042-165P + // ISA8: 2, ISA16: 6 - OSC: 12.000 MHz, 24.000, 14.31818 + // 0: BIOS-String: 286 Modular BIOS Version 3.03 01 Copyright Award Software Inc. + ROM_SYSTEM_BIOS(0, "terraat", "Terra AT") + ROMX_LOAD( "286-suntac-award_a2132439lo.bin", 0x18000, 0x4000, CRC(5fa269f8) SHA1(4167017aaeb63f4eedde155ba29f33ae2a94403b), ROM_SKIP(1) | ROM_BIOS(0) ) + ROMX_LOAD( "286-suntac-award_a2132439hi.bin", 0x18001, 0x4000, CRC(114604c3) SHA1(db957783e6b16f6e1b8a831130d37fe51da84430), ROM_SKIP(1) | ROM_BIOS(0) ) + // 1: BIOS-String: 286 Modular BIOS Version 0N3.03 NFS / ELT - board is identical to #0 + ROM_SYSTEM_BIOS(1, "286suntacelt", "286 SUNTAC ELT") + ROMX_LOAD( "286-suntac-award_a2184058lo.bin", 0x18000, 0x4000, CRC(dbf48678) SHA1(75cb7971519cf55f9bb024eed70b831af1799506), ROM_SKIP(1) | ROM_BIOS(1) ) + ROMX_LOAD( "286-suntac-award_a2184058hi.bin", 0x18001, 0x4000, CRC(2abea425) SHA1(1183d1fc665eab11042643c4f2e0eaa0490bb3df), ROM_SKIP(1) | ROM_BIOS(1) ) + // 2: BIOS-String: DSUN-1105-043089-K0 - Keyboard-BIOS: AMI Keyboard BIOS PLUS A086031 + // CPU: Intel N80286-12 - RAM: 36x16pin/16pin, used 36xTC511000AP-80 - ISA8: 2, ISA16: 6 - BIOS: AMI 286 BIOS PLUS SA073155 + ROM_SYSTEM_BIOS(2, "sa073155", "SA073155") + ROMX_LOAD( "286-suntac_sa073155_ic22.bin", 0x00000, 0x10000, CRC(abf6c367) SHA1(79a07b9b9af2e1963cfcae75fafc3478885237cb), ROM_SKIP(1) | ROM_BIOS(2) ) + ROMX_LOAD( "286-suntac_sa073155_ic23.bin", 0x00001, 0x10000, CRC(1d286cd9) SHA1(31be40c5008dc67cb24f4418cffaa57682e654c0), ROM_SKIP(1) | ROM_BIOS(2) ) + // 3: BIOS ROMs are marked TCI, Award 286 Modular BIOS Version 3.03HLS + // complains about "refresh timing error, but works - BIOS release date:: 15-11-1985 + ROM_SYSTEM_BIOS(3, "tci", "TCI") + ROMX_LOAD( "suntac_80286_lo.bin", 0x18000, 0x4000, CRC(f7bf6c49) SHA1(d8e813c264008f096006f46b90769c0927e44da9), ROM_SKIP(1) | ROM_BIOS(3) ) + ROMX_LOAD( "suntac_80286_hi.bin", 0x18001, 0x4000, CRC(5f382e78) SHA1(8ba222df9d7028513e37978598d8139906e8834c), ROM_SKIP(1) | ROM_BIOS(3) ) +ROM_END // ***** 286 motherboards using the 5 chip VLSI chipset @@ -2008,6 +2056,39 @@ ROM_END // 80286 Desktop //************************************************************************** +// Atari PC 4, PC4X motherboard - Chipset: NEAT CS8221 (P82C206, P82C211, P82C212, P82C215) - ISA8: 1, ISA16: 4 - RAM: 8XSIPP30 +// Paradise Systems PVGA1A-JK, IMSG171P +// on board: external and internal floppy, digital and analog video, ser, par, keyboard, mouse +ROM_START( ataripc4 ) // initializes video, then halts + ROM_REGION16_LE(0x20000, "bios", 0) + ROM_LOAD16_BYTE( "ami_pc4x_1.7_even.bin", 0x10000, 0x8000, CRC(9f142377) SHA1(b3e5c5dfaec133646295d9a16bc1eec54fe2bc35)) + ROM_LOAD16_BYTE( "ami_pc4x_1.7_odd.bin", 0x10001, 0x8000, CRC(ae3d4cb6) SHA1(d7915ef013462aff4f189cda8f6dc0a486777b63)) + + ROM_REGION16_LE(0x10000, "pvga", 0) + ROM_LOAD16_BYTE( "pvga_pc4x_even.bin", 0x00000, 0x8000, CRC(ff222896) SHA1(e22cdcd9c69fc4feef6b8c2903e3506c79ff531b)) + ROM_LOAD16_BYTE( "pvga_pc4x_odd.bin", 0x00001, 0x8000, CRC(8ca04b2f) SHA1(7705d866ecf366bd6ea95071bf5767877461d2d5)) +ROM_END + +// Atari ABC 286/30, PC4LC motherboard (low cost, compared to PC4) - BIOS-String: DNET-0000-092588-K0- ISA16: 3 - RAM: 4xSIPP30 +// NEAT CS8221 (P82C206, P82C211, P82C212, P82C215) - http://www.atari-computermuseum.de/abc286.htm +// on board: internal floppy, digital video (EGA), ser, par, keyboard, mouse +ROM_START( atariabc286 ) + ROM_REGION16_LE(0x20000, "bios", 0) + ROM_LOAD16_BYTE( "ami_pc4x_1.x_even.bin", 0x10000, 0x8000, CRC(930447c7) SHA1(fb7212b413ff8aa056bd23baadc22691ce714f8d)) + ROM_LOAD16_BYTE( "ami_pc4x_1.x_odd.bin", 0x10001, 0x8000, CRC(0891fd25) SHA1(4722b1db1b2c985c67f9a9b807ce68c06a905232)) + + // ROM_REGION(0x40000, "ega", 0) + // ROM_LOAD( "p82c441_ega_bios_v1.0.6.bin", 0x00000, 0x40000, BAD_DUMP CRC(80c11ef2) SHA1(90852d3cbb64504c8d57b469a594c22c247c9a39)) +ROM_END + +// Profex PC 33 - Chipset: SUNTAC ST62BC004-B1, ST62BC003-B, ST62C008, ST62C005-B, ST62BC001-B, ST72BC002-B +// RAM: 2xSIPP30, 18x18pin/16pin, 8x20pin, 4x16pin - OSC: 12.000, 14.31818, 24.000MHz - ISA8: 2, ISA16: 6 +// BIOS: Award A2245250 - Keyboard-BIOS: Award - BIOS-String: 286 Modular BIOS 3.03 Copyright Award Software Inc. / GCH +ROM_START( profpc33 ) + ROM_REGION16_LE(0x20000, "bios", 0) + ROM_LOAD( "st62-pro.bio", 0x10000, 0x10000, CRC(a42f9d0e) SHA1(384f4ddaf92307a5eeb70646a85ad991d904c2d2)) +ROM_END + // Epson PC AX / Equity III+ - 102-System Board Error (according to the technical manual this means // "TlMER SPEED CHECK: An error was detected in timer controller counter 0." ROM_START( epsax ) @@ -2374,7 +2455,7 @@ ROM_START( at386 ) // BIOS-String: MR BIOS (r) V1.41 / 386DX CPU - the notes also say it comes from a DX motherboard, so sorted here ROM_SYSTEM_BIOS( 15, "acer310", "Acer 310" ) ROMX_LOAD( "3alr001.bin", 0x10000, 0x10000, CRC(b45e5c73) SHA1(81ef79faed3914ccff23b3da5e831d7a99626538), ROM_BIOS(15)) -// 16: BIOS-String: 30-0200-ZZ1453-00101111-050591-SCAT3.04-0 + // 16: BIOS-String: 30-0200-ZZ1453-00101111-050591-SCAT3.04-0 ROM_SYSTEM_BIOS( 16, "kmxc02", "KMX-C-02" ) ROMX_LOAD( "3ctm005.bin", 0x10000, 0x10000, CRC(cfba6b2a) SHA1(001642016a3c02b031d739bd8b0fcff9470e86d2), ROM_BIOS(16)) // 17: BIOS: AMI; 11/11/92 - ISA16: 5 - CPU/FPU: Am386DX-40, IIT 3C87-40 - Chipset: FOREX FRX46C521, KS83C206Q @@ -2399,6 +2480,13 @@ ROM_START( at386 ) // 22: BIOS-String: MR BIOS (tm) V1.35 - RAM Pattern Test Failed at 0F0000H ROM_SYSTEM_BIOS( 22, "mrv135", "MR BIOS V1.35") ROMX_LOAD( "mrbios_v1.35_opti324_4floppy.bin", 0x10000, 0x10000, CRC(9a21dcd3) SHA1(dcab673fd2df621839671ef8f6a2eff443de39df), ROM_BIOS(22)) + // 23: BIOS-String: SINT-1185-040990-K0 - Chipset: VIA SL9030, SL9010, SL9025, SL9020, SL9020, SL9350, SL9090A + ROM_SYSTEM_BIOS( 23, "3vim002", "3VIM002") + ROMX_LOAD( "3vim002l.bin", 0x10000, 0x8000, CRC(368b66df) SHA1(1bef1e8e1818513061f0c7cf3c731da360c8400b), ROM_SKIP(1) | ROM_BIOS(23)) + ROMX_LOAD( "3vim002h.bin", 0x10001, 0x8000, CRC(02dbb9fe) SHA1(cfce750a4a019c71e59011fb7a7d891b40f61c61), ROM_SKIP(1) | ROM_BIOS(23)) + // 24: BIOS-String: 30-0201-ZZ1343-00101111-050591-OPWB-0 + ROM_SYSTEM_BIOS( 24, "zz1343", "zz1343") + ROMX_LOAD( "ami_zz1343.bin", 0x10000, 0x10000, CRC(f5464c1f) SHA1(cb069c3d1d322aa769d46749716a35259f78264a), ROM_BIOS(24)) ROM_END @@ -2406,6 +2494,14 @@ ROM_END // 80386 SX and DX motherboard //************************************************************************** +// 3SIUD-1.1 - CPU: AMD Am386SX/SXL-25 - Chipset: SiS 85C206, UMC (unreadable) - RAM: SIMM30x4, 8x20pin, 4x16pin +// BIOS: AMI 386SX BIOS 70167 - Keyboard-BIOS: NEC KB-BIOS VER7 - ISA8: 1, ISA16: 5 - OSC: 50.000000MHz, 14.31818MHz +// BIOS-String: 30-0200-ZZ1266-00101111-050591-UMC386SX-0 / 3SIUD-1.0 +ROM_START( 3siud ) + ROM_REGION16_LE(0x20000, "bios", 0) + ROM_LOAD( "3siud_bios.bin", 0x10000, 0x10000, CRC(24fa8491) SHA1(635ce3db872e39d84f299356b960b0a16e2cf082)) +ROM_END + // AMI 386 BABY SCREAMER - BIOS: AMI MARK V BABY SCREAMER - Chipset: VLSI VL82C331-FC, VL82C332-FC, Megatrends MG-9275, Chips ??? - OSC: 14.31818, 66.666, 24.000MHz // BIOS-String: 40-0301-000000-00101111-070791-SCREAMER-0 / BIOS RELEASE 42121691 - On board: 2xserial, parallel, floppy, 1xIDE ROM_START( amibaby ) @@ -2725,9 +2821,14 @@ ROM_END // 8x SIMM, 5x 16-bit ISA, 2x 8-bit ISA, 1x 32-bit proprietary memory expansion slot ROM_START( ecs38632 ) ROM_REGION32_LE(0x20000, "bios", 0) - // BIOS-String: EC&T-1131-030389-K0 - ROMX_LOAD( "ami_ecs-386_32_lo.bin", 0x10000, 0x8000, CRC(e119d6a4) SHA1(bcc6164173b44832b8ebfa1883e22efc167e2cd4), ROM_SKIP(1) ) - ROMX_LOAD( "ami_ecs-386_32_hi.bin", 0x10001, 0x8000, CRC(e3072bf8) SHA1(74eec72e190f682cfd5ae5425ebdc854e0ba7bc9), ROM_SKIP(1) ) + // 0: BIOS-String: EC&T-1131-030389-K0 + ROM_SYSTEM_BIOS( 0, "030389", "030389") + ROMX_LOAD( "ami_ecs-386_32_lo.bin", 0x10000, 0x8000, CRC(e119d6a4) SHA1(bcc6164173b44832b8ebfa1883e22efc167e2cd4), ROM_SKIP(1) | ROM_BIOS(0) ) + ROMX_LOAD( "ami_ecs-386_32_hi.bin", 0x10001, 0x8000, CRC(e3072bf8) SHA1(74eec72e190f682cfd5ae5425ebdc854e0ba7bc9), ROM_SKIP(1) | ROM_BIOS(0) ) + // 1: BIOS-String: EC&T-1131-092588-K0 + ROM_SYSTEM_BIOS( 1, "092588", "092588") + ROMX_LOAD( "ami_1131_bios_l.bin", 0x10000, 0x8000, CRC(145c3905) SHA1(9ee2615982e28082971bae8ef8a1f936313ac8c8), ROM_SKIP(1) | ROM_BIOS(1) ) + ROMX_LOAD( "ami_1131_bios_h.bin", 0x10001, 0x8000, CRC(73d57778) SHA1(176c90134540d5054c99c077126c7c5a65199175), ROM_SKIP(1) | ROM_BIOS(1) ) ROM_END // SY-012 16/25 386MB VER: 5.2 - Chipset: Chips P82C301C; P82A306; P82A303; P82C206; P82A304; P82C302; P82B305 @@ -2826,7 +2927,7 @@ ROM_START( ht18c ) ROM_END -// ***** 386 Motherboards using the Macronix MX83C305(A)(FC), MX83C05(A)(FC) chipset +// ***** 386 Motherboards using the Macronix MX83C305(A)(FC), MX83C06(A)(FC) chipset // TAM/33/40-MA0 (CM318R00,M31-R00) - Chipset: MX83C305, MX83C306 - CPU: AMD Am386DX-40 - ISA16:8 // OSC: 80.000MHz - 14.31818 - BIOS: AMI 386 BIOS PLUS S/N OA2050592 - BIOS-String: 31-0100-001105-00101111-121291-MXIC-0 - 386DX/Cx486DLX TAM/33,30-MA0/MA01, 09/10/1992 @@ -2873,7 +2974,8 @@ ROM_START( op82c283 ) // Keyboard-BIOS: AMI KB-BIOS-VER-F (Intel P8942AHP) - CPU: AM386 SX/SXL-25 - OSC: 14.31818MHz, 50.000MHz - ISA8: 2, ISA16: 6 ROM_SYSTEM_BIOS( 1, "3805", "386sx 3805" ) ROMX_LOAD( "386sx-opti-908380.bin", 0x10000, 0x10000, CRC(38502567) SHA1(d65d272aa60642197c9b639a8679f8f41c4a697b), ROM_BIOS(1)) - // 2: CPU: 386SX-20 - BIOS: AMI; 03/15/91 - no display + // 2: CPU: 386SX-20 - BIOS: AMI; 03/15/91 - no display - unknown ASI motherboard + // BIOS-String: 30-0100-DG1112-00101111-031591-OPSX ROM_SYSTEM_BIOS( 2, "c28301", "OPTi 82C283 #1") ROMX_LOAD( "3opm010.bin", 0x10000, 0x10000, CRC(7c2acf57) SHA1(d40605621da40204dc6370d2d00b783b3a7f8dce), ROM_BIOS(2)) ROM_END @@ -2969,8 +3071,14 @@ ROM_END ROM_START( op386wb ) ROM_REGION32_LE(0x20000, "bios", 0) // OPTi 386WB VER.1.0 - OSC: 66.6670MHz, 50.000MHz, 14,31818 - ISA8: 1, ISA16: 7 - // BIOS: 1006229 - BIOS-String: 30-0201-D41107-00101111-050591-OPWB-0 - Keyboard-BIOS: Intel P8942AHP - ROM_LOAD( "386-opti-386wb-10.bin", 0x10000, 0x10000, CRC(1a5dd6b2) SHA1(9e6b556bfdf21d6f3cba6a05a3092887a71a24a8)) + // BIOS: 1006229 - Keyboard-BIOS: Intel P8942AHP + // 0: BIOS-String: 30-0201-D41107-00101111-050591-OPWB-0 + ROM_SYSTEM_BIOS( 0, "1006229", "1006220") + ROMX_LOAD( "386-opti-386wb-10.bin", 0x10000, 0x10000, CRC(1a5dd6b2) SHA1(9e6b556bfdf21d6f3cba6a05a3092887a71a24a8), ROM_BIOS(0)) + // 1: BIOS-String: 30-0201-D41107-00101111-050591-OPWB-0 + ROM_SYSTEM_BIOS( 1, "d41107", "D41107") + ROMX_LOAD( "ami_d41107.bin", 0x10000, 0x10000, CRC(2b6cc50d) SHA1(69f69e0295abf5e331fdf01dc8e6b1c0c6591992), ROM_BIOS(1)) + ROM_END // Shuttle HOT-307H - BIOS-String: 30-0100-DK1343-00101111-070791-OPWB3/B-0 - CPU: 386DX - Chipset: OPTi 82C391 B2, 82C392 B - BIOS: AMI; 07/07/91; AA 0571504 @@ -3074,6 +3182,15 @@ ROM_START( chn333sc ) ROM_LOAD( "bios.bin", 0x10000, 0x10000, CRC(f8b2b0bc) SHA1(2799cce621b93bf38b04deeb419d25a73f7416f4)) ROM_END +// Octek Jaguar II - Chipset: SiS 85C330, 85C320, 85C206, 85C310 - CPU: i386-33, FPU: i387-33 - RAM: 8xSIMM30, Cache: 8xIS61C64-25N +// BIOS: AMI - Keyboard-BIOS: AMI KB-BIOS-VER-F - ISA8: 2, ISA16: 5, ISA16/Memory: 1 - OSC: 66.000MHz, 14.31818 +// BIOS-String: 30-0100-006069-00101111-020291-SISC / 0033P-002 +ROM_START( ocjagii ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "ami_386_zz457511.bin", 0x10000, 0x10000, CRC(b5bc6a9a) SHA1(b74f592dd3bcd2978ed7d895d483f83413e0f8d5)) +ROM_END + + ROM_START( sisrabb ) ROM_REGION32_LE(0x20000, "bios", 0) // BIOS-String: 30-0000-D01128-00101111-070791-SISD-0 @@ -3089,11 +3206,14 @@ ROM_START( 386sc ) // CPU: unreadable, FPU: Cyrix 387DX-25 - OSC: 40.000MHz, 14. ROM_LOAD( "386_sc_symphony.bin", 0x10000, 0x10000, CRC(fabe369c) SHA1(211ff63dd874c273135d1427db3562d752c2bade)) ROM_END -// BIOS-String: 20-0200-DF1121-00101111-102591-SYM_386B-0 / 386DX/SX (S1A.P) - // ROM_SYSTEM_BIOS(4, "386sc2c", "386-SC-2C") // Chipset: SYMPHONY SL82C362, SL82C461, SL82C465 ROM_START( 386sc2c ) ROM_REGION32_LE(0x20000, "bios", 0) - ROM_LOAD( "386-sc-2c_ami_za492668.bin", 0x10000, 0x10000, CRC(b408eeb7) SHA1(cf1974492119e1aae623fa366d5760343e827e52)) + // 0: BIOS-String: 20-0200-DF1121-00101111-102591-SYM_386B-0 / 386DX/SX (S1A.P) + ROM_SYSTEM_BIOS(0, "s1a", "S1A.P") // Chipset: SYMPHONY SL82C362, SL82C461, SL82C465 + ROMX_LOAD( "386-sc-2c_ami_za492668.bin", 0x10000, 0x10000, CRC(b408eeb7) SHA1(cf1974492119e1aae623fa366d5760343e827e52), ROM_BIOS(0)) + // 1: BIOS-String: 20-0200-DF1121-00001111-102591-SYM_386B-0 / 386SX/DX (S1B) + ROM_SYSTEM_BIOS(1, "s1b", "S1B") + ROMX_LOAD( "ami_386_za590821.bin", 0x10000, 0x10000, CRC(51a4c231) SHA1(4ad65408f2a401ff262934f886937a2615c08e21), ROM_BIOS(1)) ROM_END @@ -3162,7 +3282,7 @@ ROM_START( mb133340 ) ROM_END -// ***** motherboards using the UMC UM82C481AF, UM82C482A/B/F, 82C206F chipset +// ***** 386 motherboards using the UMC UM82C481AF, UM82C482A/B/F, 82C206F chipset // QD-U386DX VER 1.0 - CPU/FPU: i386DX-33, IIT 3C87-33 - ISA8:2, ISA16: 5 - BIOS: AMI 386DX ISA BIOS (AA0119183) // BIOS-String: 30-0200-428003-10101111-070791-UMC480A-F @@ -3178,6 +3298,14 @@ ROM_START( isa386u30 ) ROM_LOAD( "386-isa-386u30.bin", 0x10000, 0x10000, CRC(6d45a044) SHA1(63c06568f9db5ce12dc8dd0fb1ad1009a9fb24f6)) ROM_END +// Chicony CH-486-33C REV 1.0 - Chipset: UMC UM82C481, UM82C482, Chips P82C206 - CPU: Intel Overdrive DX2ODPR66, FPU socket provided +// RAM: 16xSIMM30, Cache: 8xW24256AK-25, P4C188-20PC - BIOS: AMI - Keyboard-BIOS: Intel/AMI +// BIOS-String: 40-0300-ZZ1116-00101111-031591-UMCWB-F - OSC: 33.000MHz - ISA8: 2, ISA16: 5 +ROM_START( ch48633c ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "ch-486-33c_ami_bios_z944944_am27.bin", 0x10000, 0x10000, CRC(1ca9bf11) SHA1(bb5fb4c7544e2ccb06d423ef4da0729a6bf8b231)) +ROM_END + // Elitegroup FX-3000 REV:1.0 - Chipset: UMC UM82C481BF, UM82C482AF, UM82C206F - ISA16: 6 ROM_START( ecsfx3000 ) ROM_REGION32_LE(0x20000, "bios", 0) @@ -3196,6 +3324,8 @@ ROM_START( um82c481af ) ROMX_LOAD( "3umr001.bin", 0x10000, 0x10000, CRC(466a115e) SHA1(077d797c653528062f1c87b03c608427c35c5505), ROM_BIOS(0)) // 1: BIOS-String: 40-0100-001266-00101111-121291-UMCAUTO-0 - 3DIUD-1.2 // Chipset: // UMC UM92C206F, UM82C482AF, UM82C481BF - MB manufacturer according to BIOS is Modula Tech Co + // ISA8: 1, ISA16: 6 - RAM: 8xSIMM30, Cache: 9x28pin, used: 4xIS61C256AH-20N, 1xW2465AK-20, CPU: AMD 386DX-40 + // CPU and FPU sockets provided - BIOS: AMI 386 BIOS, Keyboard-BIOS: AMI ROM_SYSTEM_BIOS(1, "3diud", "386 UMC 3DIUD") ROMX_LOAD( "386-umc-3flud.bin", 0x10000, 0x10000, CRC(2e795a01) SHA1(02e9e2871c1c1a542f44ab5eef66aee4b04225c1), ROM_BIOS(1)) ROM_END @@ -3205,6 +3335,32 @@ ROM_END // 80386 SX and DX Desktop //************************************************************************** +// Atari PC 5 - American Megatrends 386XT Series-4 motherboard - on board EGA +// screen remains blank, 1 beep repeated (DRAM refresh failure) +ROM_START( ataripc5 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD32_BYTE("ami_pc5_1.00_rom0.bin", 0x00000, 0x8000, CRC(496149a6) SHA1(81033b22af830af8306abfde03a194739fe54355)) + ROM_LOAD32_BYTE("ami_pc5_1.00_rom1.bin", 0x00001, 0x8000, CRC(3c82fe66) SHA1(dd6c2c3c3635761b1d928912269b8937cbdc09ae)) + ROM_LOAD32_BYTE("ami_pc5_1.00_rom2.bin", 0x00002, 0x8000, CRC(7dc5b53b) SHA1(33e138baa84a8acc629bde5a6b54e47d0d4508f1)) + ROM_LOAD32_BYTE("ami_pc5_1.00_rom3.bin", 0x00003, 0x8000, CRC(b588b7a8) SHA1(2f2597b14e54d03cf957cce47536266f68d3aa66)) +ROM_END + +// Datavan Book-Size LAN Station - CPU: Am386SX/SXL-25 - Chipset: Headland HT18/C, RAM: 4xSIMM30 +// BIOS: AMI 386SX BIOS PLUS S/NO. 232659 - Keyboard-BIOS: AMI KEYBOARD BIOS PLUS S/NO. 232659 +// BIOS-String: 30-0100-ZZ1612-00101111-070791-HT18-F - ISA16: 1, used for LAN board - on board: 2xser, par, VGA +// Video: Realtek RTG3106 VGA, 1024K, MUSIC TR9C1710-66PCA - VGA BIOS: REALTEK / QUADTEL +// Mass storage: NEC FD1138H, Quantum ProDrive ELS 977/10/17 - unknown DP8390DN based 8bit ISA LAN card +ROM_START( dvbslan ) // 3 short beeps => base memory read/write test error in the first 64 KB block of memory + ROM_REGION16_LE( 0x20000, "bios", 0) + ROM_LOAD( "ami_bios_386sx_bios_plus.bin", 0x10000, 0x10000, CRC(760afd89) SHA1(452f3e1b8b3b3d00df90c3501c8796de447a2184)) + + ROM_REGION( 0x8000, "vga", 0) // REALTEK VGA BIOS + ROM_LOAD( "realtek_vga.bin", 0x0000, 0x8000, CRC(4e416975) SHA1(826b7ec5494dc83cfcf25922185777bf6db46949)) + + ROM_REGION( 0x2000, "lan", 0) // boot ROM from DP8390DN based LAN adapter + ROM_LOAD( "net_isa_boot.bin", 0x0000, 0x2000, CRC(5bb527fd) SHA1(1eb7c82ef99d64eedffc3ac9c145d33b06cd8cb6)) +ROM_END + // Epson PC AX3 - see epsax ROM_START( epsax3 ) ROM_REGION16_LE( 0x20000, "bios", 0) @@ -3224,16 +3380,17 @@ ROM_START( mbc18nb ) ROM_END // Siemens-Nixdorf PCD-3Nsx notebook -// Intel NG680386SX-16, DP8473V, CHIPS F82C601, DS??87, unknown QFP100, ADC0833BCN (on PCU sub) -// Microcontrollers: N8042AH (KBC), N80C51BH (KBE) +// CPU: Intel NG680386SX-16 or -20 - 1MB RAM,upgradeable to 5MB, 40MB harddisk (-16 model) +// 2MB, upgradeable to 8MB, 80MB harddisk (-20 model), 9" mono VGA LCD, 1.44MB floppy drive +// Chipset: Headland HT21/E, , DP8473V, CHIPS F82C601, DS??87, unknown QFP100, ADC0833BCN (on PCU sub), CL-GD610-320C-C+CL-GD620-C +// Microcontrollers: N8042AH (KBC), N80C51RH (KBE) +// OSC: 14.318, 32.00024.0090 ROM_START( pcd3nsx ) ROM_REGION16_LE( 0x20000, "bios", 0 ) - // Phoenix 80386 ROM BIOS PLUS Version 1.10.00 - failure at 100000-10FFFF - Resume memory backup failure - ROM_SYSTEM_BIOS(0, "pcd3nsxno1", "pcd3nsxno1") - ROMX_LOAD( "3n102l30.bin", 0x00000, 0x20000, CRC(02384c19) SHA1(552dc41b40272027e2b031187f8ab1e1513751b9), ROM_BIOS(0) ) - // Phoenix 80386 ROM BIOS PLUS Version 1.10.00 - Memory high address failure at 100000-10FFFF - Resume memory backup failure - ROM_SYSTEM_BIOS(1, "pcd3nsxno2", "pcd3nsxno2") - ROMX_LOAD( "3n120l40.bin", 0x00000, 0x20000, CRC(1336dd75) SHA1(80306d85f417c51a5235ac2f02ceb58bdb51205f), ROM_BIOS(1) ) + ROM_LOAD( "337-7_2400_3f_10-15-91.bin", 0x00000, 0x20000, CRC(99befce7) SHA1(150cd6a1476ca0ea970a1103b2a2c668c984433a) ) + + ROM_REGION( 0x1000, "mcu", 0 ) + ROM_LOAD("33b_pcu_rev_3r.bin", 0x0000, 0x1000, CRC(d99308ec) SHA1(26621db2db37ab2bd1da972abb7398f9514329b2) ) ROM_REGION( 0x800, "kbc", 0 ) ROM_LOAD("kbc_c3f.bin", 0x000, 0x800, NO_DUMP) @@ -3242,6 +3399,19 @@ ROM_START( pcd3nsx ) ROM_LOAD("kbe_e3d.bin", 0x0000, 0x1000, NO_DUMP) ROM_END +// Siemens-Nixdorf PCD-3Nsl - CPU: 80386SL@25MHz - 2MB RAM, upgradeable to 8MB - 85MB harddisk - 10" mono LCD VGA +// 1.44MB floppy drive +ROM_START( pcd3nsl ) + ROM_REGION16_LE( 0x20000, "bios", 0 ) + // Phoenix 80386 ROM BIOS PLUS Version 1.10.00 - failure at 100000-10FFFF - Resume memory backup failure + ROM_SYSTEM_BIOS(0, "05-13-93", "05/13/93") + ROMX_LOAD( "3n102l30.bin", 0x00000, 0x20000, CRC(02384c19) SHA1(552dc41b40272027e2b031187f8ab1e1513751b9), ROM_BIOS(0) ) + // Phoenix 80386 ROM BIOS PLUS Version 1.10.00 - Memory high address failure at 100000-10FFFF - Resume memory backup failure + ROM_SYSTEM_BIOS(1, "01-26-94", "01/26/94") + ROMX_LOAD( "3n120l40.bin", 0x00000, 0x20000, CRC(1336dd75) SHA1(80306d85f417c51a5235ac2f02ceb58bdb51205f), ROM_BIOS(1) ) +ROM_END + + // Toshiba T2000SX // 1MB RAM on board, up to 9MB with 2MB, 4MB or 8MB expansion cards - 16 level grayscale VGA 640x480 display, PVGA1F display controller, 256KB VRAM // Super integration (SI), components: DMAC 82C37Ax2, PIC 82C59Ax2, PIT 82C54, FDC TC8565, SIO TC8570 - 80C42 and 80C50 for keyboard - RTC 146818AF @@ -3279,6 +3449,9 @@ ROM_END //************************************************************************** // 80486 BIOS +// +// BIOS files that show "original.tmp" near the beginning are compressed +// and can be unpacked using, e.g., 7-ZIP. //************************************************************************** ROM_START( at486 ) @@ -3326,13 +3499,13 @@ ROM_START( at486 ) // 9: BIOS-String: 06/27/95-VT82C505-2A4L4000-00 / Version 5.15S - Chipset: S3 Trio64, FDC 37665GT, VT82C496G, VT82C406MV ROM_SYSTEM_BIOS(9, "ficgpak2", "FIC 486-PAK-2 5.15S") /* includes Phoenix S3 TRIO64 Enhanced VGA BIOS 1.4-01 */ ROMX_LOAD( "515sbd8a.awd", 0x00000, 0x20000, CRC(778247e1) SHA1(07d8f0f2464abf507be1e8dfa06cd88737782411), ROM_BIOS(9)) - // 10: runs into Award BootBlock BIOS - Chipset: VIA VT82C505, VT82C416, VT82C496G, Winbond W83787F + // 10: BIOS-String: 04/01/96-VT496G-2A4L6F0IC-00 0000C-00 - runs into Award BootBlock BIOS - Chipset: VIA VT82C505, VT82C416, VT82C496G, Winbond W83787F ROM_SYSTEM_BIOS(10, "ficpio3g7", "FIC 486-PIO-3 1.15G705") // pnp - ISA16: 4, PCI: 3 ROMX_LOAD( "115g705.awd", 0x00000, 0x20000, CRC(ddb1544a) SHA1(d165c9ecdc9397789abddfe0fef69fdf954fa41b), ROM_BIOS(10)) - // 11: runs into Award BootBlock BIOS + // 11: BIOS-String: 04/01/96-VT496G-2A4L6F0IC-00 0000C-00 - runs into Award BootBlock BIOS ROM_SYSTEM_BIOS(11, "ficpio3g1", "FIC 486-PIO-3 1.15G105") /* non-pnp */ ROMX_LOAD( "115g105.awd", 0x00000, 0x20000, CRC(b327eb83) SHA1(9e1ff53e07ca035d8d43951bac345fec7131678d), ROM_BIOS(11)) - // 12: runs into Award BootBlock BIOS + // 12: BIOS-String: 11/27/96-VT496G-2A4L6F0IC-00 0000C-00 - runs into Award BootBlock BIOS ROM_SYSTEM_BIOS(12, "ficpos", "FIC 486-POS") ROMX_LOAD( "116di6b7.bin", 0x00000, 0x20000, CRC(d1d84616) SHA1(2f2b27ce100cf784260d8e155b48db8cfbc63285), ROM_BIOS(12)) // 13: BIOS-String: 06/27/95-VT82C505-2A4L4000-00 / Version 5.15 / Chipset: VIA VT82C496G PC/AT @@ -3369,18 +3542,125 @@ ROM_START( at486 ) ROMX_LOAD("486-cam.bin", 0x10000, 0x10000, CRC(d36a13ea) SHA1(14db51dbcf8decf1cb333c57a36971ef578c89b4), ROM_BIOS(21)) // 22: 486-PIO3 1.1 - Chipset: Winbond W83787F, VIA VT82C505, VT82C416, VT82C496G - ISA16: 4, PCI:3 - BIOS: AWARD F 4825803 1.14G705 (32pin) - CPU: Socket 3 // RAM: 2xSIMM72, Cache: 9 sockets marked SRAM 128Kx8 (2 banks +1) - On board: 2xIDE, Floppy, par, 2xser - ROM_SYSTEM_BIOS(22, "pio3", "486-PIO-3") // runs into BootBlock BIOS + // BIOS-String: 02/01/96-VT496G-2A4L6F0IC-00 0000C-00 . runs into BootBlock BIOS + ROM_SYSTEM_BIOS(22, "pio3", "486-PIO-3") ROMX_LOAD("486-pio3.bin", 0x00000, 0x20000, CRC(1edb5600) SHA1(36887cd08881dfa063b37c7c11a6b65c443bd741), ROM_BIOS(22)) - // 34: 486 G486IP IMS - Chipset: IMS 8848 IMS 8849 - CPU: i486DX2-66 - BIOS: AMI 486DX ISA BIOS AB5870352 - Keyboard-BIOS: MEGAKEY (AMI/Intel) - ISA8: 1, ISA16: 4, PCI: 3 + // 23: 486 G486IP IMS - Chipset: IMS 8848 IMS 8849 - CPU: i486DX2-66 - BIOS: AMI 486DX ISA BIOS AB5870352 - Keyboard-BIOS: MEGAKEY (AMI/Intel) - ISA8: 1, ISA16: 4, PCI: 3 // RAM: SIMM30: 4, SIMM72: 2, Cache: 10 sockets (UM61256AK-15) - BIOS-String: 41-0000-ZZ1124-00101111-060692-IMS8849-0 / PCI BIOS, Dated JUN-16-94 / FOR G486IP ROM_SYSTEM_BIOS(23, "g486ip", "G486IP") ROMX_LOAD("g486ip_ims.bin", 0x00000, 0x20000, CRC(4431794a) SHA1(f70e8c326455229c3bb7f305c2f51c4ac11979ed), ROM_BIOS(23)) + // 24: EFA 486 UPIO + // BIOS-String: 11/09/95-UMC-881/886A-2A4X5E39C-00 00 / N486U-PIO/A, Rev 1.03 ROM - NOT FOR SALE - boots into BootBlock BIOS + ROM_SYSTEM_BIOS(24, "486upio", "486 UPIO") + ROMX_LOAD("upio_103.bin", 0x00000, 0x20000, CRC(4e9139cd) SHA1(f2b00356957c712ca652c3751b31161b3110ec69), ROM_BIOS(24)) + // 25: Acer 486 Version 2.2 - Chipset: ALi M1429, M1431 - CPU: 486 - RAM: SIMM30x8 + // screen remains blank + ROM_SYSTEM_BIOS(25, "acer48622", "Acer 486 V2.2.") + ROMX_LOAD("4alm002.bin", 0x10000, 0x10000, CRC(88291af2) SHA1(7ff912e9f0550631377d1a4c3aa266a081e7dce9), ROM_BIOS(25)) + // 26: ACR6BE00-M00-940720-R01-E0 / BIOS V2.0 - Keyboard Interface Error, Pointing DeviceInterface Error + ROM_SYSTEM_BIOS(26, "4alo001", "4ALO001") + ROMX_LOAD("4alo001.bin", 0x00000, 0x20000, CRC(4afb9c50) SHA1(5e56682ba1e04bd0b074de3b2a93fb5322325d01), ROM_BIOS(26)) + // 27: dies after initialising the graphics card + ROM_SYSTEM_BIOS(27, "4alp001", "4ALP001") + ROMX_LOAD("4alp001.bin", 0x10000, 0x10000, CRC(9b4a2881) SHA1(f324bb0304164e9ede1dd2eebb085a76aae398be), ROM_BIOS(27)) + // 28: BIOS-String: 30-0500-ZZ1130-00101111-070791-1219-0 + ROM_SYSTEM_BIOS(28, "zz1130", "ZZ1130") + ROMX_LOAD("4zzw001.bin", 0x10000, 0x10000, CRC(dc21c952) SHA1(affdc4efbca4dad561e4f0141463844ec84ae519), ROM_BIOS(28)) + // 29: screen remains blank + ROM_SYSTEM_BIOS(29, "optimus", "Optimus") + ROMX_LOAD("mb_bios_ami_930808.bin", 0x10000, 0x10000, CRC(89151d5b) SHA1(92a93cae054525adfdc6277a1236e699ea9fbc32), ROM_BIOS(29)) + // 30: 40-0100-DG1112-00101111-070791-UMC480A / Rev. 251191 UMC-486A - ASI board + // The BIOS comes from http://www.elhvb.com/supportbios.info/Archives/BIOS/0-A/ASI/UMC-486A/index.html and contains 28 extra plain textattr + // bytes at the end of the file. These have been lopped off, but the emulated machine complains about a ROM error, thus marked BAD_DUMP + ROM_SYSTEM_BIOS(30, "umc486a", "UMC-486A") + ROMX_LOAD("umc481icorr.ami", 0x10000, 0x10000, BAD_DUMP CRC(d27b2fd4) SHA1(e639dbc7d65b29ffca26701af766fa75bfe33787), ROM_BIOS(30)) + // 31: 40-0201-D41107-00101111-031591-OPBC-0 + ROM_SYSTEM_BIOS(31, "a9c11f1f", "a9c11f1f") + ROMX_LOAD("ami_486_zz686886.bin", 0x10000, 0x10000, CRC(a9c11f1f) SHA1(2a27ecae9547ddd3d230c30a94deb83a4d6b4436), ROM_BIOS(31)) + //32: Award Modular BIOS v4.20 / Version 1.09K + ROM_SYSTEM_BIOS(32, "109k", "1.09K") + ROMX_LOAD("award_486dx_0097042.bin", 0x10000, 0x10000, CRC(b620534b) SHA1(d3777a82cb35639d386a1840dd5cf52527ec6f8b), ROM_BIOS(32)) ROM_END //************************************************************************** // 80486 motherboard -//************************************************************************** +//************************************************************************// + + +// AMI 80486 EISA Enterprise-II - Chipset: AMI/Intel 82357 - RAM: 8xSIMM30 (32MB max), 128K cache memory - CPU: i486DX 25/33, Weitek WTL4167 FPU socket provided +// on board: Floppy, PS/2 mouse, memory card socket, i/o expansion module slot - EISA: 8 +// BIOS-String: 41-0001-004616-00111111-070791-AMI-EP-0 - EISA CMOS INOPERATIONAL / Software Port NMI INOPERATIONAL / Fail-safe Timer NMI INOPERATIONAL / Keyboard error +ROM_START( amient2 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "16092391.cs1", 0x00000, 0x20000, CRC(b0ae5c8d) SHA1(0d6cda74433a5d70e8fc2bec6a77ed97a09a984e)) +ROM_END + +// AMI Enterprise-III EISA Local Bus Series 68 - CPU: i486SX/DX/DX2 25/33/50/66MHz - RAM: 16xSIMM32 (up to 256MB RAM!!!), Cache 256K +// EISA: 6, EISA/VL: 2 - BIOS: Flash - repeated short single beeps (DRAM refresh error) +// BIOS-String: 41-0103-004668-00111111-111192-AMIS68 +ROM_START( amient3 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "s68p.rom", 0x00000, 0x20000, CRC(7342b9ef) SHA1(da6b2312ccc175473443b1d562d5e4f3952cac5a)) +ROM_END + +// AMI ENTERPRISE-IV EISA VLB - CPU: 486SX/486SX/486DX/DX2/Pentium overdrive 25/33/50/66 MHz - RAM: 4xSIMM72 (256MB), Cache: 256KB +// EISA: 5, EISA/VL: 2 - on board: floppy, IDE, par, 2xser - screen remains blank +// BIOS-String: 41-0103-004687-00111111-111192-AMIS87 +ROM_START( amient4 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "s87p.rom", 0x00000, 0x20000, CRC(ff092e7f) SHA1(4999278dca001de74dff518f1f1c9ea8212d7ed4)) +ROM_END + +// AMI Super Voyager PCI-II - Chipset: AMI, SMC - CPU: 486DX/DX2/DX4 - RAM: 4xSIMM72 (64MB), Cache: 5x32pin, 4x28pin+TAG (127/256K) +// BIOS: Flash - Keyboard-BIOS: AMIKEY - ISA16: 4, PCI: 3 - on board: Floppy, 2xIDE, 2xer, par - screen remains blank +ROM_START( amisvpci2 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "s724p.rom", 0x00000, 0x20000, CRC(fa9ea9b3) SHA1(b0f2206a7f0d6a00e094f7d151c16022a5292858)) +ROM_END + +// AMI Super Voyager VLB - screen remains blank +// BIOS-String: 40-0103-004669-00111111-111192-AMIS69B2 +ROM_START( amisvvlb ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "s69b2p.rom", 0x00000, 0x20000, CRC(3a13944c) SHA1(9d7733ee50023edd5b0bf4b098c9c6c35a4dc2b0)) +ROM_END + +// AMI Super Voyager VLB-II - AMI Super Voyager VLB-II - CPU: 486/Overdrive - Chipset: AMI, SMC FDC37C665GT +// RAM: 4xSIMM72, Cache: 8x28pin + TAG - ISA16: 5, ISA16/VL: 2 - BIOS: 28pin in a 32pin socket - on board: Floppy, IDE +// BIOS-String: 40-0100-004682-00111111-111192-AMIS82E +ROM_START( amisvvlb2 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "s82p.rom", 0x00000, 0x20000, CRC(2e2d33ae) SHA1(349be4b29bc8a4447ab4c73fe4c695276565489f)) +ROM_END + +// AMI Super Voyager VLB-III - Chipset: FDC37C665GT, AMI - CPU: 486SX, 487DX, 486DX/DX2/DX4, Overdrive +// RAM: 4xSIMM72 - on board: mouse, par, 2xser, Floppy, IDE - ISA16: 5, ISA16/VL: 2 - screen remains blank, repeated single beeps +ROM_START( amisvvlb3 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "s707p.rom", 0x00000, 0x20000, CRC(5c0e55c0) SHA1(0c5232a21180d4541202ac6dd34677339b7cbecc)) +ROM_END + +// Edom 486VL3H MV020 - CPU: 486 - Chipset: HiNT CS8005, HMC HM82C206AQ - RAM: 8xSIMM30 +// Cache: IS61C256AH-20Z (8), AE88128AK-15 - Keyboard-BIOS: JETkey V5.0 - ISA8: 2, ISA16: 3, ISA16/VLB: 3 +// BIOS-String: 09/05/94-HINT-8005-214D1W00-00 / HiNT CS8005 FOR 486SX/DX/DX2 VL-BUS [MV020] +ROM_START( ed486vl3h ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "4hiw001.bin", 0x10000, 0x10000, CRC(760842fd) SHA1(2fe156f092c84cf385079da1209a8f1e06005f5e)) +ROM_END + +// MSI MS-4134 - Chipset: ALI M1429, M1431, M1435 - CPU: Socket 3, RAM: 4xSIMM30, 2xSIMM72, Cache: 8x32pin + TAG, used: 9xW2464AK-20 +// ISA16: 3, ISA16/VL: 2, PCI: 3 - BIOS: AMI +// BIOS-String: +ROM_START( ms4134 ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: BIOS-String: 40-0105-421169-00101111-080893-1429GPCI-0 / AL57 111594 + ROM_SYSTEM_BIOS(0, "al57", "AL57") + ROMX_LOAD( "al57.rom", 0x00000, 0x20000, CRC(6b6c2a11) SHA1(1e40ef8a7a7b3be057ba6a121abfd0d983d5d5c9), ROM_BIOS(0)) + // 1: BIOS-String: 40-0105-421169-00101111-0890893-1429GPCI-0 / AL51 5/23/1994 + ROM_SYSTEM_BIOS(1, "al51", "AL51") + ROMX_LOAD( "4alm001.bin", 0x00000, 0x20000, CRC(0ea9f232) SHA1(5af1a0cf047b68a7070b8c45081a80e817aade84), ROM_BIOS(1)) +ROM_END // Abit 486 EISA-AE4 - Chipset: SiS 85C406, 85C411, three other SiS chips unreadable - CPU: 486, FPU socket provided - RAM: 8xSIMM30, Cache: 8x28pin // ISA16: 2, EISA: 6 - BIOS: Award EISA486/CU - Keyboard-BIOS: NEC KB-BIOS VER:400 JU-JET 1989 - OSC: 50.000MHz, 14.31818MHz @@ -3407,28 +3687,12 @@ ROM_START( gc10a ) ROM_END // Arstoria AS496 - Chipset: SiS 85C495, 95C497, Winbond - CPU: Socket 3 - RAM: SIMM72x4, Cache: 4+1 - BIOS: 32pin Keyboard-BIOS: BESTKEY - ISA16: 4, PCI: 3 -ROM_START( as496 ) // lands in Boot Block BIOS +// BIOS-String: 09/12/96-SiS-496-497/A/B-2A4IBR2CC-00 / ARSTORIA AS496 V2 09/12/96 - boots to Boot Block BIOS +ROM_START( as496 ) ROM_REGION32_LE(0x20000, "bios", 0) ROM_LOAD( "as496.bin", 0x00000, 0x20000, CRC(745f8cc8) SHA1(46b9be25a7027a879482a412c9fe5687bbb28f08)) ROM_END -// Octek Hippo DCA2 - Chipset: OPTi 802G - BIOS: 28pin - CPU: Socket 3 - ISA8: 2, ISA16: 3, ISA16/VL: 3 - RAM: 4xSIMM72, Octek claimed, Cache would be taken out of main RAM -ROM_START( ochipdca2 ) - ROM_REGION32_LE(0x20000, "bios", 0) - // 0: BIOS-String: 10/27/94-OPTI-802G-2C4UKO01-00 / (2C4UKO01) EVALUATION ROM - NOT FOR SALE - ROM_SYSTEM_BIOS(0, "hv2433", "AWARD HV2433") - ROMX_LOAD( "hv2433.awa", 0x10000, 0x10000, CRC(d6179601) SHA1(8a9c7ec959f6626268e0e242760439272fc9e28c), ROM_BIOS(0)) - // 1: beep code - ROM_SYSTEM_BIOS(1, "h2433", "AMI H2433") - ROMX_LOAD( "h2433.ami", 0x10000, 0x10000, CRC(a646a191) SHA1(086ae94554e3c2b292f2e32b5cb080c15dfa3e0b), ROM_BIOS(1)) - // 2: beep code L-H-H-L - ROM_SYSTEM_BIOS(2, "mr321", "MR-BIOS 3.21") // supports AMD X5-133 - ROMX_LOAD( "095061.bin", 0x10000, 0x10000, CRC(0a58cab2) SHA1(e64d6ca0bad6eeed492260853d7d60cd2a60a222), ROM_BIOS(2)) - // 3: beep code L-H-H-L - ROM_SYSTEM_BIOS(3, "mr31", "MR-BIOS 3.1") - ROMX_LOAD( "dca2mr31.rom", 0x10000, 0x10000, CRC(43b7415f) SHA1(45df892d146b8e2594274773c93d1623207b40fc), ROM_BIOS(3)) -ROM_END - // Peacock PCK 486 DX DOC 50-60064-00 - Chipset: Symphony SL82C465 SL82C461 SL82C362 Chips F82C721 - CPU: i486DX-33, FPU socket privoded // BIOS: AMI 486DX ISA BIOS AA3364567 - Keyboard-BIOS: AMI/Intel P8942AHP - On board: 2xser, Floppy, IDE, par - OSC: 33.000MHz // BIOS-String: 40-0100-806294-00101111-060692-SYMP-0 / Peacock Computer 486 BIOS Rev. 2.0 / 30.11.92 - ISA16: 6 @@ -3444,13 +3708,6 @@ ROM_START( gete486vl ) ROM_LOAD( "486-genoa_vlb.bin", 0x10000, 0x10000, CRC(9be0f329) SHA1(3b1adedd6aad40c623757e4976e0dcadb253f255)) ROM_END -// UNICHIP 486 WB 4407 REV 1.0 - Chipset: KS83C206Q UNICHIP U4800-VLX - BIOS: AMI 486 ISA BIOS AA6562949, 28pin - Keyboard-BIOS: AMI 2050778 -// BIOS-String: 40-0200-001107-0010111-111192-U4800VLX-0 / 4407 UNICHIP BIOS VER 1.0 - OSC: 14.31818 - ISA16: 4, ISA16/VL: 3 -ROM_START( uniwb4407 ) - ROM_REGION32_LE(0x20000, "bios", 0) - ROM_LOAD( "unichip_486_wb_4407.bin", 0x10000, 0x10000, CRC(91237686) SHA1(7db14451cc3e00a2273a453152a817bccbdfb10e)) -ROM_END - // ASUS ISA-486SV2 - Chipset: SiS 85C461 - BIOS: AMI 486DX ISA BIOS AA7892378 28pin - Keyboard-BIOS: Intel/AMI // BIOS-String: 40-110A-001292-00101111-111192-I486SI-0 - ISA16: 5, ISA16/VL: 2 - CPU: 486DX in a blue socket (overdrive ready) ROM_START( a486sv2 ) @@ -3496,7 +3753,6 @@ ROM_END // Vintage Sprite SM 486-50USC - Chipset: UM82C491F - BIOS: EPROM/MR-BIOS 1.50 - Keyboard-BIOS: JETkey V3.0 // CPU: Intel 486DX2-66 - OSC: 33.333000MHz, 14.31818MHz - ISA16: 5, ISA16/VL: 2 - ROM_START( sm48650usc ) // constant reset ROM_REGION32_LE(0x20000, "bios", 0) ROM_LOAD( "mrbios_1150usc_um82c491f.bin", 0x10000, 0x10000, CRC(b6ef1220) SHA1(94511df49713ec30467c8d9b18eb04e83fa7a809)) @@ -3621,14 +3877,43 @@ ROM_END // ISA16: 3, PCI: 3, PISA: 1 - OSC: 14.3F5P - CPU: Socket 3 - BIOS: Award D2317569, 32pin ROM_START( abpb4 ) // both BIOS versions end up in the Boot Block BIOS ROM_REGION32_LE(0x20000, "bios", 0) - // 0: + // 0: BIOS-String: 10/30/95-ALI-1487/89-2A4KDA12C-5E / GREEN 486 PCI SYSTEM BIOS ROM_SYSTEM_BIOS( 0, "pb4", "PB4") ROMX_LOAD( "486-ab-pb4.bin", 0x00000, 0x20000, CRC(90884abc) SHA1(1ee11b026cb783b28cc4728ab896dbeac14eb954), ROM_BIOS(0)) - // 1: + // 1: BIOS-String: 07/03/96-ALI-1487/89-2A4KDA1BC-F2 / GREEN PCI/ISA SYSTEM ROM ROM_SYSTEM_BIOS( 1, "pb4pf2", "PB4P-F2") ROMX_LOAD( "pb4p_f2.bin", 0x00000, 0x20000, CRC(9ab8d277) SHA1(10e424f5dd5c98877a5a7c9ae6205b2c442ac0e0), ROM_BIOS(1)) ROM_END +// EFA 486 APIO all BIOS versions boot into BootBlock BIOS +ROM_START( 486apio ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: + ROM_SYSTEM_BIOS(0, "a2", "A2") + ROMX_LOAD( "apioa2.bin", 0x00000, 0x20000, CRC(0cf343be) SHA1(3a5757c802a30fb0d8d4fd623bee02af3b91fdd7), ROM_BIOS(0)) + // 1: 07/23/96-ALI-1487/89-2A4KDE3HC-00 / N486APIO Ver 2.00 SMC665GT + ROM_SYSTEM_BIOS(1, "20sm", "2.0SM") + ROMX_LOAD( "apio2smc.bin", 0x00000, 0x20000, CRC(1ced0692) SHA1(8afca17f0d793a3266b04ce8d70a359a29de3af7), ROM_BIOS(1)) + // 2: BIOS-String: 03/05/96-ALI-1487/89-2A4KDE3JC-00 / N486APIO, Rev 2.1 + ROM_SYSTEM_BIOS(2, "ag2", "AG2") + ROMX_LOAD( "1019ag2.bin", 0x00000, 0x20000, CRC(4066124e) SHA1(7adbf528d8132122da4f950ee78931abd5d949e4), ROM_BIOS(2)) +ROM_END + +// MSI MS-4145 - Chipset: ALi M1487, M1489, W83787F, W83758F - CPU: Socket 3 - RAM: 3xSIMM72 - Cache: 8x28/32pin + TAG - ISA16: 4, PCI: 3 +// BIOS: 32pin - on board: 2xIDE, Floppy, par, 2ser +ROM_START( ms4145 ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: + ROM_SYSTEM_BIOS(0, "ag56", "AG56") + ROMX_LOAD( "ag56.rom", 0x00000, 0x20000, CRC(217d7258) SHA1(bd0d484607fbcf54821822e20e4bf5fcaf456591), ROM_BIOS(0)) + // 1: + ROM_SYSTEM_BIOS(1, "ag56p", "AG56P") + ROMX_LOAD( "ag56p.rom", 0x00000, 0x20000, CRC(f2737425) SHA1(e6058a98a7ca4c03d1c1b7d30602fe97d88bc04a), ROM_BIOS(1)) + // 2: + ROM_SYSTEM_BIOS(2, "ag56s", "AG56S") + ROMX_LOAD( "ag56s.rom", 0x00000, 0x20000, CRC(c015ed49) SHA1(4c447bab1cba9d38b99c2e36e0824809e876931e), ROM_BIOS(2)) +ROM_END + // TMC Research Corporation PCI48AF - Chipset: ALi M1487, M1489, TMSIA 9347W/TC4069UBP, FDC37C665GT - CPU: Socket 3 - RAM: SIMM72x4, Cache: 4x32pin + TAG // ISA16: 4, PCI: 4 - On board: 2xISA, Floppy, 2xpar, 2xser - Keyboard-BIOS: AMIKEY-2 ROM_START( pci48af ) @@ -3636,7 +3921,7 @@ ROM_START( pci48af ) // 0: ROM_SYSTEM_BIOS(0, "af2", "AF2") ROMX_LOAD( "pci48af2.rom", 0x00000, 0x20000, CRC(556113cc) SHA1(cbbbcaa300253e766bce5292ffdfedf72c76e287), ROM_BIOS(0)) - // 1: BootBlock BIOS + // 1: 03/25/96-ALI-1487/89-2A4KDM29C-00 / 486DX-AC-WBc-25/33/40/50/66/80/100/120/133-A2-ZG - boots to BootBlock BIOS ROM_SYSTEM_BIOS(1, "afa", "AFA") ROMX_LOAD( "pci48afa.bin", 0x00000, 0x20000, CRC(9127efb5) SHA1(cf77fcca00b6e48067caefa518bedb287f945147), ROM_BIOS(1)) // 2: @@ -3719,8 +4004,48 @@ ROM_START( op82c392 ) ROM_END +// motherboards using the OPTi 82C802A, 82C602A chipset + +// Edom MV035F - Chipset: OPTi 82C802A, 82C602A - CPU: TI 486DX2-80 - RAM: 4xSIMM30, 3xSIMM72, Cache: 4x32pin, 4x28pin, TAG +// BIOS: 28pin - Keyboard-BIOS: VIA - ISA16: 5, ISA16/VL: 3 +// From the source: "The seller claimed that it POSTed, but all the BIOS options were grayed out. I pulled and dumped the BIOS +// chip, ran it through MODBIN and found out the OEM of the board simply set all BIOS setup options to 'SHOW-ONLY'. I set all +// except PCI CONFIGURATION to 'Enabled' (since this board doesn't have any PCI slots), blanked the EPROM and burned the modified +// BIOS to it, and now I can set all CMOS setup options normally." +// BIOS-String reflects the edit: 11/17/95-OPTi-802G-2C4UKW01-00 / Computer Spirit v1.0 (Hack 1.0 by Eep386 +ROM_START( edmv035f ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "mf035fed.bin", 0x10000, 0x10000, BAD_DUMP CRC(5c1ce352) SHA1(c7944b06e4a3473bb720caa5043f4b55bccf3835)) +ROM_END + +// Octek Hippo DCA2 - Chipset: OPTi 802G - BIOS: 28pin - CPU: Socket 3 - ISA8: 2, ISA16: 3, ISA16/VL: 3 - RAM: 4xSIMM72, Octek claimed, Cache would be taken out of main RAM +ROM_START( ochipdca2 ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: BIOS-String: 10/27/94-OPTI-802G-2C4UKO01-00 / (2C4UKO01) EVALUATION ROM - NOT FOR SALE + ROM_SYSTEM_BIOS(0, "hv2433", "AWARD HV2433") + ROMX_LOAD( "hv2433.awa", 0x10000, 0x10000, CRC(d6179601) SHA1(8a9c7ec959f6626268e0e242760439272fc9e28c), ROM_BIOS(0)) + // 1: beep code + ROM_SYSTEM_BIOS(1, "h2433", "AMI H2433") + ROMX_LOAD( "h2433.ami", 0x10000, 0x10000, CRC(a646a191) SHA1(086ae94554e3c2b292f2e32b5cb080c15dfa3e0b), ROM_BIOS(1)) + // 2: beep code L-H-H-L + ROM_SYSTEM_BIOS(2, "mr321", "MR-BIOS 3.21") // supports AMD X5-133 + ROMX_LOAD( "095061.bin", 0x10000, 0x10000, CRC(0a58cab2) SHA1(e64d6ca0bad6eeed492260853d7d60cd2a60a222), ROM_BIOS(2)) + // 3: beep code L-H-H-L + ROM_SYSTEM_BIOS(3, "mr31", "MR-BIOS 3.1") + ROMX_LOAD( "dca2mr31.rom", 0x10000, 0x10000, CRC(43b7415f) SHA1(45df892d146b8e2594274773c93d1623207b40fc), ROM_BIOS(3)) +ROM_END + + // Motherboards using the Opti 82C895 82C602A chipset +// ExpertChip EXP4044 - CPU: Socket3 - Chipset: OPTi 82C895, 82C602 - RAM: 4xSIMM30, 2xSIMM72, Cache: 4x28pin, 4x32pin + TAG +// Keyboard-BIOS: MEGAKEY or Winbond W83C42 - ISA16: 3, ISA16/VL: 3 +// BIOS-String: 06/23/94-OPTI-802G-2C4UKD01-00 / EXP4044 GREEN BIOS Ver 1.1 +ROM_START( exp4044 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD("4ecw001.bin", 0x10000, 0x10000, CRC(cf186fa4) SHA1(d65cc2f2c6feaa1a537319aaef86df12b44afdec)) +ROM_END + // QDI V4P895P3/SMT V5.0 - Chipset: Opti 82C895 82C602A - CPU: Am486DX2-66 - ISA8: 1, ISA16: 3, ISA16/VL: 3 // RAM: 4xSIMM30, 2xSIMM72, Cache: 8xUM61256FK-15 - BIOS: AMI 486DX ISA BIOS Ac0928698 (28pin in a 32pin socket) - Keyboard-BIOS: AMIKEY-2 ROM_START( v4p895p3 ) // no display @@ -3743,13 +4068,53 @@ ROM_END // ***** 486 motherboards using the SiS 85C496/85C497 chipset +// A-Trend ATC-1425A - Chipset: SiS 85C496, 85C497 - RAM: 4xSIMM72, Cache: 4x32pin + TAG - ISA16: 4, PCI: 3 +// on board: 2xIDE, Floppy, 2xser, par - BIOS: 32pin +ROM_START( atc1425a ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: Boot block - BIOS-String: 09/07/95-SiS-496-497/A/B-2A4IBA2HC-00 / 1425 SIS 496/7 BIOS VER : 1.8N 1995/09/25 + ROM_SYSTEM_BIOS(0, "ver18n", "ver1.8N") + ROMX_LOAD( "atc-1425a_original.bin", 0x00000, 0x20000, CRC(040ebc6c) SHA1(266ed07ef13c363234c7a2a88719badeeed9dc4c), ROM_BIOS(0)) + // 1: Boot block - BIOS-String: 11/03/95-SiS-496-497/A/B-2A4IBA2HC-00 / ATC-1425A SIS496/7 BIOS VER:2.0N 11-04-95 + ROM_SYSTEM_BIOS(1, "ver20n", "ver2.0N") + ROMX_LOAD( "atc-1425a_ver2_0n.bin", 0x00000, 0x20000, CRC(0af2f6c0) SHA1(a1ce34bdee5119b9ae1d8530fcf611ca2f9d592e), ROM_BIOS(1)) +ROM_END + // Abit AB-PI4(T) - Bios: 32pin - Keyboard-BIOS: Winbond 83C42 - CPU: Socket 3 - ISA16: 4, PCI: 3 - Chipset: SiS 85C495, 85C497 // RAM: 4xSIMM72, Cache: 9x32pin (occupied: 4xW24512AK-20, 1xW2457AK) - On board: 2xIDE -ROM_START( abpi4 ) // boots into "boot block" rescue BIOS +// BIOS-String: &09/25/95-SiS-496-497/A/B-2A4IBA11C-0B / GREEN 486 PCI SYSTEM BIOS - boots into "boot block" rescue BIOS +ROM_START( abpi4 ) ROM_REGION32_LE(0x20000, "bios", 0) ROM_LOAD( "pi4_0b.bin", 0x00000, 0x20000, CRC(2cd67f19) SHA1(4cf0b4ff10645371361d3782c8be06c463e70219)) ROM_END +// Abit AB-PM4 +// BIOS-String: 09/04/95-SiS-496-497/A/B-2A4IBA13C-0C / GREEN 486 PCI SYSTEM BIOS +ROM_START( abpm4 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "pm4_0c.bin", 0x00000, 0x20000, CRC(eaad7812) SHA1(81670c44e30fa8b8ac0aa28a5c367819ff1ca73c)) +ROM_END + +// Abit AB-PV4 +// BIOS-String: 09/26/95-SiS-496-497/A/B-2A4IBA12C-0A / GREEN 486 PCI SYSTEM BIOS +ROM_START( abpv4 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "pv4v_0a.bin", 0x00000, 0x20000, CRC(91de48d5) SHA1(2e873de152870270f51b5b2c4a30f2611364e739)) +ROM_END + +// Aopen AP43 - CPU: Socket 3 - Chipset: SiS 85C496, 85C497, SMC FDC37C665GT - RAM: SIMM72x4, Cache: 9x32pin, used: 9xUM61256FK-15 +// BIOS: 32pin - Keyboard-BIOS: AMIKEY-2 - on board: IDEx2, Floppy, par, 2xser +// constant chirping +ROM_START( aoap43 ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: + ROM_SYSTEM_BIOS(0, "original", "original") + ROMX_LOAD( "aopen_ap43_original.bin", 0x00000, 0x20000, CRC(65075fe4) SHA1(9b150e0b37b4ff3cbfcd8bd2286e1e575c34de02), ROM_BIOS(0)) + // 1: + ROM_SYSTEM_BIOS(1, "updated", "updated") + ROMX_LOAD( "aopen_ap43_updated.rom", 0x00000, 0x20000, CRC(68a5595e) SHA1(94551037e9d0b3fb644726b7ba66e676aa58b81a), ROM_BIOS(1)) +ROM_END + // ASUS PCI/I-A486S (4xSIMM72, Cache: 128/256/512KB, 1 EISA) - BIOS: 32pin // SiS 85C496/85C497 chipset; SMC 37C665 I/O; AMIKEY-2, S3 Trio 64 on board VGA, the manual also mentions Trio 32 ROM_START( aa486s ) @@ -3757,7 +4122,7 @@ ROM_START( aa486s ) // 0: BIOS-String: 05/22/95/SiS-496-497B-PCI-A486-0-00 / #401A0-0203 ROM_SYSTEM_BIOS(0, "v203", "ASUS PCI/I-A486S V2.03") ROMX_LOAD( "si4a0203.awd", 0x00000, 0x20000, CRC(95fcb7c6) SHA1(c19164d67af18c774e6eb06bd1570d95a24b2856), ROM_BIOS(0)) - // 1 boots into "boot block" rescue BIOS + // 1: BIOS-String: 11/27/95-SiS-496-497B-PI-A486SC-00 / #401A0-0304 - boots into "boot block" rescue BIOS ROM_SYSTEM_BIOS(1, "v304", "ASUS PCI/I-A486S V3.04") ROMX_LOAD( "si4a0304.awd", 0x00000, 0x20000, CRC(a00ad907) SHA1(598d97ea29f930a9359429dc540d27bfdd0fcd20), ROM_BIOS(1)) ROM_END @@ -3772,12 +4137,39 @@ ROM_START( a486sp3 ) // 1: BIOS-String: 07/22/94-SATURN-P/I-4SP3-00 / #401A0-0207 ROM_SYSTEM_BIOS(1, "v2737", "ASUS PVI-486SP3 V2.07 #2") ROMX_LOAD( "awsi2737.bin", 0x00000, 0x20000, CRC(8cd9a89c) SHA1(6c68c23cc5e8ae66261e9fe931f2ce07efe767b6), ROM_BIOS(1)) - // 2: lands in Award BootBlock BIOS V1.0 - ROM_SYSTEM_BIOS(2, "v306", "ASUA PVI-486SP3 V3.06") + // 2: BIOS-String: 06/25/96-SiS-496-497B-PVI-4SP3C-00 / #401A0-0306 - boots to Award BootBlock BIOS V1.0 + ROM_SYSTEM_BIOS(2, "v306", "ASUS PVI-486SP3 V3.06") ROMX_LOAD( "si4i0306.awd", 0x00000, 0x20000, CRC(fc70371a) SHA1(96b10cfa97c5d1d023687f01e8acb54f263069b2), ROM_BIOS(2)) - // 3: lands in Award BootBlock BIOS V1.0 - ROM_SYSTEM_BIOS(3, "v307", "ASUA PVI-486SP3 V3.07") + // 3: BIOS-String: 02/11/98-SiS-496-497B-PVI-4SP3C-00 / #401A0-0307 - boots to Award BootBlock BIOS V1.0 + ROM_SYSTEM_BIOS(3, "v307", "ASUS PVI-486SP3 V3.07") ROMX_LOAD( "si4i0307h.bin", 0x00000, 0x20000, CRC(99473cc0) SHA1(a01d253cf434a31e0ca6f6cd2b9026ca424eb463), ROM_BIOS(3)) + // 4: BIOS-String: 08/08/95-SiS-496-497B-PVI-4SP3C-00 / #401A0-0301 - boots to Award BootBlock BIOS + ROM_SYSTEM_BIOS(4, "v301", "ASUS PVI-486SP3 V3.01") + ROMX_LOAD( "4siw003.bin", 0x00000, 0x20000, CRC(47a1d815) SHA1(370bfb895646518884a2a82881721efc3aeb04d1), ROM_BIOS(4)) + // 5: BIOS-String: 11/23/94-SiS-496-497-PVI-4SP3-00 / #401A0-0101 + ROM_SYSTEM_BIOS(5, "v10101", "ASUS PVI-486SP3 V1.01 #1") + ROMX_LOAD( "0101.bin", 0x00000, 0x20000, CRC(7862ca56) SHA1(e609585893b23db10c4ae7d2abd17cc9dda964b6), ROM_BIOS(5)) + // 6: BIOS-String: 11/23/94-SiS-496-497-PVI-4SP3-00 / #401A0-0101 - screen remains blank + ROM_SYSTEM_BIOS(6, "v10102", "ASUS PVI-486SP3 V1.01 #2") + ROMX_LOAD( "si4i0101.awd", 0x00000, 0x20000, CRC(18652037) SHA1(7460e90b0a9c825d2e47943a714049fe9e943760), ROM_BIOS(6)) + // 7: BIOS-String: 07/15/95-SiS-496-497B-PVI-4SP3C-00 / #401A0-0205 - boots to Award BootBlock BIOS + ROM_SYSTEM_BIOS(7, "v205", "ASUS PVI-486SP3 V2.05") + ROMX_LOAD( "si4i0205.awd", 0x00000, 0x20000, CRC(d90d91b0) SHA1(043151d121780ff56ce32b9a48e9bbccd324625f), ROM_BIOS(7)) + // 8: BIOS-String: 04/05/96-SiS-496-497B-PVI-4SP3C-00 / #401A0-0305 - boots to Award BootBlock BIOS + ROM_SYSTEM_BIOS(8, "v305", "ASUS PCI/I-486SP3 V3.05") + ROMX_LOAD( "si4i0305.awd", 0x00000, 0x20000, CRC(2f90e63e) SHA1(a4f16753b5a57d65fba7702ca28e44f10bd5bb6c), ROM_BIOS(8)) +ROM_END + +// Chaintech 486SPM - CPU: Socket 3 - Chipset: SiS 85C497, 85C496, UMC UM8663BF - RAM: 4xSIMM72, Cache: 8xIS61C1024-10N, W24512AK-10 +// BIOS: Award E0822859 - Keyboard-BIOS: VIA VT82C42N - on board: 2xISA, Floppy, 2xser, par - ISA16: 4, PCI: 3 +ROM_START( ch486spm ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: BIOS-String: 12/21/95-SiS-496-497/A/B-2A4IBC3IC-00 + ROM_SYSTEM_BIOS(0, "original", "original") + ROMX_LOAD( "chaintech_486spm.bin", 0x00000, 0x20000, CRC(a0c9045a) SHA1(1d0b1994574437549c13541d4b65374d94c9a648), ROM_BIOS(0)) + // 1: 12/21/95-SiS-496-497/A/B-2A4IBC3IC-00 / Chaintech 486SPM v2015 PS/2 + ROM_SYSTEM_BIOS(1, "ps2", "PS2 mouse enabled") + ROMX_LOAD( "486spm-p.bin", 0x00000, 0x20000, CRC(35b5cb76) SHA1(965b212b28a5badd8d8f4769aa9edc88e47bc925), ROM_BIOS(1)) ROM_END // Freetech 486F55 - Chipset: SiS 496/497 - CPU: Socket 3 - RAM: 4xSIMM72, Cache: 128KB/256KB/512KB - ISA16: 4, PCI: 3 - @@ -3794,10 +4186,30 @@ ROM_END // SOYO SY-4SAW2 - Chipset: SiS 85C497, 85C496, Winbond W83787F - CPU: Socket 3 - RAM: 4xSIMM72, Cache: 4xUM61512AK-15+W24129AK-15 // BIOS: Award (32pin) - Keyboard-BIOS: Via VT82C42N - ISA16: 3, ISA16/VL: 1, PCI: 4 - On board: 2xser, par, 2xIDE, Floppy -// BIOS-String: 04/15/95-SiS-496-497/A/B-2A4IBS22-00 / REV IO-A +// keeping the ROMs for the 4SA boards here until the differences between the boards are clear, e.g. difference between SY-4SAW and 4SA2: L2-cache ROM_START( so4saw2 ) ROM_REGION32_LE(0x20000, "bios", 0) - ROM_LOAD( "4sa2_bios_isa_486_488755.bin", 0x00000, 0x20000, CRC(21708d9c) SHA1(be4596507df1f5cc8a4e1baafce52b96417ac029)) + // 0: BIOS-String: 04/15/95-SiS-496-497/A/B-2A4IBS22-00 / REV IO-A + ROM_SYSTEM_BIOS(0, "ioa", "IO-A") + ROMX_LOAD( "4sa2_bios_isa_486_488755.bin", 0x00000, 0x20000, CRC(21708d9c) SHA1(be4596507df1f5cc8a4e1baafce52b96417ac029), ROM_BIOS(0)) + // 1: BIOS-String: 08/22/95-SiS-496-497/A/B-2A4IBS2hC-00 / REV IO-B1 (4SA2, http://www.elhvb.com/supportbios.info/Archives/BIOS/R-S/SOYO/4SA2/index.html) + ROM_SYSTEM_BIOS(1, "iob1", "IO-B1") + ROMX_LOAD( "4sa-iob1.bin", 0x00000, 0x20000, CRC(a74891b6) SHA1(974c3a854a4e83202555bcbcba191f902527b577), ROM_BIOS(1)) + // 2: BIOS-String: 07/30/97-SiS-496-497/A/B-2A4IBS2hC-00 / SA-0730 (4SA, http://www.elhvb.com/supportbios.info/Archives/BIOS/R-S/SOYO/4SA/index.html) + ROM_SYSTEM_BIOS(2, "0730", "0730") + ROMX_LOAD( "4sa0730.bin", 0x00000, 0x20000, CRC(dea32658) SHA1(2c89500d9904f61a5426de5f1351ca8004c9920b), ROM_BIOS(2)) + // 3: BIOS-String: 07/03/96-SiS-496-497/A/B-2A4IBS29C-00 / REV WA53 (4SAW/4SAW2) + ROM_SYSTEM_BIOS(3, "wa53", "WA53") + ROMX_LOAD( "4saw53.bin", 0x00000, 0x20000, CRC(2265a9d1) SHA1(bd625f0f11e64d2620648cf14e6b6faf09df80bc), ROM_BIOS(3)) + // 4: BIOS-String: 12/05/95-SiS-496-497/A/B-2A4IBS29C-00 / REV WA3 (4SAW/4SAW2) + ROM_SYSTEM_BIOS(4, "wa3", "WA3") + ROMX_LOAD( "4saw-wa3.bin", 0x00000, 0x20000, CRC(d47e727e) SHA1(c6ba38e72575127b763a8e5ead49dbaaef85ab06), ROM_BIOS(4)) + // 5: BIOS-String: 09/11/97-SiS-496-497/A/B-2A4IBS29C-00 / REV WA0911 (4SAW/4SAW2 http://www.elhvb.com/supportbios.info/Archives/BIOS/R-S/SOYO/4SAW/index.html) + ROM_SYSTEM_BIOS(5, "0911", "0911") + ROMX_LOAD( "4saw0911.bin", 0x00000, 0x20000, CRC(4056b35e) SHA1(bca2d2507b15800ad13bd8f8c6699b49b8e87011), ROM_BIOS(5)) + // 6: BIOS-String: 09/11/97-SiS-496-497/A/B-2A4IBS29C-00 / REV WA0911 128GB BETA ROM (4SAW) + ROM_SYSTEM_BIOS(6, "0911b", "0911b") + ROMX_LOAD( "4saw0911b.bin", 0x00000, 0x20000, CRC(000fca3e) SHA1(46ceb550ed08fb013f02e51e1d428a60e220ede6), ROM_BIOS(6)) ROM_END // ZIDA Tomato board 4DPS - Chipset: SIS 85C497, SIS 85C496, Winbond W83787IF, W83768F, MX8318-01PC - CPU: 486/5x86 - BIOS: Winbond W29EE011-15 / AWARD PCI/PNP @@ -3805,25 +4217,25 @@ ROM_END // from v4.00 onward it needs FLASH instead of EPROM to update the ESCD at boot time ROM_START( zito4dps ) // all revisions land in the Award Boot block BIOS ROM_REGION32_LE(0x20000, "bios", 0) - // 0: + // 0: BIOS-String: 01/10/96-SiS-496-497/A/B-2A4IBZ11C-00 / 4DPS VER 1.5 (2301952A4IBZ11) ROM_SYSTEM_BIOS( 0, "4dps01", "Tomato 4DPS #1") ROMX_LOAD( "4siw004.bin", 0x00000, 0x20000, CRC(0c57cc33) SHA1(04ce27dc89ae15d70c14076ad4f82b50a4f1e6dd), ROM_BIOS(0)) - // 1: + // 1: BIOS-String: 06/17/1998-SiS-496-497/A-2A4IBZ11C-00 / 4DPS V4.00A (17/06/98) ROM_SYSTEM_BIOS( 1, "4dps02", "Tomato 4DPS #2") ROMX_LOAD( "4dps02.bin", 0x00000, 0x20000, CRC(757a5ef7) SHA1(e35146f34329a6a7033b1ed9d95a77692826a060), ROM_BIOS(1)) - // 2: - ROM_SYSTEM_BIOS( 2, "170", "Tomato 4DPS v1.70") + // 2: BIOS-String: 10/17/96-SiS-496-497/A/B-2A4IBZ11C-00 / 4DPS VER 1.71 (1710962A4IBZ11) + ROM_SYSTEM_BIOS( 2, "171", "Tomato 4DPS v1.71") ROMX_LOAD( "4dps_170.bin", 0x00000, 0x20000, CRC(10b43a85) SHA1(d77bb2420b98c030add5de52fc90c88384b2036b), ROM_BIOS(2)) - // 3: - ROM_SYSTEM_BIOS( 3, "172g", "Tomato 4DPS v1.72g") + // 3: BIOS-String: 07/08/97-SiS-496-497/A/B-2A4IBZ1AC-00 / 4DPS VER 1.72F (10072A4IBZ1A) + ROM_SYSTEM_BIOS( 3, "172f", "Tomato 4DPS v1.72f") ROMX_LOAD( "4dps172g.bin", 0x00000, 0x20000, CRC(184eeeba) SHA1(248555567e35d4d6a0cfad5abc989e8193a72351), ROM_BIOS(3)) - // 4: + // 4: BIOS-String: 06/17/1998-SiS-496-497/A-2A4IBZ11C-00 / 4DPS V4.00A (17/06/98) ROM_SYSTEM_BIOS( 4, "400a", "Tomato 4DPS v4.00a") ROMX_LOAD( "4dps400a.bin", 0x00000, 0x20000, CRC(494da2da) SHA1(9dcae9aa403627df03d5777c1b4de0b9f98bb24f), ROM_BIOS(4)) - // 5: + // 5: BIOS-String: 01/10/96-SiS-496-497/A/B-2A4IBZ11C-00 / Tomato 4DPS v4.01 (Y2K ready) ROM_SYSTEM_BIOS( 5, "401e", "Tomato 4DPS v4.01e") ROMX_LOAD( "4dps401e.bin", 0x00000, 0x20000, CRC(e84b2bb2) SHA1(5dd8e801decf87af90ff90e3096819354f657b5a), ROM_BIOS(5)) - // 6: v2.11, also marked v400a + // 6: v2.11, also marked v400a - BIOS-String: 06/17/1998-SiS-496-497/A-2A4IBZ11C-00 / 4DPS V4.00A (17/06/98) ROM_SYSTEM_BIOS( 6, "4dps03", "Tomato 4DPS #3") ROMX_LOAD( "4dps400b.bin", 0x00000, 0x20000, CRC(5910fa95) SHA1(934845038298d2d50f5bd4b20e0a4ccd9aa74e82), ROM_BIOS(6)) ROM_END @@ -3834,8 +4246,8 @@ ROM_START( jwj446a ) // BootBlock BIOS ROM_REGION32_LE(0x20000, "bios", 0) // 0: ROM_SYSTEM_BIOS( 0, "no1", "J-446A #1") - ROMX_LOAD( "j446a_original.bin", 0x00000, 0x20000, CRC(79d2e360) SHA1(8bf3befa1c869e298ec346cc784fcbc2193e3912), ROM_BIOS(0)) - // 1: + ROMX_LOAD( "j446a_original.bin", 0x00000, 0x20000, BAD_DUMP CRC(79d2e360) SHA1(8bf3befa1c869e298ec346cc784fcbc2193e3912), ROM_BIOS(0)) + // 1: 02/02/96-SiS-496-497/A/B-2A4IBJ19C-00 / V.446 RP5 2-2-1996 ROM_SYSTEM_BIOS( 1, "no2", "J-446A #2") ROMX_LOAD( "j446a.rom", 0x00000, 0x20000, CRC(3e3c6abd) SHA1(04952dc143baa7b51cb6fc5eb1961007ecf36aaf), ROM_BIOS(1)) ROM_END @@ -3849,17 +4261,20 @@ ROM_START( ls486e ) ROM_SYSTEM_BIOS( 0, "revc01", "Rev.C #1") ROMX_LOAD( "ls486e_revc.bin", 0x00000, 0x20000, CRC(d678a26e) SHA1(603e03171b28f73bdb6ce27b0bbae2a4cfb13517), ROM_BIOS(0)) // 1: LS486E Rev.D SiS496/497(PR/NU) EDO Support AWARD 10/21/96 - 10/21/96-SiS-496-497/A/B-2A4IBL12C-00 - 486E 96/10/24 UMC8669 PLUG & PLAY BIOS - ROM_SYSTEM_BIOS( 1, "revd01", "Rev.D #1") // lands in BootBlock BIOS + ROM_SYSTEM_BIOS( 1, "revd01", "Rev.D #1") // boots to BootBlock BIOS ROMX_LOAD( "ls486-d.awa", 0x00000, 0x20000, CRC(5a51a3a3) SHA1(6712ab742676156802fdfc4d08d687c1482f2702), ROM_BIOS(1)) - // 2: Lucky Star LS486E rev.C,Winbond,SiS496/497 - BIOS Award PNP v4.50PG (486E 96/5/17 W83787) - ROM_SYSTEM_BIOS( 2, "revc02", "Rev.C #2") // lands in BootBlock BIOS + // 2: Lucky Star LS486E rev.C,Winbond,SiS496/497 - BIOS Award PNP v4.50PG (486E 96/5/17 W83787) - BIOS-String: 03/14/96-SiS-496-497/A/B-2A4IBL13C-00 / 486E 96/5/17 W83787 + ROM_SYSTEM_BIOS( 2, "revc02", "Rev.C #2") // boots to BootBlock BIOS ROMX_LOAD( "ls486e-c.awd", 0x00000, 0x20000, CRC(8c290f20) SHA1(33d9a96e5d6b3bd5776480f5535bb1eb1d7cff57), ROM_BIOS(2)) - //3: lands in BootBlock BIOS + //3: BIOS-String: 03/14/96-SiS-496-497/A/B-2A4IBL13C-00 / 486E 96/7/19 W83787 PLUG & PLAY BIOS - boots to BootBlock BIOS ROM_SYSTEM_BIOS( 3, "revc1", "Rev.C1") ROMX_LOAD( "ls486ec1.bin", 0x00000, 0x20000, CRC(e96d1bbc) SHA1(64d0726c4e9ecee8fddf4cc39d92aecaa8184d5c), ROM_BIOS(3)) // 4: BootBlock BIOS ROM_SYSTEM_BIOS( 4, "lh5", "LH5") ROMX_LOAD( "ls-486e.bin", 0x00000, 0x20000, CRC(03ca4a97) SHA1(f9e5e2f2fabcb47960dfa91c37bf74fa93398092), ROM_BIOS(4)) + // 5: BIOS-String: 03/14/96-SiS-496-497/A/B-2A4IBL13C-00 - boots to BootBlock BIOS + ROM_SYSTEM_BIOS( 5, "ls486eb", "LS-486E(B)") + ROMX_LOAD( "4siw001.bin", 0x00000, 0x20000, CRC(d81d722d) SHA1(bb18324b3679b7419c230244891b626a61006486), ROM_BIOS(5)) ROM_END // MSI MS-4144 - Chipset: SiS 85C497, 85C496, Winbond W83787F, W83758F - CPU: Socket 3 - RAM: 4xSIMM72, Cache: 8+1 sockets @@ -3872,10 +4287,10 @@ ROM_START( ms4144 ) // 1: no display ROM_SYSTEM_BIOS(1, "af54", "AF54") ROMX_LOAD( "ms-4144_af54s.rom", 0x00000, 0x20000, CRC(1eb02779) SHA1(b18cc771fc5a820437a4daca06806188ee1a27a5), ROM_BIOS(1)) - // 2: lands in BootBlock BIOS + // 2: BIOS-String: 03/20/96-SiS-496-497/A/B-2A4IBM49C-00 / WF53S 032096 - boots to BootBlock BIOS ROM_SYSTEM_BIOS(2, "wf53", "WF53") ROMX_LOAD( "ms-4144_wf53s.bin", 0x00000, 0x20000, CRC(df83f099) SHA1(b7dc61a2cb71754cddd06d12d3bf81ffce442c89), ROM_BIOS(2)) - // 3: lands in BootBlock BIOS + // 3: BIOS-String: 02/07/96-SiS-496-497/A/B-2A4IBM49C-00 / WF54S 020896 - boots to BootBlock BIOS ROM_SYSTEM_BIOS(3, "wf54", "WF54") ROMX_LOAD( "ms-4144_wf54s.bin", 0x00000, 0x20000, CRC(c0ff31df) SHA1(4e138558781a220b340977d56ccbfa61a907d4f5), ROM_BIOS(3)) // 4: no display - VER 2.1 - BIOS: AMI 486DX ISA BIOS AC8999569 (32pin)- Keyboard-BIOS: AMIKEY-2 @@ -3883,10 +4298,31 @@ ROM_START( ms4144 ) ROMX_LOAD( "486-pci-ms4144.bin", 0x00000, 0x20000, CRC(8bd50381) SHA1(c9853642ac0946c2b1a7e469bcfacbb3351c4067), ROM_BIOS(4)) ROM_END +// SOYO 30H - CPU: Socket 3 - RAM: SIMM72x4 - Cache: 256K, 512K or 1024K - ISA16: 4, PCI: 3 - on board: 2xIDE +// BIOS-String: 12/07/95-SiS-496-497/A/B-2A4IBS2AC-00 / REV B2 +ROM_START( so30h ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "30h-b2.bin", 0x00000, 0x20000, CRC(1dd22cef) SHA1(dd0ac15e7a792e8fba2f55d6a1b35256e74bcf4e)) +ROM_END + +ROM_START( sis85c496 ) + ROM_REGION32_LE(0x20000, "bios", 0) + // Chipset: SiS 85C496/85C497 - CPU: Socket 3 - RAM: 2xSIMM72, Cache - Keyboard-BIOS: JETkey V5.0 + // ISA16: 3, PCI: 3 - BIOS: SST29EE010 (128k) AMI 486DX ISA BIOS AA2558003 - screen remains blank + ROM_LOAD( "4sim002.bin", 0x00000, 0x20000, CRC(ea898f85) SHA1(7236cd2fc985985f21979e4808cb708be8d0445f)) +ROM_END + // ***** 486 motherboards using the SiS 85C471 + 85C407 chipset -// Abit AH4/AH4T ( the T model has a voltage regulator for DX4 CPUs) - CPU: Socket 3 - Chipset: SIS 85C471 / SIS 85C407 +// 486IG-B-2-1 - CPU: 486 - RAM: 8xSIMM30, Cache: 4x32pin, 4x28pin, TAG - Chipset: SIS85C471/407 - BIOS: AMI WIN BIOS 07/25/94 +// Keyboard-BIOS: AMIKEY - BIOS-String: 40-0002-428020-00101111-080893-SIS471B-F - ISA8: 1, ISA16: 3, ISA16/VL: 3 +ROM_START( 486igb21 ) // display remains blank + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "486igb21.amw", 0x10000, 0x10000, CRC(b62cc7af) SHA1(048f80ad995a1516f97bb7544d3fb608a93893b1)) +ROM_END + +// Abit AH4/AH4T/AN4R2 ( the T model has a voltage regulator for DX4 CPUs) - CPU: Socket 3 - Chipset: SIS 85C471 / SIS 85C407 // RAM: 4xSIMM72, Cache: 9x28pin (32pin sockets except TAG) - BIOS: AMI - Keyboard-BIOS: AMIKEY - OSC: 14.31818 - ISA8: 1, ISA16: 4, ISA16/VL: 3 // BIOS-String: 08/30/95-SIS-85C471-2C4I9A12-02 ROM_START( abah4 ) @@ -3894,6 +4330,18 @@ ROM_START( abah4 ) ROM_LOAD( "ah4t_an4r2_02.bin", 0x10000, 0x10000, CRC(b45dc3b7) SHA1(94206ac9ed50fc37d954cc3cd1fb062fd75ea984)) ROM_END +// Aopen VI15G - Chipset: SiS 85C471, 85C407 - CPU: Socket 3 - RAM: 4xSocket72, Cache: 4x32pin, 4x28pin, TAG - BIOS: 28pin +// Keyboard-BIOS: AMIKEY-2 - ISA16: 4, ISA16/VL: 3 +ROM_START( aovi15g ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: + ROM_SYSTEM_BIOS(0, "072594", "07/25/94") + ROMX_LOAD( "amiwinch.bin", 0x10000, 0x10000, CRC(9ee72bef) SHA1(25f08714a384d68777d1570cf28a4db8b390257e), ROM_BIOS(0)) + // 1: + ROM_SYSTEM_BIOS(1, "r23", "R23") + ROMX_LOAD( "vi15gr23.rom", 0x10000, 0x10000, CRC(b704f571) SHA1(485795b8756069723dac865919dc3915a3162c12), ROM_BIOS(1)) +ROM_END + // ASUS VL/I-486SV2G (GX4) (4xSIMM72, Cache: 128/256/512/1024KB, 7 ISA, 2 VLB) // SiS 85C471 + 85C407; AMIKEY-2 ROM_START( a486sv2g ) @@ -3955,10 +4403,35 @@ ROM_START( ms4138 ) ROM_END // DTK PKM-0038S E-2A aka Gemlight GMB-486SG - Chipset: SIS 85C471, 85C407 - BIOS/Version: 01/10/95 Award (DTK PKM0038S.P02.03.02), 28pin - Keyboard-BIOS: JETkey V5.0 -// BIOS-String: 01/10/95-SIS-85C471B/E/G-2C4I9G30-00 / (2C4I9G30) DTKPKM0038S.P2.03.02 - CPU: Socket 3 - ISA8: 1, ISA16: 3, ISA16/VL: 3 - OSC: 14.318 +// CPU: Socket 3 - ISA8: 1, ISA16: 3, ISA16/VL: 3 - OSC: 14.318 ROM_START( pkm0038s ) ROM_REGION32_LE( 0x20000, "bios", 0) - ROM_LOAD( "pkm0038s.bin", 0x10000, 0x10000, CRC(f6e7dd88) SHA1(5a2986ff0e6352ade8d5b0abaa86e436dddcf226)) + // 0: BIOS-String: 01/10/95-SIS-85C471B/E/G-2C4I9G30-00 / (2C4I9G30) DTKPKM0038S.P2.03.02 + ROM_SYSTEM_BIOS(0, "p20302", "P2.03.02") + ROMX_LOAD( "pkm0038s.bin", 0x10000, 0x10000, BAD_DUMP CRC(f6e7dd88) SHA1(5a2986ff0e6352ade8d5b0abaa86e436dddcf226), ROM_BIOS(0)) // BIOS ROM checksum error + // 1: BIOS-String: 07/11/94-SIS-85C471E-2C4I9G30-00 / (2C4I9G30) DTKPKM0038S.P02.02.0 + ROM_SYSTEM_BIOS(1, "p2020", "P2.02.0") + ROMX_LOAD( "4siw005.bin", 0x10000, 0x10000, CRC(0b8794d3) SHA1(153b38f6815a8a3d6723eb17df7ffc37054b3194), ROM_BIOS(1)) +ROM_END + +// EFA 4DMS HL3G-L4-VI - Chipset: SIS-85C471B/E/G / SIS471E/G - CPU: Socket 3 - RAM: 2xSIMM72, Cache: 8x32pin+TAG - ISA16: 5, ISA16/VL: 3 +// BIOS: Award - BIOS-String: 12/07/95-SIS-85C471B/E/G-2C4I9E30-00 / 4DMS-HL3GC Award BIOS REV 1.05 01/12/'96 +ROM_START( 4dmshl3g ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "3g105.bin", 0x00000, 0x20000, CRC(60e4841f) SHA1(60ad11e4e4a60eef858d837470a9014706e7576a)) +ROM_END + +// Zida 4DVS - Chipset: SiS 85C471, 85C407 - CPU: Socket 3, RAM: 4xSIMM72, Cache: 4x28pin, 4x32pin, TAG +// ISA8: 1, ISA16: 3, ISA16/VL: 3 - Keyboard-BIOS: AMIKEY-2 +// BIOS-String: +ROM_START( zi4dvs ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: 02/09/95-SIS-85C471B/E/G-2C4I9000-00 / 12/10/95 SIS 85C471G + ROM_SYSTEM_BIOS(0, "4dvs20", "4DVS20") + ROMX_LOAD( "4dvs20.awa", 0x10000, 0x10000, CRC(831d33cb) SHA1(e5c3f01a9c93a7cf9dbcdc750e87952a5b6a5cf4), ROM_BIOS(0)) + // 1: blank screen + ROM_SYSTEM_BIOS(1, "4dvs471", "4DVS471") + ROMX_LOAD( "4dvs-471.amw", 0x10000, 0x10000, CRC(da749314) SHA1(686321ffa59cd2259f4fe65a28b86c88cf739393), ROM_BIOS(1)) ROM_END ROM_START( sis85c471 ) @@ -3987,6 +4460,18 @@ ROM_START( md4duvc ) // "Memory test fail" ROM_LOAD( "md-4duvc.dmg", 0x10000, 0x10000, CRC(40d208bb) SHA1(c879599d2635c093fce420d1e7081631d27c621a)) ROM_END +// BIOSTAR MB-1433UIV - Chipset: BIOTEQ 83C3498, 83C3496 - CPU: Socket 3 - RAM: 3xSIMM30, 4xSIMM72, Cache: 4x32pin, 4x28pin + TAG +// ISA16: 4, ISA16/VL: 3 - BIOS: 28pin +ROM_START( mb1433uiv ) + ROM_REGION32_LE(0x20000, "bios", 0) + // 0: + ROM_SYSTEM_BIOS(0, "um8496fw", "UM8496FW") + ROMX_LOAD( "um8496fw.ami", 0x10000, 0x10000, CRC(4a6dcc36) SHA1(f159f67eb662272244cd1781814ebcb5204a2625), ROM_BIOS(0)) + // 1: + ROM_SYSTEM_BIOS(1, "w4", "W4") + ROMX_LOAD( "um498-w4.amw", 0x10000, 0x10000, CRC(12fe6697) SHA1(2506dea874728916dc37f7dad8e8caf214a28525), ROM_BIOS(1)) +ROM_END + // PC-Chips M912 - Chipset: UM8498F, UM8496F - CPU: 486 - BIOS: AMI - ISA16: 4, ISA16/VL: 3 ROM_START( pccm912 ) // no display ROM_REGION32_LE( 0x20000, "bios", 0) @@ -4005,9 +4490,24 @@ ROM_START( pt430 ) // no display ROM_LOAD( "pt430.bin", 0x10000, 0x10000, CRC(d455c949) SHA1(c57c82ed015528f3d223f59c94ed6b8a9c323c39)) ROM_END +// Soyo 025R2 - Chipset: UM8498F, UM8486F - CPU: Socket 3 - RAM: 4xSIMM30, 2xSIMM72, Cache: 4x28pin, 4x32pin, TAG, used: 4xUM61512AK-15, AE88128AK-15 +// BIOS: 28pin - ISA16: 4, ISA16/VL: 3 +// BIOS-String: 08/28/UMC-498GP-2C4X6S21-00 / REV B2 +ROM_START( so025r2 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD("25r2-b2.bin", 0x10000, 0x10000, CRC(3b73360c) SHA1(eaaf47236154a9cc81ffda4c11086960aed0dadf)) +ROM_END + + ROM_START( um8498f ) // no display ROM_REGION32_LE(0x20000, "bios", 0) - ROM_LOAD( "deepgrn.bin", 0x10000, 0x10000, CRC(4a6dcc36) SHA1(f159f67eb662272244cd1781814ebcb5204a2625)) + // 0: BIOS-String: 40-P101-001437-00101111-072594-GREEN-H - CPU: Socket 3 - RAM: 4xSIMM30, 2xSIMM72, Cache: 9xUM61256AK-15 + // BIOS: AMI AB9300757 + ROM_SYSTEM_BIOS(0, "v14", "V1.4") + ROMX_LOAD( "4umm001.bin", 0x10000, 0x10000, CRC(a5b768b4) SHA1(904ce2814d6542b65acec0c84532946172f2296d), ROM_BIOS(0)) + // 1: + ROM_SYSTEM_BIOS(1, "um849801", "UM8498 #1") + ROMX_LOAD( "um8498.ami", 0x10000, 0x10000, CRC(51f71bc7) SHA1(0986d60081d2c578a66789c0c53fe1d5919c553f),ROM_BIOS(1)) ROM_END @@ -4032,16 +4532,30 @@ ROM_END // ***** 486 motherboards using the UM8886BF, UM8881F chipset +// A-Trend ATC-1415 - Chipset: UMC UM8881F/UM8886BF, OEC12C885, VT8235N - ISA8: 1, ISA16: 3, PCI: 3 +// CPU: Socket 3 - BIOS: Award C 0247007 UMC8881/6 BIS VER : 3.20 95-12-08 / M271001 (128k) +// BIOS-String: 11/24/95-UMC-881/886A-2A4X5A2HC-00 +ROM_START( atc1415 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "4umw002.bin", 0x00000, 0x20000, CRC(eacaa3de) SHA1(88c828def72aeae0798ba5a4a5c31cd465545c0b)) +ROM_END + // Biostar MB8433UUD-A (4 SIMM, 2 IDE, 3 PCI, 4 ISA) // UMC UM8881F, UM8886BF, UM8663AF; DS12887 RTC ROM_START( mb8433uud ) // BootBlock BIOS ROM_REGION32_LE(0x20000, "bios", 0) // Intel Flash P28F010 - // 0: + // 0: BIOS-String: 05/20/96-UMC-881E/886B-2A4X5B08C-00 / UUD960520S EVALUATION ROM - NOT FOR SALE ROM_SYSTEM_BIOS(0, "520s", "520S") ROMX_LOAD( "uud0520s.bin", 0x00000, 0x20000, CRC(0e347559) SHA1(060d3040b103dee051c5c2cfe8c53382acdfedad), ROM_BIOS(0)) - // 1: + // 1: BIOS-String: 05/20/96-UMC-881E/886B-2A4X5B08C-00 / BIOSTAR MB-8433UUD v2014 ROM_SYSTEM_BIOS(1, "2014", "2014") ROMX_LOAD( "uud2014.bin", 0x00000, 0x20000, CRC(315f7519) SHA1(e0174e4982d1861c64d871a7806b793a914f2366), ROM_BIOS(1)) + // 2: BIOS-String: 12/05/95-UMC-881E/886B-2A4X5B08C-00 / UUD951222S + ROM_SYSTEM_BIOS(2, "8881d", "8881D") + ROMX_LOAD( "um8881_d.awa", 0x00000, 0x20000, CRC(a47327b9) SHA1(6b57155cf34e2c597b7621e49ae8354c05cebfde), ROM_BIOS(2)) + // 3: BIOS-String: 11/07/95-UMC-881E/886B-2A4X5B08C-0 / UUD951108A + ROM_SYSTEM_BIOS(3, "08a", "08A") + ROMX_LOAD( "8433uud.awd", 0x00000, 0x20000, CRC(17ca5c2a) SHA1(7cda78f87f35fe8574a1f2d70d548cc2bc2af05b), ROM_BIOS(3)) ROM_END // Gigabyte GA-486AM/S - CPU: Socket 3 - Chipset: UMC UM8886AF, UM8881F, UM88663AF, UM8667 - RAM: 4xSIMM72, Cache: 9x32pin, occupied: 4xUM6152AK-15, 1xUM61M256K-15 @@ -4100,7 +4614,7 @@ ROM_START( hot433 ) // 8: Latest AMI BIOS for rev4 of the Shuttle HOT-433 motherboard. ROM_SYSTEM_BIOS(8, "aus33", "AUS33") ROMX_LOAD( "433aus33.rom", 0x00000, 0x20000, CRC(278c9cc2) SHA1(ecd348106d5118eb1e1a8c6bd25c1a4bf322f3e6), ROM_BIOS(8)) - // 9: lands in BootBlock BIOS + // 9: boots to BootBlock BIOS ROM_SYSTEM_BIOS(9, "2a4x5h21", "2A4X5H21") ROMX_LOAD( "2a4x5h21.bin", 0x00000, 0x20000, CRC(27c47b90) SHA1(09d17bc5edcd02a0ff4a3a7e9f1072202880251a), ROM_BIOS(9)) // 10: no display @@ -4123,6 +4637,13 @@ ROM_START( pt432b ) // no display ROM_LOAD( "sr_m401-a.bin", 0x00000, 0x20000, CRC(ff8cd351) SHA1(a9c6a54f38b1b548fba4d7d42643f117441b09a6)) ROM_END +// TD-4IP-UMC-AIO - CPU: Socket 3 - Chipset: UMC UM8881F, UM8886BF, UM8663BF, UM8667, bq3285P - RAM: 2xSIMM72, Cache: W24257AK-15, W24512AK-20 (4) +// BIOS: Award 020175447 / 29EE010 (128k) - BIOS-String: 12/19/95-UMC-881E/886B-2A4X5CF9C-00 - ISA16: 4, PCI: 3 +ROM_START( td4ipaio ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "4ummw001.bin", 0x00000, 0x20000, CRC(4e716d77) SHA1(1b7af88c4da5ca388acbc0cb66bd26a0ae8f4931)) +ROM_END + ROM_START( um8886 ) ROM_REGION32_LE(0x20000, "bios", 0) // 0: no display - UMC PCI 95C-0123 - Chipset: UMC UM8886AF, UM8881F, 4xUM8002, UM8663AF, UM8667 - CPU: Socket 3 - On board: 2xser, par, Floppy, 2xIDE - 4xISA16, 4xPCI @@ -4134,7 +4655,6 @@ ROM_START( um8886 ) ROMX_LOAD( "486-umc-pci mini.bin", 0x00000, 0x20000, CRC(4ee12b46) SHA1(9397f67b21f11cfda57abd5ab28f93055909ee97), ROM_BIOS(1)) ROM_END - // Elitegroup UM8810 PAIO - Chipset: UMC UM8881F, UM8886F, UM82C865FSMC FDC37C665GT, PCI0640B - CPU: Socket 3 - RAM: 4xSIMM72, Cache: 32pin sockets, 9xUM61256FK-15 occupied // BIOS: 32pin - Keyboard-BIOS: AMIKEY-2 - ISA16: 4, PCI: 3 - On board: 2xIDE, Floppy, par, 2xser ROM_START( um8810paio ) @@ -4185,6 +4705,12 @@ ROM_START( mb4d33 ) ROM_LOAD( "486-mb-4d33.bin", 0x10000, 0x10000, CRC(f1299131) SHA1(d8e2749e180135e23483e36a0a05479e64f23d8c)) ROM_END + // BIOS-String: 40-0100-001281-00101111-080893-UMC491F-0 / HL3SC/SM AMI BIOS VER 4.9 01/09/'95 +ROM_START( 4dmuhl3s ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "3s-49-1.rom", 0x10000, 0x10000, CRC(78a8ea39) SHA1(35e2d0103da28b93a8c1addb1f083bd6e4239d2a)) +ROM_END + // Elitegroup ECS UC4915 A AIO - Chipset: UMC UM82C491F UM82C493F UM82C865F SMC FDC37C662QF P, PROCHIP PR 4030 - CPU: Socket 3 // BIOS: AMI 486DX ISA BIOS AB2683223 28pin in 32pin socket - Keyboard-BIOS: Intel/AMI MEGA-KB-H-WP // BIOS-String: 40-0401-001131-00101111-040493-UMC491C-0 / VOBIS UC4915-A V1.1 11-05-93' - ISA16: 4, ISA16/VL: 2 - OSC: 14.31818 - On board: IDE, Floppy, 2xser, par, Game @@ -4203,10 +4729,30 @@ ROM_END // Biostar MB-1433UCV - Chipset: BIOTEQ 82C3491, 82C3493 (check mb133340 for a 386 motherboard using the same chipset) // CPU: 486DX2-66 - RAM: 8xSIMM30, Cache: 8+1x28pin(AS57C256-20PC) - ISA8: 1, ISA16: 3, ISA16+VL: 3 - BIOS: AMI AB0975913 - Keyboard-BIOS: JETkey V5.0 - RTC: TH6887A 9410 -// BIOS-String: 40-0100-001223-00101111-040493-UMC491F-0 / MB-1333/40UCG-A, MB-1333/40UCQ-B / MB-1433-40UDV-A, MB-1433/50UCV-C, MB-6433/50UPC-A for EXT. RTC ROM_START( mb1433ucv ) ROM_REGION32_LE(0x20000, "bios", 0) - ROM_LOAD( "biostar_bios_mb-1433-50ucv-d_pcb_ver_2.bin", 0x10000, 0x10000, CRC(e5ff2d76) SHA1(d2abe00eb2051ec7cb9423cdb8b52e91f7e2d416)) + // 0: BIOS-String: 40-0100-001223-00101111-040493-UMC491F-0 / MB-1333/40UCG-A, MB-1333/40UCQ-B / MB-1433-40UDV-A, MB-1433/50UCV-C, MB-6433/50UPC-A for EXT. RTC + ROM_SYSTEM_BIOS(0, "ucvd", "UCV-D") + ROMX_LOAD( "biostar_bios_mb-1433-50ucv-d_pcb_ver_2.bin", 0x10000, 0x10000, CRC(e5ff2d76) SHA1(d2abe00eb2051ec7cb9423cdb8b52e91f7e2d416), ROM_BIOS(0)) + // 1: BIOS-String: 40-0100-001223-00101111-04093-UMC491f-0 / UCV-G + ROM_SYSTEM_BIOS(1, "ucvg", "UCV-G") + ROMX_LOAD( "bioteq.rom", 0x10000, 0x10000, CRC(93321e89) SHA1(450e35787607a4b6aecd3159d6c0599a03cd42b1), ROM_BIOS(1)) +ROM_END + + +// ***** motherboards using the Unichip U4800 chipset + +// UNICHIP 486 WB 4407 REV 1.0 - Chipset: KS83C206Q UNICHIP U4800-VLX - BIOS: AMI 486 ISA BIOS AA6562949, 28pin - Keyboard-BIOS: AMI 2050778 +// BIOS-String: 40-0200-001107-0010111-111192-U4800VLX-0 / 4407 UNICHIP BIOS VER 1.0 - OSC: 14.31818 - ISA16: 4, ISA16/VL: 3 +ROM_START( uniwb4407 ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "unichip_486_wb_4407.bin", 0x10000, 0x10000, CRC(91237686) SHA1(7db14451cc3e00a2273a453152a817bccbdfb10e)) +ROM_END + +ROM_START( uni4800 ) + ROM_REGION32_LE(0x20000, "bios", 0) + // BIOS-String: 40-05TB-006257-00101111-060692-UNI4800-0 + ROM_LOAD( "uni4800.ami", 0x10000, 0x10000, CRC(555c4c34) SHA1(0a907d7a0ec16e9369d77a1ac1afb0e69e3d6c1a)) ROM_END @@ -4248,6 +4794,7 @@ ROM_END // VIA VT82C505 (ISA/VL to PCI bridge) + VT82C496G (system chipset) + VT82C406MV (keyboard controller, RTC, CMOS), NS311/312 or NS332 I/O ROM_START( ficpio2 ) ROM_REGION32_LE(0x40000, "isa", 0) + ROM_DEFAULT_BIOS("ficpio2c1") // 0 ROM_SYSTEM_BIOS(0, "ficpio2c7", "FIC 486-PIO-2 1.15C701") /* pnp, i/o core: NS 332, doesn't boot, requires cache emulation? */ ROMX_LOAD( "115c701.awd", 0x020000, 0x20000, CRC(b0dd7975) SHA1(bfde13b0fbd141bc945d37d92faca9f4f59b716d), ROM_BIOS(0)) @@ -4267,6 +4814,7 @@ ROM_END // FIC 486-VIP-IO2 (3 ISA, 4 PCI) // VIA VT82C505 + VT82C496G + VT82C406MV +// Boot block - BIOS-String: 05/28/96-VT496G-2A4L6F0IC-00 / 1.164G701 ROM_START( ficvipio2 ) ROM_REGION32_LE(0x20000, "bios", 0) ROM_LOAD( "1164g701.awd", 0x00000, 0x20000, CRC(7b762683) SHA1(84debce7239c8b1978246688ae538f7c4f519d13)) @@ -4314,6 +4862,16 @@ ROM_START( ts34t25 )// blank display ROM_LOAD( "s34t0003_51slbios_019f.u31", 0x00000, 0x8000, CRC(40467716) SHA1(f976f2ce13eb22e0ed164d31d6382eda489545c1)) ROM_END +// Highscreen Colani Blue Note +// Chipset: Cirrus Logic CL-GD6235-65QC-A, CL-PD6720-QC-A ETEQ ET6000 A, Appian ADI2, SMC FDC37C651 QF P, DIA UA0300-QA, Chips F82C206J +// Video: Dual Scan Color LCD (monochrome available) - RAM: 4MB on board, RAM expansion board - on board: trackball, ser, par, PS2, VGA +// mass storage: Floppy, IDE - expansion: 2xPCMCIA, expansion bus +ROM_START( bluenote ) + ROM_REGION32_LE(0x20000, "bios", 0) + ROM_LOAD( "7500d_rev26_121593.bin", 0x00000, 0x20000, CRC(d564f855) SHA1(181e4097c3b4ca2e8e79f1732d4aef9edd5b4586)) +ROM_END + + /*************************************************************************** Game driver(s) @@ -4385,7 +4943,7 @@ COMP( 198?, magb236, ibm5170, 0, ibm5162, 0, at_state, init_at COMP( 19??, mat286, ibm5170, 0, ibm5162, 0, at_state, init_at, "unknown", "MAT286 Rev.D", MACHINE_NOT_WORKING ) COMP( 1986, pcd2, ibm5170, 0, ibm5170, 0, at_state, init_at, "Siemens", "PCD-2", MACHINE_NOT_WORKING ) COMP( 19??, ht12a, ibm5170, 0, atturbo, 0, at_state, init_at, "unknown", "unknown 286 AT clones (HT12/A chipset)", MACHINE_NOT_WORKING ) -COMP( 199?, suntac5, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "286 motherboards with 5-chip SUNTAC chipset", MACHINE_NOT_WORKING ) +COMP( 199?, suntac6, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "286 motherboards with 6-chip SUNTAC chipset", MACHINE_NOT_WORKING ) COMP( 199?, headg2, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "286 motherboards with Headland G2 chipset", MACHINE_NOT_WORKING ) COMP( 198?, vlsi5, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "286 motherboards with 5-chip VLSI chipset", MACHINE_NOT_WORKING ) COMP( 198?, suntac303, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "286 motherboards with Suntac ST62C303-A chipset", MACHINE_NOT_WORKING ) @@ -4398,6 +4956,7 @@ COMP( 199?, mb1212c, ibm5170, 0, atturbo, 0, at_state, init_at COMP( 199?, cdtekg2, ibm5170, 0, atturbo, 0, at_state, init_at, "CDTEK", "286 mainboard with Headland G2 chipset", MACHINE_NOT_WORKING ) COMP( 198?, cmpa286, ibm5170, 0, atturbo, 0, at_state, init_at, "CMP enterprise CO.LTD.", "286 motherboard", MACHINE_NOT_WORKING ) COMP( 1988, dsys200, ibm5170, 0, atturbo, 0, at_state, init_at, "Dell Computer Corporation", "System 200", MACHINE_NOT_WORKING ) +COMP( 198?, bay1000c, ibm5170, 0, atturbo, 0, at_state, init_at, "Mintek", "BAY-1000C V1.01", MACHINE_NOT_WORKING ) COMP( 198?, mkp286, ibm5170, 0, atturbo, 0, at_state, init_at, "Morse", "KP-286", MACHINE_NOT_WORKING ) COMP( 199?, octekg2, ibm5170, 0, atturbo, 0, at_state, init_at, "Octek", "286 motherboard with Headland G2 chipset", MACHINE_NOT_WORKING ) COMP( 199?, olim203, ibm5170, 0, atturbo, 0, at_state, init_at, "Olivetti", "M203 motherboard", MACHINE_NOT_WORKING ) @@ -4405,6 +4964,8 @@ COMP( 198?, pccm205, ibm5170, 0, atturbo, 0, at_state, init_at COMP( 198?, pccm216, ibm5170, 0, atturbo, 0, at_state, init_at, "PC-Chips", "M216", MACHINE_NOT_WORKING ) COMP( 198?, snomi286, ibm5170, 0, atturbo, 0, at_state, init_at, "Snobol", "Mini 286", MACHINE_NOT_WORKING ) COMP( 198?, u3911v3, ibm5170, 0, atturbo, 0, at_state, init_at, "Uniron", "U3911-V3", MACHINE_NOT_WORKING ) +COMP( 1987, ataripc4, ibm5170, 0, neat, 0, at_state, init_at, "Atari", "PC4", MACHINE_NOT_WORKING ) +COMP( 1989, atariabc286,ibm5170,0, neat, 0, at_state, init_at, "Atari", "ABC-286/30", MACHINE_NOT_WORKING ) COMP( 199?, micral45, ibm5170, 0, micral45, 0, at_state, init_at, "Bull", "Micral 45", MACHINE_NOT_WORKING ) COMP( 1986, ncrpc8, ibm5170, 0, atturbo, 0, at_state, init_at, "NCR", "PC-8", MACHINE_NOT_WORKING ) COMP( 1988, comslt286, ibm5170, 0, atturbo, 0, at_state, init_at, "Compaq", "SLT/286", MACHINE_NOT_WORKING ) @@ -4414,6 +4975,7 @@ COMP( 1990, n8810m16v, ibm5170, 0, atturbo, 0, at_state, init_at COMP( 198?, o286foxii, ibm5170, 0, atturbo, 0, at_state, init_at, "Octek", "Fox II", MACHINE_NOT_WORKING ) COMP( 1987, m290, ibm5170, 0, atturbo, 0, at_state, init_at, "Olivetti", "M290", MACHINE_NOT_WORKING ) COMP( 1991, pcd204, ibm5170, 0, atturbo, 0, at_state, init_at, "Philips", "PCD204 (PCD200 series)", MACHINE_NOT_WORKING ) +COMP( 1990, profpc33, ibm5170, 0, atturbo, 0, at_state, init_at, "Profex", "PC 33", MACHINE_NOT_WORKING ) COMP( 1981, wpc250, ibm5170, 0, atturbo, 0, at_state, init_at, "Wang Laboratories, Inc.", "PC-250/16", MACHINE_NOT_WORKING ) COMP( 1990, n8810m30, ibm5170, 0, neat, 0, at_state, init_at, "Nixdorf Computer AG", "8810 M30", MACHINE_NOT_WORKING ) COMP( 198?, elt286b, ibm5170, 0, neat, 0, at_state, init_at, "Chaintech", "ELT-286B-160B(E)", MACHINE_NOT_WORKING ) @@ -4439,6 +5001,7 @@ COMP( 199?, alim1217, ibm5170, 0, at386sx, 0, at_state, init_at COMP( 199?, op82c283, ibm5170, 0, at386sx, 0, at_state, init_at, "<unknown>", "386sx motherboards using the OPTi 82C283 chipset", MACHINE_NOT_WORKING ) COMP( 199?, op82c291, ibm5170, 0, at386sx, 0, at_state, init_at, "<unknown>", "386sx motherboards using the OPTi 82C291 chipset", MACHINE_NOT_WORKING ) COMP( 19??, ht18c, ibm5170, 0, at386sx, 0, at_state, init_at, "<unknown>", "unknown 286 AT clones (HT18/C chipset)", MACHINE_NOT_WORKING ) +COMP( 199?, 3siud, ibm5170, 0, at386sx, 0, at_state, init_at, "<unknown>", "3SIUD-1.1", MACHINE_NOT_WORKING ) COMP( 199?, asc486slc, ibm5170, 0, at386sx, 0, at_state, init_at, "Computechnik", "ASC486SLC", MACHINE_NOT_WORKING ) COMP( 199?, ocpanii, ibm5170, 0, at386sx, 0, at_state, init_at, "Octek", "Panther II", MACHINE_NOT_WORKING ) COMP( 199?, pt319a, ibm5170, 0, at386sx, 0, at_state, init_at, "Pine", "PT-319A", MACHINE_NOT_WORKING ) @@ -4446,9 +5009,11 @@ COMP( 199?, td70a, ibm5170, 0, at386sx, 0, at_state, init_at COMP( 199?, td70n, ibm5170, 0, at386sx, 0, at_state, init_at, "<unknown>", "TD70N", MACHINE_NOT_WORKING ) COMP( 199?, pccm396f, ibm5170, 0, at386sx, 0, at_state, init_at, "PC-Chips", "M396F", MACHINE_NOT_WORKING ) COMP( 199?, elt386sx, ibm5170, 0, at386sx, 0, at_state, init_at, "Elitegroup", "ELT-386SX-160BE", MACHINE_NOT_WORKING ) +COMP( 199?, pcd3nsl, ibm5170, 0, at386sx, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-3Nsl Notebook Computer", MACHINE_NOT_WORKING ) COMP( 199?, pcd3nsx, ibm5170, 0, at386sx, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-3Nsx Notebook Computer", MACHINE_NOT_WORKING ) COMP( 199?, mbc18nb, ibm5170, 0, at386sx, 0, at_state, init_at, "Sanyo", "MBC-18NB", MACHINE_NOT_WORKING ) COMP( 1992, walk386sx, ibm5170, 0, at386sx, 0, at_state, init_at, "Triumph-Adler", "Walkstation 386 SX", MACHINE_NOT_WORKING ) // screen remains blank +COMP( 199?, dvbslan, ibm5170, 0, at386sx, 0, at_state, init_at, "Datavan", "Book-Size LAN station", MACHINE_NOT_WORKING ) COMP( 198?, epsax3, ibm5170, 0, at386sx, 0, at_state, init_at, "Epson", "PC AX3", MACHINE_NOT_WORKING ) COMP( 199?, frxc402, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 motherboards with a FOREX FRX46C402/FRX36C300/SIS85C206 chipset", MACHINE_NOT_WORKING ) COMP( 199?, opti495slc,ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 motherboards using a OPTi 82C495SLC chipset", MACHINE_NOT_WORKING ) @@ -4490,6 +5055,7 @@ COMP( 1992, ecsum386, ibm5170, 0, at386, 0, at_state, init_at COMP( 199?, ecsfx3000, ibm5170, 0, at386, 0, at_state, init_at, "Elitegroup Computer Systems", "FX-3000 REV1.0", MACHINE_NOT_WORKING ) COMP( 19??, smih0107, ibm5170, 0, at386, 0, at_state, init_at, "Forex Computer Company", "unknown 386 AT clone with Forex chipset", MACHINE_NOT_WORKING ) COMP( 199?, frx386c, ibm5170, 0, at386, 0, at_state, init_at, "Micro-Express Inc.", "Forex 386 Cache", MACHINE_NOT_WORKING ) +COMP( 1992, ocjagii, ibm5170, 0, at386, 0, at_state, init_at, "Octek", "Jaguar II", MACHINE_NOT_WORKING ) COMP( 1992, ocjagv, ibm5170, 0, at386, 0, at_state, init_at, "Octek", "Jaguar V v1.4", MACHINE_NOT_WORKING ) COMP( 199?, op386wb, ibm5170, 0, at386, 0, at_state, init_at, "OPTi", "OPTi 386WB VER.1.0", MACHINE_NOT_WORKING ) COMP( 199?, pccm321, ibm5170, 0, at386, 0, at_state, init_at, "PC-Chips", "M321", MACHINE_NOT_WORKING ) @@ -4500,20 +5066,38 @@ COMP( 198?, hot304, ibm5170, 0, at386, 0, at_state, init_at COMP( 198?, hot307h, ibm5170, 0, at386, 0, at_state, init_at, "Shuttle Computer International", "HOT-307H", MACHINE_NOT_WORKING ) COMP( 199?, sy019hi, ibm5170, 0, at386, 0, at_state, init_at, "Soyo", "SY-019H and SY-019I", MACHINE_NOT_WORKING ) COMP( 199?, uni386w, ibm5170, 0, at386, 0, at_state, init_at, "UNICHIP", "386W 367C REV 1.0", MACHINE_NOT_WORKING ) +COMP( 1988, ataripc5, ibm5170, 0, at386, 0, at_state, init_at, "Atari", "PC5", MACHINE_NOT_WORKING ) COMP( 1992, walk386dx, ibm5170, 0, at386, 0, at_state, init_at, "Triumph-Adler", "Walkstation 386DX", MACHINE_NOT_WORKING ) // screen remains blank COMP( 199?, via4386vio,ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "Via 4386 VIO / Highscreen universal board", MACHINE_NOT_WORKING ) COMP( 199?, nat48pv, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "NAT48PV-1.00 VL", MACHINE_NOT_WORKING ) COMP( 199?, alim1489, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the ALi 1487/1489 chipset", MACHINE_NOT_WORKING ) COMP( 199?, op82c392, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the OPTi OPTi 82C392, 82C493 chipset", MACHINE_NOT_WORKING ) COMP( 199?, sis85c471, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the SiS 85C471/85C407 chipset", MACHINE_NOT_WORKING ) +COMP( 199?, sis85c496, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the SiS 85C496/85C497 chipset", MACHINE_NOT_WORKING ) COMP( 199?, um8886, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the UMC UM8886/UM8881 chipset", MACHINE_NOT_WORKING ) COMP( 199?, um8498f, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the UMC UM8498F, UM8496F chipset", MACHINE_NOT_WORKING ) +COMP( 199?, uni4800, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486 motherboards using the UNI4800 chipset", MACHINE_NOT_WORKING ) +COMP( 199?, td4ipaio, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "TD-4IP-UMC-AIO", MACHINE_NOT_WORKING ) +COMP( 199?, 486igb21, ibm5170, 0, at486, 0, at_state, init_at, "<unknown>", "486IG-B-2-1", MACHINE_NOT_WORKING ) +COMP( 199?, atc1415, ibm5170, 0, at486, 0, at_state, init_at, "A-Trend", "ATC-1415", MACHINE_NOT_WORKING ) +COMP( 199?, atc1425a, ibm5170, 0, at486, 0, at_state, init_at, "A-Trend", "ATC-1425A", MACHINE_NOT_WORKING ) COMP( 199?, abae4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "486 EISA-AE4", MACHINE_NOT_WORKING ) COMP( 199?, abah4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "AB-AH4", MACHINE_NOT_WORKING ) COMP( 199?, abpb4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "AB-PB4", MACHINE_NOT_WORKING ) COMP( 199?, abpi4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "AB-PI4", MACHINE_NOT_WORKING ) +COMP( 199?, abpm4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "AB-PM4", MACHINE_NOT_WORKING ) +COMP( 199?, abpv4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "AB-PV4", MACHINE_NOT_WORKING ) COMP( 199?, abpw4, ibm5170, 0, at486, 0, at_state, init_at, "Abit", "AB-PW4", MACHINE_NOT_WORKING ) COMP( 199?, alator2, ibm5170, 0, at486, 0, at_state, init_at, "Alaris", "Tornado 2", MACHINE_NOT_WORKING ) +COMP( 199?, amient2, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "EISA Enterprise-II", MACHINE_NOT_WORKING ) +COMP( 199?, amient3, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "EISA Enterprise-III", MACHINE_NOT_WORKING ) +COMP( 199?, amient4, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "EISA Enterprise-IV", MACHINE_NOT_WORKING ) +COMP( 199?, amisvpci2, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "Super Voyager PCI-II", MACHINE_NOT_WORKING ) +COMP( 199?, amisvvlb, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "Super Voyager VLB", MACHINE_NOT_WORKING ) +COMP( 199?, amisvvlb2, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "Super Voyager VLB-II", MACHINE_NOT_WORKING ) +COMP( 199?, amisvvlb3, ibm5170, 0, at486, 0, at_state, init_at, "AMI", "Super Voyager VLB-III", MACHINE_NOT_WORKING ) +COMP( 199?, aoap43, ibm5170, 0, at486, 0, at_state, init_at, "Aopen", "AP43", MACHINE_NOT_WORKING ) +COMP( 199?, aovi15g, ibm5170, 0, at486, 0, at_state, init_at, "Aopen", "VI15G", MACHINE_NOT_WORKING ) COMP( 199?, mb4d33, ibm5170, 0, at486, 0, at_state, init_at, "Aquarius System (ASI)", "MB-4D33/50NR", MACHINE_NOT_WORKING ) COMP( 199?, md4duvc, ibm5170, 0, at486, 0, at_state, init_at, "Aquarius System (ASI)", "MD-4DUVC", MACHINE_NOT_WORKING ) COMP( 199?, as496, ibm5170, 0, at486, 0, at_state, init_at, "Arstoria", "AS496", MACHINE_NOT_WORKING ) @@ -4525,17 +5109,26 @@ COMP( 1995, aa486s, ibm5170, 0, at486, 0, at_state, init_at COMP( 1994, a486sv1, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "VL/EISA-486SV1", MACHINE_NOT_WORKING ) COMP( 1994, a486sv2g, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "VL/I-486SV2G", MACHINE_NOT_WORKING ) COMP( 199?, mb1433ucv, ibm5170, 0, at486, 0, at_state, init_at, "Biostar", "MB-1433UCV", MACHINE_NOT_WORKING ) -COMP( 199?, mb8433uud, ibm5170, 0, at486, 0, at_state, init_at, "Biostar", "MB8433-UUD-A", MACHINE_NOT_WORKING ) // lands in Award BootBlock BIOS +COMP( 199?, mb1433uiv, ibm5170, 0, at486, 0, at_state, init_at, "Biostar", "MB-1433UIV", MACHINE_NOT_WORKING ) +COMP( 199?, mb8433uud, ibm5170, 0, at486, 0, at_state, init_at, "Biostar", "MB8433-UUD-A", MACHINE_NOT_WORKING ) // boots to Award BootBlock BIOS COMP( 199?, ch4slez1, ibm5170, 0, at486, 0, at_state, init_at, "Chaintech", "486SLE M106 4SLE-Z1", MACHINE_NOT_WORKING ) +COMP( 199?, ch486spm, ibm5170, 0, at486, 0, at_state, init_at, "Chaintech", "486SPM", MACHINE_NOT_WORKING ) +COMP( 199?, ch48633c, ibm5170, 0, at486, 0, at_state, init_at, "Chicony", "CH-486-33C", MACHINE_NOT_WORKING ) COMP( 199?, ch491e, ibm5170, 0, at486, 0, at_state, init_at, "Chicony", "CH-491E", MACHINE_NOT_WORKING ) COMP( 199?, 486ccv, ibm5170, 0, at486, 0, at_state, init_at, "Diamond Flower, Inc. (DFI)", "486-CCV", MACHINE_NOT_WORKING ) COMP( 199?, pkm0038s, ibm5170, 0, at486, 0, at_state, init_at, "DTK", "PKM-0038S aka Gemlight GMB-486SG", MACHINE_NOT_WORKING ) COMP( 199?, gc10a, ibm5170, 0, at486, 0, at_state, init_at, "Eagle", "EAGLEN486 GC10A", MACHINE_NOT_WORKING ) +COMP( 199?, ed486vl3h, ibm5170, 0, at486, 0, at_state, init_at, "Edom", "486VL3H", MACHINE_NOT_WORKING ) +COMP( 199?, edmv035f, ibm5170, 0, at486, 0, at_state, init_at, "Edom", "MV035F", MACHINE_NOT_WORKING ) +COMP( 199?, 4dmshl3g, ibm5170, 0, at486, 0, at_state, init_at, "EFA", "4DMS HL3G-L4-VI", MACHINE_NOT_WORKING ) +COMP( 199?, 4dmuhl3s, ibm5170, 0, at486, 0, at_state, init_at, "EFA", "4DMU HL3S", MACHINE_NOT_WORKING ) +COMP( 199?, 486apio, ibm5170, 0, at486, 0, at_state, init_at, "EFA", "486 APIO", MACHINE_NOT_WORKING ) COMP( 199?, um486, ibm5170, 0, at486, 0, at_state, init_at, "Elitegroup", "UM486/UM486sx", MACHINE_NOT_WORKING ) COMP( 199?, um486v, ibm5170, 0, at486, 0, at_state, init_at, "Elitegroup", "UM486V-AIO", MACHINE_NOT_WORKING ) COMP( 199?, ec4915aio, ibm5170, 0, at486, 0, at_state, init_at, "Elitegroup", "UC4915 A AIO", MACHINE_NOT_WORKING ) COMP( 199?, ec4913, ibm5170, 0, at486, 0, at_state, init_at, "Elitegroup", "UC4913 REV:1.1", MACHINE_NOT_WORKING ) COMP( 199?, um8810paio,ibm5170, 0, at486, 0, at_state, init_at, "Elitegroup", "UM8810 PAIO", MACHINE_NOT_WORKING ) +COMP( 199?, exp4044, ibm5170, 0, at486, 0, at_state, init_at, "ExpertChip", "EXP4044", MACHINE_NOT_WORKING ) COMP( 199?, fic4386vcv,ibm5170, 0, at486, 0, at_state, init_at, "First International Computer", "4386-VC-V", MACHINE_NOT_WORKING ) COMP( 1994, ficgiovt2, ibm5170, 0, at486, 0, at_state, init_at, "First International Computer", "486-GIO-VT2", MACHINE_NOT_WORKING ) COMP( 199?, fic486kvd, ibm5170, 0, at486, 0, at_state, init_at, "First International Computer", "486 KVD", MACHINE_NOT_WORKING ) @@ -4551,8 +5144,10 @@ COMP( 1992, a433cc, ibm5170, 0, at486, 0, at_state, init_at COMP( 199?, jwj446a, ibm5170, 0, at486, 0, at_state, init_at, "Jetway", "J-446A", MACHINE_NOT_WORKING ) COMP( 199?, ls486e, ibm5170, 0, at486, 0, at_state, init_at, "LuckyStar", "LS-486E Rev:C", MACHINE_NOT_WORKING ) COMP( 199?, ms4125, ibm5170, 0, at486, 0, at_state, init_at, "MSI", "MS-4125", MACHINE_NOT_WORKING ) +COMP( 199?, ms4134, ibm5170, 0, at486, 0, at_state, init_at, "MSI", "MS-4134", MACHINE_NOT_WORKING ) COMP( 199?, ms4138, ibm5170, 0, at486, 0, at_state, init_at, "MSI", "MS-4138", MACHINE_NOT_WORKING ) COMP( 199?, ms4144, ibm5170, 0, at486, 0, at_state, init_at, "MSI", "MS-4144", MACHINE_NOT_WORKING ) +COMP( 199?, ms4145, ibm5170, 0, at486, 0, at_state, init_at, "MSI", "MS-4145", MACHINE_NOT_WORKING ) COMP( 199?, ochawk, ibm5170, 0, at486, 0, at_state, init_at, "Octek", "Hawk", MACHINE_NOT_WORKING ) COMP( 199?, ochipcom, ibm5170, 0, at486, 0, at_state, init_at, "Octek", "Hippo COM", MACHINE_NOT_WORKING ) COMP( 1994, ochipdca2, ibm5170, 0, at486, 0, at_state, init_at, "Octek", "Hippo DCA2", MACHINE_NOT_WORKING ) @@ -4570,12 +5165,16 @@ COMP( 199?, sto486wb, ibm5170, 0, at486, 0, at_state, init_at COMP( 199?, hot409, ibm5170, 0, at486, 0, at_state, init_at, "Shuttle Computer International", "HOT-409", MACHINE_NOT_WORKING ) COMP( 199?, hot419, ibm5170, 0, at486, 0, at_state, init_at, "Shuttle Computer International", "HOT-419", MACHINE_NOT_WORKING ) COMP( 199?, hot433, ibm5170, 0, at486, 0, at_state, init_at, "Shuttle Computer International", "HOT-433", MACHINE_NOT_WORKING ) +COMP( 199?, so025r2, ibm5170, 0, at486, 0, at_state, init_at, "SOYO", "025R2", MACHINE_NOT_WORKING ) +COMP( 199?, so30h, ibm5170, 0, at486, 0, at_state, init_at, "SOYO", "30H", MACHINE_NOT_WORKING ) COMP( 199?, so4saw2, ibm5170, 0, at486, 0, at_state, init_at, "SOYO", "SY-4SAW2", MACHINE_NOT_WORKING ) COMP( 199?, pci48af, ibm5170, 0, at486, 0, at_state, init_at, "TMC Research Corporation", "PCI48AF", MACHINE_NOT_WORKING ) COMP( 199?, uniwb4407, ibm5170, 0, at486, 0, at_state, init_at, "UNICHIP", "486 WB 4407 REV 1.0", MACHINE_NOT_WORKING ) COMP( 199?, sm48650usc,ibm5170, 0, at486, 0, at_state, init_at, "Vintage Sprite", "SM 486-50USC", MACHINE_NOT_WORKING ) COMP( 199?, zito4dps, ibm5170, 0, at486, 0, at_state, init_at, "ZIDA", "Tomato board 4DPS", MACHINE_NOT_WORKING ) +COMP( 199?, zi4dvs, ibm5170, 0, at486, 0, at_state, init_at, "ZIDA", "4DVS", MACHINE_NOT_WORKING ) COMP( 199?, ts34t25, ibm5170, 0, at486, 0, at_state, init_at, "Highscreen", "486-25", MACHINE_NOT_WORKING ) +COMP( 199?, bluenote, ibm5170, 0, at486, 0, at_state, init_at, "Highscreen", "Colani Blue Note", MACHINE_NOT_WORKING ) COMP( 1995, pcd4nl, ibm5170, 0, at486, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-4NL", MACHINE_NOT_WORKING ) COMP( 1993, pcd4nd, ibm5170, 0, at486, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-4ND", MACHINE_NOT_WORKING ) COMP( 1993, lion3500, ibm5170, 0, at486, 0, at_state, init_at, "Lion", "3500", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/atari400.cpp b/src/mame/drivers/atari400.cpp index f6bffb8619b..8330ea22bfc 100644 --- a/src/mame/drivers/atari400.cpp +++ b/src/mame/drivers/atari400.cpp @@ -2184,6 +2184,7 @@ void a400_state::atari_common(machine_config &config) /* software lists */ SOFTWARE_LIST(config, "flop_list").set_original("a800_flop"); SOFTWARE_LIST(config, "cart_list").set_original("a800"); + SOFTWARE_LIST(config, "cass_list").set_original("a800_cass"); SOFTWARE_LIST(config, "xegs_list").set_original("xegs"); } diff --git a/src/mame/drivers/atarigx2.cpp b/src/mame/drivers/atarigx2.cpp index 8de721542aa..b0b5efd1ac6 100644 --- a/src/mame/drivers/atarigx2.cpp +++ b/src/mame/drivers/atarigx2.cpp @@ -1740,10 +1740,10 @@ ROM_END ROM_START( motofren ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 8*64k for 68000 code */ - ROM_LOAD32_BYTE( "136094-moto0.23e", 0x000000, 0x020000, CRC(2c6ec446) SHA1(d83fee26b384e6fd783104746e6560504ae43ca6) ) - ROM_LOAD32_BYTE( "136094-moto1.23j", 0x000001, 0x020000, CRC(e7163e7b) SHA1(7ea8a7a63bd1befee4cf9e708949fca7f06572c1) ) - ROM_LOAD32_BYTE( "136094-moto2.37e", 0x000002, 0x020000, CRC(6b1c7626) SHA1(b318a5856bcbd6a8fc7eb92e4b9a576b8c16cbf3) ) - ROM_LOAD32_BYTE( "136094-moto3.37j", 0x000003, 0x020000, CRC(44c3cd2a) SHA1(a16046586cbaa000e056115c92b5f22bf49869ad) ) + ROM_LOAD32_BYTE( "136094-0021i.23e", 0x000000, 0x020000, CRC(2c6ec446) SHA1(d83fee26b384e6fd783104746e6560504ae43ca6) ) + ROM_LOAD32_BYTE( "136094-0022i.23j", 0x000001, 0x020000, CRC(e7163e7b) SHA1(7ea8a7a63bd1befee4cf9e708949fca7f06572c1) ) + ROM_LOAD32_BYTE( "136094-0023i.37e", 0x000002, 0x020000, CRC(6b1c7626) SHA1(b318a5856bcbd6a8fc7eb92e4b9a576b8c16cbf3) ) + ROM_LOAD32_BYTE( "136094-0024i.37j", 0x000003, 0x020000, CRC(44c3cd2a) SHA1(a16046586cbaa000e056115c92b5f22bf49869ad) ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp index 13c67039f01..27b3fd6b514 100644 --- a/src/mame/drivers/atarist.cpp +++ b/src/mame/drivers/atarist.cpp @@ -1780,11 +1780,6 @@ WRITE_LINE_MEMBER(st_state::write_acia_clock) } -WRITE_LINE_MEMBER( st_state::mfp_tdo_w ) -{ - m_mfp->clock_w(state); -} - WRITE_LINE_MEMBER( st_state::fdc_drq_w ) { if (state && (!(m_fdc_mode & DMA_MODE_ENABLED)) && (m_fdc_mode & DMA_MODE_FDC_HDC_ACK)) @@ -2019,14 +2014,13 @@ void st_state::common(machine_config &config) MC68901(config, m_mfp, Y2/8); m_mfp->set_timer_clock(Y1); - m_mfp->set_rx_clock(0); - m_mfp->set_tx_clock(0); m_mfp->out_irq_cb().set_inputline(m_maincpu, M68K_IRQ_6); - m_mfp->out_tdo_cb().set(FUNC(st_state::mfp_tdo_w)); + m_mfp->out_tdo_cb().set(m_mfp, FUNC(mc68901_device::tc_w)); + m_mfp->out_tdo_cb().append(m_mfp, FUNC(mc68901_device::rc_w)); m_mfp->out_so_cb().set(m_rs232, FUNC(rs232_port_device::write_txd)); RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); - m_rs232->rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); + m_rs232->rxd_handler().set(m_mfp, FUNC(mc68901_device::si_w)); m_rs232->dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); m_rs232->cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); m_rs232->ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); @@ -2224,10 +2218,9 @@ void stbook_state::stbook(machine_config &config) MC68901(config, m_mfp, U517/8); m_mfp->set_timer_clock(Y1); - m_mfp->set_rx_clock(0); - m_mfp->set_tx_clock(0); m_mfp->out_irq_cb().set_inputline(M68000_TAG, M68K_IRQ_6); - m_mfp->out_tdo_cb().set(FUNC(st_state::mfp_tdo_w)); + m_mfp->out_tdo_cb().set(m_mfp, FUNC(mc68901_device::tc_w)); + m_mfp->out_tdo_cb().append(m_mfp, FUNC(mc68901_device::rc_w)); m_mfp->out_so_cb().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); WD1772(config, m_fdc, U517/2); @@ -2243,7 +2236,7 @@ void stbook_state::stbook(machine_config &config) m_centronics->set_output_latch(cent_data_out); RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); - m_rs232->rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); + m_rs232->rxd_handler().set(m_mfp, FUNC(mc68901_device::si_w)); m_rs232->dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); m_rs232->cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); m_rs232->ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp index 23eec4b26c2..eaf5dc76ccb 100644 --- a/src/mame/drivers/atarisy1.cpp +++ b/src/mame/drivers/atarisy1.cpp @@ -2563,18 +2563,18 @@ GAME( 1985, indytemp4, indytemp, indytemp, indytemp, atarisy1_state, init_indyt GAME( 1985, indytempd, indytemp, indytemp, indytemp, atarisy1_state, init_indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (German)", 0 ) GAME( 1985, indytempc, indytemp, indytemp, indytemc, atarisy1_state, init_indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (Cocktail)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1985, roadrunn, atarisy1, roadrunn, roadrunn, atarisy1_state, init_roadrunn, ROT0, "Atari Games", "Road Runner (rev 2)", 0 ) -GAME( 1985, roadrunn2, roadrunn, roadrunn, roadrunn, atarisy1_state, init_roadrunn, ROT0, "Atari Games", "Road Runner (rev 1+)", 0 ) -GAME( 1985, roadrunn1, roadrunn, roadrunn, roadrunn, atarisy1_state, init_roadrunn, ROT0, "Atari Games", "Road Runner (rev 1)", 0 ) - -GAME( 1987, roadblst, atarisy1, roadb110, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 4)", 0 ) -GAME( 1987, roadblstg, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev 3)", 0 ) -GAME( 1987, roadblst3, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 3)", 0 ) -GAME( 1987, roadblstg2, roadblst, roadb110, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev 2)", 0 ) -GAME( 1987, roadblst2, roadblst, roadb110, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 2)", 0 ) -GAME( 1987, roadblstg1, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev 1)", 0 ) -GAME( 1987, roadblst1, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 1)", 0 ) -GAME( 1987, roadblstc, roadblst, roadb110, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (cockpit, rev 2)", 0 ) -GAME( 1987, roadblstcg, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (cockpit, German, rev 1)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1987, roadblstc1, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (cockpit, rev 1)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1987, roadblstgu, roadblst, roadb109, roadblst, atarisy1_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev ?)", 0 ) +GAME( 1985, roadrunn, atarisy1, roadrunn, roadrunn, atarisy1r_state, init_roadrunn, ROT0, "Atari Games", "Road Runner (rev 2)", 0 ) +GAME( 1985, roadrunn2, roadrunn, roadrunn, roadrunn, atarisy1r_state, init_roadrunn, ROT0, "Atari Games", "Road Runner (rev 1+)", 0 ) +GAME( 1985, roadrunn1, roadrunn, roadrunn, roadrunn, atarisy1r_state, init_roadrunn, ROT0, "Atari Games", "Road Runner (rev 1)", 0 ) + +GAME( 1987, roadblst, atarisy1, roadb110, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 4)", 0 ) +GAME( 1987, roadblstg, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev 3)", 0 ) +GAME( 1987, roadblst3, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 3)", 0 ) +GAME( 1987, roadblstg2, roadblst, roadb110, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev 2)", 0 ) +GAME( 1987, roadblst2, roadblst, roadb110, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 2)", 0 ) +GAME( 1987, roadblstg1, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev 1)", 0 ) +GAME( 1987, roadblst1, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, rev 1)", 0 ) +GAME( 1987, roadblstc, roadblst, roadb110, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (cockpit, rev 2)", 0 ) +GAME( 1987, roadblstcg, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (cockpit, German, rev 1)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1987, roadblstc1, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (cockpit, rev 1)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1987, roadblstgu, roadblst, roadb109, roadblst, atarisy1r_state, init_roadblst, ROT0, "Atari Games", "Road Blasters (upright, German, rev ?)", 0 ) diff --git a/src/mame/drivers/atarittl.cpp b/src/mame/drivers/atarittl.cpp index dfe252d9be8..23258bcec78 100644 --- a/src/mame/drivers/atarittl.cpp +++ b/src/mame/drivers/atarittl.cpp @@ -93,8 +93,8 @@ #define HRES_MULT (1) // end -#define SC_VIDCLOCK (14318181/2) -#define SC_HTOTAL (0x1C8+1) // 456 +#define SC_VIDCLOCK (14318000/2) +#define SC_HTOTAL (0x1C8+0) // 456 #define SC_VTOTAL (0x103+1) // 259 #define SC_HBSTART (SC_HTOTAL) #define SC_HBEND (32) @@ -138,34 +138,10 @@ public: stuntcyc_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - //, m_video(*this, "fixfreq") - , m_probe_screen(*this, "screen") - , m_probe_bit0(0.0) - , m_probe_bit1(0.0) - , m_probe_bit2(0.0) - , m_probe_bit3(0.0) - , m_probe_bit4(0.0) - , m_probe_bit5(0.0) - , m_probe_bit6(0.0) - , m_probe_data(nullptr) - , m_last_beam(0.0) - , m_last_hpos(0) - , m_last_vpos(0) - , m_last_fraction(0.0) + , m_video(*this, "fixfreq") { } - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit0_cb); - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit1_cb); - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit2_cb); - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit3_cb); - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit4_cb); - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit5_cb); - NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit6_cb); - NETDEV_LOGIC_CALLBACK_MEMBER(probe_clock_cb); - - uint32_t screen_update_stuntcyc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void stuntcyc(machine_config &config); protected: @@ -175,23 +151,7 @@ protected: private: required_device<netlist_mame_device> m_maincpu; - //required_device<fixedfreq_device> m_video; - required_device<screen_device> m_probe_screen; - - int m_probe_bit0; - int m_probe_bit1; - int m_probe_bit2; - int m_probe_bit3; - int m_probe_bit4; - int m_probe_bit5; - int m_probe_bit6; - - std::unique_ptr<int[]> m_probe_data; - - int m_last_beam; - int m_last_hpos; - int m_last_vpos; - double m_last_fraction; + required_device<fixedfreq_device> m_video; }; class gtrak10_state : public driver_device @@ -236,93 +196,10 @@ void atarikee_state::video_start() void stuntcyc_state::machine_start() { - save_item(NAME(m_probe_bit0)); - save_item(NAME(m_probe_bit1)); - save_item(NAME(m_probe_bit2)); - save_item(NAME(m_probe_bit3)); - save_item(NAME(m_probe_bit4)); - save_item(NAME(m_probe_bit5)); - save_item(NAME(m_probe_bit6)); - save_item(NAME(m_last_beam)); - save_item(NAME(m_last_hpos)); - save_item(NAME(m_last_vpos)); - save_item(NAME(m_last_fraction)); - - m_probe_bit0 = 0; - m_probe_bit1 = 0; - m_probe_bit2 = 0; - m_probe_bit3 = 0; - m_probe_bit4 = 0; - m_probe_bit5 = 0; - m_probe_bit6 = 0; - - m_probe_data = std::make_unique<int[]>(SC_HTOTAL * SC_VTOTAL); } void stuntcyc_state::machine_reset() { - m_probe_bit0 = 0; - m_probe_bit1 = 0; - m_probe_bit2 = 0; - m_probe_bit3 = 0; - m_probe_bit4 = 0; - m_probe_bit5 = 0; - m_probe_bit6 = 0; -} - -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit0_cb) { m_probe_bit0 = data; } -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit1_cb) { m_probe_bit1 = data; } -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit2_cb) { m_probe_bit2 = data; } -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit3_cb) { m_probe_bit3 = data; } -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit4_cb) { m_probe_bit4 = data; } -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit5_cb) { m_probe_bit5 = data; } -NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit6_cb) { m_probe_bit6 = data; } -NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_clock_cb) -{ - synchronize(); - attotime second_fraction(0, time.attoseconds()); - attotime frame_fraction(0, (second_fraction * 60).attoseconds()); - attotime pixel_time = frame_fraction * (SC_HTOTAL * SC_VTOTAL); - int32_t pixel_index = (frame_fraction * (SC_HTOTAL * SC_VTOTAL)).seconds(); - double pixel_fraction = ATTOSECONDS_TO_DOUBLE(pixel_time.attoseconds()); - - const int hpos = pixel_index % SC_HTOTAL;//m_screen->hpos(); - const int vpos = pixel_index / SC_HTOTAL;//m_screen->vpos(); - const int curr_index = vpos * SC_HTOTAL + hpos; - - int last_index = m_last_vpos * SC_HTOTAL + m_last_hpos; - if (last_index != curr_index) - { - m_probe_data[last_index] = int(double(m_probe_data[last_index]) * m_last_fraction); - m_probe_data[last_index] += int(double(m_last_beam) * (1.0 - m_last_fraction)); - last_index++; - while (last_index <= curr_index) - m_probe_data[last_index++] = m_last_beam; - } - - //m_last_beam = float(data); - m_last_beam = m_probe_bit0 + m_probe_bit1 * 2 + m_probe_bit2 * 4 + m_probe_bit3 * 8 + m_probe_bit4 * 16 + m_probe_bit5 * 32 + m_probe_bit6 * 64; - m_last_hpos = hpos; - m_last_vpos = vpos; - m_last_fraction = pixel_fraction; -} - -uint32_t stuntcyc_state::screen_update_stuntcyc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - m_last_hpos = 0; - m_last_vpos = 0; - - uint32_t pixindex = 0; - for (int y = 0; y < SC_VTOTAL; y++) - { - uint32_t *scanline = &bitmap.pix32(y); - pixindex = y * SC_HTOTAL; - for (int x = 0; x < SC_HTOTAL; x++) - *scanline++ = 0xff000000 | (m_probe_data[pixindex++] * 0x010101); - //*scanline++ = 0xff000000 | (uint8_t(m_screen_buf[pixindex++] * 63.0) * 0x010101); - } - - return 0; } void atarikee_state::atarikee(machine_config &config) @@ -347,26 +224,18 @@ void stuntcyc_state::stuntcyc(machine_config &config) { /* basic machine hardware */ NETLIST_CPU(config, m_maincpu, STUNTCYC_NL_CLOCK).set_source(netlist_stuntcyc); + NETLIST_ANALOG_OUTPUT(config, "maincpu:vid0", 0).set_params("VIDEO_OUT", "fixfreq", FUNC(fixedfreq_device::update_composite_monochrome)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit0", 0).set_params("probe_bit0", FUNC(stuntcyc_state::probe_bit0_cb)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit1", 0).set_params("probe_bit1", FUNC(stuntcyc_state::probe_bit1_cb)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit2", 0).set_params("probe_bit2", FUNC(stuntcyc_state::probe_bit2_cb)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit3", 0).set_params("probe_bit3", FUNC(stuntcyc_state::probe_bit3_cb)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit4", 0).set_params("probe_bit4", FUNC(stuntcyc_state::probe_bit4_cb)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit5", 0).set_params("probe_bit5", FUNC(stuntcyc_state::probe_bit5_cb)); - NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit6", 0).set_params("probe_bit6", FUNC(stuntcyc_state::probe_bit6_cb)); - NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_clock", 0).set_params("probe_clock", FUNC(stuntcyc_state::probe_clock_cb)); - -/* video hardware */ - SCREEN(config, m_probe_screen, SCREEN_TYPE_RASTER); - m_probe_screen->set_screen_update(FUNC(stuntcyc_state::screen_update_stuntcyc)); - m_probe_screen->set_raw(SC_HTOTAL*SC_VTOTAL*60, SC_HTOTAL, 0, SC_HTOTAL, SC_VTOTAL, 0, SC_VTOTAL); - //FIXFREQ(config, m_video).set_screen("screen"); - //m_video->set_monitor_clock(SC_VIDCLOCK); - //m_video->set_horz_params(SC_HTOTAL-67,SC_HTOTAL-40,SC_HTOTAL-8, SC_HTOTAL); - //m_video->set_vert_params(SC_VTOTAL-22,SC_VTOTAL-19,SC_VTOTAL-12,SC_VTOTAL); - //m_video->set_fieldcount(1); - //m_video->set_threshold(0.30); + /* video hardware */ + SCREEN(config, "screen", SCREEN_TYPE_RASTER); + FIXFREQ(config, m_video).set_screen("screen"); + m_video->set_monitor_clock(SC_VIDCLOCK); + m_video->set_horz_params(SC_HTOTAL-84,SC_HTOTAL-64,SC_HTOTAL-16, SC_HTOTAL); + m_video->set_vert_params(SC_VTOTAL-21,SC_VTOTAL-17,SC_VTOTAL-12, SC_VTOTAL); + m_video->set_fieldcount(1); + m_video->set_threshold(0.89); + m_video->set_gain(0.2); + m_video->set_horz_scale(4); } void gtrak10_state::gtrak10(machine_config &config) diff --git a/src/mame/drivers/atetris.cpp b/src/mame/drivers/atetris.cpp index 956d7d2538e..9d758e5cabb 100644 --- a/src/mame/drivers/atetris.cpp +++ b/src/mame/drivers/atetris.cpp @@ -588,8 +588,27 @@ ROM_START( atetb3482 ) ROM_REGION( 0x10000, "gfx1", 0 ) ROM_LOAD( "f8-d2.bin", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) ) - ROM_REGION( 0x08000, "tunes", 0 ) // Not hooked up. Same 8K repeated four times - ROM_LOAD( "k1-d3.bin", 0x00000, 0x08000, CRC(ce51c82b) SHA1(f90ed16f817e6b2a22b69db20348386b9c1ecb67) ) + ROM_REGION( 0x8000, "soundcpu", 0 ) // Not hooked up + ROM_LOAD( "k1-d3.bin", 0x0000, 0x8000, CRC(ce51c82b) SHA1(f90ed16f817e6b2a22b69db20348386b9c1ecb67) ) // Same 8K repeated four times + + // See http://www.seanriddle.com/um348x/ for notes about the UM3482 + ROM_REGION( 0x01f0, "um3482", 0 ) // Not hooked up + + /* Notes (3584 bits, which matches the datasheet's 512 7-bit notes). + Raw dump from visual decap, needs further analysis. */ + ROM_LOAD( "um3482araw.bin", 0x0000, 0x01c0, BAD_DUMP CRC(5871d564) SHA1(4203b6513ad08ece26177778e5defeb862d1a81d) ) + + /* 16 entry by 9-bit ROM + Song starting locations? Chip has 16 songs max, 512 total notes. + All 16 entries have data, but only 12 songs on chip. + Dump from visual decap with values padded to 16 bits, needs further analysis. */ + ROM_LOAD( "offsets.bin", 0x0000, 0x0020, BAD_DUMP CRC(f39aff3c) SHA1(255dcea154ed04c6d1968b09e188ca5fc8821721) ) + + /* 16 entry by 7-bit ROM. + Tempo for each song? + All 16 entries have data, but only 12 songs on chip. + Dump from visual decap with values padded to 8 bits, needs further analysis. */ + ROM_LOAD( "tempos.bin", 0x0000, 0x0010, BAD_DUMP CRC(c3a37f74) SHA1(67eac8c6530c202760d492f3e52c44f9cd183b46) ) /* Not dumped, unused */ ROM_REGION( 0x71c, "plds", 0 ) @@ -604,13 +623,13 @@ ROM_END /* - This ROM came from a prototype bartop field-test machine from an + This ROM came from a prototype bartop field-test machine from an ex-Atari Employee. PCB is screened : A044809 - The PCB does not draw its power from the JAMMA connector, instead a -small AC voltage is taken onboard and regulated down as this pcb has + The PCB does not draw its power from the JAMMA connector, instead a +small AC voltage is taken onboard and regulated down as this pcb has only a small power requirement! The label on the rom says : @@ -622,7 +641,7 @@ B4FF The cabinet is completely custom made by Atari, and this pcb differs greatly from the production pcb that we know of. The machine was operated -on location at a local bar but did not perform well so they decided it +on location at a local bar but did not perform well so they decided it wasn't a viable game to make, its the only known example. */ diff --git a/src/mame/drivers/atpci.cpp b/src/mame/drivers/atpci.cpp index 82bd6d3fa5d..e7c4c3e46d0 100644 --- a/src/mame/drivers/atpci.cpp +++ b/src/mame/drivers/atpci.cpp @@ -29,9 +29,9 @@ protected: DECLARE_WRITE8_MEMBER(boot_state_w); - static void tx_config(device_t *device); - static void sb_config(device_t *device); - static void superio_config(device_t *device); + void tx_config(device_t *device); + void sb_config(device_t *device); + void superio_config(device_t *device); void at586_io(address_map &map); void at586_map(address_map &map); @@ -48,15 +48,16 @@ WRITE8_MEMBER(at586_state::boot_state_w) void at586_state::tx_config(device_t *device) { - downcast<i82439tx_device *>(device)->set_cpu("maincpu"); + downcast<i82439tx_device *>(device)->set_cpu(m_maincpu); downcast<i82439tx_device *>(device)->set_region("isa"); } void at586_state::sb_config(device_t *device) { i82371sb_device &sb = *downcast<i82371sb_device *>(device); + sb.set_cpu(m_maincpu); sb.boot_state_hook().set(":", FUNC(at586_state::boot_state_w)); - sb.smi().set_inputline(":maincpu", INPUT_LINE_SMI); + sb.smi().set_inputline(m_maincpu, INPUT_LINE_SMI); } @@ -64,8 +65,8 @@ void at586_state::superio_config(device_t *device) { fdc37c93x_device &fdc = *downcast<fdc37c93x_device *>(device); fdc.set_sysopt_pin(1); - fdc.gp20_reset().set_inputline(":maincpu", INPUT_LINE_RESET); - fdc.gp25_gatea20().set_inputline(":maincpu", INPUT_LINE_A20); + fdc.gp20_reset().set_inputline(m_maincpu, INPUT_LINE_RESET); + fdc.gp25_gatea20().set_inputline(m_maincpu, INPUT_LINE_A20); fdc.irq1().set(":pcibus:7:i82371sb:pic8259_master", FUNC(pic8259_device::ir1_w)); } @@ -115,7 +116,7 @@ void at586_state::at586(machine_config &config) RAM(config, RAM_TAG).set_default_size("4M").set_extra_options("1M,2M,8M,16M,32M,64M,128M,256M"); PCI_BUS(config, "pcibus", 0).set_busnum(0); - PCI_CONNECTOR(config, "pcibus:0", pci_devices, "i82439tx", true).set_option_machine_config("i82439tx", tx_config); + PCI_CONNECTOR(config, "pcibus:0", pci_devices, "i82439tx", true).set_option_machine_config("i82439tx", [this](device_t *device) { tx_config(device); }); PCI_CONNECTOR(config, "pcibus:1", pci_devices, "i82371ab", true); // FIXME: determine ISA bus clock @@ -139,8 +140,8 @@ void at586_state::at586x3(machine_config &config) RAM(config, RAM_TAG).set_default_size("4M").set_extra_options("1M,2M,8M,16M,32M,64M,128M,256M"); PCI_BUS(config, "pcibus", 0).set_busnum(0); - PCI_CONNECTOR(config, "pcibus:0", pci_devices, "i82439tx", true).set_option_machine_config("i82439tx", tx_config); - PCI_CONNECTOR(config, "pcibus:1", pci_devices, "i82371sb", true).set_option_machine_config("i82371sb", sb_config); + PCI_CONNECTOR(config, "pcibus:0", pci_devices, "i82439tx", true).set_option_machine_config("i82439tx", [this](device_t *device) { tx_config(device); }); + PCI_CONNECTOR(config, "pcibus:1", pci_devices, "i82371sb", true).set_option_machine_config("i82371sb", [this](device_t *device) { sb_config(device); }); // FIXME: determine ISA bus clock ISA16_SLOT(config, "isa1", 0, "pcibus:1:i82371sb:isabus", pc_isa16_cards, "svga_et4k", false); @@ -167,10 +168,10 @@ void at586_state::at586m55(machine_config &config) RAM(config, RAM_TAG).set_default_size("4M").set_extra_options("1M,2M,8M,16M,32M,64M,128M,256M"); PCI_BUS(config, "pcibus", 0).set_busnum(0); - PCI_CONNECTOR(config, "pcibus:0", pci_devices, "i82439tx", true).set_option_machine_config("i82439tx", tx_config); - PCI_CONNECTOR(config, "pcibus:7", pci_devices, "i82371sb", true).set_option_machine_config("i82371sb", sb_config); + PCI_CONNECTOR(config, "pcibus:0", pci_devices, "i82439tx", true).set_option_machine_config("i82439tx", [this](device_t *device) { tx_config(device); }); + PCI_CONNECTOR(config, "pcibus:7", pci_devices, "i82371sb", true).set_option_machine_config("i82371sb", [this](device_t *device) { sb_config(device); }); - ISA16_SLOT(config, "board4", 0, "pcibus:7:i82371sb:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", superio_config); + ISA16_SLOT(config, "board4", 0, "pcibus:7:i82371sb:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", [this](device_t *device) { superio_config(device); }); ISA16_SLOT(config, "isa1", 0, "pcibus:7:i82371sb:isabus", pc_isa16_cards, "svga_et4k", false); ISA16_SLOT(config, "isa2", 0, "pcibus:7:i82371sb:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa3", 0, "pcibus:7:i82371sb:isabus", pc_isa16_cards, nullptr, false); diff --git a/src/mame/drivers/att3b2.cpp b/src/mame/drivers/att3b2.cpp new file mode 100644 index 00000000000..845f33aeb40 --- /dev/null +++ b/src/mame/drivers/att3b2.cpp @@ -0,0 +1,122 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for AT&T Model 3B2 computer. + +****************************************************************************/ + +#include "emu.h" +#include "cpu/we32000/we32100.h" +#include "machine/am9517a.h" +#include "machine/mc68681.h" +#include "machine/pit8253.h" +//#include "machine/upd7261.h" +#include "machine/wd_fdc.h" + +class att3b2_state : public driver_device +{ +public: + att3b2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void att3b2(machine_config &config); + void att3b26(machine_config &config); + +private: + void mem_map_300(address_map &map); + void mem_map_600(address_map &map); + + required_device<we32100_device> m_maincpu; +}; + + +void att3b2_state::mem_map_300(address_map &map) +{ + map(0x00000000, 0x00007fff).rom().region("bootstrap", 0); + map(0x00042000, 0x0004200f).rw("pit", FUNC(pit8253_device::read), FUNC(pit8253_device::write)).umask32(0x000000ff); + map(0x00048000, 0x0004800f).rw("dmac", FUNC(am9517a_device::read), FUNC(am9517a_device::write)); + map(0x00049000, 0x0004900f).rw("duart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)); + //map(0x0004a000, 0x0004a001).rw("hdc", FUNC(upd7261_device::read), FUNC(upd7261_device::write)); + map(0x0004d000, 0x0004d003).rw("fdc", FUNC(wd2797_device::read), FUNC(wd2797_device::write)); + map(0x02000000, 0x02003fff).ram(); +} + +void att3b2_state::mem_map_600(address_map &map) +{ + map(0x00000000, 0x0001ffff).rom().region("bootstrap", 0); + map(0x00041000, 0x0004100f).rw("pit", FUNC(pit8253_device::read), FUNC(pit8253_device::write)).umask32(0x000000ff); + map(0x00048000, 0x0004800f).rw("dmac", FUNC(am9517a_device::read), FUNC(am9517a_device::write)); + map(0x00049000, 0x0004900f).rw("duart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)); + map(0x0004a000, 0x0004a003).rw("fdc", FUNC(wd2797_device::read), FUNC(wd2797_device::write)); + map(0x02000000, 0x02003fff).mirror(0x1000000).ram(); +} + + +static INPUT_PORTS_START(att3b2) +INPUT_PORTS_END + +void att3b2_state::att3b2(machine_config &config) +{ + WE32100(config, m_maincpu, 10_MHz_XTAL); // special WE32102 XTAL runs at 1x or 2x speed + m_maincpu->set_addrmap(AS_PROGRAM, &att3b2_state::mem_map_300); + + PIT8253(config, "pit"); // D8253C-5; unknown clocks + + AM9517A(config, "dmac", 5'000'000); // AM9517A-5DC; unknown clock + + SCN2681(config, "duart", 3'686'400); // MC2681P + + // TODO: hard disk controller (NEC D7261AD) + + WD2797(config, "fdc", 1'000'000); // TMS2797NL + + // TODO: RTC (MM58174AN) +} + +void att3b2_state::att3b26(machine_config &config) +{ + att3b2(config); + m_maincpu->set_clock(18'000'000); + m_maincpu->set_addrmap(AS_PROGRAM, &att3b2_state::mem_map_600); +} + +ROM_START(3b2_300) + ROM_REGION32_BE(0x8000, "bootstrap", 0) + ROM_LOAD32_BYTE("3b2300-c.bin", 0x0000, 0x2000, CRC(b7f955c5) SHA1(54886c4fce5a5681af84538b65de1cc68d0f7af4)) + ROM_LOAD32_BYTE("3b2300-d.bin", 0x0001, 0x2000, CRC(5812e262) SHA1(5a69714c0c8f21d7655e43443dee0e76cf219403)) + ROM_LOAD32_BYTE("3b2300-e.bin", 0x0002, 0x2000, CRC(e28ca685) SHA1(a337a0480218db8c2d984442f7bc560834853152)) + ROM_LOAD32_BYTE("3b2300-f.bin", 0x0003, 0x2000, CRC(b8e138c4) SHA1(d2da4a7150150d0f9294814edb7ed357f9341858)) +ROM_END + +ROM_START(3b2_310) + ROM_REGION32_BE(0x8000, "bootstrap", 0) + ROM_LOAD32_BYTE("aayyc.bin", 0x0000, 0x2000, CRC(b7f955c5) SHA1(54886c4fce5a5681af84538b65de1cc68d0f7af4)) + ROM_LOAD32_BYTE("aayyd.bin", 0x0001, 0x2000, CRC(5812e262) SHA1(5a69714c0c8f21d7655e43443dee0e76cf219403)) + ROM_LOAD32_BYTE("aayye.bin", 0x0002, 0x2000, CRC(e28ca685) SHA1(a337a0480218db8c2d984442f7bc560834853152)) + ROM_LOAD32_BYTE("aayyf.bin", 0x0003, 0x2000, CRC(39dcfd8c) SHA1(2e662b3811f78ab689bc2687b73e3158f33f7f89)) +ROM_END + +ROM_START(3b2_400) + ROM_REGION32_BE(0x8000, "bootstrap", 0) + ROM_LOAD32_BYTE("3b2-aayyc.bin", 0x0000, 0x2000, CRC(b7f955c5) SHA1(54886c4fce5a5681af84538b65de1cc68d0f7af4)) + ROM_LOAD32_BYTE("3b2-aayyd.bin", 0x0001, 0x2000, CRC(5812e262) SHA1(5a69714c0c8f21d7655e43443dee0e76cf219403)) + ROM_LOAD32_BYTE("3b2-aayye.bin", 0x0002, 0x2000, CRC(e28ca685) SHA1(a337a0480218db8c2d984442f7bc560834853152)) + ROM_LOAD32_BYTE("3b2-aayyf-4.bin", 0x0003, 0x2000, CRC(85b8c5d3) SHA1(85bdf3f889f6c14cbf33ce81421f1f1d02328223)) +ROM_END + +ROM_START(3b2_600) + ROM_REGION32_BE(0x20000, "bootstrap", 0) + ROM_LOAD32_BYTE("abtry.bin", 0x0000, 0x8000, CRC(fa8d488b) SHA1(2e169f4171bd30aba1a9cd550a418c943eb78ceb)) + ROM_LOAD32_BYTE("abtrw.bin", 0x0001, 0x8000, CRC(8705cb68) SHA1(f41365cd0b4f90d8ad0335655b0ac04a7d14d6c6)) + ROM_LOAD32_BYTE("abtru.bin", 0x0002, 0x8000, CRC(ea9e127b) SHA1(6618998ead5a5e07ead8c572619a6bcf71d84497)) + ROM_LOAD32_BYTE("abtrt.bin", 0x0003, 0x8000, CRC(0f075161) SHA1(b67c9c4549dc789df33b5a38e4b35fe26fdfbea6)) +ROM_END + +COMP(1985, 3b2_300, 0, 0, att3b2, att3b2, att3b2_state, empty_init, "AT&T", "3B2/300", MACHINE_IS_SKELETON) +COMP(198?, 3b2_310, 3b2_300, 0, att3b2, att3b2, att3b2_state, empty_init, "AT&T", "3B2/310", MACHINE_IS_SKELETON) +COMP(198?, 3b2_400, 3b2_300, 0, att3b2, att3b2, att3b2_state, empty_init, "AT&T", "3B2/400", MACHINE_IS_SKELETON) +COMP(198?, 3b2_600, 0, 0, att3b26, att3b2, att3b2_state, empty_init, "AT&T", "3B2/600", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/att610.cpp b/src/mame/drivers/att610.cpp new file mode 100644 index 00000000000..788ba65a79f --- /dev/null +++ b/src/mame/drivers/att610.cpp @@ -0,0 +1,149 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for AT&T 610 Business Communication Terminal (BCT). + + The video ASIC is a 68-pin PLCC marked: + + (M) AT&T + 1006B2* + 456555 + 18289S 71 + + Another custom IC (28-pin DIP) is next to the character generator: + + WE + 492A* + 18186 71 + +****************************************************************************/ + +#include "emu.h" + +//#include "bus/rs232/rs232.h" +#include "cpu/z80/z80.h" +#include "machine/mc68681.h" +#include "machine/z80ctc.h" +#include "machine/z80sio.h" +#include "screen.h" + +class att610_state : public driver_device +{ +public: + att610_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_sio(*this, "sio") + , m_screen(*this, "screen") + , m_rom(*this, "rom") + { + } + + void att610(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void cart_select_w(u8 data); + + void mem_map(address_map &map); + void io_map(address_map &map); + + required_device<z80_device> m_maincpu; + required_device<z80sio_device> m_sio; + required_device<screen_device> m_screen; + required_memory_bank m_rom; +}; + +void att610_state::machine_start() +{ + m_rom->configure_entry(0, memregion("firmware")->base()); + m_rom->configure_entry(1, memregion("cartridge")->base()); + + m_sio->ctsb_w(0); +} + +void att610_state::machine_reset() +{ + m_rom->set_entry(0); +} + +u32 att610_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void att610_state::cart_select_w(u8 data) +{ + m_rom->set_entry(BIT(data, 0)); +} + +void att610_state::mem_map(address_map &map) +{ + map(0x0000, 0x5fff).bankr("rom"); + map(0xc000, 0xffff).ram(); +} + +void att610_state::io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x03).rw("sio", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); + map(0x10, 0x10).w(FUNC(att610_state::cart_select_w)); + map(0x60, 0x63).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); + map(0x70, 0x7f).rw("duart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)); +} + + +static INPUT_PORTS_START(att610) + // TODO: supports 103-key (56K430/ACZ) and 98-key (56K420/ADA) keyboards +INPUT_PORTS_END + +static const z80_daisy_config daisy_chain[] = +{ + { "sio" }, + { "ctc" }, + { nullptr } +}; + +void att610_state::att610(machine_config &config) +{ + Z80(config, m_maincpu, 27.72_MHz_XTAL / 7); // MK3880N-4; CPU clock guessed + m_maincpu->set_addrmap(AS_PROGRAM, &att610_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &att610_state::io_map); + m_maincpu->set_daisy_config(daisy_chain); + + z80ctc_device &ctc(Z80CTC(config, "ctc", 27.72_MHz_XTAL / 7)); // Z8430APS + ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + Z80SIO(config, m_sio, 27.72_MHz_XTAL / 7); // Z8441APS (SIO/1) + m_sio->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + scn2681_device &duart(SCN2681(config, "duart", 3'686'400)); // MC2681P (adjacent XTAL not legible) + duart.irq_cb().set("sio", FUNC(z80sio_device::syncb_w)).invert(); + duart.outport_cb().set("sio", FUNC(z80sio_device::rxcb_w)).bit(3); + duart.outport_cb().append("sio", FUNC(z80sio_device::txcb_w)).bit(3); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER, rgb_t::green()); + m_screen->set_raw(21.6675_MHz_XTAL, 963, 0, 720, 375, 0, 351); + //m_screen->set_raw(27.72_MHz_XTAL, 1232, 0, 924, 375, 0, 351); + m_screen->set_screen_update(FUNC(att610_state::screen_update)); + m_screen->screen_vblank().set("ctc", FUNC(z80ctc_device::trg0)); +} + +ROM_START(att610) + ROM_REGION(0x6000, "firmware", 0) + ROM_LOAD("455798-1.d4", 0x0000, 0x4000, CRC(91bd636f) SHA1(53bc886ba580dd64446ebe9b8a042414ff8834d6)) // MBM27128-25 + ROM_LOAD("455799-1.b4", 0x4000, 0x2000, CRC(7fd75ee0) SHA1(597b23c43b3f283b49b51b9dee60109ff683b041)) // MBM2764-25 + + ROM_REGION(0x6000, "cartridge", ROMREGION_ERASE00) // optional + + ROM_REGION(0x2000, "chargen", 0) + ROM_LOAD("att-tc85_456309-1.h7", 0x0000, 0x2000, CRC(d313e022) SHA1(a24df1d8d8c55413e4cdb0734783c0fa244bdf00)) // HN27C64G-15 +ROM_END + +COMP(1986, att610, 0, 0, att610, att610, att610_state, empty_init, "AT&T", "610 Business Communication Terminal", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/att630.cpp b/src/mame/drivers/att630.cpp index 5fe8d767a78..96e0626ea4a 100644 --- a/src/mame/drivers/att630.cpp +++ b/src/mame/drivers/att630.cpp @@ -22,6 +22,7 @@ public: { } void att630(machine_config &config); + void att730x(machine_config &config); protected: virtual void machine_start() override; @@ -32,7 +33,8 @@ private: u8 bram_r(offs_t offset); void bram_w(offs_t offset, u8 data); - void mem_map(address_map &map); + void att630_map(address_map &map); + void att730_map(address_map &map); required_device<m68000_device> m_maincpu; required_shared_ptr<u16> m_vram; @@ -67,7 +69,7 @@ void att630_state::bram_w(offs_t offset, u8 data) m_bram_data[offset] = data; } -void att630_state::mem_map(address_map &map) +void att630_state::att630_map(address_map &map) { map(0x000000, 0x03ffff).rom().region("maincpu", 0); map(0x040000, 0x0fffff).noprw(); // additional space for rom @@ -81,13 +83,22 @@ void att630_state::mem_map(address_map &map) map(0xe00000, 0xe03fff).mirror(0x1fc000).rw(FUNC(att630_state::bram_r), FUNC(att630_state::bram_w)).umask16(0x00ff); } +void att630_state::att730_map(address_map &map) +{ + att630_map(map); + map(0x040000, 0x05ffff).rom().region("maincpu", 0x40000); + map(0x100000, 0x15ffff).rom().region("cart", 0); + map(0x800000, 0x83ffff).ram(); // expansion RAM + map(0xde0000, 0xdfffff).rom().region("starlan", 0); +} + static INPUT_PORTS_START( att630 ) INPUT_PORTS_END void att630_state::att630(machine_config &config) { M68000(config, m_maincpu, 40_MHz_XTAL / 4); // clock not confirmed - m_maincpu->set_addrmap(AS_PROGRAM, &att630_state::mem_map); + m_maincpu->set_addrmap(AS_PROGRAM, &att630_state::att630_map); m_maincpu->set_cpu_space(AS_PROGRAM); // vectors are in BRAM NVRAM(config, "bram", nvram_device::DEFAULT_ALL_0); // 5264 + battery @@ -97,9 +108,17 @@ void att630_state::att630(machine_config &config) screen.set_color(rgb_t::amber()); screen.set_screen_update(FUNC(att630_state::screen_update)); - SCN2681(config, "duart1", 3.6864_MHz_XTAL); + scn2681_device &duart1(SCN2681(config, "duart1", 3.6864_MHz_XTAL)); + duart1.irq_cb().set_inputline(m_maincpu, M68K_IRQ_3); + + scn2681_device &duart2(SCN2681(config, "duart2", 3.6864_MHz_XTAL)); + duart2.irq_cb().set_inputline(m_maincpu, M68K_IRQ_2); +} - SCN2681(config, "duart2", 3.6864_MHz_XTAL); +void att630_state::att730x(machine_config &config) +{ + att630(config); + m_maincpu->set_addrmap(AS_PROGRAM, &att630_state::att730_map); } @@ -119,4 +138,28 @@ ROM_START( att630 ) ROM_LOAD16_BYTE( "460622-1.bin", 0x20001, 0x10000, CRC(c108c1e0) SHA1(ef01349e890b8a4117c01e78d1c23fbd113ba58f) ) ROM_END +ROM_START( att730x ) + ROM_REGION(0x60000, "maincpu", 0) // D27512-200V10 EPROMs "© AT&T 1990" + ROM_LOAD16_BYTE( "106219637_mln3.bin", 0x00000, 0x10000, CRC(8bb2f5f9) SHA1(e7a50b8da4dde5479c8184f89f59daf511989377) ) + ROM_LOAD16_BYTE( "106219645_mln2.bin", 0x00001, 0x10000, CRC(5663da5b) SHA1(a572381a4ca73c3ddac2eff461603c8b46949687) ) + ROM_LOAD16_BYTE( "106219652_mlq3.bin", 0x20000, 0x10000, CRC(e0f88160) SHA1(2def2bb1ad11eb976bfbab25ffa536fd14eb75ca) ) + ROM_LOAD16_BYTE( "106219660_mlq2.bin", 0x20001, 0x10000, CRC(66cdd13c) SHA1(902f653ef88c4f4d93701f0b578a45618f6caa63) ) + ROM_LOAD16_BYTE( "106219678_mls3.bin", 0x40000, 0x10000, CRC(675b8d6f) SHA1(748f42021ff9655dbc4670ac412444171e7c0e95) ) + ROM_LOAD16_BYTE( "106219686_mls2.bin", 0x40001, 0x10000, CRC(87155cfd) SHA1(2e7a2a654193979330a4cadbf4a8f00617a73c05) ) + + // 730X CARTRIDGE PC Code 33503 © 1989 AT&T ISSUE 1 MADE IN USA + ROM_REGION16_BE(0x60000, "cart", 0) // D27512-200V05 EPROMs "© AT&T-1989" + ROM_LOAD16_BYTE( "846481877.b1", 0x00000, 0x10000, CRC(5797e737) SHA1(0406add8373ab1b8c00511fd038b6548fa431d0a) ) + ROM_LOAD16_BYTE( "846481828.a1", 0x00001, 0x10000, CRC(d58e9ad6) SHA1(787a5011778be470b01036d2053945bb330da948) ) + ROM_LOAD16_BYTE( "846481844.b2", 0x20000, 0x10000, CRC(4a426790) SHA1(33209daa61255fe9b7f010e337f8de1e9446ee2b) ) + ROM_LOAD16_BYTE( "846481851.a2", 0x20001, 0x10000, CRC(57e0d7bd) SHA1(7b664c26ed9e9496d229a9907c9340e298934aba) ) + ROM_LOAD16_BYTE( "846481885.b3", 0x40000, 0x10000, CRC(eb4b0c4c) SHA1(0a520485be72992a45d5113ac053db7234adf609) ) + ROM_LOAD16_BYTE( "846481836.a3", 0x40001, 0x10000, CRC(8becf605) SHA1(8b5820d8b931a235e0c0a375973c461e14d55fed) ) + + ROM_REGION16_BE(0x20000, "starlan", 0) // D27512-200V05 EPROMs "© AT&T 1990" + ROM_LOAD16_BYTE( "846541910_abf1_001.d10", 0x00000, 0x10000, CRC(3fce193e) SHA1(e5f9704e9d06f97700ccf6f88fc935efbcd0cd4e) ) + ROM_LOAD16_BYTE( "846541902_6d82_000.b10", 0x00001, 0x10000, CRC(dcf9165c) SHA1(3f264193228bbf935a2699e64bbff08ceb1c2164) ) +ROM_END + COMP( 1986, att630, 0, 0, att630, att630, att630_state, empty_init, "AT&T", "630 MTG", MACHINE_IS_SKELETON ) +COMP( 1990, att730x, 0, 0, att730x, att630, att630_state, empty_init, "AT&T", "730X", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/ave_arb.cpp b/src/mame/drivers/ave_arb.cpp index 52482c5acf6..fcd19af7b92 100644 --- a/src/mame/drivers/ave_arb.cpp +++ b/src/mame/drivers/ave_arb.cpp @@ -77,7 +77,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(reset_button) { update_reset(); } DECLARE_INPUT_CHANGED_MEMBER(halt_button) { m_maincpu->set_input_line(M6502_NMI_LINE, newval ? ASSERT_LINE : CLEAR_LINE); update_reset(); } - // machine drivers + // machine configs void arb(machine_config &config); void v2(machine_config &config); @@ -256,7 +256,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void arb_state::v2(machine_config &config) diff --git a/src/mame/drivers/bagman.cpp b/src/mame/drivers/bagman.cpp index 6022a34ff25..2b3c339dc60 100644 --- a/src/mame/drivers/bagman.cpp +++ b/src/mame/drivers/bagman.cpp @@ -870,6 +870,45 @@ ROM_END ROM_START( sbagman ) ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "sb5v5.9e", 0x0000, 0x1000, CRC(b61029ea) SHA1(2166ca62eb1e237b56252b83d0199e58ec1c8dac) ) + ROM_LOAD( "sb6v4.9f", 0x1000, 0x1000, CRC(bb6a6883) SHA1(a65ac9aeac9c6c85bd4e7eca385d875def92b954) ) + ROM_LOAD( "sb7v4.9j", 0x2000, 0x1000, CRC(a62b6b77) SHA1(ae9cb9c148e293519e391cb88eed9d137d80ea57) ) + ROM_LOAD( "sb8v3.9k", 0x3000, 0x1000, CRC(b94fbb73) SHA1(5d676c5d1d864d70d98f0137c4072062a781b3a0) ) + ROM_LOAD( "sb9v3.9m", 0x4000, 0x1000, CRC(601f34ba) SHA1(1b7ee61a341b9a87abe4fe10b0c647a9b0b97d38) ) + ROM_LOAD( "sb10v3.9n", 0x5000, 0x1000, CRC(5f750918) SHA1(3dc44f259e88999dbb95b4d4376281cc81c1ab87) ) + ROM_LOAD( "sb13v5.8d", 0xc000, 0x0e00, CRC(e0e920f6) SHA1(fbdb36e2d3f4c8dd1f27b3f39a4c025fa47df234) ) + ROM_CONTINUE( 0xfe00, 0x0200 ) + ROM_LOAD( "sb14v3.8f", 0xd000, 0x0400, CRC(83b10139) SHA1(8a1880c6ab8a345676fe30465351d69cc1b416b2) ) + ROM_CONTINUE( 0xe400, 0x0200 ) + ROM_CONTINUE( 0xd600, 0x0a00 ) + ROM_LOAD( "sb15v3.8j", 0xe000, 0x0400, CRC(fe924879) SHA1(b80cbf9cba91e553f7685aef348854c02f0619c7) ) + ROM_CONTINUE( 0xd400, 0x0200 ) + ROM_CONTINUE( 0xe600, 0x0a00 ) + ROM_LOAD( "sb16v3.8k", 0xf000, 0x0e00, CRC(b77eb1f5) SHA1(ef94c1b449e3fa230491052fc3bd4db3f1239263) ) + ROM_CONTINUE( 0xce00, 0x0200 ) + + ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_LOAD( "sb2v3.1e", 0x0000, 0x1000, CRC(f4d3d4e6) SHA1(167ad0259578966fe86384df844e69cf2cc77443) ) + ROM_LOAD( "sb4v3.1j", 0x1000, 0x1000, CRC(2c6a510d) SHA1(304064f11e80f4ec471174823b8aaf59844061ac) ) + + ROM_REGION( 0x2000, "gfx2", 0 ) + ROM_LOAD( "sb1v3.1c", 0x0000, 0x1000, CRC(a046ff44) SHA1(af319cfb74e5efe435c26e971de13bd390f4b378) ) + ROM_LOAD( "sb3v3.1f", 0x1000, 0x1000, CRC(a4422da4) SHA1(3aa55ca8c99566c1c9eb097b6d645c4216e09dfb) ) + + ROM_REGION( 0x0040, "proms", 0 ) // not dumped for this set + ROM_LOAD( "p3.bin", 0x0000, 0x0020, BAD_DUMP CRC(2a855523) SHA1(91e032233fee397c90b7c1662934aca9e0671482) ) + ROM_LOAD( "r3.bin", 0x0020, 0x0020, BAD_DUMP CRC(ae6f1019) SHA1(fd711882b670380cb4bd909c840ba06277b8fbe3) ) + + ROM_REGION( 0x0020, "5110ctrl", 0) // not dumped for this set + ROM_LOAD( "r6.bin", 0x0000, 0x0020, BAD_DUMP CRC(c58a4f6a) SHA1(35ef244b3e94032df2610aa594ea5670b91e1449) ) /*state machine driving TMS5110*/ + + ROM_REGION( 0x2000, "tmsprom", 0 ) /* data for the TMS5110 speech chip */ + ROM_LOAD( "b11v3.9r", 0x0000, 0x1000, CRC(2e0057ff) SHA1(33e3ffa6418f86864eb81e5e9bda4bf540c143a6) ) + ROM_LOAD( "b12v3.9t", 0x1000, 0x1000, CRC(b2120edd) SHA1(52b89dbcc749b084331fa82b13d0876e911fce52) ) +ROM_END + +ROM_START( sbagman2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "5.9e", 0x0000, 0x1000, CRC(1b1d6b0a) SHA1(549161f6adc88fa16339815e05af33ca57815660) ) ROM_LOAD( "6.9f", 0x1000, 0x1000, CRC(ac49cb82) SHA1(5affa0c03bedf2c9d5368c7f075818e1760c12ae) ) ROM_LOAD( "7.9j", 0x2000, 0x1000, CRC(9a1c778d) SHA1(a655e25dc9efdf60cc5b34e42c93c4acaa4a7922) ) @@ -1121,7 +1160,8 @@ GAME( 1982, bagmans, bagman, bagman, bagmans, bagman_state, empty_init, GAME( 1982, bagmans2, bagman, bagman, bagman, bagman_state, empty_init, ROT270, "Valadon Automation (Stern Electronics license)", "Bagman (Stern Electronics, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, bagmanj, bagman, bagman, bagman, bagman_state, empty_init, ROT270, "Valadon Automation (Taito license)", "Bagman (Taito)", MACHINE_SUPPORTS_SAVE ) // title screen actually doesn't mention Valadon, only Stern and Taito -GAME( 1984, sbagman, 0, sbagman, sbagman, bagman_state, empty_init, ROT270, "Valadon Automation", "Super Bagman", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, sbagman, 0, sbagman, sbagman, bagman_state, empty_init, ROT270, "Valadon Automation", "Super Bagman (version 5)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, sbagman2, sbagman, sbagman, sbagman, bagman_state, empty_init, ROT270, "Valadon Automation", "Super Bagman (version 3?)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, sbagmani, sbagman, sbagmani, sbagman, bagman_state, empty_init, ROT90, "Valadon Automation (Itisa license)", "Super Bagman (Itisa, Spain)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // different color PROMs, needs correct decoding GAME( 1984, sbagmans, sbagman, sbagman, sbagman, bagman_state, empty_init, ROT270, "Valadon Automation (Stern Electronics license)", "Super Bagman (Stern Electronics)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/bandai_design_master.cpp b/src/mame/drivers/bandai_design_master.cpp new file mode 100644 index 00000000000..0a1b7590a10 --- /dev/null +++ b/src/mame/drivers/bandai_design_master.cpp @@ -0,0 +1,160 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/****************************************************************************************************************************** + + __________________________________IR___ + | ____ RX/TX | + | _____ ________ | | __ | + | | | | | | | | || + | |IC3 | | IC2 | | |CN2->_|| + | | | | | | | | + | |____| |_______| | | | + | ____ | | | + | | | CART SLOT->| | | + | |IC5| | | | + | |___| ________ | | | + | ____ | | | | | + | | | | IC1 | | | | + | |IC4| | | | | | + | |___| |_______| |___| | + | | + | SW2 | + |______________________________________| + + IC1 = Hitachi H8/328 (24K-byte internal ROM + 1K-byte RAM) + IC2 = Hitachi HG62G010R21FBN Gate Array (low gatecount and low I/O-count packages) + IC3 = Hitachi HM62256LFP-10T 256kbit CMOS SRAM + IC4 = BA10324AF Ground Sense Operational Amplifier + IC5 = Hitachi 74HC00 (5B2T HC00) + + + TODO: cartridge pinouts / information + + NOTE: cartridge dumps contain boot vectors so Internal ROM likely only used when no cartridge is present + +******************************************************************************************************************************/ + +#include "emu.h" +#include "cpu/h8/h83337.h" + +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include "screen.h" +//#include "speaker.h" + +class bdsm_state : public driver_device +{ +public: + bdsm_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_cartslot(*this, "cartslot"), + m_cartslot_region(nullptr), + m_bank(*this, "cartbank"), + m_screen(*this, "screen") + { } + + void bdesignm(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + void io_map(address_map &map); + void mem_map(address_map &map); + + DECLARE_READ16_MEMBER(io_p7_r); + DECLARE_WRITE16_MEMBER(io_p7_w); + + uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_bdesignm); + + required_device<cpu_device> m_maincpu; + required_device<generic_slot_device> m_cartslot; + memory_region *m_cartslot_region; + required_memory_bank m_bank; + required_device<screen_device> m_screen; +}; + +void bdsm_state::machine_start() +{ + if (m_cartslot && m_cartslot->exists()) + { + std::string region_tag; + m_cartslot_region = memregion(region_tag.assign(m_cartslot->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_bank->configure_entries(0, (m_cartslot_region->bytes() / 0x8000), m_cartslot_region->base(), 0x8000); + m_bank->set_entry(0); // only the first bank seems to contain a valid reset vector '0x50' which points at the first code in the ROM. The other banks contain 0x5a00 as the reset vector. IRQ vector seems valid in all banks. + } +} + +DEVICE_IMAGE_LOAD_MEMBER(bdsm_state::cart_load_bdesignm) +{ + uint32_t size = m_cartslot->common_get_size("rom"); + + m_cartslot->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG); + m_cartslot->common_load_rom(m_cartslot->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + +void bdsm_state::mem_map(address_map &map) +{ + map(0x0000, 0x7fff).bankr("cartbank"); + map(0x8000, 0x895f).ram().share("unkram"); +} + +READ16_MEMBER(bdsm_state::io_p7_r) +{ + return machine().rand(); +} + +WRITE16_MEMBER(bdsm_state::io_p7_w) +{ + logerror("%s: io_p7_w %04x %04x\n", machine().describe_context(), data, mem_mask); +} + + +void bdsm_state::io_map(address_map &map) +{ + map(h8_device::PORT_7, h8_device::PORT_7).rw(FUNC(bdsm_state::io_p7_r), FUNC(bdsm_state::io_p7_w)); +} + +static INPUT_PORTS_START( bdesignm ) +INPUT_PORTS_END + +uint32_t bdsm_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + + +void bdsm_state::bdesignm(machine_config &config) +{ + /* basic machine hardware */ + H83334(config, m_maincpu, XTAL(20'000'000)); /* H8/328 (24kbytes internal ROM, 1kbyte internal ROM) ?Mhz */ + m_maincpu->set_addrmap(AS_PROGRAM, &bdsm_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &bdsm_state::io_map); + + SCREEN(config, m_screen, SCREEN_TYPE_LCD); + m_screen->set_refresh_hz(60); + m_screen->set_size(160, 150); // resolution unknown + m_screen->set_visarea(0, 160-1, 0, 150-1); + m_screen->set_screen_update(FUNC(bdsm_state::screen_update)); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + + GENERIC_CARTSLOT(config, m_cartslot, generic_linear_slot, "bdesignm_cart"); // TODO: this should be a custom bus type with capability to plug the 'design' carts into it + //m_cartslot->set_must_be_loaded(true); + + SOFTWARE_LIST(config, "cart_list_game").set_original("bdesignm_game_cart"); // Game carts, these appear to disable the Internal ROM + SOFTWARE_LIST(config, "cart_list_design").set_original("bdesignm_design_cart"); // You can also plug a design cart directly into the unit for use by the Internal ROM program (they contain no program) +} + +ROM_START( bdesignm ) + ROM_REGION16_BE(0x88000, "roms", ROMREGION_ERASE00) + ROM_LOAD( "h8_328.bin", 0x00000, 0x6000, NO_DUMP ) // internal rom (When the console is booted up without a cart it enters the default (builtin) art / drawing program, otherwise probably not used as carts contain boot vectors etc.) +ROM_END + + +CONS( 1995, bdesignm, 0, 0, bdesignm, bdesignm, bdsm_state, empty_init, "Bandai", "Design Master Denshi Mangajuku", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp index b0ae71e2577..1e96311ddda 100644 --- a/src/mame/drivers/bbc.cpp +++ b/src/mame/drivers/bbc.cpp @@ -250,7 +250,7 @@ void bbcm_state::bbcm_bankdev(address_map &map) map(0x023c, 0x023f).mirror(0x400).r(FUNC(bbc_state::bbc_fe_r)); // fe3c-fe3f INTON map(0x0240, 0x025f).mirror(0x400).m(m_via6522_0, FUNC(via6522_device::map)); // fe40-fe5f 6522 VIA SYSTEM VIA map(0x0260, 0x027f).mirror(0x400).m(m_via6522_1, FUNC(via6522_device::map)); // fe60-fe7f 6522 VIA USER VIA - map(0x0280, 0x029f).mirror(0x400).r(FUNC(bbc_state::bbc_fe_r)); // fe80-fe9f Int. Modem Int. Modem + map(0x0280, 0x029f).mirror(0x400).rw(m_modem, FUNC(bbc_modem_slot_device::read), FUNC(bbc_modem_slot_device::write)); // fe80-fe9f Int. Modem Int. Modem map(0x02a0, 0x02bf).mirror(0x400).rw(m_adlc, FUNC(mc6854_device::read), FUNC(mc6854_device::write)); // fea0-febf 68B54 ADLC ECONET controller map(0x02e0, 0x02ff).mirror(0x400).rw(FUNC(bbc_state::bbcm_tube_r), FUNC(bbc_state::bbcm_tube_w)); // fee0-feff Tube ULA Tube system interface /* ACCCON TST bit - hardware test */ @@ -966,7 +966,7 @@ void bbc_state::bbcb(machine_config &config) m_via6522_1->readpb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_r)); m_via6522_1->writepb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_w)); m_via6522_1->writepb_handler().append(m_internal, FUNC(bbc_internal_slot_device::latch_fe60_w)); - m_via6522_1->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe)); + m_via6522_1->ca2_handler().set("printer", FUNC(centronics_device::write_strobe)); m_via6522_1->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<2>)); /* adc */ @@ -975,7 +975,7 @@ void bbc_state::bbcb(machine_config &config) m_upd7002->set_eoc_callback(FUNC(bbc_state::upd7002_eoc)); /* printer */ - centronics_device ¢ronics(CENTRONICS(config, "centronics", centronics_devices, "printer")); + centronics_device ¢ronics(CENTRONICS(config, "printer", centronics_devices, "printer")); centronics.ack_handler().set(m_via6522_1, FUNC(via6522_device::write_ca1)).invert(); // ack seems to be inverted? output_latch_device &latch(OUTPUT_LATCH(config, "cent_data_out")); centronics.set_output_latch(latch); @@ -1095,29 +1095,21 @@ void torch_state::torchf(machine_config &config) FLOPPY_CONNECTOR(config, "i8271:0", bbc_floppies, "525qd", bbc_state::floppy_formats, true).enable_sound(true); FLOPPY_CONNECTOR(config, "i8271:1", bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true); - /* Add Torch Z80 Communicator co-processor */ + /* Torch Z80 Communicator co-processor */ m_tube->set_default_option("zep100"); m_tube->set_fixed(true); } -void torch_state::torchh10(machine_config &config) -{ - torchf(config); - /* fdc */ - m_i8271->subdevice<floppy_connector>("1")->set_default_option(nullptr); - - /* 10MB HDD */ -} - - -void torch_state::torchh21(machine_config &config) +void torch_state::torchh(machine_config &config) { torchf(config); /* fdc */ m_i8271->subdevice<floppy_connector>("1")->set_default_option(nullptr); - /* 21MB HDD */ + /* 10MB or 21MB HDD */ + //m_1mhzbus->set_default_option("sasi"); + //m_1mhzbus->set_fixed(true); } @@ -1201,9 +1193,9 @@ void bbcbp_state::abc110(machine_config &config) m_tube->set_default_option("z80"); m_tube->set_fixed(true); - /* Adaptec ACB-4000 Winchester Disc Controller */ - - /* 10MB ST-412 Winchester */ + /* Acorn Winchester Disc 10MB */ + m_1mhzbus->set_default_option("awhd"); + m_1mhzbus->set_fixed(true); /* software lists */ config.device_remove("cass_ls_a"); @@ -1223,13 +1215,9 @@ void bbcbp_state::acw443(machine_config &config) //m_tube->set_default_option("32016"); //m_tube->set_fixed(true); - /* Adaptec ACB-4000 Winchester Disc Controller */ - //m_1mhzbus->set_default_option("awdd"); - //m_1mhzbus->set_fixed(true); - - /* 10MB ST-412 Winchester ABC210 */ - - /* 20MB ST-412 Winchester Cambridge */ + /* Acorn Winchester Disc 20MB */ + m_1mhzbus->set_default_option("awhd"); + m_1mhzbus->set_fixed(true); /* software lists */ SOFTWARE_LIST(config, "flop_ls_32016").set_original("bbc_flop_32016"); @@ -1250,9 +1238,9 @@ void bbcbp_state::abc310(machine_config &config) m_tube->set_default_option("80286"); m_tube->set_fixed(true); - /* Adaptec ACB-4000 Winchester Disc Controller */ - - /* 10MB ST-412 Winchester */ + /* Acorn Winchester Disc 10MB */ + m_1mhzbus->set_default_option("awhd"); + m_1mhzbus->set_fixed(true); /* software lists */ config.device_remove("cass_ls_a"); @@ -1406,7 +1394,7 @@ void bbcm_state::bbcm(machine_config &config) m_rtc->irq().set(m_irqs, FUNC(input_merger_device::in_w<7>)); /* printer */ - centronics_device ¢ronics(CENTRONICS(config, "centronics", centronics_devices, "printer")); + centronics_device ¢ronics(CENTRONICS(config, "printer", centronics_devices, "printer")); centronics.ack_handler().set(m_via6522_1, FUNC(via6522_device::write_ca1)).invert(); // ack seems to be inverted? output_latch_device &latch(OUTPUT_LATCH(config, "cent_data_out")); centronics.set_output_latch(latch); @@ -1449,7 +1437,7 @@ void bbcm_state::bbcm(machine_config &config) m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w)); m_via6522_1->readpb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_r)); m_via6522_1->writepb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_w)); - m_via6522_1->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe)); + m_via6522_1->ca2_handler().set("printer", FUNC(centronics_device::write_strobe)); m_via6522_1->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<2>)); /* fdc */ @@ -1510,6 +1498,10 @@ void bbcm_state::bbcm(machine_config &config) m_internal->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<8>)); m_internal->nmi_handler().set(FUNC(bbc_state::bus_nmi_w)); + /* internal modem port */ + BBC_MODEM_SLOT(config, m_modem, 16_MHz_XTAL / 16, bbcm_modem_devices, nullptr); + m_modem->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<9>)); + /* software lists */ SOFTWARE_LIST(config, "cass_ls_m").set_original("bbcm_cass"); SOFTWARE_LIST(config, "flop_ls_m").set_original("bbcm_flop"); @@ -1538,7 +1530,9 @@ void bbcm_state::bbcmaiv(machine_config &config) m_intube->set_default_option("65c102"); m_intube->set_fixed(true); - /* Add Philips VP415 Laserdisc player */ + /* Philips VP415 Laserdisc player */ + m_modem->set_default_option("scsiaiv"); + m_modem->set_fixed(true); /* Acorn Tracker Ball */ m_userport->set_default_option("tracker"); @@ -1552,7 +1546,7 @@ void bbcm_state::bbcmet(machine_config &config) m_bankdev->set_map(&bbcm_state::bbcmet_bankdev).set_options(ENDIANNESS_LITTLE, 8, 16, 0x0400); /* printer */ - config.device_remove("centronics"); + config.device_remove("printer"); config.device_remove("cent_data_out"); /* cassette */ @@ -1572,7 +1566,7 @@ void bbcm_state::bbcmet(machine_config &config) /* acia */ config.device_remove("acia6850"); - config.device_remove("rs232"); + config.device_remove("rs423"); config.device_remove("acia_clock"); /* devices */ @@ -1587,6 +1581,7 @@ void bbcm_state::bbcmet(machine_config &config) config.device_remove("extube"); config.device_remove("1mhzbus"); config.device_remove("userport"); + config.device_remove("modem"); } @@ -1608,6 +1603,9 @@ void bbcm_state::bbcmarm(machine_config &config) /* Acorn ARM co-processor */ m_extube->set_default_option("arm"); m_extube->set_fixed(true); + + /* Acorn Winchester Disc */ + m_1mhzbus->set_default_option("awhd"); } @@ -1765,6 +1763,7 @@ void bbcm_state::bbcmc(machine_config &config) config.device_remove("extube"); config.device_remove("userport"); config.device_remove("internal"); + config.device_remove("modem"); } @@ -1918,8 +1917,7 @@ ROM_START(torchf) ROM_END -#define rom_torchh10 rom_torchf -#define rom_torchh21 rom_torchf +#define rom_torchh rom_torchf ROM_START(bbcbp) @@ -2099,6 +2097,8 @@ ROM_START(bbcm) ROMX_LOAD("mos320.ic24", 0x20000, 0x20000, CRC(0f747ebe) SHA1(eacacbec3892dc4809ad5800e6c8299ff9eb528f), ROM_BIOS(0)) ROM_SYSTEM_BIOS( 1, "mos350", "Enhanced MOS 3.50" ) ROMX_LOAD("mos350.ic24", 0x20000, 0x20000, CRC(141027b9) SHA1(85211b5bc7c7a269952d2b063b7ec0e1f0196803), ROM_BIOS(1)) + ROM_SYSTEM_BIOS( 2, "mos329", "FinMOS 3.29") + ROMX_LOAD("mos329.ic24", 0x20000, 0x20000, CRC(8dd7338b) SHA1(4604203c70c04a9fd003103deec438fc5bd44839), ROM_BIOS(2)) ROM_COPY("swr", 0x20000, 0x40000, 0x4000) /* Move loaded roms into place */ ROM_FILL(0x20000, 0x4000, 0xff) /* 00000 rom 0 SK3 Rear Cartridge bottom 16K */ @@ -2126,6 +2126,7 @@ ROM_START(bbcm) /* Factory defaulted CMOS RAM, sets default language ROM, etc. */ ROMX_LOAD("mos320.cmos", 0x00, 0x40, CRC(c7f9e85a) SHA1(f24cc9db0525910689219f7204bf8b864033ee94), ROM_BIOS(0)) ROMX_LOAD("mos350.cmos", 0x00, 0x40, CRC(e84c1854) SHA1(f3cb7f12b7432caba28d067f01af575779220aac), ROM_BIOS(1)) + ROMX_LOAD("mos350.cmos", 0x00, 0x40, CRC(e84c1854) SHA1(f3cb7f12b7432caba28d067f01af575779220aac), ROM_BIOS(2)) ROM_END @@ -2504,8 +2505,7 @@ ROM_END COMP ( 1981, bbcb, 0, bbca, bbcb, bbcb, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model B", MACHINE_IMPERFECT_GRAPHICS) COMP ( 1981, bbca, bbcb, 0, bbca, bbca, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model A", MACHINE_IMPERFECT_GRAPHICS) COMP ( 1982, torchf, bbcb, 0, torchf, torch, torch_state, init_bbc, "Torch Computers", "Torch CF240", MACHINE_IMPERFECT_GRAPHICS) -COMP ( 1982, torchh10, bbcb, 0, torchh10, torch, torch_state, init_bbc, "Torch Computers", "Torch CH240/10", MACHINE_NOT_WORKING) -COMP ( 1982, torchh21, bbcb, 0, torchh21, torch, torch_state, init_bbc, "Torch Computers", "Torch CH240/21", MACHINE_NOT_WORKING) +COMP ( 1982, torchh, bbcb, 0, torchh, torch, torch_state, init_bbc, "Torch Computers", "Torch CH240", MACHINE_NOT_WORKING) COMP ( 1982, bbcb_de, bbcb, 0, bbcb_de, bbcb, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model B (German)", MACHINE_IMPERFECT_GRAPHICS) COMP ( 1983, bbcb_us, bbcb, 0, bbcb_us, bbcb, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model B (US)", MACHINE_IMPERFECT_GRAPHICS) COMP ( 1985, bbcbp, 0, bbcb, bbcbp, bbcbp, bbcbp_state, init_bbc, "Acorn Computers", "BBC Micro Model B+ 64K", MACHINE_IMPERFECT_GRAPHICS) diff --git a/src/mame/drivers/bbl380.cpp b/src/mame/drivers/bbl380.cpp index f56bf1edb9e..3ada15a1487 100644 --- a/src/mame/drivers/bbl380.cpp +++ b/src/mame/drivers/bbl380.cpp @@ -24,9 +24,9 @@ public: void bbl380(machine_config &config); private: - void cs3_command_w(u8 data); - u8 cs3_data_r(); - void cs3_data_w(u8 data); + void lcdc_command_w(u8 data); + u8 lcdc_data_r(); + void lcdc_data_w(u8 data); virtual void machine_start() override; virtual void machine_reset() override; @@ -53,28 +53,28 @@ void bbl380_state::machine_reset() { } -void bbl380_state::cs3_command_w(u8 data) +void bbl380_state::lcdc_command_w(u8 data) { - logerror("%s: CS3 command $%02X\n", machine().describe_context(), data); + logerror("%s: LCDC command $%02X\n", machine().describe_context(), data); } -u8 bbl380_state::cs3_data_r() +u8 bbl380_state::lcdc_data_r() { if (!machine().side_effects_disabled()) - logerror("%s: CS3 data read\n", machine().describe_context()); + logerror("%s: LCDC data read\n", machine().describe_context()); return 0; } -void bbl380_state::cs3_data_w(u8 data) +void bbl380_state::lcdc_data_w(u8 data) { - logerror("%s: CS3 data $%02X\n", machine().describe_context(), data); + logerror("%s: LCDC data $%02X\n", machine().describe_context(), data); } void bbl380_state::bbl380_map(address_map &map) { map(0x000000, 0x3fffff).rom().region("maincpu", 0); // not correct - map(0x600000, 0x600000).w(FUNC(bbl380_state::cs3_command_w)); - map(0x604000, 0x604000).rw(FUNC(bbl380_state::cs3_data_r), FUNC(bbl380_state::cs3_data_w)); + map(0x600000, 0x600000).w(FUNC(bbl380_state::lcdc_command_w)); + map(0x604000, 0x604000).rw(FUNC(bbl380_state::lcdc_data_r), FUNC(bbl380_state::lcdc_data_w)); } static INPUT_PORTS_START( bbl380 ) @@ -85,15 +85,18 @@ void bbl380_state::bbl380(machine_config &config) ST2205U(config, m_maincpu, 8000000); // unknown clock; type guessed m_maincpu->set_addrmap(AS_DATA, &bbl380_state::bbl380_map); - SCREEN(config, m_screen, SCREEN_TYPE_LCD); // RGB LCD + SCREEN(config, m_screen, SCREEN_TYPE_LCD); // TFT color LCD m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(64*8, 32*8); - m_screen->set_visarea(0*8, 40*8-1, 0*8, 30*8-1); + m_screen->set_size(132, 162); + m_screen->set_visarea(0, 132-1, 0, 162-1); m_screen->set_screen_update(FUNC(bbl380_state::screen_update)); m_screen->set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x200); + + // LCD controller seems to be either Sitronix ST7735R or (if RDDID bytes match) Ilitek ILI9163C + // (unless the SoC's built-in one is used and the routines which program these are leftovers) } ROM_START( bbl380 ) diff --git a/src/mame/drivers/bebox.cpp b/src/mame/drivers/bebox.cpp index f5a8a05ec49..ebe7675ec85 100644 --- a/src/mame/drivers/bebox.cpp +++ b/src/mame/drivers/bebox.cpp @@ -51,9 +51,9 @@ void bebox_state::main_mem(address_map &map) map(0x800002F8, 0x800002FF).rw("ns16550_1", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)); map(0x80000380, 0x80000387).rw("ns16550_2", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)); map(0x80000388, 0x8000038F).rw("ns16550_3", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)); - map(0x800003b0, 0x800003bf).rw("vga", FUNC(cirrus_gd5428_device::port_03b0_r), FUNC(cirrus_gd5428_device::port_03b0_w)); - map(0x800003c0, 0x800003cf).rw("vga", FUNC(cirrus_gd5428_device::port_03c0_r), FUNC(cirrus_gd5428_device::port_03c0_w)); - map(0x800003d0, 0x800003df).rw("vga", FUNC(cirrus_gd5428_device::port_03d0_r), FUNC(cirrus_gd5428_device::port_03d0_w)); + map(0x800003b0, 0x800003bf).rw(m_vga, FUNC(cirrus_gd5428_device::port_03b0_r), FUNC(cirrus_gd5428_device::port_03b0_w)); + map(0x800003c0, 0x800003cf).rw(m_vga, FUNC(cirrus_gd5428_device::port_03c0_r), FUNC(cirrus_gd5428_device::port_03c0_w)); + map(0x800003d0, 0x800003df).rw(m_vga, FUNC(cirrus_gd5428_device::port_03d0_r), FUNC(cirrus_gd5428_device::port_03d0_w)); map(0x800003F0, 0x800003F7).rw("ide", FUNC(ide_controller_device::cs1_r), FUNC(ide_controller_device::cs1_w)); map(0x800003F0, 0x800003F7).m(m_smc37c78, FUNC(smc37c78_device::map)); map(0x800003F8, 0x800003FF).rw("ns16550_0", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)); @@ -62,8 +62,8 @@ void bebox_state::main_mem(address_map &map) //map(0x800042E8, 0x800042EF).w("cirrus", FUNC(cirrus_device::cirrus_42E8_w)); map(0xBFFFFFF0, 0xBFFFFFFF).r(FUNC(bebox_state::bebox_interrupt_ack_r)); - map(0xC00A0000, 0xC00BFFFF).rw("vga", FUNC(cirrus_gd5428_device::mem_r), FUNC(cirrus_gd5428_device::mem_w)); - map(0xC1000000, 0xC11FFFFF).rw("vga", FUNC(cirrus_gd5428_device::mem_linear_r), FUNC(cirrus_gd5428_device::mem_linear_w)); + map(0xC00A0000, 0xC00BFFFF).rw(m_vga, FUNC(cirrus_gd5428_device::mem_r), FUNC(cirrus_gd5428_device::mem_w)); + map(0xC1000000, 0xC11FFFFF).rw(m_vga, FUNC(cirrus_gd5428_device::mem_linear_r), FUNC(cirrus_gd5428_device::mem_linear_w)); map(0xFFF00000, 0xFFF03FFF).bankr("bank2"); map(0xFFF04000, 0xFFFFFFFF).rw(FUNC(bebox_state::bebox_flash_r), FUNC(bebox_state::bebox_flash_w)); } @@ -122,6 +122,12 @@ void bebox_state::mpc105_config(device_t *device) mpc105.set_bank_base_default(0); } +void bebox_state::cirrus_config(device_t *device) +{ + pci_cirrus_svga_device &cirruspci = *downcast<pci_cirrus_svga_device *>(device); + cirruspci.set_vga(m_vga); +} + /************************************* * * Keyboard @@ -186,9 +192,9 @@ void bebox_state::bebox_peripherals(machine_config &config) /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480); - screen.set_screen_update("vga", FUNC(cirrus_gd5428_device::screen_update)); + screen.set_screen_update(m_vga, FUNC(cirrus_gd5428_device::screen_update)); - cirrus_gd5428_device &vga(CIRRUS_GD5428(config, "vga", 0)); + cirrus_gd5428_device &vga(CIRRUS_GD5428(config, m_vga, 0)); vga.set_screen("screen"); speaker_device &speaker(SPEAKER(config, "mono")); @@ -218,8 +224,9 @@ void bebox_state::bebox_peripherals(machine_config &config) m_pcibus->set_busnum(0); pci_connector_device &pcislot0 = add_pci_slot(config, "pcibus:0", 0, "mpc105"); - pcislot0.set_option_machine_config("mpc105", mpc105_config); - add_pci_slot(config, "pcibus:1", 1, "cirrus"); + pcislot0.set_option_machine_config("mpc105", [this](device_t *device) { mpc105_config(device); }); + pci_connector_device &pcislot1 = add_pci_slot(config, "pcibus:1", 1, "cirrus"); + pcislot1.set_option_machine_config("cirrus", [this](device_t *device) { cirrus_config(device); }); /*PCI_BUS_LEGACY_DEVICE(12, nullptr, scsi53c810_pci_read, scsi53c810_pci_write)*/ diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index 404c53eb117..f976ba2cd75 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -7721,7 +7721,7 @@ GAMEL( 1996, sltblgpo, 0, scorpion2_vid, sltblgpo, bfm_sc2_vid_state, GAMEL( 1996, sltblgp1, sltblgpo, scorpion2_vid, sltblgpo, bfm_sc2_vid_state, init_sltsbelg, 0, "BFM/ELAM", "Slots (Belgian Cash, Game Card 95-752-008)", MACHINE_SUPPORTS_SAVE,layout_sltblgpo ) GAMEL( 1997, gldncrwn, 0, scorpion2_vid, gldncrwn, bfm_sc2_vid_state, init_gldncrwn, 0, "BFM/ELAM", "Golden Crown (Dutch, Game Card 95-752-011)", MACHINE_SUPPORTS_SAVE,layout_gldncrwn ) -GAMEL( 1997, gldncrwnhop, gldncrwn, scorpion2_vid, gldncrwn, bfm_sc2_vid_state, init_gldncrwn, 0, "BFM/ELAM", "Golden Crown Hopper (Dutch, Game Card)", MACHINE_SUPPORTS_SAVE,layout_gldncrwn ) +GAMEL( 1997, gldncrwnhop, gldncrwn, scorpion2_vid, gldncrwn, bfm_sc2_vid_state, init_gldncrwn, 0, "BFM/ELAM", "Golden Crown Hopper (Dutch, Game Card)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE,layout_gldncrwn ) // SUMCHECK 3 and SUMCHECK 4 errors /* Non-Video */ diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp index 99f70e4654a..70d906675b7 100644 --- a/src/mame/drivers/blitz68k.cpp +++ b/src/mame/drivers/blitz68k.cpp @@ -20,6 +20,7 @@ Year Game Manufacturer 1997 Deuces Wild 2 <unknown> 1998 Funny Fruit Cadillac Jack 1998 Triple Play Cadillac Jack +1998 Texas Reels Cadillac Jack 199? Il Pagliaccio <unknown> ---------------------------------------------------------------------- @@ -46,6 +47,7 @@ To Do: #include "emu.h" #include "cpu/m68000/m68000.h" +#include "cpu/m6805/m68hc05.h" #include "machine/nvram.h" #include "machine/timer.h" #include "sound/saa1099.h" @@ -88,6 +90,7 @@ public: void init_megadble(); void init_maxidbl(); void init_cj3play(); + void init_texasrls(); void init_megadblj(); void init_hermit(); void init_dualgame(); @@ -102,6 +105,7 @@ public: void dualgame(machine_config &config); void bankroba(machine_config &config); void ramdac_config(machine_config &config); + void texasrls(machine_config &config); protected: virtual void machine_start() override { m_leds.resolve(); } @@ -1830,6 +1834,13 @@ void blitz68k_state::cjffruit(machine_config &config) MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k) } +void blitz68k_state::texasrls(machine_config &config) +{ + cjffruit(config); + + // not hooked up yet (some reads and writes in unimplemented features of the MCU core), but it's dumped + M68HC705C8A(config, "mcu", XTAL(4'000'000)); // clock and divider not verified, using the xtal found near the MCU +} void blitz68k_state::bankrob(machine_config &config) { @@ -2321,6 +2332,30 @@ ROM_START( cjffruit ) ROM_LOAD( "gal16v8d_dec.u70", 0x000, 0x117, NO_DUMP ) ROM_END +ROM_START( texasrls ) // CJ-8L REV-D, same PCB as cjffruit + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_WORD( "cjtxsreels ii-cj 2.00-a 040 for cjab checksum 855c.u65", 0x00000, 0x80000, CRC(8d4bf476) SHA1(dc5d72f35d4dffb3726d37f2975ba5277c1dde36) ) + + ROM_REGION( 0x2000, "mcu", 0 ) // 68HC705C8P code + ROM_LOAD( "cjtxsreels ii 5.2 for cj-8l.u30", 0x0000, 0x2000, CRC(1177ce65) SHA1(c0a8fba886e03c579c0f33b23020fbe0a511da36) ) + + ROM_REGION16_BE( 0x200000, "blitter", 0 ) // data for the blitter + ROM_LOAD16_BYTE( "cjtxsreels ii-cj 2.00-d 040 for cjab checksum b8d6.u68", 0x000000, 0x80000, CRC(e4f9e314) SHA1(a71e0a3b4ad528e9af36cf158866a76aea713d0d) ) + ROM_LOAD16_BYTE( "cjtxsreels ii-cj 2.00-c 040 for cjab checksum 0e27.u75", 0x000001, 0x80000, CRC(2279ade0) SHA1(a219a143d113d433878033222da22880f813b14c) ) + ROM_LOAD16_BYTE( "cjtxsreels ii-cj 2.00-f 020 for cjab checksum 3eee.u51", 0x100000, 0x80000, CRC(d1b5f9e3) SHA1(f7fd89d19828c4309cb17b699e506bd6fba1f16a) ) + ROM_LOAD16_BYTE( "cjtxsreels ii-cj 2.00-e 020 for cjab checksum 9adf.u61", 0x100001, 0x80000, CRC(0c7d6175) SHA1(ba925faa80224f2c43dcb58b7c34a26114cd6494) ) + + ROM_REGION( 0x80000, "samples", 0 ) // 8 bit unsigned + ROM_LOAD( "cjtxreels ii-cj 2.00-g 040 for cjab checksum 011f.u50", 0x00000, 0x80000, CRC(5fb53d3e) SHA1(f4a37b00a9417440685d198f1375b615848e7fb6) ) + + ROM_REGION( 0x117, "plds", 0 ) + ROM_LOAD( "gal16v8d_vdp.u15", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_vdo.u53", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_ck2.u64", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_ck1.u69", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_dec.u70", 0x000, 0x117, NO_DUMP ) +ROM_END + /************************************************************************************************************* Deuces Wild 2 - American Heritage (Ver. 2.02F) @@ -2900,6 +2935,17 @@ void blitz68k_state::init_cjffruit() ROM[0x1e7b8/2] = 0x6050; } +void blitz68k_state::init_texasrls() +{ + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); + + // WRONG C8 #1 + ROM[0x11f3a/2] = 0x6028; // TODO: the dump is available, hook up the MCU properly (it would give sound to the driver, too). + + // ERROR CHECKSUM ROM PROGRAM + ROM[0x211bc/2] = 0x6050; +} + void blitz68k_state::init_deucesw2() { uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); @@ -2987,4 +3033,5 @@ GAME( 1995, hermit, 0, hermit, hermit, blitz68k_state, init_hermit, GAME( 1997, deucesw2, 0, deucesw2, deucesw2, blitz68k_state, init_deucesw2, ROT0, "<unknown>", "Deuces Wild 2 - American Heritage (Ver. 2.02F)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // APRIL 10TH, 1997 GAME( 1998, cj3play, 0, cjffruit, cjffruit, blitz68k_state, init_cj3play, ROT0, "Cadillac Jack", "Triple Play (Ver. 1.10)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // FEBRUARY 24TH, 1999 GAME( 1998, cjffruit, 0, cjffruit, cjffruit, blitz68k_state, init_cjffruit, ROT0, "Cadillac Jack", "Funny Fruit (Ver. 1.13)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // APRIL 21ST, 1999 +GAME( 1998, texasrls, 0, texasrls, cjffruit, blitz68k_state, init_texasrls, ROT0, "Cadillac Jack", "Texas Reels (Ver. 2.00)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // OCTOBER 15TH, 2002 GAME( 199?, ilpag, 0, ilpag, ilpag, blitz68k_state, empty_init, ROT0, "<unknown>", "Il Pagliaccio (Italy, Ver. 2.7C)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) diff --git a/src/mame/drivers/blockade.cpp b/src/mame/drivers/blockade.cpp index 5dcb98e9c19..423cff31072 100644 --- a/src/mame/drivers/blockade.cpp +++ b/src/mame/drivers/blockade.cpp @@ -415,18 +415,15 @@ DISCRETE_SOUND_END WRITE8_MEMBER( blockade_state::sound_freq_w ) { m_discrete->write(BLOCKADE_NOTE_DATA, data); - return; } WRITE8_MEMBER( blockade_state::env_on_w ) { m_samples->start(0, 0); - return; } WRITE8_MEMBER( blockade_state::env_off_w ) { - return; } const char *const blockade_sample_names[] = diff --git a/src/mame/drivers/bloodbro_ms.cpp b/src/mame/drivers/bloodbro_ms.cpp index 7c8ba41ee56..c550a9c8972 100644 --- a/src/mame/drivers/bloodbro_ms.cpp +++ b/src/mame/drivers/bloodbro_ms.cpp @@ -169,7 +169,7 @@ ROM_START( bloodbrom ) ROM_LOAD( "4-3_403_gal16v8-25hb1.ic29", 0x000, 0x117, NO_DUMP ) ROM_LOAD( "4-3-a_p0403_pal16r8acn.ic29", 0x000, 0x104, NO_DUMP ) ROM_LOAD( "4-3-b_403_gal16v8-25hb1.ic19", 0x000, 0x117, NO_DUMP ) - ROM_LOAD( "51_1_503_gal16v8-25lp.ic48", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "51-1_503_gal16v8-25lp.ic48", 0x000, 0x117, NO_DUMP ) ROM_LOAD( "51-1-b_5146_gal16v8-20hb1.ic9", 0x000, 0x117, NO_DUMP ) ROM_LOAD( "51-1-b_5246_gal16v8-20hb1.ic8", 0x000, 0x117, NO_DUMP ) ROM_END diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp index ddc8e4709fc..35e67a5e9ed 100644 --- a/src/mame/drivers/bnstars.cpp +++ b/src/mame/drivers/bnstars.cpp @@ -441,6 +441,7 @@ void bnstars_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co flipy = !flipy; } + pri >>= 4; /* TODO: priority handling is completely wrong, but better than nothing */ if (pri == 0x0) pri_mask = 0x00; @@ -797,7 +798,7 @@ void bnstars_state::bnstars(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(bnstars_state::ms32_interrupt), "lscreen", 0, 1); - Z80(config, m_audiocpu, XTAL(8'000'000)); // 8MHz presented on sound PCB, Verified + Z80(config, m_audiocpu, XTAL(8'000'000)); // 8MHz present on sound PCB, Verified m_audiocpu->set_addrmap(AS_PROGRAM, &bnstars_state::bnstars_sound_map); config.set_maximum_quantum(attotime::from_hz(60000)); diff --git a/src/mame/drivers/btime.cpp b/src/mame/drivers/btime.cpp index 43b90ca079d..be2b0cc02d0 100644 --- a/src/mame/drivers/btime.cpp +++ b/src/mame/drivers/btime.cpp @@ -1745,6 +1745,29 @@ ROM_START( mmonkey ) ROM_LOAD( "sb-4c", 0x0020, 0x0020, CRC(a29b4204) SHA1(7f15cae5c4aaa29638fb45029782dafd2b3d1484) ) /* RAS/CAS logic - not used */ ROM_END +ROM_START( mmonkeyj ) + ROM_REGION( 0x10000, "maincpu", 0 ) // all 2732 + ROM_LOAD( "b00.e4", 0xc000, 0x1000, CRC(8d31bf6a) SHA1(77b44d8e2b4db148727e7bfc5162c7e9e9cfc662) ) + ROM_LOAD( "b10.d4", 0xd000, 0x1000, CRC(e54f584a) SHA1(a03fef09f6a0bb6802b33b28c45548efb85cda5c) ) + ROM_LOAD( "b20.b4", 0xe000, 0x1000, CRC(9f606767) SHA1(afd248e5bc05e3ee4b31545efe5d66a032cea275) ) + ROM_LOAD( "b30.a4", 0xf000, 0x1000, CRC(a4e85439) SHA1(0455a520d6dbd5efa0598f80e48b88574135922a) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "b40.h1", 0xe000, 0x1000, CRC(5bcb2e81) SHA1(60fb8fd83c83b278e3aaf96f0b6dbefbc1eef0f7) ) // 2732 + + ROM_REGION( 0x6000, "gfx1", 0 ) // all 2732 + ROM_LOAD( "b50.l11", 0x0000, 0x1000, CRC(b6aa8566) SHA1(bc90d4cfa9a221477d1989fea532621ce3e76439) ) + ROM_LOAD( "b60.m11", 0x1000, 0x1000, CRC(6cc4d0c4) SHA1(f43450e97dd0c6d0a269c06e4c4253d0814590e9) ) + ROM_LOAD( "b70.l13", 0x2000, 0x1000, CRC(2a343b7e) SHA1(1dba32a83db933096b9a9fbcfd8e0290aba76483) ) + ROM_LOAD( "b80.m13", 0x3000, 0x1000, CRC(0230b50d) SHA1(d62b5d1be35c8bf29483fb616cd7e3949a422e76) ) + ROM_LOAD( "b90.l14", 0x4000, 0x1000, CRC(922bb3e1) SHA1(72d2017e80bea7700a3a61a06882839ecffcabe8) ) + ROM_LOAD( "ba0.m14", 0x5000, 0x1000, CRC(f943e28c) SHA1(6ff536a21f34cbb958f6d0f84791102938966ff3) ) + + ROM_REGION( 0x0040, "proms", 0 ) + ROM_LOAD( "bc0.m5", 0x0000, 0x0020, CRC(55e28b32) SHA1(b73f85224738252dc8dbb38a54250dcfe1fc3ae3) ) /* 82S123, palette */ + ROM_LOAD( "m3-7603-5.c4", 0x0020, 0x0020, BAD_DUMP CRC(a29b4204) SHA1(7f15cae5c4aaa29638fb45029782dafd2b3d1484) ) /* not dumped for this set - RAS/CAS logic - not used */ +ROM_END + ROM_START( brubber ) ROM_REGION( 0x10000, "maincpu", 0 ) /* a000-bfff space for the service ROM */ @@ -2055,22 +2078,23 @@ void btime_state::init_sdtennis() } -GAME( 1982, btime, 0, btime, btime, btime_state, init_btime, ROT270, "Data East Corporation", "Burger Time (Data East set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, btime2, btime, btime, btime, btime_state, init_btime, ROT270, "Data East Corporation", "Burger Time (Data East set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, btime3, btime, btime, btime, btime_state, init_btime, ROT270, "Data East USA Inc.", "Burger Time (Data East USA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, btimem, btime, btime, btime, btime_state, init_btime, ROT270, "Data East (Bally Midway license)", "Burger Time (Midway)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, cookrace, btime, cookrace, cookrace, btime_state, init_cookrace, ROT270, "bootleg", "Cook Race", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, tisland, 0, tisland, btime, btime_state, init_tisland, ROT270, "Data East Corporation", "Treasure Island", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, lnc, 0, lnc, lnc, btime_state, init_lnc, ROT270, "Data East Corporation", "Lock'n'Chase", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, protennb, 0, disco, disco, btime_state, init_protennb, ROT270, "bootleg", "Tennis (bootleg of Pro Tennis)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, wtennis, 0, wtennis, wtennis, btime_state, init_wtennis, ROT270, "bootleg", "World Tennis", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, mmonkey, 0, mmonkey, mmonkey, btime_state, init_lnc, ROT270, "Technos Japan / Roller Tron", "Minky Monkey", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, brubber, 0, bnj, bnj, btime_state, init_bnj, ROT270, "Data East", "Burnin' Rubber", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, bnj, brubber, bnj, bnj, btime_state, init_bnj, ROT270, "Data East USA", "Bump 'n' Jump", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, bnjm, brubber, bnj, bnj, btime_state, init_bnj, ROT270, "Data East USA (Bally Midway license)", "Bump 'n' Jump (Midway)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, caractn, brubber, bnj, bnj, btime_state, init_bnj, ROT270, "bootleg", "Car Action (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, caractn2, brubber, bnj, caractn2, btime_state, init_bnj, ROT270, "bootleg", "Car Action (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, zoar, 0, zoar, zoar, btime_state, init_zoar, ROT270, "Data East USA", "Zoar", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, disco, 0, disco, disco, btime_state, init_disco, ROT270, "Data East", "Disco No.1", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, discof, disco, disco, disco, btime_state, init_disco, ROT270, "Data East", "Disco No.1 (Rev.F)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, sdtennis, 0, sdtennis, sdtennis, btime_state, init_sdtennis, ROT270, "Data East Corporation", "Super Doubles Tennis", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, btime, 0, btime, btime, btime_state, init_btime, ROT270, "Data East Corporation", "Burger Time (Data East set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, btime2, btime, btime, btime, btime_state, init_btime, ROT270, "Data East Corporation", "Burger Time (Data East set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, btime3, btime, btime, btime, btime_state, init_btime, ROT270, "Data East USA Inc.", "Burger Time (Data East USA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, btimem, btime, btime, btime, btime_state, init_btime, ROT270, "Data East (Bally Midway license)", "Burger Time (Midway)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, cookrace, btime, cookrace, cookrace, btime_state, init_cookrace, ROT270, "bootleg", "Cook Race", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, tisland, 0, tisland, btime, btime_state, init_tisland, ROT270, "Data East Corporation", "Treasure Island", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, lnc, 0, lnc, lnc, btime_state, init_lnc, ROT270, "Data East Corporation", "Lock'n'Chase", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, protennb, 0, disco, disco, btime_state, init_protennb, ROT270, "bootleg", "Tennis (bootleg of Pro Tennis)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, wtennis, 0, wtennis, wtennis, btime_state, init_wtennis, ROT270, "bootleg", "World Tennis", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mmonkey, 0, mmonkey, mmonkey, btime_state, init_lnc, ROT270, "Technos Japan / Roller Tron", "Minky Monkey", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mmonkeyj, mmonkey, mmonkey, mmonkey, btime_state, init_lnc, ROT270, "Technos Japan / Roller Tron", "Minky Monkey (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, brubber, 0, bnj, bnj, btime_state, init_bnj, ROT270, "Data East", "Burnin' Rubber", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, bnj, brubber, bnj, bnj, btime_state, init_bnj, ROT270, "Data East USA", "Bump 'n' Jump", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, bnjm, brubber, bnj, bnj, btime_state, init_bnj, ROT270, "Data East USA (Bally Midway license)", "Bump 'n' Jump (Midway)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, caractn, brubber, bnj, bnj, btime_state, init_bnj, ROT270, "bootleg", "Car Action (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, caractn2, brubber, bnj, caractn2, btime_state, init_bnj, ROT270, "bootleg", "Car Action (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, zoar, 0, zoar, zoar, btime_state, init_zoar, ROT270, "Data East USA", "Zoar", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, disco, 0, disco, disco, btime_state, init_disco, ROT270, "Data East", "Disco No.1", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, discof, disco, disco, disco, btime_state, init_disco, ROT270, "Data East", "Disco No.1 (Rev.F)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, sdtennis, 0, sdtennis, sdtennis, btime_state, init_sdtennis, ROT270, "Data East Corporation", "Super Doubles Tennis", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/cdi.cpp b/src/mame/drivers/cdi.cpp index 003447aacf7..c843954db55 100644 --- a/src/mame/drivers/cdi.cpp +++ b/src/mame/drivers/cdi.cpp @@ -74,8 +74,11 @@ void cdi_state::cdimono1_mem(address_map &map) map(0x00400000, 0x0047ffff).rom().region("maincpu", 0); map(0x004fffe0, 0x004fffff).rw(m_mcd212, FUNC(mcd212_device::regs_r), FUNC(mcd212_device::regs_w)); map(0x00500000, 0x0057ffff).ram(); - map(0x00580000, 0x00ffffff).noprw(); - map(0x00e00000, 0x00efffff).ram(); // DVC + map(0x00580000, 0x00cfffff).noprw(); + map(0x00d00000, 0x00dfffff).ram(); // DVC RAM block 1 + map(0x00e00000, 0x00e7ffff).rw(FUNC(cdi_state::dvc_r), FUNC(cdi_state::dvc_w)); + map(0x00e80000, 0x00efffff).ram(); // DVC RAM block 2 + map(0x00f00000, 0x00ffffff).noprw(); } void cdi_state::cdimono2_mem(address_map &map) @@ -94,7 +97,7 @@ void cdi_state::cdimono2_mem(address_map &map) map(0x004fffe0, 0x004fffff).rw(m_mcd212, FUNC(mcd212_device::regs_r), FUNC(mcd212_device::regs_w)); //map(0x00500000, 0x0057ffff).ram(); map(0x00500000, 0x00ffffff).noprw(); - //map(0x00e00000, 0x00efffff).ram(); // DVC + //map(0x00e00000, 0x00efffff).ram(); } void cdi_state::cdi910_mem(address_map &map) @@ -122,7 +125,7 @@ void cdi_state::cdi910_mem(address_map &map) * Input ports * *************************/ -INPUT_CHANGED_MEMBER(cdi_state::mcu_input) +INPUT_CHANGED_MEMBER(quizard_state::mcu_input) { bool send = false; @@ -161,10 +164,10 @@ INPUT_CHANGED_MEMBER(cdi_state::mcu_input) break; } - if(send) + if (send) { uint8_t data = uint8_t(param & 0x000000ff); - quizard_rx(data); + mcu_tx(data); } } @@ -233,19 +236,19 @@ static INPUT_PORTS_START( quizard ) PORT_INCLUDE( cdi ) PORT_START("INPUT1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Coin 1") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x39) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start 1") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x37) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Player 1 A") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x31) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Player 1 B") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x32) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Player 1 C") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x33) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Coin 1") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x39) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start 1") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x37) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Player 1 A") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x31) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Player 1 B") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x32) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Player 1 C") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x33) PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("INPUT2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x30) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Start 2") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x38) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Player 2 A") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x34) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Player 2 B") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x35) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("Player 2 C") PORT_CHANGED_MEMBER(DEVICE_SELF, cdi_state,mcu_input, 0x36) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x30) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Start 2") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x38) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Player 2 A") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x34) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Player 2 B") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x35) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("Player 2 C") PORT_CHANGED_MEMBER(DEVICE_SELF, quizard_state, mcu_input, 0x36) PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED) INPUT_PORTS_END @@ -254,62 +257,27 @@ INPUT_PORTS_END * Machine Initialization * ***************************/ -MACHINE_RESET_MEMBER( cdi_state, cdimono1 ) +void cdi_state::machine_reset() { uint16_t *src = (uint16_t*)memregion("maincpu")->base(); uint16_t *dst = m_planea; memcpy(dst, src, 0x8); - - // Quizard Protection HLE data - memset(m_seeds, 0, 10 * sizeof(uint16_t)); - memset(m_state, 0, 8 * sizeof(uint8_t)); - m_mcu_value = 0; - m_mcu_ack = 0; -} - -MACHINE_RESET_MEMBER( cdi_state, cdimono2 ) -{ - uint16_t *src = (uint16_t*)memregion("maincpu")->base(); - uint16_t *dst = m_planea; - memcpy(dst, src, 0x8); - - m_maincpu->reset(); } -MACHINE_RESET_MEMBER( cdi_state, quizard1 ) +void quizard_state::machine_start() { - MACHINE_RESET_CALL_MEMBER( cdimono1 ); - - set_quizard_mcu_value(0x021f); - set_quizard_mcu_ack(0x5a); + save_item(NAME(m_seeds)); + save_item(NAME(m_state)); + save_item(NAME(m_mcu_value)); + save_item(NAME(m_mcu_ack)); } -MACHINE_RESET_MEMBER( cdi_state, quizard2 ) +void quizard_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER( cdimono1 ); - - // 0x2b1: Italian - // 0x001: French - // 0x188: German - - set_quizard_mcu_value(0x188); - set_quizard_mcu_ack(0x59); -} + cdi_state::machine_reset(); -MACHINE_RESET_MEMBER( cdi_state, quizard3 ) -{ - MACHINE_RESET_CALL_MEMBER( cdimono1 ); - - set_quizard_mcu_value(0x00ae); - set_quizard_mcu_ack(0x58); -} - -MACHINE_RESET_MEMBER( cdi_state, quizard4 ) -{ - MACHINE_RESET_CALL_MEMBER( cdimono1 ); - - set_quizard_mcu_value(0x011f); - set_quizard_mcu_ack(0x57); + memset(m_seeds, 0, 10 * sizeof(uint16_t)); + memset(m_state, 0, 8 * sizeof(uint8_t)); } @@ -317,23 +285,23 @@ MACHINE_RESET_MEMBER( cdi_state, quizard4 ) * Quizard Protection HLE * ***************************/ -void cdi_state::set_quizard_mcu_ack(uint8_t ack) +void quizard_state::set_mcu_ack(uint8_t ack) { m_mcu_ack = ack; } -void cdi_state::set_quizard_mcu_value(uint16_t value) +void quizard_state::set_mcu_value(uint16_t value) { m_mcu_value = value; } -void cdi_state::quizard_rx(uint8_t data) +void quizard_state::mcu_tx(uint8_t data) { m_maincpu->uart_rx(0x5a); m_maincpu->uart_rx(data); } -void cdi_state::quizard_set_seeds(uint8_t *rx) +void quizard_state::mcu_set_seeds(uint8_t *rx) { m_seeds[0] = (rx[1] << 8) | rx[0]; m_seeds[1] = (rx[3] << 8) | rx[2]; @@ -347,7 +315,7 @@ void cdi_state::quizard_set_seeds(uint8_t *rx) m_seeds[9] = (rx[19] << 8) | rx[18]; } -void cdi_state::quizard_calculate_state() +void quizard_state::mcu_calculate_state() { //const uint16_t desired_bitfield = mcu_value; const uint16_t field0 = 0x00ff; @@ -385,7 +353,7 @@ void cdi_state::quizard_calculate_state() m_state[5] = lo1 - m_state[4]; } -void cdi_state::quizard_handle_byte_tx(uint8_t data) +void quizard_state::mcu_rx(uint8_t data) { static int state = 0; static uint8_t rx[0x100]; @@ -427,8 +395,8 @@ void cdi_state::quizard_handle_byte_tx(uint8_t data) if (rx_ptr == 20) { //printf("Calculating seeds\n"); - quizard_set_seeds(rx); - quizard_calculate_state(); + mcu_set_seeds(rx); + mcu_calculate_state(); state = 2; } break; @@ -480,6 +448,27 @@ void cdi_state::quizard_handle_byte_tx(uint8_t data) } } +READ8_MEMBER(quizard_state::mcu_p1_r) +{ + LOG("%s: MCU Port 1 Read\n", machine().describe_context()); + return 0; +} + + +/************************* +* DVC cartridge * +*************************/ + +READ16_MEMBER( cdi_state::dvc_r ) +{ + logerror("%s: dvc_r: %08x = 0000 & %04x\n", machine().describe_context(), 0xe80000 + (offset << 1), mem_mask); + return 0; +} + +WRITE16_MEMBER( cdi_state::dvc_w ) +{ + logerror("%s: dvc_w: %08x = %04x & %04x\n", machine().describe_context(), 0xe80000 + (offset << 1), data, mem_mask); +} /************************* * LCD screen * @@ -637,8 +626,6 @@ void cdi_state::cdimono2(machine_config &config) config.set_default_layout(layout_cdi); - MCFG_MACHINE_RESET_OVERRIDE( cdi_state, cdimono2 ) - M68HC05C8(config, m_servo, 4_MHz_XTAL); M68HC05C8(config, m_slave, 4_MHz_XTAL); @@ -690,8 +677,6 @@ void cdi_state::cdi910(machine_config &config) config.set_default_layout(layout_cdi); - MCFG_MACHINE_RESET_OVERRIDE( cdi_state, cdimono2 ) - M68HC05C8(config, m_servo, 4_MHz_XTAL); M68HC05C8(config, m_slave, 4_MHz_XTAL); @@ -719,56 +704,19 @@ void cdi_state::cdi910(machine_config &config) void cdi_state::cdimono1(machine_config &config) { cdimono1_base(config); - MCFG_MACHINE_RESET_OVERRIDE(cdi_state, cdimono1) CDROM(config, "cdrom").set_interface("cdi_cdrom"); SOFTWARE_LIST(config, "cd_list").set_original("cdi").set_filter("!DVC"); } -void cdi_state::quizard(machine_config &config) +void quizard_state::quizard(machine_config &config) { cdimono1_base(config); - m_maincpu->set_addrmap(AS_PROGRAM, &cdi_state::cdimono1_mem); - m_maincpu->uart_tx_callback().set(FUNC(cdi_state::quizard_handle_byte_tx)); -} - - -READ8_MEMBER( cdi_state::quizard_mcu_p1_r ) -{ - LOG("%s: MCU Port 1 Read\n", machine().describe_context()); - return 0; -} - -void cdi_state::quizard1(machine_config &config) -{ - quizard(config); - MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard1) - - i8751_device &mcu(I8751(config, "mcu", 8000000)); - mcu.port_in_cb<1>().set(FUNC(cdi_state::quizard_mcu_p1_r)); -// mcu.set_vblank_int("screen", FUNC(cdi_state::irq0_line_pulse)); -} - -void cdi_state::quizard2(machine_config &config) -{ - quizard(config); - MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard2) -} - -void cdi_state::quizard3(machine_config &config) -{ - quizard(config); - MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard3) -} - -void cdi_state::quizard4(machine_config &config) -{ - quizard(config); - MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard4) + m_maincpu->set_addrmap(AS_PROGRAM, &quizard_state::cdimono1_mem); + m_maincpu->uart_tx_callback().set(FUNC(quizard_state::mcu_rx)); i8751_device &mcu(I8751(config, "mcu", 8000000)); - mcu.port_in_cb<1>().set(FUNC(cdi_state::quizard_mcu_p1_r)); -// mcu.set_vblank_int("screen", FUNC(cdi_state::irq0_line_pulse)); + mcu.port_in_cb<1>().set(FUNC(quizard_state::mcu_p1_r)); } /************************* @@ -791,8 +739,6 @@ ROM_START( cdimono1 ) ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping ROM_END - - ROM_START( cdi910 ) ROM_REGION(0x80000, "maincpu", 0) ROM_SYSTEM_BIOS( 0, "cdi910", "CD-I 910-17P Mini-MMC" ) @@ -824,7 +770,6 @@ ROM_START( cdimono2 ) ROM_LOAD( "zc405352p__slave_cdi_4.1__0d67p__lltr9403.mc68hc705c8a.7206", 0x0000, 0x2000, CRC(5b19da07) SHA1(cf02d84977050c71e87a38f1249e83c43a93949b) ) ROM_END - ROM_START( cdi490a ) ROM_REGION(0x80000, "maincpu", 0) ROM_SYSTEM_BIOS( 0, "cdi490", "CD-i 490" ) @@ -835,9 +780,6 @@ ROM_START( cdi490a ) ROM_LOAD( "vmpega.rom", 0x0000, 0x40000, CRC(db264e8b) SHA1(be407fbc102f1731a0862554855e963e5a47c17b) ) ROM_END - - - ROM_START( cdibios ) // for the quizard sets ROM_REGION(0x80000, "maincpu", 0) ROM_SYSTEM_BIOS( 0, "mcdi200", "Magnavox CD-i 200" ) @@ -858,13 +800,19 @@ ROM_END Each Quizard game (1,2,3,4) requires it's own MCU, you can upgrade between revisions by changing just the CD, but not between games as a new MCU is required. - The only dumped MCUs are German region ones for Quizard 1 and 4. - A Czech Quizard 4 MCU was located but it was an 89c51 type instead + MCU Notes: + i8751 MCU dumps confirmed good on original hardware + German language MCUs for Quizard 1 through 4 are dumped + Czechoslovakian language MCU for Quizard 4 is dumped + Known to exist a Quizard 1 Italian language MCU IT 11 L2 (not dumped) + Known to exist is an alternate Quizard 2 German language MCU DE 122 D3 (not dumped) */ -// Quizard (1) +//******************************************************** +// Quizard (1) +//******************************************************** ROM_START( quizard ) /* CD-ROM printed ??/?? */ ROM_REGION(0x80000, "maincpu", 0) @@ -880,10 +828,9 @@ ROM_START( quizard ) /* CD-ROM printed ??/?? */ DISK_IMAGE_READONLY( "quizard18", 0, BAD_DUMP SHA1(ede873b22957f2a707bbd3039e962ef2ca5aedbd) ) ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard1_german_d8751.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // confirmed good on original hardware + ROM_LOAD( "de_11_d3.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // German language ROM_END - ROM_START( quizard_17 ) ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) ) @@ -897,8 +844,8 @@ ROM_START( quizard_17 ) DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard17", 0, BAD_DUMP SHA1(4bd698f076505b4e17be978481bce027eb47123b) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard1_german_d8751.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_11_d3.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // German language ROM_END ROM_START( quizard_12 ) /* CD-ROM printed 01/95 */ @@ -914,8 +861,8 @@ ROM_START( quizard_12 ) /* CD-ROM printed 01/95 */ DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard12", 0, BAD_DUMP SHA1(6e41683b96b74e903040842aeb18437ad7813c82) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard1_german_d8751.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_11_d3.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // German language ROM_END ROM_START( quizard_10 ) @@ -928,18 +875,19 @@ ROM_START( quizard_10 ) ROM_REGION(0x2000, "slave", 0) ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping - // software: BurnAtOnce 0.99.5 / CHDMAN 0.163 // Drive: TS-L633R DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard10", 0, SHA1(5715db50f0d5ffe06f47c0943f4bf0481ab6048e) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard1_german_d8751.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_11_d3.bin", 0x0000, 0x1000, CRC(95f45b6b) SHA1(51b34956539b1e2cf0306f243a970750f1e18d01) ) // German language ROM_END -// Quizard 2 +//******************************************************** +// Quizard 2 +//******************************************************** ROM_START( quizard2 ) /* CD-ROM printed ??/?? */ ROM_REGION(0x80000, "maincpu", 0) @@ -954,8 +902,8 @@ ROM_START( quizard2 ) /* CD-ROM printed ??/?? */ DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard23", 0, BAD_DUMP SHA1(cd909d9a54275d6f2d36e03e83eea996e781b4d3) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard2_d8751.bin", 0x0000, 0x1000, NO_DUMP ) + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "dn_122_d3.bin", 0x0000, 0x1000, CRC(d48063ea) SHA1(b512fa5e53f296a180340e09b53613dd1c0d38bc) ) // German language - DE 122 D3 known to exist ROM_END ROM_START( quizard2_22 ) @@ -971,11 +919,14 @@ ROM_START( quizard2_22 ) DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard22", 0, BAD_DUMP SHA1(03c8fdcf27ead6e221691111e8c679b551099543) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard2_d8751.bin", 0x0000, 0x1000, NO_DUMP ) + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "dn_122_d3.bin", 0x0000, 0x1000, CRC(d48063ea) SHA1(b512fa5e53f296a180340e09b53613dd1c0d38bc) ) // German language - DE 122 D3 known to exist ROM_END -// Quizard 3 + +//******************************************************** +// Quizard 3 +//******************************************************** ROM_START( quizard3 ) /* CD-ROM printed ??/?? */ ROM_REGION(0x80000, "maincpu", 0) @@ -990,8 +941,25 @@ ROM_START( quizard3 ) /* CD-ROM printed ??/?? */ DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard34", 0, BAD_DUMP SHA1(37ad49b72b5175afbb87141d57bc8604347fe032) ) - ROM_REGION(0x1000, "mcu", 0) // d8751h - ROM_LOAD( "de132d3.bin", 0x0000, 0x1000, CRC(8858251e) SHA1(2c1005a74bb6f0c2918dff4ab6326528eea48e1f) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_132_d3.bin", 0x0000, 0x1000, CRC(8858251e) SHA1(2c1005a74bb6f0c2918dff4ab6326528eea48e1f) ) // German language +ROM_END + +ROM_START( quizard3a ) /* CD-ROM printed ??/?? */ + ROM_REGION(0x80000, "maincpu", 0) + ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) ) + + ROM_REGION(0x2000, "cdic", 0) + ROM_LOAD( "cdic.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping + + ROM_REGION(0x2000, "slave", 0) + ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping + + DISK_REGION( "cdrom" ) + DISK_IMAGE_READONLY( "quizard34", 0, BAD_DUMP SHA1(37ad49b72b5175afbb87141d57bc8604347fe032) ) + + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_132_a1.bin", 0x0000, 0x1000, CRC(313ac673) SHA1(cb0ee7e9a6eaa5f4d000f5ea99b7ee4c440b31d1) ) // German language - earlier version of MCU code ROM_END ROM_START( quizard3_32 ) @@ -1007,11 +975,15 @@ ROM_START( quizard3_32 ) DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard32", 0, BAD_DUMP SHA1(31e9fa2169aa44d799c37170b238134ab738e1a1) ) - ROM_REGION(0x1000, "mcu", 0) // d8751h - ROM_LOAD( "de132d3.bin", 0x0000, 0x1000, CRC(8858251e) SHA1(2c1005a74bb6f0c2918dff4ab6326528eea48e1f) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_132_d3.bin", 0x0000, 0x1000, CRC(8858251e) SHA1(2c1005a74bb6f0c2918dff4ab6326528eea48e1f) ) // German language ROM_END +//******************************************************** +// Quizard 4 +//******************************************************** + ROM_START( quizard4 ) /* CD-ROM printed 09/98 */ ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) ) @@ -1025,8 +997,25 @@ ROM_START( quizard4 ) /* CD-ROM printed 09/98 */ DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard4r42", 0, BAD_DUMP SHA1(a5d5c8950b4650b8753f9119dc7f1ccaa2aa5442) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard4_german_d8751.bin", 0x0000, 0x1000, CRC(77be0b40) SHA1(113b5c239480a2259f55e411ba8fb3972e6d4301) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_142_d3.bin", 0x0000, 0x1000, CRC(77be0b40) SHA1(113b5c239480a2259f55e411ba8fb3972e6d4301) ) // German language +ROM_END + +ROM_START( quizard4cz ) /* CD-ROM printed 09/98 */ + ROM_REGION(0x80000, "maincpu", 0) + ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) ) + + ROM_REGION(0x2000, "cdic", 0) + ROM_LOAD( "cdic.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping + + ROM_REGION(0x2000, "slave", 0) + ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping + + DISK_REGION( "cdrom" ) + DISK_IMAGE_READONLY( "quizard4r42", 0, BAD_DUMP SHA1(a5d5c8950b4650b8753f9119dc7f1ccaa2aa5442) ) + + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "ts142_cz1.bin", 0x0000, 0x1000, CRC(fdc1f457) SHA1(5169c4d2ea4073a854c3f619205161386c9af8af) ) // Czech language - works with all Quizard 4 versions ROM_END ROM_START( quizard4_41 ) @@ -1042,8 +1031,8 @@ ROM_START( quizard4_41 ) DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard4r41", 0, BAD_DUMP SHA1(2c0484c6545aac8e00b318328c6edce6f5dde43d) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard4_german_d8751.bin", 0x0000, 0x1000, CRC(77be0b40) SHA1(113b5c239480a2259f55e411ba8fb3972e6d4301) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_142_d3.bin", 0x0000, 0x1000, CRC(77be0b40) SHA1(113b5c239480a2259f55e411ba8fb3972e6d4301) ) // German language ROM_END ROM_START( quizard4_40 ) /* CD-ROM printed 07/97 */ @@ -1059,8 +1048,8 @@ ROM_START( quizard4_40 ) /* CD-ROM printed 07/97 */ DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "quizard4r40", 0, BAD_DUMP SHA1(288cc37a994e4f1cbd47aa8c92342879c6fc0b87) ) - ROM_REGION(0x1000, "mcu", 0) - ROM_LOAD( "quizard4_german_d8751.bin", 0x0000, 0x1000, CRC(77be0b40) SHA1(113b5c239480a2259f55e411ba8fb3972e6d4301) ) // confirmed good on original hardware + ROM_REGION(0x1000, "mcu", 0) // Intel D8751H MCU + ROM_LOAD( "de_142_d3.bin", 0x0000, 0x1000, CRC(77be0b40) SHA1(113b5c239480a2259f55e411ba8fb3972e6d4301) ) // German language ROM_END @@ -1068,30 +1057,31 @@ ROM_END * Game driver(s) * *************************/ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ // BIOS / System -CONS( 1991, cdimono1, 0, 0, cdimono1, cdi, cdi_state, empty_init, "Philips", "CD-i (Mono-I) (PAL)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -CONS( 1991, cdimono2, 0, 0, cdimono2, cdimono2, cdi_state, empty_init, "Philips", "CD-i (Mono-II) (NTSC)", MACHINE_NOT_WORKING ) -CONS( 1991, cdi910, 0, 0, cdi910, cdimono2, cdi_state, empty_init, "Philips", "CD-i 910-17P Mini-MMC (PAL)", MACHINE_NOT_WORKING ) -CONS( 1991, cdi490a, 0, 0, cdimono1, cdi, cdi_state, empty_init, "Philips", "CD-i 490", MACHINE_NOT_WORKING ) +CONS( 1991, cdimono1, 0, 0, cdimono1, cdi, cdi_state, empty_init, "Philips", "CD-i (Mono-I) (PAL)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +CONS( 1991, cdimono2, 0, 0, cdimono2, cdimono2, cdi_state, empty_init, "Philips", "CD-i (Mono-II) (NTSC)", MACHINE_NOT_WORKING ) +CONS( 1991, cdi910, 0, 0, cdi910, cdimono2, cdi_state, empty_init, "Philips", "CD-i 910-17P Mini-MMC (PAL)", MACHINE_NOT_WORKING ) +CONS( 1991, cdi490a, 0, 0, cdimono1, cdi, cdi_state, empty_init, "Philips", "CD-i 490", MACHINE_NOT_WORKING ) // The Quizard games are RETAIL CD-i units, with additional JAMMA adapters & dongles for protection, hence being 'clones' of the system. -/* YEAR NAME PARENT MACHINE INPUT DEVICE INIT MONITOR COMPANY FULLNAME */ -GAME( 1995, cdibios, 0, cdimono1_base, quizard, cdi_state, empty_init, ROT0, "Philips", "CD-i (Mono-I) (PAL) BIOS", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IS_BIOS_ROOT ) +/* YEAR NAME PARENT MACHINE INPUT DEVICE INIT MONITOR COMPANY FULLNAME */ +GAME( 1995, cdibios, 0, cdimono1_base, quizard, quizard_state, empty_init, ROT0, "Philips", "CD-i (Mono-I) (PAL) BIOS", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IS_BIOS_ROOT ) -GAME( 1995, quizard, cdibios, quizard1, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.8)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1995, quizard_17, quizard, quizard1, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.7)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1995, quizard_12, quizard, quizard1, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.2)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1995, quizard_10, quizard, quizard1, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.0)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard, cdibios, quizard, quizard, quizard1_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.8, German, i8751 DE 11 D3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard_17, quizard, quizard, quizard, quizard1_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.7, German, i8751 DE 11 D3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard_12, quizard, quizard, quizard, quizard1_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.2, German, i8751 DE 11 D3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard_10, quizard, quizard, quizard, quizard1_state, empty_init, ROT0, "TAB Austria", "Quizard (v1.0, German, i8751 DE 11 D3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1995, quizard2, cdibios, quizard2, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 2 (v2.3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1995, quizard2_22, quizard2, quizard2, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 2 (v2.2)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard2, cdibios, quizard, quizard, quizard2_state, empty_init, ROT0, "TAB Austria", "Quizard 2 (v2.3, German, i8751 DN 122 D3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard2_22, quizard2, quizard, quizard, quizard2_state, empty_init, ROT0, "TAB Austria", "Quizard 2 (v2.2, German, i8751 DN 122 D3)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) // Quizard 3 and 4 will hang after inserting a coin (incomplete protection sims?) - -GAME( 1995, quizard3, cdibios, quizard3, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 3 (v3.4)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1996, quizard3_32, quizard3, quizard3, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 3 (v3.2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) - -GAME( 1998, quizard4, cdibios, quizard4, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1998, quizard4_41, quizard4, quizard4, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1997, quizard4_40, quizard4, quizard4, quizard, cdi_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.0)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard3, cdibios, quizard, quizard, quizard3_state, empty_init, ROT0, "TAB Austria", "Quizard 3 (v3.4, German, i8751 DE 132 D3)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1995, quizard3a, quizard3, quizard, quizard, quizard3_state, empty_init, ROT0, "TAB Austria", "Quizard 3 (v3.4, German, i8751 DE 132 A1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1996, quizard3_32, quizard3, quizard, quizard, quizard3_state, empty_init, ROT0, "TAB Austria", "Quizard 3 (v3.2, German, i8751 DE 132 D3)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) + +GAME( 1998, quizard4, cdibios, quizard, quizard, quizard4_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.2, German, i8751 DE 142 D3)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1998, quizard4cz, quizard4, quizard, quizard, quizard4_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.2, Czech, i8751 TS142 CZ1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1998, quizard4_41, quizard4, quizard, quizard, quizard4_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.1, German, i8751 DE 142 D3)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1997, quizard4_40, quizard4, quizard, quizard, quizard4_state, empty_init, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.0, German, i8751 DE 142 D3)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/drivers/cgang.cpp b/src/mame/drivers/cgang.cpp index b5504d1706d..c2346a7c86a 100644 --- a/src/mame/drivers/cgang.cpp +++ b/src/mame/drivers/cgang.cpp @@ -17,6 +17,9 @@ TODO: - dump/add Japanese version - game can't be played properly within MAME's constraints (mechanical stuff, and the lightguns linked to it) +- shot target is sometimes ignored, maybe a BTANB? since it's easy to dismiss + on the real thing as a missed aim. It turns on the lightgun lamp but then + doesn't read the lightsensor. ------------------------------------------------------------------------------- @@ -35,7 +38,8 @@ Audio CPU side: - M5L8255AP-5 PPI - Namco CUS121 sound interface, same chip used in Namco System 1 - Yamaha YM2151 @ 3.57MHz, 2*NEC D7759C @ 640kHz -- 2*128KB ADPCM ROM (27C010, one for each D7759C) +- 2*128KB ADPCM ROM (27C010, one for each D7759C; labels usually peeled off + or handwritten, perhaps due to field upgrade) Cabinet: - 5 lanes with movable aliens, lightsensor under mouth @@ -113,7 +117,7 @@ public: m_cg_count(*this, "cg_count%u", 0U) { } - // machine drivers + // machine configs void cgang(machine_config &config); protected: @@ -349,7 +353,7 @@ void cgang_state::refresh_motor_output() m_en_count[i] = int((m_en_pos[i] / float(CG_MOTOR_LIMIT)) * 100.0 + 0.5); } - m_door_count = int((m_door_motor_pos / float(DOOR_MOTOR_LIMIT)) * 100.0 + 0.5); + m_door_count = (m_conf->read() & 1) ? int((m_door_motor_pos / float(DOOR_MOTOR_LIMIT)) * 100.0 + 0.5) : 0; } @@ -548,8 +552,7 @@ WRITE8_MEMBER(cgang_state::spot_w) // d0-d2: ufo boss spotlights // d3-d7: cosmo spotlights // it strobes them for dimming - for (int i = 0; i < 8; i++) - m_spot->matrix(1, data); + m_spot->matrix(1, data); } WRITE8_MEMBER(cgang_state::ppi5_a_w) @@ -731,7 +734,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void cgang_state::cgang(machine_config &config) @@ -845,10 +848,10 @@ ROM_START( cgang ) ROM_LOAD("cg1_sp0b.4b", 0x8000, 0x8000, CRC(62974140) SHA1(5eee3f6345521e3fb76acb3acaa5c9df75db91db) ) ROM_REGION( 0x20000, "adpcm0", 0 ) - ROM_LOAD( "9c", 0x00000, 0x20000, CRC(f9a3f8a0) SHA1(5ad8b408d36397227019afd15c3516f85488c6df) ) + ROM_LOAD("cg2_9c_e02a", 0x00000, 0x20000, CRC(f9a3f8a0) SHA1(5ad8b408d36397227019afd15c3516f85488c6df) ) // handwritten label seen on one PCB ROM_REGION( 0x20000, "adpcm1", 0 ) - ROM_LOAD( "9e", 0x00000, 0x20000, CRC(40e7f60b) SHA1(af641b0562db1ae033cee67df583d178fd8c93f3) ) + ROM_LOAD("cg2_9e_586e", 0x00000, 0x20000, CRC(40e7f60b) SHA1(af641b0562db1ae033cee67df583d178fd8c93f3) ) // handwritten label seen on one PCB ROM_END } // anonymous namespace diff --git a/src/mame/drivers/cking_master.cpp b/src/mame/drivers/cking_master.cpp index c52a79493b8..0769b55fc8f 100644 --- a/src/mame/drivers/cking_master.cpp +++ b/src/mame/drivers/cking_master.cpp @@ -48,7 +48,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void master(machine_config &config); void init_master(); @@ -215,7 +215,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void master_state::master(machine_config &config) diff --git a/src/mame/drivers/clickstart.cpp b/src/mame/drivers/clickstart.cpp index ac5fcb27a00..67eef36810c 100644 --- a/src/mame/drivers/clickstart.cpp +++ b/src/mame/drivers/clickstart.cpp @@ -47,9 +47,11 @@ public: , m_system_region(*this, "maincpu") , m_io_mouse_x(*this, "MOUSEX") , m_io_mouse_y(*this, "MOUSEY") + , m_keys(*this, "KEYS%u", 0U) , m_cart_region(nullptr) , m_mouse_x(0) , m_mouse_y(0) + , m_mouse_button(0) , m_mouse_dx(0) , m_mouse_dy(0) , m_uart_tx_fifo_start(0) @@ -98,14 +100,16 @@ private: required_memory_region m_system_region; required_ioport m_io_mouse_x; required_ioport m_io_mouse_y; + required_ioport_array<3> m_keys; memory_region *m_cart_region; uint16_t m_mouse_x; uint16_t m_mouse_y; + uint8_t m_mouse_button; int16_t m_mouse_dx; int16_t m_mouse_dy; - uint8_t m_uart_tx_fifo[32]; // arbitrary size + uint8_t m_uart_tx_fifo[1024]; // arbitrary size uint8_t m_uart_tx_fifo_start; uint8_t m_uart_tx_fifo_end; uint8_t m_uart_tx_fifo_count; @@ -125,6 +129,7 @@ void clickstart_state::machine_start() save_item(NAME(m_mouse_x)); save_item(NAME(m_mouse_y)); + save_item(NAME(m_mouse_button)); save_item(NAME(m_mouse_dx)); save_item(NAME(m_mouse_dy)); @@ -141,8 +146,9 @@ void clickstart_state::machine_start() void clickstart_state::machine_reset() { - m_mouse_x = 0xffff; - m_mouse_y = 0xffff; + m_mouse_x = m_io_mouse_x->read(); + m_mouse_y = m_io_mouse_y->read(); + m_mouse_button = 0; m_mouse_dx = 0; m_mouse_dy = 0; @@ -198,18 +204,20 @@ void clickstart_state::uart_tx_fifo_push(uint8_t value) INPUT_CHANGED_MEMBER(clickstart_state::key_update) { const size_t keycode = static_cast<size_t>(param); + printf("keycode:%02x, oldval:%02x, newval:%02x\n", (uint8_t)keycode, oldval, newval); - uint8_t buffer[5] = {}; - buffer[0] = 0x01; - buffer[1] = newval ? keycode : 0x3f; - buffer[2] = 0x3f; - buffer[3] = 0x01; + uint8_t buffer[6] = {}; + buffer[0] = 0x00; + buffer[1] = 0x01; + buffer[2] = newval ? keycode : 0x3f; + buffer[3] = 0x2f; buffer[4] = 0x01; + buffer[5] = 0x01; printf("Keyboard queueing: "); uint16_t sum = 0; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { uart_tx_fifo_push(buffer[i] ^ 0xff); sum += buffer[i]; @@ -222,32 +230,38 @@ INPUT_CHANGED_MEMBER(clickstart_state::key_update) INPUT_CHANGED_MEMBER(clickstart_state::mouse_update) { - uint16_t x = m_io_mouse_x->read(); - uint16_t y = m_io_mouse_y->read(); - uint16_t old_mouse_x = m_mouse_x; - uint16_t old_mouse_y = m_mouse_y; - - if (m_mouse_x == 0xffff) - { - old_mouse_x = x; - old_mouse_y = y; - } - - m_mouse_x = x; - m_mouse_y = y; - - m_mouse_dx += (m_mouse_x - old_mouse_x); - m_mouse_dy += (m_mouse_y - old_mouse_y); - - if (m_mouse_dx < -63) - m_mouse_dx = -63; - else if (m_mouse_dx > 62) - m_mouse_dx = 62; - - if (m_mouse_dy < -63) - m_mouse_dy = -63; - else if (m_mouse_dy > 62) - m_mouse_dy = 62; + m_mouse_button = newval ? (uint8_t)static_cast<size_t>(param) : 0; + + const uint16_t x_val(m_io_mouse_x->read()); + const uint16_t y_val(m_io_mouse_y->read()); + int16_t x_delta(x_val - m_mouse_x); + int16_t y_delta(y_val - m_mouse_y); + + // deal with wraparound + if (0x0200 <= x_delta) + x_delta -= 0x400; + else if (-0x0200 >= x_delta) + x_delta += 0x400; + if (0x100 <= y_delta) + y_delta -= 0x200; + else if (-0x100 >= y_delta) + x_delta += 0x200; + + m_mouse_x = x_val; + m_mouse_y = y_val; + + m_mouse_dx = x_delta; + m_mouse_dy = -y_delta; + + if (m_mouse_dx < -255) + m_mouse_dx = -255; + else if (m_mouse_dx > 255) + m_mouse_dx = 255; + + if (m_mouse_dy < -255) + m_mouse_dy = -255; + else if (m_mouse_dy > 255) + m_mouse_dy = 255; update_mouse_buffer(); @@ -257,27 +271,22 @@ INPUT_CHANGED_MEMBER(clickstart_state::mouse_update) void clickstart_state::update_mouse_buffer() { - if (m_mouse_dx == 0 && m_mouse_dy == 0) - return; - - uint8_t buffer[5] = {}; - buffer[0] = 0x01; - buffer[1] = 0x3f; - buffer[2] = 0x3f; - buffer[3] = (m_mouse_dx + 1) & 0x3f; - buffer[4] = (m_mouse_dy + 1) & 0x3f; + uint8_t buffer[6] = {}; + buffer[0] = 0x00; + buffer[1] = 0x01 | m_mouse_button; + buffer[2] = 0x3e | ((m_mouse_dx >> 1) & 0x80); + buffer[3] = 0x3f | ((m_mouse_dy >> 1) & 0x80); + buffer[4] = (m_mouse_dx & 0xfe) + 1; + buffer[5] = (m_mouse_dy & 0xfe) + 1; - printf("Mouse queueing: "); uint16_t sum = 0; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { uart_tx_fifo_push(buffer[i] ^ 0xff); sum += buffer[i]; - printf("%02x/%02x ", buffer[i], buffer[i] ^ 0xff); } sum = (sum & 0xff) ^ 0xff; uart_tx_fifo_push((uint8_t)sum); - printf("%02x\n", (uint8_t)sum); } READ16_MEMBER(clickstart_state::rom_r) @@ -302,24 +311,26 @@ WRITE16_MEMBER(clickstart_state::porta_w) WRITE16_MEMBER(clickstart_state::portb_w) { - logerror("%s: portb_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); + //logerror("%s: portb_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); } WRITE16_MEMBER(clickstart_state::portc_w) { + // Bit 12: SCK from SPG SIO + // Bit 11: SDA from SPG SIO //logerror("%s: portc_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); } READ16_MEMBER(clickstart_state::porta_r) { uint16_t data = 0x4000; - //logerror("%s: porta_r: %04x & %04x\n", machine().describe_context(), data, mem_mask); + logerror("%s: porta_r: %04x & %04x\n", machine().describe_context(), data, mem_mask); return data; } READ16_MEMBER(clickstart_state::portb_r) { - logerror("%s: portb_r: %04x\n", machine().describe_context(), mem_mask); + //logerror("%s: portb_r: %04x\n", machine().describe_context(), mem_mask); return 0; } @@ -343,10 +354,14 @@ void clickstart_state::mem_map(address_map &map) static INPUT_PORTS_START( clickstart ) PORT_START("MOUSEX") - PORT_BIT(0x3e, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, mouse_update, 0) + PORT_BIT(0x3ff, 0x00, IPT_MOUSE_X) PORT_MINMAX(0x0000,0x03ff) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, mouse_update, 0) PORT_START("MOUSEY") - PORT_BIT(0x3e, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, mouse_update, 0) + PORT_BIT(0x1ff, 0x00, IPT_MOUSE_Y) PORT_MINMAX(0x0000,0x01ff) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, mouse_update, 0) + + PORT_START("MOUSEBTN") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, mouse_update, 0x10) + PORT_BIT(0xfffe, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("KEYS0") PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x01) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') @@ -377,24 +392,26 @@ static INPUT_PORTS_START( clickstart ) PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x18) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('x') PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x19) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('y') PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x1a) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('z') - PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x1b) PORT_CODE(KEYCODE_0) PORT_CHAR('0') - PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x1c) PORT_CODE(KEYCODE_1) PORT_CHAR('1') - PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x1d) PORT_CODE(KEYCODE_2) PORT_CHAR('2') - PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x1e) PORT_CODE(KEYCODE_3) PORT_CHAR('3') - PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x1f) PORT_CODE(KEYCODE_4) PORT_CHAR('4') - PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x20) PORT_CODE(KEYCODE_5) PORT_CHAR('5') + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x25) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x26) PORT_CODE(KEYCODE_1) PORT_CHAR('1') + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x28) PORT_CODE(KEYCODE_2) PORT_CHAR('2') + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x29) PORT_CODE(KEYCODE_3) PORT_CHAR('3') + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2a) PORT_CODE(KEYCODE_4) PORT_CHAR('4') + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2b) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_START("KEYS2") - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x21) PORT_CODE(KEYCODE_6) PORT_CHAR('6') - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x22) PORT_CODE(KEYCODE_7) PORT_CHAR('7') - PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x23) PORT_CODE(KEYCODE_8) PORT_CHAR('8') + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2d) PORT_CODE(KEYCODE_6) PORT_CHAR('6') + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2e) PORT_CODE(KEYCODE_7) PORT_CHAR('7') + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2f) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x24) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x27) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0xa9) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("Shift") - PORT_BIT(0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2c) PORT_CODE(KEYCODE_LALT) PORT_NAME("Music") + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0xa9) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("Shift") PORT_TOGGLE + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, clickstart_state, key_update, 0x2f) PORT_CODE(KEYCODE_TILDE) PORT_NAME("Pause") PORT_TOGGLE + PORT_BIT(0xff00, IP_ACTIVE_HIGH, IPT_UNUSED) INPUT_PORTS_END -// There is a SEEPROM on the motherboard (type?) +// There is a 24C08AN SEEPROM on the motherboard void clickstart_state::clickstart(machine_config &config) { diff --git a/src/mame/drivers/cliffhgr.cpp b/src/mame/drivers/cliffhgr.cpp index 32d6407c675..01e2cd345bd 100644 --- a/src/mame/drivers/cliffhgr.cpp +++ b/src/mame/drivers/cliffhgr.cpp @@ -344,9 +344,9 @@ static INPUT_PORTS_START( cliffhgr ) PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("G11:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Short Scenes" ) PORT_DIPLOCATION("G11:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Short Scenes" ) PORT_DIPLOCATION("G11:7") + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("G11:6") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x20, DEF_STR( On ) ) diff --git a/src/mame/drivers/compuchess.cpp b/src/mame/drivers/compuchess.cpp index b78c6c248bc..0c065f2766e 100644 --- a/src/mame/drivers/compuchess.cpp +++ b/src/mame/drivers/compuchess.cpp @@ -101,7 +101,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(reset_switch) { update_reset(newval); } - // machine drivers + // machine configs void cmpchess(machine_config &config); void mk1(machine_config &config); void cnc(machine_config &config); diff --git a/src/mame/drivers/cps1bl_5205.cpp b/src/mame/drivers/cps1bl_5205.cpp index c9ced627017..1d8b5485cd4 100644 --- a/src/mame/drivers/cps1bl_5205.cpp +++ b/src/mame/drivers/cps1bl_5205.cpp @@ -19,7 +19,14 @@ Often the 2x M5205 are clocked with a 400KHz xtal (should really be 384KHz) so pitch of samples is slightly out as well. The sf2 sets seem to have quite a few missing samples? - *** see fcrash.cpp for game status *** +Status of each game: +-------------------- +sf2mdt, sf2mdtb: OK. +sf2mdta, sf2ceb: Scroll 2X has strange 0x200 writes that cause missing fighters' portraits at the vs. screen + and glitched backgrounds during fights. Masking them out seems a hack. +captcommb2: OK. +knightsb3: OK. + */ #include "emu.h" diff --git a/src/mame/drivers/cps1bl_pic.cpp b/src/mame/drivers/cps1bl_pic.cpp index 55e0e9c132c..8d9797c00df 100644 --- a/src/mame/drivers/cps1bl_pic.cpp +++ b/src/mame/drivers/cps1bl_pic.cpp @@ -20,7 +20,16 @@ Unless any un-protected PIcs ever turn up (unlikely) then "decapping" of working chips is probably the only way valid dumps will ever be made. - *** see fcrash.cpp for game status *** +Status of each game: +-------------------- +dinopic: No sound. +dinopic2: No sound, one bad graphics ROM. Copying 8.bin from dinopic fixes it. +dinopic3: No sound. Some minor gfx priority issues, confirmed present on real board. +punipic, punipic2: No sound. Problems in Central Park. Patches used. +punipic3: Same as punipic, and doors are missing. +slampic: No sound. Some minor gfx issues (sprites on character select screen). +slampic2: No sound. All gfx issues confirmed present on real board. + */ #include "emu.h" diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp index 50cf4c71f52..75572b5c596 100644 --- a/src/mame/drivers/cubo.cpp +++ b/src/mame/drivers/cubo.cpp @@ -8,23 +8,26 @@ for JAMMA use. Known Games: - Title | rev. | year - ---------------------------------------------- - Candy Puzzle | 1.0 | 1995 - Double Strixx | | 1995 - Greyhound Race | | 199x - Harem Challenge | | 1995 - Laser Quiz | | 1995 - Laser Quiz France | 1.0 | 1995 - Laser Quiz Greece? | | 1995 *may exist - Laser Quiz 2 "Italy" | 1.0 | 1995 - Laser Strixx | | 1995 - Laser Strixx 2 | | 1995 - Lucky Five | | 1995 - Magic Number | | 1995 - Magic Premium | 1.1 | 1996 - Odeon Twister | | 199x - Odeon Twister 2 |202.19| 1999 + Dumped | Title | Rev. | Year | Notes + ---------------------------------------------------- + YES | Candy Puzzle | 1.0 | 1995 | + | Double Strixx | | 1995 | + YES | El Dorado | 4.2 | 199x | Laser Gate 2 + | Greyhound Race | | 199x | + YES | Harem Challenge | | 1995 | + | Laser Quiz | | 1995 | + | Laser Quiz France | 1.0 | 1995 | + | Laser Quiz Greece | | 1995 | May exist + YES | Laser Quiz Italy | | 1995 | + YES | Laser Quiz 2 Greece | | 1995 | + YES | Laser Quiz 2 Italy | 1.0 | 1995 | + | Laser Strixx | | 1995 | + YES | Laser Strixx 2 | | 1995 | + | Lucky Five | | 1995 | + YES | Magic Number | | 1995 | + YES | Magic Premium | 1.1| 1996 | + YES | Odeon Twister | 1.4| 199x | + YES | Odeon Twister 2 | 202.19| 1999 | ToDo: - remove the hack needed to make inputs working @@ -1139,13 +1142,20 @@ ROM_START( lsrquiz ) DISK_IMAGE_READONLY( "lsrquiz", 0, BAD_DUMP SHA1(41fb6cd0c9d36bd77e9c3db69d36801edc791e96) ) ROM_END -ROM_START( lsrquiz2 ) +ROM_START( lsrquiz2i ) CD32_BIOS DISK_REGION( "cdrom" ) DISK_IMAGE_READONLY( "lsrquiz2", 0, BAD_DUMP SHA1(78e261df1c548fa492e6cf37a9469640bb8816bf) ) ROM_END +ROM_START( lsrquizg ) + CD32_BIOS + + DISK_REGION( "cdrom" ) + DISK_IMAGE_READONLY( "laserquizgreek2pro", 0, BAD_DUMP SHA1(8538915b4a0078f19197a5562e37ed3e6d0429a4) ) +ROM_END + ROM_START( mgprem11 ) CD32_BIOS @@ -1167,6 +1177,13 @@ ROM_START( mgnumber ) DISK_IMAGE_READONLY( "magicnumber", 0, BAD_DUMP SHA1(60e1fadc42694742d19cc0ac2b6e99e9e33faa3d) ) ROM_END +ROM_START( odeontw ) + CD32_BIOS + + DISK_REGION( "cdrom" ) + DISK_IMAGE_READONLY( "twister32_17_3", 0, BAD_DUMP SHA1(a40ec484708e22059f7186415283084ebf01323e) ) // has its audio cut a little, worth to mark as redump needed +ROM_END + ROM_START( odeontw2 ) CD32_BIOS @@ -1174,6 +1191,12 @@ ROM_START( odeontw2 ) DISK_IMAGE_READONLY( "odeontw2", 0, BAD_DUMP SHA1(f39e09f35b65a6ae9f1eba4a22f970626b7d3b71) ) ROM_END +ROM_START( eldoralg ) + CD32_BIOS + + DISK_REGION( "cdrom" ) + DISK_IMAGE_READONLY( "eldorado", 0, BAD_DUMP SHA1(bc1617c2e3438b729421c1d8b1bf88840b12f030) ) +ROM_END /************************************* @@ -1369,12 +1392,17 @@ INPUT_PORTS_END -GAME( 1993, cubo, 0, cubo, cubo, cubo_state, init_cubo, ROT0, "Commodore", "Cubo BIOS", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_IS_BIOS_ROOT ) -GAME( 1995, cndypuzl, cubo, cubo, cndypuzl, cubo_state, init_cndypuzl, ROT0, "CD Express", "Candy Puzzle (v1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1995, haremchl, cubo, cubo, haremchl, cubo_state, init_haremchl, ROT0, "CD Express", "Harem Challenge", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1995, lsrquiz, cubo, cubo, lsrquiz, cubo_state, init_lsrquiz, ROT0, "CD Express", "Laser Quiz Italy", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* no player 2 inputs (ingame), wrong pitch for most gfxs */ -GAME( 1995, lsrquiz2, cubo, cubo, lsrquiz2, cubo_state, init_lsrquiz2, ROT0, "CD Express", "Laser Quiz 2 Italy (v1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* wrong pitch for some gfxs, crashes during gameplay */ -GAME( 1995, lasstixx, cubo, cubo, lasstixx, cubo_state, init_lasstixx, ROT0, "CD Express", "Laser Strixx 2", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1995, mgnumber, cubo, cubo, mgnumber, cubo_state, init_mgnumber, ROT0, "CD Express", "Magic Number", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1996, mgprem11, cubo, cubo, mgprem11, cubo_state, init_mgprem11, ROT0, "CD Express", "Magic Premium (v1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1999, odeontw2, cubo, cubo, odeontw2, cubo_state, init_cubo, ROT0, "CD Express", "Odeon Twister 2 (v202.19)", MACHINE_NOT_WORKING ) +GAME( 1993, cubo, 0, cubo, cubo, cubo_state, init_cubo, ROT0, "Commodore", "Cubo BIOS", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_IS_BIOS_ROOT ) +GAME( 1995, cndypuzl, cubo, cubo, cndypuzl, cubo_state, init_cndypuzl, ROT0, "CD Express", "Candy Puzzle (v1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1995, haremchl, cubo, cubo, haremchl, cubo_state, init_haremchl, ROT0, "CD Express", "Harem Challenge", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1995, lsrquiz, cubo, cubo, lsrquiz, cubo_state, init_lsrquiz, ROT0, "CD Express", "Laser Quiz Italy", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* no player 2 inputs (ingame), wrong pitch for most gfxs */ +GAME( 1995, lsrquizg, cubo, cubo, lsrquiz, cubo_state, init_lsrquiz, ROT0, "CD Express", "Laser Quiz Greece", MACHINE_NOT_WORKING ) +GAME( 1995, lsrquiz2i, cubo, cubo, lsrquiz2, cubo_state, init_lsrquiz2, ROT0, "CD Express", "Laser Quiz 2 Italy (v1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* wrong pitch for some gfxs, crashes during gameplay */ +GAME( 1995, lasstixx, cubo, cubo, lasstixx, cubo_state, init_lasstixx, ROT0, "CD Express", "Laser Strixx 2", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1995, mgnumber, cubo, cubo, mgnumber, cubo_state, init_mgnumber, ROT0, "CD Express", "Magic Number", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1996, mgprem11, cubo, cubo, mgprem11, cubo_state, init_mgprem11, ROT0, "CD Express", "Magic Premium (v1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 19??, odeontw, cubo, cubo, odeontw2, cubo_state, init_cubo, ROT0, "CD Express", "Odeon Twister (v1.4)", MACHINE_NOT_WORKING ) +GAME( 1999, odeontw2, cubo, cubo, odeontw2, cubo_state, init_cubo, ROT0, "CD Express", "Odeon Twister 2 (v202.19)", MACHINE_NOT_WORKING ) + +// Laser Gate 2 +GAME( 19??, eldoralg, cubo, cubo, cubo, cubo_state, init_cubo, ROT0, "CD Express", "Eldorado (4.2)", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/cxg_ch2001.cpp b/src/mame/drivers/cxg_ch2001.cpp index afa4fdab5e1..b418229acf8 100644 --- a/src/mame/drivers/cxg_ch2001.cpp +++ b/src/mame/drivers/cxg_ch2001.cpp @@ -47,7 +47,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void ch2001(machine_config &config); protected: @@ -179,7 +179,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void ch2001_state::ch2001(machine_config &config) diff --git a/src/mame/drivers/cxg_dominator.cpp b/src/mame/drivers/cxg_dominator.cpp index 4ba5f50be8c..166aae962da 100644 --- a/src/mame/drivers/cxg_dominator.cpp +++ b/src/mame/drivers/cxg_dominator.cpp @@ -50,7 +50,7 @@ public: m_out_lcd(*this, "lcd%u.%u", 0U, 0U) { } - // machine drivers + // machine configs void dominator(machine_config &config); protected: @@ -195,7 +195,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void dominator_state::dominator(machine_config &config) diff --git a/src/mame/drivers/cxg_sphinx40.cpp b/src/mame/drivers/cxg_sphinx40.cpp index 8eb1d94d8ae..0c689f19412 100644 --- a/src/mame/drivers/cxg_sphinx40.cpp +++ b/src/mame/drivers/cxg_sphinx40.cpp @@ -74,7 +74,7 @@ public: m_out_lcd(*this, "lcd%u", 0U) { } - // machine drivers + // machine configs void sphinx40(machine_config &config); protected: @@ -269,7 +269,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void sphinx40_state::sphinx40(machine_config &config) diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp index 6c2abbad2ba..cb56a3ad89a 100644 --- a/src/mame/drivers/dccons.cpp +++ b/src/mame/drivers/dccons.cpp @@ -366,22 +366,20 @@ WRITE64_MEMBER(dc_cons_state::dc_pdtra_w ) PDTRA = (data & 0xffff); } -#if 0 READ8_MEMBER(dc_cons_state::dc_flash_r) { - return m_dcflash->read(offset); + return m_dcflash->read(offset+0x20000); } WRITE8_MEMBER(dc_cons_state::dc_flash_w) { - m_dcflash->write(offset,data); + m_dcflash->write(offset+0x20000,data); } -#endif void dc_cons_state::dc_map(address_map &map) { map(0x00000000, 0x001fffff).rom().nopw(); // BIOS - map(0x00200000, 0x0021ffff).rom().region("dcflash", 0);//.rw(FUNC(dc_cons_state::dc_flash_r), FUNC(dc_cons_state::dc_flash_w)); + map(0x00200000, 0x0021ffff).rw(FUNC(dc_cons_state::dc_flash_r), FUNC(dc_cons_state::dc_flash_w)).region("dcflash", 0x20000); map(0x005f6800, 0x005f69ff).rw(FUNC(dc_cons_state::dc_sysctrl_r), FUNC(dc_cons_state::dc_sysctrl_w)); map(0x005f6c00, 0x005f6cff).m(m_maple, FUNC(maple_dc_device::amap)); map(0x005f7000, 0x005f701f).rw(m_ata, FUNC(ata_interface_device::cs1_r), FUNC(ata_interface_device::cs1_w)).umask64(0x0000ffff0000ffff); @@ -647,7 +645,7 @@ void dc_cons_state::dc_base(machine_config &config) MCFG_MACHINE_RESET_OVERRIDE(dc_cons_state,dc_console ) -// MACRONIX_29LV160TMC(config, "dcflash"); + FUJITSU_29LV002TC(config, "dcflash"); MAPLE_DC(config, m_maple, 0, m_maincpu); m_maple->irq_callback().set(FUNC(dc_state::maple_irq)); @@ -784,16 +782,16 @@ struct cid_record ROM_START(dc) DREAMCAST_COMMON_BIOS - ROM_REGION64_LE(0x020000, "dcflash", 0) - ROM_LOAD( "dcus_ntsc.bin", 0x000000, 0x020000, CRC(4136c25b) SHA1(1efa00ab9d8357a9f91e5be931a3efd6236f2b79) ) // dumped from VA2.4 mobo with 1.022 BIOS + ROM_REGION64_LE(0x040000, "dcflash", ROMREGION_ERASEFF) + ROM_LOAD( "dcus_ntsc.bin", 0x020000, 0x020000, CRC(4136c25b) SHA1(1efa00ab9d8357a9f91e5be931a3efd6236f2b79) ) // dumped from VA2.4 mobo with 1.022 BIOS ROM_END ROM_START( dceu ) DREAMCAST_COMMON_BIOS - ROM_REGION64_LE(0x020000, "dcflash", 0) - ROM_LOAD( "dceu_pal.bin", 0x000000, 0x020000, CRC(7a102d05) SHA1(13e444e613dffe0a8bce073a01efa9a1d4626ba7) ) // VA1 - ROM_LOAD( "dceu_pala.bin", 0x000000, 0x020000, CRC(2e8dfa07) SHA1(ca5fd977bbf8f48c28c1027a023b038123d57d39) ) // from VA1 with 1.01d BIOS + ROM_REGION64_LE(0x040000, "dcflash", ROMREGION_ERASEFF) + ROM_LOAD( "dceu_pal.bin", 0x020000, 0x020000, CRC(7a102d05) SHA1(13e444e613dffe0a8bce073a01efa9a1d4626ba7) ) // VA1 + ROM_LOAD( "dceu_pala.bin", 0x020000, 0x020000, CRC(2e8dfa07) SHA1(ca5fd977bbf8f48c28c1027a023b038123d57d39) ) // from VA1 with 1.01d BIOS ROM_END ROM_START( dcjp ) @@ -801,8 +799,8 @@ ROM_START( dcjp ) ROM_SYSTEM_BIOS(4, "1004", "v1.004 (Japan)") // oldest known mass production version, supports Japan region only ROM_LOAD_BIOS(4, "mpr-21068.ic501", 0x000000, 0x200000, CRC(5454841f) SHA1(1ea132c0fbbf07ef76789eadc07908045c089bd6) ) - ROM_REGION64_LE(0x020000, "dcflash", 0) - ROM_LOAD( "dcjp_ntsc.bin", 0x000000, 0x020000, CRC(306023ab) SHA1(5fb66adb6d1b54a552fe9c2bb736e4c6960e447d) ) // from refurbished VA0 with 1.004 BIOS + ROM_REGION64_LE(0x040000, "dcflash", ROMREGION_ERASEFF) + ROM_LOAD( "dcjp_ntsc.bin", 0x020000, 0x020000, CRC(306023ab) SHA1(5fb66adb6d1b54a552fe9c2bb736e4c6960e447d) ) // from refurbished VA0 with 1.004 BIOS ROM_END // unauthorised portable modification @@ -811,8 +809,8 @@ ROM_START( dctream ) // uses regular mpr-21931 BIOS chip, have region-free mod-chip installed, see driver init. ROM_LOAD( "mpr-21931.ic501", 0x000000, 0x200000, CRC(89f2b1a1) SHA1(8951d1bb219ab2ff8583033d2119c899cc81f18c) ) - ROM_REGION64_LE(0x020000, "dcflash", 0) - ROM_LOAD( "dc_flash.bin", 0x000000, 0x020000, CRC(9d5515c4) SHA1(78a86fd4e8b58fc9d3535eef6591178f1b97ecf9) ) // VA1 NTSC-US + ROM_REGION64_LE(0x040000, "dcflash", ROMREGION_ERASEFF) + ROM_LOAD( "dc_flash.bin", 0x020000, 0x020000, CRC(9d5515c4) SHA1(78a86fd4e8b58fc9d3535eef6591178f1b97ecf9) ) // VA1 NTSC-US ROM_END // normally, with DIP switch 4 off, HKT-0100/0110/0120 AKA "Katana Set 5.xx", will be booted from flash ROM IC507 (first 2 dumps below) @@ -836,8 +834,8 @@ ROM_START( dcdev ) ROM_SYSTEM_BIOS(4, "041", "Katana Set5 Checker v0.41") ROM_LOAD_BIOS(4, "set5v0.41.bin", 0x000000, 0x200000, CRC(485877bd) SHA1(dc1af1f1248ffa87d57bc5ef2ea41aac95ecfc5e) ) - ROM_REGION64_LE(0x020000, "dcflash", 0) - ROM_LOAD( "hkt-0120-flash.bin", 0x000000, 0x020000, CRC(7784c304) SHA1(31ef57f550d8cd13e40263cbc657253089e53034) ) // Dev.Boxes have empty (FF filled) flash ROM + ROM_REGION64_LE(0x040000, "dcflash", ROMREGION_ERASEFF) + // Dev.Boxes have empty (FF filled) flash ROM ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ @@ -877,13 +875,20 @@ Consists of HKS-0300 main unit and HKS-0100 LCD with touch screen z: unused X/Y values range seems 3000x2294 - Known software: - HDR-0093 Fish Life Red Sea Playful Edition - *HDR-0094 Fish Life Amazon Playful Edition - HDR-0095 Fish Life Episode 1 Basic Edition - HDR-0096 Fish Life Episode 2 Basic Edition - HDR-0097 Fish Life Episode 3 Basic Edition + HKS-0200 software GD-ROMs: + HDR-0093 673-01613 Fish Life Red Sea Playful Edition + *HDR-0094 673-01672 Fish Life Amazon Playful Edition + HDR-0095 673-01??? Fish Life Episode 1 Basic Edition + HDR-0096 673-01??? Fish Life Episode 2 Basic Edition + HDR-0097 673-01??? Fish Life Episode 3 Basic Edition + * denotes these games are archived. + Machines high likely based on Fish Life: + タッチであそぼ! / Play with a touch! (2001) - touch screen cabinet for McDonald's Japan https://www.famitsu.com/game/news/2001/09/13/103,1000362656,1276,0,0.html + タッチでポン! / Pong by touch! (2001) - sushi ordering system https://web.archive.org/web/20180421214402/sega.jp/fb/creators/vol_13/1.html + + notes: + Some sources claims Playful and Basic editions hardware is not the same, has to be verified. Press down+B for Test Mode */ ROM_START( dcfish ) @@ -891,13 +896,12 @@ ROM_START( dcfish ) ROM_LOAD( "mpr-21931.ic501", 0x000000, 0x200000, CRC(89f2b1a1) SHA1(8951d1bb219ab2ff8583033d2119c899cc81f18c) ) // regular v1.0d 3.3v BIOS // similar Dreamcast flashes, machine_name was changed to "Fish Life", machine_code2 is 0xff (verified by software) - // dumped from used device, should be replaced with cleaned binary when flash programming will be emulated - ROM_REGION64_LE(0x020000, "dcflash", 0) - ROM_LOAD( "fish_flash.bin", 0x000000, 0x020000, BAD_DUMP CRC(73cbc49b) SHA1(c55caf64eb0ac5f8e73a1a385064606ad12947b7) ) // VA1 NTSC-JP + ROM_REGION64_LE(0x040000, "dcflash", ROMREGION_ERASEFF) + ROM_LOAD( "fish_flash.bin", 0x020000, 0x020000, CRC(f7f36b7b) SHA1(f49d18de85c519c16d5447ca8ae39b62d1b8e483) ) // VA1 NTSC-JP DISK_REGION( "ata:0:gdrom" ) DISK_IMAGE_READONLY( "fish_life_amazon", 0, SHA1(2cbba727b219bbbeddf551d0f3e80c5f8ecbe21f) ) // HDR-0094 ROM_END -/* YEAR NAME PARENT MACHINE INPUT CLASS INIT MONITOR COMPANY FULLNAME */ -GAME( 2000, dcfish, 0, dc_fish, dcfish,dc_cons_state, init_dcjp, ROT0, "Sega", "Fish Life Amazon Playful Edition (Japan)", MACHINE_NOT_WORKING ) +/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME */ +GAME( 2000, dcfish, 0, dc_fish, dcfish,dc_cons_state, init_dcjp, ROT0, "Sega", "Fish Life Amazon Playful Edition (Japan)", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp index 01f72a7197b..fb45982fc3b 100644 --- a/src/mame/drivers/ddragon.cpp +++ b/src/mame/drivers/ddragon.cpp @@ -1103,7 +1103,7 @@ void ddragon_state::ddragon2(machine_config &config) fmsnd.add_route(0, "mono", 0.60); fmsnd.add_route(1, "mono", 0.60); - okim6295_device &oki(OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified + okim6295_device &oki(OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 verified on bootleg PCB by Jose Tejada oki.add_route(ALL_OUTPUTS, "mono", 0.20); } @@ -1179,8 +1179,8 @@ ROM_START( ddragon ) ROM_LOAD( "21j-7", 0x00000, 0x10000, CRC(904de6f8) SHA1(3623e5ea05fd7c455992b7ed87e605b87c3850aa) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* unknown */ - ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* Layer priority */ + ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* Layer priority */ + ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ ROM_END ROM_START( ddragonw ) @@ -1703,7 +1703,8 @@ ROM_START( ddragon2 ) ROM_LOAD( "26j7-0.bin", 0x20000, 0x20000, CRC(bc6a48d5) SHA1(04c434f8cd42a8f82a263548183569396f9b684d) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "prom.16", 0x0000, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* sprite timing (same as ddragon) */ + ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* Layer priority (same as ddragon) */ + ROM_LOAD( "prom.16", 0x0000, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* sprite timing (same as ddragon) */ ROM_END diff --git a/src/mame/drivers/debut.cpp b/src/mame/drivers/debut.cpp index 8e09a1eac62..d7ac21da7a6 100644 --- a/src/mame/drivers/debut.cpp +++ b/src/mame/drivers/debut.cpp @@ -73,7 +73,7 @@ public: // assume that RESET button is tied to CPU RESET pin DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } - // machine drivers + // machine configs void debutm(machine_config &config); protected: diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp index 5d21ca1f196..cd759911d5b 100644 --- a/src/mame/drivers/dec0.cpp +++ b/src/mame/drivers/dec0.cpp @@ -2285,6 +2285,11 @@ ROM_START( hbarrel ) /* DE-0289-2 main board, DE-0293-1 sub/rom board */ ROM_LOAD( "mb7122e.17e", 0x200, 0x400, CRC(a5cda23e) SHA1(d6c8534ae3c95b47a0701047fef67f15dd71f3fe) ) /* Also known to be labeled as A-2 */ ROM_END +/* +There are known PCBs with ROMs 01 & 04 stamped as "-1" revision +At least 1 PCB was spotted with ROM labels as "MYF HEAVY BARREL 01-2" & "MYF HEAVY BARREL 04-2" +Niether version has been dumped to verify they are indeed different versions +*/ ROM_START( hbarrelu ) /* DE-0297-1 main board, DE-0299-0 sub/rom board */ ROM_REGION( 0x60000, "maincpu", 0 ) /* 6*64k for 68000 code */ ROM_LOAD16_BYTE( "heavy_barrel_04.3c", 0x00000, 0x10000, CRC(4877b09e) SHA1(30c653b2f59fece881d088b675192ff2599adbe3) ) diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp index 7a766ddc55a..b6424e510f3 100644 --- a/src/mame/drivers/dec8.cpp +++ b/src/mame/drivers/dec8.cpp @@ -2695,7 +2695,7 @@ ROM_START( gondou ) ROM_LOAD( "dt17.f11", 0x50000, 0x08000, CRC(3bbcff0d) SHA1(a8f7aa56ff49ed6b29240c3504d6c9945944953b) ) // Unique data to the US set ROM_LOAD( "dt21.f16", 0x60000, 0x10000, CRC(1c5f682d) SHA1(4b7022cce930a9e9a0087c91e8344269fe7ed889) ) ROM_LOAD( "dt22.f18", 0x70000, 0x08000, CRC(c1876a5f) SHA1(66122ce765723765e20036bd4d461a210c8b94d3) ) // Unique data to the US set - + ROM_REGION( 0x80000, "gfx3", 0 ) /* tiles */ ROM_LOAD( "dt08.h10", 0x00000, 0x08000, CRC(aec483f5) SHA1(1d6de823ab0eeb9c89e9c227428ff278663627f3) ) // Tiles data is the same for all 3 regions ROM_CONTINUE( 0x10000, 0x08000 ) diff --git a/src/mame/drivers/deco_mlc.cpp b/src/mame/drivers/deco_mlc.cpp index b2f385759d3..24ad15cadc2 100644 --- a/src/mame/drivers/deco_mlc.cpp +++ b/src/mame/drivers/deco_mlc.cpp @@ -102,6 +102,8 @@ Driver by Bryan McPhail, bmcphail@tendril.co.uk, thank you to Avedis and The Guru. + Note: MLC stands for MotherLess Cassette + ***************************************************************************/ #include "emu.h" diff --git a/src/mame/drivers/decwritr.cpp b/src/mame/drivers/decwritr.cpp index bcd83f09b89..ceb8f48d2c0 100644 --- a/src/mame/drivers/decwritr.cpp +++ b/src/mame/drivers/decwritr.cpp @@ -11,10 +11,13 @@ // tech manual: http://manx.classiccmp.org/mirror/vt100.net/docs/la120-tm/la120tm1.pdf #include "emu.h" +#include "bus/rs232/rs232.h" #include "cpu/i8085/i8085.h" #include "machine/74259.h" +#include "machine/dc305.h" #include "machine/er1400.h" #include "machine/i8251.h" +#include "machine/input_merger.h" #include "sound/beep.h" #include "render.h" #include "speaker.h" @@ -38,7 +41,8 @@ public: m_speaker(*this, "beeper"), m_usart(*this, "usart"), m_nvm(*this, "nvm"), - m_ledlatch(*this, "ledlatch") + m_ledlatch(*this, "ledlatch"), + m_prtlsi(*this, "prtlsi") { } @@ -49,6 +53,9 @@ private: bitmap.fill(rgb_t::black(), cliprect); return 0; } + + IRQ_CALLBACK_MEMBER(inta_cb); + DECLARE_READ8_MEMBER(la120_KBD_r); DECLARE_WRITE8_MEMBER(la120_LED_w); DECLARE_READ8_MEMBER(la120_NVR_r); @@ -67,12 +74,22 @@ private: required_device<i8251_device> m_usart; required_device<er1400_device> m_nvm; required_device<ls259_device> m_ledlatch; + required_device<dc305_device> m_prtlsi; ioport_port* m_col_array[16]; uint8_t m_led_7seg_counter; uint8_t m_led_7seg[4]; }; +IRQ_CALLBACK_MEMBER( decwriter_state::inta_cb ) +{ + // one wait state inserted + if (!machine().side_effects_disabled()) + m_maincpu->adjust_icount(-1); + + return m_prtlsi->inta(); +} + READ8_MEMBER( decwriter_state::la120_KBD_r ) { /* for reading the keyboard array, addr bits 5-11 are ignored. @@ -192,7 +209,7 @@ READ8_MEMBER( decwriter_state::la120_DC305_r ) if (!machine().side_effects_disabled()) m_maincpu->adjust_icount(-1); - uint8_t data = 0x00; + uint8_t data = m_prtlsi->read(offset); if (DC305_VERBOSE) logerror("DC305 Read from offset %01x, returning %02X\n", offset, data); return data; @@ -213,6 +230,7 @@ WRITE8_MEMBER( decwriter_state::la120_DC305_w ) if (!machine().side_effects_disabled()) m_maincpu->adjust_icount(-1); + m_prtlsi->write(offset, data); if (DC305_VERBOSE) logerror("DC305 Write of %02X to offset %01X\n", data, offset); } @@ -413,7 +431,7 @@ void decwriter_state::la120(machine_config &config) I8080A(config, m_maincpu, XTAL(18'000'000) / 9); // 18Mhz xtal on schematics, using an i8224 clock divider/reset sanitizer IC m_maincpu->set_addrmap(AS_PROGRAM, &decwriter_state::la120_mem); m_maincpu->set_addrmap(AS_IO, &decwriter_state::la120_io); - //m_maincpu->set_irq_acknowledge_callback("prtlsi", FUNC(dc305_device::inta_cb)); + m_maincpu->set_irq_acknowledge_callback(FUNC(decwriter_state::inta_cb)); /* video hardware */ //TODO: no actual screen! has 8 leds above the keyboard (similar to vt100/vk100) and has 4 7segment leds for showing an error code. @@ -423,10 +441,10 @@ void decwriter_state::la120(machine_config &config) screen.set_visarea_full(); screen.set_refresh_hz(30); - //dc305_device &prtlsi(DC305(config, "prtlsi", XTAL(18'000'000) / 9)); - //prtlsi.out_rxc_cb().set("usart", FUNC(i8251_device, write_rxc)); - //prtlsi.out_txc_cb().set("usart", FUNC(i8251_device, write_txc)); - //prtlsi.out_int_cb().set("mainint", FUNC(input_merger_device::in_w<0>)); + DC305(config, m_prtlsi, XTAL(18'000'000) / 9); + m_prtlsi->rxc_callback().set("usart", FUNC(i8251_device::write_rxc)); + m_prtlsi->txc_callback().set("usart", FUNC(i8251_device::write_txc)); + m_prtlsi->int_callback().set("mainint", FUNC(input_merger_device::in_w<0>)); LS259(config, m_ledlatch); // E2 on keyboard m_ledlatch->q_out_cb<0>().set_output("led1").invert(); // ON LINE @@ -445,19 +463,17 @@ void decwriter_state::la120(machine_config &config) BEEP(config, m_speaker, 786).add_route(ALL_OUTPUTS, "mono", 0.50); // TODO: LA120 speaker is controlled by asic; VT100 has: 7.945us per serial clock = ~125865.324hz, / 160 clocks per char = ~ 786 hz /* i8251 */ - I8251(config, "usart", XTAL(18'000'000) / 9); - /* - usart.txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); - usart.dtr_handler().set(RS232_TAG, FUNC(rs232_port_device::write_dtr)); - usart.rts_handler().set(RS232_TAG, FUNC(rs232_port_device::write_rts)); + i8251_device &usart(I8251(config, "usart", XTAL(18'000'000) / 9)); + usart.txd_handler().set("eia", FUNC(rs232_port_device::write_txd)); + usart.dtr_handler().set("eia", FUNC(rs232_port_device::write_dtr)); + usart.rts_handler().set("eia", FUNC(rs232_port_device::write_rts)); usart.rxrdy_handler().set("mainint", FUNC(input_merger_device::in_w<1>)); INPUT_MERGER_ANY_HIGH(config, "mainint").output_handler().set_inputline(m_maincpu, 0); - rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); + rs232_port_device &rs232(RS232_PORT(config, "eia", default_rs232_devices, nullptr)); rs232.rxd_handler().set("usart", FUNC(i8251_device::write_rxd)); rs232.dsr_handler().set("usart", FUNC(i8251_device::write_dsr)); - */ ER1400(config, m_nvm); } diff --git a/src/mame/drivers/dinoking.cpp b/src/mame/drivers/dinoking.cpp new file mode 100644 index 00000000000..3eab5caa0c0 --- /dev/null +++ b/src/mame/drivers/dinoking.cpp @@ -0,0 +1,89 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + +Taito mid-2000s medal hardware + +Currently two games are dumped: +Dinoking Kids - ダイノキングキッズ (2004) - K11J0985A - F39 ROM code +Dinoking Battle - ダイノキングバトル (2005) - K11J0998A - F54 ROM code + +Main CPU: H8S-2394 +Video chip: Axell AG-1 AX51102A (should be similar to the chip in gunpey.cpp) +Sound chip: OKI M9810B +XTALs: 20 MHz near CPU and sound chip, 25 MHz near video chip +*/ + + + +#include "emu.h" +#include "screen.h" +#include "speaker.h" +#include "cpu/h8/h8s2357.h" +#include "sound/okim9810.h" + + +class dinoking_state : public driver_device +{ +public: + dinoking_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void dinoking(machine_config &config); + +protected: + +private: + void mem_map(address_map &map); + + required_device<cpu_device> m_maincpu; +}; + + +void dinoking_state::mem_map(address_map &map) +{ + map(0x000000, 0x1fffff).rom().region("maincpu", 0); +} + + + +static INPUT_PORTS_START( dinoking ) +INPUT_PORTS_END + + +void dinoking_state::dinoking(machine_config &config) +{ + H8S2394(config, m_maincpu, 20_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &dinoking_state::mem_map); +} + + +ROM_START( dkkids ) + ROM_REGION16_BE( 0x200000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "f39-03.ic3", 0x000000, 0x200000, CRC(061ea9e6) SHA1(9a6957a24e228aa1f44bf91c635894ecd4871623) ) // ST-M27C160-100 + + ROM_REGION( 0x1000000, "gfx", 0 ) + ROM_LOAD( "f39-01.ic30", 0x000000, 0x1000000, CRC(1eb9efa6) SHA1(08aa33cb9a5e1e57702d23d7692ad9a289b9a4ed) ) // ST-M59PW1282-100MIT + + ROM_REGION( 0x400000, "oki", 0 ) + ROM_LOAD( "f39-02.ic27", 0x000000, 0x400000, CRC(f0a38e0e) SHA1(30ee275d4cce5bb50141e807dc64d6509eaf4937) ) // MBM29F033C-90PTN +ROM_END + +ROM_START( dkbattle ) + ROM_REGION16_BE( 0x200000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "f54-03.ic3", 0x000000, 0x200000, CRC(eeb61085) SHA1(33304c1fd068dc4fd0bacfd4e47e699aa4ae0b82) ) // ST-M27C160-100 + + ROM_REGION( 0x1000000, "gfx", 0 ) + ROM_LOAD( "f54-01.ic30", 0x000000, 0x1000000, CRC(f2006d02) SHA1(3ba1832eb3440b175014a4d00b56e24a9d8d1994) ) // ST-M59PW1282-100MIT + + ROM_REGION( 0x400000, "oki", 0 ) + ROM_LOAD( "f54-02.ic27", 0x000000, 0x400000, CRC(bd8e10e9) SHA1(a86fde5860501b06f63bafbc02ebc6160c682b1e) ) // MBM29F033C-90PTN +ROM_END + + +GAME( 2004, dkkids, 0, dinoking, dinoking, dinoking_state, empty_init, ROT0, "Taito Corporation", "Dinoking Kids", MACHINE_IS_SKELETON ) +GAME( 2005, dkbattle, 0, dinoking, dinoking, dinoking_state, empty_init, ROT0, "Taito Corporation", "Dinoking Battle", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp index 7dfe984f2c7..07562467680 100644 --- a/src/mame/drivers/djmain.cpp +++ b/src/mame/drivers/djmain.cpp @@ -1294,7 +1294,7 @@ static INPUT_PORTS_START( popnstage ) PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:6" ) INPUT_PORTS_END -#ifdef UNUSED_DEFINITION + static INPUT_PORTS_START( popnstex ) PORT_INCLUDE( popnstage ) PORT_MODIFY("DSW3") @@ -1309,7 +1309,7 @@ static INPUT_PORTS_START( popnstex ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* "Enable Secret Mode" 3-1=On 3-3=On 3-5=On */ INPUT_PORTS_END -#endif + /************************************* * @@ -1806,7 +1806,49 @@ ROM_START( popn1 ) ROM_LOAD16_BYTE( "803aaa10.27d", 0x100001, 0x80000, CRC(a487ad02) SHA1(ca9edb611ddf2f1e7d42b049ce867b173fce3634) ) DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ - DISK_IMAGE( "803aaa11", 0, SHA1(8684c1a1f0de9496bac0333c0302e35359173d8a) ) /* ver 1.00 JA */ + DISK_IMAGE( "803jaa11", 0, SHA1(8684c1a1f0de9496bac0333c0302e35359173d8a) ) /* GQ803 pop'n music ver1.00 1998/09/04 (C) KONAMI */ +ROM_END + +ROM_START( popn1k ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* MC68EC020FG25 MPU */ + ROM_LOAD16_BYTE( "803k a01.bin", 0x000000, 0x80000, CRC(5037e700) SHA1(b1e4d0a69187b22706d7a744da63bf639aee9738) ) + ROM_LOAD16_BYTE( "803k a02.bin", 0x000001, 0x80000, CRC(14aff1c4) SHA1(0832c1eea7fb593245fba23bf7dc4b4495ff0cdc) ) + + ROM_REGION( 0x200000, "gfx1", 0) /* SPRITE */ + ROM_LOAD16_BYTE( "803aaa03.19a", 0x000000, 0x80000, CRC(a0970b32) SHA1(4bf06f977f67f13d0994e80021faaefed015ca1c) ) + ROM_LOAD16_BYTE( "803aaa04.20a", 0x000001, 0x80000, CRC(a158b950) SHA1(535d994a68fe56c8a93d460e5272b1a0b081383d) ) + ROM_LOAD16_BYTE( "803aaa05.22a", 0x100000, 0x80000, CRC(8a23c18d) SHA1(714b68a3112dff52feba6a50ae15c02d041b1def) ) + ROM_LOAD16_BYTE( "803aaa06.24a", 0x100001, 0x80000, CRC(bd6450ff) SHA1(bb89c65d1b0e38c0a26ec4cccd35103583efff45) ) + + ROM_REGION( 0x200000, "k056832", 0 ) /* TILEMAP */ + ROM_LOAD16_BYTE( "803aaa07.22d", 0x000000, 0x80000, CRC(4c97dbf0) SHA1(c33f84e2c1a59294413163a5546cb2fe092e42d1) ) + ROM_LOAD16_BYTE( "803aaa08.23d", 0x000001, 0x80000, CRC(cc6b21d3) SHA1(eac3b92bc392265df08b0311320c4e23f257c58b) ) + ROM_LOAD16_BYTE( "803aaa09.25d", 0x100000, 0x80000, CRC(45ab3978) SHA1(c34b800dfb14affcb705dffa566d046a6d1e7c7c) ) + ROM_LOAD16_BYTE( "803aaa10.27d", 0x100001, 0x80000, CRC(a487ad02) SHA1(ca9edb611ddf2f1e7d42b049ce867b173fce3634) ) + + DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ + DISK_IMAGE( "803kaa11", 0, SHA1(be833a3c0f1e5953271fa7d8d6e81211fbe9710f) ) /* GQ803AA pop'n music ver1.01 1998/10/14 (C) KONAMI */ +ROM_END + +ROM_START( popn1j ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* MC68EC020FG25 MPU */ + ROM_LOAD16_BYTE( "803jaa01.6a", 0x000000, 0x80000, CRC(469cee89) SHA1(d7c3e25e48492bceb17825db357830b08a20f09a) ) + ROM_LOAD16_BYTE( "803jaa02.8a", 0x000001, 0x80000, CRC(112ff5a3) SHA1(74d7155a1b63d411a8c3f99e511fc4c331b4c62f) ) + + ROM_REGION( 0x200000, "gfx1", 0) /* SPRITE */ + ROM_LOAD16_BYTE( "803jaa03.19a", 0x000000, 0x80000, CRC(d80315f6) SHA1(070ea8d00aeecce1e357be5a9c434ef46f57a7e9) ) + ROM_LOAD16_BYTE( "803jaa04.20a", 0x000001, 0x80000, CRC(f7b9ac82) SHA1(898fbe229a3fdea5988d46359d030c3ec35eaafd) ) + ROM_LOAD16_BYTE( "803jaa05.22a", 0x100000, 0x80000, CRC(2902f6df) SHA1(658ccae9a67196a310bd69870c350058d2911feb) ) + ROM_LOAD16_BYTE( "803jaa06.24a", 0x100001, 0x80000, CRC(508f326a) SHA1(a55c17f88b5856a754f00a6e32b6f60685a88bec) ) + + ROM_REGION( 0x200000, "k056832", 0 ) /* TILEMAP */ + ROM_LOAD16_BYTE( "803jaa07.22d", 0x000000, 0x80000, CRC(b9c12071) SHA1(8f67965d5c8e7c9bfac528a77a9e7c8e0d8b17c8) ) + ROM_LOAD16_BYTE( "803jaa08.23d", 0x000001, 0x80000, CRC(a263f819) SHA1(b479a215282212e9253e4085640c0638a4036e31) ) + ROM_LOAD16_BYTE( "803jaa09.25d", 0x100000, 0x80000, CRC(204d53eb) SHA1(349de147246b0ed08fb7e473d63e073b71fa30c9) ) + ROM_LOAD16_BYTE( "803jaa10.27d", 0x100001, 0x80000, CRC(535a61a3) SHA1(b24c57601a7e3a349473af69114703133a46806d) ) + + DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ + DISK_IMAGE( "803jaa11", 0, SHA1(8684c1a1f0de9496bac0333c0302e35359173d8a) ) /* GQ803 pop'n music ver1.00 1998/09/04 (C) KONAMI */ ROM_END ROM_START( popn2 ) @@ -1827,7 +1869,7 @@ ROM_START( popn2 ) ROM_LOAD16_BYTE( "831jaa10.27d", 0x100001, 0x80000, CRC(85173cb6) SHA1(bc4d86bf4654a9a0a58e624f77090854950f3993) ) DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ - DISK_IMAGE( "831jhdda01", 0, SHA1(ef62d5fcc1a36235fc932e6ecef71dc845d1d72d) ) + DISK_IMAGE( "831jhdda01", 0, SHA1(ef62d5fcc1a36235fc932e6ecef71dc845d1d72d) ) /* GQ831JA pop'n music ver1.00 1999/2/28 (C) KONAMI */ ROM_END ROM_START( popn3 ) @@ -1848,30 +1890,31 @@ ROM_START( popn3 ) ROM_LOAD16_BYTE( "980a10.27d", 0x100001, 0x080000, CRC(7776b87e) SHA1(662b7cd7cb4fb8f8bab240ef543bf9a593e23a03) ) DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ - DISK_IMAGE( "980hdda01", 0, SHA1(57ece2b63c32d194d4e41b4e4a45aaab30150fd4) ) + DISK_IMAGE( "980hdda01", 0, SHA1(57ece2b63c32d194d4e41b4e4a45aaab30150fd4) ) /* GQ980JA pop'n music 3 ver. 1.00 1999/09/02 (C) KONAMI */ ROM_END -ROM_START( popnstage ) +ROM_START( popnstex ) ROM_REGION( 0x100000, "maincpu", 0 ) /* MC68EC020FG25 MPU */ - ROM_LOAD16_BYTE( "970jba01.6a", 0x000000, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba02.8a", 0x000001, 0x80000, NO_DUMP ) + ROM_LOAD16_BYTE( "970jba01.6a", 0x000000, 0x80000, CRC(8fa0c957) SHA1(12d1d6f15e19955c663ebdfcb16d5f6d209c0f76) ) + ROM_LOAD16_BYTE( "970jba02.8a", 0x000001, 0x80000, CRC(7adb00a0) SHA1(70a86897ab6cbc3f34be51f7f078644de697e331) ) ROM_REGION( 0x200000, "gfx1", 0) /* SPRITE */ - ROM_LOAD16_BYTE( "970jba03.19a", 0x000000, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba04.20a", 0x000001, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba05.22a", 0x100000, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba06.24a", 0x100001, 0x80000, NO_DUMP ) + ROM_LOAD16_BYTE( "970jba03.19a", 0x000000, 0x80000, CRC(e5d15d3c) SHA1(bdbd3c59e3377e071b199eea6cfb2ad84d37e971) ) + ROM_LOAD16_BYTE( "970jba04.20a", 0x000001, 0x80000, CRC(687f9beb) SHA1(6baac0aa2db3af9e34469b1719ccff3643fd85f7) ) + ROM_LOAD16_BYTE( "970jba05.22a", 0x100000, 0x80000, CRC(3bedc09c) SHA1(d0806bb54a3e620a987d61c6a5f04a2e1fc613a8) ) + ROM_LOAD16_BYTE( "970jba06.24a", 0x100001, 0x80000, CRC(1673a771) SHA1(2768434f1c94543f69d40165e68d325ae5d553cd) ) ROM_REGION( 0x200000, "k056832", 0 ) /* TILEMAP */ - ROM_LOAD16_BYTE( "970jba07.22d", 0x000000, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba08.23d", 0x000001, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba09.25d", 0x100000, 0x80000, NO_DUMP ) - ROM_LOAD16_BYTE( "970jba10.27d", 0x100001, 0x80000, NO_DUMP ) + ROM_LOAD16_BYTE( "970jba07.22d", 0x000000, 0x80000, CRC(6fd06bdb) SHA1(1dc621923e0871d2d5171753f5ddb97786ab12bd) ) + ROM_LOAD16_BYTE( "970jba08.23d", 0x000001, 0x80000, CRC(28256891) SHA1(2069f52d596acbf355f205bb8d69cefc4cce3542) ) + ROM_LOAD16_BYTE( "970jba09.25d", 0x100000, 0x80000, CRC(5d2bda52) SHA1(d03c135ac04437b54e4d267ae168fe7ebb9e5b65) ) + ROM_LOAD16_BYTE( "970jba10.27d", 0x100001, 0x80000, CRC(edc4a245) SHA1(30bbd7bf0299a064119c535abb9be69d725aa130) ) DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ DISK_IMAGE( "970jba11", 0, SHA1(72e92b73b22a8f35e9faca93211e5acf781e66bb) ) /* GQ970 pop'n stage 1.5 ver1.00 1999/10/15 (C) KONAMI */ ROM_END + #if 0 // for reference, these sets have not been verified ROM_START( bm3rdmxb ) @@ -1895,47 +1938,8 @@ ROM_START( bm3rdmxb ) DISK_IMAGE( "825jab11", 0, MD5(f4360da10a932ba90e93469df7426d1d) SHA1(1) ) /* ver 1.01 JA */ ROM_END -ROM_START( popn1j ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* MC68EC020FG25 MPU */ - ROM_LOAD16_BYTE( "803jaa01.6a", 0x000000, 0x80000, CRC(469cee89) SHA1(d7c3e25e48492bceb17825db357830b08a20f09a) ) - ROM_LOAD16_BYTE( "803jaa02.8a", 0x000001, 0x80000, CRC(112ff5a3) SHA1(74d7155a1b63d411a8c3f99e511fc4c331b4c62f) ) - ROM_REGION( 0x200000, "gfx1", 0) /* SPRITE */ - ROM_LOAD16_BYTE( "803jaa03.19a", 0x000000, 0x80000, CRC(d80315f6) SHA1(070ea8d00aeecce1e357be5a9c434ef46f57a7e9) ) - ROM_LOAD16_BYTE( "803jaa04.20a", 0x000001, 0x80000, CRC(f7b9ac82) SHA1(898fbe229a3fdea5988d46359d030c3ec35eaafd) ) - ROM_LOAD16_BYTE( "803jaa05.22a", 0x100000, 0x80000, CRC(2902f6df) SHA1(658ccae9a67196a310bd69870c350058d2911feb) ) - ROM_LOAD16_BYTE( "803jaa06.24a", 0x100001, 0x80000, CRC(508f326a) SHA1(a55c17f88b5856a754f00a6e32b6f60685a88bec) ) - ROM_REGION( 0x200000, "k056832", 0 ) /* TILEMAP */ - ROM_LOAD16_BYTE( "803jaa07.22d", 0x000000, 0x80000, CRC(b9c12071) SHA1(8f67965d5c8e7c9bfac528a77a9e7c8e0d8b17c8) ) - ROM_LOAD16_BYTE( "803jaa08.23d", 0x000001, 0x80000, CRC(a263f819) SHA1(b479a215282212e9253e4085640c0638a4036e31) ) - ROM_LOAD16_BYTE( "803jaa09.25d", 0x100000, 0x80000, CRC(204d53eb) SHA1(349de147246b0ed08fb7e473d63e073b71fa30c9) ) - ROM_LOAD16_BYTE( "803jaa10.27d", 0x100001, 0x80000, CRC(535a61a3) SHA1(b24c57601a7e3a349473af69114703133a46806d) ) - - DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ - DISK_IMAGE( "803jaa11", 0, MD5(54a8ac87857d81740621c622e27736d7) ) /* ver 1.00 JA */ -ROM_END - -ROM_START( popnstex ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* MC68EC020FG25 MPU */ - ROM_LOAD16_BYTE( "970jba01.6a", 0x000000, 0x80000, CRC(8fa0c957) SHA1(12d1d6f15e19955c663ebdfcb16d5f6d209c0f76) ) - ROM_LOAD16_BYTE( "970jba02.8a", 0x000001, 0x80000, CRC(7adb00a0) SHA1(70a86897ab6cbc3f34be51f7f078644de697e331) ) - - ROM_REGION( 0x200000, "gfx1", 0) /* SPRITE */ - ROM_LOAD16_BYTE( "970jba03.19a", 0x000000, 0x80000, CRC(e5d15d3c) SHA1(bdbd3c59e3377e071b199eea6cfb2ad84d37e971) ) - ROM_LOAD16_BYTE( "970jba04.20a", 0x000001, 0x80000, CRC(687f9beb) SHA1(6baac0aa2db3af9e34469b1719ccff3643fd85f7) ) - ROM_LOAD16_BYTE( "970jba05.22a", 0x100000, 0x80000, CRC(3bedc09c) SHA1(d0806bb54a3e620a987d61c6a5f04a2e1fc613a8) ) - ROM_LOAD16_BYTE( "970jba06.24a", 0x100001, 0x80000, CRC(1673a771) SHA1(2768434f1c94543f69d40165e68d325ae5d553cd) ) - - ROM_REGION( 0x200000, "k056832", 0 ) /* TILEMAP */ - ROM_LOAD16_BYTE( "970jba07.22d", 0x000000, 0x80000, CRC(6fd06bdb) SHA1(1dc621923e0871d2d5171753f5ddb97786ab12bd) ) - ROM_LOAD16_BYTE( "970jba08.23d", 0x000001, 0x80000, CRC(28256891) SHA1(2069f52d596acbf355f205bb8d69cefc4cce3542) ) - ROM_LOAD16_BYTE( "970jba09.25d", 0x100000, 0x80000, CRC(5d2bda52) SHA1(d03c135ac04437b54e4d267ae168fe7ebb9e5b65) ) - ROM_LOAD16_BYTE( "970jba10.27d", 0x100001, 0x80000, CRC(edc4a245) SHA1(30bbd7bf0299a064119c535abb9be69d725aa130) ) - - DISK_REGION( "ata:0:hdd:image" ) /* IDE HARD DRIVE */ - DISK_IMAGE( "970jba11", 0, MD5(1616905838fdb2b521d53499c6c2a7a4) ) /* ver 1.00 JA */ -ROM_END #endif /************************************* @@ -2172,14 +2176,16 @@ GAME( 2001, bm6thmix, 0, djmainj, bm6thmix, djmain_state, init_bm6thmix, GAME( 2001, bm7thmix, 0, djmainj, bm6thmix, djmain_state, init_bm7thmix, ROT0, "Konami", "beatmania 7th MIX (ver JA-B)", 0 ) GAME( 2002, bmfinal, 0, djmainj, bm6thmix, djmain_state, init_bmfinal, ROT0, "Konami", "beatmania THE FINAL (ver JA-A)", 0 ) -GAME( 1998, popn1, 0, djmaina, popn1, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 1 (ver AA-A)", 0 ) +GAME( 1998, popn1, 0, djmaina, popn1, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 1 (ver AA-A, HDD 1.00)", 0 ) +GAME( 1998, popn1k, popn1, djmaina, popn1, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 1 (ver KA-A, HDD 1.01)", 0 ) // KA-A based on filenames provided, no warning message +GAME( 1998, popn1j, popn1, djmainj, popn1, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 1 (ver JA-A, HDD 1.00)", 0 ) GAME( 1999, popn2, 0, djmainj, popn2, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 2 (ver JA-A)", 0 ) GAME( 1999, popn3, 0, djmainj, popn2, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 3 (ver JA-A)", 0 ) -GAME( 1999, popnstage,0, djmainj, popnstage, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Stage (ver JB-A)", MACHINE_NOT_WORKING ) +// Pop'n Stage +GAME( 1999, popnstex, 0, djmainj, popnstex, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Stage EX (ver JB-A)", 0 ) // for reference, these sets have not been verified //GAME( 1998, bm3rdmxb, bm3rdmix, djmainj, bm3rdmix, djmain_state, init_beatmania, ROT0, "Konami", "beatmania 3rd MIX (ver JA-B)", 0 ) -//GAME( 1998, popn1j, popn1, djmainj, popn1, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Music 1 (ver JA-A)", 0 ) -//GAME( 1999, popnstex, 0, djmainj, popnstex, djmain_state, init_beatmania, ROT0, "Konami", "Pop'n Stage EX (ver JB-A)", 0 ) + diff --git a/src/mame/drivers/dkong.cpp b/src/mame/drivers/dkong.cpp index 26b2bc58ff3..09fe8852378 100644 --- a/src/mame/drivers/dkong.cpp +++ b/src/mame/drivers/dkong.cpp @@ -1939,6 +1939,7 @@ ROM_START( radarscp ) /* unclear which boardset this comes from; there existed a ROM_LOAD( "trs2c5gc", 0x1000, 0x1000, CRC(afa8c49f) SHA1(25880e9dcf2dc8862f7f3c38687f01dfe2424293) ) ROM_LOAD( "trs2c5hc", 0x2000, 0x1000, CRC(51b8263d) SHA1(09687f2c40cf09ffc2aeddde4a4fa32800847f01) ) ROM_LOAD( "trs2c5kc", 0x3000, 0x1000, CRC(1f0101f7) SHA1(b9f988847fdefa64dfeae06c2244215cb0d64dbe) ) + //empty socket on position 5L on pcb labeled "Test", 0x4000, 0x1000 ROM_REGION( 0x1800, "soundcpu", 0 ) /* sound */ ROM_LOAD( "trs2s3i", 0x0000, 0x0800, CRC(78034f14) SHA1(548b44ac69f39df6687da1c0f60968009b1e0767) ) @@ -1971,6 +1972,7 @@ ROM_START( radarscp1 ) /* TRS01 5-pcb stack with TRS01 "Voice" pcb on top contai ROM_LOAD( "trs01_5g", 0x1000, 0x1000, CRC(afa8c49f) SHA1(25880e9dcf2dc8862f7f3c38687f01dfe2424293) ) ROM_LOAD( "trs01_5h", 0x2000, 0x1000, CRC(51b8263d) SHA1(09687f2c40cf09ffc2aeddde4a4fa32800847f01) ) ROM_LOAD( "trs01_5k", 0x3000, 0x1000, CRC(1f0101f7) SHA1(b9f988847fdefa64dfeae06c2244215cb0d64dbe) ) + //empty socket on position 5L on pcb labeled "Test", 0x4000, 0x1000 ROM_REGION( 0x1800, "soundcpu", 0 ) /* sound */ ROM_LOAD( "trs-s__5a.5a", 0x0000, 0x0800, CRC(5166554c) SHA1(00bf501ca448929f6187598da6fdbc1ea488745a) ) // 5A on the 'voice' board on top of the 5-pcb stack; eprom label is "TRS-S ['S' overstrikes a '1'] // 5A [stamped '8' or 'a' in red ink]" @@ -2069,6 +2071,7 @@ ROM_START( dkongo ) ROM_LOAD( "c_5ct_g.bin", 0x1000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) ) /* tkg3c.5g */ ROM_LOAD( "c_5h_b.bin", 0x2000, 0x1000, CRC(1d28895d) SHA1(63792cab215fc2a7b0e8ee61d8115045571e9d42) ) /* tkg3c.5h */ ROM_LOAD( "tkg3c.5k", 0x3000, 0x1000, CRC(553b89bb) SHA1(61611df9e2748fdcd31821038dcc0e16dc933873) ) + //empty socket on position 5L on pcb labeled "Test", 0x4000, 0x1000 ROM_REGION( 0x1800, "soundcpu", 0 ) /* sound */ ROM_LOAD( "s_3i_b.bin", 0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) ) @@ -2097,6 +2100,7 @@ ROM_START( dkongj ) ROM_LOAD( "5g.cpu", 0x1000, 0x1000, CRC(d326599b) SHA1(94c7382604d0a123a442d53f9641f366dfbb7631) ) ROM_LOAD( "5h.cpu", 0x2000, 0x1000, CRC(ff31ac89) SHA1(9626a9e6df0d1b0ff273dbbe986f670200f91f75) ) ROM_LOAD( "c_5k_b.bin", 0x3000, 0x1000, CRC(394d6007) SHA1(57e5ae76ef5d4a2fa9cd860b6c6be03b6d5ed5ba) ) + //empty socket on position 5L on pcb labeled "Test", 0x4000, 0x1000 ROM_REGION( 0x1800, "soundcpu", 0 ) /* sound */ ROM_LOAD( "s_3i_b.bin", 0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) ) @@ -2125,6 +2129,7 @@ ROM_START( dkongjo ) ROM_LOAD( "c_5g_b.bin", 0x1000, 0x1000, CRC(3b2a6635) SHA1(32c62e00863ab99c6f263587d9d5bb775a68f3de) ) ROM_LOAD( "c_5h_b.bin", 0x2000, 0x1000, CRC(1d28895d) SHA1(63792cab215fc2a7b0e8ee61d8115045571e9d42) ) ROM_LOAD( "c_5k_b.bin", 0x3000, 0x1000, CRC(394d6007) SHA1(57e5ae76ef5d4a2fa9cd860b6c6be03b6d5ed5ba) ) + //empty socket on position 5L on pcb labeled "Test", 0x4000, 0x1000 ROM_REGION( 0x1800, "soundcpu", 0 ) /* sound */ ROM_LOAD( "s_3i_b.bin", 0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) ) @@ -2153,6 +2158,7 @@ ROM_START( dkongjo1 ) ROM_LOAD( "5g.cpu", 0x1000, 0x1000, CRC(d326599b) SHA1(94c7382604d0a123a442d53f9641f366dfbb7631) ) ROM_LOAD( "c_5h_b.bin", 0x2000, 0x1000, CRC(1d28895d) SHA1(63792cab215fc2a7b0e8ee61d8115045571e9d42) ) ROM_LOAD( "5k.bin", 0x3000, 0x1000, CRC(7961599c) SHA1(698a4c2b8d67840dca7526efb1ac0d3370a86925) ) + //empty socket on position 5L on pcb labeled "Test", 0x4000, 0x1000 ROM_REGION( 0x1800, "soundcpu", 0 ) /* sound */ ROM_LOAD( "s_3i_b.bin", 0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) ) @@ -2399,6 +2405,7 @@ ROM_START( dkongjr ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "djr1-c_3h.3h", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) @@ -2424,6 +2431,7 @@ ROM_START( dkongjr2 ) ROM_LOAD( "0", 0x0000, 0x2000, CRC(dc1f1d12) SHA1(d0faac0310b0273429ccb3387b914792d1a312eb) ) ROM_LOAD( "1", 0x2000, 0x2000, CRC(f1f286d0) SHA1(cd87770c968d10623f312f651955ad9b1f85c6df) ) ROM_LOAD( "2", 0x4000, 0x2000, CRC(4cb856c4) SHA1(e5ac7155b13cac2c201fa733f5061fb4a0ceafa4) ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "8", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) @@ -2456,6 +2464,7 @@ ROM_START( dkongjrj ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "c_3h.bin", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) @@ -2488,6 +2497,7 @@ ROM_START( dkongjnrj ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "c_3h.bin", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) @@ -2553,6 +2563,7 @@ ROM_START( dkongjrpb ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "c_3h.bin", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) @@ -2585,6 +2596,7 @@ ROM_START( dkongjrb ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ) ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "c_3h.bin", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) @@ -2617,6 +2629,7 @@ ROM_START( dkongjrhs ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ) ROM_REGION( 0x10000, "braze", 0 ) ROM_LOAD( "dkj_12.bin", 0x0000, 0x8000, CRC(e341b337) SHA1(7cba8305d9618769ba3afb52a60984e16a0dd266) ) /* Version 1.2 */ @@ -2653,6 +2666,7 @@ ROM_START( dkongddk ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ) ROM_REGION( 0x10000, "braze", 0 ) ROM_LOAD( "ddk_12.bin", 0x0000, 0x10000, CRC(26caaf8a) SHA1(8abd5855326a6653f12ae1bdc8f18ef45861c344) ) /* Version 1.2 */ @@ -2689,6 +2703,7 @@ ROM_START( jrking ) ROM_CONTINUE( 0x2800, 0x0800 ) ROM_CONTINUE( 0x5000, 0x0800 ) ROM_CONTINUE( 0x1800, 0x0800 ) + //empty socket on position 5A on pcb 0x8000, 0x1000 ) ROM_REGION( 0x1000, "soundcpu", 0 ) /* sound */ ROM_LOAD( "h3.bin", 0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) ) diff --git a/src/mame/drivers/docastle.cpp b/src/mame/drivers/docastle.cpp index 5bdb72b7eec..7c4a12a2728 100644 --- a/src/mame/drivers/docastle.cpp +++ b/src/mame/drivers/docastle.cpp @@ -1106,5 +1106,5 @@ GAME( 1984, dowild, 0, dorunrun, dowild, docastle_state, empty_init GAME( 1984, jjack, 0, dorunrun, jjack, docastle_state, empty_init, ROT270, "Universal", "Jumping Jack", MACHINE_SUPPORTS_SAVE ) GAME( 1984, kickridr, 0, dorunrun, kickridr, docastle_state, empty_init, ROT0, "Universal", "Kick Rider", MACHINE_SUPPORTS_SAVE ) GAME( 1985, idsoccer, 0, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "Indoor Soccer (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) -GAME( 1985, idsoccera, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "Indoor Soccer (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND ) -GAME( 1987, asoccer, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "American Soccer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND ) +GAME( 1985, idsoccera, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "Indoor Soccer (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1987, asoccer, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "American Soccer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/dreamwld.cpp b/src/mame/drivers/dreamwld.cpp index a843328bd73..c0468850dc6 100644 --- a/src/mame/drivers/dreamwld.cpp +++ b/src/mame/drivers/dreamwld.cpp @@ -86,14 +86,21 @@ Stephh's notes (based on the game M68EC020 code and some tests) : probably a leftover from hardware development as the test menu is mostly incomplete. - All: sprite priority, the original psikyo.c HW has sprite<->tilemap + All: sprite priority, the original psikyo.cpp HW has sprite<->tilemap priority but we don't support it here, does the clone HW support it? - All: sprite zooming, again the original psikyo.c HW supports this, but we - don't support it here. The Strikers 1945 bootleg in psikyo.c doesn't + All: sprite zooming, again the original psikyo.cpp HW supports this, but we + don't support it here. The Strikers 1945 bootleg in psikyo.cpp doesn't appear to support it properly either, so it might be missing on these clone boards. + At least based on the dumped Dream World MCU code, the internal ROM + doesn't appear to do any kind of bounds checking when reading out the data + table, so assuming no read address lock up the MCU you could probably just + overflow the counter to read out internal ROM. Also compared to earlier + SemiCom MCUs the code is minimal, just 0x3a bytes and the payload table, + no header with the game title, programmer name or date. + */ #include "emu.h" @@ -117,11 +124,11 @@ public: , m_vregs(*this, "vregs") , m_workram(*this, "workram") , m_lineram(*this, "lineram", 32) - , m_prot(*this, "prot") , m_spritelut(*this, "spritelut") , m_okibank(*this, "oki%ubank", 1) , m_dsw(*this, "DSW") , m_maincpu(*this, "maincpu") + , m_mcu(*this, "mcu") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") { @@ -143,8 +150,6 @@ private: required_shared_ptr<u32> m_vregs; required_shared_ptr<u32> m_workram; required_shared_ptr<u16> m_lineram; - - optional_memory_region m_prot; required_memory_region m_spritelut; optional_memory_bank_array<2> m_okibank; required_ioport m_dsw; @@ -161,12 +166,22 @@ private: std::unique_ptr<u32[]> m_spritebuf[2]; /* misc */ - int m_protindex; + uint8_t m_port1_data; + uint8_t m_port2_data; + uint8_t m_protlatch; required_device<cpu_device> m_maincpu; + required_device<mcs51_cpu_device> m_mcu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; + DECLARE_WRITE8_MEMBER(prot_p1_w); + DECLARE_WRITE8_MEMBER(prot_p2_w); + DECLARE_READ8_MEMBER(prot_p2_r); + + DECLARE_WRITE32_MEMBER(to_prot_w); + + template<int Layer> u16 vram_r(offs_t offset); template<int Layer> void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); u32 protdata_r(); @@ -375,23 +390,7 @@ u32 dreamwld_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c } -u32 dreamwld_state::protdata_r() -{ - //static int count = 0; - - size_t protsize = m_prot->bytes(); - const u8 dat = m_prot->base()[m_protindex]; - - if (!machine().side_effects_disabled()) - m_protindex = (m_protindex + 1) % protsize; - //printf("protection read %04x %02x\n", count, dat); - //count++; - // real hw returns 00 after end of data, I haven't checked if it's possible to overflow the read counter - // and read out the internal rom. - - return dat << 24; -} void dreamwld_state::oki1_map(address_map &map) { @@ -429,6 +428,8 @@ void dreamwld_state::baryon_map(address_map &map) map(0xc0000f, 0xc0000f).w(FUNC(dreamwld_state::okibank_w<0>)); // sfx map(0xc00018, 0xc00018).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // sfx + // C00010 might reset the MCU? + map(0xc00020, 0xc00023).w(FUNC(dreamwld_state::to_prot_w)); map(0xc00030, 0xc00033).r(FUNC(dreamwld_state::protdata_r)); // it reads protection data (irq code) from here and puts it at ffd000 map(0xfe0000, 0xffffff).ram().share("workram"); // work ram @@ -723,7 +724,10 @@ void dreamwld_state::machine_start() m_okibank[1]->set_entry(0); } - save_item(NAME(m_protindex)); + save_item(NAME(m_port1_data)); + save_item(NAME(m_port2_data)); + save_item(NAME(m_protlatch)); + save_item(NAME(m_tilebank)); save_item(NAME(m_tilebankold)); } @@ -732,7 +736,69 @@ void dreamwld_state::machine_reset() { m_tilebankold[0] = m_tilebankold[1] = -1; m_tilebank[0] = m_tilebank[1] = 0; - m_protindex = 0; + m_port1_data = 0; + m_port2_data = 0; + m_protlatch = 0; +} + +WRITE8_MEMBER(dreamwld_state::prot_p1_w) +{ + logerror("%s:prot_p1_w %02x\n", machine().describe_context(), data); + m_port1_data = data; +} + +WRITE8_MEMBER(dreamwld_state::prot_p2_w) +{ + logerror("%s:prot_p2_w %02x\n", machine().describe_context(), data); + + for (int bit = 0; bit < 8; bit++) + { + if ((m_port2_data & (1 << bit)) != (data & (1 << bit))) + { + if (data & (1 << bit)) + { + logerror("bit %d low to high\n", bit); + + // bit == 0 is toggled before reading from port 0 (data not used, maybe reads whatever was written on to_prot_w into port 0 for reading tho) + + if (bit == 1) // toggled after writing a byte on port 1 + { + m_protlatch = m_port1_data; + } + } + else + { + logerror("bit %d high to low\n", bit); + } + } + } + + m_port2_data = data; +} + +READ8_MEMBER(dreamwld_state::prot_p2_r) +{ + // bit 2 is waited on before reading from port 0 + // bit 3 is waited on after writing a byte + + // will inf loop reading here once the 68k stops requesting data + //logerror("%s:prot_p2_r\n", machine().describe_context()); + return m_port2_data; +} + +WRITE32_MEMBER(dreamwld_state::to_prot_w) +{ + m_port2_data &= 0xfb; // lower bit 0x04 to indicate data sent? + logerror("%s:to_prot_w %08x\n", machine().describe_context(), data); + m_maincpu->spin_until_time(attotime::from_usec(50)); // give it time to respond +} + +u32 dreamwld_state::protdata_r() +{ + m_port2_data &= 0xf7; // clear bit 0x08 to indicate data received? + logerror("%s:protdata_r\n", machine().describe_context()); + m_maincpu->spin_until_time(attotime::from_usec(50)); // give it time to respond + return m_protlatch << 24; } @@ -743,7 +809,12 @@ void dreamwld_state::baryon(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &dreamwld_state::baryon_map); m_maincpu->set_vblank_int("screen", FUNC(dreamwld_state::irq4_line_hold)); - AT89C52(config, "mcu", XTAL(32'000'000)/2).set_disable(); /* AT89C52 or 87(C)52, unknown clock (value from docs), internal ROMs aren't dumped */ + AT89C52(config, m_mcu, XTAL(32'000'000) / 2); /* AT89C52 or 87(C)52, unknown clock (value from docs) */ + m_mcu->port_out_cb<1>().set(FUNC(dreamwld_state::prot_p1_w)); + m_mcu->port_out_cb<2>().set(FUNC(dreamwld_state::prot_p2_w)); + m_mcu->port_in_cb<2>().set(FUNC(dreamwld_state::prot_p2_r)); + + //config.set_perfect_quantum(m_maincpu); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -778,6 +849,7 @@ void dreamwld_state::dreamwld(machine_config &config) } + /* Baryon @@ -822,10 +894,7 @@ ROM_START( baryon ) // this set had original SemiCom labels ROM_LOAD32_BYTE( "3_semicom", 0x000003, 0x040000, CRC(0ae6d86e) SHA1(410ad161688ec8516fe5ac7160a4a228dbb01936) ) ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x6bd, "prot", 0 ) /* Protection data - from baryona set, assumed to be the same */ - ROM_LOAD( "protdata.bin", 0x000, 0x6bd, CRC(117f32a8) SHA1(837bea09d3e59ab9e13bd1103b1fc988edb361c0) ) /* extracted */ + ROM_LOAD( "mcu.bin", 0x00000, 0x02000, BAD_DUMP CRC(1ee7896c) SHA1(f1e8500b7b6aa4e6ae939e228ffd11462f10ba33) ) // handcrafted from Dream World MCU using correct protection data for this game ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples */ ROM_LOAD( "1_semicom", 0x000000, 0x80000, CRC(e0349074) SHA1(f3d53d96dff586a0ad1632f52e5559cdce5ed0d8) ) // eprom type 27C040 @@ -853,10 +922,7 @@ ROM_START( baryona ) // replacment labels? no SemiCom logo ROM_LOAD32_BYTE( "5.bin", 0x000003, 0x040000, CRC(63d5e7cb) SHA1(269bf5ffe10f2464f823c4d377921e19cfb8bc46) ) ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x6bd, "prot", 0 ) /* Protection data */ - ROM_LOAD( "protdata.bin", 0x000, 0x6bd, CRC(117f32a8) SHA1(837bea09d3e59ab9e13bd1103b1fc988edb361c0) ) /* extracted */ + ROM_LOAD( "mcu.bin", 0x00000, 0x02000, BAD_DUMP CRC(1ee7896c) SHA1(f1e8500b7b6aa4e6ae939e228ffd11462f10ba33) ) // handcrafted from Dream World MCU using correct protection data for this game ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples */ ROM_LOAD( "1.bin", 0x000000, 0x80000, CRC(e0349074) SHA1(f3d53d96dff586a0ad1632f52e5559cdce5ed0d8) ) @@ -923,10 +989,7 @@ ROM_START( cutefght ) ROM_LOAD32_BYTE( "4_semicom", 0x000003, 0x080000, CRC(476a3bf5) SHA1(5be1c70bbf4fcfc534b7f20bfceaa8da2e961330) ) ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x1000, "prot", ROMREGION_ERASEFF ) /* Protection data */ - ROM_LOAD( "protdata.bin", 0x000, 0x701 , CRC(764c3c0e) SHA1(ae044d016850b730b2d97ccb7845b6b438c1e074) ) + ROM_LOAD( "mcu.bin", 0x00000, 0x02000, BAD_DUMP CRC(7d9acd7d) SHA1(12059143ac9e10f3a21402d2879ff0b5097d6de0) ) // handcrafted from Dream World MCU using correct protection data for this game ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples - 1st chip */ ROM_LOAD( "2_semicom", 0x000000, 0x80000, CRC(694ddaf9) SHA1(f9138e7e1d8f771c4e69c17f27fb2b70fbee076a) ) @@ -1002,10 +1065,7 @@ ROM_START( rolcrush ) ROM_LOAD32_BYTE( "mx27c2000_1.bin", 0x000003, 0x040000, CRC(a37e15b2) SHA1(f0fc945a894d6ed58daf05390a17051d0f3cda20) ) ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x10000, "prot", ROMREGION_ERASE00 ) /* Protection data */ - ROM_LOAD( "protdata.bin", 0x000, 0x745, CRC(06b8a880) SHA1(b7d4bf26d34cb544825270c2c474bbd4c81a6c9e) ) /* extracted */ + ROM_LOAD( "mcu.bin", 0x00000, 0x02000, BAD_DUMP CRC(9185e237) SHA1(866255242130503fa9a164645082640f1da0a8ff) ) // handcrafted from Dream World MCU using correct protection data for this game ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples - 1st chip*/ ROM_LOAD( "mx27c4000_5.bin", 0x000000, 0x80000, CRC(7afa6adb) SHA1(d4049e1068a5f7abf0e14d0b9fbbbc6dfb5d0170) ) @@ -1036,10 +1096,7 @@ ROM_START( rolcrusha ) ROM_LOAD32_BYTE( "1", 0x000003, 0x040000, CRC(ef23ccf3) SHA1(14dcf8bfca991f6aa9b20236c879ae715a009ca2) ) ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x10000, "prot", ROMREGION_ERASE00 ) /* Protection data */ - ROM_LOAD( "protdata.bin", 0x000, 0x745, CRC(06b8a880) SHA1(b7d4bf26d34cb544825270c2c474bbd4c81a6c9e) ) + ROM_LOAD( "mcu.bin", 0x00000, 0x02000, BAD_DUMP CRC(9185e237) SHA1(866255242130503fa9a164645082640f1da0a8ff) ) // handcrafted from Dream World MCU using correct protection data for this game ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples - 1st chip*/ ROM_LOAD( "5", 0x000000, 0x80000, CRC(7afa6adb) SHA1(d4049e1068a5f7abf0e14d0b9fbbbc6dfb5d0170) ) @@ -1110,16 +1167,8 @@ ROM_START( dreamwld ) ROM_LOAD32_BYTE( "1.bin", 0x000002, 0x040000, CRC(35c94ee5) SHA1(3440a65a807622b619c97bc2a88fd7d875c26f66) ) ROM_LOAD32_BYTE( "2.bin", 0x000003, 0x040000, CRC(5409e7fc) SHA1(2f94a6a8e4c94b36b43f0b94d58525f594339a9d) ) - ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x6c9, "prot", 0 ) /* Protection data */ - /* The MCU supplies this data. - The 68k reads it through a port, taking the size and destination write address from the level 1 - and level 2 irq positions in the 68k vector table (there is code to check that they haven't been - modified!) It then decodes the data using the rom checksum previously calculated and puts it in - ram. The interrupt vectors point at the code placed in RAM. */ - ROM_LOAD( "protdata.bin", 0x000, 0x6c9 , CRC(f284b2fd) SHA1(9e8096c8aa8a288683f002311b38787b120748d1) ) /* extracted */ + ROM_REGION( 0x02000, "mcu", 0 ) // chip marked P87C52EBPN, die shows 87C51RA+ after decapping + ROM_LOAD( "87c51rap.bin", 0x00000, 0x02000 , CRC(987bbfe8) SHA1(7717ed5cf97bc11c104356f6ff1d893d1606bcf0) ) ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples - 1st chip */ ROM_LOAD( "5.bin", 0x000000, 0x80000, CRC(9689570a) SHA1(4414233da8f46214ca7e9022df70953922a63aa4) ) @@ -1198,10 +1247,7 @@ ROM_START( gaialast ) ROM_LOAD32_BYTE( "3", 0x000003, 0x040000, CRC(a8e845d8) SHA1(f8c7e702bd747a22e76c861effec4cd3cd2f3fc9) ) ROM_REGION( 0x02000, "mcu", 0 ) /* 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x02000 , NO_DUMP ) /* can't be dumped. */ - - ROM_REGION( 0x6c9, "prot", ROMREGION_ERASEFF ) /* Protection data */ - ROM_LOAD( "protdata.bin", 0x000, 0x6c9 , CRC(d3403b7b) SHA1(712a7f27fc41b632d584237f7641e8ae20035111) ) + ROM_LOAD( "mcu.bin", 0x00000, 0x02000, BAD_DUMP CRC(fb3db92b) SHA1(3ae3649debf79a4345b05c2f4ae9674c13a66ed1) ) // handcrafted from Dream World MCU using correct protection data for this game ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples */ ROM_LOAD( "1", 0x000000, 0x80000, CRC(2dbad410) SHA1(bb788ea14bb605be9af9c8f8adec94ad1c17ab55) ) diff --git a/src/mame/drivers/elan_eu3a05.cpp b/src/mame/drivers/elan_eu3a05.cpp index 2eb0825c060..73f2f3921c9 100644 --- a/src/mame/drivers/elan_eu3a05.cpp +++ b/src/mame/drivers/elan_eu3a05.cpp @@ -104,17 +104,19 @@ #include "machine/elan_eu3a05gpio.h" #include "machine/elan_eu3a05sys.h" #include "video/elan_eu3a05vid.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" class elan_eu3a05_state : public driver_device { public: elan_eu3a05_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_sys(*this, "sys"), + m_gpio(*this, "gpio"), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_ram(*this, "ram"), - m_gpio(*this, "gpio"), - m_sys(*this, "sys"), m_sound(*this, "eu3a05sound"), m_vid(*this, "vid"), m_pixram(*this, "pixram"), @@ -126,6 +128,17 @@ public: void elan_eu3a05(machine_config &config); void airblsjs(machine_config& config); + void elan_sudoku(machine_config &config); + + +protected: + // driver_device overrides + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device<elan_eu3a05sys_device> m_sys; + required_device<elan_eu3a05gpio_device> m_gpio; + private: // screen updates uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -137,18 +150,14 @@ private: void elan_eu3a05_bank_map(address_map &map); void elan_eu3a05_map(address_map &map); + void elan_sudoku_map(address_map &map); - // driver_device overrides - virtual void machine_start() override; - virtual void machine_reset() override; virtual void video_start() override; required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; required_shared_ptr<uint8_t> m_ram; - required_device<elan_eu3a05gpio_device> m_gpio; - required_device<elan_eu3a05sys_device> m_sys; required_device<elan_eu3a05_sound_device> m_sound; required_device<elan_eu3a05vid_device> m_vid; required_shared_ptr<uint8_t> m_pixram; @@ -164,6 +173,94 @@ private: DECLARE_WRITE_LINE_MEMBER(sound_end5) { m_sys->generate_custom_interrupt(7); } }; +class elan_eu3a05_buzztime_state : public elan_eu3a05_state +{ +public: + elan_eu3a05_buzztime_state(const machine_config &mconfig, device_type type, const char *tag) : + elan_eu3a05_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { } + + void elan_buzztime(machine_config& config); + +protected: + virtual void machine_start() override; + +private: + //DECLARE_READ8_MEMBER(random_r) { return machine().rand(); } + DECLARE_READ8_MEMBER(porta_r); + DECLARE_WRITE8_MEMBER(portb_w); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + + required_device<generic_slot_device> m_cart; +}; + +void elan_eu3a05_buzztime_state::machine_start() +{ + elan_eu3a05_state::machine_start(); + + // if there's a cart make sure we can see it + if (m_cart && m_cart->exists()) + { + uint8_t *rom = memregion("maincpu")->base(); + uint8_t* cart = m_cart->get_rom_base(); + std::copy(&cart[0x000000], &cart[0x200000], &rom[0x200000]); + } + else + { + uint8_t *rom = memregion("maincpu")->base(); + uint8_t* bios = memregion("bios")->base(); + std::copy(&bios[0x000000], &bios[0x200000], &rom[0x200000]); + } +} + +DEVICE_IMAGE_LOAD_MEMBER(elan_eu3a05_buzztime_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + if (size != 0x200000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); + return image_init_result::FAIL; + } + + m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_NATIVE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + +void elan_eu3a05_buzztime_state::elan_buzztime(machine_config &config) +{ + elan_eu3a05_state::elan_eu3a05(config); + + m_sys->set_alt_timer(); + + m_gpio->read_0_callback().set(FUNC(elan_eu3a05_buzztime_state::porta_r)); // I/O lives in here +// m_gpio->read_1_callback().set(FUNC(elan_eu3a05_buzztime_state::random_r)); // nothing of note +// m_gpio->read_2_callback().set(FUNC(elan_eu3a05_buzztime_state::random_r)); // nothing of note + m_gpio->write_1_callback().set(FUNC(elan_eu3a05_buzztime_state::portb_w)); // control related + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "buzztime_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(elan_eu3a05_buzztime_state::cart_load)); + + SOFTWARE_LIST(config, "buzztime_cart").set_original("buzztime_cart"); +} + +READ8_MEMBER(elan_eu3a05_buzztime_state::porta_r) +{ + logerror("%s: porta_r\n", machine().describe_context()); + return machine().rand(); +} + +WRITE8_MEMBER(elan_eu3a05_buzztime_state::portb_w) +{ + logerror("%s: portb_w %02x\n", machine().describe_context(), data); +} + + void elan_eu3a05_state::video_start() { } @@ -214,6 +311,16 @@ void elan_eu3a05_state::elan_eu3a05_map(address_map &map) //map(0xfffe, 0xffff).r(m_sys, FUNC(elan_eu3a05commonsys_device::irq_vector_r)); // allow normal IRQ for brk } +// default e000 mapping is the same as eu3a14, other registers seem closer to eua05, probably a different chip type +void elan_eu3a05_state::elan_sudoku_map(address_map& map) +{ + elan_eu3a05_map(map); + map(0xe000, 0xffff).rom().region("maincpu", 0x0000); + // not sure how these work, might be a modified 6502 core instead. + map(0xfffa, 0xfffb).r(m_sys, FUNC(elan_eu3a05commonsys_device::nmi_vector_r)); // custom vectors handled with NMI for now + //map(0xfffe, 0xffff).r(m_sys, FUNC(elan_eu3a05commonsys_device::irq_vector_r)); // allow normal IRQ for brk +} + void elan_eu3a05_state::elan_eu3a05_bank_map(address_map &map) { @@ -286,6 +393,105 @@ static INPUT_PORTS_START( airblsjs ) INPUT_PORTS_END +static INPUT_PORTS_START( sudoku ) + PORT_START("IN0") + PORT_DIPNAME( 0x01, 0x01, "IN0" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_DIPNAME( 0x01, 0x01, "IN1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_DIPNAME( 0x01, 0x01, "IN2" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( carlecfg ) + PORT_START("IN0") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Start/Pause") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Select") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // guess, not used? + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // guess, not used? + + PORT_START("IN2") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + + void elan_eu3a05_state::machine_start() { @@ -447,6 +653,15 @@ void elan_eu3a05_state::elan_eu3a05(machine_config &config) */ } +void elan_eu3a05_state::elan_sudoku(machine_config& config) +{ + elan_eu3a05(config); + m_maincpu->set_addrmap(AS_PROGRAM, &elan_eu3a05_state::elan_sudoku_map); + m_vid->set_is_sudoku(); + m_sys->set_alt_timer(); // for Carl Edwards' +} + + void elan_eu3a05_state::airblsjs(machine_config& config) { elan_eu3a05(config); @@ -454,7 +669,6 @@ void elan_eu3a05_state::airblsjs(machine_config& config) m_sys->set_pal(); // TODO: also set PAL clocks } - ROM_START( rad_tetr ) ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "tetrisrom.bin", 0x000000, 0x100000, CRC(40538e08) SHA1(1aef9a2c678e39243eab8d910bb7f9f47bae0aee) ) @@ -476,6 +690,30 @@ ROM_START( airblsjs ) ROM_LOAD( "airblsjs.bin", 0x000000, 0x400000, BAD_DUMP CRC(d10a6a84) SHA1(fa65f06e7da229006ddaffb245eef2cc4f90a66d) ) // ROM probably ok, but needs verification pass ROM_END +ROM_START( sudoelan ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "sudoku.bin", 0x00000, 0x100000, CRC(c2596173) SHA1(cc74932648b577b735151014e8c04ed778e11704) ) + ROM_RELOAD(0x100000,0x100000) + ROM_RELOAD(0x200000,0x100000) + ROM_RELOAD(0x300000,0x100000) +ROM_END + +ROM_START( carlecfg ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "carledwardsracing.bin", 0x00000, 0x100000, CRC(920f633e) SHA1(8460b77b9635a2484edab1111f35bbda74eb68e4) ) + ROM_RELOAD(0x100000,0x100000) + ROM_RELOAD(0x200000,0x100000) + ROM_RELOAD(0x300000,0x100000) +ROM_END + + +ROM_START( buzztime ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 ) + + ROM_REGION( 0x200000, "bios", ROMREGION_ERASE00 ) + ROM_LOAD( "buzztimeunit.bin", 0x000000, 0x200000, CRC(8ba3569c) SHA1(3e704338a53daed63da90aba0db4f6adb5bccd21) ) +ROM_END + CONS( 2004, rad_sinv, 0, 0, elan_eu3a05, rad_sinv, elan_eu3a05_state, empty_init, "Radica (licensed from Taito)", "Space Invaders [Lunar Rescue, Colony 7, Qix, Phoenix] (Radica, Arcade Legends TV Game)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // "5 Taito games in 1" @@ -483,3 +721,11 @@ CONS( 2004, rad_tetr, 0, 0, elan_eu3a05, rad_tetr, elan_eu3a05_state, empty_init // ROM contains the string "Credit:XiAn Hummer Software Studio(CHINA) Tel:86-29-84270600 Email:HummerSoft@126.com" PCB has datecode of "050423" (23rd April 2005) CONS( 2005, airblsjs, 0, 0, airblsjs, airblsjs, elan_eu3a05_state, empty_init, "Advance Bright Ltd", "Air-Blaster Joystick (AB1500, PAL)", MACHINE_NOT_WORKING ) + +CONS( 2004, buzztime, 0, 0, elan_buzztime, sudoku, elan_eu3a05_buzztime_state, empty_init, "Cadaco", "Buzztime Home Trivia System", MACHINE_NOT_WORKING ) + +// Below are probably not EU3A05 but use similar modes (possibly EU3A13?) + +CONS( 2006, sudoelan, 0, 0, elan_sudoku, sudoku, elan_eu3a05_state, empty_init, "Senario / All in 1 Products Ltd", "Ultimate Sudoku TV Edition 3-in-1", MACHINE_NOT_WORKING ) + +CONS( 200?, carlecfg, 0, 0, elan_sudoku, carlecfg, elan_eu3a05_state, empty_init, "Excalibur Electronics Inc", "Carl Edwards' Chase For Glory", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/electron.cpp b/src/mame/drivers/electron.cpp index cc799facb50..218477d20ea 100644 --- a/src/mame/drivers/electron.cpp +++ b/src/mame/drivers/electron.cpp @@ -1,8 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol +// copyright-holders:Wilbert Pol, Nigel Barnes /****************************************************************************** - Acorn Electron driver - By Wilbert Pol Hardware Overview ----------------- @@ -46,6 +44,26 @@ Notes: (all IC's shown. Only 16 ICs are used) KBD_CONN - 22-pin keyboard connector SPKR - 2-pin internal speaker connector + +Master RAM Board +---------------- +The Master RAM Board (MRB) is an internal expansion board from Slogger, and could +also be purchased pre-fitted in the form of the Electron 64. +The MRB comes with a new MOS which provides three modes of operation, selected by a +switch, which are Normal, Turbo, and 64K. The 64K mode was the first to provide a +'shadow mode' on the Electron. + + +Stop Press 64i +-------------- +The Stop Press 64i (SP64i) is another internal expansion board from Slogger, which +also requires the MRB to fitted. Being released in the early 90's there are no known +working examples, but bare prototype boards and ROMs were discovered during a Slogger +workshop clearout. +It provides a re-written AMX Stop Press (Desktop Publishing) for the Electron to take +advantage of the extra memory provided by the Master RAM Board, and also offers +ROM/RAM sockets and User Port for a mouse. + ****************************************************************************** Emulation notes: @@ -58,6 +76,11 @@ Incomplete: - 1 MHz bus is not emulated - Bus claiming by ULA is not implemented +Other internal boards to emulate: + - Slogger Turbo Driver + - Jafa Mode7 Mk2 Display Unit + - move MRB and SP64i to an internal slot device? + ******************************************************************************/ #include "emu.h" @@ -211,11 +234,29 @@ static INPUT_PORTS_START( electron64 ) PORT_CONFSETTING(0x02, "64K") INPUT_PORTS_END +static INPUT_PORTS_START(electronsp) + PORT_INCLUDE(electron64) + + PORT_START("ROMPAGES") + /* TODO: Actual 4bit dip settings are unknown, require a manual */ + PORT_DIPNAME(0x0f, 0x06, "SP64i ROM Pages") + PORT_DIPSETTING(0x00, "0&1") + PORT_DIPSETTING(0x02, "2&3") + PORT_DIPSETTING(0x04, "4&5") + PORT_DIPSETTING(0x06, "6&7") + PORT_DIPSETTING(0x08, "8&9 (reserved)") + PORT_DIPSETTING(0x0a, "10&11 (reserved)") + PORT_DIPSETTING(0x0c, "12&13") + PORT_DIPSETTING(0x0e, "14&15") +INPUT_PORTS_END + void electron_state::electron(machine_config &config) { M6502(config, m_maincpu, 16_MHz_XTAL / 8); m_maincpu->set_addrmap(AS_PROGRAM, &electron_state::electron_mem); + INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, M6502_IRQ_LINE); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(16_MHz_XTAL, 1024, 0, 640, 312, 0, 256); //m_screen->set_raw(16_MHz_XTAL, 1024, 264, 264 + 640, 312, 31, 31 + 256) @@ -237,7 +278,7 @@ void electron_state::electron(machine_config &config) /* expansion port */ ELECTRON_EXPANSION_SLOT(config, m_exp, 16_MHz_XTAL, electron_expansion_devices, "plus3"); - m_exp->irq_handler().set_inputline(m_maincpu, M6502_IRQ_LINE); + m_exp->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>)); m_exp->nmi_handler().set_inputline(m_maincpu, M6502_NMI_LINE); /* software lists */ @@ -277,6 +318,30 @@ void electron_state::electron64(machine_config &config) } +void electronsp_state::electronsp(machine_config &config) +{ + /* install mrb board */ + electron64(config); + + /* rom sockets */ + GENERIC_SOCKET(config, m_romi[0], generic_plain_slot, "electron_rom", "bin,rom"); + m_romi[0]->set_device_load(FUNC(electronsp_state::rom1_load)); + GENERIC_SOCKET(config, m_romi[1], generic_plain_slot, "electron_rom", "bin,rom"); + m_romi[1]->set_device_load(FUNC(electronsp_state::rom2_load)); + + /* via */ + VIA6522(config, m_via, 16_MHz_XTAL / 16); + m_via->readpb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_r)); + m_via->writepb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_w)); + m_via->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<2>)); + + /* user port */ + BBC_USERPORT_SLOT(config, m_userport, bbc_userport_devices, "amxmouse"); + m_userport->cb1_handler().set(m_via, FUNC(via6522_device::write_cb1)); + m_userport->cb2_handler().set(m_via, FUNC(via6522_device::write_cb2)); +} + + ROM_START(electron) ROM_REGION( 0x4000, "mos", 0 ) ROM_LOAD( "b02_acornos-1.rom", 0x0000, 0x4000, CRC(a0c2cf43) SHA1(a27ce645472cc5497690e4bfab43710efbb0792d) ) @@ -295,15 +360,32 @@ ROM_END ROM_START(electron64) ROM_REGION( 0x4000, "mos", 0 ) ROM_LOAD( "os_300.rom", 0x0000, 0x4000, CRC(f80a0cea) SHA1(165e42ff4164a842e56f08ebd420d5027af99fdd) ) - ROM_REGION(0x4000, "basic", 0) + ROM_REGION( 0x4000, "basic", 0 ) + ROM_LOAD( "basic.rom", 0x0000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281) ) +ROM_END + +ROM_START(electronsp) + ROM_REGION( 0x4000, "mos", 0 ) + ROM_LOAD( "os_310.rom", 0x0000, 0x4000, CRC(8b7a9003) SHA1(6d4e2f8ddc1d829b14206d2747749c4c24789568) ) + ROM_REGION( 0x4000, "basic", 0 ) ROM_LOAD( "basic.rom", 0x0000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281) ) + ROM_REGION( 0x8000, "sp64", 0 ) + ROM_SYSTEM_BIOS( 0, "101_2", "v1.01 (2x16K)" ) + ROMX_LOAD( "sp64_101_1.rom", 0x0000, 0x4000, CRC(07e2c5d6) SHA1(837e3382c376e3cc1ae42f1ca51158657ef2fd73), ROM_BIOS(0) ) + ROMX_LOAD( "sp64_101_2.rom", 0x4000, 0x4000, CRC(3d0e5dc1) SHA1(89743c43b24950d481c150fd4b4de985600cca2d), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "100", "v1.00 (32K)" ) + ROMX_LOAD( "sp64_100.rom", 0x0000, 0x8000, CRC(4918221c) SHA1(f185873106e7e7225b2e0c718803dc1ec4ebc685), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS( 2, "100_2", "v1.00 (2x16K)" ) + ROMX_LOAD( "sp64_100_1.rom", 0x0000, 0x4000, CRC(6053e5a0) SHA1(6d79e5494349f157672e7c59949f3941e5a3dbdb), ROM_BIOS(2) ) + ROMX_LOAD( "sp64_100_2.rom", 0x4000, 0x4000, CRC(25d11d8e) SHA1(c1bceeb50fee1e11de7505a3b664b844cfb56289), ROM_BIOS(2) ) ROM_END #define rom_btm2105 rom_electron -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP ( 1983, electron, 0, 0, electron, electron, electron_state, empty_init, "Acorn", "Acorn Electron", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -COMP ( 1983, electront, electron, 0, electron, electron, electron_state, empty_init, "Acorn", "Acorn Electron (Trial)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -COMP ( 1985, btm2105, electron, 0, btm2105, electron, electron_state, empty_init, "British Telecom Business Systems", "BT Merlin M2105", MACHINE_NOT_WORKING ) -COMP ( 1987, electron64, electron, 0, electron64, electron64, electron_state, empty_init, "Acorn/Slogger", "Acorn Electron (64K Master RAM Board)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP ( 1983, electron, 0, 0, electron, electron, electron_state, empty_init, "Acorn Computers", "Acorn Electron", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +COMP ( 1983, electront, electron, 0, electron, electron, electron_state, empty_init, "Acorn Computers", "Acorn Electron (Trial)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +COMP ( 1985, btm2105, electron, 0, btm2105, electron, electron_state, empty_init, "British Telecom Business Systems", "BT Merlin M2105", MACHINE_NOT_WORKING ) +COMP ( 1987, electron64, electron, 0, electron64, electron64, electron_state, empty_init, "Acorn Computers / Slogger", "Acorn Electron (64K Master RAM Board)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +COMP ( 1991, electronsp, electron, 0, electronsp, electronsp, electronsp_state, empty_init, "Acorn Computers / Slogger", "Acorn Electron (Stop Press 64i)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp index 4f0c93e4ae5..eb51cde8e3d 100644 --- a/src/mame/drivers/esd16.cpp +++ b/src/mame/drivers/esd16.cpp @@ -193,6 +193,14 @@ void esd16_state::multchmp_map(address_map &map) map(0x700008, 0x70000b).nopr(); // unused protection? } +void esd16_state::fantstrya_map(address_map &map) +{ + multchmp_map(map); + + map(0x100000, 0x10ffff).unmaprw(); + map(0x900000, 0x90ffff).ram(); +} + void esd16_state::jumppop_map(address_map &map) { map(0x000000, 0x07ffff).rom(); @@ -521,7 +529,7 @@ static INPUT_PORTS_START( fantstry ) PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0600, DEF_STR( 1C_4C ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unused ) ) @@ -745,6 +753,15 @@ void esd16_state::fantstry(machine_config& config) OKIM6295(config, "okimusic", XTAL(16'000'000) / 8, okim6295_device::PIN7_LOW); } +void esd16_state::fantstrya(machine_config& config) +{ + fantstry(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &esd16_state::fantstrya_map); + + config.device_remove("okisfx"); +} + void esd16_state::esd16(machine_config& config) { esd16_nosound(config); @@ -1764,6 +1781,27 @@ ROM_START( fantstry ) ROM_LOAD16_BYTE( "graphics_rom_1", 0x200000, 0x080000, CRC(c8caa752) SHA1(cecc7a18a0bb59554316ed24ed0dc01d58d6ae53) ) // 1bpp ROM_END +// the following set has a worse sound section: only one OKI with only 0x80000 of ROM. +ROM_START( fantstrya ) // PCB marked: PNXND-MULTI 2002 01 01 - Only EPROMs dumped for now, marked the flash ROMs as BAD_DUMP but they should match + ROM_REGION( 0x80000, "maincpu", 0 ) // only difference from the above set seems to be they moved the RAM base from 0x100000 to 0x900000 + ROM_LOAD16_WORD_SWAP( "system_rom", 0x00000, 0x80000, CRC(38471eed) SHA1(02f311ea5bdea41092e6754ed120e5e3e6994623) ) // 27c040, sldh + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "pic16f84a", 0x00000, 0x10000, NO_DUMP ) // did they change the program to take into account the one less OKI? + + ROM_REGION( 0x80000, "okimusic", 0 ) + ROM_LOAD( "sound_rom", 0x00000, 0x80000, CRC(44424914) SHA1(5bbe296d2c8de89b9271914164ef178239fa3e05) ) // 27c4000, sldh + + ROM_REGION( 0x400000, "bgs", 0 ) + ROM_LOAD32_WORD( "graphics_rom_4", 0x000000, 0x200000, BAD_DUMP CRC(82d5104a) SHA1(23067ca2698eb1ec39a77af75beb79431c054fa9) ) + ROM_LOAD32_WORD( "graphics_rom_5", 0x000002, 0x200000, BAD_DUMP CRC(9178c370) SHA1(2c0f29c62d36cdb29380a3e63945da1a80e8d170) ) + + ROM_REGION( 0x300000, "spr", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "graphics_rom_3", 0x000000, 0x100000, BAD_DUMP CRC(1bd2b5fc) SHA1(21f32e9d2673c376c0781137db0f2d267b64bc0c) ) // 2bpp + ROM_LOAD16_WORD_SWAP( "graphics_rom_2", 0x100000, 0x100000, BAD_DUMP CRC(2020add8) SHA1(a7d950c6485f6abdcf4fc609a85f60df2bafe34e) ) // 2bpp + ROM_LOAD16_BYTE( "graphics_rom_1", 0x200000, 0x080000, CRC(c8caa752) SHA1(cecc7a18a0bb59554316ed24ed0dc01d58d6ae53) ) // 1bpp, 27c040 +ROM_END + /*************************************************************************** @@ -1773,34 +1811,35 @@ ROM_END ***************************************************************************/ /* ESD 11-09-98 */ -GAME( 1999, multchmp, 0, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 2.5)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, multchmpk, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (Korea, older)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, multchmpa, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, older)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, multchmp, 0, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 2.5)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, multchmpk, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (Korea, older)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, multchmpa, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, older)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, jumppop, 0, jumppop, jumppop, esd16_state, empty_init, ROT0, "ESD", "Jumping Pop (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, jumppope, jumppop, jumppop, jumppop, esd16_state, empty_init, ROT0, "Emag Soft", "Jumping Pop (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, jumppop, 0, jumppop, jumppop, esd16_state, empty_init, ROT0, "ESD", "Jumping Pop (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, jumppope, jumppop, jumppop, jumppop, esd16_state, empty_init, ROT0, "Emag Soft", "Jumping Pop (set 2)", MACHINE_SUPPORTS_SAVE ) /* ESD 05-28-99 */ -GAME( 1999, hedpanico, hedpanic, hedpanio, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0615, 15/06/1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, hedpanico, hedpanic, hedpanio, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0615, 15/06/1999)", MACHINE_SUPPORTS_SAVE ) /* ESD 06-10-1999 */ -GAME( 1999, hedpanica, hedpanic, hedpanic, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0702, 02/07/1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, hedpanica, hedpanic, hedpanic, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0702, 02/07/1999)", MACHINE_SUPPORTS_SAVE ) /* ESD 08-26-1999 */ -GAME( 2000, mchampdx, 0, mchampdx, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Multi Champ Deluxe (ver. 0106, 06/01/2000)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, mchampdxa, mchampdx, mchampdx, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Multi Champ Deluxe (ver. 1126, 26/11/1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, mchampdxb, mchampdx, mchampdx, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Multi Champ Deluxe (ver. 1114, 14/11/1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, hedpanic, 0, hedpanic, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0117, 17/01/2000)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, hedpanicf, hedpanic, hedpanic, hedpanic, esd16_state, empty_init, ROT0, "ESD / Fuuki", "Head Panic (ver. 0315, 15/03/2000)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mchampdx, 0, mchampdx, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Multi Champ Deluxe (ver. 0106, 06/01/2000)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, mchampdxa, mchampdx, mchampdx, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Multi Champ Deluxe (ver. 1126, 26/11/1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, mchampdxb, mchampdx, mchampdx, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Multi Champ Deluxe (ver. 1114, 14/11/1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, hedpanic, 0, hedpanic, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0117, 17/01/2000)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, hedpanicf, hedpanic, hedpanic, hedpanic, esd16_state, empty_init, ROT0, "ESD / Fuuki", "Head Panic (ver. 0315, 15/03/2000)", MACHINE_SUPPORTS_SAVE ) /* ESD - This PCB looks identical to the ESD 08-26-1999 PCB */ -GAME( 2000, deluxe5, 0, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 5 (ver. 0107, 07/01/2000, set 1)", MACHINE_SUPPORTS_SAVE ) // all 4 sets report the same version number? -GAME( 2000, deluxe5a, deluxe5, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 5 (ver. 0107, 07/01/2000, set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, deluxe5b, deluxe5, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 5 (ver. 0107, 07/01/2000, set 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, deluxe4u, deluxe5, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 4 U (ver. 0107, 07/01/2000)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, deluxe5, 0, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 5 (ver. 0107, 07/01/2000, set 1)", MACHINE_SUPPORTS_SAVE ) // all 4 sets report the same version number? +GAME( 2000, deluxe5a, deluxe5, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 5 (ver. 0107, 07/01/2000, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, deluxe5b, deluxe5, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 5 (ver. 0107, 07/01/2000, set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, deluxe4u, deluxe5, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Deluxe 4 U (ver. 0107, 07/01/2000)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, tangtang, 0, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Tang Tang (ver. 0526, 26/05/2000)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, swatpolc, 0, hedpanic, swatpolc, esd16_state, empty_init, ROT0, "ESD", "SWAT Police", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, tangtang, 0, tangtang, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Tang Tang (ver. 0526, 26/05/2000)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, swatpolc, 0, hedpanic, swatpolc, esd16_state, empty_init, ROT0, "ESD", "SWAT Police", MACHINE_SUPPORTS_SAVE ) /* Z Soft PCB, uses PIC instead of Z80 */ -GAME( 2002, fantstry, 0, fantstry, fantstry, esd16_state, empty_init, ROT0, "Z Soft", "Fantasy Story", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // playable, just no sound +GAME( 2002, fantstry, 0, fantstry, fantstry, esd16_state, empty_init, ROT0, "Z Soft", "Fantasy Story (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // playable, just no sound +GAME( 2002, fantstrya, fantstry, fantstrya, fantstry, esd16_state, empty_init, ROT0, "Z Soft", "Fantasy Story (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // same diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp index 875febac064..494d384efa3 100644 --- a/src/mame/drivers/expro02.cpp +++ b/src/mame/drivers/expro02.cpp @@ -390,7 +390,8 @@ uint32_t expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_ uint32_t expro02_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update_backgrounds(screen, bitmap, cliprect); - m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->render_sprites(cliprect, m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->copybitmap(bitmap, cliprect, screen.priority()); return 0; } diff --git a/src/mame/drivers/fcrash.cpp b/src/mame/drivers/fcrash.cpp index 3b334795267..8c3c1ab09e0 100644 --- a/src/mame/drivers/fcrash.cpp +++ b/src/mame/drivers/fcrash.cpp @@ -17,12 +17,10 @@ *1 these seem to be only CPS1.5/Q sound games? *2 this is original configuration, but non-Capcom (usually single-board) hardware. - As per the above, this file now only contains games in second and last catergories. Eventually only Final Crash, other Final Fight bootlegs and Carrier Air Wing bootlegs will remain here. */ - /* Final Crash is a bootleg of Final Fight @@ -78,41 +76,13 @@ likely won't write any sprite clearing values otherwise. None of this is hooked up currently due to issues with row scroll on the scroll2 layer. - Status of each game: -------------------- -cawingb2, cawingbl: ok - -dinopic: no sound (moved to cps1bl_pic.cpp) - -dinopic2: no sound, one bad graphics ROM. Copying 8.bin from dinopic fixes it. (moved to cps1bl_pic.cpp) - -fcrash, kodb: old sprites show on next screen. Patch used. - -punipic, punipic2: no sound. Problems in Central Park. Patches used. (moved to cps1bl_pic.cpp) - -punipic3: same as punipic, and doors are missing. (moved to cps1bl_pic.cpp) - -sf2m1: crowd is missing. Plane's tail comes off a bit. Patch used. - -sf2mdt, sf2mdtb: ok (moved to cps1bl_5205.cpp) - -sf2mdta, sf2ceb: scroll 2X has strange 0x200 writes that cause missing fighters' portraits at the vs. screen (moved to cps1bl_5205.cpp) - and glitched backgrounds during fights. Masking them out seems a hack. - -sgyxz, wofabl: garbage left behind. A priority problem can be seen in 3rd demo where - the fighters walk through the crowd instead of behind. - -slampic: no sound. Some minor gfx issues (sprites on character select screen) (moved to cps1bl_pic.cpp) - -slampic2: no sound. All gfx issues confirmed present on real board. (moved to cps1bl_pic.cpp) - -captcommb2: ok (moved to cps1bl_5205.cpp) - -knightsb3: ok (moved to cps1bl_5205.cpp) - -dinopic3: no sound. Some minor gfx priority issues, confirmed present on real board. (moved to cps1bl_pic.cpp) - +cawingb2, cawingbl: OK. +fcrash, kodb: Old sprites show on next screen. Patch used. +sf2m1: Crowd is missing. Plane's tail comes off a bit. Patch used. +sgyxz, wofabl: Garbage left behind. A priority problem can be seen in 3rd demo where + the fighters walk through the crowd instead of behind. */ #include "emu.h" diff --git a/src/mame/drivers/ffantasy_ms.cpp b/src/mame/drivers/ffantasy_ms.cpp new file mode 100644 index 00000000000..8bed6ad31ac --- /dev/null +++ b/src/mame/drivers/ffantasy_ms.cpp @@ -0,0 +1,170 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Fighting Fantasy (Modular System) + + As with most of the 'Modular System' setups, the hardware is heavily modified from the original + and consists of a multi-board stack in a cage, hence different driver. + + For this game the Modular System cage contains 8 main boards and 1 sub board. + + MOD-6/1 - TSC68000CP12, 4 ROMs, RAMs, 20 MHz XTAL. + MOD 21/1(?) - 20 MHz XTAL. + MOD 1/5 - Sound board (Z80B, 2 x YM2203C). 2 8-dips banks + small sub board with OKI M5205. + MOD 51/3 - Sprite board, has logic + 4 empty ROM sockets. Sprite ROMs are actually on the below board. + MODULAR SYSTEM 2 MOD 5/1 - red sprite ROM board, 8 sprite ROMs populated (maximum 24 ROMs) + MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0467 SOLD) with no chips, just routing along one edge. + MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0468 SOLD) with no chips, just routing along one edge. + MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0469 SOLD) with no chips, just routing along one edge. + + PCBs pictures and dip listing are available at: http://www.recreativas.org/modular-system-fighting-fantasy-5694-gaelco-sa +*/ + + +#include "emu.h" +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "sound/2203intf.h" +#include "sound/msm5205.h" +#include "emupal.h" +#include "screen.h" +#include "speaker.h" + + +class ffantasy_ms_state : public driver_device +{ +public: + ffantasy_ms_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_screen(*this, "screen") + { } + + void ffantasym(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device<cpu_device> m_maincpu; + required_device<screen_device> m_screen; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void ffantasym_map(address_map &map); +}; + + +void ffantasy_ms_state::ffantasym_map(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); +} + + +void ffantasy_ms_state::machine_start() +{ +} + + +uint32_t ffantasy_ms_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +static INPUT_PORTS_START( ffantasym ) +INPUT_PORTS_END + +static GFXDECODE_START( gfx_ffantasy_ms ) +GFXDECODE_END + +void ffantasy_ms_state::ffantasym(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 20_MHz_XTAL / 2); // divisor unknown + m_maincpu->set_addrmap(AS_PROGRAM, &ffantasy_ms_state::ffantasym_map); + + Z80(config, "audiocpu", 20_MHz_XTAL / 5).set_disable(); // divisor unknown + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // all wrong + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 256-1, 0, 256-32-1); + m_screen->set_screen_update(FUNC(ffantasy_ms_state::screen_update)); + m_screen->set_palette("palette"); + + PALETTE(config, "palette").set_format(palette_device::xBRG_444, 1024); + + GFXDECODE(config, "gfxdecode", "palette", gfx_ffantasy_ms); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + GENERIC_LATCH_8(config, "soundlatch"); + + YM2203(config, "ym1", 20_MHz_XTAL / 5).add_route(ALL_OUTPUTS, "mono", 0.15); // divisor unknown + + YM2203(config, "ym2", 20_MHz_XTAL / 5).add_route(ALL_OUTPUTS, "mono", 0.15); // divisor unknown + + MSM5205(config, "msm", 20_MHz_XTAL / 5).add_route(ALL_OUTPUTS, "mono", 0.15); // divisor unknown +} + +ROM_START( ffantasym ) + ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board, extremely similar to ffantasybl in dec0.cpp + ROM_LOAD16_BYTE( "ff_6-1_5fa_603.ic17", 0x00000, 0x10000, CRC(124ebff8) SHA1(20423990903dc3d682e2df6fb4dec0ae6b49036d) ) + ROM_LOAD16_BYTE( "ff_6-1_5fa_606.ic8", 0x00001, 0x10000, CRC(94fa4a64) SHA1(fa1405144fc525debd1b62f78b5434cf7670e1cb) ) + ROM_LOAD16_BYTE( "ff_6-1_5fa_602.ic20", 0x20000, 0x10000, CRC(68d50c5d) SHA1(d4a96c9ecb565c3c84ca76537492101264007cc1) ) + ROM_LOAD16_BYTE( "ff_6-1_5fa_605.ic11", 0x20001, 0x10000, CRC(dee5475e) SHA1(57a063834dc2fe97f4372eee06114f873a372786) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) // on MOD 1/2 board + ROM_LOAD( "ff_1-5_5fa_101.ic12", 0x00000, 0x10000, CRC(891bc223) SHA1(737248ea23c42076da9ce6c4abb9506f396892a0) ) + + ROM_REGION( 0x80000, "gfx1", 0 ) // on one of the MOD 4/3 boards + ROM_LOAD( "ff_4-3_5fa_404.ic14", 0x00000, 0x8000, CRC(819d8197) SHA1(1303d94f6b3048e1108d25662de971a77f6e3ae6) ) + ROM_LOAD( "ff_4-3_5fa_402.ic16", 0x08000, 0x8000, CRC(fd8030d7) SHA1(84a9d775c0be1d068795ae8889cb5cec2842d622) ) + ROM_LOAD( "ff_4-3_5fa_403.ic15", 0x10000, 0x8000, CRC(0c572113) SHA1(3d035f1a985d1e04e64eb124c83c44e17bc07d53) ) + ROM_LOAD( "ff_4-3_5fa_401.ic17", 0x18000, 0x8000, CRC(26f57324) SHA1(079745385f1240edf4ce712262352547b20282d2) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) // on a second MOD 4/3 board + ROM_LOAD( "ff_4-3-a_5fa_4a1.ic17", 0x00000, 0x8000, CRC(4be99b3a) SHA1(d4c576dda0bd855c8f361c96cd4615815c8c36c8) ) + ROM_LOAD( "ff_4-3-a_5fa_4a2.ic16", 0x08000, 0x8000, CRC(206239f1) SHA1(f5d2f7c888f01db57c9b78eff733b22301836025) ) + ROM_LOAD( "ff_4-3-a_5fa_4a3.ic15", 0x10000, 0x8000, CRC(c3eeb8a4) SHA1(c097034e2d3c3f55c935aff1d2c14a1dacc1f5da) ) + ROM_LOAD( "ff_4-3-a_5fa_4a4.ic14", 0x18000, 0x8000, CRC(a4a8ba47) SHA1(2bf3379a33850703db49cbcdd61d5e4777006726) ) + + ROM_REGION( 0x80000, "gfx3", 0 ) // on a third MOD 4/3 board + ROM_LOAD( "ff_4-3-b_4fa_4b1.ic17", 0x00000, 0x8000, CRC(51c274f0) SHA1(145a2da91db9d26a8ecaa6d4267c9aa0e4883fdc) ) + ROM_LOAD( "ff_4-3-b_4fa_4b2.ic16", 0x08000, 0x8000, CRC(53fade55) SHA1(d7ae60c908338f746fb585bf81c89036a6a9c8e0) ) + ROM_LOAD( "ff_4-3-b_4fa_4b3.ic15", 0x10000, 0x8000, CRC(49668a54) SHA1(f6129aa46f8e766a5012fe1b90c98a78581a773b) ) + ROM_LOAD( "ff_4-3-b_4fa_4b4.ic14", 0x18000, 0x8000, BAD_DUMP CRC(bd0d2e07) SHA1(3165fb23ee9cd5912fd17e557dd0d1513bd189ef) ) + + ROM_REGION( 0x100000, "gfx4", 0 ) // on MOD 51/1 board + ROM_LOAD( "ff_5-1_5fa_505.ic5", 0x20000, 0x10000, CRC(24503b71) SHA1(4b303bbfa7f7ede1679cdf660e5cf53806ca3531) ) + ROM_LOAD( "ff_5-1_5fa_506.ic6", 0x30000, 0x10000, CRC(b47d3b99) SHA1(ee6c79a93a0640692fcc49a0c247d15f35e3a7ca) ) + ROM_LOAD( "ff_5-1_5fa_511.ic14", 0x60000, 0x10000, CRC(01b8cc18) SHA1(434989b5cf00845788d4a855fc027684e8c79ace) ) + ROM_LOAD( "ff_5-1_5fa_512.ic15", 0x70000, 0x10000, CRC(36fa650e) SHA1(8226bba7d75a5112883e30c8012d18bc7c1acd11) ) + ROM_LOAD( "ff_5-1_5fa_517.ic20", 0xa0000, 0x10000, CRC(ed7d42e5) SHA1(52a453da9bbf11846bbe8e1121b56a869b93ac65) ) + ROM_LOAD( "ff_5-1_5fa_518.ic21", 0xb0000, 0x10000, CRC(1106d842) SHA1(002b785ed575c3ae6514d866c070dab83323a8b6) ) + ROM_LOAD( "ff_5-1_5fa_523.ic26", 0xe0000, 0x10000, CRC(a541c879) SHA1(53133cb2ad5378f101025fc758d08a54e23f3c87) ) + ROM_LOAD( "ff_5-1_5fa_524.ic27", 0xf0000, 0x10000, CRC(1e7351c5) SHA1(88d83b45f25fe58726e5158b97395443cf065564) ) + + ROM_REGION( 0x0400, "proms", 0 ) /* PROMs (function unknown) */ + ROM_LOAD( "ff_1-5_110_82s123.ic20", 0x000, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) + ROM_LOAD( "ff_21-1_201_82s129.ic4", 0x100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) + ROM_LOAD( "ff_21-1_205_82s129.ic12", 0x200, 0x100, CRC(204a7aee) SHA1(322164134aa65c37a9389024f921364a81d13e88) ) + ROM_LOAD( "ff_51-3_502_82s129.ic10", 0x300, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) + + ROM_REGION( 0x1000, "plds", ROMREGION_ERASEFF ) + ROM_LOAD( "ff_6-1_604_gal16v8.ic13", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "ff_6-1_635_gal16v8.ic7", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "ff_4-3_p0403_pal16r8a.ic29", 0x000, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "ff_4-3-a_p0402_pal16r8a.ic29", 0x000, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "ff_4-3-b_p0403_pal16r8a.ic29", 0x000, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "ff_51-3_p0503_pal16r6a.ic46", 0x000, 0x104, CRC(07eb86d2) SHA1(482eb325df5bc60353bac85412cf45429cd03c6d) ) + ROM_LOAD( "ff_5-1_5135_gal16v8.ic9", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "ff_5-1_5235_gal16v8.ic8", 0x000, 0x117, NO_DUMP ) +ROM_END + +GAME( 199?, ffantasym, hippodrm, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Fighting Fantasy (Modular System)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/fidel_as12.cpp b/src/mame/drivers/fidel_as12.cpp index 98adcbf4e1a..1e4cd37ee7e 100644 --- a/src/mame/drivers/fidel_as12.cpp +++ b/src/mame/drivers/fidel_as12.cpp @@ -51,7 +51,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void as12(machine_config &config); protected: @@ -205,7 +205,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void as12_state::as12(machine_config &config) @@ -215,7 +215,7 @@ void as12_state::as12(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &as12_state::div_trampoline); ADDRESS_MAP_BANK(config, m_mainmap).set_map(&as12_state::main_map).set_options(ENDIANNESS_LITTLE, 8, 16); - const attotime irq_period = attotime::from_hz(585); // from 556 timer (22nF, 110K, 1K) + const attotime irq_period = attotime::from_hz(600); // from 556 timer (22nF, 110K, 1K), ideal frequency is 600Hz TIMER(config, m_irq_on).configure_periodic(FUNC(as12_state::irq_on<M6502_IRQ_LINE>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_nsec(15250)); // active for 15.25us TIMER(config, "irq_off").configure_periodic(FUNC(as12_state::irq_off<M6502_IRQ_LINE>), irq_period); diff --git a/src/mame/drivers/fidel_card.cpp b/src/mame/drivers/fidel_card.cpp index 5487f2f1083..82bb019fae5 100644 --- a/src/mame/drivers/fidel_card.cpp +++ b/src/mame/drivers/fidel_card.cpp @@ -192,7 +192,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void ubc(machine_config &config); void vbrc(machine_config &config); void bv3(machine_config &config); @@ -556,7 +556,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void card_state::brc_base(machine_config &config) diff --git a/src/mame/drivers/fidel_cc1.cpp b/src/mame/drivers/fidel_cc1.cpp index 3d9cfec2334..9b1df3fa7a9 100644 --- a/src/mame/drivers/fidel_cc1.cpp +++ b/src/mame/drivers/fidel_cc1.cpp @@ -68,7 +68,7 @@ public: // RE button is tied to 8224 RESIN pin DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } - // machine drivers + // machine configs void cc1(machine_config &config); void cc3(machine_config &config); @@ -216,7 +216,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void cc1_state::cc1(machine_config &config) diff --git a/src/mame/drivers/fidel_cc10.cpp b/src/mame/drivers/fidel_cc10.cpp index a7bb7e43860..00d13ceec87 100644 --- a/src/mame/drivers/fidel_cc10.cpp +++ b/src/mame/drivers/fidel_cc10.cpp @@ -57,7 +57,7 @@ public: // RE button is tied to Z80 RESET pin DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } - // machine drivers + // machine configs void acr(machine_config &config); void ccx(machine_config &config); @@ -285,7 +285,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void ccx_state::acr(machine_config &config) diff --git a/src/mame/drivers/fidel_cc7.cpp b/src/mame/drivers/fidel_cc7.cpp index fc7088a872d..fe19380202d 100644 --- a/src/mame/drivers/fidel_cc7.cpp +++ b/src/mame/drivers/fidel_cc7.cpp @@ -68,7 +68,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void bcc(machine_config &config); void bkc(machine_config &config); @@ -218,7 +218,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void bcc_state::bkc(machine_config &config) diff --git a/src/mame/drivers/fidel_chesster.cpp b/src/mame/drivers/fidel_chesster.cpp index 323bcdc1a70..e98b4df7a1a 100644 --- a/src/mame/drivers/fidel_chesster.cpp +++ b/src/mame/drivers/fidel_chesster.cpp @@ -54,7 +54,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void chesster(machine_config &config); void kishon(machine_config &config); @@ -186,7 +186,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void chesster_state::chesster(machine_config &config) diff --git a/src/mame/drivers/fidel_csc.cpp b/src/mame/drivers/fidel_csc.cpp index 1dc2bc961dd..dfda2902321 100644 --- a/src/mame/drivers/fidel_csc.cpp +++ b/src/mame/drivers/fidel_csc.cpp @@ -610,7 +610,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void csc_state::csc(machine_config &config) diff --git a/src/mame/drivers/fidel_dames.cpp b/src/mame/drivers/fidel_dames.cpp index e9ecbf0317e..7b5193988e9 100644 --- a/src/mame/drivers/fidel_dames.cpp +++ b/src/mame/drivers/fidel_dames.cpp @@ -50,7 +50,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void dsc(machine_config &config); protected: @@ -224,7 +224,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void dsc_state::dsc(machine_config &config) diff --git a/src/mame/drivers/fidel_desdis.cpp b/src/mame/drivers/fidel_desdis.cpp index f4c514fc425..7ed198d5dad 100644 --- a/src/mame/drivers/fidel_desdis.cpp +++ b/src/mame/drivers/fidel_desdis.cpp @@ -70,7 +70,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void fdes2000d(machine_config &config); void fdes2100d(machine_config &config); @@ -129,7 +129,7 @@ public: desdis_state(mconfig, type, tag) { } - // machine drivers + // machine configs void fdes2265(machine_config &config); void fdes2325(machine_config &config); @@ -287,7 +287,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void desdis_state::fdes2100d(machine_config &config) @@ -296,7 +296,7 @@ void desdis_state::fdes2100d(machine_config &config) M65C02(config, m_maincpu, 6_MHz_XTAL); // W65C02P-6 m_maincpu->set_addrmap(AS_PROGRAM, &desdis_state::fdes2100d_map); - const attotime irq_period = attotime::from_hz(630); // from 556 timer (22nF, 102K, 1K) + const attotime irq_period = attotime::from_hz(600); // from 556 timer (22nF, 102K, 1K), ideal frequency is 600Hz TIMER(config, m_irq_on).configure_periodic(FUNC(desdis_state::irq_on<M6502_IRQ_LINE>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_nsec(15250)); // active for 15.25us TIMER(config, "irq_off").configure_periodic(FUNC(desdis_state::irq_off<M6502_IRQ_LINE>), irq_period); @@ -333,9 +333,9 @@ void desmas_state::fdes2265(machine_config &config) M68000(config.replace(), m_maincpu, 16_MHz_XTAL); // MC68HC000P12F m_maincpu->set_addrmap(AS_PROGRAM, &desmas_state::fdes2265_map); - const attotime irq_period = attotime::from_hz(597); // from 555 timer, measured + const attotime irq_period = attotime::from_hz(600); // from 555 timer, ideal frequency is 600Hz (measured 597Hz) TIMER(config.replace(), m_irq_on).configure_periodic(FUNC(desmas_state::irq_on<M68K_IRQ_4>), irq_period); - m_irq_on->set_start_delay(irq_period - attotime::from_nsec(6000)); // active for 6us + m_irq_on->set_start_delay(irq_period - attotime::from_usec(6)); // active for 6us TIMER(config.replace(), "irq_off").configure_periodic(FUNC(desmas_state::irq_off<M68K_IRQ_4>), irq_period); config.set_default_layout(layout_fidel_desdis_68kr); @@ -401,4 +401,4 @@ CONS( 1988, fdes2100d, 0, 0, fdes2100d, desdis, desdis_state, init_fdes2 CONS( 1988, fdes2000d, fdes2100d, 0, fdes2000d, desdis, desdis_state, init_fdes2100d, "Fidelity Electronics", "Designer 2000 Display", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1989, fdes2265, 0, 0, fdes2265, desdis, desmas_state, init_fdes2265, "Fidelity Electronics", "Designer Mach III Master 2265", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1991, fdes2325, fdes2265, 0, fdes2325, desdis, desmas_state, empty_init, "Fidelity Electronics", "Designer Mach IV Master 2325", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, fdes2325, fdes2265, 0, fdes2325, desdis, desmas_state, empty_init, "Fidelity Electronics", "Designer Mach IV 68020 Master 2325", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/fidel_eag68k.cpp b/src/mame/drivers/fidel_eag68k.cpp index 5c6fb8f8302..4b34e968533 100644 --- a/src/mame/drivers/fidel_eag68k.cpp +++ b/src/mame/drivers/fidel_eag68k.cpp @@ -5,10 +5,12 @@ Fidelity 68000-based Elite Avant Garde driver For 6502-based EAG, see fidel_elite.cpp + Excel 68000 I/O is very similar to EAG, so it's handled in this driver as well TODO: -- USART is not emulated +- unemulated waitstates with DTACK +- EAG USART is not emulated - V11 CPU should be M68EC060, not yet emulated. Now using M68EC040 in its place at twice the frequency due to lack of superscalar. - V11 beeper is too high pitched, related to wrong CPU type too? But even at 72MHz @@ -25,10 +27,13 @@ Excel 68000 (model 6094) overview: There's room for 2 SIMMs at U22 and U23, unpopulated in Excel 68000 and Mach III. Mach II has 2*64KB DRAM with a MB1422A DRAM controller @ 25MHz. Mach III has wire mods from U22/U23 to U8/U9(2*8KB + 2*32KB piggybacked). -Mach IV has 2*256KB DRAM, and a daughterboard(510.1123B01) for the 68020. +Mach IV has 2*256KB DRAM, and a daughterboard(510.1123B01) for the 68020 + 32KB RAM. I/O is via TTL, overall very similar to EAG. +fex68km4 continuously tests RAM at boot and displays "512", this is normal. +To start, hold New Game or Clear. + ******************************************************************************* Elite Avant Garde (EAG, model 6114) @@ -190,7 +195,7 @@ public: m_rotate(true) { } - // machine drivers + // machine configs void eagv2(machine_config &config); void eagv3(machine_config &config); void eagv5(machine_config &config); @@ -235,18 +240,13 @@ protected: DECLARE_WRITE8_MEMBER(digit_w); bool m_rotate; - u8 m_select; - u8 m_7seg_data; - u8 m_led_data; + u8 m_select = 0; + u8 m_7seg_data = 0; + u8 m_led_data = 0; }; void eag_state::machine_start() { - // zerofill - m_select = 0; - m_7seg_data = 0; - m_led_data = 0; - // register for savestates save_item(NAME(m_select)); save_item(NAME(m_7seg_data)); @@ -265,7 +265,7 @@ public: m_sublatch(*this, "sublatch") { } - // machine drivers + // machine configs void eagv5(machine_config &config); private: @@ -295,16 +295,18 @@ public: m_rotate = false; } - // machine drivers + // machine configs void fex68k(machine_config &config); void fex68km2(machine_config &config); void fex68km3(machine_config &config); + void fex68km4(machine_config &config); private: // address maps void fex68k_map(address_map &map); void fex68km2_map(address_map &map); void fex68km3_map(address_map &map); + void fex68km4_map(address_map &map); }; @@ -443,6 +445,18 @@ void excel68k_state::fex68km3_map(address_map &map) map(0x200000, 0x20ffff).ram(); } +void excel68k_state::fex68km4_map(address_map &map) +{ + map(0x00000000, 0x0000ffff).rom(); + map(0x00000000, 0x0000000f).mirror(0x00fff0).w(FUNC(excel68k_state::leds_w)).umask32(0x00ff00ff); + map(0x00000000, 0x0000000f).mirror(0x00fff0).w(FUNC(excel68k_state::digit_w)).umask32(0xff00ff00); + map(0x00044000, 0x00047fff).ram(); // unused? + map(0x00100000, 0x0010000f).mirror(0x03fff0).r(FUNC(excel68k_state::input1_r)).umask32(0x00ff00ff); + map(0x00140000, 0x0014000f).mirror(0x03fff0).w(FUNC(excel68k_state::mux_w)).umask32(0x00ff00ff); + map(0x00200000, 0x0027ffff).ram(); + map(0x00400000, 0x00407fff).ram(); +} + // EAG @@ -545,7 +559,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void excel68k_state::fex68k(machine_config &config) @@ -554,7 +568,7 @@ void excel68k_state::fex68k(machine_config &config) M68000(config, m_maincpu, 12_MHz_XTAL); // HD68HC000P12 m_maincpu->set_addrmap(AS_PROGRAM, &excel68k_state::fex68k_map); - const attotime irq_period = attotime::from_hz(618); // theoretical frequency from 556 timer (22nF, 91K + 20K POT @ 14.8K, 0.1K), measurement was 580Hz + const attotime irq_period = attotime::from_hz(600); // 556 timer (22nF, 91K + 20K POT @ 14.8K, 0.1K), ideal is 600Hz (measured 580Hz, 604Hz, 632Hz) TIMER(config, m_irq_on).configure_periodic(FUNC(excel68k_state::irq_on<M68K_IRQ_2>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_nsec(1528)); // active for 1.525us TIMER(config, "irq_off").configure_periodic(FUNC(excel68k_state::irq_off<M68K_IRQ_2>), irq_period); @@ -591,6 +605,17 @@ void excel68k_state::fex68km3(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &excel68k_state::fex68km3_map); } +void excel68k_state::fex68km4(machine_config &config) +{ + fex68k(config); + + /* basic machine hardware */ + M68020(config.replace(), m_maincpu, 20_MHz_XTAL); // XC68020RC16 or MC68020RC20E + m_maincpu->set_addrmap(AS_PROGRAM, &excel68k_state::fex68km4_map); + + m_irq_on->set_start_delay(attotime::from_hz(600) - attotime::from_usec(10)); // irq active for 10us +} + void eag_state::eag_base(machine_config &config) { /* basic machine hardware */ @@ -748,6 +773,12 @@ ROM_START( fex68km3 ) // model 6098, PCB label 510.1120B01 ROM_LOAD16_BYTE("mo_yellow.u7", 0x00001, 0x08000, CRC(b96b0b5f) SHA1(281145be802efb38ed764aecb26b511dcd71cb87) ) // " ROM_END +ROM_START( fex68km4 ) // model 6110, PCB label 510.1120B01 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD16_BYTE("68020_even_master_2325.u6", 0x00000, 0x08000, CRC(13ea816c) SHA1(98d00fc382ddcbccb0a47c3f8d7fc73f30a15fbd) ) + ROM_LOAD16_BYTE("68020_odd_master_2325.u7", 0x00001, 0x08000, CRC(d24c7b54) SHA1(3204fd600786792a618965715990c44890cc7119) ) +ROM_END + ROM_START( feagv2 ) ROM_REGION16_BE( 0x20000, "maincpu", 0 ) @@ -819,6 +850,7 @@ CONS( 1987, fex68kb, fex68k, 0, fex68k, excel68k, excel68k_state, empty_ini CONS( 1988, fex68km2, fex68k, 0, fex68km2, excel68k, excel68k_state, empty_init, "Fidelity Electronics", "Excel 68000 Mach II (rev. C+, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1988, fex68km2a, fex68k, 0, fex68km2, excel68k, excel68k_state, empty_init, "Fidelity Electronics", "Excel 68000 Mach II (rev. C+, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1988, fex68km3, fex68k, 0, fex68km3, excel68k, excel68k_state, empty_init, "Fidelity Electronics", "Excel 68000 Mach III Master", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1989, fex68km4, fex68k, 0, fex68km4, excel68k, excel68k_state, empty_init, "Fidelity Electronics", "Excel 68000 Mach IV 68020 Master 2325", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1989, feagv2, 0, 0, eagv2, eag, eag_state, init_eag, "Fidelity Electronics", "Elite Avant Garde (model 6114-2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1989, feagv3, feagv2, 0, eagv3, eag, eag_state, init_eag, "Fidelity Electronics", "Elite Avant Garde (model 6114-3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/fidel_elite.cpp b/src/mame/drivers/fidel_elite.cpp index 46ead41491d..fe4fcba2b9e 100644 --- a/src/mame/drivers/fidel_elite.cpp +++ b/src/mame/drivers/fidel_elite.cpp @@ -97,7 +97,7 @@ public: m_rotate(false) { } - // machine drivers + // machine configs void pc(machine_config &config); void eas(machine_config &config); void eas_priv(machine_config &config); @@ -173,7 +173,7 @@ public: m_rotate = true; } - // machine drivers + // machine configs void eag(machine_config &config); void eag2100(machine_config &config); @@ -419,7 +419,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void elite_state::pc(machine_config &config) diff --git a/src/mame/drivers/fidel_excel.cpp b/src/mame/drivers/fidel_excel.cpp index ee3ab1dc203..5d15aa74f45 100644 --- a/src/mame/drivers/fidel_excel.cpp +++ b/src/mame/drivers/fidel_excel.cpp @@ -166,7 +166,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void fexcel(machine_config &config); void fexcelb(machine_config &config); void fexcel4(machine_config &config); @@ -390,7 +390,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void excel_state::fexcel(machine_config &config) @@ -399,7 +399,7 @@ void excel_state::fexcel(machine_config &config) M65SC02(config, m_maincpu, 12_MHz_XTAL/4); // G65SC102P-3, 12.0M ceramic resonator m_maincpu->set_addrmap(AS_PROGRAM, &excel_state::fexcel_map); - const attotime irq_period = attotime::from_hz(630); // from 556 timer (22nF, 102K, 1K) + const attotime irq_period = attotime::from_hz(600); // from 556 timer (22nF, 102K, 1K), ideal frequency is 600Hz TIMER(config, m_irq_on).configure_periodic(FUNC(excel_state::irq_on<M6502_IRQ_LINE>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_nsec(15250)); // active for 15.25us TIMER(config, "irq_off").configure_periodic(FUNC(excel_state::irq_off<M6502_IRQ_LINE>), irq_period); @@ -462,12 +462,6 @@ void excel_state::fdes2100(machine_config &config) M65C02(config.replace(), m_maincpu, 5_MHz_XTAL); // WDC 65C02 m_maincpu->set_addrmap(AS_PROGRAM, &excel_state::fexcelb_map); - // change irq timer frequency - const attotime irq_period = attotime::from_hz(630); // from 556 timer (22nF, 102K, 1K) - TIMER(config.replace(), m_irq_on).configure_periodic(FUNC(excel_state::irq_on<M6502_IRQ_LINE>), irq_period); - m_irq_on->set_start_delay(irq_period - attotime::from_nsec(15250)); // active for 15.25us - TIMER(config.replace(), "irq_off").configure_periodic(FUNC(excel_state::irq_off<M6502_IRQ_LINE>), irq_period); - config.set_default_layout(layout_fidel_des); } diff --git a/src/mame/drivers/fidel_phantom.cpp b/src/mame/drivers/fidel_phantom.cpp index f8594006224..60f549c4a92 100644 --- a/src/mame/drivers/fidel_phantom.cpp +++ b/src/mame/drivers/fidel_phantom.cpp @@ -381,7 +381,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void phantom_state::fphantom(machine_config &config) diff --git a/src/mame/drivers/fidel_sc12.cpp b/src/mame/drivers/fidel_sc12.cpp index aec0576fd8c..81d9e395a60 100644 --- a/src/mame/drivers/fidel_sc12.cpp +++ b/src/mame/drivers/fidel_sc12.cpp @@ -81,7 +81,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void sc12(machine_config &config); void sc12b(machine_config &config); @@ -224,7 +224,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void sc12_state::sc12(machine_config &config) @@ -234,7 +234,7 @@ void sc12_state::sc12(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &sc12_state::div_trampoline); ADDRESS_MAP_BANK(config, m_mainmap).set_map(&sc12_state::main_map).set_options(ENDIANNESS_LITTLE, 8, 16); - const attotime irq_period = attotime::from_hz(630); // from 556 timer (22nF, 102K, 1K) + const attotime irq_period = attotime::from_hz(600); // from 556 timer (22nF, 102K, 1K), ideal frequency is 600Hz TIMER(config, m_irq_on).configure_periodic(FUNC(sc12_state::irq_on<M6502_IRQ_LINE>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_nsec(15250)); // active for 15.25us TIMER(config, "irq_off").configure_periodic(FUNC(sc12_state::irq_off<M6502_IRQ_LINE>), irq_period); @@ -265,12 +265,6 @@ void sc12_state::sc12b(machine_config &config) /* basic machine hardware */ m_maincpu->set_clock(4_MHz_XTAL); // R65C02P4 - - // change irq timer frequency - const attotime irq_period = attotime::from_hz(596); // from 556 timer (22nF, 82K+26K, 1K) - TIMER(config.replace(), m_irq_on).configure_periodic(FUNC(sc12_state::irq_on<M6502_IRQ_LINE>), irq_period); - m_irq_on->set_start_delay(irq_period - attotime::from_nsec(15250)); // active for 15.25us - TIMER(config.replace(), "irq_off").configure_periodic(FUNC(sc12_state::irq_off<M6502_IRQ_LINE>), irq_period); } diff --git a/src/mame/drivers/fidel_sc6.cpp b/src/mame/drivers/fidel_sc6.cpp index 1864fa3ec24..8ffb99ef305 100644 --- a/src/mame/drivers/fidel_sc6.cpp +++ b/src/mame/drivers/fidel_sc6.cpp @@ -51,7 +51,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void sc6(machine_config &config); protected: @@ -213,7 +213,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void sc6_state::sc6(machine_config &config) diff --git a/src/mame/drivers/fidel_sc8.cpp b/src/mame/drivers/fidel_sc8.cpp index e36023439b7..5f1949eff74 100644 --- a/src/mame/drivers/fidel_sc8.cpp +++ b/src/mame/drivers/fidel_sc8.cpp @@ -39,7 +39,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void scc(machine_config &config); protected: @@ -153,7 +153,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void scc_state::scc(machine_config &config) diff --git a/src/mame/drivers/fidel_sc9.cpp b/src/mame/drivers/fidel_sc9.cpp index d8f49e242b2..764dd048735 100644 --- a/src/mame/drivers/fidel_sc9.cpp +++ b/src/mame/drivers/fidel_sc9.cpp @@ -69,7 +69,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void sc9b(machine_config &config); void sc9c(machine_config &config); void sc9d(machine_config &config); @@ -271,7 +271,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void sc9_state::sc9d(machine_config &config) @@ -280,7 +280,7 @@ void sc9_state::sc9d(machine_config &config) M6502(config, m_maincpu, 3.9_MHz_XTAL/2); // R6502AP, 3.9MHz resonator m_maincpu->set_addrmap(AS_PROGRAM, &sc9_state::sc9d_map); - const attotime irq_period = attotime::from_hz(610); // from 555 timer (22nF, 102K, 2.7K) + const attotime irq_period = attotime::from_hz(600); // from 555 timer (22nF, 102K, 2.7K), ideal frequency is 600Hz TIMER(config, m_irq_on).configure_periodic(FUNC(sc9_state::irq_on<M6502_IRQ_LINE>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_usec(41)); // active for 41us TIMER(config, "irq_off").configure_periodic(FUNC(sc9_state::irq_off<M6502_IRQ_LINE>), irq_period); diff --git a/src/mame/drivers/fidel_vcc.cpp b/src/mame/drivers/fidel_vcc.cpp index ddf9b772864..f8705db4f11 100644 --- a/src/mame/drivers/fidel_vcc.cpp +++ b/src/mame/drivers/fidel_vcc.cpp @@ -130,7 +130,7 @@ public: // RE button is tied to Z80 RESET pin DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } - // machine drivers + // machine configs void vcc(machine_config &config); protected: @@ -321,7 +321,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void vcc_state::vcc(machine_config &config) diff --git a/src/mame/drivers/fidel_vsc.cpp b/src/mame/drivers/fidel_vsc.cpp index 053ddd591f6..f2038f1cec0 100644 --- a/src/mame/drivers/fidel_vsc.cpp +++ b/src/mame/drivers/fidel_vsc.cpp @@ -180,7 +180,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void vsc(machine_config &config); protected: @@ -416,7 +416,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void vsc_state::vsc(machine_config &config) @@ -426,7 +426,7 @@ void vsc_state::vsc(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &vsc_state::main_map); m_maincpu->set_addrmap(AS_IO, &vsc_state::main_io); - const attotime irq_period = attotime::from_hz(587); // 555 timer, measured + const attotime irq_period = attotime::from_hz(600); // 555 timer, ideal frequency is 600Hz (measurement was 587Hz) TIMER(config, m_irq_on).configure_periodic(FUNC(vsc_state::irq_on<INPUT_LINE_NMI>), irq_period); m_irq_on->set_start_delay(irq_period - attotime::from_usec(845)); // active for 0.845ms (approx half) TIMER(config, "irq_off").configure_periodic(FUNC(vsc_state::irq_off<INPUT_LINE_NMI>), irq_period); diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp index 9ab08722491..19857ca8ba3 100644 --- a/src/mame/drivers/flstory.cpp +++ b/src/mame/drivers/flstory.cpp @@ -440,7 +440,7 @@ static INPUT_PORTS_START( victnine ) PORT_DIPSETTING( 0x20, DEF_STR( Upright ) ) PORT_DIPSETTING( 0xa0, DEF_STR( Cocktail ) ) PORT_DIPSETTING( 0x00, "MA / MB" ) // This is a small single player sit-down cab called 'Taito MA' or 'Taito MB', with only 1 joystick and 3 buttons. - // Only Player 1 can play and only buttons A, C and c are active. + // Only Player 1 can play and only buttons A, C and c are active. PORT_START("SWB") /* D801 */ PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWB:1,2,3,4") diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index eecb33f6453..318a15e8cc8 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -9,7 +9,7 @@ CPU: various AMD x86 CPUs, originally 80386DX (80387 available as an add-on). later models use 80386SX, 80486 and Pentium CPUs - Sound: Yamaha YM3438 + Sound: Yamaha YM3438 (some later models are use YMF276; Low voltage variation of YM3438, needs External DAC) Ricoh RF5c68 CD-DA Video: Custom @@ -2837,11 +2837,20 @@ void towns_state::towns_base(machine_config &config) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); + ym3438_device &fm(YM3438(config, "fm", 16000000 / 2)); // actual clock speed unknown fm.irq_handler().set(FUNC(towns_state::towns_fm_irq)); fm.add_route(0, "lspeaker", 1.00); fm.add_route(1, "rspeaker", 1.00); +/* + // Later model uses YMF276 for FM + ymf276_device &fm(YMF276(config, "fm", 16000000 / 2)); // actual clock speed unknown + fm.irq_handler().set(FUNC(towns_state::towns_fm_irq)); + fm.add_route(0, "lspeaker", 1.00); + fm.add_route(1, "rspeaker", 1.00); +*/ + rf5c68_device &pcm(RF5C68(config, "pcm", 16000000 / 2)); // actual clock speed unknown pcm.set_end_callback(FUNC(towns_state::towns_pcm_irq)); pcm.set_addrmap(0, &towns_state::pcm_mem); diff --git a/src/mame/drivers/funworld.cpp b/src/mame/drivers/funworld.cpp index 044380fcc53..2f92f3b8054 100644 --- a/src/mame/drivers/funworld.cpp +++ b/src/mame/drivers/funworld.cpp @@ -3210,24 +3210,24 @@ READ8_MEMBER(royalcrdf_state::royalcrdf_opcode_r) // 1-bit-to-1-bit bitswaps; furthermore, in both sets one of the // bitswaps is equal to the one applied to all the data (but notice // that, in those cases, we are applying it twice to opcodes here) - constexpr std::array<std::array<int,4>,16> bs{ // bitswaps for data bits 1,2,5 & 7, in that order - 1,5,2,7, - 1,5,2,7, - 5,1,7,2, - 7,2,5,1, - 1,5,2,7, - 1,5,2,7, - 5,2,1,7, - 7,2,5,1, - 1,5,2,7, - 1,5,2,7, - 5,1,7,2, - 1,7,5,2, - 1,5,2,7, - 1,5,2,7, - 5,2,1,7, - 1,7,5,2, - }; + constexpr std::array<std::array<int,4>,16> bs{{ // bitswaps for data bits 1,2,5 & 7, in that order + { 1,5,2,7 }, + { 1,5,2,7 }, + { 5,1,7,2 }, + { 7,2,5,1 }, + { 1,5,2,7 }, + { 1,5,2,7 }, + { 5,2,1,7 }, + { 7,2,5,1 }, + { 1,5,2,7 }, + { 1,5,2,7 }, + { 5,1,7,2 }, + { 1,7,5,2 }, + { 1,5,2,7 }, + { 1,5,2,7 }, + { 5,2,1,7 }, + { 1,7,5,2 } + }}; // xor masks, dependent on the same address bits than the bitswaps, // and with the same 5-values structure @@ -3285,16 +3285,16 @@ READ8_MEMBER(multiwin_state::multiwin_opcode_r) // one of the address bits don't have effect on the bitswap, just on the xor; // again, we have just five different bitswaps, and the hardware is probably using // passive logic on the address bits to do the selection - constexpr std::array<std::array<int,5>,8> bs { // bitswaps for data bits 0,2,4,5 & 7, in that order - 5,2,4,0,7, - 4,0,2,7,5, - 7,4,5,2,0, - 4,0,2,7,5, - 2,7,0,5,4, - 4,0,2,7,5, - 0,5,7,4,2, - 4,0,2,7,5, - }; + constexpr std::array<std::array<int,5>,8> bs{{ // bitswaps for data bits 0,2,4,5 & 7, in that order + { 5,2,4,0,7 }, + { 4,0,2,7,5 }, + { 7,4,5,2,0 }, + { 4,0,2,7,5 }, + { 2,7,0,5,4 }, + { 4,0,2,7,5 }, + { 0,5,7,4,2 }, + { 4,0,2,7,5 } + }}; // xor masks constexpr std::array<uint8_t,16> xm { @@ -3357,80 +3357,79 @@ READ8_MEMBER(powercrd_state::powercrd_opcode_r) constexpr uint8_t UNKN {0xfc}; - constexpr std::array<std::array<uint8_t,256>,4> decryption_tables - { - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - 0xe8, 0x29, UNKN, UNKN, 0x85, UNKN, 0x18, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd5, // 0_ - UNKN, UNKN, 0xa6, 0x4c, UNKN, UNKN, 0x84, UNKN, UNKN, UNKN, 0x69, UNKN, 0x91, 0x38, 0xa8, UNKN, // 1_ - UNKN, 0x9d, 0xd8, 0x49, 0xc0, UNKN, 0x66, UNKN, UNKN, 0xe6, 0xb9, 0xad, UNKN, UNKN, UNKN, 0x10, // 2_ - UNKN, 0xd0, UNKN, 0x92, UNKN, UNKN, 0x74, UNKN, 0x9e, UNKN, UNKN, UNKN, UNKN, 0xb1, UNKN, 0x3d, // 3_ - 0xa5, 0xc4, UNKN, UNKN, UNKN, 0xce, 0x6a, 0x3a, UNKN, UNKN, UNKN, UNKN, 0xa2, UNKN, UNKN, UNKN, // 4_ - 0x9c, UNKN, UNKN, UNKN, UNKN, 0x79, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 5_ - UNKN, 0xed, UNKN, UNKN, UNKN, UNKN, 0xc9, 0x99, UNKN, 0xa9, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 6_ - UNKN, UNKN, 0xc8, UNKN, 0xe0, 0x2d, UNKN, 0x7d, UNKN, UNKN, 0x80, 0x64, 0xf0, UNKN, UNKN, UNKN, // 7_ - UNKN, UNKN, UNKN, UNKN, 0x98, UNKN, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, 0x1a, UNKN, UNKN, UNKN, // 8_ - UNKN, 0x30, UNKN, UNKN, 0xc6, 0x90, UNKN, UNKN, UNKN, 0x6d, 0xee, UNKN, UNKN, UNKN, 0xe4, UNKN, // 9_ - UNKN, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0d, 0x95, UNKN, 0x8e, 0x40, UNKN, 0x20, 0xb2, UNKN, // a_ - UNKN, UNKN, UNKN, UNKN, UNKN, 0x65, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, UNKN, UNKN, 0x05, UNKN, // b_ - UNKN, UNKN, 0xba, 0x8a, UNKN, UNKN, UNKN, 0x60, 0xf8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // c_ - 0xdd, UNKN, UNKN, UNKN, 0xaa, 0xe9, 0x8d, 0xa0, UNKN, 0xb5, UNKN, 0xca, UNKN, UNKN, 0x0a, UNKN, // d_ - 0x2a, UNKN, UNKN, UNKN, 0xb0, UNKN, UNKN, 0x48, UNKN, UNKN, UNKN, UNKN, UNKN, 0x4a, 0xcd, 0x45, // e_ - UNKN, UNKN, UNKN, 0x09, UNKN, UNKN, 0xc5, UNKN, UNKN, 0x88, 0xae, UNKN, 0x86, UNKN, 0xda, 0x8c, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, UNKN, UNKN, 0xae, UNKN, 0x4e, 0xda, UNKN, UNKN, UNKN, 0x60, UNKN, UNKN, UNKN, UNKN, 0x64, // 0_ - 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x86, 0x9c, 0x88, 0xe4, 0xc4, UNKN, UNKN, 0x95, // 1_ - 0x2a, UNKN, 0xe0, UNKN, UNKN, 0x99, UNKN, UNKN, 0x90, UNKN, UNKN, UNKN, 0x6c, 0x49, UNKN, UNKN, // 2_ - 0xf0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x66, UNKN, 0x11, 0xee, UNKN, UNKN, 0x4c, // 3_ - 0xb0, UNKN, UNKN, 0x45, 0xc6, UNKN, UNKN, UNKN, UNKN, 0xcd, UNKN, UNKN, 0xc8, 0x1a, UNKN, UNKN, // 4_ - UNKN, UNKN, 0x09, 0x91, UNKN, 0xc9, 0xf8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x92, 0x20, 0xa4, // 5_ - UNKN, 0x65, UNKN, 0xe8, UNKN, 0xd8, 0x3d, UNKN, UNKN, UNKN, UNKN, UNKN, 0x80, 0xbd, 0x84, UNKN, // 6_ - UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 7_ - 0xaa, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0d, 0x18, UNKN, UNKN, UNKN, 0x8a, UNKN, UNKN, UNKN, 0x26, // 8_ - 0xc0, UNKN, UNKN, UNKN, 0x3a, 0xc5, UNKN, 0x6d, 0xe9, UNKN, 0x4a, 0xb9, UNKN, 0x05, 0x0a, UNKN, // 9_ - UNKN, 0xfa, UNKN, UNKN, UNKN, 0xd5, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x48, UNKN, // a_ - 0x10, UNKN, 0xf9, 0x5a, UNKN, 0xa2, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa9, UNKN, 0xa6, UNKN, UNKN, // b_ - 0xca, UNKN, UNKN, 0x85, UNKN, UNKN, UNKN, UNKN, UNKN, 0xb2, UNKN, UNKN, UNKN, 0x9d, UNKN, 0x7a, // c_ - UNKN, 0x79, 0xa5, UNKN, UNKN, 0xb1, UNKN, 0x8e, 0xad, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // d_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, 0x8d, UNKN, UNKN, UNKN, 0xb5, 0xce, // e_ - UNKN, UNKN, 0x38, UNKN, 0xe6, UNKN, UNKN, 0xd0, 0x69, UNKN, UNKN, 0x29, UNKN, UNKN, UNKN, UNKN, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, UNKN, 0x30, 0xb5, 0x49, 0xb0, UNKN, 0xc5, UNKN, 0x1a, UNKN, UNKN, UNKN, UNKN, 0x90, UNKN, // 0_ - UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 1_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x4a, 0x9a, UNKN, 0xfa, UNKN, UNKN, 0x5a, UNKN, 0xae, UNKN, // 2_ - UNKN, UNKN, 0xe0, UNKN, UNKN, UNKN, 0x8d, 0x0a, UNKN, UNKN, 0xed, UNKN, 0x88, UNKN, UNKN, UNKN, // 3_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xee, UNKN, UNKN, UNKN, 0xb1, UNKN, 0x9c, UNKN, 0x0d, // 4_ - 0x4c, UNKN, 0x69, UNKN, UNKN, 0xa9, UNKN, UNKN, 0x05, 0xa4, UNKN, 0x4e, UNKN, UNKN, UNKN, UNKN, // 5_ - 0xc6, UNKN, UNKN, 0xbd, 0x09, UNKN, UNKN, UNKN, UNKN, 0x20, UNKN, 0x3a, 0xc0, UNKN, UNKN, UNKN, // 6_ - 0xa0, UNKN, UNKN, UNKN, 0x80, UNKN, 0x95, UNKN, UNKN, UNKN, 0xe8, UNKN, 0xd0, UNKN, UNKN, UNKN, // 7_ - 0x60, 0xe9, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x40, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 8_ - UNKN, UNKN, 0x9d, UNKN, UNKN, UNKN, UNKN, 0xa5, UNKN, UNKN, 0xf0, UNKN, UNKN, UNKN, UNKN, UNKN, // 9_ - UNKN, 0x38, UNKN, 0xca, 0xa2, 0x8e, UNKN, 0xb9, UNKN, 0xa6, 0xcd, 0x2a, UNKN, UNKN, UNKN, UNKN, // a_ - UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, UNKN, UNKN, 0xf8, UNKN, UNKN, 0x11, 0xce, UNKN, UNKN, UNKN, // b_ - UNKN, UNKN, 0xda, UNKN, UNKN, UNKN, 0x6c, UNKN, UNKN, UNKN, UNKN, 0x8a, UNKN, UNKN, UNKN, UNKN, // c_ - UNKN, UNKN, UNKN, 0x84, UNKN, UNKN, UNKN, UNKN, 0xc9, UNKN, 0x7a, UNKN, 0x48, 0xd8, UNKN, 0x18, // d_ - 0xe6, UNKN, UNKN, 0x68, UNKN, 0x29, UNKN, UNKN, 0xc4, 0x65, UNKN, UNKN, 0xa8, UNKN, 0x85, UNKN, // e_ - UNKN, 0xc8, 0xd5, 0xe4, UNKN, 0x7d, 0x10, UNKN, UNKN, UNKN, 0x25, UNKN, UNKN, 0x1d, 0x64, UNKN, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, 0x99, 0xf0, UNKN, UNKN, UNKN, 0xae, UNKN, UNKN, UNKN, UNKN, 0x64, UNKN, UNKN, 0x2a, UNKN, // 0_ - 0xb5, UNKN, 0xa6, UNKN, UNKN, 0x65, UNKN, 0xf8, UNKN, UNKN, UNKN, 0x58, UNKN, UNKN, 0xc8, UNKN, // 1_ - 0x1a, UNKN, UNKN, UNKN, 0x09, 0x91, UNKN, 0xe0, UNKN, UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, UNKN, // 2_ - UNKN, 0xa4, 0xb0, UNKN, 0xd9, 0xe4, 0xd0, UNKN, UNKN, 0x5a, 0x2d, UNKN, UNKN, 0x4c, 0xa0, UNKN, // 3_ - 0x85, UNKN, 0x49, UNKN, UNKN, UNKN, UNKN, UNKN, 0x88, UNKN, UNKN, 0xbd, 0x69, 0x95, UNKN, UNKN, // 4_ - UNKN, 0xe9, UNKN, UNKN, UNKN, UNKN, UNKN, 0x80, 0x0d, UNKN, UNKN, 0x30, UNKN, UNKN, UNKN, 0x9d, // 5_ - UNKN, UNKN, UNKN, 0x26, UNKN, 0xd5, 0x1d, UNKN, 0x4e, UNKN, 0xe8, UNKN, UNKN, UNKN, UNKN, 0x05, // 6_ - 0xa5, UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, 0xcd, UNKN, UNKN, UNKN, UNKN, UNKN, 0x25, UNKN, UNKN, // 7_ - UNKN, UNKN, UNKN, 0xc9, UNKN, UNKN, UNKN, 0xa2, UNKN, UNKN, 0x45, UNKN, UNKN, 0xa8, UNKN, UNKN, // 8_ - 0x9a, UNKN, 0xca, UNKN, UNKN, UNKN, UNKN, UNKN, 0xe6, UNKN, UNKN, UNKN, UNKN, UNKN, 0x60, 0x8d, // 9_ - UNKN, UNKN, UNKN, UNKN, UNKN, 0xda, 0xee, 0xb2, 0x7d, UNKN, UNKN, 0x84, UNKN, UNKN, 0xaa, UNKN, // a_ - 0x90, UNKN, UNKN, 0x6d, 0xb1, UNKN, UNKN, UNKN, UNKN, 0x78, UNKN, UNKN, 0x8e, UNKN, 0xc0, 0x40, // b_ - UNKN, UNKN, 0x38, 0xc6, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd8, UNKN, UNKN, 0x0a, UNKN, UNKN, 0xb9, // c_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xfa, UNKN, UNKN, UNKN, UNKN, 0x10, 0x20, // d_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa9, UNKN, UNKN, UNKN, UNKN, 0xc5, UNKN, // e_ - UNKN, 0x86, 0x29, 0x4a, UNKN, UNKN, 0x18, 0x98, UNKN, UNKN, UNKN, 0x9c, UNKN, 0x7a, UNKN, 0x48, // f_ - }; + constexpr std::array<std::array<uint8_t,256>,4> decryption_tables{{ + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { 0xe8, 0x29, UNKN, UNKN, 0x85, UNKN, 0x18, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd5, // 0_ + UNKN, UNKN, 0xa6, 0x4c, UNKN, UNKN, 0x84, UNKN, UNKN, UNKN, 0x69, UNKN, 0x91, 0x38, 0xa8, UNKN, // 1_ + UNKN, 0x9d, 0xd8, 0x49, 0xc0, UNKN, 0x66, UNKN, UNKN, 0xe6, 0xb9, 0xad, UNKN, UNKN, UNKN, 0x10, // 2_ + UNKN, 0xd0, UNKN, 0x92, UNKN, UNKN, 0x74, UNKN, 0x9e, UNKN, UNKN, UNKN, UNKN, 0xb1, UNKN, 0x3d, // 3_ + 0xa5, 0xc4, UNKN, UNKN, UNKN, 0xce, 0x6a, 0x3a, UNKN, UNKN, UNKN, UNKN, 0xa2, UNKN, UNKN, UNKN, // 4_ + 0x9c, UNKN, UNKN, UNKN, UNKN, 0x79, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 5_ + UNKN, 0xed, UNKN, UNKN, UNKN, UNKN, 0xc9, 0x99, UNKN, 0xa9, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 6_ + UNKN, UNKN, 0xc8, UNKN, 0xe0, 0x2d, UNKN, 0x7d, UNKN, UNKN, 0x80, 0x64, 0xf0, UNKN, UNKN, UNKN, // 7_ + UNKN, UNKN, UNKN, UNKN, 0x98, UNKN, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, 0x1a, UNKN, UNKN, UNKN, // 8_ + UNKN, 0x30, UNKN, UNKN, 0xc6, 0x90, UNKN, UNKN, UNKN, 0x6d, 0xee, UNKN, UNKN, UNKN, 0xe4, UNKN, // 9_ + UNKN, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0d, 0x95, UNKN, 0x8e, 0x40, UNKN, 0x20, 0xb2, UNKN, // a_ + UNKN, UNKN, UNKN, UNKN, UNKN, 0x65, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, UNKN, UNKN, 0x05, UNKN, // b_ + UNKN, UNKN, 0xba, 0x8a, UNKN, UNKN, UNKN, 0x60, 0xf8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // c_ + 0xdd, UNKN, UNKN, UNKN, 0xaa, 0xe9, 0x8d, 0xa0, UNKN, 0xb5, UNKN, 0xca, UNKN, UNKN, 0x0a, UNKN, // d_ + 0x2a, UNKN, UNKN, UNKN, 0xb0, UNKN, UNKN, 0x48, UNKN, UNKN, UNKN, UNKN, UNKN, 0x4a, 0xcd, 0x45, // e_ + UNKN, UNKN, UNKN, 0x09, UNKN, UNKN, 0xc5, UNKN, UNKN, 0x88, 0xae, UNKN, 0x86, UNKN, 0xda, 0x8c },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, UNKN, UNKN, 0xae, UNKN, 0x4e, 0xda, UNKN, UNKN, UNKN, 0x60, UNKN, UNKN, UNKN, UNKN, 0x64, // 0_ + 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x86, 0x9c, 0x88, 0xe4, 0xc4, UNKN, UNKN, 0x95, // 1_ + 0x2a, UNKN, 0xe0, UNKN, UNKN, 0x99, UNKN, UNKN, 0x90, UNKN, UNKN, UNKN, 0x6c, 0x49, UNKN, UNKN, // 2_ + 0xf0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x66, UNKN, 0x11, 0xee, UNKN, UNKN, 0x4c, // 3_ + 0xb0, UNKN, UNKN, 0x45, 0xc6, UNKN, UNKN, UNKN, UNKN, 0xcd, UNKN, UNKN, 0xc8, 0x1a, UNKN, UNKN, // 4_ + UNKN, UNKN, 0x09, 0x91, UNKN, 0xc9, 0xf8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x92, 0x20, 0xa4, // 5_ + UNKN, 0x65, UNKN, 0xe8, UNKN, 0xd8, 0x3d, UNKN, UNKN, UNKN, UNKN, UNKN, 0x80, 0xbd, 0x84, UNKN, // 6_ + UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 7_ + 0xaa, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0d, 0x18, UNKN, UNKN, UNKN, 0x8a, UNKN, UNKN, UNKN, 0x26, // 8_ + 0xc0, UNKN, UNKN, UNKN, 0x3a, 0xc5, UNKN, 0x6d, 0xe9, UNKN, 0x4a, 0xb9, UNKN, 0x05, 0x0a, UNKN, // 9_ + UNKN, 0xfa, UNKN, UNKN, UNKN, 0xd5, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x48, UNKN, // a_ + 0x10, UNKN, 0xf9, 0x5a, UNKN, 0xa2, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa9, UNKN, 0xa6, UNKN, UNKN, // b_ + 0xca, UNKN, UNKN, 0x85, UNKN, UNKN, UNKN, UNKN, UNKN, 0xb2, UNKN, UNKN, UNKN, 0x9d, UNKN, 0x7a, // c_ + UNKN, 0x79, 0xa5, UNKN, UNKN, 0xb1, UNKN, 0x8e, 0xad, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // d_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, 0x8d, UNKN, UNKN, UNKN, 0xb5, 0xce, // e_ + UNKN, UNKN, 0x38, UNKN, 0xe6, UNKN, UNKN, 0xd0, 0x69, UNKN, UNKN, 0x29, UNKN, UNKN, UNKN, UNKN },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, UNKN, 0x30, 0xb5, 0x49, 0xb0, UNKN, 0xc5, UNKN, 0x1a, UNKN, UNKN, UNKN, UNKN, 0x90, UNKN, // 0_ + UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 1_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x4a, 0x9a, UNKN, 0xfa, UNKN, UNKN, 0x5a, UNKN, 0xae, UNKN, // 2_ + UNKN, UNKN, 0xe0, UNKN, UNKN, UNKN, 0x8d, 0x0a, UNKN, UNKN, 0xed, UNKN, 0x88, UNKN, UNKN, UNKN, // 3_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xee, UNKN, UNKN, UNKN, 0xb1, UNKN, 0x9c, UNKN, 0x0d, // 4_ + 0x4c, UNKN, 0x69, UNKN, UNKN, 0xa9, UNKN, UNKN, 0x05, 0xa4, UNKN, 0x4e, UNKN, UNKN, UNKN, UNKN, // 5_ + 0xc6, UNKN, UNKN, 0xbd, 0x09, UNKN, UNKN, UNKN, UNKN, 0x20, UNKN, 0x3a, 0xc0, UNKN, UNKN, UNKN, // 6_ + 0xa0, UNKN, UNKN, UNKN, 0x80, UNKN, 0x95, UNKN, UNKN, UNKN, 0xe8, UNKN, 0xd0, UNKN, UNKN, UNKN, // 7_ + 0x60, 0xe9, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x40, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 8_ + UNKN, UNKN, 0x9d, UNKN, UNKN, UNKN, UNKN, 0xa5, UNKN, UNKN, 0xf0, UNKN, UNKN, UNKN, UNKN, UNKN, // 9_ + UNKN, 0x38, UNKN, 0xca, 0xa2, 0x8e, UNKN, 0xb9, UNKN, 0xa6, 0xcd, 0x2a, UNKN, UNKN, UNKN, UNKN, // a_ + UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, UNKN, UNKN, 0xf8, UNKN, UNKN, 0x11, 0xce, UNKN, UNKN, UNKN, // b_ + UNKN, UNKN, 0xda, UNKN, UNKN, UNKN, 0x6c, UNKN, UNKN, UNKN, UNKN, 0x8a, UNKN, UNKN, UNKN, UNKN, // c_ + UNKN, UNKN, UNKN, 0x84, UNKN, UNKN, UNKN, UNKN, 0xc9, UNKN, 0x7a, UNKN, 0x48, 0xd8, UNKN, 0x18, // d_ + 0xe6, UNKN, UNKN, 0x68, UNKN, 0x29, UNKN, UNKN, 0xc4, 0x65, UNKN, UNKN, 0xa8, UNKN, 0x85, UNKN, // e_ + UNKN, 0xc8, 0xd5, 0xe4, UNKN, 0x7d, 0x10, UNKN, UNKN, UNKN, 0x25, UNKN, UNKN, 0x1d, 0x64, UNKN },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, 0x99, 0xf0, UNKN, UNKN, UNKN, 0xae, UNKN, UNKN, UNKN, UNKN, 0x64, UNKN, UNKN, 0x2a, UNKN, // 0_ + 0xb5, UNKN, 0xa6, UNKN, UNKN, 0x65, UNKN, 0xf8, UNKN, UNKN, UNKN, 0x58, UNKN, UNKN, 0xc8, UNKN, // 1_ + 0x1a, UNKN, UNKN, UNKN, 0x09, 0x91, UNKN, 0xe0, UNKN, UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, UNKN, // 2_ + UNKN, 0xa4, 0xb0, UNKN, 0xd9, 0xe4, 0xd0, UNKN, UNKN, 0x5a, 0x2d, UNKN, UNKN, 0x4c, 0xa0, UNKN, // 3_ + 0x85, UNKN, 0x49, UNKN, UNKN, UNKN, UNKN, UNKN, 0x88, UNKN, UNKN, 0xbd, 0x69, 0x95, UNKN, UNKN, // 4_ + UNKN, 0xe9, UNKN, UNKN, UNKN, UNKN, UNKN, 0x80, 0x0d, UNKN, UNKN, 0x30, UNKN, UNKN, UNKN, 0x9d, // 5_ + UNKN, UNKN, UNKN, 0x26, UNKN, 0xd5, 0x1d, UNKN, 0x4e, UNKN, 0xe8, UNKN, UNKN, UNKN, UNKN, 0x05, // 6_ + 0xa5, UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, 0xcd, UNKN, UNKN, UNKN, UNKN, UNKN, 0x25, UNKN, UNKN, // 7_ + UNKN, UNKN, UNKN, 0xc9, UNKN, UNKN, UNKN, 0xa2, UNKN, UNKN, 0x45, UNKN, UNKN, 0xa8, UNKN, UNKN, // 8_ + 0x9a, UNKN, 0xca, UNKN, UNKN, UNKN, UNKN, UNKN, 0xe6, UNKN, UNKN, UNKN, UNKN, UNKN, 0x60, 0x8d, // 9_ + UNKN, UNKN, UNKN, UNKN, UNKN, 0xda, 0xee, 0xb2, 0x7d, UNKN, UNKN, 0x84, UNKN, UNKN, 0xaa, UNKN, // a_ + 0x90, UNKN, UNKN, 0x6d, 0xb1, UNKN, UNKN, UNKN, UNKN, 0x78, UNKN, UNKN, 0x8e, UNKN, 0xc0, 0x40, // b_ + UNKN, UNKN, 0x38, 0xc6, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd8, UNKN, UNKN, 0x0a, UNKN, UNKN, 0xb9, // c_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xfa, UNKN, UNKN, UNKN, UNKN, 0x10, 0x20, // d_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa9, UNKN, UNKN, UNKN, UNKN, 0xc5, UNKN, // e_ + UNKN, 0x86, 0x29, 0x4a, UNKN, UNKN, 0x18, 0x98, UNKN, UNKN, UNKN, 0x9c, UNKN, 0x7a, UNKN, 0x48 } // f_ + }}; uint8_t data {_maincpu->space(AS_PROGRAM).read_byte(offset)}; return decryption_tables[offset&3][data]; @@ -3473,80 +3472,79 @@ READ8_MEMBER(megacard_state::megacard_opcode_r) constexpr uint8_t UNKN {0xfc}; - constexpr std::array<std::array<uint8_t,256>,4> decryption_tables - { - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, 0x6c, UNKN, UNKN, UNKN, 0xfa, 0x38, UNKN, UNKN, 0x4c, 0xd8, UNKN, 0xe8, UNKN, 0xc5, UNKN, // 0_ - UNKN, 0xa6, 0x91, UNKN, UNKN, UNKN, UNKN, 0x58, 0xa0, 0xe0, 0xb9, 0x4e, UNKN, UNKN, UNKN, 0x78, // 1_ - 0xe9, 0xee, UNKN, 0xca, 0x85, UNKN, 0xe6, UNKN, UNKN, UNKN, 0xcd, UNKN, UNKN, UNKN, UNKN, UNKN, // 2_ - UNKN, UNKN, UNKN, UNKN, 0x90, UNKN, UNKN, 0x64, UNKN, UNKN, 0x45, 0x60, UNKN, UNKN, 0x69, UNKN, // 3_ - UNKN, UNKN, 0xea, 0xf8, 0x7a, UNKN, UNKN, 0x1a, UNKN, UNKN, UNKN, UNKN, UNKN, 0xb1, UNKN, 0x80, // 4_ - UNKN, UNKN, 0x84, UNKN, UNKN, UNKN, UNKN, 0x49, UNKN, UNKN, 0x7c, UNKN, 0x20, 0x8a, 0xed, UNKN, // 5_ - 0x8c, UNKN, UNKN, UNKN, 0x5a, UNKN, UNKN, UNKN, 0xa8, 0xa9, UNKN, 0x6d, 0xc9, 0x95, UNKN, 0xda, // 6_ - 0xaa, 0xe4, UNKN, UNKN, UNKN, UNKN, 0x8e, 0xae, 0x3a, 0xc0, UNKN, 0xd5, 0x92, UNKN, UNKN, UNKN, // 7_ - 0xc6, UNKN, UNKN, UNKN, UNKN, UNKN, 0x48, UNKN, UNKN, 0x86, 0x9c, UNKN, UNKN, 0xc8, UNKN, UNKN, // 8_ - UNKN, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd0, 0xa2, UNKN, UNKN, UNKN, UNKN, 0x25, UNKN, 0xa5, // 9_ - UNKN, 0x9d, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, // a_ - UNKN, UNKN, UNKN, 0xb2, UNKN, 0x29, UNKN, 0x09, UNKN, UNKN, UNKN, 0xb0, UNKN, UNKN, 0xb5, UNKN, // b_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0a, UNKN, UNKN, 0x7d, UNKN, 0xf0, UNKN, 0x00, // c_ - UNKN, UNKN, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, 0x4a, 0x88, 0x05, UNKN, UNKN, 0x10, 0xce, UNKN, // d_ - UNKN, UNKN, 0xc4, UNKN, 0x18, UNKN, UNKN, UNKN, 0x99, 0xf9, UNKN, UNKN, UNKN, UNKN, UNKN, 0xdd, // e_ - 0x11, UNKN, 0x26, UNKN, 0x65, 0x98, UNKN, 0xad, 0x2a, UNKN, UNKN, 0x8d, UNKN, UNKN, UNKN, UNKN, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, UNKN, UNKN, 0x18, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, 0xcd, 0x0a, // 0_ - 0xe6, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, UNKN, // 1_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x69, UNKN, 0xd0, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2d, UNKN, // 2_ - UNKN, 0x88, UNKN, UNKN, UNKN, 0x98, UNKN, 0x99, UNKN, 0xb1, UNKN, UNKN, 0x9c, 0x1a, UNKN, UNKN, // 3_ - UNKN, 0x7a, 0xae, 0xa2, 0xca, 0xba, UNKN, 0x25, UNKN, UNKN, 0x10, UNKN, 0xea, 0x79, 0x8a, UNKN, // 4_ - UNKN, 0x60, UNKN, UNKN, UNKN, UNKN, 0x84, 0xd8, 0xa9, UNKN, UNKN, UNKN, 0xe9, UNKN, 0xda, UNKN, // 5_ - 0xc0, UNKN, UNKN, 0x3d, 0x8d, UNKN, UNKN, UNKN, UNKN, 0x68, UNKN, 0x92, UNKN, 0x48, UNKN, UNKN, // 6_ - 0x9d, 0x49, 0x95, 0xc6, 0xb0, UNKN, 0x40, UNKN, UNKN, UNKN, 0x05, UNKN, UNKN, UNKN, UNKN, UNKN, // 7_ - UNKN, 0x0d, UNKN, UNKN, UNKN, UNKN, 0xa4, UNKN, UNKN, 0x30, UNKN, 0x66, UNKN, UNKN, 0xa5, UNKN, // 8_ - 0x64, UNKN, 0x29, UNKN, UNKN, 0x86, UNKN, 0xb2, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2a, 0x6d, 0x3a, // 9_ - 0x38, UNKN, UNKN, 0x91, UNKN, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd5, UNKN, // a_ - UNKN, UNKN, UNKN, UNKN, 0xb5, 0xf8, UNKN, UNKN, UNKN, 0xc5, UNKN, UNKN, UNKN, 0x09, UNKN, UNKN, // b_ - UNKN, UNKN, UNKN, UNKN, 0x11, 0x90, 0x4c, UNKN, 0x85, UNKN, UNKN, UNKN, 0x4a, UNKN, UNKN, UNKN, // c_ - UNKN, UNKN, 0x20, 0xb9, UNKN, UNKN, UNKN, UNKN, 0x00, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // d_ - UNKN, 0x80, 0x65, UNKN, UNKN, 0xe8, 0xc9, UNKN, UNKN, UNKN, UNKN, UNKN, 0xee, 0xf0, UNKN, UNKN, // e_ - UNKN, 0xa0, 0xc8, UNKN, UNKN, UNKN, 0xc4, UNKN, 0x4e, 0xe0, 0xa8, UNKN, 0x45, UNKN, UNKN, 0xa6, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, 0x86, UNKN, UNKN, 0xe6, 0xc9, UNKN, 0x1a, UNKN, 0xdd, 0x88, UNKN, UNKN, UNKN, UNKN, 0x8e, // 0_ - UNKN, 0xe0, UNKN, UNKN, 0x4c, 0xd0, UNKN, 0x64, UNKN, 0xa4, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 1_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xee, UNKN, 0x74, UNKN, 0xa0, UNKN, 0xed, UNKN, 0xe9, // 2_ - UNKN, 0xd9, UNKN, UNKN, UNKN, UNKN, 0x0a, UNKN, 0x49, UNKN, 0x1d, 0xa2, UNKN, 0x8d, UNKN, 0x00, // 3_ - 0xa9, UNKN, UNKN, 0xea, UNKN, UNKN, UNKN, UNKN, UNKN, 0xf0, 0xfa, UNKN, UNKN, UNKN, UNKN, 0x84, // 4_ - UNKN, UNKN, 0x38, UNKN, 0xbd, UNKN, 0x9d, 0x92, 0xb1, UNKN, 0x95, UNKN, 0xe8, 0x45, UNKN, UNKN, // 5_ - UNKN, UNKN, 0xb5, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x85, UNKN, UNKN, // 6_ - UNKN, UNKN, UNKN, UNKN, 0xa6, 0xa5, 0xe4, 0x09, UNKN, 0x29, UNKN, 0x5a, 0x90, UNKN, 0xc0, UNKN, // 7_ - 0xca, UNKN, UNKN, UNKN, 0x18, UNKN, UNKN, UNKN, UNKN, 0x66, UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, // 8_ - 0x98, 0xb0, 0x26, 0xc4, UNKN, 0x2d, UNKN, UNKN, UNKN, UNKN, 0xc6, UNKN, UNKN, UNKN, 0xd8, UNKN, // 9_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x3d, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, UNKN, // a_ - 0xce, 0x10, UNKN, 0x05, 0x80, 0x48, UNKN, UNKN, UNKN, 0xf8, 0x0d, UNKN, UNKN, UNKN, UNKN, UNKN, // b_ - UNKN, UNKN, UNKN, UNKN, 0x91, 0xc5, UNKN, UNKN, UNKN, 0x9c, UNKN, 0x30, 0xc8, UNKN, UNKN, UNKN, // c_ - 0x69, 0x60, 0x9a, 0xb2, UNKN, UNKN, 0x2a, UNKN, 0x65, UNKN, UNKN, UNKN, 0x25, UNKN, 0x79, 0x6a, // d_ - UNKN, 0x20, 0xb9, UNKN, 0x3a, 0xd5, UNKN, 0x4a, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x99, 0xa8, // e_ - UNKN, UNKN, UNKN, UNKN, 0xda, UNKN, UNKN, UNKN, UNKN, 0xcd, UNKN, 0x7a, 0xad, UNKN, UNKN, UNKN, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, UNKN, UNKN, 0x60, UNKN, UNKN, 0xb1, UNKN, UNKN, UNKN, 0x29, UNKN, 0x8e, 0x74, 0x9a, 0xea, // 0_ - UNKN, 0x6d, UNKN, 0x92, 0xb5, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x7d, 0xb9, 0xa2, UNKN, 0x6a, // 1_ - UNKN, UNKN, UNKN, 0xb0, 0xc4, UNKN, UNKN, 0x2d, UNKN, 0x79, 0x8a, UNKN, UNKN, UNKN, 0xa0, UNKN, // 2_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, 0x1a, UNKN, 0xaa, 0x80, UNKN, UNKN, // 3_ - UNKN, UNKN, 0x10, UNKN, 0x3a, UNKN, UNKN, UNKN, 0x8d, UNKN, UNKN, UNKN, UNKN, 0xf8, UNKN, 0x25, // 4_ - UNKN, UNKN, 0x40, UNKN, 0x85, UNKN, 0x95, UNKN, UNKN, 0xcd, UNKN, UNKN, 0x4c, 0x98, UNKN, UNKN, // 5_ - UNKN, 0x68, UNKN, 0xe9, 0x9e, 0x09, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x5a, 0xee, // 6_ - UNKN, 0x86, UNKN, UNKN, UNKN, 0xd5, UNKN, 0xa5, 0x65, UNKN, UNKN, UNKN, UNKN, 0x4e, 0xe0, 0x90, // 7_ - UNKN, UNKN, 0xc0, 0xce, UNKN, UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, 0x88, UNKN, UNKN, UNKN, UNKN, // 8_ - UNKN, 0xda, UNKN, UNKN, UNKN, 0xb2, UNKN, 0x7a, UNKN, UNKN, UNKN, UNKN, 0x91, UNKN, UNKN, 0xc5, // 9_ - UNKN, UNKN, 0x05, 0xe6, UNKN, UNKN, 0x49, UNKN, UNKN, 0x0d, 0x9d, 0x4a, UNKN, UNKN, 0xc8, UNKN, // a_ - UNKN, UNKN, UNKN, UNKN, 0x20, UNKN, 0x1d, UNKN, UNKN, 0xd0, UNKN, UNKN, 0xfa, UNKN, 0xbd, UNKN, // b_ - UNKN, UNKN, UNKN, UNKN, 0x2a, UNKN, UNKN, 0x0a, UNKN, UNKN, 0xca, UNKN, 0x9c, 0x69, UNKN, UNKN, // c_ - 0x00, 0xd8, 0x38, UNKN, UNKN, UNKN, 0xa6, UNKN, UNKN, UNKN, 0xc6, UNKN, UNKN, UNKN, UNKN, UNKN, // d_ - UNKN, 0xc9, UNKN, UNKN, UNKN, UNKN, 0x64, 0x48, UNKN, UNKN, 0xa8, UNKN, 0xe8, UNKN, UNKN, UNKN, // e_ - UNKN, UNKN, 0xa9, UNKN, 0xf0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x18, UNKN, UNKN, UNKN, UNKN, // f_ - }; + constexpr std::array<std::array<uint8_t,256>,4> decryption_tables{{ + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, 0x6c, UNKN, UNKN, UNKN, 0xfa, 0x38, UNKN, UNKN, 0x4c, 0xd8, UNKN, 0xe8, UNKN, 0xc5, UNKN, // 0_ + UNKN, 0xa6, 0x91, UNKN, UNKN, UNKN, UNKN, 0x58, 0xa0, 0xe0, 0xb9, 0x4e, UNKN, UNKN, UNKN, 0x78, // 1_ + 0xe9, 0xee, UNKN, 0xca, 0x85, UNKN, 0xe6, UNKN, UNKN, UNKN, 0xcd, UNKN, UNKN, UNKN, UNKN, UNKN, // 2_ + UNKN, UNKN, UNKN, UNKN, 0x90, UNKN, UNKN, 0x64, UNKN, UNKN, 0x45, 0x60, UNKN, UNKN, 0x69, UNKN, // 3_ + UNKN, UNKN, 0xea, 0xf8, 0x7a, UNKN, UNKN, 0x1a, UNKN, UNKN, UNKN, UNKN, UNKN, 0xb1, UNKN, 0x80, // 4_ + UNKN, UNKN, 0x84, UNKN, UNKN, UNKN, UNKN, 0x49, UNKN, UNKN, 0x7c, UNKN, 0x20, 0x8a, 0xed, UNKN, // 5_ + 0x8c, UNKN, UNKN, UNKN, 0x5a, UNKN, UNKN, UNKN, 0xa8, 0xa9, UNKN, 0x6d, 0xc9, 0x95, UNKN, 0xda, // 6_ + 0xaa, 0xe4, UNKN, UNKN, UNKN, UNKN, 0x8e, 0xae, 0x3a, 0xc0, UNKN, 0xd5, 0x92, UNKN, UNKN, UNKN, // 7_ + 0xc6, UNKN, UNKN, UNKN, UNKN, UNKN, 0x48, UNKN, UNKN, 0x86, 0x9c, UNKN, UNKN, 0xc8, UNKN, UNKN, // 8_ + UNKN, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd0, 0xa2, UNKN, UNKN, UNKN, UNKN, 0x25, UNKN, 0xa5, // 9_ + UNKN, 0x9d, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, // a_ + UNKN, UNKN, UNKN, 0xb2, UNKN, 0x29, UNKN, 0x09, UNKN, UNKN, UNKN, 0xb0, UNKN, UNKN, 0xb5, UNKN, // b_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0a, UNKN, UNKN, 0x7d, UNKN, 0xf0, UNKN, 0x00, // c_ + UNKN, UNKN, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, 0x4a, 0x88, 0x05, UNKN, UNKN, 0x10, 0xce, UNKN, // d_ + UNKN, UNKN, 0xc4, UNKN, 0x18, UNKN, UNKN, UNKN, 0x99, 0xf9, UNKN, UNKN, UNKN, UNKN, UNKN, 0xdd, // e_ + 0x11, UNKN, 0x26, UNKN, 0x65, 0x98, UNKN, 0xad, 0x2a, UNKN, UNKN, 0x8d, UNKN, UNKN, UNKN, UNKN },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, UNKN, UNKN, 0x18, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, 0xcd, 0x0a, // 0_ + 0xe6, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, UNKN, // 1_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x69, UNKN, 0xd0, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2d, UNKN, // 2_ + UNKN, 0x88, UNKN, UNKN, UNKN, 0x98, UNKN, 0x99, UNKN, 0xb1, UNKN, UNKN, 0x9c, 0x1a, UNKN, UNKN, // 3_ + UNKN, 0x7a, 0xae, 0xa2, 0xca, 0xba, UNKN, 0x25, UNKN, UNKN, 0x10, UNKN, 0xea, 0x79, 0x8a, UNKN, // 4_ + UNKN, 0x60, UNKN, UNKN, UNKN, UNKN, 0x84, 0xd8, 0xa9, UNKN, UNKN, UNKN, 0xe9, UNKN, 0xda, UNKN, // 5_ + 0xc0, UNKN, UNKN, 0x3d, 0x8d, UNKN, UNKN, UNKN, UNKN, 0x68, UNKN, 0x92, UNKN, 0x48, UNKN, UNKN, // 6_ + 0x9d, 0x49, 0x95, 0xc6, 0xb0, UNKN, 0x40, UNKN, UNKN, UNKN, 0x05, UNKN, UNKN, UNKN, UNKN, UNKN, // 7_ + UNKN, 0x0d, UNKN, UNKN, UNKN, UNKN, 0xa4, UNKN, UNKN, 0x30, UNKN, 0x66, UNKN, UNKN, 0xa5, UNKN, // 8_ + 0x64, UNKN, 0x29, UNKN, UNKN, 0x86, UNKN, 0xb2, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2a, 0x6d, 0x3a, // 9_ + 0x38, UNKN, UNKN, 0x91, UNKN, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd5, UNKN, // a_ + UNKN, UNKN, UNKN, UNKN, 0xb5, 0xf8, UNKN, UNKN, UNKN, 0xc5, UNKN, UNKN, UNKN, 0x09, UNKN, UNKN, // b_ + UNKN, UNKN, UNKN, UNKN, 0x11, 0x90, 0x4c, UNKN, 0x85, UNKN, UNKN, UNKN, 0x4a, UNKN, UNKN, UNKN, // c_ + UNKN, UNKN, 0x20, 0xb9, UNKN, UNKN, UNKN, UNKN, 0x00, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // d_ + UNKN, 0x80, 0x65, UNKN, UNKN, 0xe8, 0xc9, UNKN, UNKN, UNKN, UNKN, UNKN, 0xee, 0xf0, UNKN, UNKN, // e_ + UNKN, 0xa0, 0xc8, UNKN, UNKN, UNKN, 0xc4, UNKN, 0x4e, 0xe0, 0xa8, UNKN, 0x45, UNKN, UNKN, 0xa6 },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, 0x86, UNKN, UNKN, 0xe6, 0xc9, UNKN, 0x1a, UNKN, 0xdd, 0x88, UNKN, UNKN, UNKN, UNKN, 0x8e, // 0_ + UNKN, 0xe0, UNKN, UNKN, 0x4c, 0xd0, UNKN, 0x64, UNKN, 0xa4, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 1_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xee, UNKN, 0x74, UNKN, 0xa0, UNKN, 0xed, UNKN, 0xe9, // 2_ + UNKN, 0xd9, UNKN, UNKN, UNKN, UNKN, 0x0a, UNKN, 0x49, UNKN, 0x1d, 0xa2, UNKN, 0x8d, UNKN, 0x00, // 3_ + 0xa9, UNKN, UNKN, 0xea, UNKN, UNKN, UNKN, UNKN, UNKN, 0xf0, 0xfa, UNKN, UNKN, UNKN, UNKN, 0x84, // 4_ + UNKN, UNKN, 0x38, UNKN, 0xbd, UNKN, 0x9d, 0x92, 0xb1, UNKN, 0x95, UNKN, 0xe8, 0x45, UNKN, UNKN, // 5_ + UNKN, UNKN, 0xb5, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x85, UNKN, UNKN, // 6_ + UNKN, UNKN, UNKN, UNKN, 0xa6, 0xa5, 0xe4, 0x09, UNKN, 0x29, UNKN, 0x5a, 0x90, UNKN, 0xc0, UNKN, // 7_ + 0xca, UNKN, UNKN, UNKN, 0x18, UNKN, UNKN, UNKN, UNKN, 0x66, UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, // 8_ + 0x98, 0xb0, 0x26, 0xc4, UNKN, 0x2d, UNKN, UNKN, UNKN, UNKN, 0xc6, UNKN, UNKN, UNKN, 0xd8, UNKN, // 9_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x3d, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, UNKN, // a_ + 0xce, 0x10, UNKN, 0x05, 0x80, 0x48, UNKN, UNKN, UNKN, 0xf8, 0x0d, UNKN, UNKN, UNKN, UNKN, UNKN, // b_ + UNKN, UNKN, UNKN, UNKN, 0x91, 0xc5, UNKN, UNKN, UNKN, 0x9c, UNKN, 0x30, 0xc8, UNKN, UNKN, UNKN, // c_ + 0x69, 0x60, 0x9a, 0xb2, UNKN, UNKN, 0x2a, UNKN, 0x65, UNKN, UNKN, UNKN, 0x25, UNKN, 0x79, 0x6a, // d_ + UNKN, 0x20, 0xb9, UNKN, 0x3a, 0xd5, UNKN, 0x4a, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x99, 0xa8, // e_ + UNKN, UNKN, UNKN, UNKN, 0xda, UNKN, UNKN, UNKN, UNKN, 0xcd, UNKN, 0x7a, 0xad, UNKN, UNKN, UNKN },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, UNKN, UNKN, 0x60, UNKN, UNKN, 0xb1, UNKN, UNKN, UNKN, 0x29, UNKN, 0x8e, 0x74, 0x9a, 0xea, // 0_ + UNKN, 0x6d, UNKN, 0x92, 0xb5, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x7d, 0xb9, 0xa2, UNKN, 0x6a, // 1_ + UNKN, UNKN, UNKN, 0xb0, 0xc4, UNKN, UNKN, 0x2d, UNKN, 0x79, 0x8a, UNKN, UNKN, UNKN, 0xa0, UNKN, // 2_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, 0x1a, UNKN, 0xaa, 0x80, UNKN, UNKN, // 3_ + UNKN, UNKN, 0x10, UNKN, 0x3a, UNKN, UNKN, UNKN, 0x8d, UNKN, UNKN, UNKN, UNKN, 0xf8, UNKN, 0x25, // 4_ + UNKN, UNKN, 0x40, UNKN, 0x85, UNKN, 0x95, UNKN, UNKN, 0xcd, UNKN, UNKN, 0x4c, 0x98, UNKN, UNKN, // 5_ + UNKN, 0x68, UNKN, 0xe9, 0x9e, 0x09, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x5a, 0xee, // 6_ + UNKN, 0x86, UNKN, UNKN, UNKN, 0xd5, UNKN, 0xa5, 0x65, UNKN, UNKN, UNKN, UNKN, 0x4e, 0xe0, 0x90, // 7_ + UNKN, UNKN, 0xc0, 0xce, UNKN, UNKN, UNKN, 0xad, UNKN, UNKN, UNKN, 0x88, UNKN, UNKN, UNKN, UNKN, // 8_ + UNKN, 0xda, UNKN, UNKN, UNKN, 0xb2, UNKN, 0x7a, UNKN, UNKN, UNKN, UNKN, 0x91, UNKN, UNKN, 0xc5, // 9_ + UNKN, UNKN, 0x05, 0xe6, UNKN, UNKN, 0x49, UNKN, UNKN, 0x0d, 0x9d, 0x4a, UNKN, UNKN, 0xc8, UNKN, // a_ + UNKN, UNKN, UNKN, UNKN, 0x20, UNKN, 0x1d, UNKN, UNKN, 0xd0, UNKN, UNKN, 0xfa, UNKN, 0xbd, UNKN, // b_ + UNKN, UNKN, UNKN, UNKN, 0x2a, UNKN, UNKN, 0x0a, UNKN, UNKN, 0xca, UNKN, 0x9c, 0x69, UNKN, UNKN, // c_ + 0x00, 0xd8, 0x38, UNKN, UNKN, UNKN, 0xa6, UNKN, UNKN, UNKN, 0xc6, UNKN, UNKN, UNKN, UNKN, UNKN, // d_ + UNKN, 0xc9, UNKN, UNKN, UNKN, UNKN, 0x64, 0x48, UNKN, UNKN, 0xa8, UNKN, 0xe8, UNKN, UNKN, UNKN, // e_ + UNKN, UNKN, 0xa9, UNKN, 0xf0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x18, UNKN, UNKN, UNKN, UNKN } // f_ + }}; uint8_t data {_maincpu->space(AS_PROGRAM).read_byte(offset)}; return decryption_tables[offset&3][data]; @@ -3623,80 +3621,79 @@ READ8_MEMBER(jokercrd_state::jokercrd_opcode_r) constexpr uint8_t UNKN {0xfc}; - constexpr std::array<std::array<uint8_t,256>,4> decryption_tables - { - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, UNKN, UNKN, 0x3d, 0xe0, UNKN, UNKN, 0xb0, UNKN, 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 0_ - UNKN, UNKN, 0x4a, 0x65, 0x18, 0x64, 0xad, UNKN, 0x90, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 1_ - UNKN, UNKN, 0x49, UNKN, 0xa8, 0x8c, 0x20, UNKN, UNKN, 0xf8, UNKN, UNKN, 0xe6, UNKN, 0x88, UNKN, // 2_ - UNKN, UNKN, UNKN, UNKN, 0xb2, UNKN, UNKN, UNKN, UNKN, 0x58, 0x38, 0x45, UNKN, UNKN, UNKN, UNKN, // 3_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd5, 0xa5, 0xa9, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 4_ - UNKN, UNKN, UNKN, UNKN, 0xda, 0xa2, UNKN, 0x4e, 0x1a, UNKN, 0xe4, UNKN, UNKN, UNKN, 0x0c, 0x98, // 5_ - 0xa6, UNKN, UNKN, UNKN, 0x9c, 0xfa, UNKN, 0xbd, UNKN, 0xae, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 6_ - UNKN, UNKN, 0xc0, 0xc5, UNKN, UNKN, UNKN, UNKN, UNKN, 0xcd, UNKN, UNKN, UNKN, 0x8a, UNKN, 0x80, // 7_ - UNKN, UNKN, 0x95, UNKN, UNKN, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, // 8_ - 0xb1, UNKN, UNKN, UNKN, UNKN, 0xd0, 0x0d, 0xc9, UNKN, UNKN, UNKN, UNKN, 0x29, 0x3a, 0xc8, 0x8d, // 9_ - 0xc6, 0xee, 0x25, UNKN, 0x05, 0x6e, UNKN, 0x2a, UNKN, 0x85, UNKN, UNKN, 0xd8, UNKN, 0xce, UNKN, // a_ - UNKN, UNKN, UNKN, 0xe9, 0xc4, 0xe8, UNKN, UNKN, 0x99, 0x6a, 0x0a, UNKN, 0x84, UNKN, UNKN, UNKN, // b_ - UNKN, UNKN, UNKN, 0x9d, 0x2d, 0x10, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, UNKN, 0x11, UNKN, // c_ - UNKN, 0xb9, 0x86, UNKN, 0xca, UNKN, UNKN, UNKN, UNKN, UNKN, 0x7a, UNKN, 0xf0, 0x09, 0x4c, UNKN, // d_ - 0x60, 0x78, UNKN, UNKN, UNKN, 0x48, 0x5a, UNKN, UNKN, UNKN, 0x79, UNKN, UNKN, UNKN, UNKN, 0xba, // e_ - UNKN, UNKN, 0x6d, 0x92, UNKN, 0x26, UNKN, UNKN, 0xb5, UNKN, 0x69, UNKN, UNKN, 0xa4, UNKN, 0x1d, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, UNKN, UNKN, UNKN, 0x48, UNKN, UNKN, 0x0c, UNKN, 0x60, 0x6d, 0x20, 0xda, UNKN, 0xf0, UNKN, // 0_ - UNKN, 0xcd, 0x95, UNKN, UNKN, 0xae, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x8e, UNKN, 0x29, UNKN, // 1_ - 0x90, UNKN, UNKN, UNKN, 0x69, 0xb5, UNKN, UNKN, UNKN, UNKN, 0xd0, 0xad, UNKN, UNKN, UNKN, 0x9a, // 2_ - 0xb6, 0x40, UNKN, 0xd5, 0xfa, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, UNKN, 0x88, UNKN, // 3_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2a, UNKN, UNKN, UNKN, 0xa2, UNKN, UNKN, UNKN, UNKN, UNKN, // 4_ - 0xee, UNKN, UNKN, UNKN, 0x64, UNKN, 0xb0, 0x9d, UNKN, UNKN, UNKN, 0x80, UNKN, 0xf8, 0xe8, UNKN, // 5_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x91, UNKN, 0xb9, 0x8a, UNKN, UNKN, UNKN, 0x10, UNKN, // 6_ - 0x4a, UNKN, UNKN, 0xc8, 0x9c, 0x4e, UNKN, UNKN, UNKN, UNKN, 0xb2, 0x85, 0x45, 0xc9, UNKN, UNKN, // 7_ - 0x1a, UNKN, UNKN, 0xe9, UNKN, UNKN, UNKN, UNKN, UNKN, 0xca, UNKN, 0xc6, UNKN, 0xb1, UNKN, UNKN, // 8_ - 0x1d, UNKN, 0xa8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xc5, // 9_ - 0xe0, UNKN, 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x30, UNKN, 0x0d, UNKN, 0x8d, // a_ - UNKN, 0x86, UNKN, UNKN, 0xd9, 0xbd, UNKN, UNKN, 0x05, 0xaa, UNKN, 0x38, UNKN, 0x18, 0xe4, UNKN, // b_ - UNKN, 0xa6, UNKN, 0xa5, 0xc0, 0x2d, UNKN, UNKN, UNKN, UNKN, UNKN, 0x4c, 0x84, UNKN, 0x6e, UNKN, // c_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x19, 0x65, UNKN, UNKN, UNKN, 0xce, 0x7a, UNKN, 0x3a, // d_ - UNKN, 0x7d, UNKN, 0x0a, 0x49, UNKN, UNKN, UNKN, 0xe6, 0xd8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // e_ - UNKN, UNKN, UNKN, UNKN, 0x09, 0xa9, 0x25, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x5a, UNKN, 0x68, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - UNKN, 0x20, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, UNKN, 0xb0, 0x85, 0x3d, UNKN, 0x86, UNKN, UNKN, // 0_ - 0x18, UNKN, UNKN, UNKN, 0x8a, 0xad, 0x79, 0x98, UNKN, UNKN, 0xc0, UNKN, 0x30, UNKN, 0x10, UNKN, // 1_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xe4, UNKN, UNKN, UNKN, 0x29, UNKN, UNKN, UNKN, UNKN, // 2_ - 0x9e, 0x6d, 0xa6, UNKN, 0xc9, 0x6e, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 3_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, 0x9c, 0x09, UNKN, UNKN, UNKN, 0xfa, UNKN, // 4_ - UNKN, 0x69, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, UNKN, UNKN, 0xc4, UNKN, 0x1a, 0x4c, 0x5a, UNKN, // 5_ - UNKN, UNKN, 0xe9, UNKN, 0xb1, UNKN, 0x0c, 0xee, 0xda, 0xb2, 0xce, UNKN, 0x74, UNKN, UNKN, UNKN, // 6_ - 0x7d, 0x0d, 0x48, UNKN, UNKN, UNKN, 0xf8, 0xd8, UNKN, UNKN, 0x0a, UNKN, UNKN, 0x45, 0xc6, UNKN, // 7_ - UNKN, UNKN, UNKN, UNKN, UNKN, 0x26, UNKN, UNKN, UNKN, 0xc5, UNKN, UNKN, UNKN, 0xae, UNKN, UNKN, // 8_ - 0xa9, UNKN, 0x90, 0x3a, UNKN, UNKN, 0x6c, UNKN, 0x64, UNKN, UNKN, 0xd5, UNKN, UNKN, UNKN, UNKN, // 9_ - UNKN, 0x7a, UNKN, 0x05, 0xa8, UNKN, UNKN, 0x60, UNKN, UNKN, 0xa4, 0x8d, 0x2a, UNKN, UNKN, UNKN, // a_ - UNKN, UNKN, UNKN, UNKN, 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x92, 0x66, // b_ - UNKN, UNKN, 0xd0, 0xf0, UNKN, UNKN, 0x38, 0xbd, 0xa2, UNKN, 0xed, 0x9d, 0x80, UNKN, 0xa5, UNKN, // c_ - UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x99, UNKN, 0x88, UNKN, 0xcd, UNKN, 0xe8, // d_ - 0xca, 0xb5, 0x49, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xe6, 0xe0, 0x4a, UNKN, // e_ - UNKN, UNKN, UNKN, 0xc8, UNKN, 0xb9, 0x91, UNKN, UNKN, UNKN, UNKN, 0x65, 0x95, UNKN, UNKN, UNKN, // f_ - - //_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f - 0x65, UNKN, UNKN, UNKN, 0x30, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, 0xda, 0x2d, 0xc4, UNKN, 0x68, // 0_ - UNKN, 0xa2, UNKN, UNKN, 0x2a, 0xa6, UNKN, UNKN, UNKN, 0x86, UNKN, UNKN, 0x60, UNKN, 0xe6, 0xa4, // 1_ - UNKN, 0x84, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, UNKN, UNKN, 0xce, 0xe4, 0xf8, 0xa0, UNKN, 0x8d, // 2_ - UNKN, 0xcd, UNKN, UNKN, UNKN, 0x88, 0x4a, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 3_ - 0xd8, UNKN, UNKN, UNKN, 0x40, 0x11, UNKN, UNKN, 0xaa, 0x79, UNKN, 0x98, UNKN, 0x85, UNKN, UNKN, // 4_ - 0x9a, 0xc6, UNKN, UNKN, 0x74, UNKN, UNKN, UNKN, UNKN, 0x95, 0xdd, UNKN, UNKN, 0x6d, UNKN, UNKN, // 5_ - 0x8a, 0x6e, UNKN, UNKN, 0x18, 0xc5, UNKN, 0xf9, UNKN, 0xb0, 0x7a, UNKN, UNKN, UNKN, UNKN, 0xc0, // 6_ - 0x99, UNKN, UNKN, 0x10, 0x90, 0x38, 0x09, UNKN, UNKN, UNKN, 0xe0, UNKN, UNKN, UNKN, UNKN, UNKN, // 7_ - UNKN, UNKN, UNKN, 0xb5, UNKN, 0x4c, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xfa, UNKN, UNKN, // 8_ - UNKN, UNKN, 0x6a, 0x29, UNKN, UNKN, 0x5a, 0xae, UNKN, 0x3a, UNKN, 0x9c, UNKN, 0x0d, 0x49, 0xee, // 9_ - UNKN, UNKN, UNKN, UNKN, 0xa5, 0x69, 0xf0, UNKN, 0x80, UNKN, 0xc8, UNKN, UNKN, UNKN, 0xb9, UNKN, // a_ - 0x1a, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0c, UNKN, UNKN, UNKN, UNKN, UNKN, // b_ - UNKN, UNKN, UNKN, UNKN, 0x64, UNKN, UNKN, 0xb2, 0x9d, UNKN, UNKN, 0xca, UNKN, UNKN, 0x0a, 0x05, // c_ - UNKN, UNKN, UNKN, 0x91, UNKN, UNKN, UNKN, 0x92, UNKN, UNKN, UNKN, 0xed, UNKN, UNKN, UNKN, UNKN, // d_ - UNKN, 0xec, 0x20, UNKN, 0xad, 0xd0, UNKN, 0x3d, UNKN, 0xb1, 0x6c, 0x66, UNKN, 0x4e, UNKN, 0xd5, // e_ - 0xe9, UNKN, UNKN, 0xa9, UNKN, UNKN, 0xe8, UNKN, UNKN, 0xc9, 0xa8, UNKN, UNKN, 0x48, UNKN, UNKN, // f_ - }; + constexpr std::array<std::array<uint8_t,256>,4> decryption_tables{{ + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, UNKN, UNKN, 0x3d, 0xe0, UNKN, UNKN, 0xb0, UNKN, 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 0_ + UNKN, UNKN, 0x4a, 0x65, 0x18, 0x64, 0xad, UNKN, 0x90, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 1_ + UNKN, UNKN, 0x49, UNKN, 0xa8, 0x8c, 0x20, UNKN, UNKN, 0xf8, UNKN, UNKN, 0xe6, UNKN, 0x88, UNKN, // 2_ + UNKN, UNKN, UNKN, UNKN, 0xb2, UNKN, UNKN, UNKN, UNKN, 0x58, 0x38, 0x45, UNKN, UNKN, UNKN, UNKN, // 3_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xd5, 0xa5, 0xa9, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 4_ + UNKN, UNKN, UNKN, UNKN, 0xda, 0xa2, UNKN, 0x4e, 0x1a, UNKN, 0xe4, UNKN, UNKN, UNKN, 0x0c, 0x98, // 5_ + 0xa6, UNKN, UNKN, UNKN, 0x9c, 0xfa, UNKN, 0xbd, UNKN, 0xae, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 6_ + UNKN, UNKN, 0xc0, 0xc5, UNKN, UNKN, UNKN, UNKN, UNKN, 0xcd, UNKN, UNKN, UNKN, 0x8a, UNKN, 0x80, // 7_ + UNKN, UNKN, 0x95, UNKN, UNKN, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, UNKN, UNKN, 0x68, UNKN, UNKN, // 8_ + 0xb1, UNKN, UNKN, UNKN, UNKN, 0xd0, 0x0d, 0xc9, UNKN, UNKN, UNKN, UNKN, 0x29, 0x3a, 0xc8, 0x8d, // 9_ + 0xc6, 0xee, 0x25, UNKN, 0x05, 0x6e, UNKN, 0x2a, UNKN, 0x85, UNKN, UNKN, 0xd8, UNKN, 0xce, UNKN, // a_ + UNKN, UNKN, UNKN, 0xe9, 0xc4, 0xe8, UNKN, UNKN, 0x99, 0x6a, 0x0a, UNKN, 0x84, UNKN, UNKN, UNKN, // b_ + UNKN, UNKN, UNKN, 0x9d, 0x2d, 0x10, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, UNKN, 0x11, UNKN, // c_ + UNKN, 0xb9, 0x86, UNKN, 0xca, UNKN, UNKN, UNKN, UNKN, UNKN, 0x7a, UNKN, 0xf0, 0x09, 0x4c, UNKN, // d_ + 0x60, 0x78, UNKN, UNKN, UNKN, 0x48, 0x5a, UNKN, UNKN, UNKN, 0x79, UNKN, UNKN, UNKN, UNKN, 0xba, // e_ + UNKN, UNKN, 0x6d, 0x92, UNKN, 0x26, UNKN, UNKN, 0xb5, UNKN, 0x69, UNKN, UNKN, 0xa4, UNKN, 0x1d },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, UNKN, UNKN, UNKN, 0x48, UNKN, UNKN, 0x0c, UNKN, 0x60, 0x6d, 0x20, 0xda, UNKN, 0xf0, UNKN, // 0_ + UNKN, 0xcd, 0x95, UNKN, UNKN, 0xae, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x8e, UNKN, 0x29, UNKN, // 1_ + 0x90, UNKN, UNKN, UNKN, 0x69, 0xb5, UNKN, UNKN, UNKN, UNKN, 0xd0, 0xad, UNKN, UNKN, UNKN, 0x9a, // 2_ + 0xb6, 0x40, UNKN, 0xd5, 0xfa, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xa4, UNKN, 0x88, UNKN, // 3_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x2a, UNKN, UNKN, UNKN, 0xa2, UNKN, UNKN, UNKN, UNKN, UNKN, // 4_ + 0xee, UNKN, UNKN, UNKN, 0x64, UNKN, 0xb0, 0x9d, UNKN, UNKN, UNKN, 0x80, UNKN, 0xf8, 0xe8, UNKN, // 5_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x91, UNKN, 0xb9, 0x8a, UNKN, UNKN, UNKN, 0x10, UNKN, // 6_ + 0x4a, UNKN, UNKN, 0xc8, 0x9c, 0x4e, UNKN, UNKN, UNKN, UNKN, 0xb2, 0x85, 0x45, 0xc9, UNKN, UNKN, // 7_ + 0x1a, UNKN, UNKN, 0xe9, UNKN, UNKN, UNKN, UNKN, UNKN, 0xca, UNKN, 0xc6, UNKN, 0xb1, UNKN, UNKN, // 8_ + 0x1d, UNKN, 0xa8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xc5, // 9_ + 0xe0, UNKN, 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x30, UNKN, 0x0d, UNKN, 0x8d, // a_ + UNKN, 0x86, UNKN, UNKN, 0xd9, 0xbd, UNKN, UNKN, 0x05, 0xaa, UNKN, 0x38, UNKN, 0x18, 0xe4, UNKN, // b_ + UNKN, 0xa6, UNKN, 0xa5, 0xc0, 0x2d, UNKN, UNKN, UNKN, UNKN, UNKN, 0x4c, 0x84, UNKN, 0x6e, UNKN, // c_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x19, 0x65, UNKN, UNKN, UNKN, 0xce, 0x7a, UNKN, 0x3a, // d_ + UNKN, 0x7d, UNKN, 0x0a, 0x49, UNKN, UNKN, UNKN, 0xe6, 0xd8, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // e_ + UNKN, UNKN, UNKN, UNKN, 0x09, 0xa9, 0x25, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x5a, UNKN, 0x68 },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { UNKN, 0x20, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, UNKN, 0xb0, 0x85, 0x3d, UNKN, 0x86, UNKN, UNKN, // 0_ + 0x18, UNKN, UNKN, UNKN, 0x8a, 0xad, 0x79, 0x98, UNKN, UNKN, 0xc0, UNKN, 0x30, UNKN, 0x10, UNKN, // 1_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xe4, UNKN, UNKN, UNKN, 0x29, UNKN, UNKN, UNKN, UNKN, // 2_ + 0x9e, 0x6d, 0xa6, UNKN, 0xc9, 0x6e, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 3_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xaa, UNKN, 0x9c, 0x09, UNKN, UNKN, UNKN, 0xfa, UNKN, // 4_ + UNKN, 0x69, UNKN, UNKN, 0x2d, UNKN, UNKN, UNKN, UNKN, UNKN, 0xc4, UNKN, 0x1a, 0x4c, 0x5a, UNKN, // 5_ + UNKN, UNKN, 0xe9, UNKN, 0xb1, UNKN, 0x0c, 0xee, 0xda, 0xb2, 0xce, UNKN, 0x74, UNKN, UNKN, UNKN, // 6_ + 0x7d, 0x0d, 0x48, UNKN, UNKN, UNKN, 0xf8, 0xd8, UNKN, UNKN, 0x0a, UNKN, UNKN, 0x45, 0xc6, UNKN, // 7_ + UNKN, UNKN, UNKN, UNKN, UNKN, 0x26, UNKN, UNKN, UNKN, 0xc5, UNKN, UNKN, UNKN, 0xae, UNKN, UNKN, // 8_ + 0xa9, UNKN, 0x90, 0x3a, UNKN, UNKN, 0x6c, UNKN, 0x64, UNKN, UNKN, 0xd5, UNKN, UNKN, UNKN, UNKN, // 9_ + UNKN, 0x7a, UNKN, 0x05, 0xa8, UNKN, UNKN, 0x60, UNKN, UNKN, 0xa4, 0x8d, 0x2a, UNKN, UNKN, UNKN, // a_ + UNKN, UNKN, UNKN, UNKN, 0xa0, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x92, 0x66, // b_ + UNKN, UNKN, 0xd0, 0xf0, UNKN, UNKN, 0x38, 0xbd, 0xa2, UNKN, 0xed, 0x9d, 0x80, UNKN, 0xa5, UNKN, // c_ + UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x99, UNKN, 0x88, UNKN, 0xcd, UNKN, 0xe8, // d_ + 0xca, 0xb5, 0x49, 0x68, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xe6, 0xe0, 0x4a, UNKN, // e_ + UNKN, UNKN, UNKN, 0xc8, UNKN, 0xb9, 0x91, UNKN, UNKN, UNKN, UNKN, 0x65, 0x95, UNKN, UNKN, UNKN },// f_ + + // _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f + { 0x65, UNKN, UNKN, UNKN, 0x30, UNKN, UNKN, UNKN, 0x8e, UNKN, UNKN, 0xda, 0x2d, 0xc4, UNKN, 0x68, // 0_ + UNKN, 0xa2, UNKN, UNKN, 0x2a, 0xa6, UNKN, UNKN, UNKN, 0x86, UNKN, UNKN, 0x60, UNKN, 0xe6, 0xa4, // 1_ + UNKN, 0x84, UNKN, UNKN, 0xbd, UNKN, UNKN, UNKN, UNKN, UNKN, 0xce, 0xe4, 0xf8, 0xa0, UNKN, 0x8d, // 2_ + UNKN, 0xcd, UNKN, UNKN, UNKN, 0x88, 0x4a, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, // 3_ + 0xd8, UNKN, UNKN, UNKN, 0x40, 0x11, UNKN, UNKN, 0xaa, 0x79, UNKN, 0x98, UNKN, 0x85, UNKN, UNKN, // 4_ + 0x9a, 0xc6, UNKN, UNKN, 0x74, UNKN, UNKN, UNKN, UNKN, 0x95, 0xdd, UNKN, UNKN, 0x6d, UNKN, UNKN, // 5_ + 0x8a, 0x6e, UNKN, UNKN, 0x18, 0xc5, UNKN, 0xf9, UNKN, 0xb0, 0x7a, UNKN, UNKN, UNKN, UNKN, 0xc0, // 6_ + 0x99, UNKN, UNKN, 0x10, 0x90, 0x38, 0x09, UNKN, UNKN, UNKN, 0xe0, UNKN, UNKN, UNKN, UNKN, UNKN, // 7_ + UNKN, UNKN, UNKN, 0xb5, UNKN, 0x4c, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0xfa, UNKN, UNKN, // 8_ + UNKN, UNKN, 0x6a, 0x29, UNKN, UNKN, 0x5a, 0xae, UNKN, 0x3a, UNKN, 0x9c, UNKN, 0x0d, 0x49, 0xee, // 9_ + UNKN, UNKN, UNKN, UNKN, 0xa5, 0x69, 0xf0, UNKN, 0x80, UNKN, 0xc8, UNKN, UNKN, UNKN, 0xb9, UNKN, // a_ + 0x1a, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, 0x0c, UNKN, UNKN, UNKN, UNKN, UNKN, // b_ + UNKN, UNKN, UNKN, UNKN, 0x64, UNKN, UNKN, 0xb2, 0x9d, UNKN, UNKN, 0xca, UNKN, UNKN, 0x0a, 0x05, // c_ + UNKN, UNKN, UNKN, 0x91, UNKN, UNKN, UNKN, 0x92, UNKN, UNKN, UNKN, 0xed, UNKN, UNKN, UNKN, UNKN, // d_ + UNKN, 0xec, 0x20, UNKN, 0xad, 0xd0, UNKN, 0x3d, UNKN, 0xb1, 0x6c, 0x66, UNKN, 0x4e, UNKN, 0xd5, // e_ + 0xe9, UNKN, UNKN, 0xa9, UNKN, UNKN, 0xe8, UNKN, UNKN, 0xc9, 0xa8, UNKN, UNKN, 0x48, UNKN, UNKN } // f_ + }}; uint8_t data {_maincpu->space(AS_PROGRAM).read_byte(offset)}; return decryption_tables[offset&3][data]; diff --git a/src/mame/drivers/gaelco2.cpp b/src/mame/drivers/gaelco2.cpp index aec05304c0e..b7d317d7c1b 100644 --- a/src/mame/drivers/gaelco2.cpp +++ b/src/mame/drivers/gaelco2.cpp @@ -842,6 +842,7 @@ void gaelco2_state::play2000(machine_config &config) m_maincpu->set_vblank_int("screen", FUNC(gaelco2_state::irq6_line_hold)); GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(32'000'000) / 2).set_addrmap(0, &gaelco2_state::mcu_hostmem_map); /* 16 MHz */ + config.set_perfect_quantum("gaelco_ds5002fp:mcu"); /* video hardware */ BUFFERED_SPRITERAM16(config, m_spriteram); @@ -1219,6 +1220,7 @@ void gaelco2_state::alighunt_d5002fp(machine_config &config) { alighunt(config); GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(24'000'000) / 2).set_addrmap(0, &gaelco2_state::mcu_hostmem_map); /* 12 MHz */ + config.set_perfect_quantum("gaelco_ds5002fp:mcu"); } /* @@ -1535,6 +1537,7 @@ void gaelco2_state::touchgo_d5002fp(machine_config &config) { touchgo(config); GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(32'000'000) / 2).set_addrmap(0, &gaelco2_state::mcu_hostmem_map); /* 16 MHz */ + config.set_perfect_quantum("gaelco_ds5002fp:mcu"); } /* @@ -2128,6 +2131,7 @@ void wrally2_state::wrally2(machine_config &config) m_maincpu->set_vblank_int("lscreen", FUNC(gaelco2_state::irq6_line_hold)); GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(26'000'000) / 2).set_addrmap(0, &wrally2_state::mcu_hostmem_map); /* 13 MHz */ + config.set_perfect_quantum("gaelco_ds5002fp:mcu"); LS259(config, m_mainlatch); // IC6 m_mainlatch->q_out_cb<0>().set(FUNC(gaelco2_state::coin1_counter_w)); diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp index 570f6e27f57..9aef5f17fe7 100644 --- a/src/mame/drivers/galaxian.cpp +++ b/src/mame/drivers/galaxian.cpp @@ -667,6 +667,8 @@ TODO: #include "screen.h" #include "speaker.h" +#include "audio/nl_konami.h" + /************************************* * * Interrupts @@ -817,25 +819,25 @@ READ8_MEMBER(galaxian_state::konami_sound_timer_r) 0x0e; /* assume remaining bits are high, except B0 which is grounded */ } - WRITE8_MEMBER(galaxian_state::konami_sound_filter_w) { - if (m_discrete != nullptr) + if (m_netlist != nullptr) { /* the offset is used as data, 6 channels * 2 bits each */ - /* AV0 .. AV5 ==> AY8910 #2 */ - /* AV6 .. AV11 ==> AY8910 #1 */ + /* AV0 .. AV5 ==> AY8910 #2 - 3C */ + /* AV6 .. AV11 ==> AY8910 #1 - 3D */ for (int which = 0; which < 2; which++) { if (m_ay8910[which] != nullptr) { - for (int chan = 0; chan < 3; chan++) + for (int flt = 0; flt < 6; flt++) { - uint8_t bits = (offset >> (2 * chan + 6 * (1 - which))) & 3; + const int fltnum = (flt + 6 * which); + const uint8_t bit = (offset >> (flt + 6 * (1 - which))) & 1; /* low bit goes to 0.22uF capacitor = 220000pF */ /* high bit goes to 0.047uF capacitor = 47000pF */ - m_discrete->write(NODE(3 * which + chan + 11), bits); + m_filter_ctl[fltnum]->write(bit); } } } @@ -5924,62 +5926,6 @@ static GFXDECODE_START(gfx_videight) GFXDECODE_END -/************************************* - * - * Sound configuration - * - *************************************/ - -static const discrete_mixer_desc konami_sound_mixer_desc = - {DISC_MIXER_IS_OP_AMP, - {RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1)}, - {0,0,0,0,0,0}, /* no variable resistors */ - {0,0,0,0,0,0}, /* no node capacitors */ - 0, RES_K(2.2), - 0, - 0, /* modelled separately */ - 0, 1}; - -static DISCRETE_SOUND_START( konami_sound_discrete ) - - DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0) - DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0) - DISCRETE_INPUTX_STREAM(NODE_03, 2, 1.0, 0) - - DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0) - DISCRETE_INPUTX_STREAM(NODE_05, 4, 1.0, 0) - DISCRETE_INPUTX_STREAM(NODE_06, 5, 1.0, 0) - - DISCRETE_INPUT_DATA(NODE_11) - DISCRETE_INPUT_DATA(NODE_12) - DISCRETE_INPUT_DATA(NODE_13) - - DISCRETE_INPUT_DATA(NODE_14) - DISCRETE_INPUT_DATA(NODE_15) - DISCRETE_INPUT_DATA(NODE_16) - - DISCRETE_RCFILTER_SW(NODE_21, 1, NODE_01, NODE_11, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0) - DISCRETE_RCFILTER_SW(NODE_22, 1, NODE_02, NODE_12, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0) - DISCRETE_RCFILTER_SW(NODE_23, 1, NODE_03, NODE_13, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0) - - DISCRETE_RCFILTER_SW(NODE_24, 1, NODE_04, NODE_14, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0) - DISCRETE_RCFILTER_SW(NODE_25, 1, NODE_05, NODE_15, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0) - DISCRETE_RCFILTER_SW(NODE_26, 1, NODE_06, NODE_16, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0) - - DISCRETE_MIXER6(NODE_30, 1, NODE_21, NODE_22, NODE_23, NODE_24, NODE_25, NODE_26, &konami_sound_mixer_desc) - - /* FIXME the amplifier M51516L has a decay circuit */ - /* This is handled with sound_global_enable but */ - /* belongs here. */ - - /* Input impedance of a M51516L is typically 30k (datasheet) */ - DISCRETE_CRFILTER(NODE_40,NODE_30,RES_K(30),CAP_U(0.15)) - - DISCRETE_OUTPUT(NODE_40, 10.0 ) - -DISCRETE_SOUND_END - - /************************************* * @@ -6038,6 +5984,7 @@ void galaxian_state::konami_base(machine_config &config) m_ppi8255[1]->out_pb_callback().set(FUNC(galaxian_state::konami_sound_control_w)); m_ppi8255[1]->in_pc_callback().set_ioport("IN3"); m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::konami_portc_1_w)); + } @@ -6052,15 +5999,32 @@ void galaxian_state::konami_sound_1x_ay8910(machine_config &config) /* sound hardware */ AY8910(config, m_ay8910[0], KONAMI_SOUND_CLOCK/8); - m_ay8910[0]->set_flags(AY8910_DISCRETE_OUTPUT); - m_ay8910[0]->set_resistors_load(RES_K(5.1), RES_K(5.1), RES_K(5.1)); + m_ay8910[0]->set_flags(AY8910_RESISTOR_OUTPUT); + m_ay8910[0]->set_resistors_load(1000.0, 1000.0, 1000.0); m_ay8910[0]->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); m_ay8910[0]->port_b_read_callback().set(FUNC(galaxian_state::frogger_sound_timer_r)); m_ay8910[0]->add_route(0, "konami", 1.0, 0); m_ay8910[0]->add_route(1, "konami", 1.0, 1); m_ay8910[0]->add_route(2, "konami", 1.0, 2); - DISCRETE(config, m_discrete, konami_sound_discrete).add_route(ALL_OUTPUTS, "speaker", 0.75); + NETLIST_SOUND(config, "konami", 48000) + .set_source(netlist_konami1x) + .add_route(ALL_OUTPUTS, "speaker", 1.0); + + // Filter + NETLIST_LOGIC_INPUT(config, "konami:ctl0", "CTL0.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl1", "CTL1.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl2", "CTL2.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl3", "CTL3.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl4", "CTL4.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl5", "CTL5.IN", 0); + + // CHA1 - 3D + NETLIST_STREAM_INPUT(config, "konami:cin0", 0, "R_AY3D_A.R"); + NETLIST_STREAM_INPUT(config, "konami:cin1", 1, "R_AY3D_B.R"); + NETLIST_STREAM_INPUT(config, "konami:cin2", 2, "R_AY3D_C.R"); + + NETLIST_STREAM_OUTPUT(config, "konami:cout0", 0, "OUT").set_mult_offset(30000.0 / 0.05, 0.0); } @@ -6075,8 +6039,8 @@ void galaxian_state::konami_sound_2x_ay8910(machine_config &config) /* sound hardware */ AY8910(config, m_ay8910[0], KONAMI_SOUND_CLOCK/8); - m_ay8910[0]->set_flags(AY8910_DISCRETE_OUTPUT); - m_ay8910[0]->set_resistors_load(RES_K(5.1), RES_K(5.1), RES_K(5.1)); + m_ay8910[0]->set_flags(AY8910_RESISTOR_OUTPUT); + m_ay8910[0]->set_resistors_load(1000.0, 1000.0, 1000.0); m_ay8910[0]->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); m_ay8910[0]->port_b_read_callback().set(FUNC(galaxian_state::konami_sound_timer_r)); m_ay8910[0]->add_route(0, "konami", 1.0, 0); @@ -6084,13 +6048,40 @@ void galaxian_state::konami_sound_2x_ay8910(machine_config &config) m_ay8910[0]->add_route(2, "konami", 1.0, 2); AY8910(config, m_ay8910[1], KONAMI_SOUND_CLOCK/8); - m_ay8910[1]->set_flags(AY8910_DISCRETE_OUTPUT); - m_ay8910[1]->set_resistors_load(RES_K(5.1), RES_K(5.1), RES_K(5.1)); + m_ay8910[1]->set_flags(AY8910_RESISTOR_OUTPUT); + m_ay8910[1]->set_resistors_load(1000.0, 1000.0, 1000.0); m_ay8910[1]->add_route(0, "konami", 1.0, 3); m_ay8910[1]->add_route(1, "konami", 1.0, 4); m_ay8910[1]->add_route(2, "konami", 1.0, 5); - DISCRETE(config, m_discrete, konami_sound_discrete).add_route(ALL_OUTPUTS, "speaker", 0.5); + NETLIST_SOUND(config, "konami", 48000) + .set_source(netlist_konami2x) + .add_route(ALL_OUTPUTS, "speaker", 1.0); + + // Filter + NETLIST_LOGIC_INPUT(config, "konami:ctl0", "CTL0.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl1", "CTL1.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl2", "CTL2.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl3", "CTL3.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl4", "CTL4.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl5", "CTL5.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl6", "CTL6.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl7", "CTL7.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl8", "CTL8.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl9", "CTL9.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl10", "CTL10.IN", 0); + NETLIST_LOGIC_INPUT(config, "konami:ctl11", "CTL11.IN", 0); + + // CHA1 - 3D + NETLIST_STREAM_INPUT(config, "konami:cin0", 0, "R_AY3D_A.R"); + NETLIST_STREAM_INPUT(config, "konami:cin1", 1, "R_AY3D_B.R"); + NETLIST_STREAM_INPUT(config, "konami:cin2", 2, "R_AY3D_C.R"); + + // CHA2 - 3C + NETLIST_STREAM_INPUT(config, "konami:cin3", 3, "R_AY3C_A.R"); + NETLIST_STREAM_INPUT(config, "konami:cin4", 4, "R_AY3C_B.R"); + NETLIST_STREAM_INPUT(config, "konami:cin5", 5, "R_AY3C_C.R"); + NETLIST_STREAM_OUTPUT(config, "konami:cout0", 0, "OUT").set_mult_offset(30000.0 / 0.05, 0.0); } @@ -6115,9 +6106,7 @@ void galaxian_state::galaxian(machine_config &config) { galaxian_base(config); - GALAXIAN(config, "cust", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); - - DISCRETE(config, GAL_AUDIO, galaxian_discrete).add_route(ALL_OUTPUTS, "speaker", 1.0); + GALAXIAN_SOUND(config, "cust", 0); } void galaxian_state::victoryc(machine_config &config) @@ -6199,9 +6188,7 @@ void galaxian_state::mooncrst(machine_config &config) // alternate memory map m_maincpu->set_addrmap(AS_PROGRAM, &galaxian_state::mooncrst_map); - GALAXIAN(config, "cust", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); - - DISCRETE(config, GAL_AUDIO, mooncrst_discrete).add_route(ALL_OUTPUTS, "speaker", 1.0); + MOONCRST_SOUND(config, "cust", 0); } void galaxian_state::eagle(machine_config &config) @@ -6250,7 +6237,6 @@ void galaxian_state::fantastc(machine_config &config) // sound hardware AY8910(config, m_ay8910[0], GALAXIAN_PIXEL_CLOCK/3/2).add_route(ALL_OUTPUTS, "speaker", 0.25); // 3.072MHz - AY8910(config, m_ay8910[1], GALAXIAN_PIXEL_CLOCK/3/2).add_route(ALL_OUTPUTS, "speaker", 0.25); // 3.072MHz } @@ -6374,6 +6360,7 @@ void galaxian_state::frogger(machine_config &config) void galaxian_state::froggermc(machine_config &config) { galaxian_base(config); + konami_sound_1x_ay8910(config); // alternate memory map @@ -6701,10 +6688,6 @@ void galaxian_state::turpins(machine_config &config) // the ROMs came from a bli void galaxian_state::anteater(machine_config &config) { scobra(config); - - /* quiet down the sounds */ - m_discrete->reset_routes(); - m_discrete->add_route(ALL_OUTPUTS, "speaker", 0.25); } @@ -7573,17 +7556,24 @@ void galaxian_state::init_scramble() common_init(&galaxian_state::scramble_draw_bullet, &galaxian_state::scramble_draw_background, nullptr, nullptr); } -void galaxian_state::init_mandinga() +void galaxian_state::init_mandingaeg() { init_scramble(); /* watchdog is in a different location */ address_space &space = m_maincpu->space(AS_PROGRAM); watchdog_timer_device *wdog = subdevice<watchdog_timer_device>("watchdog"); - space.unmap_read(0x7000, 0x7000, 0x7ff); space.install_read_handler(0x6800, 0x6800, 0, 0x7ff, 0, read8mo_delegate(*wdog, FUNC(watchdog_timer_device::reset_r))); } +void galaxian_state::init_mandinga() +{ + init_mandingaeg(); + + address_space &space = m_maincpu->space(AS_PROGRAM); + space.unmap_read(0x7000, 0x7000, 0x7ff); +} + void galaxian_state::init_sfx() { /* basic configuration */ @@ -11264,6 +11254,29 @@ ROM_START( mandinga ) ROM_LOAD( "6e.bin", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) ) // 82s123 ROM_END +ROM_START( mandingaeg ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "eg-01.2c", 0x0000, 0x0800, CRC(9e765a39) SHA1(5e6ddd2f929304cb01b4130fb54f24df70c0c5f5) ) // AM4716 + ROM_LOAD( "eg-02.2e", 0x0800, 0x0800, CRC(4c64161e) SHA1(5b2e49ff915295617671b13f15b566046a5dbc15) ) // MBM2716 + ROM_LOAD( "eg-03.2f", 0x1000, 0x0800, CRC(b3987a72) SHA1(1d72e9ae3005029628c6f9beb6ca65afcb1f7893) ) // HN462716G + ROM_LOAD( "eg-04.2h", 0x1800, 0x0800, CRC(29873461) SHA1(7d0ee9a82f02163b4cc6a7097e88ae34e96ebf58) ) // i2716 + ROM_LOAD( "eg-05.2j", 0x2000, 0x0800, CRC(a684578c) SHA1(a71c06cc87fa7c64b49433a8d25a480c26a2d700) ) // MB8516 + ROM_LOAD( "eg-06.2l", 0x2800, 0x0800, CRC(5382f7ed) SHA1(425ec2c2caf404fc8ab13ee38d6567413022e1a1) ) // AM2716 + ROM_LOAD( "eg-07.2m", 0x3000, 0x0800, CRC(1d7109e9) SHA1(e0d24475547bbe5a94b45be6abefb84ad84d2534) ) // TMS2516 + ROM_LOAD( "eg-08.2p", 0x3800, 0x0800, CRC(cf52fb24) SHA1(420c0cd0543e59d9698b14547d23bd38210439ff) ) // TMS2516 + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eg-m11s.5c", 0x0000, 0x1000, BAD_DUMP CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) ) // TMS2532, ROM corrupted, using the one from amidars for now + ROM_LOAD( "eg-m12s.5d", 0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) ) // TMS2532 + + ROM_REGION( 0x1000, "gfx1", 0 ) + ROM_LOAD( "eg-09.5f", 0x0000, 0x0800, CRC(09ed5818) SHA1(69dce85228b2c9176d4be429f530410350a1c76c) ) // MB8516 + ROM_LOAD( "eg-10.5h", 0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) ) // MB8516 + + ROM_REGION( 0x0020, "proms", 0 ) + ROM_LOAD( "eg-mb7051.6e", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) ) // Dumped as 82s123 +ROM_END + ROM_START( mandingarf ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "2716-mg1.bin", 0x0000, 0x0800, CRC(a684a494) SHA1(76885bb3bdab09f46c7daa25164a2fdaa744742f) ) // 2716 @@ -12892,28 +12905,29 @@ GAME( 1981, froggeram, frogger, froggeram, froggeram, galaxian_state, init_ // Turtles based hardware // CPU/Video Board: KT-4108-2 // Sound Board: KT-4108-1 -GAME( 1981, turtles, 0, turtles, turtles, galaxian_state, init_turtles, ROT90, "Konami (Stern Electronics license)", "Turtles", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, turpin, turtles, turtles, turpin, galaxian_state, init_turtles, ROT90, "Konami (Sega license)", "Turpin", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, 600, turtles, turtles, turtles, galaxian_state, init_turtles, ROT90, "Konami", "600", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, turpins, turtles, turpins, turtles, galaxian_state, init_turtles, ROT90, "bootleg", "Turpin (bootleg on Super Cobra hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // needs different sound timer - -GAME( 1982, amidar, 0, turtles, amidaru, galaxian_state, init_turtles, ROT90, "Konami", "Amidar", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, amidar1, amidar, turtles, amidar, galaxian_state, init_turtles, ROT90, "Konami", "Amidar (older)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, amidaru, amidar, turtles, amidaru, galaxian_state, init_turtles, ROT90, "Konami (Stern Electronics license)", "Amidar (Stern Electronics)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, amidaro, amidar, turtles, amidaro, galaxian_state, init_turtles, ROT90, "Konami (Olympia license)", "Amidar (Olympia)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, amidarb, amidar, turtles, amidaru, galaxian_state, init_turtles, ROT90, "bootleg", "Amidar (bootleg)", MACHINE_SUPPORTS_SAVE ) /* similar to Amigo bootleg */ -GAME( 1982, amigo, amidar, turtles, amidaru, galaxian_state, init_turtles, ROT90, "bootleg", "Amigo (bootleg of Amidar, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, amigo2, amidar, amigo2, amidaru, galaxian_state, init_amigo2, ROT90, "bootleg", "Amigo (bootleg of Amidar, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // sound timer might be different? -GAME( 1982, amidars, amidar, scramble, amidars, galaxian_state, init_scramble, ROT90, "Konami", "Amidar (Scramble hardware)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, mandinga, amidar, scramble, amidars, galaxian_state, init_mandinga, ROT90, "bootleg (Artemi)", "Mandinga (bootleg of Amidar)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // color PROM needs bitswap<8> on addressing, reference: http://www.youtube.com/watch?v=6uGK4AZxV2U -GAME( 1982, mandingarf, amidar, mandingarf, mandingarf, galaxian_state, init_galaxian, ROT90, "bootleg (Recreativos Franco S.A.)", "Mandanga (bootleg of Mandinga on Galaxian hardware, set 1)", MACHINE_NO_COCKTAIL | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // assume same issue as mandinga -GAME( 1982, mandingac, amidar, mandingarf, mandingarf, galaxian_state, init_galaxian, ROT90, "bootleg (Centromatic)", "Mandanga (bootleg of Mandinga on Galaxian hardware, set 2)", MACHINE_NO_COCKTAIL | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // assume same issue as mandinga +GAME( 1981, turtles, 0, turtles, turtles, galaxian_state, init_turtles, ROT90, "Konami (Stern Electronics license)", "Turtles", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, turpin, turtles, turtles, turpin, galaxian_state, init_turtles, ROT90, "Konami (Sega license)", "Turpin", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, 600, turtles, turtles, turtles, galaxian_state, init_turtles, ROT90, "Konami", "600", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, turpins, turtles, turpins, turtles, galaxian_state, init_turtles, ROT90, "bootleg", "Turpin (bootleg on Super Cobra hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // needs different sound timer + +GAME( 1982, amidar, 0, turtles, amidaru, galaxian_state, init_turtles, ROT90, "Konami", "Amidar", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, amidar1, amidar, turtles, amidar, galaxian_state, init_turtles, ROT90, "Konami", "Amidar (older)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, amidaru, amidar, turtles, amidaru, galaxian_state, init_turtles, ROT90, "Konami (Stern Electronics license)", "Amidar (Stern Electronics)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, amidaro, amidar, turtles, amidaro, galaxian_state, init_turtles, ROT90, "Konami (Olympia license)", "Amidar (Olympia)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, amidarb, amidar, turtles, amidaru, galaxian_state, init_turtles, ROT90, "bootleg", "Amidar (bootleg)", MACHINE_SUPPORTS_SAVE ) /* similar to Amigo bootleg */ +GAME( 1982, amigo, amidar, turtles, amidaru, galaxian_state, init_turtles, ROT90, "bootleg", "Amigo (bootleg of Amidar, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, amigo2, amidar, amigo2, amidaru, galaxian_state, init_amigo2, ROT90, "bootleg", "Amigo (bootleg of Amidar, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // sound timer might be different? +GAME( 1982, amidars, amidar, scramble, amidars, galaxian_state, init_scramble, ROT90, "Konami", "Amidar (Scramble hardware)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mandinga, amidar, scramble, amidars, galaxian_state, init_mandinga, ROT90, "bootleg (Artemi)", "Mandinga (Artemi bootleg of Amidar)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // color PROM needs bitswap<8> on addressing, reference: http://www.youtube.com/watch?v=6uGK4AZxV2U +GAME( 1982, mandingaeg, amidar, scramble, amidars, galaxian_state, init_mandingaeg, ROT90, "bootleg (Electrogame S.A.)", "Mandinga (Electrogame S.A. bootleg of Amidar)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mandingarf, amidar, mandingarf, mandingarf, galaxian_state, init_galaxian, ROT90, "bootleg (Recreativos Franco S.A.)", "Mandanga (bootleg of Mandinga on Galaxian hardware, set 1)", MACHINE_NO_COCKTAIL | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // assume same issue as mandinga +GAME( 1982, mandingac, amidar, mandingarf, mandingarf, galaxian_state, init_galaxian, ROT90, "bootleg (Centromatic)", "Mandanga (bootleg of Mandinga on Galaxian hardware, set 2)", MACHINE_NO_COCKTAIL | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // assume same issue as mandinga /* The End/Scramble based hardware */ -GAME( 1980, theend, 0, theend, theend, galaxian_state, init_theend, ROT90, "Konami", "The End", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, theends, theend, theend, theend, galaxian_state, init_theend, ROT90, "Konami (Stern Electronics license)", "The End (Stern Electronics)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, takeoff, theend, takeoff, explorer, galaxian_state, init_explorer, ROT90, "bootleg (Sidam)", "Take Off (bootleg of The End)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // colors likely need bitswap<8> somewhere; needs different sound timer. reference: https://www.youtube.com/watch?v=iPYX3yJORTE +GAME( 1980, theend, 0, theend, theend, galaxian_state, init_theend, ROT90, "Konami", "The End", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, theends, theend, theend, theend, galaxian_state, init_theend, ROT90, "Konami (Stern Electronics license)", "The End (Stern Electronics)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, takeoff, theend, takeoff, explorer, galaxian_state, init_explorer, ROT90, "bootleg (Sidam)", "Take Off (bootleg of The End)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // colors likely need bitswap<8> somewhere; needs different sound timer. reference: https://www.youtube.com/watch?v=iPYX3yJORTE GAME( 1981, scramble, 0, scramble, scramble, galaxian_state, init_scramble, ROT90, "Konami", "Scramble", MACHINE_SUPPORTS_SAVE ) GAME( 1981, scrambles, scramble, scramble, scramble, galaxian_state, init_scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 1)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp index 933fb5a4374..ab018944297 100644 --- a/src/mame/drivers/galaxold.cpp +++ b/src/mame/drivers/galaxold.cpp @@ -2292,16 +2292,12 @@ void galaxold_state::galaxold_base(machine_config &config) void galaxold_state::galaxian_audio(machine_config &config) { - GALAXIAN(config, "cust", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); - - DISCRETE(config, GAL_AUDIO, galaxian_discrete).add_route(ALL_OUTPUTS, "speaker", 1.0); + GALAXIAN_SOUND(config, "cust", 0); } void galaxold_state::mooncrst_audio(machine_config &config) { - GALAXIAN(config, "cust", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); - - DISCRETE(config, GAL_AUDIO, mooncrst_discrete).add_route(ALL_OUTPUTS, "speaker", 1.0); + MOONCRST_SOUND(config, "cust", 0); } @@ -3383,7 +3379,7 @@ ROM_START( drivfrcg ) ROM_LOAD( "bot.clr", 0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) ) ROM_END -ROM_START( drivfrcsg ) // This PCB has a big epoxy block by Tanaka Enterprises marked E-0010, possibly providing ROM addressing +ROM_START( drivfrcsg ) // This PCB has a big epoxy block by Tanaka Enterprises marked E-0010, providing ROM addressing ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "6n-2-2764a.bin", 0x2800, 0x0400, CRC(85242241) SHA1(bad2609c7f6d83a15809b602a0c141793909ceb0) ) ROM_CONTINUE( 0x2c00, 0x0400 ) @@ -3412,6 +3408,35 @@ ROM_START( drivfrcsg ) // This PCB has a big epoxy block by Tanaka Enterprises m ROM_LOAD( "82s123-2.bin", 0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) ) ROM_END +ROM_START( drivfrcsga ) // This PCB has a big epoxy block by Tanaka Enterprises marked E-0237, possibly providing ROM addressing + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "xx.bin", 0x2800, 0x0400, NO_DUMP ) // missing + ROM_CONTINUE( 0x2c00, 0x0400 ) + ROM_CONTINUE( 0x0000, 0x0400 ) + ROM_CONTINUE( 0x0400, 0x0400 ) + ROM_CONTINUE( 0x0800, 0x0400 ) + ROM_CONTINUE( 0x0c00, 0x0400 ) + ROM_CONTINUE( 0x2000, 0x0400 ) + ROM_CONTINUE( 0x2400, 0x0400 ) + ROM_LOAD( "1p.bin", 0x6800, 0x0400, CRC(58b12215) SHA1(73c8bd16994704d8b1d007c5924ba5e83f7233ea) ) // unique + ROM_CONTINUE( 0x6c00, 0x0400 ) + ROM_CONTINUE( 0x4000, 0x0400 ) + ROM_CONTINUE( 0x4400, 0x0400 ) + ROM_CONTINUE( 0x4800, 0x0400 ) + ROM_CONTINUE( 0x4c00, 0x0400 ) + ROM_CONTINUE( 0x6000, 0x0400 ) + ROM_CONTINUE( 0x6400, 0x0400 ) + + ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_LOAD( "kj_5.22.bin", 0x0000, 0x2000, CRC(7b6d837a) SHA1(925ca351635e77cacfb5a2d6e31487c5e4aaf0ec) ) // unique + ROM_LOAD( "kl_5.22.bin", 0x2000, 0x2000, CRC(86cd5438) SHA1(c921d8cd031fd0fa78488ae95a1570dd1be919e9) ) // unique + + /* piggy-backed colour proms */ + ROM_REGION( 0x0040, "proms", 0 ) // missing + ROM_LOAD( "82s123-1.bin", 0x0000, 0x0020, NO_DUMP ) + ROM_LOAD( "82s123-2.bin", 0x0020, 0x0020, NO_DUMP ) +ROM_END + ROM_START( drivfrcb ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "dfp.bin", 0x2800, 0x0400, CRC(b5b2981d) SHA1(c9ff19791895bf05b569457b1e53dfa0aaeb8e95) ) @@ -3669,7 +3694,8 @@ GAME( 1983, spcwarp, 0, spcwarp, hunchbkg, galaxold_state, empty_ini GAME( 1984, drivfrcg, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "Shinkai Inc. (Magic Electronics USA license)", "Driving Force (Galaxian conversion)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, drivfrct, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "bootleg (EMT Germany)", "Top Racer (bootleg of Driving Force)", MACHINE_SUPPORTS_SAVE ) // Video Klein PCB GAME( 1985, drivfrcb, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "bootleg (Elsys Software)", "Driving Force (Galaxian conversion bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, drivfrcsg, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "Seatongrove UK", "Driving Force (Galaxian conversion, Seatongrove UK)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, drivfrcsg, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "Seatongrove UK", "Driving Force (Galaxian conversion, Seatongrove UK, E-0010)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, drivfrcsga,drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "Seatongrove UK", "Driving Force (Galaxian conversion, Seatongrove UK, E-0237)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // incomplete dump GAME( 1986, racknrol, 0, racknrol, racknrol, galaxold_state, empty_init, ROT0, "Senko Industries (Status license from Shinkai Inc.)", "Rack + Roll", MACHINE_SUPPORTS_SAVE ) GAME( 1986, hexpool, racknrol, racknrol, racknrol, galaxold_state, empty_init, ROT90, "Senko Industries (Shinkai Inc. license)", "Hex Pool (Shinkai)", MACHINE_SUPPORTS_SAVE ) // still has Senko logo in gfx rom GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, galaxold_state, empty_init, ROT90, "Senko Industries", "Hex Pool (Senko)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/galivan.cpp b/src/mame/drivers/galivan.cpp index a47523d1f6c..4f815dd7742 100644 --- a/src/mame/drivers/galivan.cpp +++ b/src/mame/drivers/galivan.cpp @@ -121,7 +121,7 @@ void galivan_state::ninjemak_io_map(address_map &map) map(0x83, 0x83).portr("SERVICE"); map(0x84, 0x84).portr("DSW1"); map(0x85, 0x85).portr("DSW2").w(FUNC(galivan_state::galivan_sound_command_w)); - map(0x86, 0x86).w(FUNC(galivan_state::blit_trigger_w)); + map(0x86, 0x86).w(FUNC(galivan_state::blit_trigger_w)); map(0x87, 0x87).w(FUNC(galivan_state::vblank_ack_w)); } @@ -439,7 +439,7 @@ void galivan_state::video_config(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // TODO: not measured, ~60 Hz - m_screen->set_raw(XTAL(12'000'000)/2,382,0,32*8, 262, 2*8, 30*8); + m_screen->set_raw(XTAL(12'000'000)/2,382,0,32*8, 262, 2*8, 30*8); m_screen->screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising)); m_screen->set_palette(m_palette); } @@ -465,7 +465,7 @@ void galivan_state::galivan(machine_config &config) m_screen->set_screen_update(FUNC(galivan_state::screen_update_galivan)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_galivan); PALETTE(config, m_palette, FUNC(galivan_state::galivan_palette), 16*16+16*16+256*16, 256); - + /* sound hardware */ SPEAKER(config, "speaker").front_center(); diff --git a/src/mame/drivers/galpanic_ms.cpp b/src/mame/drivers/galpanic_ms.cpp index 01d62d747b1..d74847c5b40 100644 --- a/src/mame/drivers/galpanic_ms.cpp +++ b/src/mame/drivers/galpanic_ms.cpp @@ -154,7 +154,8 @@ uint32_t galspanic_ms_state::screen_update_backgrounds(screen_device &screen, bi uint32_t galspanic_ms_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update_backgrounds(screen, bitmap, cliprect); -// m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); +// m_kaneko_spr->render_sprites(cliprect, m_spriteram, m_spriteram.bytes()); +// m_kaneko_spr->copybitmap(bitmap, cliprect, screen.priority()); return 0; } diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index 95e05f76493..6f81073cd05 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -1337,7 +1337,7 @@ void gba_state::machine_start() m_maincpu->space(AS_PROGRAM).install_read_bank(0x0c000000, 0x0cffffff, "rom3"); std::string region_tag; - memory_region *cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GBASLOT_ROM_REGION_TAG).c_str()); + memory_region *cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GBASLOT_ROM_REGION_TAG)); // install ROM accesses membank("rom1")->set_base(cart_rom->base()); @@ -1387,7 +1387,7 @@ void gba_state::machine_start() if (m_cart->get_type() == GBA_3DMATRIX) { m_maincpu->space(AS_PROGRAM).install_write_handler(0x08800000, 0x088001ff, write32_delegate(*m_cart, FUNC(gba_cart_slot_device::write_mapper))); - memory_region *cart_romhlp = memregion(region_tag.assign(m_cart->tag()).append(GBAHELP_ROM_REGION_TAG).c_str()); + memory_region *cart_romhlp = memregion(region_tag.assign(m_cart->tag()).append(GBAHELP_ROM_REGION_TAG)); membank("rom1")->set_base(cart_romhlp->base()); } diff --git a/src/mame/drivers/generalplus_gpl32612.cpp b/src/mame/drivers/generalplus_gpl32612.cpp index 07c322b4341..4913326aa39 100644 --- a/src/mame/drivers/generalplus_gpl32612.cpp +++ b/src/mame/drivers/generalplus_gpl32612.cpp @@ -4,8 +4,18 @@ /***************************************************************************** - unlike earlier SunPlus / GeneralPlus based SoCs this one seems to be - ARM based + unlike earlier SunPlus / GeneralPlus based SoCs this one is + ARM based + + NAND types + + MX30LF1G08AA + ID = C2F1 + Capacity = (2048+64) x 64 x 512 + + Star Wars Blaster - MX30LF1G08AA + TMNT Hero Portal - MX30LF1G08AA + DC Hero Portal - MX30LF1G08AA *****************************************************************************/ @@ -79,14 +89,19 @@ void generalplus_gpl32612_game_state::gpl32612(machine_config &config) // NAND dumps, so there will be a bootloader / boot strap at least +ROM_START( jak_swbstrik ) + ROM_REGION( 0x8400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "starwarsblaster.bin", 0x000000, 0x8400000, CRC(02c3c4d6) SHA1(a6ae05a7d7b2015023113f6baad25458f3c01102) ) +ROM_END + ROM_START( jak_tmnthp ) ROM_REGION( 0x8400000, "maincpu", ROMREGION_ERASEFF ) ROM_LOAD( "tmntheroportal.bin", 0x000000, 0x8400000, CRC(75ec7127) SHA1(cd05f55a1f5a7fd3d1b0658ad6805b8777857a7e) ) ROM_END -ROM_START( jak_swbstrik ) +ROM_START( jak_dchp ) ROM_REGION( 0x8400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "starwarsblaster.bin", 0x000000, 0x8400000, CRC(02c3c4d6) SHA1(a6ae05a7d7b2015023113f6baad25458f3c01102) ) + ROM_LOAD( "dcheroportal_mx30lf1g08aa_c2f1.bin", 0x000000, 0x8400000, CRC(576a3005) SHA1(6cd9edc4def707aede3f82a21c87269d2a6bc870) ) ROM_END void generalplus_gpl32612_game_state::nand_init(int blocksize, int blocksize_stripped) @@ -131,8 +146,8 @@ void generalplus_gpl32612_game_state::nand_init840() // year, name, parent, compat, machine, input, class, init, company, fullname, flags -CONS( 200?, jak_tmnthp, 0, 0, gpl32612, gpl32612, generalplus_gpl32612_game_state, nand_init840, "JAKKS Pacific Inc", "Teenage Mutanat Ninja Turtles Hero Portal", MACHINE_IS_SKELETON ) CONS( 200?, jak_swbstrik, 0, 0, gpl32612, gpl32612, generalplus_gpl32612_game_state, nand_init840, "JAKKS Pacific Inc", "Star Wars Blaster Strike", MACHINE_IS_SKELETON ) -// Hero Portal Dreamworks Dragons -// Hero Portal Power Rangers -// Hero Portal DC Super Heroes +CONS( 200?, jak_tmnthp, 0, 0, gpl32612, gpl32612, generalplus_gpl32612_game_state, nand_init840, "JAKKS Pacific Inc", "Teenage Mutant Ninja Turtles Hero Portal", MACHINE_IS_SKELETON ) +// Hero Portal Dreamworks Dragons +// Hero Portal Power Rangers +CONS( 200?, jak_dchp, 0, 0, gpl32612, gpl32612, generalplus_gpl32612_game_state, nand_init840, "JAKKS Pacific Inc", "DC Super Heroes The Watchtower Hero Portal", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp index c0f40b8769a..134e6ad3e11 100644 --- a/src/mame/drivers/geneve.cpp +++ b/src/mame/drivers/geneve.cpp @@ -1,186 +1,174 @@ // license:LGPL-2.1+ // copyright-holders:Michael Zapf /****************************************************************************** - Myarc Geneve 9640. - - The Geneve has two operation modes. One is compatible with the TI-99/4a, - the other is not. - - - General architecture: - - TMS9995@12MHz (including 256 bytes of on-chip 16-bit RAM and a timer), - V9938, SN76496 (compatible with TMS9919), TMS9901, MM58274 RTC, 512 kbytes - of 1-wait-state CPU RAM (expandable to almost 2 Mbytes), 32 kbytes of - 0-wait-state CPU RAM (expandable to 64 kbytes), 128 kbytes of VRAM - (expandable to 192 kbytes). - - - Memory map: - - 64-kbyte CPU address space is mapped to a 2-Mbyte virtual address space. - 8 8-kbyte pages are available simultaneously, out of a total of 256. - - Page map (regular console): - >00->3f: 512kbytes of CPU RAM (pages >36 and >37 are used to emulate - cartridge CPU ROMs in ti99 mode, and pages >38 through >3f are used to - emulate console and cartridge GROMs in ti99 mode) - >40->7f: optional Memex RAM (except >7a and >7c that are mirrors of >ba and - >bc?) - >80->b7: PE-bus space using spare address lines (AMA-AMC)? Used by RAM - extension (Memex or PE-Bus 512k card). - >b8->bf: PE-bus space (most useful pages are >ba: DSR space and >bc: speech - synthesizer page; other pages are used by RAM extension) - >c0->e7: optional Memex RAM - >e8->ef: 64kbytes of 0-wait-state RAM (with 32kbytes of SRAM installed, - only even pages (>e8, >ea, >ec and >ee) are available) - >f0->f1: boot ROM - >f2->fe: optional Memex RAM? (except >fa and >fc that are mirrors of >ba - and >bc?) - >ff: always empty? - - Page map (genmod console): - >00->39, >40->b9, >bb, >bd->ef, f2->fe: Memex RAM (except >3a, >3c, >7a, - >7c, >fa and >fc that are mirrors of >ba and >bc?) (I don't know if - >e8->ef is on the Memex board or the Geneve motherboard) - >ba: DSR space - >bc: speech synthesizer space - >f0->f1: boot ROM - >ff: always empty? - - >00->3f: switch-selectable(?): 512kbytes of onboard RAM (1-wait-state DRAM) - or first 512kbytes of the Memex Memory board (0-wait-state SRAM). The - latter setting is incompatible with TI mode. - - Note that >bc is actually equivalent to >8000->9fff on the /4a bus, - therefore the speech synthesizer is only available at offsets >1800->1bff - (read port) and >1c00->1fff (write port). OTOH, if you installed a FORTI - sound card, it will be available in the same page at offsets >0400->7ff. - - - Unpaged locations (ti99 mode): - >8000->8007: memory page registers (>8000 for page 0, >8001 for page 1, - etc. register >8003 is ignored (this page is hard-wired to >36->37). - >8008: key buffer - >8009->800f: ??? - >8010->801f: clock chip - >8400->9fff: sound, VDP, speech, and GROM registers (according to one - source, the GROM and sound registers are only available if page >3 - is mapped in at location >c000 (register 6). I am not sure the Speech - registers are implemented, though I guess they are.) - Note that >8020->83ff is mapped to regular CPU RAM according to map - register 4. - - Unpaged locations (native mode): - >f100: VDP data port (read/write) - >f102: VDP address/status port (read/write) - >f104: VDP port 2 - >f106: VDP port 3 - >f108->f10f: VDP mirror (used by Barry Boone's converted Tomy cartridges) - >f110->f117: memory page registers (>f110 for page 0, >f111 for page 1, - etc.) - >f118: key buffer - >f119->f11f: ??? - >f120: sound chip - >f121->f12f: ??? - >f130->f13f: clock chip - - Unpaged locations (tms9995 locations): - >f000->f0fb and >fffc->ffff: tms9995 RAM - >fffa->fffb: tms9995 timer register - Note: accessing tms9995 locations will also read/write corresponding paged - locations. - - - GROM emulator: - - The GPL interface is accessible only in TI99 mode. GPL data is fetched - from pages >38->3f. It uses a straight 16-bit address pointer. The - address pointer is incremented when the read data and write data ports - are accessed, and when the second byte of the GPL address is written. A - weird consequence of this is the fact that GPL data is always off by one - byte, i.e. GPL bytes 0, 1, 2... are stored in bytes 1, 2, 3... of pages - >38->3f (byte 0 of page >38 corresponds to GPL address >ffff). - - I think that I have once read that the geneve GROM emulator does not - emulate wrap-around within a GROM, i.e. address >1fff is followed by >2000 - (instead of >0000 with a real GROM). - - There are two ways to implement GPL address load and store. - One is maintaining 2 flags (one for address read and one for address write) - that tell if you are accessing address LSB: these flags must be cleared - whenever data is read, and the read flag must be cleared when the write - address port is written to. - The other is to shift the register and always read/write the MSByte of the - address pointer. The LSByte is copied to the MSbyte when the address is - read, whereas the former MSByte is copied to the LSByte when the address is - written. The address pointer must be incremented after the address is - written to. It will not harm if it is incremented after the address is - read, provided the LSByte has been cleared. - - - Cartridge emulator: - - The cartridge interface is in the >6000->7fff area. - - If CRU bit @>F7C is set, the cartridge area is always mapped to virtual - page >36. Writes in the >6000->6fff area are ignored if the CRU bit @>F7D - is 0, whereas writes in the >7000->7fff area are ignored if the CRU bit - @>F7E is 0. - - If CRU bit @>F7C is clear, the cartridge area is mapped either to virtual - page >36 or to page >37 according to which page is currently selected. - Writing data to address >6000->7fff will select page >36 if A14 is 0, - >37 if A14 is 1. - - - CRU map: - - Base >0000: tms9901 - tms9901 pin assignment: - int1: external interrupt (INTA on PE-bus) (connected to tms9995 (int4/EC)* - pin as well) - int2: VDP interrupt - int3-int7: joystick port inputs (fire, left, right, down, up) - int8: keyboard interrupt (asserted when key buffer full) - int9/p13: unused - int10/p12: third mouse button - int11/p11: clock interrupt? - int12/p10: INTB from PE-bus - int13/p9: (used as output) - int14/p8: unused - int15/p7: (used as output) - p0: PE-bus reset line - p1: VDP reset line - p2: joystick select (0 for joystick 1, 1 for joystick 2) - p3-p5: unused - p6: keyboard reset line - p7/int15: external mem cycles 0=long, 1=short - p9/int13: vdp wait cycles 1=add 15 cycles, 0=add none - - Base >1EE0 (>0F70): tms9995 flags and geneve mode register - bits 0-1: tms9995 flags - Bits 2-4: tms9995 interrupt state register - Bits 5-15: tms9995 user flags - overlaps geneve mode, but hopefully the - geneve registers are write-only, so no real conflict happens - TMS9995 user flags: - Bit 5: 0 if NTSC, 1 if PAL video - Bit 6: unused??? - Bit 7: some keyboard flag, set to 1 if caps is on - Geneve gate array + TMS9995 user flags: - Bit 8: 1 = allow keyboard clock - Bit 9: 0 = clear keyboard input buffer, 1 = allow keyboard buffer to be - loaded - Bit 10: 1 = geneve mode, 0 = ti99 mode - Bit 11: 1 = ROM mode, 0 = map mode - Bit 12: 0 = Enable cartridge paging - Bit 13: 0 = protect cartridge range >6000->6fff - Bit 14: 0 = protect cartridge range >7000->7fff - bit 15: 1 = add 1 extra wait state when accessing 0-wait-state SRAM??? - - Original version 2003 by Raphael Nabet - - Rewritten 2012 by Michael Zapf + + ====== Original system ========= + + Myarc Geneve 9640 + ================= + + +--------------------------------------------------------------------+ + | /---\ +---+ + | +-----+-----+ |Bat| |Vid() + | | | | +-HM62256---+ ____\---/ +---+ + | +-----+-----+ | 32K SRAM ||RTC_|+-------------+ +---+ + | | 512K | +-----------+ ____ | V9938 | |Mou[] + | +- DRAM ---+ +-----------+|Snd_|| VDP | +---+ + | | ... | ... | | 16K EPROM | +-------------+ +---+ + | | 16* | +-----------+ +----+ +--+ +----+ |Joy[] + | +--HM50256--+ +--------------+ | | +-----+ | | |Keyb| +---+ + | | 256Kx1 | | TMS9995 | | | |128K | | +---+( )+----+ + | +-----+-----+ | CPU | |TMS | +Video+ | + | | | | +--------------+ |9901| |RAM | | outside of box + | +-----+-----+ +--------+ +-+ | | +- - -+ | + | | | |P| | | |4*HM | | + | | Gate | |A| | | +50464+ | + | | Array | |L| +----+ |64Kx4| | + O= LED | | +-+ +-----+ | + | +-+ +--------+ +-+ | + +--------------+ | | +---------+ + Front ||||||||||||||||||||||| Back + +---------------------+ + + The Geneve 9640 is a card for the Peripheral Expansion Box of the TI-99/4A + system, equipped with a complete computing architecture and thus replaces + the TI console. It was created by the company Myarc Inc. in 1987, who also + manufactured several expansion cards for the TI system (like floppy disk + controllers, hard disk controllers, serial interfaces, memory expansions). + + The Geneve 9640 got its name purportedly from a picture at the wall of + one of its creators, showing the Swiss city Geneva (Geneve). The number + 9640 should be read as 9-640, with the 9 being a reference to the TI-99 + family (TI did not agree to use the 99 as a reference), and the 640 as + the amount of built-in RAM (CPU + video). + + It is equipped with a TMS9995 microprocessor, which is downward compatible + with the TMS9900 used in the TI console. It is clocked at 12 MHz, + internally divided by 4, which makes it compatible with the expected clock + rate of external devices, but internally it is much more efficient and + can execute TMS programs about 2-3 times faster. For more details, see + tms9995.cpp. + + General architecture + -------------------- + - CPU: TMS9995, 12 Mhz, with 256 bytes on-chip RAM and decrementer + - RAM: SRAM (32 KiB, 0 wait states, HM62256 32Kx8), + DRAM (512 KiB, 1 wait state, 16*HM50256 256Kx1) + - Video: Yamaha V9938 (compatible to TMS9928, also used in MSX2) + - Video memory: 128 KiB (4*HM50464 64Kx4) + - Sound: SN76496 (compat. to TMS9919) + - System interface: TMS9901 + - Real time clock: MM58274, battery-backed + - Keyboard: Connector for external XT-compatible keyboard + - Mouse: Bus mouse connector, going to the color bus of the V9938 + - Joysticks: TI-99/4A joystick connector + - Video output: RGB or composite via DIN plug + + A Gate Array circuit (labeled Myarc M60014-1004J 715500) contains most of + logic circuitry for device and memory selection, a memory mapper, and the + keyboard interface. Unfortunately, the details of its implementation must + be considered as lost. We can only guess its implementation by its + behavior. + + Also, a PAL circuit (PAL16R4ACN) is mounted on the board whose task is + to drive the READY line to the processor and selection lines to the + peribox. The equations of the PAL are available. The PAL controls + the creation of wait states according to the device or memory selected + by the Gate Array. + + + Operating modes + --------------- + To achieve a maximum degree of compatibility, the Geneve offers two + operation modes: native and GPL. + + In the GPL mode, memory space layout is largely equal to the TI-99/4A + layout, thus allowing programs to run without any adaptation. + + The native mode rearranges the memory layout in order to exploit all + capabilities of the enhanced architecture. However, this mode cannot run + older TI-99 programs. + + Memory Map + ---------- + The memory map is described in genboard.cpp where the emulation of the + Gate Array and the PAL are implemented. + + CRU map + ------- + The CRU space contains the selectable devices and flags of the system. + For more details, see genboard.cpp. + + + ====== Modifications =========== + + 32K SRAM expansion + ------------------ + The schematics prove that Myarc already planned for a 32K expansion of + the stock 32K SRAM memory. One additional chip is soldered on top + of the base 32K chip, with its CE* line (pin 20) wired to pin 48 of the + Gate Array (RAMEN-X*). + + The 32K expansion is required for releases of the operating system (MDOS) + later than version 2.5. + + + PFM: Boot EPROM replacement + --------------------------- + The Programmable Flash Memory mod replaces the stock EPROM (16K) by a + flash memory chip (AT29C040(A) for 512K). It is enabled by selecting + the machine configuration switch BOOTROM. When set to EPROM, the mod is + inactive. + + There were several versions. Only the third one is emulated, since it + functionally subsumes the other two: + + PFM: Original version, 128 KiB + PFM+: Expansion of the original version, piggybacked, adds another 128KiB + PFM512: Using an AT29C040 (not A), 512 KiB + + The PFM512 is visible as four banks in memory pages 0xF0-0xFF. + Bank 0 is the boot code, while banks 1-3 can be used as flash drives. + + The lower 13 bits (A3-A15 by TI counting) of its memory space are set by + the main address bus, provided that the Gate Array enables the access. + This is true when the EPROM bank area is accessed (pages F0-FF) or in + direct mode (unmapped mode, used during boot). + + The next four bits (AMA, AB0, AB1, AB2) are set by the Gate Array as the + lower four bits of the page number (F0-FF, i.e. 0-F). Note that the AMB + and further lines cannot be used, because the boot ROM area is restricted + to that range by the Gate Array. + + To set the most significant two bits of the flash memory chip (A17 and A18 + in the usual counting), two dedicated CRU bits are used, set and latched + by the 9901 chip. Also, the output can be disabled by another CRU bit. + + CRU 0028: LSB of bank number + CRU 003A: MSB of bank number + CRU 002A: PFM output enable + + Genmod + ------ + A special modification was published for the Geneve around 1990. The goal + was to fill all memory space with physical memory from a memory + expansion card, and also to make use of 0-wait state SRAM from this card. + The mod required some few changes on the Geneve card. The Geneve itself + never had a large user base, compared to the 99/4A, and this modification + was even much rarer. Nevertheless, its interesting point is that it + in fact expands the Geneve architecture to its maximum. + + For more details, see genboard.cpp. + + Genmod is treated as a separate system in MAME. Beside the modified + hardware, it also requires a modified boot ROM. + + ============================================ + + 2003: Original version by Raphael Nabet + 2012: Rewritten by Michael Zapf (functionally, high level) + 2019: Rewritten by Michael Zapf (closer to the actual hardware) + ******************************************************************************/ #include "emu.h" @@ -204,16 +192,33 @@ #include "speaker.h" #define LOG_WARN (1U<<1) -#define LOG_READY (1U<<2) -#define LOG_LINES (1U<<3) #define LOG_CRU (1U<<4) #define LOG_CRUKEY (1U<<5) +#define LOG_READ (1U<<6) +#define LOG_READG (1U<<7) +#define LOG_WRITE (1U<<8) +#define LOG_SETTING (1U<<9) +#define LOG_PFM (1U<<10) // Minimum log should be settings and warnings -#define VERBOSE ( LOG_GENERAL | LOG_WARN ) +#define VERBOSE ( LOG_GENERAL | LOG_SETTING | LOG_WARN ) #include "logmacro.h" +#define GENEVE_SRAM_TAG "sram" +#define GENEVE_SRAMX_TAG "sramexp" +#define GENEVE_DRAM_TAG "dram" +#define GENEVE_CLOCK_TAG "mm58274c" + +enum +{ + AB2 = 1, + AB1 = 2, + AB0 = 4, + AMA = 8, + FULLGEN = 63, // AMC,AMB,AMA,AB0,AB1,AB2 + FULLGNM = 255 // AME,AMD,FULLGEN +}; void geneve_xt_keyboards(device_slot_interface &device) { @@ -229,20 +234,37 @@ public: : driver_device(mconfig, type, tag), m_cpu(*this, "maincpu"), m_tms9901(*this, TI_TMS9901_TAG), + m_sound(*this, TI_SOUNDCHIP_TAG), + m_video(*this, TI_VDP_TAG), + m_rtc(*this, GENEVE_CLOCK_TAG), + m_dram(*this, GENEVE_DRAM_TAG), + m_sram(*this, GENEVE_SRAM_TAG), + m_sramx(*this, GENEVE_SRAMX_TAG), m_gatearray(*this, GENEVE_GATE_ARRAY_TAG), - m_peribox(*this, TI_PERIBOX_TAG), + m_genmod_decoder(*this, GENMOD_DECODER_TAG), + m_pal(*this, GENEVE_PAL_TAG), m_joyport(*this, TI_JOYPORT_TAG), m_colorbus(*this, COLORBUS_TAG), m_kbdconn(*this, GENEVE_KEYBOARD_CONN_TAG), - m_left_button(0) + m_peribox(*this, TI_PERIBOX_TAG), + m_pfm512(*this, GENEVE_PFM512_TAG), + m_pfm512a(*this, GENEVE_PFM512A_TAG), + m_left_button(0), + m_pfm_prefix(0), + m_pfm_oe(true), + m_sram_exp(true), + m_genmod(false) { } void geneve_common(machine_config &config); void geneve(machine_config &config); void genmod(machine_config &config); - void init_geneve(); + void init_genmod(); + + DECLARE_INPUT_CHANGED_MEMBER( settings_changed ); + DECLARE_INPUT_CHANGED_MEMBER( setgm_changed ); private: // CRU (Communication Register Unit) handling @@ -254,7 +276,6 @@ private: DECLARE_WRITE_LINE_MEMBER(peripheral_bus_reset); DECLARE_WRITE_LINE_MEMBER(VDP_reset); DECLARE_WRITE_LINE_MEMBER(joystick_select); - DECLARE_WRITE_LINE_MEMBER(extbus_wait_states); DECLARE_WRITE_LINE_MEMBER(keyboard_reset); DECLARE_WRITE_LINE_MEMBER(video_wait_states); DECLARE_WRITE_LINE_MEMBER(left_mouse_button); @@ -270,39 +291,75 @@ private: DECLARE_WRITE_LINE_MEMBER( keyboard_interrupt ); - required_device<tms9995_device> m_cpu; - required_device<tms9901_device> m_tms9901; - required_device<bus::ti99::internal::geneve_gate_array_device> m_gatearray; - required_device<bus::ti99::peb::peribox_device> m_peribox; - required_device<bus::ti99::joyport::joyport_device> m_joyport; - required_device<bus::ti99::colorbus::v9938_colorbus_device> m_colorbus; - required_device<pc_kbdc_device> m_kbdconn; + required_device<tms9995_device> m_cpu; + required_device<tms9901_device> m_tms9901; + required_device<sn76496_device> m_sound; + required_device<v9938_device> m_video; + required_device<mm58274c_device> m_rtc; + required_device<ram_device> m_dram; + required_device<ram_device> m_sram; + required_device<ram_device> m_sramx; + + required_device<bus::ti99::internal::geneve_gate_array_device> m_gatearray; + optional_device<bus::ti99::internal::genmod_decoder_device> m_genmod_decoder; + required_device<bus::ti99::internal::geneve_pal_device> m_pal; + required_device<bus::ti99::joyport::joyport_device> m_joyport; + required_device<bus::ti99::colorbus::v9938_colorbus_device> m_colorbus; + required_device<pc_kbdc_device> m_kbdconn; + required_device<bus::ti99::peb::peribox_device> m_peribox; + + uint8_t* m_eprom; // Pointer to the EPROM + // PFM expansion + required_device<at29c040_device> m_pfm512; + required_device<at29c040a_device> m_pfm512a; + void read_eprom_or_pfm(offs_t offset, uint8_t& value); + void write_pfm(offs_t offset, uint8_t data); + + DECLARE_WRITE_LINE_MEMBER( pfm_a17 ); + DECLARE_WRITE_LINE_MEMBER( pfm_a18 ); + DECLARE_WRITE_LINE_MEMBER( pfm_oe ); + + // Interrupts DECLARE_WRITE_LINE_MEMBER( inta ); DECLARE_WRITE_LINE_MEMBER( intb ); - DECLARE_WRITE_LINE_MEMBER( ext_ready ); - DECLARE_WRITE_LINE_MEMBER( mapper_ready ); DECLARE_WRITE_LINE_MEMBER( keyboard_int ); + DECLARE_WRITE_LINE_MEMBER( int2_from_v9938 ); + + // READY line contributors + DECLARE_WRITE_LINE_MEMBER( extready ); + DECLARE_WRITE_LINE_MEMBER( sndready ); + + // Memory bus + void setaddress_debug(bool debug, offs_t address, uint8_t busctrl); + void setaddress(offs_t address, uint8_t busctrl); + DECLARE_READ8_MEMBER( memread ); + DECLARE_WRITE8_MEMBER( memwrite ); + + void crumap(address_map &map); + void memmap(address_map &map); + void memmap_setaddress(address_map &map); + // General device lifecycle virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_WRITE_LINE_MEMBER(set_tms9901_INT2_from_v9938); - + // Members int m_inta; int m_intb; int m_int2; int m_keyint; - int m_video_wait; // reflects the line to the mapper for CRU query - int m_ready_line; - int m_ready_line1; + int m_left_button; // Left mouse button, not wired to the 9938 + int m_pfm_prefix; + bool m_pfm_oe; - int m_left_button; + // Settings + int m_boot_rom; // Kind of boot ROM (EPROM or PFM512 or PFM512A) + bool m_sram_exp; - void crumap(address_map &map); - void memmap(address_map &map); - void memmap_setaddress(address_map &map); + // Genmod modifications + bool m_genmod; }; /* @@ -311,12 +368,12 @@ private: void geneve_state::memmap(address_map &map) { - map(0x0000, 0xffff).rw(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::readm), FUNC(bus::ti99::internal::geneve_gate_array_device::writem)); + map(0x0000, 0xffff).rw(FUNC(geneve_state::memread), FUNC(geneve_state::memwrite)); } void geneve_state::memmap_setaddress(address_map &map) { - map(0x0000, 0xffff).w(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::setaddress)); + map(0x0000, 0xffff).w(FUNC(geneve_state::setaddress)); } /* @@ -324,19 +381,19 @@ void geneve_state::memmap_setaddress(address_map &map) The TMS9901 is fully decoded, no mirroring, so we have 32 bits for it, and the rest goes to the board (and from there to the PEB) TMS9995 has a full 15-bit CRU bit address space (attached to A0-A14) - TODO: Check whether A0-A2 are available for CRU addressing since those - bits are usually routed through the mapper first. */ void geneve_state::crumap(address_map &map) { map(0x0000, 0xffff).rw(FUNC(geneve_state::cruread), FUNC(geneve_state::cruwrite)); + map(0x1ee0, 0x1eff).w(m_gatearray, FUNC(bus::ti99::internal::geneve_gate_array_device::cru_ctrl_write)); + map(0x13c0, 0x13cf).w(m_gatearray, FUNC(bus::ti99::internal::geneve_gate_array_device::cru_sstep_write)); map(0x0000, 0x003f).rw(m_tms9901, FUNC(tms9901_device::read), FUNC(tms9901_device::write)); } static INPUT_PORTS_START(geneve_common) PORT_START( "BOOTROM" ) - PORT_CONFNAME( 0x03, GENEVE_EPROM, "Boot from" ) PORT_CHANGED_MEMBER(GENEVE_GATE_ARRAY_TAG, bus::ti99::internal::geneve_gate_array_device, settings_changed, 3) + PORT_CONFNAME( 0x03, GENEVE_EPROM, "Boot from" ) PORT_CHANGED_MEMBER(DEVICE_SELF, geneve_state, settings_changed, 3) PORT_CONFSETTING( GENEVE_EPROM, "EPROM" ) PORT_CONFSETTING( GENEVE_PFM512, "PFM 512" ) PORT_CONFSETTING( GENEVE_PFM512A, "PFM 512A" ) @@ -352,10 +409,9 @@ static INPUT_PORTS_START(geneve) PORT_INCLUDE(geneve_common) PORT_START( "SRAM" ) - PORT_CONFNAME( 0x03, 0x01, "Onboard SRAM" ) - PORT_CONFSETTING( 0x00, "32 KiB" ) - PORT_CONFSETTING( 0x01, "64 KiB" ) - PORT_CONFSETTING( 0x02, "384 KiB" ) + PORT_CONFNAME( 0x03, 0x01, "SRAM expansion 32K" ) + PORT_CONFSETTING( 0x00, "off" ) + PORT_CONFSETTING( 0x01, "on" ) INPUT_PORTS_END @@ -363,113 +419,414 @@ static INPUT_PORTS_START(genmod) PORT_INCLUDE(geneve_common) PORT_START( "GENMODDIPS" ) - PORT_DIPNAME( GENEVE_GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CHANGED_MEMBER(GENEVE_GATE_ARRAY_TAG, bus::ti99::internal::genmod_gate_array_device, setgm_changed, 1) + PORT_DIPNAME( GENEVE_GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CHANGED_MEMBER(DEVICE_SELF, geneve_state, setgm_changed, 1) PORT_CONFSETTING( 0x00, DEF_STR( Off )) PORT_CONFSETTING( GENEVE_GM_TURBO, DEF_STR( On )) - PORT_DIPNAME( GENEVE_GM_TIM, GENEVE_GM_TIM, "Genmod TI mode") PORT_CHANGED_MEMBER(GENEVE_GATE_ARRAY_TAG, bus::ti99::internal::genmod_gate_array_device, setgm_changed, 2) + PORT_DIPNAME( GENEVE_GM_TIM, GENEVE_GM_TIM, "Genmod TI mode") PORT_CHANGED_MEMBER(DEVICE_SELF, geneve_state, setgm_changed, 2) PORT_CONFSETTING( 0x00, DEF_STR( Off )) PORT_CONFSETTING( GENEVE_GM_TIM, DEF_STR( On )) INPUT_PORTS_END +INPUT_CHANGED_MEMBER( geneve_state::settings_changed ) +{ + // Used when switching the boot ROMs during runtime, especially the PFM + m_boot_rom = newval; +} -/**************************************************************************** - CRU handling -*****************************************************************************/ +INPUT_CHANGED_MEMBER( geneve_state::setgm_changed ) +{ + int number = int(param&0x03); + int value = newval; -#define CRU_CONTROL_BASE 0x1ee0 -#define CRU_SSTEP_BASE 0x13c0 + switch (number) + { + case 1: + // Turbo switch. May be changed at any time. + LOGMASKED(LOG_SETTING, "Setting turbo flag to %d\n", value); + m_genmod_decoder->set_turbo(value!=0); + break; + case 2: + // TIMode switch. Causes reset when changed. + LOGMASKED(LOG_SETTING, "Setting timode flag to %d\n", value); + m_genmod_decoder->set_timode(value!=0); + machine().schedule_hard_reset(); + break; + case 3: + // Used when switching the boot ROMs during runtime, especially the PFM + m_boot_rom = value; + break; + default: + LOGMASKED(LOG_WARN, "Unknown setting %d ignored\n", number); + } +} -void geneve_state::cruwrite(offs_t offset, uint8_t data) +/* + Propagate the address bus levels to the Gate Array. This will make it + create waitstates before the read operation and assert the selector lines. +*/ +void geneve_state::setaddress(offs_t address, uint8_t busctrl) { - int addroff = offset << 1; + setaddress_debug(false, address, busctrl); +} - // Single step - // 13c0 - 13fe: 0001 0011 11xx xxx0 - if ((addroff & 0xffc0) == CRU_SSTEP_BASE) +void geneve_state::setaddress_debug(bool debug, offs_t address, uint8_t busctrl) +{ + m_gatearray->set_debug(debug); + m_gatearray->setaddress(address, busctrl); + + // Genmod + if (m_genmod) + { + m_genmod_decoder->set_debug(debug); + m_genmod_decoder->set_function(m_gatearray->get_function(), m_gatearray->get_prefix(FULLGNM)>>13); + } + + // Insert a wait state except for SRAM (not by debugger) + if (!debug) + { + // Note that the CSR/CSW inputs must not be asserted for more than + // 2 us; i.e. they cannot remain asserted for the whole 14 wait cycles + // (which are 4.6 us). Accordingly, we have to assume that the CSW/CSR + // signals are only asserted for a single clock cycle (333ns, which + // is more than the minimum pulse width of 186 ns). + // See V9938 specs + m_pal->csw_in(m_gatearray->csw_out()); + m_pal->csr_in(m_gatearray->csr_out()); + } + + // Going to the box + int extbus = m_genmod? m_genmod_decoder->dben_out() : m_gatearray->dben_out(); + + if (extbus==ASSERT_LINE) + { + offs_t addr13 = address & 0x1fff; + m_peribox->memen_in(ASSERT_LINE); + m_peribox->setaddress_dbin(m_gatearray->get_prefix(m_genmod? FULLGNM : FULLGEN) | addr13, ((busctrl & TMS99xx_BUS_DBIN)!=0)); + } +} + +READ8_MEMBER( geneve_state::memread ) +{ + uint8_t value = 0; + offs_t sramadd; + offs_t dramadd; + offs_t pboxadd; + offs_t addr13 = offset & 0x1fff; + // For debugging + int page = m_gatearray->get_prefix(FULLGNM) >> 13; + + if (machine().side_effects_disabled()) + { + if (m_cpu->is_onchip(offset)) + return m_cpu->debug_read_onchip_memory(offset); + + // The debugger does not call setaddress, so we do it here + // Also, the decode result is replaced by the debugger version + setaddress_debug(true, offset, TMS99xx_BUS_DBIN); + } + + // Video read (never by debugger) + if (m_gatearray->csr_out()==ASSERT_LINE) + { + value = m_video->read((offset>>1)&3); // M1=A13, M0=A14 + LOGMASKED(LOG_READ, "Video %04x -> %02x\n", offset, value); + } + + // All of the following parts are accessed in parallel and can set the + // value on the data bus. In reality, if several of them did, this would + // be a bug and likely damage the machine. + + // Gate array itself (Keyboard, mapper, GROM address register) + // If not addressed, value remains unchanged + m_gatearray->readz(value); + + // Clock + // The clock is connected with only 4 data bits. Tests on the real machine + // showed that the upper nibble is 0xf (probably because of the location + // at f130-f13f?) + // In TI mode, however, the upper nibble is 1, unless we read 801f, + // in which case the nibble is 2. Here the location is 8010-801f. + // Needs more investigation. Simply clearing the upper nibble will not work + // for some software that assumes these bits to be set. + if (m_gatearray->rtcen_out()==ASSERT_LINE) + { + value = m_rtc->read(offset & 0x000f); + if (m_gatearray->geneve_mode()) + value |= 0xf0; + else + value |= ((offset & 0x001f)+1) & 0xf0; + + LOGMASKED(LOG_READ, "Clock %04x -> %02x\n", offset, value); + } + + // DRAM (also for GROM simulator) + // Genmod uses the box, but also the DRAM in parallel. Only for + // TIMODE, the box access is suppressed. + if (m_gatearray->accessing_dram()) { - int bit = (addroff & 0x003e)>>1; - LOGMASKED(LOG_WARN, "Single step not implemented; bit %d set to %d\n", bit, data); - return; + dramadd = m_gatearray->get_dram_address(); + value = m_dram->pointer()[dramadd]; + int dpage = dramadd >> 13; + + const char* ramtype = (m_gatearray->accessing_grom())? "GROM" : "DRAM"; + LOGMASKED(LOG_READ, "%s %02x:%04x -> %02x\n", ramtype, dpage, addr13, value); } - // This is just mirroring the internal flags of the 9995 - if ((addroff & 0xffe0) == CRU_CONTROL_BASE) + // Boot ROM or PFM (normal and Genmod) + if (m_gatearray->romen_out()==ASSERT_LINE) + read_eprom_or_pfm(offset, value); + + // Stock SRAM 32K (normal and Genmod) + if (m_gatearray->ramen_out()==ASSERT_LINE) { - int bit = (addroff & 0x001e)>>1; - switch (bit) + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + value = m_sram->pointer()[sramadd]; + LOGMASKED(LOG_READ, "SRAM %02x:%04x -> %02x\n", page, addr13, value); + } + + // Expanded SRAM 32K (not in Genmod) + if (!m_genmod) + { + if (m_gatearray->ramenx_out()==ASSERT_LINE) { - case 5: - // No one really cares... - LOGMASKED(LOG_CRU, "Set PAL flag = %02x\n", data); - // m_palvideo = (data!=0); - break; - case 7: - // m_capslock = (data!=0); - LOGMASKED(LOG_CRU, "Set capslock flag = %02x\n", data); - break; - case 8: - LOGMASKED(LOG_CRUKEY, "Set keyboard clock = %02x\n", data); - m_gatearray->set_keyboard_clock(data); - break; - case 9: - LOGMASKED(LOG_CRUKEY, "Enable keyboard shift reg = %02x\n", data); - m_gatearray->enable_shift_register(data); - break; - case 10: - LOGMASKED(LOG_CRU, "Geneve mode = %02x\n", data); - m_gatearray->set_geneve_mode(data!=0); - break; - case 11: - LOGMASKED(LOG_CRU, "Direct mode = %02x\n", data); - m_gatearray->set_direct_mode(data!=0); - break; - case 12: - LOGMASKED(LOG_CRU, "Cartridge size 8K = %02x\n", data); - m_gatearray->set_cartridge_size((data!=0)? 0x2000 : 0x4000); - break; - case 13: - LOGMASKED(LOG_CRU, "Cartridge writable 6000 = %02x\n", data); - m_gatearray->set_cartridge_writable(0x6000, (data!=0)); - break; - case 14: - LOGMASKED(LOG_CRU, "Cartridge writable 7000 = %02x\n", data); - m_gatearray->set_cartridge_writable(0x7000, (data!=0)); - break; - case 15: - LOGMASKED(LOG_CRU, "Extra wait states = %02x\n", data==0); - m_gatearray->set_extra_waitstates(data==0); // let's use the inverse semantics - break; - default: - LOGMASKED(LOG_WARN, "set CRU address %04x=%02x ignored\n", addroff, data); - break; + if (m_sram_exp) + { + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + value = m_sramx->pointer()[sramadd]; + LOGMASKED(LOG_READ, "SRAMX %02x:%04x -> %02x\n", page, addr13, value); + } + else + LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); } } - else + + // Peripheral box + if ((m_genmod && m_genmod_decoder->dben_out()) + || (!m_genmod && m_gatearray->dben_out()==ASSERT_LINE)) { - m_peribox->cruwrite(addroff, data); + pboxadd = m_gatearray->get_prefix(m_genmod? FULLGNM : FULLGEN) | addr13; + m_peribox->readz(pboxadd, &value); + m_peribox->memen_in(CLEAR_LINE); + LOGMASKED(LOG_READ, "PEB %02x:%04x -> %02x\n", page, addr13, value); } + + // In case we had a debugger read, reset the flag. + m_gatearray->set_debug(false); + + return value; } -uint8_t geneve_state::cruread(offs_t offset) +WRITE8_MEMBER( geneve_state::memwrite ) { - uint8_t value = 0; - uint16_t addroff = offset << 1; + offs_t sramadd = 0; + offs_t dramadd = 0; + offs_t pboxadd = 0; + + offs_t addr13 = offset & 0x1fff; + // For debugging + int page = m_gatearray->get_prefix(FULLGNM) >> 13; + + if (machine().side_effects_disabled()) + { + // TODO: add method to tms9995 +// if (m_cpu->is_onchip(offset)) +// { +// m_cpu->debug_write_onchip_memory(offset, data); +// return; +// } + + // The debugger does not call setaddress, so we do it here + // Also, the decode result is replaced by the debugger version + setaddress_debug(true, addr13, 0); + } + + // Video write (never by debugger) + if (m_gatearray->csw_out()==ASSERT_LINE) + { + LOGMASKED(LOG_WRITE, "Video %04x <- %02x\n", offset, data); + m_video->write((offset>>1)&3, data); // M1=A13, M0=A14 + } + + // Gate array itself (Keyboard, mapper, GROM address (not by debugger)) + // Has no effect when not addressed + m_gatearray->write(data); + + // Clock + if (m_gatearray->rtcen_out()==ASSERT_LINE) + { + LOGMASKED(LOG_WRITE, "Clock %04x <- %02x\n", offset, data); + m_rtc->write(offset & 0x000f, data); + } + + // DRAM (also for GROM simulator) + if (m_gatearray->accessing_dram()) + { + // We block the write access to the DRAM for the Genmod when not in TI mode + // This is not verified to happen on the real machine, but if we do not + // block, page 3A will be declared as available, which is wrong. + if (!m_genmod || !m_genmod_decoder->dben_out()) + { + dramadd = m_gatearray->get_dram_address(); + m_dram->pointer()[dramadd] = data; + const char* ramtype = (m_gatearray->accessing_grom())? "GROM" : "DRAM"; + LOGMASKED(LOG_WRITE, "%s %02x:%04x <- %02x\n", ramtype, page, addr13, data); + } + } - // Single step - // 13c0 - 13fe: 0001 0011 11xx xxx0 - if ((addroff & 0xffc0) == CRU_SSTEP_BASE) + // Sound + if (m_gatearray->snden_out()==ASSERT_LINE) { - int bit = (addroff & 0x003e)>>1; - LOGMASKED(LOG_WARN, "Single step not implemented; attempting to read bit %d\n", bit); - return value; + LOGMASKED(LOG_WRITE, "Sound %04x <- %02x\n", offset, data); + m_sound->write(data); } - // TMS9995-internal CRU locations (1ee0-1efe) are handled within the processor - // so we just don't arrive here + // Boot ROM or PFM (normal and Genmod) + if (m_gatearray->romen_out()==ASSERT_LINE) + write_pfm(offset, data); + + // Stock SRAM 32K + if (m_gatearray->ramen_out()==ASSERT_LINE) + { + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + LOGMASKED(LOG_WRITE, "SRAM %02x:%04x <- %02x\n", page, addr13, data); + m_sram->pointer()[sramadd] = data; + } + // Expanded SRAM + if (!m_genmod) + { + if (m_gatearray->ramenx_out()==ASSERT_LINE) + { + if (m_sram_exp) + { + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + LOGMASKED(LOG_WRITE, "SRAMX %02x:%04x <- %02x\n", page, addr13, data); + m_sramx->pointer()[sramadd] = data; + } + else + LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + } + } + + // Peripheral box + if ((m_genmod && m_genmod_decoder->dben_out()) + || (!m_genmod && m_gatearray->dben_out()==ASSERT_LINE)) + { + pboxadd = m_gatearray->get_prefix(m_genmod? FULLGNM : FULLGEN) | addr13; + LOGMASKED(LOG_WRITE, "PEB %02x:%04x <- %02x\n", page, addr13, data); + m_peribox->write(pboxadd, data); + m_peribox->memen_in(CLEAR_LINE); + } + + // In case we had a debugger write, reset the flag. + m_gatearray->set_debug(false); +} + +/**************************************************************************** + PFM handling +*****************************************************************************/ + +WRITE_LINE_MEMBER( geneve_state::pfm_a17 ) +{ + if (state==ASSERT_LINE) m_pfm_prefix |= 0x20000; + else m_pfm_prefix &= ~0x20000; +} + +WRITE_LINE_MEMBER( geneve_state::pfm_a18 ) +{ + if (state==ASSERT_LINE) m_pfm_prefix |= 0x40000; + else m_pfm_prefix &= ~0x40000; +} + +WRITE_LINE_MEMBER( geneve_state::pfm_oe ) +{ + // Negative logic + LOGMASKED(LOG_PFM, "PFM output %s\n", (state==0)? "enable" : "disable"); + m_pfm_oe = (state==0); +} + +/* + Boot ROM handling, from EPROM or PFM. +*/ +void geneve_state::read_eprom_or_pfm(offs_t offset, uint8_t& value) +{ + int pfmaddress; + offs_t addr13 = offset & 0x1fff; + int page = m_gatearray->get_prefix(FULLGNM) >> 13; + + switch (m_boot_rom) + { + case GENEVE_EPROM: + // Mirrors at pages F0, F2, F4,... FE, and F1, F3, ... FF. + value = m_eprom[addr13 | m_gatearray->get_prefix(AB2)]; + LOGMASKED(LOG_READ, "EPROM %02x:%04x -> %02x\n", page, addr13, value); + break; + case GENEVE_PFM512: + pfmaddress = addr13 | m_gatearray->get_prefix(AMA | AB0 | AB1 | AB2) | m_pfm_prefix; + if (m_pfm_oe) + { + value = m_pfm512->read(pfmaddress); + LOGMASKED(LOG_PFM, "PFM %02x:%04x -> %02x\n", page, addr13, value); + } + else LOGMASKED(LOG_PFM, "PFM512 disabled\n"); + break; + case GENEVE_PFM512A: + pfmaddress = addr13 | m_gatearray->get_prefix(AMA | AB0 | AB1 | AB2) | m_pfm_prefix; + if (m_pfm_oe) + { + value = m_pfm512a->read(pfmaddress); + LOGMASKED(LOG_PFM, "PFM %02x:%04x -> %02x\n", page, addr13, value); + } + else LOGMASKED(LOG_PFM, "PFM512a disabled\n"); + break; + default: + LOGMASKED(LOG_WARN, "Illegal mode for reading boot ROM: %d\n", m_boot_rom); + } +} + +void geneve_state::write_pfm(offs_t offset, uint8_t data) +{ + // Nota bene: The PFM must be write protected on startup, or the RESET + // of the 9995 will attempt to write the return vector into the flash EEPROM + offs_t addr13 = offset & 0x1fff; + int pfmaddress = addr13 | m_gatearray->get_prefix(AMA | AB0 | AB1 | AB2) | m_pfm_prefix; + int page = m_gatearray->get_prefix(FULLGNM) >> 13; + + switch (m_boot_rom) + { + case GENEVE_EPROM: + LOGMASKED(LOG_WARN, "Write to EPROM at %02x:%04x ignored\n", page, addr13); + break; + case GENEVE_PFM512: + m_pfm512->write(pfmaddress, data); + LOGMASKED(LOG_PFM, "PFM %02x:%04x <- %02x\n", page, addr13, data); + break; + case GENEVE_PFM512A: + m_pfm512a->write(pfmaddress, data); + LOGMASKED(LOG_PFM, "PFMa %02x:%04x <- %02x\n", page, addr13, data); + break; + default: + LOGMASKED(LOG_WARN, "Illegal mode for writing to PFM: %d\n", m_boot_rom); + } +} + +/**************************************************************************** + CRU handling +*****************************************************************************/ + +// TODO: change peribox::cruwrite to make this obsolete + +void geneve_state::cruwrite(offs_t offset, uint8_t data) +{ + m_peribox->cruwrite(offset << 1, data); +} + +uint8_t geneve_state::cruread(offs_t offset) +{ + uint8_t value = 0; // Propagate the CRU access to external devices - m_peribox->crureadz(addroff, &value); + m_peribox->crureadz(offset << 1, &value); return value; } @@ -532,7 +889,7 @@ WRITE_LINE_MEMBER( geneve_state::left_mouse_button ) */ WRITE_LINE_MEMBER( geneve_state::peripheral_bus_reset ) { - LOGMASKED(LOG_WARN, "Peripheral bus reset request; not implemented yet.\n"); + m_peribox->reset_in(state); } /* @@ -540,7 +897,7 @@ WRITE_LINE_MEMBER( geneve_state::peripheral_bus_reset ) */ WRITE_LINE_MEMBER( geneve_state::VDP_reset ) { - LOGMASKED(LOG_WARN, "Video reset request; not implemented yet.\n"); + m_video->reset_line(state); } /* @@ -551,32 +908,14 @@ WRITE_LINE_MEMBER( geneve_state::joystick_select ) m_joyport->write_port((state==ASSERT_LINE)? 1:2); } - -/* - Write external mem cycles (0=long, 1=short) -*/ -WRITE_LINE_MEMBER( geneve_state::extbus_wait_states ) -{ - LOGMASKED(LOG_WARN, "External bus wait states set to %d, not implemented yet.\n", state); -} - /* - Write vdp wait cycles (1=add 14 cycles, 0=add none) - see above for waitstate handling -*/ -WRITE_LINE_MEMBER( geneve_state::video_wait_states ) -{ - LOGMASKED(LOG_LINES, "Video wait states set to %d\n", state); - m_gatearray->set_video_waitstates(state==ASSERT_LINE); - m_video_wait = (state!=0)? ASSERT_LINE : CLEAR_LINE; -} - -/* - Keyboard reset (active low). + Keyboard reset (active low). Most keyboards do not use a dedicated reset + line but trigger a reset when the clock line is held low for some time. */ WRITE_LINE_MEMBER( geneve_state::keyboard_reset ) { - LOGMASKED(LOG_CRUKEY, "Keyboard reset %d\n", state); + if (state==CLEAR_LINE) + LOGMASKED(LOG_GENERAL, "Keyboard reset (line not connected)\n"); } /* @@ -614,24 +953,10 @@ WRITE_LINE_MEMBER( geneve_state::intb ) m_tms9901->set_int_line(12, state); } -WRITE_LINE_MEMBER( geneve_state::ext_ready ) -{ - LOGMASKED(LOG_READY, "READY level (ext) = %02x\n", state); - m_ready_line = state; - m_cpu->ready_line((m_ready_line == ASSERT_LINE && m_ready_line1 == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE); -} - -WRITE_LINE_MEMBER( geneve_state::mapper_ready ) -{ - LOGMASKED(LOG_READY, "READY level (mapper) = %02x\n", state); - m_ready_line1 = state; - m_cpu->ready_line((m_ready_line == ASSERT_LINE && m_ready_line1 == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE); -} - /* set the state of int2 (called by the v9938 core) */ -WRITE_LINE_MEMBER(geneve_state::set_tms9901_INT2_from_v9938) +WRITE_LINE_MEMBER(geneve_state::int2_from_v9938) { // This method is frequently called without level change, so we only // react on changes @@ -651,6 +976,26 @@ WRITE_LINE_MEMBER( geneve_state::keyboard_interrupt ) m_tms9901->set_int_line(8, state); } +/* + READY from the box is connected to the Gate Array and the Genmod board. +*/ +WRITE_LINE_MEMBER( geneve_state::extready ) +{ + m_gatearray->extready_in(state); + if (m_genmod) + m_genmod_decoder->extready_in(state); +} + +/* + READY from the sound chip is connected to the Gate Array and the Genmod board. +*/ +WRITE_LINE_MEMBER( geneve_state::sndready ) +{ + m_gatearray->sndready_in(state); + if (m_genmod) + m_genmod_decoder->sndready_in(state); +} + void geneve_state::external_operation(offs_t offset, uint8_t data) { static char const *const extop[8] = { "inv1", "inv2", "IDLE", "RSET", "inv3", "CKON", "CKOF", "LREX" }; @@ -665,10 +1010,45 @@ WRITE_LINE_MEMBER( geneve_state::clock_out ) { m_tms9901->phi_line(state); m_gatearray->clock_in(state); + + + if (state==ASSERT_LINE) + { + // Video also has a GA waitstate, in addition to the video wait states + // obviously, when comparing to the real machine + + int readyin = m_gatearray->gaready_out(); + if (m_genmod) + { + m_genmod_decoder->gaready_in(readyin); + readyin = m_genmod_decoder->gaready_out(); + } + m_pal->gaready_in(readyin); + } + else + { + // Stop the pulse after one cycle for video write. Video read + // will be reset by the next access. + if (m_gatearray->csw_out()==ASSERT_LINE) + { + m_pal->csw_in(CLEAR_LINE); + } // see pal_device::set_ready + + // The pulse must be active so that the READY line is asserted after + // the ext waitstate + } + + m_pal->clock_in(state); } void geneve_state::init_geneve() { + m_genmod = false; +} + +void geneve_state::init_genmod() +{ + m_genmod = true; } void geneve_state::machine_start() @@ -677,10 +1057,9 @@ void geneve_state::machine_start() save_item(NAME(m_intb)); save_item(NAME(m_int2)); save_item(NAME(m_keyint)); - save_item(NAME(m_video_wait)); // reflects the line to the mapper for CRU query - save_item(NAME(m_ready_line)); - save_item(NAME(m_ready_line1)); save_item(NAME(m_left_button)); + save_item(NAME(m_pfm_prefix)); + save_item(NAME(m_pfm_oe)); } /* @@ -699,9 +1078,30 @@ void geneve_state::machine_reset() m_cpu->hold_line(CLEAR_LINE); m_cpu->reset_line(ASSERT_LINE); - m_ready_line = m_ready_line1 = ASSERT_LINE; - m_joyport->write_port(0x01); // select Joystick 1 + + // Configuring the VRAM size + uint32_t videoram = (ioport("VRAM")->read()!=0)? 0x30000 : 0x20000; + m_video->set_vram_size(videoram); + LOGMASKED(LOG_SETTING, "Video RAM set to %d KiB\n", videoram / 1024); + + // Check which boot EPROM we are using (or PFM) + m_eprom = memregion("maincpu")->base(); + m_boot_rom = ioport("BOOTROM")->read(); + + if (m_genmod) + { + m_sram_exp = false; + m_genmod_decoder->set_turbo((ioport("GENMODDIPS")->read() & GENEVE_GM_TURBO)!=0); + m_genmod_decoder->set_timode((ioport("GENMODDIPS")->read() & GENEVE_GM_TIM)!=0); + } + else + { + // SRAM expansion + // Only separately handled for the standard Geneve; Genmod uses + // the Memex instead + m_sram_exp = (ioport("SRAM")->read()!=0); + } } void geneve_state::geneve(machine_config &config) @@ -710,30 +1110,29 @@ void geneve_state::geneve(machine_config &config) // Gate array GENEVE_GATE_ARRAY(config, m_gatearray, 0); - m_gatearray->ready_cb().set(FUNC(geneve_state::mapper_ready)); m_gatearray->kbdint_cb().set(FUNC(geneve_state::keyboard_interrupt)); // Peripheral expansion box (Geneve composition) TI99_PERIBOX_GEN(config, m_peribox, 0); m_peribox->inta_cb().set(FUNC(geneve_state::inta)); m_peribox->intb_cb().set(FUNC(geneve_state::intb)); - m_peribox->ready_cb().set(FUNC(geneve_state::ext_ready)); + m_peribox->ready_cb().set(FUNC(geneve_state::extready)); } void geneve_state::genmod(machine_config &config) { geneve_common(config); + GENMOD_DECODER(config, m_genmod_decoder, 0); - // Mapper - GENMOD_GATE_ARRAY(config, m_gatearray, 0); - m_gatearray->ready_cb().set(FUNC(geneve_state::mapper_ready)); + // Gate Array + GENEVE_GATE_ARRAY(config, m_gatearray, 0); m_gatearray->kbdint_cb().set(FUNC(geneve_state::keyboard_interrupt)); // Peripheral expansion box (Geneve composition with Genmod and plugged-in Memex) TI99_PERIBOX_GENMOD(config, m_peribox, 0); m_peribox->inta_cb().set(FUNC(geneve_state::inta)); m_peribox->intb_cb().set(FUNC(geneve_state::intb)); - m_peribox->ready_cb().set(FUNC(geneve_state::ext_ready)); + m_peribox->ready_cb().set(FUNC(geneve_state::extready)); } void geneve_state::geneve_common(machine_config &config) @@ -750,7 +1149,7 @@ void geneve_state::geneve_common(machine_config &config) // Video hardware v99x8_device& video(V9938(config, TI_VDP_TAG, XTAL(21'477'272))); // typical 9938 clock, not verified video.set_vram_size(0x20000); - video.int_cb().set(FUNC(geneve_state::set_tms9901_INT2_from_v9938)); + video.int_cb().set(FUNC(geneve_state::int2_from_v9938)); video.set_screen(TI_SCREEN_TAG); screen_device& screen(SCREEN(config, TI_SCREEN_TAG, SCREEN_TYPE_RASTER)); screen.set_raw(XTAL(21'477'272), \ @@ -768,22 +1167,28 @@ void geneve_state::geneve_common(machine_config &config) m_tms9901->p_out_cb(0).set(FUNC(geneve_state::peripheral_bus_reset)); m_tms9901->p_out_cb(1).set(FUNC(geneve_state::VDP_reset)); m_tms9901->p_out_cb(2).set(FUNC(geneve_state::joystick_select)); - m_tms9901->p_out_cb(4).set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::pfm_select_lsb)); - m_tms9901->p_out_cb(5).set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::pfm_output_enable)); m_tms9901->p_out_cb(6).set(FUNC(geneve_state::keyboard_reset)); - m_tms9901->p_out_cb(7).set(FUNC(geneve_state::extbus_wait_states)); - m_tms9901->p_out_cb(9).set(FUNC(geneve_state::video_wait_states)); - m_tms9901->p_out_cb(13).set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::pfm_select_msb)); + m_tms9901->p_out_cb(7).set(GENEVE_PAL_TAG, FUNC(bus::ti99::internal::geneve_pal_device::sysspeed)); + m_tms9901->p_out_cb(9).set(GENEVE_PAL_TAG, FUNC(bus::ti99::internal::geneve_pal_device::vwaiten)); m_tms9901->intreq_cb().set(FUNC(geneve_state::tms9901_interrupt)); + // PFM expansion: Select the 2^17 and 2^18 bit and the output enable + m_tms9901->p_out_cb(4).set(FUNC(geneve_state::pfm_a17)); + m_tms9901->p_out_cb(5).set(FUNC(geneve_state::pfm_oe)); + m_tms9901->p_out_cb(13).set(FUNC(geneve_state::pfm_a18)); + // Clock MM58274C(config, GENEVE_CLOCK_TAG, 0).set_mode_and_day(1, 0); // 24h, sunday + // PAL + GENEVE_PAL(config, m_pal, 0); + m_pal->ready_cb().set("maincpu", FUNC(tms9995_device::ready_line)); + // Sound hardware SPEAKER(config, "sound_out").front_center(); - sn76496_device& soundgen(SN76496(config, TI_SOUNDCHIP_TAG, 3579545)); - soundgen.ready_cb().set(FUNC(geneve_state::ext_ready)); - soundgen.add_route(ALL_OUTPUTS, "sound_out", 0.75); + SN76496(config, m_sound, XTAL(21'477'272)/6); // Delivered by the CLKOUT of the V9938 + m_sound->add_route(ALL_OUTPUTS, "sound_out", 0.75); + m_sound->ready_cb().set(FUNC(geneve_state::sndready)); // User interface devices: PC-style keyboard, joystick port, mouse connector PC_KBDC(config, m_kbdconn, 0); @@ -802,8 +1207,9 @@ void geneve_state::geneve_common(machine_config &config) // DRAM 512K RAM(config, GENEVE_DRAM_TAG).set_default_size("512K").set_default_value(0); - // SRAM 384K (max; stock Geneve: 32K, but later MDOS releases require 64K) - RAM(config, GENEVE_SRAM_TAG).set_default_size("384K").set_default_value(0); + // SRAM + RAM(config, GENEVE_SRAM_TAG).set_default_size("32K").set_default_value(0); + RAM(config, GENEVE_SRAMX_TAG).set_default_size("32K").set_default_value(0); } /* @@ -828,4 +1234,4 @@ ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS COMP( 1987, geneve, 0, 0, geneve, geneve, geneve_state, init_geneve, "Myarc", "Geneve 9640", MACHINE_SUPPORTS_SAVE) -COMP( 1990, genmod, 0, 0, genmod, genmod, geneve_state, init_geneve, "Myarc / Ron G. Walters", "Geneve 9640 Mod", MACHINE_SUPPORTS_SAVE) +COMP( 1990, genmod, 0, 0, genmod, genmod, geneve_state, init_genmod, "Myarc / Ron G. Walters", "Geneve 9640 Mod", MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/drivers/geniusjr.cpp b/src/mame/drivers/geniusjr.cpp index 3d64d115f4d..117bc9cc7f8 100644 --- a/src/mame/drivers/geniusjr.cpp +++ b/src/mame/drivers/geniusjr.cpp @@ -338,7 +338,7 @@ ROM_START( pitagjr ) ROM_REGION( 0x40000, "extrom", 0 ) ROM_LOAD( "lh532hjt_9811d.u3", 0x00000, 0x40000, CRC(23878b45) SHA1(8f3c41c10cfde9d76763c3a8701ec6616db4ab40) ) - + ROM_REGION( 0x2000, "speech", 0 ) ROM_LOAD( "csm10150an.u2", 0x0000, 0x2000, NO_DUMP ) // TSP50C10 (8K bytes of ROM) labeled "CSM10150AN" ROM_END @@ -381,7 +381,7 @@ ROM_START( pitagor ) ROM_REGION( 0x80000, "extrom", 0 ) ROM_LOAD( "27-5374-00.u2", 0x000000, 0x80000, CRC(89a8fe7d) SHA1(dff06f7313af22c6c19b1f00c0651a64cc505fe2)) - + ROM_REGION( 0x2000, "speech", 0 ) ROM_LOAD( "csm10150an.u1", 0x0000, 0x2000, NO_DUMP ) // TSP50C10 (8K bytes of ROM) labeled "64C_4TT VIDEO TECH CSM10150AN" ROM_END diff --git a/src/mame/drivers/genpc.cpp b/src/mame/drivers/genpc.cpp index 6cf678ea76f..23eaddcc3e1 100644 --- a/src/mame/drivers/genpc.cpp +++ b/src/mame/drivers/genpc.cpp @@ -27,6 +27,7 @@ public: void pccga(machine_config &config); void pcherc(machine_config &config); void pcmda(machine_config &config); + void pcv20(machine_config &config); void pc8_io(address_map &map); void pc8_map(address_map &map); @@ -84,6 +85,15 @@ void genpc_state::pcmda(machine_config &config) SOFTWARE_LIST(config, "disk_list").set_original("ibm5150"); } +void genpc_state::pcv20(machine_config &config) +{ + pccga(config); + + v20_device &maincpu(V20(config.replace(), "maincpu", XTAL(14'318'181)/3)); /* 4.77 MHz */ + maincpu.set_addrmap(AS_PROGRAM, &genpc_state::pc8_map); + maincpu.set_addrmap(AS_IO, &genpc_state::pc8_io); + maincpu.set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); +} void genpc_state::pcherc(machine_config &config) { @@ -116,112 +126,180 @@ void genpc_state::pcvga(machine_config &config) ROM_START(pc) ROM_REGION(0x10000, "bios", 0) + // 0: Turbo XT BIOS v3.1 - 10/28/2017 ROM_SYSTEM_BIOS(0, "v31", "Turbo XT BIOS 3.1") ROMX_LOAD("pcxtbios31.rom", 0xe000, 0x02000, CRC(8ede74c6) SHA1(5848065f9b40e504c02e6930d3602965b2b1bfad),ROM_BIOS(0)) + // 1: Turbo XT BIOS v3.0 - 11/09/2016 ROM_SYSTEM_BIOS(1, "v30", "Turbo XT BIOS 3.0") ROMX_LOAD("pcxtbios30.rom", 0xe000, 0x02000, CRC(4e1fd77a) SHA1(36873971c47b242db7edad7a0c1ea2f7f8d43b87),ROM_BIOS(1)) + // 2: Turbo XT BIOS v2.6 for 8088/V20 ROM_SYSTEM_BIOS(2, "v26", "Turbo XT BIOS 2.6") ROMX_LOAD("pcxtbios26.rom", 0xe000, 0x02000, CRC(a7505acd) SHA1(1fdd80b09feed0ac59401fd6d8dae6250cb56054),ROM_BIOS(2)) + // 3: Turbo XT BIOS v2.5 for 8088/V20 ROM_SYSTEM_BIOS(3, "v25", "Turbo XT BIOS 2.5") ROMX_LOAD("pcxtbios25.rom", 0xe000, 0x02000, CRC(1ab22db6) SHA1(e681acec93c79b08ec06fd26d3be4cccd28f7a45),ROM_BIOS(3)) + // 4: Turbo XT BIOS v2.4 for 8088/V20 ROM_SYSTEM_BIOS(4, "v24", "Turbo XT BIOS 2.4") ROMX_LOAD("pcxtbios24.rom", 0xe000, 0x02000, CRC(80e3c43f) SHA1(3f623cf12f3375aa0fa59da84b5137b9fc86c0ce),ROM_BIOS(4)) + // 5: Turbo XT BIOS for 8088/V20 ROM_SYSTEM_BIOS(5, "v23", "Turbo XT BIOS 2.3") ROMX_LOAD("pcxtbios23.rom", 0xe000, 0x02000, CRC(f397485a) SHA1(777826be2feadb3a8cf7a28ed2245dddef8e1d23),ROM_BIOS(5)) + // 6: Turbo XT BIOS 2.2 for 8088/V20 ROM_SYSTEM_BIOS(6, "v22", "Turbo XT BIOS 2.2") ROMX_LOAD("pcxtbios22.rom", 0xe000, 0x02000, CRC(00967678) SHA1(2dd7f6c8236673e471dd456be009dcc43e28a09f),ROM_BIOS(6)) + // 7: Turbo XT BIOS 2.1 for 8088/V20 ROM_SYSTEM_BIOS(7, "v21", "Turbo XT BIOS 2.1") ROMX_LOAD("pcxtbios21.rom", 0xe000, 0x02000, CRC(017f8f61) SHA1(d9696ba16b56685eb51612eddf1a75364acae7af),ROM_BIOS(7)) + // 8: Turbo XT BIOS for 8088/V20 ROM_SYSTEM_BIOS(8, "v20", "Turbo XT BIOS 2.0") ROMX_LOAD("xtbios2.rom", 0xe000, 0x02000, CRC(1d7bd86c) SHA1(33a500f599b4dad2fe6d7a5c3e89b13bd5dd2987),ROM_BIOS(8)) + // 9: Generic Turbo XT BIOS 1987 for 8088 or V20 cpu (c)Anonymous ROM_SYSTEM_BIOS(9, "v10", "XT Anonymous Generic Turbo BIOS") ROMX_LOAD("pcxt.rom", 0xe000, 0x02000, CRC(031aafad) SHA1(a641b505bbac97b8775f91fe9b83d9afdf4d038f),ROM_BIOS(9)) + // List of bioses to go to separate drivers + // 10: 8088-BIOS (C)AMI, 1985, 1986 / (C)AMI, 3000-100386 ROM_SYSTEM_BIOS(10, "ami", "XT AMI") ROMX_LOAD( "ami.bin", 0xe000, 0x2000, CRC(b381eb22) SHA1(9735193de119270c946a17ed58c3ab9554e0852e),ROM_BIOS(10)) + // 11: XT BIOS V2.05 COPYRIGHT Award Software Inc. 1986 / SUPERWAVE ELECTRONIC CO., LTD. ROM_SYSTEM_BIOS(11, "award", "XT Award 2.05 #1") ROMX_LOAD( "award2.05.bin", 0xe000, 0x2000, CRC(5b3953e5) SHA1(4a36171aa8d993008187f39f732b9296401b7b6c),ROM_BIOS(11)) + // 12: DTK Corp. COMPUTER XT / DTK/ERSO/BIOS 2.26 (C) 1986 ROM_SYSTEM_BIOS(12, "dtk226", "XT DTK Erso bios 2.26") ROMX_LOAD( "dtk-ers0.rom", 0xe000, 0x2000, CRC(85fd5e10) SHA1(2ae152f042e7e43e27621f071af763e3f9dc68d2),ROM_BIOS(12)) + // 13: DTK Corp. COMPUTER '88 / DTK/ERSO/BIOS 2.40 (C) 1986 ROM_SYSTEM_BIOS(13, "dtk240", "XT DTK Erso bios 2.40") // 8 MHz Turbo ROMX_LOAD( "dtk2.40.bin", 0xe000, 0x2000, CRC(a4ed27c3) SHA1(66b67540d94c0d049ebc14ee14eadd2ab7304818),ROM_BIOS(13)) + // 14: DTK Corp. COMPUTER '88 / DTK/ERSO/BIOS 2.42 (C) 1986 ROM_SYSTEM_BIOS(14, "dtk242", "XT DTK Erso bios 2.42") // 10 MHz Turbo ROMX_LOAD( "dtk2.42.bin", 0xe000, 0x2000, CRC(3f2d2a76) SHA1(02fa057f2c22ab199a8d9795ab1ae570f2b13a36),ROM_BIOS(14)) - ROM_SYSTEM_BIOS(15, "peter", "XT Peter Kohlman 3.75") // V20 Rom only - ROMX_LOAD( "peterv203.75.bin", 0xe000, 0x2000, CRC(b053a6a4) SHA1(f53218ad3d725f12d9149b22d8afcf6a8869a3bd),ROM_BIOS(15)) - ROM_SYSTEM_BIOS(16, "pho2271", "XT Phoenix Bios 2.27 #1") - ROMX_LOAD( "phoenix2.27.bin", 0xe000, 0x2000, CRC(168ffef0) SHA1(69465db2f9246a614044d1f433d374506a13a07f),ROM_BIOS(16)) - ROM_SYSTEM_BIOS(17, "pho2272", "XT Phoenix Bios 2.27 #2") // V20 installed on board, 8 ISA8 slots - ROMX_LOAD( "compatibility_software_phoenix_technologies_1985_1986_1121277.bin", 0xe000, 0x2000, CRC(33ceb81a) SHA1(7c7db75e61e19025938f30798d9d0f8b4f6ab0ee),ROM_BIOS(17)) - ROM_SYSTEM_BIOS(18, "pho251", "XT Phoenix Bios 2.51") // Micro Universe v1.0b - ROMX_LOAD( "phoenix2.51.bin", 0xe000, 0x2000, CRC(9b7e9c40) SHA1(c948a8d3d715e469105c6e2acd8b46ec274b25a8),ROM_BIOS(18)) - ROM_SYSTEM_BIOS(19, "turbo", "XT Turbo Bios 3.10") - ROMX_LOAD( "turbo3.10.bin", 0xe000, 0x2000, CRC(8aaca1e3) SHA1(9c03da16713e08c0112a04c8bdfa394e7341c1fc),ROM_BIOS(19)) - ROM_SYSTEM_BIOS(20, "nestv200", "JUKO NEST v2.00") // use keytronic keyboard - ROMX_LOAD( "jukoa.bin", 0xe000, 0x2000, CRC(7d78707e) SHA1(8b09a32658a850e7f03254d1328fe6e336e91871),ROM_BIOS(20)) - ROM_SYSTEM_BIOS(21, "nest230", "JUKO NEST v2.30") - ROMX_LOAD( "juko_st_v2.30.bin", 0xe000, 0x2000, CRC(7a1c6dfa) SHA1(0b343f3028ca06c9e6dc69427d1b15a47c74b9fc),ROM_BIOS(21)) - ROM_SYSTEM_BIOS(22, "nest232", "JUKO NEST v2.32") - ROMX_LOAD( "xt-juko-st-2.32.bin", 0xe000, 0x2000, CRC(0768524e) SHA1(259520bb7a6796e5b987c2b9bef1acd501df1670),ROM_BIOS(22)) - ROM_SYSTEM_BIOS(23, "sid41", "SID BIOS v4.1") // from X'GOLDEN mainboard - ROMX_LOAD( "sid_bios_version_v4.1.bin", 0xe000, 0x2000, CRC(c58daf4d) SHA1(7066f8f993500383b99103a9fa1e6c125c89581b),ROM_BIOS(23)) - ROM_SYSTEM_BIOS(24, "scb12", "Super Computer BIOS 1.2" ) // from X'GOLDEN mainboard - ROMX_LOAD( "super_computer_bios_1.2_1984.bin", 0xe000, 0x2000, CRC(0768a9ba) SHA1(d05c893e9dfc84a3c11c35f87859429f350571c3), ROM_BIOS(24)) - ROM_SYSTEM_BIOS(25, "txt310", "T U R B O XT Version 3.10") // from X'GOLDEN Turbo mainboard, computer can operate in 8MHz mode, source mentions possible corruption - ROMX_LOAD( "turbo_xt_3.10_2764.bin", 0xe000, 0x2000, BAD_DUMP CRC(8aaca1e3) SHA1(9c03da16713e08c0112a04c8bdfa394e7341c1fc),ROM_BIOS(25)) - ROM_SYSTEM_BIOS(26, "alco", "ALCO 8MHz") // another Phoenix v2.27 variant, probably overdumped, therefore BAD_DUMP - ROMX_LOAD( "alco8mhz.bin", 0xe000, 0x2000, BAD_DUMP CRC(96a56814) SHA1(7f752cbe1a25ed6ea5f77fed79cfbf608c667dc3),ROM_BIOS(26)) - ROM_SYSTEM_BIOS(27, "american", "American XT 1.32") - ROMX_LOAD( "americxt.rom", 0xe000, 0x2000, CRC(4c6e23f3) SHA1(6e16f42da9c3d7bd408cf885caf93de9aa02ebe4),ROM_BIOS(27)) - ROM_SYSTEM_BIOS(28, "excel214", "Excel-Turbo Computer Version 2.14") // EXCEL-TURBO SPEEDY SYSTEM / Excel-Turbo Computer 9/20/1985 Version 2.14 - ROMX_LOAD( "excelturbobios.bin", 0xe000, 0x2000, CRC(8ef472a6) SHA1(8f3d512e23ecffb6d9a650d126b11270ff5cf175), ROM_BIOS(28)) - ROM_SYSTEM_BIOS(29, "excel31", "Excel-Turbo Computer Version 3.1") // EXCEL-TURBO SPEEDY SYSTEM / Excel-Turbo Computer 9/20/1985 Version 3.1 - ROMX_LOAD( "excel-turbo_computer_3.1_2764.bin", 0xe000, 0x2000, CRC(d319fea7) SHA1(5b4b0eb35889602aa7f18de82800599528690e15),ROM_BIOS(29)) - ROM_SYSTEM_BIOS(30, "s10b1", "Super 10-B1") // another Phoenix 2.51 variant - ROMX_LOAD( "super_10-b1_27c64.bin", 0xe000, 0x2000, CRC(ba7797db) SHA1(2ee8863640b860a1807cc41e1ac9d94f73a087aa),ROM_BIOS(30)) - ROM_SYSTEM_BIOS(31, "td386", "TD 3.86") - ROMX_LOAD( "td3.86_id_75102637.bin", 0xe000, 0x2000, CRC(aec96e13) SHA1(6e3143418f439a0373fba626cf69df34e41815e5),ROM_BIOS(31)) - ROM_SYSTEM_BIOS(32, "td391", "TD 3.91") - ROMX_LOAD( "tbios-ii.rom", 0xe000, 0x2000, CRC(508b1bad) SHA1(ee9f51423f4cccfdc160c565ecd95fabbcb8a4d4),ROM_BIOS(32)) - ROM_SYSTEM_BIOS(33, "td393", "TD 3.93") - ROMX_LOAD( "td3.93.bin", 0xe000, 0x2000, CRC(807620d9) SHA1(3f0ca24e33feb32051de9e819b962df1528a0403),ROM_BIOS(33)) - ROM_SYSTEM_BIOS(34, "yangp227", "YANGTECH.INC Phoenix 2.27") - ROMX_LOAD( "000p001.bin", 0xe000, 0x2000, CRC(16f4fdc8) SHA1(8e73e9d1456aadd65bb89cc813d1aa1354c90d68),ROM_BIOS(34)) - ROM_SYSTEM_BIOS(35, "ethom11f", "ETHOM Associates Version 1.1f") // 8 MHz - ROMX_LOAD( "ethom_associates_version_1.1f.bin", 0xe000, 0x02000, CRC(bbe7dc12) SHA1(195989a43e6701ff247329524622f1d6f41db7b4),ROM_BIOS(35)) - ROM_SYSTEM_BIOS(36, "arc20", "ARC BIOS 2.0") // ABC Turbo Board - X Turbo System - ROMX_LOAD( "ibm-artb.rom", 0xe000, 0x2000, CRC(0ae5bf8e) SHA1(79b043070c92f9b2f6f9ca25fe61b4c1fcdf1bc8),ROM_BIOS(36)) - ROM_SYSTEM_BIOS(37, "pho252", "XT Phoenix Bios 2.52") - ROMX_LOAD( "ibm-phxt.rom", 0xe000, 0x2000, CRC(c0bc9482) SHA1(a527403c92b6bf4fd876f516c18ca499cb7d4b13),ROM_BIOS(37)) - ROM_SYSTEM_BIOS(38, "com33", "IBM Compatible BIOS v3.3") - ROMX_LOAD( "ibm3-3.rom", 0xe000, 0x02000, CRC(bf6dde1a) SHA1(e63456a888b887b8c0f77f35261ff067f0e2020d),ROM_BIOS(38)) - ROM_SYSTEM_BIOS(39, "xt16", "Turbo BIOS for PC XT-16") - ROMX_LOAD( "ibmturb.rom", 0xe000, 0x2000, CRC(ba4a711e) SHA1(82fe2f76fd6668d2b38f8e6552a605d70c822792),ROM_BIOS(39)) - ROM_SYSTEM_BIOS(40, "znix", "Z-NIX PC-1600") // use pcherc - ROMX_LOAD( "ibmzen.rom", 0xe000, 0x2000, CRC(c5468172) SHA1(499a7813f870b04003e246cc90d4a591d043c6bb),ROM_BIOS(40)) - ROM_SYSTEM_BIOS(41, "pcpi", "PC/88 BIOS Ver1.92") // use pcega - ROMX_LOAD( "pcpi-192.rom", 0xe000, 0x2000, CRC(ef2da5ce) SHA1(95376440be1276e6f1c16fe49c847056bb1e4d5c),ROM_BIOS(41)) - ROM_SYSTEM_BIOS(42, "fday17", "Faraday 5 slot PC") // use pcherc - ROMX_LOAD( "fdaypc17.rom", 0xe000, 0x2000, CRC(26bb29ac) SHA1(5a58680b9193f4323db3e7894f853dc82d17f4ee),ROM_BIOS(42)) - ROM_SYSTEM_BIOS(43, "tava238", "Tava DTK Erso V2.38") - ROMX_LOAD( "tava_dtk_erso_bios_2.38_u87.bin", 0xe000, 0x2000, CRC(34f5c0e5) SHA1(5a1590f948670a5ef85a1ee7cbb40387fced8a1f), ROM_BIOS(43)) - ROM_SYSTEM_BIOS(44, "ecd", "ECD-Computer") // (c) E C D Computer GmbH 1985 - BIOS for ECD Professional Microcomputer - use pcherc - ROMX_LOAD( "ecd_computer.bin", 0xe000, 0x2000, CRC(caab05f5) SHA1(060aa6c17ff9405c256684cec8a5165227c7c522), ROM_BIOS(44)) - ROM_SYSTEM_BIOS(45, "td20", "TD-20") // Triple D International TD-20, 8088/86 Modular BIOS Ver 3.1jk 06/19&/89 15:42 - ROMX_LOAD( "td20bios.bin", 0xc000, 0x4000, CRC(dfce8cd5) SHA1(c4a9624f230ecdeeee606ee1d0bc685226938505), ROM_BIOS(45)) - ROM_SYSTEM_BIOS(46, "b190b", "B-190-B") // B-190-B' P1.830 810.02, Chipset: Faraday FE2010A ICs: UM8272A, INS8250N-BT, MM58167AN-T - ROMX_LOAD( "b190bios.bin", 0xc000, 0x4000, CRC(4178d321) SHA1(a6b30c0805beabe3566b7d22984aa683fc62d7dc), ROM_BIOS(46)) // continuous beep but works - ROM_SYSTEM_BIOS(47, "kt10mb", "KT 10 M/B") // Award XT BIOS 2.05 - ROMX_LOAD( "kt10bios.bin", 0xe000, 0x2000, CRC(94e9836e) SHA1(793a9359ffd6f0964aa25edce31a3f37aa0dadc8), ROM_BIOS(47)) - ROM_SYSTEM_BIOS(48, "diag", "Ruud Baltissen's Diagnostics") // http://www.vcfed.org/forum/showthread.php?68214-Ruud-s-diagnostic-ROM-for-IBM-PC-XT-and-compatibles / use pcherc - ROMX_LOAD( "diagrom.bin", 0xe000, 0x2000, CRC(747b1853) SHA1(204a484bc83b3607d5e1404a2dbe629f5f3044b1), ROM_BIOS(48)) - ROM_SYSTEM_BIOS(49, "081682", "08/16/1982") - ROMX_LOAD( "xt_rom_1_081682_clone.bin", 0xe000, 0x2000, CRC(cfce9b2c) SHA1(14145acb0aca2baf8a6f3c7613f4521fdf0cbe92), ROM_BIOS(49)) - // 50: V20 NEC D70108C-8 - OSC: 14.31818, 24.000 MHz - ROM_SYSTEM_BIOS(50, "awxt205", "XT Award 2.05 #2") - ROMX_LOAD( "rom7.u35", 0xe000, 0x2000, CRC(aa3def6b) SHA1(9fb88b6b522d939f7080a567f4a24279ca6c0928), ROM_BIOS(50)) - // ROM_LOAD("82s129.u95b", 0x000, 0x100, CRC(91e7bead) SHA1(a1eddefc5017591b12db4364c98dfe036b1cb2c7)) // motherboard PROM + // 15: Phoenix ROM BIOS Ver 2.27 + ROM_SYSTEM_BIOS(15, "pho2271", "XT Phoenix Bios 2.27 #1") + ROMX_LOAD( "phoenix2.27.bin", 0xe000, 0x2000, CRC(168ffef0) SHA1(69465db2f9246a614044d1f433d374506a13a07f),ROM_BIOS(15)) + // 16: Phoenix ROM BIOS Ver 2.27 + ROM_SYSTEM_BIOS(16, "pho2272", "XT Phoenix Bios 2.27 #2") // V20 installed on board, 8 ISA8 slots + ROMX_LOAD( "compatibility_software_phoenix_technologies_1985_1986_1121277.bin", 0xe000, 0x2000, CRC(33ceb81a) SHA1(7c7db75e61e19025938f30798d9d0f8b4f6ab0ee),ROM_BIOS(16)) + // 17: Phoenix ROM BIOS Ver 2.51 / Micro-Universe ver 1.0B + ROM_SYSTEM_BIOS(17, "pho251", "XT Phoenix Bios 2.51") + ROMX_LOAD( "phoenix2.51.bin", 0xe000, 0x2000, CRC(9b7e9c40) SHA1(c948a8d3d715e469105c6e2acd8b46ec274b25a8),ROM_BIOS(17)) + // 18: T U R B O - XT 1986 / Version 3.10 + ROM_SYSTEM_BIOS(18, "turbo", "XT Turbo Bios 3.10") + ROMX_LOAD( "turbo3.10.bin", 0xe000, 0x2000, CRC(8aaca1e3) SHA1(9c03da16713e08c0112a04c8bdfa394e7341c1fc),ROM_BIOS(18)) + // 19: BIOS ver 2.00 VEGAS COMPUTER COMMUNICATIONS. + ROM_SYSTEM_BIOS(19, "nestv200", "JUKO NEST v2.00") + ROMX_LOAD( "jukoa.bin", 0xe000, 0x2000, CRC(7d78707e) SHA1(8b09a32658a850e7f03254d1328fe6e336e91871),ROM_BIOS(19)) + // 20: Juko ST BIOS ver 2.30 / Copyright 1988 Juko Electronics Industrial Co., Ltd. + ROM_SYSTEM_BIOS(20, "nest230", "JUKO NEST v2.30") + ROMX_LOAD( "juko_st_v2.30.bin", 0xe000, 0x2000, CRC(7a1c6dfa) SHA1(0b343f3028ca06c9e6dc69427d1b15a47c74b9fc),ROM_BIOS(20)) + // 21: BIOS Ver 2.32 + ROM_SYSTEM_BIOS(21, "nest232", "JUKO NEST v2.32") + ROMX_LOAD( "xt-juko-st-2.32.bin", 0xe000, 0x2000, CRC(0768524e) SHA1(259520bb7a6796e5b987c2b9bef1acd501df1670),ROM_BIOS(21)) + // 22: System 100 ! / S.pecial I.ntegrated D.esigns / BIOS For PC,XT-16 Version 4.1 / (C) 1986 + ROM_SYSTEM_BIOS(22, "sid41", "SID BIOS v4.1") // from X'GOLDEN mainboard + ROMX_LOAD( "sid_bios_version_v4.1.bin", 0xe000, 0x2000, CRC(c58daf4d) SHA1(7066f8f993500383b99103a9fa1e6c125c89581b),ROM_BIOS(22)) + // 23: System Already ! + ROM_SYSTEM_BIOS(23, "scb12", "Super Computer BIOS 1.2" ) // from X'GOLDEN mainboard + ROMX_LOAD( "super_computer_bios_1.2_1984.bin", 0xe000, 0x2000, CRC(0768a9ba) SHA1(d05c893e9dfc84a3c11c35f87859429f350571c3), ROM_BIOS(23)) + // 24: T U R B O - XT 1986 / Version 3.10 + ROM_SYSTEM_BIOS(24, "txt310", "T U R B O XT Version 3.10") // from X'GOLDEN Turbo mainboard, computer can operate in 8MHz mode, source mentions possible corruption + ROMX_LOAD( "turbo_xt_3.10_2764.bin", 0xe000, 0x2000, BAD_DUMP CRC(8aaca1e3) SHA1(9c03da16713e08c0112a04c8bdfa394e7341c1fc),ROM_BIOS(24)) + // 25: Phoenix ROM BIOS Ver 2.27 + ROM_SYSTEM_BIOS(25, "alco", "ALCO 8MHz") // another Phoenix v2.27 variant, probably overdumped, therefore BAD_DUMP + ROMX_LOAD( "alco8mhz.bin", 0xe000, 0x2000, BAD_DUMP CRC(96a56814) SHA1(7f752cbe1a25ed6ea5f77fed79cfbf608c667dc3),ROM_BIOS(25)) + // 26: System Ready / American XT Computer / (C) 1986 For American XT BIOS V.1.32 + ROM_SYSTEM_BIOS(26, "american", "American XT 1.32") + ROMX_LOAD( "americxt.rom", 0xe000, 0x2000, CRC(4c6e23f3) SHA1(6e16f42da9c3d7bd408cf885caf93de9aa02ebe4),ROM_BIOS(26)) + // 27: EXCEL-TURBO SPEEDY SYSTEM / EXCEL-TURBO Computer 9/20/1985 Version 2.14 + ROM_SYSTEM_BIOS(27, "excel214", "Excel-Turbo Computer Version 2.14") + ROMX_LOAD( "excelturbobios.bin", 0xe000, 0x2000, CRC(8ef472a6) SHA1(8f3d512e23ecffb6d9a650d126b11270ff5cf175), ROM_BIOS(27)) + // 28: EXCEL-TURBO SPEEDY SYSTEM / Excel-Turbo Computer 9/20/1985 Version 3.1 + ROM_SYSTEM_BIOS(28, "excel31", "Excel-Turbo Computer Version 3.1") + ROMX_LOAD( "excel-turbo_computer_3.1_2764.bin", 0xe000, 0x2000, CRC(d319fea7) SHA1(5b4b0eb35889602aa7f18de82800599528690e15),ROM_BIOS(28)) + // 29: Phoenix ROM BIOS Ver 2.51 + ROM_SYSTEM_BIOS(29, "s10b1", "Super 10-B1") // another Phoenix 2.51 variant + ROMX_LOAD( "super_10-b1_27c64.bin", 0xe000, 0x2000, CRC(ba7797db) SHA1(2ee8863640b860a1807cc41e1ac9d94f73a087aa),ROM_BIOS(29)) + // 30: 86(C) TD3.86 ID: 75102637 + ROM_SYSTEM_BIOS(30, "td386", "TD 3.86") + ROMX_LOAD( "td3.86_id_75102637.bin", 0xe000, 0x2000, CRC(aec96e13) SHA1(6e3143418f439a0373fba626cf69df34e41815e5),ROM_BIOS(30)) + // 31: 86(C) TD3.91 ID: + ROM_SYSTEM_BIOS(31, "td391", "TD 3.91") + ROMX_LOAD( "td391-td.rom", 0xe000, 0x2000, CRC(508b1bad) SHA1(ee9f51423f4cccfdc160c565ecd95fabbcb8a4d4),ROM_BIOS(31)) + // 32: 86(C) TD3.93 ID: + ROM_SYSTEM_BIOS(32, "td393", "TD 3.93") + ROMX_LOAD( "td3.93.bin", 0xe000, 0x2000, CRC(807620d9) SHA1(3f0ca24e33feb32051de9e819b962df1528a0403),ROM_BIOS(32)) + // 33: Phoenix ROM BIOS Ver 2.27 / YANGTECH.INC + ROM_SYSTEM_BIOS(33, "yangp227", "YANGTECH.INC Phoenix 2.27") + ROMX_LOAD( "000p001.bin", 0xe000, 0x2000, CRC(16f4fdc8) SHA1(8e73e9d1456aadd65bb89cc813d1aa1354c90d68),ROM_BIOS(33)) + // 34: ETHOM Associates Inc. Personal Computer Version 1.1F + ROM_SYSTEM_BIOS(34, "ethom11f", "ETHOM Associates Version 1.1f") // 8 MHz + ROMX_LOAD( "ethom_associates_version_1.1f.bin", 0xe000, 0x02000, CRC(bbe7dc12) SHA1(195989a43e6701ff247329524622f1d6f41db7b4),ROM_BIOS(34)) + // 35: ARC Turbo Board - X Turbo System + ROM_SYSTEM_BIOS(35, "arc20", "ARC BIOS 2.0") + ROMX_LOAD( "ibm-artb.rom", 0xe000, 0x2000, CRC(0ae5bf8e) SHA1(79b043070c92f9b2f6f9ca25fe61b4c1fcdf1bc8),ROM_BIOS(35)) + // 36: Phoenix ROM BIOS Ver 2.52 + ROM_SYSTEM_BIOS(36, "pho252", "XT Phoenix Bios 2.52") + ROMX_LOAD( "ibm-phxt.rom", 0xe000, 0x2000, CRC(c0bc9482) SHA1(a527403c92b6bf4fd876f516c18ca499cb7d4b13),ROM_BIOS(36)) + // 37: System Already ! IBM COMPATIBLE BIOS v3.3 .......1985 + ROM_SYSTEM_BIOS(37, "com33", "IBM Compatible BIOS v3.3") + ROMX_LOAD( "ibm3-3.rom", 0xe000, 0x02000, CRC(bf6dde1a) SHA1(e63456a888b887b8c0f77f35261ff067f0e2020d),ROM_BIOS(37)) + // 38: TURBO SYSTEM / Compatible Computer TURBO + ROM_SYSTEM_BIOS(38, "xt16", "Turbo BIOS for PC XT-16") + ROMX_LOAD( "ibmturb.rom", 0xe000, 0x2000, CRC(ba4a711e) SHA1(82fe2f76fd6668d2b38f8e6552a605d70c822792),ROM_BIOS(38)) + // 39: Z-NIX PC-1600 + ROM_SYSTEM_BIOS(39, "znix", "Z-NIX PC-1600") + ROMX_LOAD( "ibmzen.rom", 0xe000, 0x2000, CRC(c5468172) SHA1(499a7813f870b04003e246cc90d4a591d043c6bb),ROM_BIOS(39)) + // 40: PC/88 BIOS Ver1.92 + ROM_SYSTEM_BIOS(40, "pcpi", "PC/88 BIOS Ver1.92") // use pcega + ROMX_LOAD( "pcpi-192.rom", 0xe000, 0x2000, CRC(ef2da5ce) SHA1(95376440be1276e6f1c16fe49c847056bb1e4d5c),ROM_BIOS(40)) + // 41: + ROM_SYSTEM_BIOS(41, "fday17", "Faraday 5 slot PC") + ROMX_LOAD( "fdaypc17.rom", 0xe000, 0x2000, CRC(26bb29ac) SHA1(5a58680b9193f4323db3e7894f853dc82d17f4ee),ROM_BIOS(41)) + // 42: DTK Corp. COMPUTER '88 / DTK/ERSO/BIOS 2.38 (C) 1986 + ROM_SYSTEM_BIOS(42, "tava238", "Tava DTK Erso V2.38") + ROMX_LOAD( "tava_dtk_erso_bios_2.38_u87.bin", 0xe000, 0x2000, CRC(34f5c0e5) SHA1(5a1590f948670a5ef85a1ee7cbb40387fced8a1f), ROM_BIOS(42)) + // 43: (c) E C D Computer GmbH 1985 - BIOS for ECD Professional Microcomputer - use pcherc + ROM_SYSTEM_BIOS(43, "ecd", "ECD-Computer") + ROMX_LOAD( "ecd_computer.bin", 0xe000, 0x2000, CRC(caab05f5) SHA1(060aa6c17ff9405c256684cec8a5165227c7c522), ROM_BIOS(43)) + // 44: Triple D International TD-20 - 8088/86 Modular BIOS Ver 3.1jk 06/19&/89 15:42 / Copyright Award Software Inc. + ROM_SYSTEM_BIOS(44, "td20", "TD-20") + ROMX_LOAD( "td20bios.bin", 0xc000, 0x4000, CRC(dfce8cd5) SHA1(c4a9624f230ecdeeee606ee1d0bc685226938505), ROM_BIOS(44)) + // 45: B-190-B' P1.830 810.02, Chipset: Faraday FE2010A ICs: UM8272A, INS8250N-BT, MM58167AN-T + // 86(C) CD3.98 ID - continuous beep but works + ROM_SYSTEM_BIOS(45, "b190b", "B-190-B") + ROMX_LOAD( "b190bios.bin", 0xc000, 0x4000, CRC(4178d321) SHA1(a6b30c0805beabe3566b7d22984aa683fc62d7dc), ROM_BIOS(45)) + // 46: XT BIOS V2.05 COPYRIGHT Award Software Inc. 1986 + ROM_SYSTEM_BIOS(46, "kt10mb", "KT 10 M/B") // Award XT BIOS 2.05 + ROMX_LOAD( "kt10bios.bin", 0xe000, 0x2000, CRC(94e9836e) SHA1(793a9359ffd6f0964aa25edce31a3f37aa0dadc8), ROM_BIOS(46)) + // 47: // http://www.vcfed.org/forum/showthread.php?68214-Ruud-s-diagnostic-ROM-for-IBM-PC-XT-and-compatibles + ROM_SYSTEM_BIOS(47, "diag", "Ruud Baltissen's Diagnostics") + ROMX_LOAD( "diagrom.bin", 0xe000, 0x2000, CRC(747b1853) SHA1(204a484bc83b3607d5e1404a2dbe629f5f3044b1), ROM_BIOS(47)) + // 48: + ROM_SYSTEM_BIOS(48, "081682", "08/16/1982") + ROMX_LOAD( "xt_rom_1_081682_clone.bin", 0xe000, 0x2000, CRC(cfce9b2c) SHA1(14145acb0aca2baf8a6f3c7613f4521fdf0cbe92), ROM_BIOS(48)) + // 49: V20 NEC D70108C-8 - OSC: 14.31818, 24.000 MHz + // XT BIOS V2.05 COPYRIGHT Award Software Inc. 1986 + ROM_SYSTEM_BIOS(49, "awxt205", "XT Award 2.05 #2") + ROMX_LOAD( "rom7.u35", 0xe000, 0x2000, CRC(aa3def6b) SHA1(9fb88b6b522d939f7080a567f4a24279ca6c0928), ROM_BIOS(49)) + // 50: 8 MHz TURBO BOARD - ISA8: 8 - + // American Research Corp., Copyright 1985, ARC TURBO BIOS VERSION 1.23 6/27/85 + ROM_SYSTEM_BIOS(50, "arc123", "ARC Turbo BIOS 1.23") + ROMX_LOAD( "arcturbobios.bin", 0xe000, 0x2000, CRC(07692e7b) SHA1(27aa350dbc0d846cee8f9149bde0ef72d3862254), ROM_BIOS(50)) + // 51: XT-Faraday PAC - Chipset: Faraday FE2010A-ES, Faraday FE2100, MM58167AN, Z0765A08PSC, NS8250N - CPU: SONY CXQ70108P-8 (V20) + // OSC: 28.6363, 18.4328.000 - ISA8: 6 - BIOS: PCBIOS 05017 / FARADAY'84'87 / 07017007 - on board: Floppy, ... (ser/par?) + ROM_SYSTEM_BIOS(51, "pac", "XT-Faraday PAC") + ROMX_LOAD( "xt-faraday_pac_32k.bin", 0x8000, 0x8000, CRC(d1edf110) SHA1(09570ef36dada08a6d3b97d17ad64814fe32d345), ROM_BIOS(51)) +ROM_END + +// BIOS versions specifically for NEC V20 CPUs, don't run on plain 8088 +ROM_START( pcv20 ) + ROM_REGION(0x10000, "bios", 0) + // 0: V20-BIOS Version 3.75 c't // (C) Peter Köhlmann 1987 + ROM_SYSTEM_BIOS(0, "v375", "c't v3.75") + ROMX_LOAD( "peterv203.75.bin", 0xe000, 0x2000, CRC(b053a6a4) SHA1(f53218ad3d725f12d9149b22d8afcf6a8869a3bd), ROM_BIOS(0)) + // 1: V20-BIOS Version 3.72 c't // (C) Peter Köhlmann 1987 => last known version is 3.82 + ROM_SYSTEM_BIOS(1, "v372", "c't v3.72") + ROMX_LOAD( "v20xtbios.bin", 0xe000, 0x2000, CRC(b2dca2e4) SHA1(18b0cb90084723eae08cf6b27bfb3fec8e9fb11b), ROM_BIOS(1)) ROM_END #define rom_pcmda rom_pc @@ -239,8 +317,9 @@ ROM_END ***************************************************************************/ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME -COMP( 1987, pc, ibm5150, 0, pccga, 0, genpc_state, empty_init, "<generic>", "PC (CGA)", 0 ) -COMP( 1987, pcega, ibm5150, 0, pcega, 0, genpc_state, empty_init, "<generic>", "PC (EGA)", 0 ) -COMP( 1987, pcmda, ibm5150, 0, pcmda, 0, genpc_state, empty_init, "<generic>", "PC (MDA)", 0 ) -COMP( 1987, pcherc, ibm5150, 0, pcherc, 0, genpc_state, empty_init, "<generic>", "PC (Hercules)", 0 ) -COMP( 1987, pcvga, ibm5150, 0, pcvga, 0, genpc_state, empty_init, "<generic>", "PC (VGA)", 0 ) +COMP( 1987, pc, ibm5150, 0, pccga, 0, genpc_state, empty_init, "<generic>", "PC (CGA)", 0 ) +COMP( 1987, pcega, ibm5150, 0, pcega, 0, genpc_state, empty_init, "<generic>", "PC (EGA)", 0 ) +COMP( 1987, pcmda, ibm5150, 0, pcmda, 0, genpc_state, empty_init, "<generic>", "PC (MDA)", 0 ) +COMP( 1987, pcherc, ibm5150, 0, pcherc, 0, genpc_state, empty_init, "<generic>", "PC (Hercules)", 0 ) +COMP( 1987, pcvga, ibm5150, 0, pcvga, 0, genpc_state, empty_init, "<generic>", "PC (VGA)", 0 ) +COMP( 1987, pcv20, ibm5150, 0, pcv20, 0, genpc_state, empty_init, "<generic>", "PC with V20 CPU", 0 ) diff --git a/src/mame/drivers/gigatron.cpp b/src/mame/drivers/gigatron.cpp new file mode 100644 index 00000000000..19b5cd459bc --- /dev/null +++ b/src/mame/drivers/gigatron.cpp @@ -0,0 +1,105 @@ +// license:BSD-3-Clause +// copyright-holders:Sterophonick +/*************************************************************************** + + Skeleton driver for Gigatron TTL Microcomputer + Driver by Sterophonick + +***************************************************************************/ + +//There is a pre-existing emulator here https://github.com/PhilThomas/gigatron +//It's just a matter of translating it to MAME. + +#include "emu.h" +#include "cpu/gigatron/gigatron.h" +#include "screen.h" +#include "speaker.h" + +#define MAIN_CLOCK 6250000 + +class gigatron_state : public driver_device +{ +public: + gigatron_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void gigatron(machine_config &config); + + +private: + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + virtual void machine_start() override; + virtual void machine_reset() override; + + void prog_map(address_map &map); + void data_map(address_map &map); + + DECLARE_READ8_MEMBER(gigatron_random) + { + return machine().rand() & 0xff; + } + + required_device<cpu_device> m_maincpu; +}; + +uint32_t gigatron_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void gigatron_state::prog_map(address_map &map) +{ + map(0x0000, 0x3fff).rom().region("maincpu", 0); +} + +void gigatron_state::data_map(address_map &map) +{ + map(0x0000, 0x7fff).ram(); +} + +void gigatron_state::machine_start() +{ +} + +void gigatron_state::machine_reset() +{ +} + +static INPUT_PORTS_START(gigatron) +INPUT_PORTS_END + +void gigatron_state::gigatron(machine_config &config) +{ + GTRON(config, m_maincpu, MAIN_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &gigatron_state::prog_map); + m_maincpu->set_addrmap(AS_DATA, &gigatron_state::data_map); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(59.98); + screen.set_size(640, 480); + screen.set_visarea(0, 640-1, 0, 480-1); + screen.set_screen_update(FUNC(gigatron_state::screen_update)); + + /* sound hardware */ + //SPEAKER(config, "mono").front_center(); +} + +ROM_START( gigatron ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_SYSTEM_BIOS(0, "v4", "Gigatron ROM V4") + ROMX_LOAD( "gigrom4.rom", 0x0000, 0x20000, CRC(78995109) SHA1(2395fc48e64099836111f5aeca39ddbf4650ea4e),ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v3", "Gigatron ROM V3") + ROMX_LOAD( "gigrom3.rom", 0x0000, 0x20000, CRC(1536efbe) SHA1(959268069e761a01d620396eedb9abc1ee63c421),ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "v2", "Gigatron ROM V2") + ROMX_LOAD( "gigrom2.rom", 0x0000, 0x20000, CRC(b4a3d936) SHA1(c93f417d589144b912c79f85b9e942d66242c2c3),ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "v1", "Gigatron ROM V1") + ROMX_LOAD( "gigrom1.rom", 0x0000, 0x20000, CRC(8ea5a2af) SHA1(e5758d5cc467c3476bd8f992fd45dfcdf06d0430),ROM_BIOS(3)) +ROM_END + +COMP(2018, gigatron, 0, 0, gigatron, gigatron, gigatron_state, empty_init, "Marcel van Kervinck", "Gigatron TTL Microcomputer", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/gkidabc.cpp b/src/mame/drivers/gkidabc.cpp index 8470df24e66..e3aa86c07ad 100644 --- a/src/mame/drivers/gkidabc.cpp +++ b/src/mame/drivers/gkidabc.cpp @@ -45,7 +45,7 @@ ROM_END ROM_START(miprimlec) ROM_REGION(0x20000, "maincpu", 0) ROM_LOAD("27-5482-01.u1", 0x00000, 0x20000, CRC(83aa655b) SHA1(5d7b03f0ff2836e228da77676df03854f87edd26)) - + ROM_REGION( 0x2000, "speech", 0 ) ROM_LOAD( "csm10150an.u3", 0x0000, 0x2000, NO_DUMP ) // TSP50C10 (8K bytes of ROM) labeled "67ACLKT VIDEO TECH CSM10150AN" ROM_END diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index 5bb866c66cf..080f3c5e514 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -217,6 +217,7 @@ #include "cpu/z80/z80.h" #include "cpu/mcs51/mcs51.h" +#include "machine/segacrpt_device.h" #include "machine/segacrp2_device.h" #include "machine/nvram.h" #include "sound/ay8910.h" @@ -848,6 +849,19 @@ void cmaster_state::cm_portmap(address_map &map) map(0x14, 0x14).w(FUNC(cmaster_state::girl_scroll_w)); } +void cmaster_state::cm97_portmap(address_map &map) // TODO: other reads/writes +{ + map.global_mask(0xff); + map(0x09, 0x09).r("aysnd", FUNC(ay8910_device::data_r)); + map(0x0a, 0x0b).w("aysnd", FUNC(ay8910_device::data_address_w)); + map(0x0c, 0x0c).portr("DSW1"); + map(0x0d, 0x0d).portr("DSW2"); + map(0x0e, 0x0e).portr("DSW3"); + map(0x10, 0x10).portr("IN0"); + map(0x11, 0x11).portr("IN1"); + map(0x12, 0x12).portr("IN2").w(FUNC(cmaster_state::outport0_w)); +} + void cmaster_state::chryangl_decrypted_opcodes_map(address_map &map) { map(0x0000, 0xf7ff).rom().share("decrypted_opcodes"); @@ -3798,14 +3812,14 @@ static INPUT_PORTS_START( luckylad ) // CHECK & FIX ME PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play (Bet)") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Odds table") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_START("IN2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Keep 3") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Keep 2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Keep 1") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3813,22 +3827,22 @@ static INPUT_PORTS_START( luckylad ) // CHECK & FIX ME PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Keep 5") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Keep 4") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_NAME("Coin A") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_NAME("Coin B") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) PORT_NAME("Coin C") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_IMPULSE(2) PORT_NAME("Coin D") PORT_START("IN4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Key Out / Attendant") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Hopper") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3874,9 +3888,9 @@ static INPUT_PORTS_START( luckylad ) // CHECK & FIX ME PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -8295,7 +8309,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_cmast91 ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128+64, 4 ) // or is there a register for the +64? - GFXDECODE_ENTRY( "user1", 0, tiles256x128x4_layout, 128, 4 ) // wrong... FIXME. + GFXDECODE_ENTRY( "user1", 0, tiles256x128x4_layout, 128, 4 ) GFXDECODE_END #if 0 // decodes an extra plane for cmv4 / cmasterb, not sure if we need to @@ -8364,7 +8378,8 @@ static const gfx_layout tiles8x8_3bpp_layout = static GFXDECODE_START( gfx_nfm ) GFXDECODE_ENTRY( "tilegfx", 0, tiles8x8_3bpp_layout, 0, 16 ) - GFXDECODE_ENTRY( "reelgfx", 0, tiles8x32_4bpp_layout, 0, 16 ) + GFXDECODE_ENTRY( "reelgfx", 0, tiles8x32_4bpp_layout, 128+64, 4 ) + GFXDECODE_ENTRY( "user1", 0, tiles128x128x4_layout, 128, 4 ) // wrong, needs correct decoding GFXDECODE_END @@ -8700,6 +8715,19 @@ void goldstar_state::lucky8_palette(palette_device &palette) const } } +void goldstar_state::nfm_palette(palette_device &palette) const +{ + // BBGGGRRR + uint8_t const *const colours = memregion("colours")->base(); + for (int i = 0; i < 0x100; i++) + { + uint8_t const data = bitswap<8>(colours[0x000 + i], 3, 2, 1, 0, 7, 6, 5, 4); + palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); + } + + // TODO: what's 0x100-0x1ff for? For the currently undecoded user1 ROM? +} + void cb3_state::ncb3(machine_config &config) { @@ -8781,13 +8809,12 @@ void cb3_state::cherrys(machine_config &config) m_gfxdecode->set_info(gfx_cherrys); } -void cb3_state::cm97(machine_config &config) +void cb3_state::eldoradd(machine_config &config) { ncb3(config); m_gfxdecode->set_info(gfx_cm97); } - void goldstar_state::wcherry(machine_config &config) { /* basic machine hardware */ @@ -8880,6 +8907,18 @@ void cmaster_state::cmasterc(machine_config &config) m_gfxdecode->set_info(gfx_cmasterc); } +void cmaster_state::cm97(machine_config &config) +{ + cm(config); + + m_maincpu->set_addrmap(AS_IO, &cmaster_state::cm97_portmap); + + m_gfxdecode->set_info(gfx_cm97); + + config.device_remove("ppi8255_0"); + config.device_remove("ppi8255_1"); +} + void cmaster_state::chryangl(machine_config &config) { cm(config); @@ -9003,6 +9042,16 @@ void wingco_state::lucky8k(machine_config &config) maincpu.set_decrypted_tag(m_decrypted_opcodes); } +void wingco_state::luckylad(machine_config &config) +{ + lucky8(config); + + sega_315_spat_device &maincpu(SEGA_315_SPAT(config.replace(), m_maincpu, CPU_CLOCK)); // actually Falcon 03155096 encrypted Z80 + maincpu.set_addrmap(AS_PROGRAM, &wingco_state::lucky8_map); + maincpu.set_addrmap(AS_OPCODES, &wingco_state::common_decrypted_opcodes_map); + maincpu.set_decrypted_tag(":decrypted_opcodes"); +} + void wingco_state::super972(machine_config &config) { lucky8(config); @@ -9426,6 +9475,8 @@ void cmaster_state::nfm(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &cmaster_state::nfm_map); m_gfxdecode->set_info(gfx_nfm); + + m_palette->set_init(FUNC(cmaster_state::nfm_palette)); } @@ -11188,6 +11239,37 @@ ROM_START( aplan ) // Has "DYNA QL-1 V1.01" string. ROM_LOAD( "82s129.u46", 0x100, 0x100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) ) ROM_END +ROM_START( war3cb ) // WANG QL-0B V1.00 in NVRAM, SANGHO in GFX ROMs + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "27c512 9 sub-board.bin", 0x2000, 0x2000, CRC(7fc6009d) SHA1(cb664890cffaddb741e8fe94d73ca23634c21e95) ) + ROM_CONTINUE( 0x0000, 0x2000 ) + ROM_CONTINUE( 0x6000, 0x2000 ) + ROM_CONTINUE( 0x4000, 0x2000 ) + ROM_CONTINUE( 0xa000, 0x2000 ) + ROM_CONTINUE( 0x8000, 0x2000 ) + ROM_CONTINUE( 0xe000, 0x2000 ) + ROM_CONTINUE( 0xc000, 0x2000 ) + ROM_COPY( "maincpu" , 0x6000, 0x7000, 0x1000 ) // verified with Z80 ICE memory dump + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "27c256 5.bin", 0x00000, 0x8000, CRC(5ba97822) SHA1(f089a09509c13d01a375e273eadcd4007c2054c8) ) + ROM_LOAD( "27c256 6.bin", 0x08000, 0x8000, CRC(56f7359a) SHA1(b33b6853d05607b1a35b6f5e1a52a4b84a86759a) ) + ROM_LOAD( "27c256 7.bin", 0x10000, 0x8000, CRC(b2ba5c16) SHA1(4ba64eed71b3e470dbb5250fcb98ab24abc151df) ) + + ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_LOAD( "27c64 1.bin", 0x0000, 0x2000, CRC(b35c5114) SHA1(1f3e105ebc1ee59201defcea78a8abf0607608f8) ) + ROM_LOAD( "27c64 2.bin", 0x2000, 0x2000, CRC(d65f8608) SHA1(bd68c6004a97617fbc23acbd76ac1e093a565f89) ) + ROM_LOAD( "27c64 3.bin", 0x4000, 0x2000, CRC(7f2d9f4c) SHA1(f7f62cd09091bd8e713237c6ac4ee3b4c28350b2) ) + ROM_LOAD( "27c64 4.bin", 0x6000, 0x2000, CRC(1d7f7f2a) SHA1(787f9d2cea1f0690445c65c0a4827b07d85571b7) ) + + ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) + ROM_FILL( 0x0000, 0x10000, 0xff ) // (girl bitmaps, not present) + + ROM_REGION( 0x200, "proms", 0 ) // not yet dumped + ROM_LOAD( "prom1", 0x000, 0x100, BAD_DUMP CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) ) + ROM_LOAD( "prom2", 0x100, 0x100, BAD_DUMP CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) ) +ROM_END + ROM_START( chryangl ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "8.u6", 0x0000, 0x10000, CRC(331961e4) SHA1(50c7e0e983aed1f199f238442bb8fafce1849f84) ) @@ -11394,8 +11476,8 @@ ROM_START( cmast91 ) ROM_LOAD( "1.bin", 0x10000, 0x8000, CRC(71bdab69) SHA1(d2c594ed88d6368df15b623c48eecc1c219b839e) ) ROM_LOAD( "2.bin", 0x18000, 0x8000, CRC(fccd48d7) SHA1(af564f5ef9ff5b6363897ce6bdf0b21123911fd4) ) - ROM_REGION( 0x40000, "user1", 0 ) /* unknown, bitmaps, or sound? */ - ROM_LOAD( "9.bin", 0x00000, 0x40000, CRC(92342276) SHA1(f9436752f2ec67cf873fd01c729c7c113dc18be0) ) // ? + ROM_REGION( 0x40000, "user1", 0 ) // girls GFX + ROM_LOAD( "9.bin", 0x00000, 0x40000, CRC(92342276) SHA1(f9436752f2ec67cf873fd01c729c7c113dc18be0) ) ROM_REGION( 0x300, "proms", 0 ) ROM_LOAD( "p1.bin", 0x0000, 0x0100, CRC(ac529f04) SHA1(5bc92e50c85bb23e609172cc15c430ddea7fdcb5) ) @@ -12755,10 +12837,7 @@ ROM_END About encryption... - Seems that programmers left a hole at offset 3890-3a90, enough to see some - values and progressions as hints. Some of these strings (IE: 00 20 00 20), - are valid to XOR some text offsets, as 3ac7-3acf, 3ae5-3aea, 3c00-3c0f, and - other text strings. See also offsets 5240 and 5800 onward... + The scheme is the same used in some early Sega games (see machine/segacrpt_device.cpp) ******************************************************************************/ @@ -13411,13 +13490,35 @@ ROM_START( wcat3 ) ROM_LOAD( "wcat3.g14", 0x0100, 0x0100, CRC(dcd53d2c) SHA1(bbcb4266117c3cd1c8ef0e5046d3558c8293313a) ) ROM_REGION( 0x40, "proms2", 0 ) - ROM_LOAD( "wcat3.d12", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) ) + ROM_LOAD( "wcat3.d13", 0x0000, 0x0020, CRC(eab832ed) SHA1(0fbc8914ba1805cfc6698fe7f137a934e63a4f89) ) ROM_REGION( 0x100, "unkprom", 0 ) ROM_LOAD( "wcat3.f3", 0x0000, 0x0100, CRC(1d668d4a) SHA1(459117f78323ea264d3a29f1da2889bbabe9e4be) ) ROM_REGION( 0x40, "unkprom2", 0 ) - ROM_LOAD( "wcat3.d13", 0x0000, 0x0020, CRC(eab832ed) SHA1(0fbc8914ba1805cfc6698fe7f137a934e63a4f89) ) + ROM_LOAD( "wcat3.d12", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) ) +ROM_END + +ROM_START( wcat3a ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "main program sub 27c512.bin", 0x0000, 0x10000, CRC(50b61d88) SHA1(7cea2a03d9b48a1f324171f69ae9df62cf65dc6f) ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "rom7.bin", 0x10000, 0x8000, CRC(3e2ade27) SHA1(9a463219c5028ed32086c378a17079f69d1c0439) ) + ROM_LOAD( "rom6.bin", 0x08000, 0x8000, CRC(71ae4c3c) SHA1(7b3b0a7453e5844194f3d3ed449549e4c091b127) ) + ROM_LOAD( "rom5.bin", 0x00000, 0x8000, CRC(8fac3f23) SHA1(e2c67620aa2ea01c2d469d963b5a34ca710742ec) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "rom4.bin", 0x6000, 0x2000, CRC(0509d556) SHA1(c2f46d279f45b544c67b0c966659cc6d5d53c22f) ) + ROM_LOAD( "rom3.bin", 0x4000, 0x2000, CRC(d50f3d62) SHA1(8500c7f3a2f51ea0ed7e142ecdc4e669ba3e7065) ) + ROM_LOAD( "rom2.bin", 0x2000, 0x2000, CRC(373d9949) SHA1(ff483505fb9e86411acad7059bf5434dde290946) ) + ROM_LOAD( "rom1.bin", 0x0000, 0x2000, CRC(50febe3b) SHA1(0479bcee53b174aa0413951e283e446b09a6f156) ) + + ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) // no girls bitmap + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "n82s129 u84.bin", 0x0000, 0x0100, CRC(d12b865b) SHA1(cb1fee592c9eb51e38c33a27f8d706c4c57b9823) ) + ROM_LOAD( "n82s129 u79.bin", 0x0100, 0x0100, CRC(89af30d9) SHA1(049252654a25399ad5ca95d1b063eb45356efcad) ) ROM_END @@ -13982,6 +14083,46 @@ ROM_START( nfb96c ) // none? ROM_END +ROM_START( nfb96d ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "27c512 v3.1 ca.bin", 0x00000, 0x1000, CRC(f823e51d) SHA1(2a258c0746d86e5933b22230e21c97b0ddee7cc2) ) // v3.1, A Sub-PCB + ROM_CONTINUE(0x4000, 0x1000) + ROM_CONTINUE(0x3000, 0x1000) + ROM_CONTINUE(0x7000, 0x1000) + ROM_CONTINUE(0x1000, 0x1000) + ROM_CONTINUE(0x6000, 0x1000) + ROM_CONTINUE(0x2000, 0x1000) + ROM_CONTINUE(0x5000, 0x1000) + ROM_CONTINUE(0x8000, 0x8000) + + ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) + // no girls + + ROM_REGION( 0x20000, "graphics", 0 ) + ROM_LOAD( "high.bin", 0x00000, 0x10000, CRC(fee708a7) SHA1(40ca3a236954d5549f9ad768541487752402fb5e) ) + ROM_LOAD( "low.bin", 0x10000, 0x10000, CRC(b00e1a8c) SHA1(d191e7721059045a90129a8e14817c44f48fb5e6) ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2 + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 ) + ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 ) + ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 ) + ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 ) + + ROM_REGION( 0x200, "proms", 0 ) // palette + ROM_LOAD( "chu19.bin", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) ) + ROM_LOAD( "chu20.bin", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) ) + + ROM_REGION( 0x100, "sku1920.bin", 0 ) // colours again? + ROM_LOAD( "chu1920.bin", 0x0000, 0x0100, CRC(71b0e11d) SHA1(1d2a2a31d8571f580c0cb7f4833823841072b31f) ) +ROM_END ROM_START( nfb96txt ) ROM_REGION( 0x20000, "maincpu", 0 ) @@ -14314,6 +14455,117 @@ ROM_START( nc96f ) // none? ROM_END +ROM_START( nc96g ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "new cherry 96 b-type 3.1.bin", 0x00000, 0x1000, CRC(7c06c960) SHA1(017428d3cf5471533ef8702d62cb572bb7fbb652) ) // v3.1, B Sub-PCB + ROM_CONTINUE(0x4000, 0x1000) + ROM_CONTINUE(0x3000, 0x1000) + ROM_CONTINUE(0x7000, 0x1000) + ROM_CONTINUE(0x1000, 0x1000) + ROM_CONTINUE(0x6000, 0x1000) + ROM_CONTINUE(0x2000, 0x1000) + ROM_CONTINUE(0x5000, 0x1000) + ROM_CONTINUE(0x8000, 0x8000) + + ROM_REGION( 0x20000, "graphics", 0 ) + ROM_LOAD( "high.bin", 0x00000, 0x10000, CRC(1ab0441a) SHA1(88bd43fb27aa38b566c13b3a0c63cd2f7529f886) ) + ROM_LOAD( "low.bin", 0x10000, 0x10000, CRC(6c173154) SHA1(af7d597dd9d7704b9fc9c154349e067c990c541d) ) + + ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2 + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 ) + ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 ) + ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 ) + ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 ) + + ROM_REGION( 0x200, "proms", 0 ) // palette, not dumped for this set + ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, BAD_DUMP CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) ) + ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, BAD_DUMP CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) ) +ROM_END + +ROM_START( nc96h ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "version 97-3.1c.bin", 0x00000, 0x1000, CRC(2aeb5747) SHA1(331a43195d01f18f9637c2ce1ca6cede6d3c51fd) ) // v3.1C, G Sub-PCB + ROM_CONTINUE(0x4000, 0x1000) + ROM_CONTINUE(0x3000, 0x1000) + ROM_CONTINUE(0x7000, 0x1000) + ROM_CONTINUE(0x1000, 0x1000) + ROM_CONTINUE(0x6000, 0x1000) + ROM_CONTINUE(0x2000, 0x1000) + ROM_CONTINUE(0x5000, 0x1000) + ROM_CONTINUE(0x8000, 0x8000) + + ROM_REGION( 0x20000, "graphics", 0 ) + ROM_LOAD( "high.bin", 0x00000, 0x10000, CRC(a3901324) SHA1(2bdfe3fb05202af32d0d845a499d44a79e963d89) ) + ROM_LOAD( "low.bin", 0x10000, 0x10000, CRC(482931a3) SHA1(0307a7f7428974f3b9563ab4b56528a31c355cdd) ) + + ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2 + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 ) + ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 ) + ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 ) + ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 ) + + ROM_REGION( 0x200, "proms", 0 ) // palette, not dumped for this set + ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, BAD_DUMP CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) ) + ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, BAD_DUMP CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) ) +ROM_END + +ROM_START( nc96i ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "3.55 new cherry 96.bin", 0x00000, 0x1000, CRC(0046ab11) SHA1(21b500642545b62c3f80f639dee9807e14863be5) ) // v3.55, C1 Sub-PCB + ROM_CONTINUE(0x4000, 0x1000) + ROM_CONTINUE(0x3000, 0x1000) + ROM_CONTINUE(0x7000, 0x1000) + ROM_CONTINUE(0x1000, 0x1000) + ROM_CONTINUE(0x6000, 0x1000) + ROM_CONTINUE(0x2000, 0x1000) + ROM_CONTINUE(0x5000, 0x1000) + ROM_CONTINUE(0x8000, 0x8000) + + ROM_REGION( 0x20000, "graphics", 0 ) + ROM_LOAD( "high cherry 96.bin", 0x00000, 0x10000, CRC(b405a88d) SHA1(74caa24fe10292bb59debf505fb0bbb14547e7fb) ) + ROM_LOAD( "low cherry 96.bin", 0x10000, 0x10000, CRC(846bb8ae) SHA1(aa6203cd4c7a39dbd816a1bebd9a60be7655f823) ) + + ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2 + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 ) + ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 ) + ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 ) + ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 ) + + ROM_REGION( 0x200, "proms", 0 ) // palette, not dumped for this set + ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, BAD_DUMP CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) ) + ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, BAD_DUMP CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) ) +ROM_END + ROM_START( nc96txt ) ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "tc132axt.bin", 0x00000, 0x1000, CRC(a77dc042) SHA1(1076a6687da1871b666bd214a755b68f5e1aeb8c) ) // Special Texas v1.32, C2 Sub-PCB @@ -14788,22 +15040,61 @@ ROM_START( nfm ) ROM_CONTINUE(0xf000,0x1000) ROM_REGION( 0x10000, "reelgfx", 0 ) - ROM_LOAD( "fruit1", 0x00000, 0x04000, CRC(dd096dae) SHA1(ab34942cfa4fe7d46892819372c42f566c249f8c) ) - ROM_CONTINUE(0x0000, 0x4000) - ROM_LOAD( "fruit2", 0x04000, 0x04000, CRC(6a37a16f) SHA1(7adb08d3e4de9768a8e41760a044bf52509da211) ) - ROM_CONTINUE(0x0000, 0x4000) - ROM_LOAD( "fruit3", 0x08000, 0x04000, CRC(f3361ba7) SHA1(1a7b9c4f685656447bd6ce5f361e6e4af63012e3) ) + ROM_LOAD( "fruit4", 0x00000, 0x04000, CRC(99ac5ddf) SHA1(65b6abb98f3156f4c0c55478d09c612eed5ae555) ) + ROM_LOAD( "fruit3", 0x04000, 0x04000, CRC(f3361ba7) SHA1(1a7b9c4f685656447bd6ce5f361e6e4af63012e3) ) + ROM_CONTINUE(0x4000, 0x4000) + ROM_LOAD( "fruit2", 0x08000, 0x04000, CRC(6a37a16f) SHA1(7adb08d3e4de9768a8e41760a044bf52509da211) ) ROM_CONTINUE(0x8000, 0x4000) - ROM_LOAD( "fruit4", 0x0c000, 0x04000, CRC(99ac5ddf) SHA1(65b6abb98f3156f4c0c55478d09c612eed5ae555) ) + ROM_LOAD( "fruit1", 0x0c000, 0x04000, CRC(dd096dae) SHA1(ab34942cfa4fe7d46892819372c42f566c249f8c) ) + ROM_CONTINUE(0xc000, 0x4000) - // do these graphics really belong with this set? a lot of the tiles seem wrong for it ROM_REGION( 0x18000, "tilegfx", 0 ) - ROM_LOAD( "fruit5", 0x00000, 0x08000, CRC(a7a8f08d) SHA1(76c93194133ba85c0dde1f364260e16d5b647134) ) + ROM_LOAD( "fruit7", 0x00000, 0x08000, CRC(3ade6709) SHA1(9cdf2814e50c5433c582fc40265c5df2a16e99e7) ) ROM_LOAD( "fruit6", 0x08000, 0x08000, CRC(39d5b89a) SHA1(4cf52fa557ffc792d3e13f7dbb5d45fd617bac85) ) - ROM_LOAD( "fruit7", 0x10000, 0x08000, CRC(3ade6709) SHA1(9cdf2814e50c5433c582fc40265c5df2a16e99e7) ) + ROM_LOAD( "fruit5", 0x10000, 0x08000, CRC(a7a8f08d) SHA1(76c93194133ba85c0dde1f364260e16d5b647134) ) + + ROM_REGION( 0x40000, "user1", 0 ) + ROM_LOAD( "8_f29c51002t.u53", 0x00000, 0x40000, CRC(ff9d5b6d) SHA1(a84fe241ff9958740dcdbd4650bd16a0aa6e01ca) ) - ROM_REGION( 0x18000, "proms", 0 ) // colours? - ROM_LOAD( "fruiprg2", 0x00000, 0x08000, CRC(13925ff5) SHA1(236415a244ef6092834f8080cf0d2e04bbfa2650) ) + ROM_REGION( 0x8000, "colours", 0 ) // colours, only 0x200 used + ROM_LOAD( "fruiprg2", 0x0000, 0x08000, CRC(13925ff5) SHA1(236415a244ef6092834f8080cf0d2e04bbfa2650) ) +ROM_END + +ROM_START( nfma ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "9_27c512.u53", 0x00000, 0x01000, CRC(127b2a17) SHA1(973815f99d744e055f8bdff7753c3e70a892250c) ) + ROM_CONTINUE(0x5000,0x1000) + ROM_CONTINUE(0x7000,0x1000) + ROM_CONTINUE(0xa000,0x1000) + ROM_CONTINUE(0x2000,0x1000) //? + ROM_CONTINUE(0xb000,0x1000) //? + ROM_CONTINUE(0x9000,0x1000) + ROM_CONTINUE(0xc000,0x1000) + ROM_CONTINUE(0x1000,0x1000) + ROM_CONTINUE(0x3000,0x1000) + ROM_CONTINUE(0x6000,0x1000) + ROM_CONTINUE(0x4000,0x1000) + ROM_CONTINUE(0x8000,0x1000) + ROM_CONTINUE(0xd000,0x1000) // ? + ROM_CONTINUE(0xe000,0x1000) + ROM_CONTINUE(0xf000,0x1000) + + ROM_REGION( 0x10000, "reelgfx", 0 ) + ROM_LOAD( "4_27c128.u15", 0x00000, 0x04000, CRC(99ac5ddf) SHA1(65b6abb98f3156f4c0c55478d09c612eed5ae555) ) // matches nfm + ROM_LOAD( "3_27c128.u10", 0x04000, 0x04000, CRC(e8fbe05e) SHA1(a9439a91953d5caa211587eb837f6bfe52be0a00) ) // matches nfm, once taken into account this is correct size ROM + ROM_LOAD( "2_27c128.u14", 0x08000, 0x04000, CRC(6540a218) SHA1(78f5b78b9c7198c5cf6b2d1a7e02e9ac7b422b10) ) // matches nfm, once taken into account this is correct size ROM + ROM_LOAD( "1_27c128.u9", 0x0c000, 0x04000, CRC(af41b0c0) SHA1(ce463035b7f5509a92ae727020c3ecc511ed1d30) ) // matches nfm, once taken into account this is correct size ROM + + ROM_REGION( 0x18000, "tilegfx", 0 ) + ROM_LOAD( "7_27c256.u16", 0x00000, 0x08000, CRC(3ade6709) SHA1(9cdf2814e50c5433c582fc40265c5df2a16e99e7) ) // matches nfm + ROM_LOAD( "6_27c256.u11", 0x08000, 0x08000, CRC(39d5b89a) SHA1(4cf52fa557ffc792d3e13f7dbb5d45fd617bac85) ) // matches nfm + ROM_LOAD( "5_27c256.u4", 0x10000, 0x08000, CRC(a7a8f08d) SHA1(76c93194133ba85c0dde1f364260e16d5b647134) ) // matches nfm + + ROM_REGION( 0x40000, "user1", 0 ) + ROM_LOAD( "8_f29c51002t.u53", 0x00000, 0x40000, CRC(ff9d5b6d) SHA1(a84fe241ff9958740dcdbd4650bd16a0aa6e01ca) ) + + ROM_REGION( 0x8000, "colours", 0 ) // colours, only 0x200 used + ROM_LOAD( "10bp_27c257.u62", 0x0000, 0x8000, CRC(13925ff5) SHA1(236415a244ef6092834f8080cf0d2e04bbfa2650) ) // matches nfm ROM_END @@ -14981,7 +15272,7 @@ ROM_START( eldoradd ) ROM_REGION( 0x300, "proms", 0 ) ROM_LOAD( "mb7114.e8", 0x000, 0x100, CRC(fa274678) SHA1(6712cb1f7ead1a7aa703ec799e7199c33ace857c) ) ROM_LOAD( "mb7114.e10", 0x100, 0x100, CRC(e58877ea) SHA1(30fa873fc05d91610ef68eef54b78f2c7301a62a) ) - ROM_LOAD( "mb7114.e12", 0x100, 0x100, CRC(781b2842) SHA1(566667d4f81e93b29bb01dbc51bf144c02dff75d) ) + ROM_LOAD( "mb7114.e12", 0x200, 0x100, CRC(781b2842) SHA1(566667d4f81e93b29bb01dbc51bf144c02dff75d) ) ROM_REGION( 0x400, "plds", 0 ) // available as brute-forced dumps, need to be verified and converted ROM_LOAD( "pal16l8.d13", 0x000, 0x104, NO_DUMP ) @@ -16942,32 +17233,62 @@ void goldstar_state::init_ladylinre() void wingco_state::init_wcat3() { - // the following is very preliminary and only good to decrypt text strings. Treat everything as incomplete and probably incorrect. + // there must be some more conditions and/or some errors as the game needs to be soft resets 4-5 times before working apparently fine + // see from 0xb0 - 0xcf range for an example (comparable to range 0x96 - 0xb5 in lucky8) uint8_t *rom = memregion("maincpu")->base(); + static const uint8_t op_convtable[8][8] = + { + // opcodes address + // 0 1 2 3 4 5 6 7 + { 0x10, 0x00, 0x80, 0x90, 0x30, 0x20, 0xa0, 0xb0 }, // 0x000 + { 0x10, 0x00, 0x80, 0x90, 0x30, 0x20, 0xa0, 0xb0 }, // 0x001 + { 0x20, 0xa0, 0x00, 0x80, 0x10, 0x90, 0x30, 0xb0 }, // 0x004 + { 0x00, 0x20, 0x10, 0x30, 0x80, 0xa0, 0x90, 0xb0 }, // 0x005 + { 0x20, 0x80, 0x00, 0xa0, 0x30, 0x90, 0x10, 0xb0 }, // 0x400 + { 0x00, 0x80, 0x10, 0x90, 0x20, 0xa0, 0x30, 0xb0 }, // 0x401 + { 0x20, 0x80, 0x00, 0xa0, 0x30, 0x90, 0x10, 0xb0 }, // 0x404 + { 0x80, 0xa0, 0x10, 0x30, 0x00, 0x20, 0x90, 0xb0 }, // 0x405 + }; + + static const uint8_t convtable[8][8] = + { + // data address + // 0 1 2 3 4 5 6 7 + { 0x00, 0x10, 0x20, 0x30, 0x80, 0x90, 0xa0, 0xb0 }, // 0x000 + { 0x10, 0x00, 0x90, 0x80, 0x20, 0x30, 0xa0, 0xb0 }, // 0x001 + { 0x20, 0xa0, 0x00, 0x80, 0x10, 0x90, 0x30, 0xb0 }, // 0x004 // verify 0x00, 0x90, 0xa0 + { 0x80, 0x20, 0x90, 0x30, 0x00, 0xa0, 0x10, 0xb0 }, // 0x005 + { 0x00, 0x10, 0x20, 0x30, 0x80, 0x90, 0xa0, 0xb0 }, // 0x400 + { 0x10, 0x00, 0x90, 0x80, 0x20, 0x30, 0xa0, 0xb0 }, // 0x401 + { 0x00, 0x80, 0x20, 0xa0, 0x10, 0x90, 0x30, 0xb0 }, // 0x404 + { 0x00, 0x80, 0x20, 0xa0, 0x10, 0x90, 0x30, 0xb0 }, // 0x405 + }; + for (int i = 0x0000; i < 0x10000; i++) { uint8_t x = rom[i]; - m_decrypted_opcodes[i] = x; + // translation table from address + uint8_t row = (BIT(i, 0) + (BIT(i, 2) << 1) + (BIT(i, 10) << 2)); + + // offset in the table from source data + uint8_t col = (BIT(x, 4) + (BIT(x, 5) << 1) + (BIT(x, 7) << 2)); + + m_decrypted_opcodes[i] = (x & ~0xb0) | op_convtable[row][col]; } - // data encryption seems to involve only bits 4, 5 and 7 and some conditional XORs - for (int i = 0x4000; i < 0x10000; i++) + for (int i = 0x0000; i < 0x10000; i++) { uint8_t x = rom[i]; - switch (i & 0x405) - { - case 0x001: x = bitswap<8>(BIT(x, 6) ? x ^ 0x10 : x, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x004: x = bitswap<8>(!BIT(x, 7) ? x ^ 0x20 : x, 4, 6, 5, 7, 3, 2, 1, 0); break; - case 0x005: x = bitswap<8>(BIT(x, 7) ? x ^ 0x80 : x, 7, 6, 4, 5, 3, 2, 1, 0); break; - case 0x401: x = bitswap<8>(!BIT(x, 7) ? x ^ 0x10 : x, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x404: x = bitswap<8>(x, 4, 6, 5, 7, 3, 2, 1, 0); break; - case 0x405: x = bitswap<8>(x, 4, 6, 5, 7, 3, 2, 1, 0); break; - } + // translation table from address + uint8_t row = (BIT(i, 0) + (BIT(i, 2) << 1) + (BIT(i, 10) << 2)); - rom[i] = x; + // offset in the table from source data + uint8_t col = (BIT(x, 4) + (BIT(x, 5) << 1) + (BIT(x, 7) << 2)); + + rom[i] = (x & ~0xb0) | convtable[row][col]; } } @@ -17113,6 +17434,47 @@ void goldstar_state::init_chryangl() } } +void cmaster_state::init_wcat3a() // seems ok, but needs checking +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = rom[i]; + + switch (i & 0x83) + { + case 0x00: x = bitswap<8>(x ^ 0x2a, 1, 6, 7, 4, 5, 2, 3, 0); break; + case 0x01: x = bitswap<8>(x ^ 0x0a, 5, 6, 3, 4, 1, 2, 7, 0); break; + case 0x02: x = bitswap<8>(x ^ 0xa8, 5, 6, 3, 4, 1, 2, 7, 0); break; + case 0x03: x = bitswap<8>(x ^ 0x0a, 3, 6, 1, 4, 7, 2, 5, 0); break; + case 0x80: x = bitswap<8>(x ^ 0x28, 3, 6, 1, 4, 7, 2, 5, 0); break; + case 0x81: x = bitswap<8>(x ^ 0xa8, 1, 6, 7, 4, 5, 2, 3, 0); break; + case 0x82: x = bitswap<8>(x ^ 0xa2, 3, 6, 1, 4, 7, 2, 5, 0); break; + case 0x83: x = bitswap<8>(x ^ 0x2a, 5, 6, 3, 4, 1, 2, 7, 0); break; + } + + m_decrypted_opcodes[i] = x; + } + + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = rom[i]; + switch (i & 0x83) + { + case 0x00: x = bitswap<8>(x ^ 0x88, 3, 6, 1, 4, 7, 2, 5, 0); break; + case 0x01: x = bitswap<8>(x ^ 0x80, 5, 6, 3, 4, 1, 2, 7, 0); break; + case 0x02: x = bitswap<8>(x ^ 0x28, 1, 6, 7, 4, 5, 2, 3, 0); break; + case 0x03: x = bitswap<8>(x ^ 0x80, 3, 6, 1, 4, 7, 2, 5, 0); break; + case 0x80: x = bitswap<8>(x ^ 0x02, 5, 6, 3, 4, 1, 2, 7, 0); break; + case 0x81: x = bitswap<8>(x ^ 0x22, 3, 6, 1, 4, 7, 2, 5, 0); break; + case 0x82: x = bitswap<8>(x ^ 0x88, 5, 6, 3, 4, 1, 2, 7, 0); break; + case 0x83: x = bitswap<8>(x ^ 0x22, 1, 6, 7, 4, 5, 2, 3, 0); break; + } + rom[i] = x; + } +} + void cb3_state::init_chrygld() { uint8_t *rom = memregion("maincpu")->base(); @@ -17392,6 +17754,40 @@ void cmaster_state::init_skill98() /* Oki 6295 at 0x20 */ } +void cmaster_state::init_nfb96_a() +{ + uint8_t *rom = memregion("maincpu")->base(); + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = rom[i]; + + switch (i & 0x02) + { + case 0x00: x = bitswap<8>(x ^ 0x06, 5, 4, 3, 2, 1, 0, 7, 6); break; + case 0x02: x = bitswap<8>(x ^ 0x09, 3, 2, 1, 0, 7, 6, 5, 4); break; + } + rom[i] = x; + } +} + +void cmaster_state::init_nfb96_b() +{ + uint8_t *rom = memregion("maincpu")->base(); + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = rom[i]; + + switch (i & 0x18) + { + case 0x00: x = bitswap<8>(x ^ 0x27, 3, 2, 1, 0, 7, 6, 5, 4); break; + case 0x08: x = bitswap<8>(x ^ 0xa1, 0, 7, 6, 5, 4, 3, 2, 1); break; + case 0x10: x = bitswap<8>(x ^ 0x34, 5, 4, 3, 2, 1, 0, 7, 6); break; + case 0x18: x = bitswap<8>(x ^ 0x5c, 4, 3, 2, 1, 0, 7, 6, 5); break; + } + rom[i] = x; + } +} + void cmaster_state::init_nfb96_c1() { uint8_t *rom = memregion("maincpu")->base(); @@ -17412,6 +17808,26 @@ void cmaster_state::init_nfb96_c1() } +void cmaster_state::init_nfb96_c1_2() // C1 PCB, different CPLD +{ + uint8_t *rom = memregion("maincpu")->base(); + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = rom[i]; + + switch (i & 0x14) + { + case 0x00: x = bitswap<8>(x ^ 0x7d, 4, 0, 7, 6, 3, 1, 5, 2); break; + case 0x04: x = bitswap<8>(x ^ 0xbe, 6, 7, 0, 4, 3, 2, 1, 5); break; + case 0x10: x = bitswap<8>(x ^ 0x30, 3, 4, 2, 0, 5, 6, 1, 7); break; + case 0x14: x = bitswap<8>(x ^ 0x59, 6, 0, 1, 2, 4, 5, 3, 7); break; + } + rom[i] = x; + } + m_maincpu->space(AS_IO).install_read_handler(0x18, 0x18, read8_delegate(*this, FUNC(cmaster_state::fixedval_r<0x3a>))); + +} + void cmaster_state::init_nfb96_c2() { uint8_t *rom = memregion("maincpu")->base(); @@ -17478,6 +17894,24 @@ void cmaster_state::init_nfb96_dk() } +void cmaster_state::init_nfb96_g() +{ + uint8_t *rom = memregion("maincpu")->base(); + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = rom[i]; + + switch (i & 0x0a) + { + case 0x00: x = bitswap<8>(x ^ 0x5c, 1, 0, 7, 6, 5, 4, 3, 2); break; + case 0x02: x = bitswap<8>(x ^ 0xaf, 5, 4, 3, 2, 1, 0, 7, 6); break; + case 0x08: x = bitswap<8>(x ^ 0x39, 2, 1, 0, 7, 6, 5, 4, 3); break; + case 0x0a: x = bitswap<8>(x ^ 0xd7, 6, 5, 4, 3, 2, 1, 0, 7); break; + } + rom[i] = x; + } +} + void cmaster_state::init_rp35() { uint8_t *rom = memregion("maincpu")->base(); @@ -17920,36 +18354,6 @@ void cmaster_state::init_super7() } } -void wingco_state::init_luckylad() -{ - uint8_t *rom = memregion("maincpu")->base(); - - for (int i = 0x0000; i < 0x8000; i++) - { - uint8_t x = rom[i]; - switch (i & 0x1111) // preliminary, text in 0x3ab0-0x3c70, 0x4c00-0x5160 ranges seems mostly ok, seems similar to the one used in luckygrl (jangou.cpp). - { - case 0x0000: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; - case 0x0001: x = bitswap<8>(x ^ 0xa0, 3, 6, 5, 4, 7, 2, 1, 0); break; - case 0x0010: x = bitswap<8>(x ^ 0x88, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x0011: x = bitswap<8>(x ^ 0x28, 3, 6, 7, 4, 5, 2, 1, 0); break; - case 0x0100: x = bitswap<8>(x ^ 0x28, 3, 6, 7, 4, 5, 2, 1, 0); break; - case 0x0101: x = bitswap<8>(x ^ 0x20, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x0110: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; - case 0x0111: x = bitswap<8>(x ^ 0x88, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x1000: x = bitswap<8>(x ^ 0x20, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x1001: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; - case 0x1010: x = bitswap<8>(x ^ 0xa0, 3, 6, 5, 4, 7, 2, 1, 0); break; - case 0x1011: x = bitswap<8>(x ^ 0x80, 7, 6, 3, 4, 5, 2, 1, 0); break; - case 0x1100: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; - case 0x1101: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; - case 0x1110: x = bitswap<8>(x ^ 0x80, 7, 6, 3, 4, 5, 2, 1, 0); break; - case 0x1111: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; - } - - rom[i] = x; - } -} /********************************************* * Game Drivers * @@ -17980,8 +18384,7 @@ GAMEL( 199?, cb3e, ncb3, cb3e, chrygld, cb3_state, init_cb3e, GAMEL( 199?, chryglda, ncb3, cb3e, chrygld, cb3_state, init_cb3e, ROT0, "bootleg", "Cherry Gold I (set 2, encrypted bootleg)", 0, layout_chrygld ) // Runs in CB3e hardware. GAME( 1994, chryangla, ncb3, chryangla,ncb3, cb3_state, init_chryangl, ROT0, "bootleg (G.C.I.)", "Cherry Angel (encrypted, W-4 hardware)", MACHINE_NOT_WORKING ) // DYNA CB3 V1.40 string, decrypted but only test screens work -GAME( 1996, cmast97, ncb3, cm97, chrygld, cb3_state, empty_init, ROT0, "Dyna", "Cherry Master '97", MACHINE_NOT_WORKING) // fix prom decode -GAME( 1991, eldoradd, 0, cm97, chrygld, cb3_state, empty_init, ROT0, "Dyna", "El Dorado", MACHINE_NOT_WORKING) // everything +GAME( 1991, eldoradd, 0, eldoradd, chrygld, cb3_state, empty_init, ROT0, "Dyna", "El Dorado", MACHINE_NOT_WORKING) // everything // looks like a hack of Cherry Bonus 3 GAME( 1994, chryangl, ncb3, chryangl, chryangl, cmaster_state, init_chryangl, ROT0, "bootleg (G.C.I.)", "Cherry Angel", MACHINE_NOT_WORKING ) // SKY SUPERCB 1.0 string, decrypted but hangs when betting @@ -18010,6 +18413,7 @@ GAMEL( 1991, cmasterf, cmaster, cm, cmasterb, cmaster_state, init_cmv4, GAMEL( 1991, cmasterg, cmaster, cm, cmasterg, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 8, V4-B-)", 0, layout_cmasterb ) GAMEL( 1991, cmasterh, cmaster, cm, cmasterb, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.10)", 0, layout_cmasterb ) GAMEL( 199?, super7, cmaster, cm, cmaster, cmaster_state, init_super7, ROT0, "bootleg", "Super Seven", MACHINE_NOT_WORKING, layout_cmasterb ) +GAME ( 199?, wcat3a, wcat3, chryangl, cmaster, cmaster_state, init_wcat3a, ROT0, "E.A.I.", "Wild Cat 3 (CMV4 hardware)", MACHINE_NOT_WORKING ) // does not boot. Wrong decryption, wrong machine or wrong what? GAMEL( 1991, tonypok, 0, cm, tonypok, cmaster_state, init_tonypok, ROT0, "Corsica", "Poker Master (Tony-Poker V3.A, hack?)", 0 , layout_tonypok ) GAME( 1999, jkrmast, 0, pkrmast, pkrmast, goldstar_state, init_jkrmast, ROT0, "Pick-A-Party USA", "Joker Master (V515)", MACHINE_NOT_WORKING ) // encryption broken, needs GFX and controls @@ -18021,10 +18425,13 @@ GAME( 199?, chthree, cmaster, cm, cmaster, cmaster_state, init_chthr GAME( 1991, cmast91, 0, cmast91, cmast91, goldstar_state, init_cmast91, ROT0, "Dyna", "Cherry Master '91 (ver.1.30)", 0 ) GAME( 1992, cmast92, 0, cmast91, cmast91, goldstar_state, init_cmast91, ROT0, "Dyna", "Cherry Master '92", MACHINE_NOT_WORKING ) // no gfx roms are dumped +GAME( 1996, cmast97, 0, cm97, cmv801, cmaster_state, empty_init, ROT0, "Dyna", "Cherry Master '97", MACHINE_NOT_WORKING) // fix prom decode, reels GAME( 1999, cmast99, 0, cm, cmast99, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master '99 (V9B.00)", MACHINE_NOT_WORKING ) GAME( 1999, cmast99b, cmast99, cm, cmast99, cmaster_state, init_cmv4, ROT0, "bootleg", "Cherry Master '99 (V9B.00 bootleg / hack)", MACHINE_NOT_WORKING ) GAME( 1993, aplan, 0, cm, cmast99, cmaster_state, init_cmv4, ROT0, "WeaShing H.K.", "A-Plan", MACHINE_NOT_WORKING ) +GAME( 1996, war3cb, 0, cm, cmast99, cmaster_state, empty_init, ROT0, "S.B.E.", "War III Cherry Best", MACHINE_NOT_WORKING ) // different portmap? + GAME( 1995, tcl, 0, cm, cmaster, cmaster_state, init_tcl, ROT0, "Uniwang", "Taiwan Chess Legend", MACHINE_NOT_WORKING ) // incomplete decryption // --- Wing W-4 hardware --- @@ -18053,9 +18460,9 @@ GAME( 198?, ladylinrb, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladyl GAME( 198?, ladylinrc, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinrc, ROT0, "TAB Austria", "Lady Liner (encrypted, set 2)", 0 ) GAME( 198?, ladylinrd, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinrd, ROT0, "TAB Austria", "Lady Liner (encrypted, set 3)", 0 ) GAME( 198?, ladylinre, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinre, ROT0, "TAB Austria", "Lady Liner (encrypted, set 4)", 0 ) -GAME( 198?, wcat3, 0, wcat3, lucky8, wingco_state, init_wcat3, ROT0, "E.A.I.", "Wild Cat 3", MACHINE_NOT_WORKING ) +GAME( 1995, wcat3, 0, wcat3, lucky8, wingco_state, init_wcat3, ROT0, "E.A.I.", "Wild Cat 3", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS ) // decryption partially wrong, needs soft resets before running. Bad PROM decode -GAME( 1985, luckylad, 0, lucky8, luckylad, wingco_state, init_luckylad, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", MACHINE_NOT_WORKING ) // encrypted (see notes in rom_load)... +GAME( 1985, luckylad, 0, luckylad, luckylad, wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS ) // controls / dips, colors not correctly decoded GAME( 1991, megaline, 0, megaline, megaline, unkch_state, empty_init, ROT0, "Fun World", "Mega Lines", MACHINE_NOT_WORKING ) GAMEL( 1993, bingowng, 0, bingowng, bingowng, wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "Bingo (set 1)", 0, layout_bingowng ) @@ -18100,27 +18507,31 @@ GAME( 1998, match98, 0, amcoe1a, match98, cmaster_state, init_matc /* The Sub-PCB has a printed sticker denoting C1, C2, D or DK for the type of FPGA decryption chip used */ /* There is known to be a special IOWA version running on the Texas C2 hardware with roms FB96P IA, FB96L IA & FB96H IA with a (c) 2000 Amcoe */ -GAMEL( 1996, nfb96, 0, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.63, C1 PCB)", 0, layout_nfb96 ) /* ver. 02-3.63 C1 Sub-PCB */ -GAMEL( 1996, nfb96a, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.62, C1 PCB)", 0, layout_nfb96 ) /* ver. 00-3.62 C1 Sub-PCB */ -GAMEL( 1996, nfb96b, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* ver. 00-3.54 D Sub-PCB */ -GAMEL( 1996, nfb96c, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_dk, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* ver. 00-3.62 DK Sub-PCB */ -GAMEL( 2000, nfb96txt, nfb96, amcoe2, nfb96tx, cmaster_state, init_nfb96_c2, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v1.22 Texas XT, C2 PCB)", 0, layout_nfb96 ) /* ver. tf1.22axt C2 Sub-PCB */ - -GAMEL( 1996, nc96, 0, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.63, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ -GAMEL( 1996, nc96a, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ -GAMEL( 1996, nc96b, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.61, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ -GAMEL( 1996, nc96c, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ -GAMEL( 1996, nc96d, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.53, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ -GAMEL( 1996, nc96e, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.40, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ -GAMEL( 1996, nc96f, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_dk, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* DK Sub-PCB */ -GAMEL( 2000, nc96txt, nc96, amcoe2, nfb96tx, cmaster_state, init_nfb96_c2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v1.32 Texas XT, C2 PCB)", 0, layout_nfb96tx ) /* ver. tc1.32axt C2 Sub-PCB */ - -GAME( 2009, fb2010, 0, amcoe2, fb2010, cmaster_state, init_fb2010, ROT0, "Amcoe", "Fruit Bonus 2010", 0 ) - -GAMEL( 1996, roypok96, 0, amcoe2, roypok96, cmaster_state, init_rp35, ROT0, "Amcoe", "Royal Poker '96 (set 1, v97-3.5)", 0, layout_roypok96 ) -GAMEL( 1996, roypok96a, roypok96, amcoe2, roypok96a, cmaster_state, init_rp36, ROT0, "Amcoe", "Royal Poker '96 (set 2, v98-3.6)", 0, layout_roypok96 ) -GAMEL( 1996, roypok96b, roypok96, amcoe2, roypok96a, cmaster_state, init_rp36c3, ROT0, "Amcoe", "Royal Poker '96 (set 3, v98-3.6?)", 0, layout_roypok96 ) -GAME( 1996, roypok96c, roypok96, amcoe2, roypok96a, cmaster_state, init_rp96sub, ROT0, "Amcoe", "Royal Poker '96 (set 4, C3 board)", MACHINE_NOT_WORKING ) +GAMEL( 1996, nfb96, 0, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.63, C1 PCB)", 0, layout_nfb96 ) /* ver. 02-3.63 C1 Sub-PCB */ +GAMEL( 1996, nfb96a, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.62, C1 PCB)", 0, layout_nfb96 ) /* ver. 00-3.62 C1 Sub-PCB */ +GAMEL( 1996, nfb96b, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* ver. 00-3.54 D Sub-PCB */ +GAMEL( 1996, nfb96c, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_dk, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* ver. 00-3.62 DK Sub-PCB */ +GAMEL( 1996, nfb96d, nfb96, amcoe2, nfb96, cmaster_state, init_nfb96_a, ROT0, "Amcoe", "New Fruit Bonus '96 (v3.1, A PCB)", 0, layout_nfb96 ) /* ver. 00-3.1 A Sub-PCB */ +GAMEL( 2000, nfb96txt, nfb96, amcoe2, nfb96tx, cmaster_state, init_nfb96_c2, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v1.22 Texas XT, C2 PCB)", 0, layout_nfb96 ) /* ver. tf1.22axt C2 Sub-PCB */ + +GAMEL( 1996, nc96, 0, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.63, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ +GAMEL( 1996, nc96a, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ +GAMEL( 1996, nc96b, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.61, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ +GAMEL( 1996, nc96c, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ +GAMEL( 1996, nc96d, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.53, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ +GAMEL( 1996, nc96e, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.40, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ +GAMEL( 1996, nc96f, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_dk, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* DK Sub-PCB */ +GAMEL( 1996, nc96g, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_b, ROT0, "Amcoe", "New Cherry '96 (v3.1, B PCB)", 0, layout_nfb96 ) /* B Sub-PCB */ +GAMEL( 1996, nc96h, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_g, ROT0, "Amcoe", "New Cherry '96 (v3.1C, G PCB)", 0, layout_nfb96 ) /* G Sub-PCB */ +GAMEL( 1996, nc96i, nc96, amcoe2, nfb96, cmaster_state, init_nfb96_c1_2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.55, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ +GAMEL( 2000, nc96txt, nc96, amcoe2, nfb96tx, cmaster_state, init_nfb96_c2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v1.32 Texas XT, C2 PCB)", 0, layout_nfb96tx ) /* ver. tc1.32axt C2 Sub-PCB */ + +GAME( 2009, fb2010, 0, amcoe2, fb2010, cmaster_state, init_fb2010, ROT0, "Amcoe", "Fruit Bonus 2010", 0 ) + +GAMEL( 1996, roypok96, 0, amcoe2, roypok96, cmaster_state, init_rp35, ROT0, "Amcoe", "Royal Poker '96 (set 1, v97-3.5)", 0, layout_roypok96 ) +GAMEL( 1996, roypok96a, roypok96, amcoe2, roypok96a, cmaster_state, init_rp36, ROT0, "Amcoe", "Royal Poker '96 (set 2, v98-3.6)", 0, layout_roypok96 ) +GAMEL( 1996, roypok96b, roypok96, amcoe2, roypok96a, cmaster_state, init_rp36c3, ROT0, "Amcoe", "Royal Poker '96 (set 3, v98-3.6?)", 0, layout_roypok96 ) +GAME( 1996, roypok96c, roypok96, amcoe2, roypok96a, cmaster_state, init_rp96sub, ROT0, "Amcoe", "Royal Poker '96 (set 4, C3 board)", MACHINE_NOT_WORKING ) /* these all appear to be graphic hacks of 'New Fruit Bonus '96', they can run with the same program rom @@ -18134,7 +18545,8 @@ GAME( 1996, nfb96sec, nfb96, amcoe2, nfb96bl, cmaster_state, empty_init GAME( 2002, carb2002, nfb96, amcoe2, nfb96bl, cmaster_state, empty_init, ROT0, "bootleg", "Carriage Bonus 2002 (bootleg)", MACHINE_WRONG_COLORS ) GAME( 2003, carb2003, nfb96, amcoe2, nfb96bl, cmaster_state, empty_init, ROT0, "bootleg", "Carriage Bonus 2003 (bootleg)", MACHINE_WRONG_COLORS ) -GAME( 2003, nfm, 0, nfm, nfm, cmaster_state, empty_init, ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic)", MACHINE_NOT_WORKING ) // vFB02-07A "Copyright By Ms. Liu Orchis 2003/03/06" +GAME( 2003, nfm, 0, nfm, nfm, cmaster_state, empty_init, ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic, vFB02-07A)", MACHINE_NOT_WORKING ) // vFB02-07A "Copyright By Ms. Liu Orchis 2003/03/06", needs correct PROM and USER1 regions decode +GAME( 2003, nfma, nfm, nfm, nfm, cmaster_state, empty_init, ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic, vFB02-01A)", MACHINE_NOT_WORKING ) // vFB02-01A "Copyright By Ms. Liu Orchis 2003/03/06", needs correct PROM and USER1 regions decode // super cherry master sets... diff --git a/src/mame/drivers/gunsmoke.cpp b/src/mame/drivers/gunsmoke.cpp index c813db9703a..167b3878013 100644 --- a/src/mame/drivers/gunsmoke.cpp +++ b/src/mame/drivers/gunsmoke.cpp @@ -69,12 +69,18 @@ Stephh's notes (based on the games Z80 code and some tests) : ***************************************************************************/ +// Notes by Jose Tejada (jotego) +// CPU speed is 3MHz as per PCB measurement +// Vertical speed is 59.63 Hz +// There is no watchdog +// There is a DMA circuit, same as GnG, Commando and other CAPCOM games of the era +// The DMA copies sprites to a video and halts the CPU for ~131us + #include "emu.h" #include "includes/gunsmoke.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" -#include "machine/watchdog.h" #include "sound/2203intf.h" #include "screen.h" #include "speaker.h" @@ -117,7 +123,7 @@ void gunsmoke_state::gunsmoke_map(address_map &map) map(0xc4c9, 0xc4cb).r(FUNC(gunsmoke_state::gunsmoke_protection_r)); map(0xc800, 0xc800).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0xc804, 0xc804).w(FUNC(gunsmoke_state::gunsmoke_c804_w)); // ROM bank switch, screen flip - map(0xc806, 0xc806).w("watchdog", FUNC(watchdog_timer_device::reset_w)); + // 0xc806 DMA trigger (not emulated) map(0xd000, 0xd3ff).ram().w(FUNC(gunsmoke_state::gunsmoke_videoram_w)).share("videoram"); map(0xd400, 0xd7ff).ram().w(FUNC(gunsmoke_state::gunsmoke_colorram_w)).share("colorram"); map(0xd800, 0xd801).ram().share("scrollx"); @@ -304,19 +310,17 @@ void gunsmoke_state::machine_reset() void gunsmoke_state::gunsmoke(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 4000000); // 4 MHz + Z80(config, m_maincpu, 3000000); // 3 MHz Verified on PCB by jotego m_maincpu->set_addrmap(AS_PROGRAM, &gunsmoke_state::gunsmoke_map); m_maincpu->set_vblank_int("screen", FUNC(gunsmoke_state::irq0_line_hold)); z80_device &audiocpu(Z80(config, "audiocpu", 3000000)); // 3 MHz audiocpu.set_addrmap(AS_PROGRAM, &gunsmoke_state::sound_map); - audiocpu.set_periodic_int(FUNC(gunsmoke_state::irq0_line_hold), attotime::from_hz(4*60)); - - WATCHDOG_TIMER(config, "watchdog"); + audiocpu.set_periodic_int(FUNC(gunsmoke_state::irq0_line_hold), attotime::from_hz(4*59.63)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); + screen.set_refresh_hz(59.63); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); @@ -364,6 +368,7 @@ ROM_START( gunsmoke ) ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) diff --git a/src/mame/drivers/hapyfish.cpp b/src/mame/drivers/hapyfish.cpp index 8681e2723af..f43bf2f2728 100644 --- a/src/mame/drivers/hapyfish.cpp +++ b/src/mame/drivers/hapyfish.cpp @@ -10,6 +10,43 @@ To see bootloader messages, uncomment the UART_PRINTF define in s3c24xx.hxx. + The primary blocker at this point is a lack of a viable workaround for the + FameG FS8806 I2C/SPI authentication key chip. + + The FS8806 provides 96 bytes of on-board EEPROM as well as a 24-byte key, + with which it can perform either hashing or Triple DES. The expected + response bytes are not yet known, and the key-check routine is hundreds + of instructions' worth of assorted bitwise operations. + + To work around the FS8806 initialization and initial challenge/response + tests, run MAME with its debugger enabled, and do the following: + + 1. bp C002D788 [Enter] + 2. bp C002D84C [Enter] + 3. Close the debugger window. + 4. The debugger will reappear when the first breakpoint is hit. + 5a. R0=1 [Enter] + 5b. This will force the FS8806 init function to report success. + 6. Close the debugger window. + 7. The debugger will reappear when the second breakpoint is hit. + 8a. R4=1 [Enter] + 8b. This will force the first challenge/response test to report success. + + The system will begin its startup sequence, displaying a red fish logo. + + After some time checking the filesystem, it will then boot into the main + menu. Currently, inputs are not hooked up. + + It will then watchdog at around 52 seconds remaining on the timer, for + reasons not yet known, though the following kernel messages might provide + a clue: + + <3>dma2: IRQ with no loaded buffer? + <3>dma2: IRQ with no loaded buffer? + <0>Restarting system. + . + arch_reset: attempting watchdog reset + *******************************************************************************/ #include "emu.h" @@ -23,7 +60,13 @@ #include <algorithm> -#define VERBOSE_LEVEL ( 0 ) +#define LOG_GPIO (1 << 0) +#define LOG_ADC (1 << 1) +#define LOG_I2C (1 << 2) +#define LOG_INPUTS (1 << 3) + +#define VERBOSE (LOG_GPIO | LOG_ADC | LOG_I2C | LOG_INPUTS) +#include "logmacro.h" class hapyfish_state : public driver_device { @@ -35,7 +78,8 @@ public: m_nand(*this, "nand"), m_nand2(*this, "nand2"), m_ldac(*this, "ldac"), - m_rdac(*this, "rdac") + m_rdac(*this, "rdac"), + m_inputs(*this, "INPUT%u", 0U) { } void hapyfish(machine_config &config); @@ -48,11 +92,41 @@ private: required_device<nand_device> m_nand, m_nand2; required_device<dac_word_interface> m_ldac; required_device<dac_word_interface> m_rdac; + required_ioport_array<6> m_inputs; + + void i2c_scl_write(bool clk); + void i2c_sda_write(int data); uint32_t m_port[9]; + + enum i2c_mode + { + I2C_IDLE, + I2C_ADDR, + I2C_TYPE, + I2C_READ_ACK, + I2C_READ, + I2C_WRITE_ACK, + I2C_WRITE + }; + + int m_i2c_sda_in; + int m_i2c_sda_out; + bool m_i2c_scl; + bool m_i2c_scl_pulse_started; + bool m_i2c_started; + i2c_mode m_i2c_mode; + uint8_t m_i2c_addr; + uint8_t m_i2c_addr_bits; + uint8_t m_i2c_data; + uint8_t m_i2c_data_bits; + + bool m_nand_select; + + uint8_t m_input_select; + virtual void machine_start() override; virtual void machine_reset() override; - inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); DECLARE_READ32_MEMBER(s3c2440_gpio_port_r); DECLARE_WRITE32_MEMBER(s3c2440_gpio_port_w); DECLARE_READ32_MEMBER(s3c2440_core_pin_r); @@ -66,43 +140,183 @@ private: void hapyfish_map(address_map &map); }; -inline void hapyfish_state::verboselog(int n_level, const char *s_fmt, ...) +/*************************************************************************** + MACHINE HARDWARE +***************************************************************************/ + +// I2C bus on GPIO port E bits 15 (SDA) and 14 (SCL) + +void hapyfish_state::i2c_sda_write(int sda) { - if (VERBOSE_LEVEL >= n_level) + int old_sda = m_i2c_sda_out; + m_i2c_sda_out = sda; + if (old_sda && !m_i2c_sda_out && m_i2c_scl) + { + if (!m_i2c_started) + { + LOGMASKED(LOG_I2C, "%s: I2C Starting\n", machine().describe_context()); + } + else + { + LOGMASKED(LOG_I2C, "%s: I2C Repeat-starting\n", machine().describe_context()); + } + m_i2c_started = true; + m_i2c_mode = I2C_ADDR; + m_i2c_addr_bits = 0; + m_i2c_addr = 0x00; + m_i2c_scl_pulse_started = false; + } + else if (!old_sda && m_i2c_sda_out && m_i2c_scl && m_i2c_started) { - va_list v; - char buf[32768]; - va_start(v, s_fmt); - vsprintf(buf, s_fmt, v); - va_end(v); - logerror("%s: %s", machine().describe_context(), buf); + LOGMASKED(LOG_I2C, "%s: I2C Stopping\n", machine().describe_context()); + m_i2c_started = false; + m_i2c_scl_pulse_started = false; + m_i2c_mode = I2C_IDLE; } } -/*************************************************************************** - MACHINE HARDWARE -***************************************************************************/ +void hapyfish_state::i2c_scl_write(bool scl) +{ + bool old_scl = m_i2c_scl; + m_i2c_scl = scl; + if (!old_scl && m_i2c_scl) + { + LOGMASKED(LOG_I2C, "%s: Received low-high SCL transition\n", machine().describe_context()); + m_i2c_scl_pulse_started = true; + if (m_i2c_mode == I2C_READ_ACK) + { + LOGMASKED(LOG_I2C, "%s: Sending read acknowledge bit, entering read mode\n", machine().describe_context()); + m_i2c_sda_in = 0; // ACK + m_i2c_mode = I2C_READ; + } + else if (m_i2c_mode == I2C_READ) + { + m_i2c_data_bits--; + m_i2c_sda_in = BIT(m_i2c_data, m_i2c_data_bits); + LOGMASKED(LOG_I2C, "%s: Sending read data bit %d: %d\n", machine().describe_context(), m_i2c_data_bits, m_i2c_sda_in); + if (m_i2c_data_bits == 0) + { + LOGMASKED(LOG_I2C, "%s: Sent I2C data to host, entering read-acknowledge mode: %02x\n", machine().describe_context(), m_i2c_data); + m_i2c_mode = I2C_READ_ACK; + m_i2c_data_bits = 8; + m_i2c_data = 0xff; + } + } + } + else if (old_scl && !m_i2c_scl && m_i2c_scl_pulse_started && m_i2c_started) + { + m_i2c_scl_pulse_started = false; + if (m_i2c_mode == I2C_ADDR) + { + LOGMASKED(LOG_I2C, "%s: Received address bit %d: %d\n", machine().describe_context(), 7 - m_i2c_addr_bits, m_i2c_sda_out); + m_i2c_addr <<= 1; + m_i2c_addr |= m_i2c_sda_out; + m_i2c_addr_bits++; + if (m_i2c_addr_bits == 7) + { + LOGMASKED(LOG_I2C, "%s: Received I2C address: %02x\n", machine().describe_context(), m_i2c_addr); + m_i2c_mode = I2C_TYPE; + } + } + else if (m_i2c_mode == I2C_TYPE) + { + LOGMASKED(LOG_I2C, "%s: Received access type bit: %d\n", machine().describe_context(), m_i2c_sda_out); + if (m_i2c_sda_out) + { + LOGMASKED(LOG_I2C, "%s: Received I2C read request, acknowledging\n", machine().describe_context()); + m_i2c_sda_in = 0; // ACK + m_i2c_mode = I2C_READ_ACK; + m_i2c_data_bits = 8; + m_i2c_data = 0xff; + } + else + { + LOGMASKED(LOG_I2C, "%s: Received I2C write request, acknowledging\n", machine().describe_context()); + m_i2c_sda_in = 0; // ACK + m_i2c_mode = I2C_WRITE; + m_i2c_data_bits = 0; + m_i2c_data = 0x00; + } + } + else if (m_i2c_mode == I2C_READ_ACK) + { + // TODO: Actual response from actual device + LOGMASKED(LOG_I2C, "%s: Acknowledging I2C read request\n", machine().describe_context()); + } + else if (m_i2c_mode == I2C_WRITE_ACK) + { + LOGMASKED(LOG_I2C, "%s: Acknowledging I2C write request\n", machine().describe_context()); + } + else if (m_i2c_mode == I2C_WRITE) + { + LOGMASKED(LOG_I2C, "%s: Received write data bit %d: %d\n", machine().describe_context(), 7 - m_i2c_data_bits, m_i2c_sda_out); + m_i2c_data <<= 1; + m_i2c_data |= m_i2c_sda_out; + m_i2c_data_bits++; + if (m_i2c_data_bits == 8) + { + LOGMASKED(LOG_I2C, "%s: Received I2C data from host, acknowledging: %02x\n", machine().describe_context(), m_i2c_data); + m_i2c_sda_in = 0; // ACK + m_i2c_data_bits = 0; + m_i2c_data = 0x00; + } + } + } +} // GPIO READ32_MEMBER(hapyfish_state::s3c2440_gpio_port_r) { uint32_t data = m_port[offset]; - verboselog(3, "Read GPIO @ %x\n", offset); switch (offset) { + case S3C2440_GPIO_PORT_A: + LOGMASKED(LOG_GPIO, "%s: Read GPIO A: %08x\n", machine().describe_context(), data); + break; + + case S3C2440_GPIO_PORT_B: + LOGMASKED(LOG_GPIO, "%s: Read GPIO B: %08x\n", machine().describe_context(), data); + break; + + case S3C2440_GPIO_PORT_C: + LOGMASKED(LOG_GPIO, "%s: Read GPIO C: %08x\n", machine().describe_context(), data); + break; + + case S3C2440_GPIO_PORT_D: + LOGMASKED(LOG_GPIO, "%s: Read GPIO D: %08x\n", machine().describe_context(), data); + break; + case S3C2440_GPIO_PORT_E: - data = 0x80008000; + data = m_i2c_sda_in << 15; + m_i2c_scl_pulse_started = false; + LOGMASKED(LOG_GPIO, "%s: Read GPIO E: %08x\n", machine().describe_context(), data); break; - case S3C2440_GPIO_PORT_G : - { + case S3C2440_GPIO_PORT_F: + data = 0xff; + if (m_input_select < 6) + { + data = m_inputs[m_input_select]->read(); + } + LOGMASKED(LOG_GPIO, "%s: Read GPIO F: %08x\n", machine().describe_context(), data); + break; + + case S3C2440_GPIO_PORT_G: data = (data & ~(1 << 13)) | (1 << 13); // [nand] 1 = 2048 byte page (if ncon = 1) data = (data & ~(1 << 14)) | (1 << 14); // [nand] 1 = 5 address cycle (if ncon = 1) data = (data & ~(1 << 15)) | (0 << 15); // [nand] 0 = 8-bit bus width (if ncon = 1) data = data | 0x8E9; // for "load Image of Linux..." - } - break; + LOGMASKED(LOG_GPIO, "%s: Read GPIO G: %08x\n", machine().describe_context(), data); + break; + + case S3C2440_GPIO_PORT_H: + LOGMASKED(LOG_GPIO, "%s: Read GPIO H: %08x\n", machine().describe_context(), data); + break; + + case S3C2440_GPIO_PORT_J: + LOGMASKED(LOG_GPIO, "%s: Read GPIO J: %08x\n", machine().describe_context(), data); + break; } return data; } @@ -116,6 +330,63 @@ WRITE32_MEMBER(hapyfish_state::s3c2440_gpio_port_w) //printf("%08x to GPIO @ %x\n", data, offset); m_port[offset] = data; + switch (offset) + { + case S3C2440_GPIO_PORT_A: + LOGMASKED(LOG_GPIO, "%s: Write GPIO A: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_B: + LOGMASKED(LOG_GPIO, "%s: Write GPIO B: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_C: + LOGMASKED(LOG_GPIO, "%s: Write GPIO C: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_D: + LOGMASKED(LOG_GPIO, "%s: Write GPIO D: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_E: + LOGMASKED(LOG_GPIO, "%s: Write GPIO E: %08x & %08x\n", machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_I2C, "%s: I2C SDA/SCL: %d/%d (&%d/&%d)\n", machine().describe_context(), BIT(data, 15), BIT(data, 14), BIT(mem_mask, 15), BIT(mem_mask, 14)); + if (BIT(mem_mask, 14)) + { + i2c_scl_write(BIT(data, 14)); + } + if (BIT(mem_mask, 15)) + { + i2c_sda_write(BIT(data, 15)); + } + if (mem_mask & 0x7e0) + { + uint8_t input_row_mask = ~(((data & mem_mask) >> 5) & 0x7f); + for (m_input_select = 0; m_input_select < 8 && !BIT(input_row_mask, m_input_select); m_input_select++); + LOGMASKED(LOG_INPUTS, "%s: Input select: Port %d\n", machine().describe_context(), m_input_select); + } + break; + + case S3C2440_GPIO_PORT_F: + LOGMASKED(LOG_GPIO, "%s: Write GPIO F: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_G: + LOGMASKED(LOG_GPIO, "%s: Write GPIO G: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_H: + LOGMASKED(LOG_GPIO, "%s: Write GPIO H: %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case S3C2440_GPIO_PORT_J: + LOGMASKED(LOG_GPIO, "%s: Write GPIO J: %08x & %08x\n", machine().describe_context(), data, mem_mask); + if (BIT(mem_mask, 11)) + { + m_nand_select = BIT(data, 11); + } + break; + } } // CORE @@ -146,47 +417,34 @@ READ32_MEMBER(hapyfish_state::s3c2440_core_pin_r) WRITE8_MEMBER(hapyfish_state::s3c2440_nand_command_w ) { - if ((m_port[8] & 0x1800) != 0) - { + if (m_nand_select) m_nand->command_w(data); - } else - { m_nand2->command_w(data); - } } WRITE8_MEMBER(hapyfish_state::s3c2440_nand_address_w ) { - if ((m_port[8] & 0x1800) != 0) - { + if (m_nand_select) m_nand->address_w(data); - } else - { m_nand2->address_w(data); - } } READ8_MEMBER(hapyfish_state::s3c2440_nand_data_r ) { - if ((m_port[8] & 0x1800) != 0) - { + if (m_nand_select) return m_nand->data_r(); - } - - return m_nand2->data_r(); + else + return m_nand2->data_r(); } WRITE8_MEMBER(hapyfish_state::s3c2440_nand_data_w ) { - if ((m_port[8] & 0x1800) != 0) - { + if (m_nand_select) m_nand->data_w(data); - return; - } - - m_nand2->data_w(data); + else + m_nand2->data_w(data); } // I2S @@ -204,6 +462,7 @@ WRITE16_MEMBER(hapyfish_state::s3c2440_i2s_data_w ) READ32_MEMBER(hapyfish_state::s3c2440_adc_data_r ) { uint32_t data = 0; + LOGMASKED(LOG_ADC, "%s: ADC data read: %08x\n", machine().describe_context(), data); return data; } @@ -213,14 +472,26 @@ void hapyfish_state::machine_start() { m_nand->set_data_ptr(memregion("nand")->base()); m_nand2->set_data_ptr(memregion("nand2")->base()); - m_port[8] = 0x1800; // select NAND #1 (S3C2440 bootloader will happen before machine_reset()) + m_nand_select = true; // select NAND #1 (S3C2440 bootloader will happen before machine_reset()) + m_input_select = 7; } void hapyfish_state::machine_reset() { m_maincpu->reset(); std::fill(std::begin(m_port), std::end(m_port), 0); - m_port[8] = 0x1800; // select NAND #1 + m_nand_select = true; // select NAND #1 + m_i2c_sda_in = 1; + m_i2c_sda_out = 1; + m_i2c_scl = true; + m_i2c_scl_pulse_started = false; + m_i2c_started = false; + m_i2c_mode = I2C_IDLE; + m_i2c_addr = 0x00; + m_i2c_addr_bits = 0; + m_i2c_data = 0x00; + m_i2c_data_bits = 0; + m_input_select = 7; } /*************************************************************************** @@ -286,6 +557,50 @@ void hapyfish_state::hapyfish(machine_config &config) } static INPUT_PORTS_START( hapyfish ) + PORT_START("INPUT0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(1) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(1) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(1) + + PORT_START("INPUT1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2) + + PORT_START("INPUT2") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("INPUT3") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("INPUT4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_START1) + PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("INPUT5") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Language ) ) PORT_DIPLOCATION("S2:1") + PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( Chinese ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("S2:2") + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coinage ) ) PORT_DIPLOCATION("S2:3,4") + PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) + PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED) INPUT_PORTS_END /*************************************************************************** diff --git a/src/mame/drivers/harriet.cpp b/src/mame/drivers/harriet.cpp index 9dac9ad279e..91dbdcd32fa 100644 --- a/src/mame/drivers/harriet.cpp +++ b/src/mame/drivers/harriet.cpp @@ -82,6 +82,17 @@ void harriet_state::machine_reset() } +static const input_device_default terminal_defaults[] = +{ + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) + { nullptr, 0, 0 } +}; + void harriet_state::harriet(machine_config &config) { M68010(config, m_maincpu, 40_MHz_XTAL / 4); // MC68010FN10 @@ -91,11 +102,9 @@ void harriet_state::harriet(machine_config &config) mc68901_device &mfp(MC68901(config, "mfp", 40_MHz_XTAL / 16)); mfp.set_timer_clock(2.4576_MHz_XTAL); - mfp.set_rx_clock(9600); - mfp.set_tx_clock(9600); mfp.out_so_cb().set("rs232", FUNC(rs232_port_device::write_txd)); - //mfp.out_tco_cb().set("mfp", FUNC(mc68901_device::rc_w)); - //mfp.out_tdo_cb().set("mfp", FUNC(mc68901_device::tc_w)); + mfp.out_tco_cb().set("mfp", FUNC(mc68901_device::rc_w)); + mfp.out_tdo_cb().set("mfp", FUNC(mc68901_device::tc_w)); HD63450(config, "dmac", 40_MHz_XTAL / 4, "maincpu"); // MC68450R10 (or HD68450Y-10) @@ -103,8 +112,9 @@ void harriet_state::harriet(machine_config &config) NVRAM(config, "zpram", nvram_device::DEFAULT_ALL_0); // MK48Z02 rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); - rs232.rxd_handler().set("mfp", FUNC(mc68901_device::write_rx)); + rs232.rxd_handler().set("mfp", FUNC(mc68901_device::si_w)); rs232.rxd_handler().append("mfp", FUNC(mc68901_device::tbi_w)); + rs232.set_option_device_input_defaults("terminal", terminal_defaults); NSCSI_BUS(config, "scsia"); NSCSI_CONNECTOR(config, "scsia:7").option_set("wdc", WD33C93A).clock(40_MHz_XTAL / 4); diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index aac56116960..d4d218091f9 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -23,14 +23,15 @@ TODO: - confirm gnw_bfight rom (assumed to be the same as gnw_bfightn) - confirm gnw_climber rom (assumed to be the same as gnw_climbern) - confirm gnw_smb rom (assumed to be the same as gnw_smbn) -- dump/add purple version of gnw_judge +- dump/add purple version of gnw_judge, different MCU label? +- dump/add 2nd version of gnw_mariocmt, different MCU label? - dump/add CN-07 version of gnw_helmet - Currently there is no accurate way to dump the SM511/SM512 melody ROM electronically. For the ones that weren't decapped, they were read by playing back all melody data and reconstructing it to ROM. Visual(decap) verification is wanted for: gnw_bfightn, gnw_bjack, gnw_bsweep, gnw_climbern, - gnw_dkcirc, gnw_dkjrp, gnw_gcliff, gnw_mariotj, gnw_mbaway, gnw_mmousep, - gnw_sbuster, gnw_zelda + gnw_dkcirc, gnw_dkjrp, gnw_gcliff, gnw_mariocmt, gnw_mariotj, gnw_mbaway, + gnw_mmousep, gnw_sbuster, gnw_zelda **************************************************************************** @@ -82,7 +83,7 @@ JB-63 ms SM511 Safe Buster MV-64 ms SM512 Gold Cliff ZL-65 ms SM512 Zelda CJ-71* tt SM511? Donkey Kong Jr. -CM-72* tt SM511? Mario's Cement Factory +CM-72 tt SM511 Mario's Cement Factory SM-73* tt SM511? Snoopy PG-74* tt SM511? Popeye SM-91* p SM511? Snoopy (assume same ROM & LCD as tabletop version) @@ -112,6 +113,9 @@ YM-901-S* x SM511 Super Mario Bros. " RGW-001 (2010 Ball remake) is on different hardware, ATmega169PV MCU. The "Mini Classics" keychains are by Nelsonic, not Nintendo. +Bassmate Computer (BM-501) is on identical hardware as G&W Multi Screen, +but it's not part of the game series. + ***************************************************************************/ #include "emu.h" @@ -2780,6 +2784,83 @@ ROM_END /*************************************************************************** + Nintendo Game & Watch: Mario's Cement Factory (model CM-72) + * PCB labels: CM-72 M (main board) + CM-72 C (joystick controller board) + CM-72 S (buttons controller board) + * Sharp SM511 label CM-72 534A (no decap) + * inverted lcd screen with custom segments, 1-bit sound + + This is the tabletop version. There's also a new wide screen version which is + a different game. Unlike the other tabletop games, there is no panorama version. + There are two known versions, distinguished by the startup jingle. The first + version sounds like Queen's "Another One Bites the Dust". + +***************************************************************************/ + +class gnw_mariocmt_state : public hh_sm510_state +{ +public: + gnw_mariocmt_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_sm510_state(mconfig, type, tag) + { } + + void gnw_mariocmt(machine_config &config); +}; + +// config + +static INPUT_PORTS_START( gnw_mariocmt ) + PORT_START("IN.0") // S1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_CB(input_changed) // Open + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_CB(input_changed) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_CB(input_changed) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // S2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_CHANGED_CB(input_changed) PORT_NAME("Time") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_CHANGED_CB(input_changed) PORT_NAME("Game B") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_CHANGED_CB(input_changed) PORT_NAME("Game A") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_CHANGED_CB(input_changed) PORT_NAME("Alarm") + + PORT_START("ACL") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED_CB(acl_button) PORT_NAME("ACL") + + PORT_START("BA") + PORT_CONFNAME( 0x01, 0x01, "Increase Score (Cheat)") // factory test, unpopulated on PCB + PORT_CONFSETTING( 0x01, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("B") + PORT_CONFNAME( 0x01, 0x01, "Infinite Lives (Cheat)") // " + PORT_CONFSETTING( 0x01, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + +void gnw_mariocmt_state::gnw_mariocmt(machine_config &config) +{ + sm511_common(config, 1920, 1046); +} + +// roms + +ROM_START( gnw_mariocmt ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "cm-72.program", 0x0000, 0x1000, CRC(b2ae4596) SHA1(f64bf11e18c9fbd4de4134f685bb2d7bda3d7487) ) + + ROM_REGION( 0x100, "maincpu:melody", 0 ) + ROM_LOAD( "cm-72.melody", 0x000, 0x100, BAD_DUMP CRC(db4f0fc1) SHA1(e386df3e3e88fa36a73bcd0649feb904180493c8) ) // decap needed for verification + + ROM_REGION( 293317, "screen", 0) + ROM_LOAD( "gnw_mariocmt.svg", 0, 293317, CRC(4f969dc7) SHA1(fec72c4a8600c0753f81bfb296b53cca6aee14cc) ) +ROM_END + + + + + +/*************************************************************************** + Nintendo Game & Watch: Donkey Kong Jr. (model CJ-93) * PCB labels: CJ-93 M (main board), CJ-93C (controller board) * Sharp SM511 label CJ-93 539D (no decap) @@ -8772,33 +8853,33 @@ ROM_END // YEAR NAME PARENT COMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -// Nintendo G&W: silver/gold (initial series is uncategorized, "silver" was made up later) +// Nintendo G&W: Silver/Gold (initial series is uncategorized, "Silver" was made up later) CONS( 1980, gnw_ball, 0, 0, gnw_ball, gnw_ball, gnw_ball_state, empty_init, "Nintendo", "Game & Watch: Ball", MACHINE_SUPPORTS_SAVE ) CONS( 1980, gnw_flagman, 0, 0, gnw_flagman, gnw_flagman, gnw_flagman_state, empty_init, "Nintendo", "Game & Watch: Flagman", MACHINE_SUPPORTS_SAVE ) CONS( 1980, gnw_vermin, 0, 0, gnw_vermin, gnw_vermin, gnw_vermin_state, empty_init, "Nintendo", "Game & Watch: Vermin", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, gnw_fires, 0, 0, gnw_fires, gnw_fires, gnw_fires_state, empty_init, "Nintendo", "Game & Watch: Fire (silver)", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, gnw_judge, 0, 0, gnw_judge, gnw_judge, gnw_judge_state, empty_init, "Nintendo", "Game & Watch: Judge (green)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, gnw_manholeg,0, 0, gnw_manholeg,gnw_manholeg,gnw_manholeg_state,empty_init, "Nintendo", "Game & Watch: Manhole (gold)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, gnw_helmet, 0, 0, gnw_helmet, gnw_helmet, gnw_helmet_state, empty_init, "Nintendo", "Game & Watch: Helmet (Rev. 2)", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, gnw_fires, 0, 0, gnw_fires, gnw_fires, gnw_fires_state, empty_init, "Nintendo", "Game & Watch: Fire (Silver)", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, gnw_judge, 0, 0, gnw_judge, gnw_judge, gnw_judge_state, empty_init, "Nintendo", "Game & Watch: Judge (green version)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_manholeg,0, 0, gnw_manholeg,gnw_manholeg,gnw_manholeg_state,empty_init, "Nintendo", "Game & Watch: Manhole (Gold)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_helmet, 0, 0, gnw_helmet, gnw_helmet, gnw_helmet_state, empty_init, "Nintendo", "Game & Watch: Helmet (CN-17 version)", MACHINE_SUPPORTS_SAVE ) CONS( 1981, gnw_lion, 0, 0, gnw_lion, gnw_lion, gnw_lion_state, empty_init, "Nintendo", "Game & Watch: Lion", MACHINE_SUPPORTS_SAVE ) -// Nintendo G&W: wide screen +// Nintendo G&W: Wide Screen CONS( 1981, gnw_pchute, 0, 0, gnw_pchute, gnw_pchute, gnw_pchute_state, empty_init, "Nintendo", "Game & Watch: Parachute", MACHINE_SUPPORTS_SAVE ) CONS( 1981, gnw_octopus, 0, 0, gnw_octopus, gnw_octopus, gnw_octopus_state, empty_init, "Nintendo", "Game & Watch: Octopus", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, gnw_popeye, 0, 0, gnw_popeye, gnw_popeye, gnw_popeye_state, empty_init, "Nintendo", "Game & Watch: Popeye (wide screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_popeye, 0, 0, gnw_popeye, gnw_popeye, gnw_popeye_state, empty_init, "Nintendo", "Game & Watch: Popeye (Wide Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1981, gnw_chef, 0, 0, gnw_chef, gnw_chef, gnw_chef_state, empty_init, "Nintendo", "Game & Watch: Chef", MACHINE_SUPPORTS_SAVE ) CONS( 1989, merrycook, gnw_chef, 0, merrycook, gnw_chef, gnw_chef_state, empty_init, "Elektronika", "Merry Cook", MACHINE_SUPPORTS_SAVE) -CONS( 1981, gnw_mmouse, 0, 0, gnw_mmouse, gnw_mmouse, gnw_mmouse_state, empty_init, "Nintendo", "Game & Watch: Mickey Mouse (wide screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_mmouse, 0, 0, gnw_mmouse, gnw_mmouse, gnw_mmouse_state, empty_init, "Nintendo", "Game & Watch: Mickey Mouse (Wide Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1981, gnw_egg, gnw_mmouse, 0, gnw_egg, gnw_mmouse, gnw_mmouse_state, empty_init, "Nintendo", "Game & Watch: Egg", MACHINE_SUPPORTS_SAVE ) CONS( 1984, nupogodi, gnw_mmouse, 0, nupogodi, gnw_mmouse, gnw_mmouse_state, empty_init, "Elektronika", "Nu, pogodi!", MACHINE_SUPPORTS_SAVE ) CONS( 1989, exospace, gnw_mmouse, 0, exospace, exospace, gnw_mmouse_state, empty_init, "Elektronika", "Explorers of Space", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, gnw_fire, 0, 0, gnw_fire, gnw_fire, gnw_fire_state, empty_init, "Nintendo", "Game & Watch: Fire (wide screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_fire, 0, 0, gnw_fire, gnw_fire, gnw_fire_state, empty_init, "Nintendo", "Game & Watch: Fire (Wide Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1989, spacebridge, gnw_fire, 0, spacebridge, gnw_fire, gnw_fire_state, empty_init, "Elektronika", "Space Bridge", MACHINE_SUPPORTS_SAVE ) CONS( 1982, gnw_tbridge, 0, 0, gnw_tbridge, gnw_tbridge, gnw_tbridge_state, empty_init, "Nintendo", "Game & Watch: Turtle Bridge", MACHINE_SUPPORTS_SAVE ) CONS( 1982, gnw_fireatk, 0, 0, gnw_fireatk, gnw_fireatk, gnw_fireatk_state, empty_init, "Nintendo", "Game & Watch: Fire Attack", MACHINE_SUPPORTS_SAVE ) CONS( 1982, gnw_stennis, 0, 0, gnw_stennis, gnw_stennis, gnw_stennis_state, empty_init, "Nintendo", "Game & Watch: Snoopy Tennis", MACHINE_SUPPORTS_SAVE ) -// Nintendo G&W: multi screen +// Nintendo G&W: Multi Screen CONS( 1982, gnw_opanic, 0, 0, gnw_opanic, gnw_opanic, gnw_opanic_state, empty_init, "Nintendo", "Game & Watch: Oil Panic", MACHINE_SUPPORTS_SAVE) CONS( 1982, gnw_dkong, 0, 0, gnw_dkong, gnw_dkong, gnw_dkong_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong", MACHINE_SUPPORTS_SAVE ) CONS( 1982, gnw_mickdon, 0, 0, gnw_mickdon, gnw_mickdon, gnw_mickdon_state, empty_init, "Nintendo", "Game & Watch: Mickey & Donald", MACHINE_SUPPORTS_SAVE ) @@ -8814,29 +8895,30 @@ CONS( 1988, gnw_sbuster, 0, 0, gnw_sbuster, gnw_sbuster, gnw_sbuster_st CONS( 1988, gnw_gcliff, 0, 0, gnw_gcliff, gnw_gcliff, gnw_gcliff_state, empty_init, "Nintendo", "Game & Watch: Gold Cliff", MACHINE_SUPPORTS_SAVE ) CONS( 1989, gnw_zelda, 0, 0, gnw_zelda, gnw_zelda, gnw_zelda_state, empty_init, "Nintendo", "Game & Watch: Zelda", MACHINE_SUPPORTS_SAVE ) -// Nintendo G&W: new wide screen / crystal screen -CONS( 1982, gnw_dkjr, 0, 0, gnw_dkjr, gnw_dkjr, gnw_dkjr_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong Jr. (new wide screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, gnw_mariocm, 0, 0, gnw_mariocm, gnw_mariocm, gnw_mariocm_state, empty_init, "Nintendo", "Game & Watch: Mario's Cement Factory (new wide screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, gnw_manhole, 0, 0, gnw_manhole, gnw_manhole, gnw_manhole_state, empty_init, "Nintendo", "Game & Watch: Manhole (new wide screen)", MACHINE_SUPPORTS_SAVE ) +// Nintendo G&W: New Wide Screen / Crystal Screen +CONS( 1982, gnw_dkjr, 0, 0, gnw_dkjr, gnw_dkjr, gnw_dkjr_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong Jr. (New Wide Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gnw_mariocm, 0, 0, gnw_mariocm, gnw_mariocm, gnw_mariocm_state, empty_init, "Nintendo", "Game & Watch: Mario's Cement Factory (New Wide Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gnw_manhole, 0, 0, gnw_manhole, gnw_manhole, gnw_manhole_state, empty_init, "Nintendo", "Game & Watch: Manhole (New Wide Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1985, gnw_tfish, 0, 0, gnw_tfish, gnw_tfish, gnw_tfish_state, empty_init, "Nintendo", "Game & Watch: Tropical Fish", MACHINE_SUPPORTS_SAVE ) -CONS( 1986, gnw_smb, 0, 0, gnw_smb, gnw_smb, gnw_smb_state, empty_init, "Nintendo", "Game & Watch: Super Mario Bros. (crystal screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1988, gnw_smbn, gnw_smb, 0, gnw_smbn, gnw_smb, gnw_smb_state, empty_init, "Nintendo", "Game & Watch: Super Mario Bros. (new wide screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1986, gnw_climber, 0, 0, gnw_climber, gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (crystal screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1988, gnw_climbern,gnw_climber,0, gnw_climbern,gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (new wide screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1986, gnw_bfight, 0, 0, gnw_bfight, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (crystal screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1988, gnw_bfightn, gnw_bfight, 0, gnw_bfightn, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (new wide screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1986, gnw_smb, 0, 0, gnw_smb, gnw_smb, gnw_smb_state, empty_init, "Nintendo", "Game & Watch: Super Mario Bros. (Crystal Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1988, gnw_smbn, gnw_smb, 0, gnw_smbn, gnw_smb, gnw_smb_state, empty_init, "Nintendo", "Game & Watch: Super Mario Bros. (New Wide Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1986, gnw_climber, 0, 0, gnw_climber, gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (Crystal Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1988, gnw_climbern,gnw_climber,0, gnw_climbern,gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (New Wide Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1986, gnw_bfight, 0, 0, gnw_bfight, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (Crystal Screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1988, gnw_bfightn, gnw_bfight, 0, gnw_bfightn, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (New Wide Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1991, gnw_mariotj, 0, 0, gnw_mariotj, gnw_mariotj, gnw_mariotj_state, empty_init, "Nintendo", "Game & Watch: Mario The Juggler", MACHINE_SUPPORTS_SAVE ) -// Nintendo G&W: table top / panorama screen -CONS( 1983, gnw_dkjrp, 0, 0, gnw_dkjrp, gnw_dkjrp, gnw_dkjrp_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong Jr. (panorama screen)", MACHINE_SUPPORTS_SAVE ) +// Nintendo G&W: Table Top / Panorama Screen +CONS( 1983, gnw_mariocmt,0, 0, gnw_mariocmt,gnw_mariocmt,gnw_mariocmt_state,empty_init, "Nintendo", "Game & Watch: Mario's Cement Factory (Table Top)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gnw_dkjrp, 0, 0, gnw_dkjrp, gnw_dkjrp, gnw_dkjrp_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong Jr. (Panorama Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1983, gnw_mbaway, 0, 0, gnw_mbaway, gnw_mbaway, gnw_mbaway_state, empty_init, "Nintendo", "Game & Watch: Mario's Bombs Away", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, gnw_mmousep, 0, 0, gnw_mmousep, gnw_mmousep, gnw_mmousep_state, empty_init, "Nintendo", "Game & Watch: Mickey Mouse (panorama screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, gnw_mmousep, 0, 0, gnw_mmousep, gnw_mmousep, gnw_mmousep_state, empty_init, "Nintendo", "Game & Watch: Mickey Mouse (Panorama Screen)", MACHINE_SUPPORTS_SAVE ) CONS( 1984, gnw_dkcirc, gnw_mmousep,0, gnw_dkcirc, gnw_mmousep, gnw_mmousep_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong Circus", MACHINE_SUPPORTS_SAVE ) -// Nintendo G&W: super color +// Nintendo G&W: Super Color CONS( 1984, gnw_ssparky, 0, 0, gnw_ssparky, gnw_ssparky, gnw_ssparky_state, empty_init, "Nintendo", "Game & Watch: Spitball Sparky", MACHINE_SUPPORTS_SAVE ) -// Nintendo G&W: micro vs. system (actually, no official Game & Watch logo anywhere) +// Nintendo G&W: Micro Vs. System (actually, no official Game & Watch logo anywhere) CONS( 1984, gnw_boxing, 0, 0, gnw_boxing, gnw_boxing, gnw_boxing_state, empty_init, "Nintendo", "Micro Vs. System: Boxing", MACHINE_SUPPORTS_SAVE ) // Konami diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp index 8331cef3813..ba9779c3e59 100644 --- a/src/mame/drivers/homedata.cpp +++ b/src/mame/drivers/homedata.cpp @@ -13,6 +13,7 @@ driver by Phil Stroffolino and Nicola Salmoria *1988 A74 Mahjong Hourouki Okite *1988 X80 Mahjong Clinic *1988 M81 Mahjong Rokumeikan +*1988 E82 The Last Apostle Puppetshow *1988 J82 Reikai Doushi / Chinese Exorcist *1989 X83 Mahjong Kojin Kyouju (Private Teacher) 1989 S88 Battle Cry (not released in Japan) @@ -1313,11 +1314,11 @@ void homedata_state::mrokumei(machine_config &config) void homedata_state::reikaids(machine_config &config) { /* basic machine hardware */ - MC6809E(config, m_maincpu, 16000000/4); /* 4MHz ? */ + MC6809E(config, m_maincpu, 16_MHz_XTAL/4); /* MC68B09EP 4MHz ? */ m_maincpu->set_addrmap(AS_PROGRAM, &homedata_state::reikaids_map); m_maincpu->set_vblank_int("screen", FUNC(homedata_state::homedata_irq)); /* also triggered by the blitter */ - upd7807_device &audiocpu(UPD7807(config, m_audiocpu, 9000000)); /* 9MHz ? */ + upd7807_device &audiocpu(UPD7807(config, m_audiocpu, 9_MHz_XTAL)); /* 9MHz ? */ audiocpu.set_addrmap(AS_PROGRAM, &homedata_state::reikaids_upd7807_map); audiocpu.pa_in_cb().set(FUNC(homedata_state::reikaids_upd7807_porta_r)); audiocpu.pa_out_cb().set(FUNC(homedata_state::reikaids_upd7807_porta_w)); @@ -1351,7 +1352,7 @@ void homedata_state::reikaids(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); - YM2203(config, m_ymsnd, 16000000/4); /* 4 MHz */ + YM2203(config, m_ymsnd, 16_MHz_XTAL/4); /* 4 MHz */ m_ymsnd->port_a_read_callback().set_ioport("DSW1"); m_ymsnd->port_b_read_callback().set_ioport("DSW2"); m_ymsnd->add_route(0, "speaker", 0.25); @@ -1748,6 +1749,42 @@ ROM_START( mrokumei ) ROM_LOAD( "m81a08.bin", 0x0000, 0x20000, CRC(dba706b9) SHA1(467c8c3e12cd64002d2516dd117bc87d03448f49) ) ROM_END +ROM_START( lastapos ) + ROM_REGION( 0x02c000, "maincpu", 0 ) /* 6809 Code */ + ROM_LOAD( "e82a01.j14", 0x010000, 0x01c000, CRC(236475ae) SHA1(e14176682fda9195b2919868134ee8491f59badd) ) + ROM_CONTINUE( 0x00c000, 0x004000) + + ROM_REGION( 0x40000, "audiocpu", 0) /* uPD7807 code */ + ROM_LOAD( "x82a04.e20", 0x000000, 0x040000, CRC(52c9028a) SHA1(9d5e37b2f741d5c0e64ba3d674a72330058b96f2) ) + + ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_LOAD( "x82a13.d2", 0x000000, 0x80000, CRC(954c8844) SHA1(94e09009d0ad40a62f2a92cd5bd500ffe2c4650a) ) + ROM_LOAD( "x82a14.d1", 0x080000, 0x80000, CRC(a748305e) SHA1(ee01025820a0915621d2c056d65e67a84a5f724c) ) + ROM_LOAD( "x82a15.f2", 0x100000, 0x80000, CRC(c50f7047) SHA1(13fcd1abaf88c759e747cf5f2c94a522276945c9) ) + ROM_LOAD( "x82a16.f1", 0x180000, 0x80000, CRC(b270094a) SHA1(edd4f7e3fd082c12758d82ea6eba2a060398b9ef) ) + + ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_LOAD( "x82a09.d5", 0x000000, 0x80000, CRC(c496b187) SHA1(8ec4e09469c9f425681671f5ddb2d2d8768af42b) ) + ROM_LOAD( "x82a10.d4", 0x080000, 0x80000, CRC(4243fe28) SHA1(01260543a6f61f46ba56840c1b96ecedf637451c) ) + ROM_LOAD16_BYTE( "e82a12.f4", 0x100000, 0x20000, CRC(0e2cdd40) SHA1(254b4f1f986ad5fd9437a5c8bbaf6683d9edf02b) ) + ROM_LOAD16_BYTE( "e82a11.f5", 0x100001, 0x20000, CRC(141ced2e) SHA1(90b5be2e488ad2793750225ab20c1649d709b578) ) + + ROM_REGION( 0x80000, "gfx3", 0 ) + ROM_LOAD( "x82a08.d6", 0x000000, 0x80000, CRC(51cfd790) SHA1(208f00b1ccf420fe891dd30684481bf871c1aa63) ) + + ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_LOAD( "x82a05.d8", 0x000000, 0x80000, CRC(fb65e0e0) SHA1(d560091cfad17af6539913db1279c62a680de4fc) ) + + ROM_REGION( 0x010000, "proms", 0 ) /* static palette */ + ROM_LOAD16_BYTE( "e82a18.e12", 0x00000, 0x8000, CRC(1f52a7aa) SHA1(55bbba5bfad1eee4872939d23ac643aa3074b3cf) ) + ROM_LOAD16_BYTE( "e82a17.e9", 0x00001, 0x8000, CRC(f91d77a1) SHA1(a650a68e7e75719819fd04dda86d7fc8849dfe7d) ) + + ROM_REGION( 0x040000, "blit_rom", 0 ) /* blitter data */ + ROM_LOAD( "x82a02.e19", 0x00000, 0x040000, CRC(90fe700f) SHA1(bf7f9955a2cb1af43a272bf3366ff8c09ff6f7e6) ) + + ROM_REGION( 0x0100, "user2", 0 ) + ROM_LOAD( "x82a19.l4", 0x0000, 0x0100, CRC(7ed947b4) SHA1(40c74a17976fab5d7f9da367083764934bb87281) ) // N82S129AN - priority (not used) +ROM_END ROM_START( reikaids ) ROM_REGION( 0x02c000, "maincpu", 0 ) /* 6809 Code */ @@ -1784,7 +1821,6 @@ ROM_START( reikaids ) ROM_LOAD( "x82a19.l4", 0x0000, 0x0100, CRC(7ed947b4) SHA1(40c74a17976fab5d7f9da367083764934bb87281) ) // N82S129AN - priority (not used) ROM_END - ROM_START( battlcry ) ROM_REGION( 0x02c000, "maincpu", 0 ) /* 6809 Code */ ROM_LOAD( "s88e01.j13", 0x010000, 0x01c000, CRC(b08438fe) SHA1(41a0fcdabee449081840848c45983984d7153d1b) ) @@ -1820,7 +1856,6 @@ ROM_START( battlcry ) ROM_LOAD( "s88a19.l5", 0x0000, 0x0100, CRC(c8ead41e) SHA1(d1e733691de9f9b71c9724de73086d36f381fc74) ) // priority (not used) ROM_END - ROM_START( battlcryc ) ROM_REGION( 0x02c000, "maincpu", 0 ) /* 6809 Code */ ROM_LOAD( "s88c01.j14", 0x010000, 0x01c000, CRC(4aa6d637) SHA1(e10c6c4a6adeb3b4837ebe5ff0a49ec1204b2e54) ) // 27C1000 @@ -1856,7 +1891,6 @@ ROM_START( battlcryc ) ROM_LOAD( "s88a19.l5", 0x0000, 0x0100, CRC(c8ead41e) SHA1(d1e733691de9f9b71c9724de73086d36f381fc74) ) // priority (not used) ROM_END - ROM_START( battlcryp ) // prototype presented at AOU 1989 ROM_REGION( 0x02c000, "maincpu", 0 ) /* 6809 Code */ ROM_LOAD( "s88_b01.ic31", 0x010000, 0x01c000, CRC(8dae51b5) SHA1(52a4ec602c9c5bb185dd66b4b98dbfaa91189ced) ) // 27C1000 @@ -1918,7 +1952,6 @@ ROM_START( battlcryp ) // prototype presented at AOU 1989 ROM_LOAD( "s88_a19.ic42", 0x0000, 0x0100, CRC(c8ead41e) SHA1(d1e733691de9f9b71c9724de73086d36f381fc74) ) // 82s129, priority (not used) ROM_END - ROM_START( mjkojink ) ROM_REGION( 0x01c000, "maincpu", 0 ) /* 6809 Code */ ROM_LOAD( "x83j01.16e", 0x010000, 0xc000, CRC(91f90376) SHA1(d452f538f4a1b774640ced49f0ab2784b112e8ba) ) @@ -1979,7 +2012,6 @@ ROM_START( mjjoship ) ROM_LOAD( "x73a03.12e", 0x0000, 0x20000, CRC(fd32eb8c) SHA1(584afb1ed2da776a4ff9c0b9eb2906c914b28928) ) ROM_END - ROM_START( vitaminc ) ROM_REGION( 0x01c000, "maincpu", 0 ) /* 6809 Code */ ROM_LOAD( "x90e01.bin", 0x010000, 0xc000, CRC(bc982525) SHA1(30f5e9ab27f799b895a3d979109e331603d94249) ) @@ -2092,7 +2124,6 @@ ROM_START( jogakuen ) ROM_LOAD( "a03.bin", 0x0000, 0x40000, CRC(bb1507ab) SHA1(465f45c9cae2d4e064b784cc5ba25b60839e4b5f) ) ROM_END - ROM_START( lemnangl ) ROM_REGION( 0x01c000, "maincpu", 0 ) /* 6809 Code */ ROM_LOAD( "x02_d01.16e", 0x010000, 0xc000, CRC(4c2fae05) SHA1(86516399bd1eb1565b446dfa0f9a974bde6f9af2) ) @@ -2224,7 +2255,9 @@ GAME( 1988, mjclinic, 0, mrokumei, mjhokite, homedata_state, empty_init, GAME( 1988, mjclinica, mjclinic, mrokumei, mjhokite, homedata_state, empty_init, ROT0, "Home Data", "Mahjong Clinic (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, mrokumei, 0, mrokumei, mjhokite, homedata_state, empty_init, ROT0, "Home Data", "Mahjong Rokumeikan (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1988, reikaids, 0, reikaids, reikaids, homedata_state, init_reikaids, ROT0, "Home Data", "Reikai Doushi (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, lastapos, 0, reikaids, reikaids, homedata_state, init_reikaids, ROT0, "Home Data", "The Last Apostle Puppetshow", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, reikaids, lastapos, reikaids, reikaids, homedata_state, init_reikaids, ROT0, "Home Data", "Reikai Doushi (Japan)", MACHINE_SUPPORTS_SAVE ) + GAME( 1991, battlcry, 0, reikaids, battlcry, homedata_state, init_battlcry, ROT0, "Home Data", "Battlecry (Version E)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1989, battlcryc, battlcry, reikaids, battlcry, homedata_state, init_battlcry, ROT0, "Home Data", "Battlecry (Version C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1989, battlcryp, battlcry, reikaids, battlcry, homedata_state, init_battlcry, ROT0, "Home Data", "Battlecry (Prototype)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/igs011.cpp b/src/mame/drivers/igs011.cpp index c1e8262bcd1..9f516de60d6 100644 --- a/src/mame/drivers/igs011.cpp +++ b/src/mame/drivers/igs011.cpp @@ -3727,7 +3727,7 @@ INPUT_PORTS_END // vbowlhk: joystick only, no cabinet linking static INPUT_PORTS_START( vbowlhk ) PORT_START("DSW1") - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) @@ -3736,60 +3736,60 @@ static INPUT_PORTS_START( vbowlhk ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Sexy Interlude" ) + PORT_DIPNAME( 0x10, 0x10, "Sexy Interlude" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Open Picture" ) + PORT_DIPNAME( 0x20, 0x20, "Open Picture" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) + PORT_DIPUNKNOWN_DIPLOC(0x40, IP_ACTIVE_LOW, "SW1:7" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) + PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) // 5 PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) // 7 PORT_DIPSETTING( 0x01, DEF_STR( Medium ) ) // 9 PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) // 11 - PORT_DIPNAME( 0x04, 0x04, "Spares To Win (Frames 1-5)" ) + PORT_DIPNAME( 0x04, 0x04, "Spares To Win (Frames 1-5)" ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x04, "3" ) PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPNAME( 0x18, 0x18, "Points To Win (Frames 6-10)" ) + PORT_DIPNAME( 0x18, 0x18, "Points To Win (Frames 6-10)" ) PORT_DIPLOCATION("SW2:4,5") PORT_DIPSETTING( 0x18, "160" ) PORT_DIPSETTING( 0x10, "170" ) PORT_DIPSETTING( 0x08, "180" ) PORT_DIPSETTING( 0x00, "190" ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_DIPUNKNOWN( 0x80, 0x80 ) + PORT_DIPUNKNOWN_DIPLOC(0x20, IP_ACTIVE_LOW, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC(0x40, IP_ACTIVE_LOW, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8" ) PORT_START("DSW3") - PORT_DIPUNKNOWN( 0x01, 0x01 ) - PORT_DIPUNKNOWN( 0x02, 0x02 ) - PORT_DIPUNKNOWN( 0x04, 0x04 ) - PORT_DIPUNKNOWN( 0x08, 0x08 ) - PORT_DIPUNKNOWN( 0x10, 0x10 ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) + PORT_DIPUNKNOWN_DIPLOC(0x01, IP_ACTIVE_LOW, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC(0x02, IP_ACTIVE_LOW, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC(0x04, IP_ACTIVE_LOW, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC(0x08, IP_ACTIVE_LOW, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC(0x10, IP_ACTIVE_LOW, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC(0x20, IP_ACTIVE_LOW, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC(0x40, IP_ACTIVE_LOW, "SW3:7" ) + PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW3:8" ) PORT_START("DSW4") - PORT_DIPNAME( 0x81, 0x81, "Protection & Comm Test" ) // includes IGS011 and IGS012 protection tests + PORT_DIPNAME( 0x81, 0x81, "Protection & Comm Test" ) PORT_DIPLOCATION("SW4:1,8") // includes IGS011 and IGS012 protection tests PORT_DIPSETTING( 0x81, "No (0)" ) PORT_DIPSETTING( 0x80, "No (1)" ) PORT_DIPSETTING( 0x01, "No (2)" ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPUNKNOWN( 0x02, 0x02 ) - PORT_DIPUNKNOWN( 0x04, 0x04 ) - PORT_DIPUNKNOWN( 0x08, 0x08 ) - PORT_DIPUNKNOWN( 0x10, 0x10 ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) + PORT_DIPUNKNOWN_DIPLOC(0x02, IP_ACTIVE_LOW, "SW4:2" ) + PORT_DIPUNKNOWN_DIPLOC(0x04, IP_ACTIVE_LOW, "SW4:3" ) + PORT_DIPUNKNOWN_DIPLOC(0x08, IP_ACTIVE_LOW, "SW4:4" ) + PORT_DIPUNKNOWN_DIPLOC(0x10, IP_ACTIVE_LOW, "SW4:5" ) + PORT_DIPUNKNOWN_DIPLOC(0x20, IP_ACTIVE_LOW, "SW4:6" ) + PORT_DIPUNKNOWN_DIPLOC(0x40, IP_ACTIVE_LOW, "SW4:7" ) PORT_START("COIN") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -3834,45 +3834,19 @@ static INPUT_PORTS_START( vbowl ) PORT_INCLUDE(vbowlhk) PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Sexy Interlude" ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Open Picture" ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Controls ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Joystick ) ) PORT_DIPSETTING( 0x00, DEF_STR( Trackball ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_MODIFY("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Cabinet ID" ) + PORT_DIPNAME( 0x03, 0x03, "Cabinet ID" ) PORT_DIPLOCATION("SW3:1,2") PORT_DIPSETTING( 0x03, "1" ) PORT_DIPSETTING( 0x02, "2" ) PORT_DIPSETTING( 0x01, "3" ) PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPNAME( 0x04, 0x04, "Linked Cabinets" ) + PORT_DIPNAME( 0x04, 0x04, "Linked Cabinets" ) PORT_DIPLOCATION("SW3:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNKNOWN( 0x08, 0x08 ) - PORT_DIPUNKNOWN( 0x10, 0x10 ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_MODIFY("AN0") PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) @@ -3887,28 +3861,9 @@ static INPUT_PORTS_START( vbowlj ) PORT_INCLUDE(vbowl) PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Sexy Interlude" ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Controls ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, DEF_STR( Joystick ) ) PORT_DIPSETTING( 0x00, DEF_STR( Trackball ) ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -4974,5 +4929,5 @@ GAME( 1996, xymg, 0, xymg, xymg, igs011_state, in GAME( 1996, wlcc, xymg, wlcc, wlcc, igs011_state, init_wlcc, ROT0, "IGS", "Wanli Changcheng (China, V638C)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, vbowl, 0, vbowl, vbowl, igs011_state, init_vbowl, ROT0, "IGS", "Virtua Bowling (World, V101XCM)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAME( 1996, vbowlj, vbowl, vbowl, vbowlj, igs011_state, init_vbowlj, ROT0, "IGS / Alta", "Virtua Bowling (Japan, V100JCM)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) -GAME( 1996, vbowlhk, vbowl, vbowlhk, vbowl, igs011_state, init_vbowlhk, ROT0, "IGS / Tai Tin Amusement", "Virtua Bowling (Hong Kong, V101HJS)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) +GAME( 1996, vbowlhk, vbowl, vbowlhk, vbowlhk, igs011_state, init_vbowlhk, ROT0, "IGS / Tai Tin Amusement", "Virtua Bowling (Hong Kong, V101HJS)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAME( 1998, nkishusp, lhb2, nkishusp, nkishusp, igs011_state, init_nkishusp, ROT0, "IGS / Alta", "Mahjong Nenrikishu SP (Japan, V250J)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/imds2.cpp b/src/mame/drivers/imds2.cpp index be7837d6272..1d059f11269 100644 --- a/src/mame/drivers/imds2.cpp +++ b/src/mame/drivers/imds2.cpp @@ -87,6 +87,7 @@ #include "machine/pit8253.h" #include "machine/pic8259.h" #include "bus/rs232/rs232.h" +#include "bus/multibus/multibus.h" // CPU oscillator of IPC board: 8 MHz #define IPC_XTAL_Y2 8_MHz_XTAL @@ -124,6 +125,7 @@ private: required_device<ls259_device> m_ipcctrl; required_device_array<rs232_port_device, 2> m_serial; required_device<imds2ioc_device> m_ioc; + required_device<multibus_slot_device> m_slot; std::vector<uint8_t> m_ipc_ram; @@ -161,6 +163,7 @@ imds2_state::imds2_state(const machine_config &mconfig, device_type type, const m_ipcctrl(*this, "ipcctrl"), m_serial(*this, "serial%u", 0U), m_ioc(*this, "ioc"), + m_slot(*this, "slot"), m_ipc_rom(*this, "ipcrom") { } @@ -218,6 +221,9 @@ void imds2_state::driver_start() { // Allocate 64k for IPC RAM m_ipc_ram.resize(0x10000); + + m_slot->install_io_rw(m_ipccpu->space(AS_IO)); + m_slot->install_mem_rw(m_ipccpu->space(AS_PROGRAM)); } bool imds2_state::in_ipc_rom(offs_t offset) const @@ -300,6 +306,8 @@ void imds2_state::imds2(machine_config &config) IMDS2IOC(config, m_ioc); m_ioc->master_intr_cb().set(m_ipclocpic, FUNC(pic8259_device::ir6_w)); m_ioc->parallel_int_cb().set(m_ipclocpic, FUNC(pic8259_device::ir5_w)); + + MULTIBUS_SLOT(config , m_slot , 0); } ROM_START(imds2) diff --git a/src/mame/drivers/indiana.cpp b/src/mame/drivers/indiana.cpp index 9e87da7198b..3466fb936c1 100644 --- a/src/mame/drivers/indiana.cpp +++ b/src/mame/drivers/indiana.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic +// copyright-holders:Miodrag Milanovic, AJR /*************************************************************************** Indiana University 68030 board @@ -15,7 +15,8 @@ ****************************************************************************/ #include "emu.h" -#include "bus/rs232/keyboard.h" +#include "bus/pc_kbd/keyboards.h" +#include "bus/pc_kbd/pc_kbdc.h" #include "cpu/m68000/m68000.h" #include "bus/isa/com.h" #include "bus/isa/fdc.h" @@ -24,17 +25,19 @@ #include "bus/isa/isa_cards.h" #include "bus/isa/vga.h" #include "machine/mc68901.h" +#include "sound/spkrdev.h" +#include "speaker.h" -#define M68K_TAG "maincpu" #define ISABUS_TAG "isa" -#define MFP_TAG "mfp" class indiana_state : public driver_device { public: indiana_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , - m_maincpu(*this, M68K_TAG) { } + m_maincpu(*this, "maincpu") + { + } void indiana(machine_config &config); @@ -52,7 +55,7 @@ void indiana_state::indiana_mem(address_map &map) map.unmap_value_high(); map(0x00000000, 0x0000ffff).mirror(0x7f800000).rom().region("user1", 0); // 64Kb of EPROM map(0x00100000, 0x00107fff).mirror(0x7f8f8000).ram(); // SRAM 32Kb of SRAM - map(0x00200000, 0x002fffff).rw(MFP_TAG, FUNC(mc68901_device::read), FUNC(mc68901_device::write)).mirror(0x7f800000); // MFP + map(0x00200000, 0x002fffff).rw("mfp", FUNC(mc68901_device::read), FUNC(mc68901_device::write)).mirror(0x7f800000); // MFP map(0x00400000, 0x004fffff).rw(ISABUS_TAG, FUNC(isa16_device::io16_swap_r), FUNC(isa16_device::io16_swap_w)).mirror(0x7f800000); // 16 bit PC IO map(0x00500000, 0x005fffff).rw(ISABUS_TAG, FUNC(isa16_device::mem16_swap_r), FUNC(isa16_device::mem16_swap_w)).mirror(0x7f800000); // 16 bit PC MEM map(0x00600000, 0x006fffff).rw(ISABUS_TAG, FUNC(isa16_device::io_r), FUNC(isa16_device::io_w)).mirror(0x7f800000); // 8 bit PC IO @@ -86,38 +89,46 @@ void indiana_isa_cards(device_slot_interface &device) device.option_add("ide", ISA16_IDE); } -static DEVICE_INPUT_DEFAULTS_START( keyboard ) - DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_1200 ) - DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) - DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) - DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) - DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) -DEVICE_INPUT_DEFAULTS_END - void indiana_state::indiana(machine_config &config) { /* basic machine hardware */ - M68030(config, m_maincpu, XTAL(16'000'000)); + M68030(config, m_maincpu, 16_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &indiana_state::indiana_mem); - // FIXME: determine ISA bus clock - isa16_device &isa(ISA16(config, ISABUS_TAG, 0)); + isa16_device &isa(ISA16(config, ISABUS_TAG, 16_MHz_XTAL / 2)); // OSC = CLK = CLK8 isa.set_custom_spaces(); + isa.irq3_callback().set_inputline(m_maincpu, M68K_IRQ_5); + isa.irq4_callback().set_inputline(m_maincpu, M68K_IRQ_4); + isa.irq5_callback().set_inputline(m_maincpu, M68K_IRQ_3); + isa.irq6_callback().set_inputline(m_maincpu, M68K_IRQ_2); + isa.irq7_callback().set_inputline(m_maincpu, M68K_IRQ_1); + isa.irq2_callback().set("mfp", FUNC(mc68901_device::i7_w)); // IRQ9 + isa.irq10_callback().set("mfp", FUNC(mc68901_device::i6_w)); + isa.irq11_callback().set("mfp", FUNC(mc68901_device::i5_w)); + isa.irq12_callback().set("mfp", FUNC(mc68901_device::i4_w)); + isa.irq14_callback().set("mfp", FUNC(mc68901_device::i3_w)); + isa.irq15_callback().set("mfp", FUNC(mc68901_device::i2_w)); ISA16_SLOT(config, "isa1", 0, ISABUS_TAG, indiana_isa_cards, "vga", false); ISA16_SLOT(config, "isa2", 0, ISABUS_TAG, indiana_isa_cards, "fdc_at", false); ISA16_SLOT(config, "isa3", 0, ISABUS_TAG, indiana_isa_cards, "comat", false); ISA16_SLOT(config, "isa4", 0, ISABUS_TAG, indiana_isa_cards, "ide", false); - mc68901_device &mfp(MC68901(config, MFP_TAG, XTAL(16'000'000)/4)); - mfp.set_timer_clock(XTAL(16'000'000)/4); - mfp.set_rx_clock(0); - mfp.set_tx_clock(0); - mfp.out_so_cb().set("keyboard", FUNC(rs232_port_device::write_txd)); + pc_kbdc_device &pc_kbdc(PC_KBDC(config, "pc_kbdc", 0)); + pc_kbdc.out_data_cb().set("mfp", FUNC(mc68901_device::i0_w)); + pc_kbdc.out_data_cb().append("mfp", FUNC(mc68901_device::si_w)); + pc_kbdc.out_clock_cb().set("mfp", FUNC(mc68901_device::i1_w)); + pc_kbdc.out_clock_cb().append("mfp", FUNC(mc68901_device::rc_w)); + + PC_KBDC_SLOT(config, "kbd", pc_at_keyboards, STR_KBD_IBM_PC_AT_84).set_pc_kbdc_slot(subdevice("pc_kbdc")); + + mc68901_device &mfp(MC68901(config, "mfp", 16_MHz_XTAL / 4)); + mfp.set_timer_clock(16_MHz_XTAL / 16); + mfp.out_irq_cb().set_inputline(m_maincpu, M68K_IRQ_6); + mfp.out_tdo_cb().set("speaker", FUNC(speaker_sound_device::level_w)); - rs232_port_device &keyboard(RS232_PORT(config, "keyboard", default_rs232_devices, "keyboard")); - keyboard.rxd_handler().set(MFP_TAG, FUNC(mc68901_device::write_rx)); - keyboard.set_option_device_input_defaults("keyboard", DEVICE_INPUT_DEFAULTS_NAME(keyboard)); + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); } /* ROM definition */ diff --git a/src/mame/drivers/iphone2g.cpp b/src/mame/drivers/iphone2g.cpp index 868f520884f..897bd09a767 100644 --- a/src/mame/drivers/iphone2g.cpp +++ b/src/mame/drivers/iphone2g.cpp @@ -10,14 +10,212 @@ #include "emu.h" #include "cpu/arm7/arm7.h" +#include "cpu/arm7/arm7core.h" +#include "machine/bankdev.h" +#include "machine/vic_pl192.h" #include "screen.h" +class iphone2g_spi_device : public device_t, public device_memory_interface +{ +public: + iphone2g_spi_device(const machine_config &mconfig, const char* tag, device_t *owner, uint32_t clock = 0); + + auto out_irq_cb() { return m_out_irq_func.bind(); } + + void map(address_map &map); + +protected: + iphone2g_spi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + virtual space_config_vector memory_space_config() const override; + +private: + static constexpr device_timer_id TIMER_SEND_IRQ = 0; + + address_space_config m_mmio_config; + + devcb_write_line m_out_irq_func; + + u8 cmd, tx_data; + u32 ctrl; + u16 status; +}; + +DECLARE_DEVICE_TYPE(IPHONE2G_SPI, iphone2g_spi_device) + +void iphone2g_spi_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + m_out_irq_func(1); +} + +void iphone2g_spi_device::map(address_map &map) +{ + map(0x00,0x03).lrw32(NAME([this](offs_t offset){ return ctrl; }), NAME([this](offs_t offset, u32 data){ + if(data & 1) + { + status |= 0xfff2; + cmd = tx_data; + timer_set(attotime::from_hz(1'000), TIMER_SEND_IRQ); + } + ctrl = data; + })); + map(0x08, 0x09).lr16([this](offs_t offset){ return status; }, "status").umask32(0x0000ffff); + map(0x10, 0x10).lrw8(NAME([this](offs_t offset){ return tx_data; }), NAME([this](offs_t offset, u8 data){ tx_data = data; })).umask32(0x000000ff); + map(0x20, 0x20).lr8([this](offs_t offset){ + // FIXME: make this less hacky + switch(cmd) + { + case 0x95: return 0x01; + case 0xda: return 0x71; + case 0xdb: return 0xc2; + case 0xdc: return 0x00; + } + return 0; + }, "rx_data"); +} + +device_memory_interface::space_config_vector iphone2g_spi_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(0, &m_mmio_config) + }; +} + +void iphone2g_spi_device::device_resolve_objects() +{ + // resolve callbacks + m_out_irq_func.resolve_safe(); +} + +void iphone2g_spi_device::device_start() +{ + save_item(NAME(cmd)); + save_item(NAME(ctrl)); + save_item(NAME(tx_data)); + save_item(NAME(status)); +} + +void iphone2g_spi_device::device_reset() +{ + cmd = ctrl= status = tx_data = 0; +} + +DEFINE_DEVICE_TYPE(IPHONE2G_SPI, iphone2g_spi_device, "iphone2g_spi", "iPhone 2G SPI controller") + +iphone2g_spi_device::iphone2g_spi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_mmio_config("mmio", ENDIANNESS_LITTLE, 32, 32, 0) + , m_out_irq_func(*this) +{ +} + +iphone2g_spi_device::iphone2g_spi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : iphone2g_spi_device(mconfig, IPHONE2G_SPI, tag, owner, clock) +{ +} + +class iphone2g_timer_device : public device_t, public device_memory_interface +{ +public: + iphone2g_timer_device(const machine_config &mconfig, const char* tag, device_t *owner, uint32_t clock = 0); + + auto out_irq_cb() { return m_out_irq_func.bind(); } + + void map(address_map &map); + void timer_map(address_map &map); + +protected: + iphone2g_timer_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + virtual space_config_vector memory_space_config() const override; + +private: + static constexpr device_timer_id TIMER_TICK = 0; + + address_space_config m_mmio_config; + + devcb_write_line m_out_irq_func; + + struct timer + { + u16 config; + u8 state; + u32 count_buffer[2], count; + } timers[7]; + + u64 ticks; +}; + +DECLARE_DEVICE_TYPE(IPHONE2G_TIMER, iphone2g_timer_device) + +void iphone2g_timer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + m_out_irq_func(1); +} + +void iphone2g_timer_device::map(address_map &map) +{ +} + +device_memory_interface::space_config_vector iphone2g_timer_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(0, &m_mmio_config) + }; +} + +void iphone2g_timer_device::device_resolve_objects() +{ + // resolve callbacks + m_out_irq_func.resolve_safe(); +} + +void iphone2g_timer_device::device_start() +{ +} + +void iphone2g_timer_device::device_reset() +{ +} + +DEFINE_DEVICE_TYPE(IPHONE2G_TIMER, iphone2g_timer_device, "iphone2g_timer", "iPhone 2G timers") + +iphone2g_timer_device::iphone2g_timer_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_mmio_config("mmio", ENDIANNESS_LITTLE, 32, 32, 0) + , m_out_irq_func(*this) +{ +} + +iphone2g_timer_device::iphone2g_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : iphone2g_timer_device(mconfig, IPHONE2G_TIMER, tag, owner, clock) +{ +} + class iphone2g_state : public driver_device { public: iphone2g_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_vic0(*this, "vic0"), + m_vic1(*this, "vic1"), + m_spi(*this, {"spi0", "spi1", "spi2"}), + m_timers(*this, "timers"), m_ram(*this, "ram"), m_bios(*this, "bios"), m_screen(*this, "screen") @@ -33,7 +231,11 @@ protected: private: required_device<cpu_device> m_maincpu; - required_shared_ptr<uint32_t> m_ram; + required_device<vic_pl192_device> m_vic0; + required_device<vic_pl192_device> m_vic1; + required_device_array<iphone2g_spi_device, 3> m_spi; + required_device<iphone2g_timer_device> m_timers; + optional_shared_ptr<uint32_t> m_ram; required_region_ptr<uint32_t> m_bios; required_device<screen_device> m_screen; @@ -62,15 +264,19 @@ READ32_MEMBER(iphone2g_state::clock1_r) void iphone2g_state::mem_map(address_map &map) { - map(0x00000000, 0x07FFFFFF).mirror(0x18000000).ram().share("ram"); /* DRAM */ - map(0x20000000, 0x2000FFFF).rom().region("bios", 0); /* BIOS */ - map(0x22000000, 0x224FFFFF).ram(); /* SRAM */ - map(0x3C500000, 0x3C500FFF).r(FUNC(iphone2g_state::clock1_r)).nopw(); + map(0x00000000, 0x0000ffff).mirror(0x20000000).rom().region("bios", 0); /* BIOS */ + map(0x22000000, 0x224fffff).ram(); /* SRAM */ + map(0x38e00000, 0x38e00fff).m(m_vic0, FUNC(vic_pl192_device::map)); + map(0x38e01000, 0x38e01fff).m(m_vic1, FUNC(vic_pl192_device::map)); + map(0x3c300000, 0x3c3000ff).m(m_spi[0], FUNC(iphone2g_spi_device::map)); + map(0x3c500000, 0x3c500fff).r(FUNC(iphone2g_state::clock1_r)).nopw(); + map(0x3ce00000, 0x3ce000ff).m(m_spi[1], FUNC(iphone2g_spi_device::map)); + map(0x3d200000, 0x3d2000ff).m(m_spi[2], FUNC(iphone2g_spi_device::map)); } void iphone2g_state::machine_start() { - std::copy_n(m_bios.target(), m_bios.length(), m_ram.target()); + //std::copy_n(m_bios.target(), m_bios.length(), m_ram.target()); } void iphone2g_state::machine_reset() @@ -83,6 +289,24 @@ void iphone2g_state::iphone2g(machine_config &config) ARM1176JZF_S(config, m_maincpu, XTAL(12'000'000) * 103 / 3); //412 MHz, downclocked from 600 MHz m_maincpu->set_addrmap(AS_PROGRAM, &iphone2g_state::mem_map); + PL192_VIC(config, m_vic0); + m_vic0->out_irq_cb().set_inputline("maincpu", ARM7_IRQ_LINE); + m_vic0->out_fiq_cb().set_inputline("maincpu", ARM7_FIRQ_LINE); + + IPHONE2G_SPI(config, m_spi[0], XTAL(12'000'000)); + m_spi[0]->out_irq_cb().set(m_vic0, FUNC(vic_pl192_device::irq_w<0x09>)); + + IPHONE2G_SPI(config, m_spi[1], XTAL(12'000'000)); + m_spi[1]->out_irq_cb().set(m_vic0, FUNC(vic_pl192_device::irq_w<0x0a>)); + + IPHONE2G_SPI(config, m_spi[2], XTAL(12'000'000)); + m_spi[2]->out_irq_cb().set(m_vic0, FUNC(vic_pl192_device::irq_w<0x0b>)); + + IPHONE2G_TIMER(config, m_timers, XTAL(12'000'000)); + m_timers->out_irq_cb().set(m_vic0, FUNC(vic_pl192_device::irq_w<0x07>)); + + PL192_VIC(config, m_vic1); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(XTAL(12'000'000), 320, 0, 320, 480, 0, 480); //Complete guess m_screen->set_screen_update(FUNC(iphone2g_state::screen_update)); diff --git a/src/mame/drivers/iqunlim.cpp b/src/mame/drivers/iqunlim.cpp index 25f76a2213a..811a8b6a7fa 100644 --- a/src/mame/drivers/iqunlim.cpp +++ b/src/mame/drivers/iqunlim.cpp @@ -55,19 +55,25 @@ A4 = MAX232 #include "emu.h" #include "screen.h" #include "cpu/m68000/m68000.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" class iqunlim_state : public driver_device { public: - iqunlim_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") - { } + iqunlim_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_cart(*this, "cartslot") + { } void iqunlim(machine_config &config); private: required_device<cpu_device> m_maincpu; + required_device<generic_slot_device> m_cart; + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void iqunlim_mem(address_map &map); @@ -87,6 +93,17 @@ void iqunlim_state::iqunlim_mem(address_map &map) static INPUT_PORTS_START( iqunlim ) INPUT_PORTS_END +DEVICE_IMAGE_LOAD_MEMBER(iqunlim_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + + void iqunlim_state::iqunlim(machine_config &config) { /* basic machine hardware */ @@ -100,6 +117,12 @@ void iqunlim_state::iqunlim(machine_config &config) screen.set_size(512, 256); screen.set_visarea(0, 512-1, 0, 256-1); screen.set_screen_update(FUNC(iqunlim_state::screen_update)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "iqunlim_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(iqunlim_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("iqunlim_cart"); } ROM_START( iqunlim ) diff --git a/src/mame/drivers/iris3130.cpp b/src/mame/drivers/iris3130.cpp index 1fa805fae13..a8ad62f5175 100644 --- a/src/mame/drivers/iris3130.cpp +++ b/src/mame/drivers/iris3130.cpp @@ -2,21 +2,19 @@ // copyright-holders:Ryan Holtz /**************************************************************************** - drivers/sgi_ip2.cpp - SGI IRIS 3130 skeleton driver with some meat on its bones - - by Ryan Holtz + SGI IRIS 3130 skeleton driver 0x00000000 - ? RAM (?) 0x30000000 - 0x30017fff ROM (3x32k) 0x30800000 - 0x30800000 Mouse Buttons (1) 0x31000000 - 0x31000001 Mouse Quadrature (2) + 0x31800000 - 0x31800001 DIP Switches 0x32000000 - 0x3200000f DUART0 (serial console on channel B at 19200 baud 8N1, channel A set to 600 baud 8N1 (mouse?)) 0x32800000 - 0x3280000f DUART1 (printer/modem?) 0x33000000 - 0x330007ff SRAM (2k) 0x34000000 - 0x34000000 Clock Control (1) 0x35000000 - 0x35000000 Clock Data (1) - 0x36000000 - 0x36000000 OS Base (1) + 0x36000000 - 0x36000000 Kernel Base (1) 0x38000000 - 0x38000001 Status Register (2) 0x39000000 - 0x39000000 Parity control (1) 0x3a000000 - 0x3a000000 Multibus Protection (1) @@ -27,10 +25,7 @@ 0x3f000000 - 0x3f000001 Stack Limit (2) TODO: - Hook up keyboard - Hook up mouse - Hook up graphics - Hook up mass storage + Most everything Interrupts: M68K: @@ -39,376 +34,563 @@ ****************************************************************************/ #include "emu.h" + +#include "imagedev/snapquik.h" + #include "bus/rs232/rs232.h" #include "cpu/m68000/m68000.h" -#include "machine/mc146818.h" /* TOD clock */ -#include "machine/mc68681.h" /* DUART0, DUART1 */ +#include "machine/bankdev.h" +#include "machine/mc146818.h" +#include "machine/mc68681.h" + +#include <vector> + +#define LOG_RTC (1 << 0) +#define LOG_INVALID_SEGMENT (1 << 1) +#define LOG_OTHER (1 << 2) + +#define VERBOSE (LOG_OTHER) +#include "logmacro.h" -class sgi_ip2_state : public driver_device +class iris3000_state : public driver_device { public: - sgi_ip2_state(const machine_config &mconfig, device_type type, const char *tag) + iris3000_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_mainram(*this, "mainram"), m_duarta(*this, "duart68681a"), m_duartb(*this, "duart68681b"), - m_bss(*this, "bss"), - m_ptmap(*this, "ptmap"), - m_rtc(*this, "rtc") + m_text_data_space(*this, "text_data"), + m_stack_space(*this, "stack"), + m_kernel_space(*this, "kernel"), + m_system_space(*this, "system"), + m_multibus_mem_space(*this, "multibus_mem"), + m_multibus_io_space(*this, "multibus_io"), + m_geometry_pipe_space(*this, "geometry_pipe"), + m_fpa_space(*this, "fpa"), + m_page_table_map(*this, "ptmap"), + m_rtc(*this, "rtc"), + m_dips(*this, "DIPS") { } - void sgi_ip2(machine_config &config); + void iris3130(machine_config &config); - void init_sgi_ip2(); + DECLARE_QUICKLOAD_LOAD_MEMBER(load_romboard); private: - DECLARE_READ8_MEMBER(sgi_ip2_m_but_r); - DECLARE_WRITE8_MEMBER(sgi_ip2_m_but_w); - DECLARE_READ16_MEMBER(sgi_ip2_m_quad_r); - DECLARE_WRITE16_MEMBER(sgi_ip2_m_quad_w); - DECLARE_READ16_MEMBER(sgi_ip2_swtch_r); - DECLARE_READ8_MEMBER(sgi_ip2_clock_ctl_r); - DECLARE_WRITE8_MEMBER(sgi_ip2_clock_ctl_w); - DECLARE_READ8_MEMBER(sgi_ip2_clock_data_r); - DECLARE_WRITE8_MEMBER(sgi_ip2_clock_data_w); - DECLARE_READ8_MEMBER(sgi_ip2_os_base_r); - DECLARE_WRITE8_MEMBER(sgi_ip2_os_base_w); - DECLARE_READ16_MEMBER(sgi_ip2_status_r); - DECLARE_WRITE16_MEMBER(sgi_ip2_status_w); - DECLARE_READ8_MEMBER(sgi_ip2_parctl_r); - DECLARE_WRITE8_MEMBER(sgi_ip2_parctl_w); - DECLARE_READ8_MEMBER(sgi_ip2_mbp_r); - DECLARE_WRITE8_MEMBER(sgi_ip2_mbp_w); - DECLARE_READ32_MEMBER(sgi_ip2_ptmap_r); - DECLARE_WRITE32_MEMBER(sgi_ip2_ptmap_w); - DECLARE_READ16_MEMBER(sgi_ip2_tdbase_r); - DECLARE_WRITE16_MEMBER(sgi_ip2_tdbase_w); - DECLARE_READ16_MEMBER(sgi_ip2_tdlmt_r); - DECLARE_WRITE16_MEMBER(sgi_ip2_tdlmt_w); - DECLARE_READ16_MEMBER(sgi_ip2_stkbase_r); - DECLARE_WRITE16_MEMBER(sgi_ip2_stkbase_w); - DECLARE_READ16_MEMBER(sgi_ip2_stklmt_r); - DECLARE_WRITE16_MEMBER(sgi_ip2_stklmt_w); + virtual void machine_start() override; + virtual void machine_reset() override; + + void text_data_map(address_map &map); + void stack_map(address_map &map); + void kernel_map(address_map &map); + void system_map(address_map &map); + void multibus_mem_map(address_map &map); + void multibus_io_map(address_map &map); + void geometry_pipe_map(address_map &map); + void fpa_map(address_map &map); + + DECLARE_READ32_MEMBER(mmu_r); + DECLARE_WRITE32_MEMBER(mmu_w); + + DECLARE_READ8_MEMBER(mouse_buttons_r); + DECLARE_WRITE8_MEMBER(mouse_buttons_w); + DECLARE_READ16_MEMBER(mouse_quad_r); + DECLARE_WRITE16_MEMBER(mouse_quad_w); + DECLARE_READ16_MEMBER(dips_r); + DECLARE_READ8_MEMBER(clock_ctrl_r); + DECLARE_WRITE8_MEMBER(clock_ctrl_w); + DECLARE_READ8_MEMBER(clock_data_r); + DECLARE_WRITE8_MEMBER(clock_data_w); + DECLARE_READ8_MEMBER(kernel_base_r); + DECLARE_WRITE8_MEMBER(kernel_base_w); + DECLARE_READ16_MEMBER(status_r); + DECLARE_WRITE16_MEMBER(status_w); + DECLARE_READ8_MEMBER(parity_ctrl_r); + DECLARE_WRITE8_MEMBER(parity_ctrl_w); + DECLARE_READ8_MEMBER(multibus_prot_r); + DECLARE_WRITE8_MEMBER(multibus_prot_w); + DECLARE_READ32_MEMBER(page_table_map_r); + DECLARE_WRITE32_MEMBER(page_table_map_w); + DECLARE_READ16_MEMBER(text_data_base_r); + DECLARE_WRITE16_MEMBER(text_data_base_w); + DECLARE_READ16_MEMBER(text_data_limit_r); + DECLARE_WRITE16_MEMBER(text_data_limit_w); + DECLARE_READ16_MEMBER(stack_base_r); + DECLARE_WRITE16_MEMBER(stack_base_w); + DECLARE_READ16_MEMBER(stack_limit_r); + DECLARE_WRITE16_MEMBER(stack_limit_w); + DECLARE_READ8_MEMBER(romboard_r); + DECLARE_WRITE8_MEMBER(romboard_w); DECLARE_WRITE_LINE_MEMBER(duarta_irq_handler); DECLARE_WRITE_LINE_MEMBER(duartb_irq_handler); - required_device<cpu_device> m_maincpu; - void sgi_ip2_map(address_map &map); + void mem_map(address_map &map); + + required_device<m68020_device> m_maincpu; required_shared_ptr<uint32_t> m_mainram; required_device<mc68681_device> m_duarta; required_device<mc68681_device> m_duartb; - required_shared_ptr<uint32_t> m_bss; - required_shared_ptr<uint32_t> m_ptmap; - required_device<mc146818_device> m_rtc; - uint8_t m_mbut; - uint16_t m_mquad; - uint16_t m_tdbase; - uint16_t m_tdlmt; - uint16_t m_stkbase; - uint16_t m_stklmt; - uint8_t m_parctl; - uint8_t m_mbp; - virtual void machine_start() override; - virtual void machine_reset() override; - inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); -}; + required_device<address_map_bank_device> m_text_data_space; + required_device<address_map_bank_device> m_stack_space; + required_device<address_map_bank_device> m_kernel_space; + required_device<address_map_bank_device> m_system_space; + required_device<address_map_bank_device> m_multibus_mem_space; + required_device<address_map_bank_device> m_multibus_io_space; + required_device<address_map_bank_device> m_geometry_pipe_space; + required_device<address_map_bank_device> m_fpa_space; + required_shared_ptr<uint32_t> m_page_table_map; + required_device<mc146818_device> m_rtc; + required_ioport m_dips; -#define VERBOSE_LEVEL ( 0 ) - -#define ENABLE_VERBOSE_LOG (0) + enum + { + MOUSE_BUTTON_RIGHT = 0x01, + MOUSE_BUTTON_MIDDLE = 0x02, + MOUSE_BUTTON_LEFT = 0x04, + BOARD_REV1 = 0x60, /* Board revision - #1 */ + BOARD_REV2 = 0x50, /* Board revision - #2 */ + + MOUSE_XFIRE = 0x01, /* X Quadrature Fired, active low */ + MOUSE_XCHANGE = 0x02, /* MOUSE_XCHANGE ? x-- : x++ */ + MOUSE_YFIRE = 0x04, /* Y Quadrature Fired, active low */ + MOUSE_YCHANGE = 0x08, /* MOUSE_YCHANGE ? y-- : y++ */ + + PAR_UR = 0x01, /* Check parity on user-mode reads */ + PAR_UW = 0x02, /* Check parity on user-mode writes */ + PAR_KR = 0x04, /* Check parity on kernel-mode reads */ + PAR_KW = 0x08, /* Check parity on kernel-mode writes */ + PAR_DIS0 = 0x10, /* Disable access to DUART0 and LEDs */ + PAR_DIS1 = 0x20, /* Disable access to DUART1 */ + PAR_MBR = 0x40, /* Check parity on multibus reads */ + PAR_MBW = 0x80, /* Check parity on multibus writes */ + + MBP_DCACC = 0x01, /* Display controller access (I/O page 4) */ + MBP_UCACC = 0x02, /* Update controller access (I/O page 3) */ + MBP_GFACC = 0x04, /* Allow GF access (I/O page 1) */ + MBP_DMACC = 0x08, /* Allow GL2 DMA access (0x8nnnnn - x0bnnnnn) */ + MBP_LIOACC = 0x10, /* Allow lower I/O access (0x0nnnnn - 0x7nnnnn) */ + MBP_HIOACC = 0x20, /* Allow upper I/O access (0x8nnnnn - 0xfnnnnn) */ + MBP_LMACC = 0x40, /* Allow lower memory access (0x0nnnnn - 0x7nnnnn) */ + MBP_HMACC = 0x80, /* Allow upper memory access (0x8nnnnn - 0xfnnnnn) */ + + STATUS_DIAG0 = 0, + STATUS_DIAG1 = 1, + STATUS_DIAG2 = 2, + STATUS_DIAG3 = 3, + STATUS_ENABEXT = 4, + STATUS_ENABINT = 5, + STATUS_BINIT = 6, + STATUS_NOTBOOT = 7, + STATUS_USERFPA = 8, + STATUS_USERGE = 9, + STATUS_SLAVE = 10, + STATUS_ENABCBRQ = 11, + STATUS_NOTGEMASTER = 12, + STATUS_GENBAD = 13, + STATUS_ENABWDOG = 14, + STATUS_QUICK_TOUT = 15 + }; + + std::vector<uint8_t> m_file_data; + uint8_t m_mouse_buttons; + uint16_t m_mouse_quadrature; + uint16_t m_text_data_base; + uint16_t m_text_data_limit; + uint16_t m_stack_base; + uint16_t m_stack_limit; + uint16_t m_status; + uint8_t m_parity_ctrl; + uint8_t m_multibus_prot; +}; -inline void ATTR_PRINTF(3,4) sgi_ip2_state::verboselog( int n_level, const char *s_fmt, ... ) +QUICKLOAD_LOAD_MEMBER(iris3000_state::load_romboard) { -#if ENABLE_VERBOSE_LOG - if( VERBOSE_LEVEL >= n_level ) + m_file_data.resize(quickload_size); + + if (!quickload_size || image.fread(&m_file_data[0], quickload_size) != quickload_size) { - va_list v; - char buf[ 32768 ]; - va_start( v, s_fmt ); - vsprintf( buf, s_fmt, v ); - va_end( v ); - logerror("%s: %s", machine().describe_context(), buf); + m_file_data.clear(); + return image_init_result::FAIL; } -#endif + return image_init_result::PASS; } /*************************************************************************** MACHINE FUNCTIONS ***************************************************************************/ -#define MBUT_RIGHT 0x01 /* Right button */ -#define MBUT_MIDDLE 0x02 /* Middle button */ -#define MBUT_LEFT 0x04 /* Left button */ -#define BOARD_REV1 0x60 /* Board revision - #1 */ -#define BOARD_REV2 0x50 /* Board revision - #2 */ +READ32_MEMBER(iris3000_state::mmu_r) +{ + const uint8_t type = (offset >> 26) & 0xf; + const uint32_t vaddr = offset & 0x03ffffff; + const uint32_t page_offset = vaddr & 0x000003ff; + const uint32_t page_index = (vaddr >> 10) & 0x3fff; + const uint32_t phys_page = m_page_table_map[page_index] & 0x1fff; + const uint32_t paddr = (phys_page << 10) | page_offset; -READ8_MEMBER(sgi_ip2_state::sgi_ip2_m_but_r) -{ - verboselog(0, "sgi_ip2_m_but_r: %02x\n", m_mbut | BOARD_REV1); - return m_mbut | BOARD_REV1; + uint32_t ret; + switch (type) + { + case 0: // Text/Data Segment + ret = m_text_data_space->read32(paddr, mem_mask); + break; + case 1: // Stack Segment + ret = m_stack_space->read32(paddr, mem_mask); + break; + case 2: // Kernel Segment + ret = m_kernel_space->read32(paddr, mem_mask); + break; + case 3: // System Segment + ret = m_system_space->read32(vaddr, mem_mask); + break; + case 4: // Multibus Memory Segment + ret = m_multibus_mem_space->read32(vaddr, mem_mask); + break; + case 5: // Multibus I/O Segment + ret = m_multibus_io_space->read32(vaddr, mem_mask); + break; + case 6: // Geometry Pipe Segment + ret = m_geometry_pipe_space->read32(vaddr, mem_mask); + break; + case 15: // Floating-Point Accelerator Segment + ret = m_fpa_space->read32(vaddr, mem_mask); + break; + default: // Unused/Unknown Segment + LOGMASKED(LOG_INVALID_SEGMENT, "%s: Invalid segment read: %08x & %08x\n", machine().describe_context(), offset << 2, mem_mask); + ret = 0; + break; + } + return ret; } -WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_m_but_w) +WRITE32_MEMBER(iris3000_state::mmu_w) { - verboselog(0, "sgi_ip2_m_but_w: %02x\n", data); - m_mbut = data; + const uint8_t type = (offset >> 26) & 0xf; + const uint32_t vaddr = offset & 0x03ffffff; + + const uint32_t page_offset = vaddr & 0x000003ff; + const uint32_t page_index = (vaddr >> 10) & 0x3fff; + const uint32_t phys_page = m_page_table_map[page_index] & 0x1fff; + const uint32_t paddr = (phys_page << 10) | page_offset; + + switch (type) + { + case 0: // Text/Data Segment + m_text_data_space->write32(paddr, data, mem_mask); + break; + case 1: // Stack Segment + m_stack_space->write32(paddr, data, mem_mask); + break; + case 2: // Kernel Segment + m_kernel_space->write32(paddr, data, mem_mask); + break; + case 3: // System Segment + m_system_space->write32(vaddr, data, mem_mask); + break; + case 4: // Multibus Memory Segment + m_multibus_mem_space->write32(vaddr, data, mem_mask); + break; + case 5: // Multibus I/O Segment + m_multibus_io_space->write32(vaddr, data, mem_mask); + break; + case 6: // Geometry Pipe Segment + m_geometry_pipe_space->write32(vaddr, data, mem_mask); + break; + case 15: // Floating-Point Accelerator Segment + m_fpa_space->write32(vaddr, data, mem_mask); + break; + default: // Unused/Unknown Segment + LOGMASKED(LOG_INVALID_SEGMENT, "%s: Invalid segment write: %08x = %08x & %08x\n", machine().describe_context(), offset << 2, data, mem_mask); + break; + } } -#define MOUSE_XFIRE 0x01 /* X Quadrature Fired, active low */ -#define MOUSE_XCHANGE 0x02 /* MOUSE_XCHANGE ? x-- : x++ */ -#define MOUSE_YFIRE 0x04 /* Y Quadrature Fired, active low */ -#define MOUSE_YCHANGE 0x08 /* MOUSE_YCHANGE ? y-- : y++ */ +READ8_MEMBER(iris3000_state::mouse_buttons_r) +{ + LOGMASKED(LOG_OTHER, "%s: mouse_buttons_r: %02x\n", machine().describe_context(), m_mouse_buttons | BOARD_REV1); + return m_mouse_buttons | BOARD_REV1; +} +WRITE8_MEMBER(iris3000_state::mouse_buttons_w) +{ + LOGMASKED(LOG_OTHER, "%s: mouse_buttons_w (ignored): %02x\n", machine().describe_context(), data); +} -READ16_MEMBER(sgi_ip2_state::sgi_ip2_m_quad_r) +READ16_MEMBER(iris3000_state::mouse_quad_r) { - verboselog(0, "sgi_ip2_m_quad_r: %04x\n", m_mquad); - return m_mquad; + LOGMASKED(LOG_OTHER, "%s: mouse_quad_r: %04x & %04x\n", machine().describe_context(), m_mouse_quadrature, mem_mask); + return m_mouse_quadrature; } -WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_m_quad_w) +WRITE16_MEMBER(iris3000_state::mouse_quad_w) { - verboselog(0, "sgi_ip2_m_quad_w = %04x & %04x\n", data, mem_mask); - COMBINE_DATA(&m_mquad); + LOGMASKED(LOG_OTHER, "%s: mouse_quad_w (ignored): %04x & %04x\n", machine().describe_context(), data, mem_mask); } -READ16_MEMBER(sgi_ip2_state::sgi_ip2_swtch_r) +READ16_MEMBER(iris3000_state::dips_r) { - verboselog(0, "sgi_ip2_swtch_r: %04x\n", ioport("SWTCH")->read()); - return ioport("SWTCH")->read(); + const uint16_t data = m_dips->read(); + LOGMASKED(LOG_OTHER, "%s: dips_r: %04x & %04x\n", machine().describe_context(), data, mem_mask); + return data; } -READ8_MEMBER(sgi_ip2_state::sgi_ip2_clock_ctl_r) +READ8_MEMBER(iris3000_state::clock_ctrl_r) { - uint8_t ret = m_rtc->read(1); - verboselog(1, "sgi_ip2_clock_ctl_r: %02x\n", ret); - return ret; + const uint8_t data = m_rtc->read(1); + LOGMASKED(LOG_RTC, "%s: clock_ctrl_r: %02x\n", machine().describe_context(), data); + return data; } -WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_clock_ctl_w) +WRITE8_MEMBER(iris3000_state::clock_ctrl_w) { - verboselog(1, "sgi_ip2_clock_ctl_w: %02x\n", data); + LOGMASKED(LOG_RTC, "%s: clock_ctrl_w: %02x\n", machine().describe_context(), data); m_rtc->write(1, data); } -READ8_MEMBER(sgi_ip2_state::sgi_ip2_clock_data_r) +READ8_MEMBER(iris3000_state::clock_data_r) { - uint8_t ret = m_rtc->read(0); - verboselog(1, "sgi_ip2_clock_data_r: %02x\n", ret); - return ret; + uint8_t data = m_rtc->read(0); + LOGMASKED(LOG_RTC, "%s: clock_data_r: %02x\n", machine().describe_context(), data); + return data; } -WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_clock_data_w) +WRITE8_MEMBER(iris3000_state::clock_data_w) { - verboselog(1, "sgi_ip2_clock_data_w: %02x\n", data); + LOGMASKED(LOG_RTC, "%s: clock_data_w: %02x\n", machine().describe_context(), data); m_rtc->write(0, data); } - -READ8_MEMBER(sgi_ip2_state::sgi_ip2_os_base_r) +READ8_MEMBER(iris3000_state::kernel_base_r) { switch(offset) { default: - verboselog(0, "sgi_ip2_os_base_r: Unknown Register %08x\n", 0x36000000 + offset); + LOGMASKED(LOG_OTHER, "%s: kernel_base_r: Unknown Register %08x\n", machine().describe_context(), 0x36000000 + offset); break; } return 0; } -WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_os_base_w) +WRITE8_MEMBER(iris3000_state::kernel_base_w) { switch(offset) { default: - verboselog(0, "sgi_ip2_os_base_w: Unknown Register %08x = %02x\n", 0x36000000 + offset, data); + LOGMASKED(LOG_OTHER, "%s: kernel_base_w: Unknown Register %08x = %02x\n", machine().describe_context(), 0x36000000 + offset, data); break; } } -READ16_MEMBER(sgi_ip2_state::sgi_ip2_status_r) +READ16_MEMBER(iris3000_state::status_r) { - switch(offset) - { - default: - verboselog(0, "sgi_ip2_status_r: Unknown Register %08x & %04x\n", 0x38000000 + (offset << 1), mem_mask); - break; - } - return 0; + LOGMASKED(LOG_OTHER, "%s: status_r: %04x & %04x\n", machine().describe_context(), m_status, mem_mask); + return m_status; } -WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_status_w) +WRITE16_MEMBER(iris3000_state::status_w) { - switch(offset) - { - default: - verboselog(0, "sgi_ip2_status_w: Unknown Register %08x = %04x & %04x\n", 0x38000000 + (offset << 1), data, mem_mask); - break; - } + LOGMASKED(LOG_OTHER, "%s: status_w: %04x & %04x (DIAG:%x, ENABEXT:%d, ENABINT:%d, BINIT:%d, NOTBOOT:%d)\n", machine().describe_context(), data, mem_mask, + data & 0xf, BIT(data, STATUS_ENABEXT), BIT(data, STATUS_ENABINT), BIT(data, STATUS_BINIT), BIT(data, STATUS_NOTBOOT)); + LOGMASKED(LOG_OTHER, "%s: (USERFPA:%d, USERGE:%d, SLAVE:%d, ENABCBRQ:%d)\n", machine().describe_context(), + BIT(data, STATUS_USERFPA), BIT(data, STATUS_USERGE), BIT(data, STATUS_SLAVE), BIT(data, STATUS_ENABCBRQ)); + LOGMASKED(LOG_OTHER, "%s: (NOTGEMASTER:%d, GENBAD:%d, ENABWDOG:%d, QUICK_TOUT:%d)\n", machine().describe_context(), + BIT(data, STATUS_NOTGEMASTER), BIT(data, STATUS_GENBAD), BIT(data, STATUS_ENABWDOG), BIT(data, STATUS_QUICK_TOUT)); + COMBINE_DATA(&m_status); } -#define PAR_UR 0x01 /* Check parity on user-mode reads */ -#define PAR_UW 0x02 /* Check parity on user-mode writes */ -#define PAR_KR 0x04 /* Check parity on kernel-mode reads */ -#define PAR_KW 0x08 /* Check parity on kernel-mode writes */ -#define PAR_DIS0 0x10 /* Disable access to DUART0 and LEDs */ -#define PAR_DIS1 0x20 /* Disable access to DUART1 */ -#define PAR_MBR 0x40 /* Check parity on multibus reads */ -#define PAR_MBW 0x80 /* Check parity on multibus writes */ +READ8_MEMBER(iris3000_state::parity_ctrl_r) +{ + LOGMASKED(LOG_OTHER, "%s: parity_ctrl_r: %02x\n", m_parity_ctrl); + return m_parity_ctrl; +} +WRITE8_MEMBER(iris3000_state::parity_ctrl_w) +{ + LOGMASKED(LOG_OTHER, "%s: parity_ctrl_w: %02x\n", machine().describe_context(), data); + m_parity_ctrl = data; +} -READ8_MEMBER(sgi_ip2_state::sgi_ip2_parctl_r) +READ8_MEMBER(iris3000_state::multibus_prot_r) { - verboselog(0, "sgi_ip2_parctl_r: %02x\n", m_parctl); - return m_parctl; + LOGMASKED(LOG_OTHER, "%s: multibus_prot_r: %02x\n", machine().describe_context(), m_multibus_prot); + return m_multibus_prot; } -WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_parctl_w) +WRITE8_MEMBER(iris3000_state::multibus_prot_w) { - verboselog(0, "sgi_ip2_parctl_w: %02x\n", data); - m_parctl = data; + LOGMASKED(LOG_OTHER, "%s: multibus_prot_w: %02x\n", machine().describe_context(), data); + m_multibus_prot = data; } -#define MBP_DCACC 0x01 /* Display controller access (I/O page 4) */ -#define MBP_UCACC 0x02 /* Update controller access (I/O page 3) */ -#define MBP_GFACC 0x04 /* Allow GF access (I/O page 1) */ -#define MBP_DMACC 0x08 /* Allow GL2 DMA access (0x8nnnnn - x0bnnnnn) */ -#define MBP_LIOACC 0x10 /* Allow lower I/O access (0x0nnnnn - 0x7nnnnn) */ -#define MBP_HIOACC 0x20 /* Allow upper I/O access (0x8nnnnn - 0xfnnnnn) */ -#define MBP_LMACC 0x40 /* Allow lower memory access (0x0nnnnn - 0x7nnnnn) */ -#define MBP_HMACC 0x80 /* Allow upper memory access (0x8nnnnn - 0xfnnnnn) */ +READ32_MEMBER(iris3000_state::page_table_map_r) +{ + LOGMASKED(LOG_OTHER, "%s: page_table_map_r: %08x = %08x & %08x\n", machine().describe_context(), 0x3b000000 + (offset << 2), m_page_table_map[offset], mem_mask); + return m_page_table_map[offset]; +} +WRITE32_MEMBER(iris3000_state::page_table_map_w) +{ + LOGMASKED(LOG_OTHER, "%s: page_table_map_w: %08x = %08x & %08x\n", machine().describe_context(), 0x3b000000 + (offset << 2), data, mem_mask); + COMBINE_DATA(&m_page_table_map[offset]); +} -READ8_MEMBER(sgi_ip2_state::sgi_ip2_mbp_r) +READ16_MEMBER(iris3000_state::text_data_base_r) { - verboselog(0, "sgi_ip2_mbp_r: %02x\n", m_mbp); - return m_mbp; + LOGMASKED(LOG_OTHER, "%s: text_data_base_r: %04x & %04x\n", machine().describe_context(), m_text_data_base, mem_mask); + return m_text_data_base; } -WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_mbp_w) +WRITE16_MEMBER(iris3000_state::text_data_base_w) { - verboselog(0, "sgi_ip2_mbp_w: %02x\n", data); - m_mbp = data; + LOGMASKED(LOG_OTHER, "%s: text_data_base_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); + COMBINE_DATA(&m_text_data_base); } -READ32_MEMBER(sgi_ip2_state::sgi_ip2_ptmap_r) +READ16_MEMBER(iris3000_state::text_data_limit_r) { - verboselog(0, "sgi_ip2_ptmap_r: %08x = %08x & %08x\n", 0x3b000000 + (offset << 2), m_ptmap[offset], mem_mask); - return m_ptmap[offset]; + LOGMASKED(LOG_OTHER, "%s: text_data_limit_r: %04x & %04x\n", machine().describe_context(), m_text_data_limit, mem_mask); + return m_text_data_limit; } -WRITE32_MEMBER(sgi_ip2_state::sgi_ip2_ptmap_w) +WRITE16_MEMBER(iris3000_state::text_data_limit_w) { - verboselog(0, "sgi_ip2_ptmap_w: %08x = %08x & %08x\n", 0x3b000000 + (offset << 2), data, mem_mask); - COMBINE_DATA(&m_ptmap[offset]); + LOGMASKED(LOG_OTHER, "%s: text_data_limit_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); + COMBINE_DATA(&m_text_data_limit); } -READ16_MEMBER(sgi_ip2_state::sgi_ip2_tdbase_r) +READ16_MEMBER(iris3000_state::stack_base_r) { - verboselog(0, "sgi_ip2_tdbase_r: %04x\n", m_tdbase); - return m_tdbase; + LOGMASKED(LOG_OTHER, "%s: stack_base_r: %04x & %04x\n", machine().describe_context(), m_stack_base, mem_mask); + return m_stack_base; } -WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_tdbase_w) +WRITE16_MEMBER(iris3000_state::stack_base_w) { - verboselog(0, "sgi_ip2_tdbase_w: %04x & %04x\n", data, mem_mask); - COMBINE_DATA(&m_tdbase); + LOGMASKED(LOG_OTHER, "%s: stack_base_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); + COMBINE_DATA(&m_stack_base); } -READ16_MEMBER(sgi_ip2_state::sgi_ip2_tdlmt_r) +READ16_MEMBER(iris3000_state::stack_limit_r) +{ + LOGMASKED(LOG_OTHER, "%s: stack_limit_r: %04x & %04x\n", machine().describe_context(), m_stack_limit, mem_mask); + return m_stack_limit; +} + +WRITE16_MEMBER(iris3000_state::stack_limit_w) { - verboselog(0, "sgi_ip2_tdlmt_r: %04x\n", m_tdlmt); - return m_tdlmt; + LOGMASKED(LOG_OTHER, "%s: stack_limit_w: %04x & %04x\n", machine().describe_context(), data, mem_mask); + COMBINE_DATA(&m_stack_limit); } -WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_tdlmt_w) +READ8_MEMBER(iris3000_state::romboard_r) { - verboselog(0, "sgi_ip2_tdlmt_w: %04x & %04x\n", data, mem_mask); - COMBINE_DATA(&m_tdlmt); + const uint8_t data = offset < m_file_data.size() ? m_file_data[offset] : 0; + LOGMASKED(LOG_OTHER, "%s: romboard_r: %08x = %02x\n", machine().describe_context(), 0x40000000 + offset, data); + return data; } +WRITE8_MEMBER(iris3000_state::romboard_w) +{ + if (offset > m_file_data.size()) + m_file_data.resize(offset + 1); + m_file_data[offset] = data; + LOGMASKED(LOG_OTHER, "%s: romboard write: %08x = %02x\n", machine().describe_context(), 0x40000000 + offset, data); +} -READ16_MEMBER(sgi_ip2_state::sgi_ip2_stkbase_r) +void iris3000_state::machine_start() { - verboselog(0, "sgi_ip2_stkbase_r: %04x\n", m_stkbase); - return m_stkbase; } -WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_stkbase_w) +void iris3000_state::machine_reset() { - verboselog(0, "sgi_ip2_stkbase_w: %04x & %04x\n", data, mem_mask); - COMBINE_DATA(&m_stkbase); + uint32_t *src = (uint32_t*)(memregion("maincpu")->base()); + uint32_t *dst = m_mainram; + memcpy(dst, src, 8); } +/*************************************************************************** + ADDRESS MAPS +***************************************************************************/ -READ16_MEMBER(sgi_ip2_state::sgi_ip2_stklmt_r) +void iris3000_state::text_data_map(address_map &map) { - verboselog(0, "sgi_ip2_stklmt_r: %04x\n", m_stklmt); - return m_stklmt; + map(0x0000000, 0x03fffff).ram().share("mainram"); } -WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_stklmt_w) +void iris3000_state::stack_map(address_map &map) { - verboselog(0, "sgi_ip2_stklmt_w: %04x & %04x\n", data, mem_mask); - COMBINE_DATA(&m_stklmt); + map(0x0000000, 0x03fffff).ram().share("mainram"); } -void sgi_ip2_state::machine_start() +void iris3000_state::kernel_map(address_map &map) { + map(0x0000000, 0x03fffff).ram().share("mainram"); } -void sgi_ip2_state::machine_reset() +void iris3000_state::system_map(address_map &map) { + map(0x0000000, 0x0017fff).rom().region("maincpu", 0); + map(0x0800000, 0x0800003).rw(FUNC(iris3000_state::mouse_buttons_r), FUNC(iris3000_state::mouse_buttons_w)); + map(0x1000000, 0x1000003).rw(FUNC(iris3000_state::mouse_quad_r), FUNC(iris3000_state::mouse_quad_w)); + map(0x1800000, 0x1800003).r(FUNC(iris3000_state::dips_r)); + map(0x2000000, 0x200000f).rw(m_duarta, FUNC(mc68681_device::read), FUNC(mc68681_device::write)); + map(0x2800000, 0x280000f).rw(m_duartb, FUNC(mc68681_device::read), FUNC(mc68681_device::write)); + map(0x3000000, 0x30007ff).ram(); + map(0x4000000, 0x4000003).rw(FUNC(iris3000_state::clock_ctrl_r), FUNC(iris3000_state::clock_ctrl_w)); + map(0x5000000, 0x5000003).rw(FUNC(iris3000_state::clock_data_r), FUNC(iris3000_state::clock_data_w)); + map(0x6000000, 0x6000003).rw(FUNC(iris3000_state::kernel_base_r), FUNC(iris3000_state::kernel_base_w)); + map(0x8000000, 0x8000003).rw(FUNC(iris3000_state::status_r), FUNC(iris3000_state::status_w)); + map(0x9000000, 0x9000003).rw(FUNC(iris3000_state::parity_ctrl_r), FUNC(iris3000_state::parity_ctrl_w)); + map(0xa000000, 0xa000003).rw(FUNC(iris3000_state::multibus_prot_r), FUNC(iris3000_state::multibus_prot_w)); + map(0xb000000, 0xb00ffff).rw(FUNC(iris3000_state::page_table_map_r), FUNC(iris3000_state::page_table_map_w)).share("ptmap"); + map(0xc000000, 0xc000003).rw(FUNC(iris3000_state::text_data_base_r), FUNC(iris3000_state::text_data_base_w)); + map(0xd000000, 0xd000003).rw(FUNC(iris3000_state::text_data_limit_r), FUNC(iris3000_state::text_data_limit_w)); + map(0xe000000, 0xe000003).rw(FUNC(iris3000_state::stack_base_r), FUNC(iris3000_state::stack_base_w)); + map(0xf000000, 0xf000003).rw(FUNC(iris3000_state::stack_limit_r), FUNC(iris3000_state::stack_limit_w)); } -/*************************************************************************** - ADDRESS MAPS -***************************************************************************/ +void iris3000_state::multibus_mem_map(address_map &map) +{ + map(0x0200000, 0x03fffff).r(FUNC(iris3000_state::romboard_r)); +} +void iris3000_state::multibus_io_map(address_map &map) +{ +} + +void iris3000_state::geometry_pipe_map(address_map &map) +{ +} + +void iris3000_state::fpa_map(address_map &map) +{ +} -void sgi_ip2_state::sgi_ip2_map(address_map &map) -{ - map(0x00000000, 0x00ffffff).ram().share("mainram"); - map(0x02100000, 0x0210ffff).ram().share("bss"); // ??? I don't understand the need for this... - map(0x30000000, 0x30017fff).rom().region("maincpu", 0); - map(0x30800000, 0x30800003).rw(FUNC(sgi_ip2_state::sgi_ip2_m_but_r), FUNC(sgi_ip2_state::sgi_ip2_m_but_w)); - map(0x31000000, 0x31000003).rw(FUNC(sgi_ip2_state::sgi_ip2_m_quad_r), FUNC(sgi_ip2_state::sgi_ip2_m_quad_w)); - map(0x31800000, 0x31800003).r(FUNC(sgi_ip2_state::sgi_ip2_swtch_r)); - map(0x32000000, 0x3200000f).rw(m_duarta, FUNC(mc68681_device::read), FUNC(mc68681_device::write)); - map(0x32800000, 0x3280000f).rw(m_duartb, FUNC(mc68681_device::read), FUNC(mc68681_device::write)); - map(0x33000000, 0x330007ff).ram(); - map(0x34000000, 0x34000003).rw(FUNC(sgi_ip2_state::sgi_ip2_clock_ctl_r), FUNC(sgi_ip2_state::sgi_ip2_clock_ctl_w)); - map(0x35000000, 0x35000003).rw(FUNC(sgi_ip2_state::sgi_ip2_clock_data_r), FUNC(sgi_ip2_state::sgi_ip2_clock_data_w)); - map(0x36000000, 0x36000003).rw(FUNC(sgi_ip2_state::sgi_ip2_os_base_r), FUNC(sgi_ip2_state::sgi_ip2_os_base_w)); - map(0x38000000, 0x38000003).rw(FUNC(sgi_ip2_state::sgi_ip2_status_r), FUNC(sgi_ip2_state::sgi_ip2_status_w)); - map(0x39000000, 0x39000003).rw(FUNC(sgi_ip2_state::sgi_ip2_parctl_r), FUNC(sgi_ip2_state::sgi_ip2_parctl_w)); - map(0x3a000000, 0x3a000003).rw(FUNC(sgi_ip2_state::sgi_ip2_mbp_r), FUNC(sgi_ip2_state::sgi_ip2_mbp_w)); - map(0x3b000000, 0x3b003fff).rw(FUNC(sgi_ip2_state::sgi_ip2_ptmap_r), FUNC(sgi_ip2_state::sgi_ip2_ptmap_w)).share("ptmap"); - map(0x3c000000, 0x3c000003).rw(FUNC(sgi_ip2_state::sgi_ip2_tdbase_r), FUNC(sgi_ip2_state::sgi_ip2_tdbase_w)); - map(0x3d000000, 0x3d000003).rw(FUNC(sgi_ip2_state::sgi_ip2_tdlmt_r), FUNC(sgi_ip2_state::sgi_ip2_tdlmt_w)); - map(0x3e000000, 0x3e000003).rw(FUNC(sgi_ip2_state::sgi_ip2_stkbase_r), FUNC(sgi_ip2_state::sgi_ip2_stkbase_w)); - map(0x3f000000, 0x3f000003).rw(FUNC(sgi_ip2_state::sgi_ip2_stklmt_r), FUNC(sgi_ip2_state::sgi_ip2_stklmt_w)); +void iris3000_state::mem_map(address_map &map) +{ + map(0x00000000, 0xffffffff).rw(FUNC(iris3000_state::mmu_r), FUNC(iris3000_state::mmu_w)); } /*************************************************************************** MACHINE DRIVERS ***************************************************************************/ -WRITE_LINE_MEMBER(sgi_ip2_state::duarta_irq_handler) +WRITE_LINE_MEMBER(iris3000_state::duarta_irq_handler) { m_maincpu->set_input_line(M68K_IRQ_6, state); } -WRITE_LINE_MEMBER(sgi_ip2_state::duartb_irq_handler) +WRITE_LINE_MEMBER(iris3000_state::duartb_irq_handler) { m_maincpu->set_input_line(M68K_IRQ_6, state); } @@ -422,28 +604,40 @@ static DEVICE_INPUT_DEFAULTS_START( ip2_terminal ) DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END -void sgi_ip2_state::sgi_ip2(machine_config &config) +void iris3000_state::iris3130(machine_config &config) { /* basic machine hardware */ M68020(config, m_maincpu, 16000000); - m_maincpu->set_addrmap(AS_PROGRAM, &sgi_ip2_state::sgi_ip2_map); + m_maincpu->set_addrmap(AS_PROGRAM, &iris3000_state::mem_map); + + ADDRESS_MAP_BANK(config, "text_data").set_map(&iris3000_state::text_data_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "stack").set_map(&iris3000_state::stack_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "kernel").set_map(&iris3000_state::kernel_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "system").set_map(&iris3000_state::system_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "multibus_mem").set_map(&iris3000_state::multibus_mem_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "multibus_io").set_map(&iris3000_state::multibus_io_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "geometry_pipe").set_map(&iris3000_state::geometry_pipe_map).set_options(ENDIANNESS_BIG, 32, 32); + ADDRESS_MAP_BANK(config, "fpa").set_map(&iris3000_state::fpa_map).set_options(ENDIANNESS_BIG, 32, 32); MC68681(config, m_duarta, 3.6864_MHz_XTAL); /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */ - m_duarta->irq_cb().set(FUNC(sgi_ip2_state::duarta_irq_handler)); + m_duarta->irq_cb().set(FUNC(iris3000_state::duarta_irq_handler)); m_duarta->b_tx_cb().set("rs232", FUNC(rs232_port_device::write_txd)); MC68681(config, m_duartb, 3.6864_MHz_XTAL); /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */ - m_duartb->irq_cb().set(FUNC(sgi_ip2_state::duartb_irq_handler)); + m_duartb->irq_cb().set(FUNC(iris3000_state::duartb_irq_handler)); MC146818(config, m_rtc, 4.194304_MHz_XTAL); rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); rs232.rxd_handler().set(m_duarta, FUNC(mc68681_device::rx_b_w)); rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(ip2_terminal)); + + quickload_image_device &quickload(QUICKLOAD(config, "quickload", "")); + quickload.set_load_callback(FUNC(iris3000_state::load_romboard)); } -static INPUT_PORTS_START( sgi_ip2 ) - PORT_START("SWTCH") +static INPUT_PORTS_START( iris3130 ) + PORT_START("DIPS") PORT_DIPNAME( 0x8000, 0x8000, "Master/Slave" ) PORT_DIPSETTING( 0x0000, "Slave" ) PORT_DIPSETTING( 0x8000, "Master" ) @@ -487,28 +681,20 @@ static INPUT_PORTS_START( sgi_ip2 ) PORT_DIPSETTING( 0x000d, "DSD Tape Boot (1)" ) PORT_DIPSETTING( 0x000e, "DSD Tape Boot (2)" ) PORT_DIPSETTING( 0x000f, "DSD Hard Disk Boot" ) - INPUT_PORTS_END -void sgi_ip2_state::init_sgi_ip2() -{ - uint32_t *src = (uint32_t*)(memregion("maincpu")->base()); - uint32_t *dst = m_mainram; - memcpy(dst, src, 8); -} - /*************************************************************************** ROM definition(s) ***************************************************************************/ -ROM_START( sgi_ip2 ) +ROM_START( iris3130 ) ROM_REGION32_BE(0x18000, "maincpu", 0) ROM_LOAD( "sgi-ip2-u91.nolabel.od", 0x00000, 0x8000, CRC(32e1f6b5) SHA1(2bd928c3fe2e364b9a38189158e9bad0e5271a59) ) ROM_LOAD( "sgi-ip2-u92.nolabel.od", 0x08000, 0x8000, CRC(13dbfdb3) SHA1(3361fb62f7a8c429653700bccfc3e937f7508182) ) ROM_LOAD( "sgi-ip2-u93.ip2.2-008.od", 0x10000, 0x8000, CRC(bf967590) SHA1(1aac48e4f5531a25c5482f64de5cd3c7a9931f11) ) ROM_END -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1985, sgi_ip2, 0, 0, sgi_ip2, sgi_ip2, sgi_ip2_state, init_sgi_ip2, "Silicon Graphics Inc", "IRIS 3130 (IP2)", MACHINE_NOT_WORKING ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1985, iris3130, 0, 0, iris3130, iris3130, iris3000_state, empty_init, "Silicon Graphics Inc", "IRIS 3130 (IP2)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp index a778619e127..6b4de103095 100644 --- a/src/mame/drivers/itech32.cpp +++ b/src/mame/drivers/itech32.cpp @@ -870,8 +870,8 @@ void itech32_state::timekill_map(address_map &map) map(0x050000, 0x050001).portr("SYSTEM"); map(0x050001, 0x050001).w(FUNC(itech32_state::timekill_intensity_w)); map(0x058000, 0x058001).portr("DIPS").w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x060001, 0x060001).w(FUNC(itech32_state::timekill_colora_w)); - map(0x068001, 0x068001).w(FUNC(itech32_state::timekill_colorbc_w)); + map(0x060000, 0x060003).w(FUNC(itech32_state::timekill_colora_w)); + map(0x068000, 0x068003).w(FUNC(itech32_state::timekill_colorbc_w)); map(0x070000, 0x070001).nopw(); /* noisy */ map(0x078001, 0x078001).w(FUNC(itech32_state::sound_data_w)); map(0x080000, 0x08007f).rw(FUNC(itech32_state::video_r), FUNC(itech32_state::video_w)).share("video"); @@ -1938,6 +1938,34 @@ ROM_START( timekill121a ) /* Version 1.21 (3-tier board set: P/N 1050 Rev 1, P/N ROM_LOAD16_BYTE( "tksrom02_u26.u26", 0x200000, 0x80000, CRC(051ced3e) SHA1(6b63c4837e709806ffea9a37d93933635d356a6e) ) /* Labeled TKSROM02 (U26) */ ROM_END +ROM_START( timekill100 ) /* Version 1.00? - actual version not shown (3-tier board set: P/N 1050 Rev 1, P/N 1051 Rev 0 & P/N 1052 Rev 2) */ + ROM_REGION16_BE( 0x80000, "user1", 0 ) + ROM_LOAD16_BYTE( "tk00.bim_u54.u54", 0x00000, 0x40000, CRC(2b379f30) SHA1(7034cb0e6ba49ba9147fdb7ff6cbe34451ed4465) ) /* Labeled TK00.BIM (U54) */ + ROM_LOAD16_BYTE( "tk01.bim_u53.u53", 0x00001, 0x40000, CRC(e43e029c) SHA1(4bb069fffaa7482674f52eb4106409842f2c2a0e) ) /* Labeled TK01.BIM (U53) */ + + ROM_REGION( 0x28000, "soundcpu", 0 ) /* At 0x18002 in ROM: ITS Ver 4.0 OTTO Sound Board 6255 I/O 6/3/92 */ + ROM_LOAD( "timekillsnd_u17.u17", 0x10000, 0x18000, CRC(ab1684c3) SHA1(cc7e591fd160b259f8aecddb2c5a3c36e4e37b2f) ) /* Labeled TIMEKILLSND (U17) */ + ROM_CONTINUE( 0x08000, 0x08000 ) + + ROM_REGION( 0x880000, "gfx1", 0 ) /* ROM board P/N 1051 REV0 */ + ROM_LOAD32_BYTE( "time_killers_0.rom0", 0x000000, 0x200000, CRC(94cbf6f8) SHA1(dac5c4d9c8e42336c236ecc3c72b3b1f8282dc2f) ) /* 42 pin mask ROM */ + ROM_LOAD32_BYTE( "time_killers_1.rom1", 0x000001, 0x200000, CRC(c07dea98) SHA1(dd8b88beb9781579eb0a17231ad2a274b70ae1bc) ) /* 42 pin mask ROM */ + ROM_LOAD32_BYTE( "time_killers_2.rom2", 0x000002, 0x200000, CRC(183eed2a) SHA1(3905268fe45ecc47cd4d349666b4d33efda2140b) ) /* 42 pin mask ROM */ + ROM_LOAD32_BYTE( "time_killers_3.rom3", 0x000003, 0x200000, CRC(b1da1058) SHA1(a1d483701c661d69cecc9d073b23683b119f5ef1) ) /* 42 pin mask ROM */ + + /* NOTE: ROM boards are known to exist and have been verified to list (silkscreen) the above locations as ROM1, ROM2, ROM3 & ROM4 */ + + ROM_LOAD32_BYTE( "timekill_grom01.grom1", 0x800000, 0x020000, CRC(b030c3d9) SHA1(f5c21285ec8ff4f74205e0cf18da67e733e31183) ) + ROM_LOAD32_BYTE( "timekill_grom02.grom2", 0x800001, 0x020000, CRC(e98492a4) SHA1(fe8fb4bd3900109f3872f2930e8ddc9d19f599fd) ) + ROM_LOAD32_BYTE( "timekill_grom03.grom3", 0x800002, 0x020000, CRC(6088fa64) SHA1(a3eee10bdef48fefec3836f551172dbe0819acf6) ) + ROM_LOAD32_BYTE( "timekill_grom04.grom4", 0x800003, 0x020000, CRC(95be2318) SHA1(60580c87d63a114df44e2580e138128388ff447b) ) + + ROM_REGION16_BE( 0x400000, "ensoniq.2", ROMREGION_ERASE00 ) /* Sound board P/N 1052 REV 4 */ + ROM_LOAD16_BYTE( "tksrom00_u18.u18", 0x000000, 0x80000, CRC(79d8b83a) SHA1(78934b4d0ccca8fefcf8277e4296eb1d59cd575b) ) /* Labeled TKSROM00 (U18) */ + ROM_LOAD16_BYTE( "tksrom01_u20.u20", 0x100000, 0x80000, CRC(ec01648c) SHA1(b83c66cf22db5d89b9ed79b79861b79429d8380c) ) /* Labeled TKSROM01 (U20) */ + ROM_LOAD16_BYTE( "tksrom02_u26.u26", 0x200000, 0x80000, CRC(051ced3e) SHA1(6b63c4837e709806ffea9a37d93933635d356a6e) ) /* Labeled TKSROM02 (U26) */ +ROM_END + ROM_START( bloodstm ) ROM_REGION16_BE( 0x80000, "user1", 0 ) ROM_LOAD16_BYTE( "bld00_v222.u83", 0x00000, 0x40000, CRC(95f36db6) SHA1(72ec5ca93aed8fb12d5e5b7ff3d07c5cf1dab4bb) ) /* Labeled BLD00 V2.22 (U83) */ @@ -4694,6 +4722,7 @@ GAME( 1992, timekill132i, timekill, timekill, timekill, itech32_state, init_tim GAME( 1992, timekill131, timekill, timekill, timekill, itech32_state, init_timekill, ROT0, "Strata/Incredible Technologies", "Time Killers (v1.31)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, timekill121, timekill, timekill, timekill, itech32_state, init_timekill, ROT0, "Strata/Incredible Technologies", "Time Killers (v1.21)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, timekill121a, timekill, timekill, timekill, itech32_state, init_timekill, ROT0, "Strata/Incredible Technologies", "Time Killers (v1.21, alternate ROM board)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, timekill100, timekill, timekill, timekill, itech32_state, init_timekill, ROT0, "Strata/Incredible Technologies", "Time Killers (v1.00)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, hardyard, 0, bloodstm, hardyard, itech32_state, init_hardyard, ROT0, "Strata/Incredible Technologies", "Hard Yardage (v1.20)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, hardyard11, hardyard, bloodstm, hardyard, itech32_state, init_hardyard, ROT0, "Strata/Incredible Technologies", "Hard Yardage (v1.10)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, hardyard10, hardyard, bloodstm, hardyard, itech32_state, init_hardyard, ROT0, "Strata/Incredible Technologies", "Hard Yardage (v1.00)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/itech8.cpp b/src/mame/drivers/itech8.cpp index dd3ed86f907..b8a96aef281 100644 --- a/src/mame/drivers/itech8.cpp +++ b/src/mame/drivers/itech8.cpp @@ -2348,44 +2348,44 @@ ROM_START( pokrdice ) ROM_END -ROM_START( hstennis ) +ROM_START( hstennis ) /* PCB p/n 1030 */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "tenbim.v11", 0x00000, 0x10000, CRC(faffab5c) SHA1(4de525f6adb16205c47788b78aecdebd57008295) ) + ROM_LOAD( "ten.bim_v1.1_u5.u5", 0x00000, 0x10000, CRC(faffab5c) SHA1(4de525f6adb16205c47788b78aecdebd57008295) ) /* labeled as TEN.BIM V1.1 (U5) */ ROM_REGION( 0x10000, "soundcpu", 0 ) - ROM_LOAD( "tensnd.v1", 0x08000, 0x8000, CRC(f034a694) SHA1(3540e2edff2ce47504260ec856bab9b638d9260d) ) + ROM_LOAD( "tensnd.bim_v1_u27.u27", 0x08000, 0x8000, CRC(f034a694) SHA1(3540e2edff2ce47504260ec856bab9b638d9260d) ) /* labeled as TENSND.BIM V1 U27 */ ROM_REGION( 0xc0000, "grom", 0 ) - ROM_LOAD( "grom0.bin", 0x00000, 0x20000, CRC(1e69ebae) SHA1(a32e2c2f4e4a527ae6b57adeccd2c4d2045ab5fe) ) - ROM_LOAD( "grom1.bin", 0x20000, 0x20000, CRC(4e6a22d5) SHA1(3c2d51dd874f61c0a557ea2c1968afa02d9bfc42) ) - ROM_LOAD( "grom2.bin", 0x40000, 0x20000, CRC(c0b643a9) SHA1(d240f703a55c39ce4a969612fbb9cd76e4b849ac) ) - ROM_LOAD( "grom3.bin", 0x60000, 0x20000, CRC(54afb456) SHA1(0a7f10b1a490825a85489ac3f678eb1e11a0ac65) ) - ROM_LOAD( "grom4.bin", 0x80000, 0x20000, CRC(ee09d645) SHA1(8233cfbd17d9de548ae3ca5e30928061712e0781) ) + ROM_LOAD( "t_grom0.bim.grom0", 0x00000, 0x20000, CRC(1e69ebae) SHA1(a32e2c2f4e4a527ae6b57adeccd2c4d2045ab5fe) ) /* labeled as T GROM0.BIM, ect... */ + ROM_LOAD( "t_grom1.bim.grom1", 0x20000, 0x20000, CRC(4e6a22d5) SHA1(3c2d51dd874f61c0a557ea2c1968afa02d9bfc42) ) + ROM_LOAD( "t_grom2.bim.grom2", 0x40000, 0x20000, CRC(c0b643a9) SHA1(d240f703a55c39ce4a969612fbb9cd76e4b849ac) ) + ROM_LOAD( "t_grom3.bim.grom3", 0x60000, 0x20000, CRC(54afb456) SHA1(0a7f10b1a490825a85489ac3f678eb1e11a0ac65) ) + ROM_LOAD( "t_grom4.bim.grom4", 0x80000, 0x20000, CRC(ee09d645) SHA1(8233cfbd17d9de548ae3ca5e30928061712e0781) ) ROM_REGION( 0x40000, "oki", 0 ) - ROM_LOAD( "srom0.bin", 0x00000, 0x20000, CRC(d9ce58c3) SHA1(92574e60497d86b8608fba6278ccfc9036cb7f22) ) + ROM_LOAD( "tennis.vr_srom0.srom0", 0x00000, 0x20000, CRC(d9ce58c3) SHA1(92574e60497d86b8608fba6278ccfc9036cb7f22) ) /* labeled as TENNIS.VR SROM0 */ ROM_REGION( 0x0200, "plds", 0 ) ROM_LOAD( "pal16l8-itvs.u11", 0x0000, 0x0104, CRC(fee03727) SHA1(e784ff18505cdccc1020dbe5cb0e7cc9efc068a4) ) ROM_END -ROM_START( hstennis10 ) +ROM_START( hstennis10 ) /* PCB p/n 1030 */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "tenbim.v10", 0x00000, 0x10000, CRC(d108a6e0) SHA1(1041e1d95b10245fc50f6484e710803db2706f9a) ) + ROM_LOAD( "ten.bim_v1.0_u5.u5", 0x00000, 0x10000, CRC(d108a6e0) SHA1(1041e1d95b10245fc50f6484e710803db2706f9a) ) /* labeled as TEN.BIM V1.0 (U5) */ ROM_REGION( 0x10000, "soundcpu", 0 ) - ROM_LOAD( "tensnd.v1", 0x08000, 0x8000, CRC(f034a694) SHA1(3540e2edff2ce47504260ec856bab9b638d9260d) ) + ROM_LOAD( "tensnd.bim_v1_u27.u27", 0x08000, 0x8000, CRC(f034a694) SHA1(3540e2edff2ce47504260ec856bab9b638d9260d) ) /* labeled as TENSND.BIM V1 U27 */ ROM_REGION( 0xc0000, "grom", 0 ) - ROM_LOAD( "grom0.bin", 0x00000, 0x20000, CRC(1e69ebae) SHA1(a32e2c2f4e4a527ae6b57adeccd2c4d2045ab5fe) ) - ROM_LOAD( "grom1.bin", 0x20000, 0x20000, CRC(4e6a22d5) SHA1(3c2d51dd874f61c0a557ea2c1968afa02d9bfc42) ) - ROM_LOAD( "grom2.bin", 0x40000, 0x20000, CRC(c0b643a9) SHA1(d240f703a55c39ce4a969612fbb9cd76e4b849ac) ) - ROM_LOAD( "grom3.bin", 0x60000, 0x20000, CRC(54afb456) SHA1(0a7f10b1a490825a85489ac3f678eb1e11a0ac65) ) - ROM_LOAD( "grom4.bin", 0x80000, 0x20000, CRC(ee09d645) SHA1(8233cfbd17d9de548ae3ca5e30928061712e0781) ) + ROM_LOAD( "t_grom0.bim.grom0", 0x00000, 0x20000, CRC(1e69ebae) SHA1(a32e2c2f4e4a527ae6b57adeccd2c4d2045ab5fe) ) /* labeled as T GROM0.BIM, ect... */ + ROM_LOAD( "t_grom1.bim.grom1", 0x20000, 0x20000, CRC(4e6a22d5) SHA1(3c2d51dd874f61c0a557ea2c1968afa02d9bfc42) ) + ROM_LOAD( "t_grom2.bim.grom2", 0x40000, 0x20000, CRC(c0b643a9) SHA1(d240f703a55c39ce4a969612fbb9cd76e4b849ac) ) + ROM_LOAD( "t_grom3.bim.grom3", 0x60000, 0x20000, CRC(54afb456) SHA1(0a7f10b1a490825a85489ac3f678eb1e11a0ac65) ) + ROM_LOAD( "t_grom4.bim.grom4", 0x80000, 0x20000, CRC(ee09d645) SHA1(8233cfbd17d9de548ae3ca5e30928061712e0781) ) ROM_REGION( 0x40000, "oki", 0 ) - ROM_LOAD( "srom0.bin", 0x00000, 0x20000, CRC(d9ce58c3) SHA1(92574e60497d86b8608fba6278ccfc9036cb7f22) ) + ROM_LOAD( "tennis.vr_srom0.srom0", 0x00000, 0x20000, CRC(d9ce58c3) SHA1(92574e60497d86b8608fba6278ccfc9036cb7f22) ) /* labeled as TENNIS.VR SROM0 */ ROM_REGION( 0x0200, "plds", 0 ) ROM_LOAD( "pal16l8-itvs.u11", 0x0000, 0x0104, CRC(fee03727) SHA1(e784ff18505cdccc1020dbe5cb0e7cc9efc068a4) ) diff --git a/src/mame/drivers/jangou.cpp b/src/mame/drivers/jangou.cpp index 9753f643edc..43a79870a07 100644 --- a/src/mame/drivers/jangou.cpp +++ b/src/mame/drivers/jangou.cpp @@ -30,6 +30,7 @@ $c088-$c095 player tiles #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/nvram.h" +#include "machine/segacrpt_device.h" #include "sound/ay8910.h" #include "sound/hc55516.h" #include "sound/msm5205.h" @@ -61,9 +62,9 @@ public: void roylcrdn(machine_config &config); void cntrygrl(machine_config &config); void jangou(machine_config &config); + void luckygrl(machine_config &config); void init_jngolady(); - void init_luckygrl(); protected: virtual void machine_start() override; @@ -133,6 +134,8 @@ private: void nsc_map(address_map &map); void roylcrdn_cpu0_io(address_map &map); void roylcrdn_cpu0_map(address_map &map); + void luckygrl_cpu0_map(address_map &map); + void decrypted_opcodes_map(address_map &map); }; @@ -441,6 +444,23 @@ void jangou_state::cntrygrl_cpu0_io(address_map &map) /************************************* * + * Lucky Girl Memory Map + * + *************************************/ + +void jangou_state::luckygrl_cpu0_map(address_map &map) +{ + map(0x0000, 0x4fff).rom(); + map(0xc000, 0xc7ff).ram(); +} + +void jangou_state::decrypted_opcodes_map(address_map &map) +{ + map(0x0000, 0x4fff).rom().share("decrypted_opcodes"); +} + +/************************************* + * * Royal Card Memory Map * *************************************/ @@ -811,6 +831,75 @@ static INPUT_PORTS_START( roylcrdn ) PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END +static INPUT_PORTS_START( luckygrl ) + PORT_START("PL1_1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z) PORT_NAME("1P Bet1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X) PORT_NAME("1P Bet2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C) PORT_NAME("1P Bet3") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V) PORT_NAME("1P Bet4") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B) PORT_NAME("1P Bet5") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("1P Bet6") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1) PORT_NAME("1P Start") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LCONTROL) PORT_NAME("1P Flip-Flop") + + PORT_START("PL1_2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("1P Take Score") /* 1P Take Score */ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3) PORT_NAME("1P Hi-Lo (W-Up)") /* 1P W-Up */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("1P Hi (Big)") /* 1P Big */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("1P Lo (Small)") /* 1P Small */ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F) PORT_NAME("1P Stand") /* 1P Stand */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("1P Hit") /* 1P Hit */ + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PL2_1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("2P Bet1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2P Bet2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("2P Bet3") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("2P Bet4") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("2P Bet5") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("2P Bet6") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("2P Start") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("2P Flip-Flop") + + PORT_START("PL2_2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LEFT) PORT_NAME("2P Take Score") /* 2P Take Score */ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("2P Hi-Lo (W-Up)") /* 2P W-Up */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP) PORT_NAME("2P Hi (Big)") /* 2P Big */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN) PORT_NAME("2P Lo (Small)") /* 2P Small */ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("2P Stand") /* 2P Stand */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("2P Hit") /* 2P Hit */ + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PL1_3") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PL2_3") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("SYSTEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* Spare 2 */ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note In") /* Note In */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE PORT_CODE(KEYCODE_9) /* Memory Reset */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE PORT_CODE(KEYCODE_0) PORT_NAME("Analyzer") /* Analyzer */ + PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) /* Test Mode */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") /* Coin In */ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Credit Clear") /* Credit Clear */ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* Spare 1 */ + + PORT_START("DSW") // 6 dips bank + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("blitter", jangou_blitter_device, status_r) + + PORT_START("IN_NOMUX") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + /************************************* * @@ -968,6 +1057,18 @@ void jangou_state::roylcrdn(machine_config &config) config.device_remove("soundlatch"); } +void jangou_state::luckygrl(machine_config &config) +{ + cntrygrl(config); + + sega_315_spat_device &maincpu(SEGA_315_SPAT(config.replace(), m_cpu_0, MASTER_CLOCK / 8)); // actually Falcon 03155096 encrypted Z80 + maincpu.set_addrmap(AS_PROGRAM, &jangou_state::luckygrl_cpu0_map); + maincpu.set_addrmap(AS_IO, &jangou_state::cntrygrl_cpu0_io); + maincpu.set_addrmap(AS_OPCODES, &jangou_state::decrypted_opcodes_map); + maincpu.set_decrypted_tag(":decrypted_opcodes"); + maincpu.set_vblank_int("screen", FUNC(jangou_state::irq0_line_hold)); +} + /************************************* * @@ -1241,10 +1342,10 @@ ROM_END ROM_START( luckygrl ) - ROM_REGION( 0x10000, "cpu0", 0 ) //encrypted z80 cpu + ROM_REGION( 0x10000, "cpu0", 0 ) ROM_LOAD( "5.9c", 0x00000, 0x01000, CRC(79b34eb2) SHA1(4b4916e09bfd6573fd2c7a7254fa4419164e0c4d) ) - ROM_LOAD( "7.9f", 0x01000, 0x01000, CRC(14a44d23) SHA1(4f84a8f986a8fd9d5ac0636be1bb036c3b2746c2) ) ROM_LOAD( "6.9e", 0x02000, 0x01000, CRC(06850aa8) SHA1(c23cb6b7b26d5586b1a095dee88228d1613ae7d0) ) + ROM_LOAD( "7.9f", 0x04000, 0x01000, CRC(14a44d23) SHA1(4f84a8f986a8fd9d5ac0636be1bb036c3b2746c2) ) ROM_REGION( 0x10000, "gfx", 0 ) ROM_LOAD( "1.5r", 0x00000, 0x2000, CRC(fb429678) SHA1(00e37e90550d9190d06977a5f5ed75b691750cc1) ) @@ -1274,45 +1375,6 @@ void jangou_state::init_jngolady() m_nsc->space(AS_PROGRAM).install_read_handler(0x08, 0x08, read8_delegate(*this, FUNC(jangou_state::jngolady_rng_r))); } -void jangou_state::init_luckygrl() -{ - // this is WRONG, plaintext in the 0x1800 - 0x1dff range - uint8_t *ROM = memregion("cpu0")->base(); - - for (int A = 0; A < 0x3000; A++) - { - uint8_t x = ROM[A]; - - switch(A & 0x111) - { - case 0x000: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; - case 0x001: x = bitswap<8>(x ^ 0xa0, 3, 6, 5, 4, 7, 2, 1, 0); break; - case 0x010: x = bitswap<8>(x ^ 0x88, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x011: x = bitswap<8>(x ^ 0x28, 3, 6, 7, 4, 5, 2, 1, 0); break; - case 0x100: x = bitswap<8>(x ^ 0x28, 3, 6, 7, 4, 5, 2, 1, 0); break; - case 0x101: x = bitswap<8>(x ^ 0x20, 5, 6, 7, 4, 3, 2, 1, 0); break; - case 0x110: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; - case 0x111: x = bitswap<8>(x ^ 0x88, 5, 6, 7, 4, 3, 2, 1, 0); break; - } - - ROM[A] = x; - } - - #if 0 - { - char filename[256]; - sprintf(filename,"decrypted_%s", machine().system().name); - FILE *fp = fopen(filename, "w+b"); - if (fp) - { - fwrite(ROM, 0x3000, 1, fp); - fclose(fp); - } - } - #endif - -} - /************************************* * @@ -1320,17 +1382,15 @@ void jangou_state::init_luckygrl() * *************************************/ -GAME( 1983, jangou, 0, jangou, jangou, jangou_state, empty_init, ROT0, "Nichibutsu", "Jangou [BET] (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, macha, 0, jangou, macha, jangou_state, empty_init, ROT0, "Logitec", "Monoshiri Quiz Osyaberi Macha (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, jngolady, 0, jngolady, jngolady, jangou_state, init_jngolady, ROT0, "Nichibutsu", "Jangou Lady (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, cntrygrl, 0, cntrygrl, cntrygrl, jangou_state, empty_init, ROT0, "Royal Denshi", "Country Girl (Japan set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, cntrygrla, cntrygrl, cntrygrl, cntrygrl, jangou_state, empty_init, ROT0, "Nichibutsu", "Country Girl (Japan set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, fruitbun, cntrygrl, cntrygrl, cntrygrl, jangou_state, empty_init, ROT0, "Nichibutsu", "Fruits & Bunny (World?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, roylcrdn, 0, roylcrdn, roylcrdn, jangou_state, empty_init, ROT0, "Amusement", "Royal Card (Nichibutsu HW)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, roylcrdna, roylcrdn, roylcrdn, roylcrdn, jangou_state, empty_init, ROT0, "Miki Corp.", "Royal Card Part-Two (Nichibutsu HW, Ver. 1.02)", MACHINE_SUPPORTS_SAVE ) - -/* The following might not run there... */ -GAME( 1985, luckygrl, 0, cntrygrl, cntrygrl, jangou_state, init_luckygrl, ROT0, "Wing Co., Ltd.", "Lucky Girl? (Wing)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, jangou, 0, jangou, jangou, jangou_state, empty_init, ROT0, "Nichibutsu", "Jangou [BET] (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, macha, 0, jangou, macha, jangou_state, empty_init, ROT0, "Logitec", "Monoshiri Quiz Osyaberi Macha (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, jngolady, 0, jngolady, jngolady, jangou_state, init_jngolady, ROT0, "Nichibutsu", "Jangou Lady (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, cntrygrl, 0, cntrygrl, cntrygrl, jangou_state, empty_init, ROT0, "Royal Denshi", "Country Girl (Japan set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, cntrygrla, cntrygrl, cntrygrl, cntrygrl, jangou_state, empty_init, ROT0, "Nichibutsu", "Country Girl (Japan set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, fruitbun, cntrygrl, cntrygrl, cntrygrl, jangou_state, empty_init, ROT0, "Nichibutsu", "Fruits & Bunny (World?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, roylcrdn, 0, roylcrdn, roylcrdn, jangou_state, empty_init, ROT0, "Amusement", "Royal Card (Nichibutsu HW)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, roylcrdna, roylcrdn, roylcrdn, roylcrdn, jangou_state, empty_init, ROT0, "Miki Corp.", "Royal Card Part-Two (Nichibutsu HW, Ver. 1.02)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, luckygrl, 0, luckygrl, luckygrl, jangou_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky Girl (Wing)", MACHINE_SUPPORTS_SAVE ) /* Some other games that might run on this HW: diff --git a/src/mame/drivers/jazz.cpp b/src/mame/drivers/jazz.cpp index e603218b24c..e2569b22d61 100644 --- a/src/mame/drivers/jazz.cpp +++ b/src/mame/drivers/jazz.cpp @@ -13,10 +13,11 @@ * http://www.sensi.org/~alec/mips/mips-history.html * * TODO - * - make it boot Windows NT * - big-endian support for RISC/os * - EISA bus and slots * - slotify and improve graphics board + * - other models/variants + * - sound and other loose ends * * Unconfirmed parts lists from ARCSystem reference design (which appears to * be very similar or identical to the Jazz system) taken from: @@ -59,11 +60,14 @@ #include "debugger.h" +#include "jazz.lh" + #define VERBOSE 0 #include "logmacro.h" void jazz_state::machine_start() { + m_led.resolve(); } void jazz_state::machine_reset() @@ -75,66 +79,37 @@ void jazz_state::machine_reset() void jazz_state::init_common() { // map the configured ram and vram - m_cpu->space(0).install_ram(0x00000000, 0x00000000 | m_ram->mask(), m_ram->pointer()); - // FIXME: video ram must be written in emulated cpu order - m_cpu->space(0).install_ram(0x40000000, 0x40000000 | m_vram->mask(), m_vram->pointer()); + m_mct_adr->space(0).install_ram(0x00000000, 0x00000000 | m_ram->mask(), m_ram->pointer()); + m_mct_adr->space(0).install_ram(0x40000000, 0x40000000 | m_vram->mask(), m_vram->pointer()); } -void jazz_state::jazz_common_map(address_map &map) +void jazz_state::cpu_map(address_map &map) { - map(0x1fc00000, 0x1fc3ffff).r(m_flash, FUNC(amd_28f020_device::read)); + map(0x00000000, 0xffffffff).rw(m_mct_adr, FUNC(mct_adr_device::r4k_r), FUNC(mct_adr_device::r4k_w)); +} - // NOTE: defaults to console on serial1 if no video rom found - map(0x60000000, 0x6000013f).lr8( - [] (offs_t offset) - { - /* - * Board_Identifier, PROM_Stride, PROM_Width, PROM_Size - * 0=JazzVideoG300, 1=JazzVideoG364, 2=JazzVideoVxl, 0x10=MipsVideoG364, 0x11=MaximumJazzVideo (jazzvideog364 osc period == 123077, MipsVideoG364 = 200000) - * Test_Byte_0 - Test_Byte_3 - * VideoMemorySize, VideoControlSize - * CodeOffset, CodeSize - * ID string - */ - /* - static u8 const jazz_g364[] = - { - 0x01, 0x08, 0x01, 0x20, 'J', 'a', 'z', 'z', - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, - 'J', 'a', 'z', 'z', ' ', 'G', '3', '6', - '4', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; - - static u8 const mips_g364[] = - { - 0x10, 0x08, 0x01, 0x20, 'J', 'a', 'z', 'z', - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, - 'M', 'i', 'p', 's', ' ', 'G', '3', '6', - '4', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; - */ - - // FIXME: this is the MIPS G364 with the PROM fields zeroed to - // avoid a startup error, and should be replaced with the real - // signature above when an actual PROM dump is located. - static u8 const bogus_g364[] = - { - 0x10, 0x00, 0x00, 0x00, 'J', 'a', 'z', 'z', - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, - 'M', 'i', 'p', 's', ' ', 'G', '3', '6', - '4', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; +void jazz_state::mct_map(address_map &map) +{ + map(0x1fc00000, 0x1fc3ffff).r(m_flash, FUNC(amd_28f020_device::read)); - return bogus_g364[offset]; - }, "bogus_g364_r").umask64(0xff); + // VDR1 + //map(0x60000000, 0x60001fff).m(m_cvc, FUNC(g364_device::map)); + //map(0x60010000, 0x60010000); // id (r/w) + //map(0x60020000, 0x60020000); // reset + // VDR1F "Fission" + map(0x60000000, 0x6007ffff).rom().region("graphics", 0); map(0x60080000, 0x60081fff).m(m_cvc, FUNC(g364_device::map)); - map(0x60180000, 0x60180007).lw32([this] (u32 data) { m_cvc->reset(); }, "g364_reset"); + map(0x60100000, 0x60100000).lw8([this] (u8 data) { m_cvc->set_swapped(ENDIANNESS_NATIVE == ENDIANNESS_BIG); }, "little_endian"); + map(0x60102000, 0x60102000).lw8([this] (u8 data) { m_cvc->set_swapped(ENDIANNESS_NATIVE == ENDIANNESS_LITTLE); }, "big_endian"); + map(0x60180000, 0x60180000).lw8([this] (u8 data) { m_cvc->reset(); }, "g364_reset"); + //map(0x60182000, 0x60182000); // TODO: monitor - map(0x80000000, 0x80000fff).m(m_mct_adr, FUNC(jazz_mct_adr_device::map)); + // VDR2 + //map(0x60000000, 0x60000fff).m(m_cvc, FUNC(g300_device::map)); + //map(0x60008000, 0x60008fff).m(m_cursor, FUNC(bt431_device::map)).umask32(0x000000ff); + + map(0x80000000, 0x80000fff).m(m_mct_adr, FUNC(mct_adr_device::map)); map(0x80001000, 0x800010ff).m(m_net, FUNC(dp83932c_device::map)).umask32(0x0000ffff); map(0x80002000, 0x8000200f).m(m_scsi, FUNC(ncr53c94_device::map)); @@ -144,13 +119,13 @@ void jazz_state::jazz_common_map(address_map &map) // BE: read 400d, write 400d, write 400c map(0x80004000, 0x8000400f).lrw8( NAME([this] (offs_t offset) { return m_rtc->read(1); }), - NAME([this] (offs_t offset, u8 data) { m_rtc->write(1, data); })).umask64(0xff); - map(0x80005000, 0x80005007).rw(m_kbdc, FUNC(ps2_keyboard_controller_device::data_r), FUNC(ps2_keyboard_controller_device::data_w)).umask64(0x00ff); - map(0x80005000, 0x80005007).rw(m_kbdc, FUNC(ps2_keyboard_controller_device::status_r), FUNC(ps2_keyboard_controller_device::command_w)).umask64(0xff00); + NAME([this] (offs_t offset, u8 data) { m_rtc->write(1, data); })); + map(0x80005000, 0x80005000).rw(m_kbdc, FUNC(ps2_keyboard_controller_device::data_r), FUNC(ps2_keyboard_controller_device::data_w)); + map(0x80005001, 0x80005001).rw(m_kbdc, FUNC(ps2_keyboard_controller_device::status_r), FUNC(ps2_keyboard_controller_device::command_w)); map(0x80006000, 0x80006007).rw(m_ace[0], FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)); map(0x80007000, 0x80007007).rw(m_ace[1], FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)); - map(0x80008000, 0x80008007).rw(m_lpt, FUNC(pc_lpt_device::read), FUNC(pc_lpt_device::write)).umask64(0xffffffff); - map(0x80009000, 0x8000afff).ram().share("nvram"); // 9000-9fff unprotected/a000-afff protected? + map(0x80008000, 0x80008003).rw(m_lpt, FUNC(pc_lpt_device::read), FUNC(pc_lpt_device::write)); + map(0x80009000, 0x8000afff).ram().share("nvram"); map(0x8000b000, 0x8000b007).lr8( [] (offs_t offset) { @@ -160,32 +135,30 @@ void jazz_state::jazz_common_map(address_map &map) return mac[offset]; }, "mac"); - // 3 4k pages of nvram: read/write, protected, read-only - // last page holds ethernet mac and checksum in bytes 0-7 //map(0x8000c000, 0x8000cfff) // sound //map(0x8000d000, 0x8000dfff).noprw(); // dummy dma device? map(0x8000d600, 0x8000d607).nopw(); - map(0x8000f000, 0x8000f007).lrw8( - NAME([this] () { return m_led; }), - NAME([this] (u8 data) - { - logerror("led 0x%02x (%s)\n", data, machine().describe_context()); - m_led = data; - })).umask64(0xff); + map(0x8000f000, 0x8000f000).w(FUNC(jazz_state::led_w)); // lots of byte data written to 800 //map(0x800e0000, 0x800fffff).m() // dram config map(0x90000000, 0x90ffffff).m(m_isp, FUNC(i82357_device::map)); + // HACK: empty eisa slots + map(0x90001c80, 0x90001c87).ram(); + map(0x90002c80, 0x90002c87).ram(); + map(0x90003c80, 0x90003c87).ram(); + map(0x90004c80, 0x90004c87).ram(); + //map(0x91000000, 0x91ffffff).m(); //map(0x92000000, 0x92ffffff).m(); // EISA I/O ports? //map(0x93000000, 0x93ffffff).m(); // EISA memory - map(0xf0000000, 0xf0000007).r(m_mct_adr, FUNC(jazz_mct_adr_device::isr_r)).umask64(0xffff); - map(0xf0000000, 0xf0000007).rw(m_mct_adr, FUNC(jazz_mct_adr_device::imr_r), FUNC(jazz_mct_adr_device::imr_w)).umask64(0xffff0000); + map(0xf0000000, 0xf0000001).r(m_mct_adr, FUNC(mct_adr_device::isr_r)); + map(0xf0000002, 0xf0000003).rw(m_mct_adr, FUNC(mct_adr_device::imr_r), FUNC(mct_adr_device::imr_w)); map(0xfff00000, 0xfff3ffff).r(m_flash, FUNC(amd_28f020_device::read)); // mirror? } @@ -204,7 +177,7 @@ void jazz_state::jazz(machine_config &config) { // FIXME: slow the cpu clock to get past session manager bugcheck R4000(config, m_cpu, 50_MHz_XTAL / 5); - m_cpu->set_addrmap(0, &jazz_state::jazz_common_map); + m_cpu->set_addrmap(0, &jazz_state::cpu_map); RAM(config, m_ram); m_ram->set_default_size("16M"); @@ -216,8 +189,8 @@ void jazz_state::jazz(machine_config &config) m_vram->set_default_value(0); // local bus dma, timer and interrupt controller - JAZZ_MCT_ADR(config, m_mct_adr, 0); - m_mct_adr->set_bus(m_cpu, 0); + MCT_ADR(config, m_mct_adr, 0); + m_mct_adr->set_addrmap(0, &jazz_state::mct_map); m_mct_adr->out_int_dma_cb().set_inputline(m_cpu, INPUT_LINE_IRQ0); m_mct_adr->out_int_device_cb().set_inputline(m_cpu, INPUT_LINE_IRQ1); m_mct_adr->out_int_timer_cb().set_inputline(m_cpu, INPUT_LINE_IRQ4); @@ -235,21 +208,21 @@ void jazz_state::jazz(machine_config &config) // scsi host adapter NSCSI_CONNECTOR(config, "scsi:7").option_set("ncr53c94", NCR53C94).clock(24_MHz_XTAL).machine_config( - [this](device_t *device) + [this] (device_t *device) { ncr53c94_device &adapter = downcast<ncr53c94_device &>(*device); - adapter.irq_handler_cb().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<5>));; - adapter.drq_handler_cb().set(m_mct_adr, FUNC(jazz_mct_adr_device::drq<0>)); + adapter.irq_handler_cb().set(m_mct_adr, FUNC(mct_adr_device::irq<5>));; + adapter.drq_handler_cb().set(m_mct_adr, FUNC(mct_adr_device::drq<0>)); - subdevice<jazz_mct_adr_device>(":mct_adr")->dma_r_cb<0>().set(adapter, FUNC(ncr53c94_device::dma_r)); - subdevice<jazz_mct_adr_device>(":mct_adr")->dma_w_cb<0>().set(adapter, FUNC(ncr53c94_device::dma_w)); + subdevice<mct_adr_device>(":mct_adr")->dma_r_cb<0>().set(adapter, FUNC(ncr53c94_device::dma_r)); + subdevice<mct_adr_device>(":mct_adr")->dma_w_cb<0>().set(adapter, FUNC(ncr53c94_device::dma_w)); }); // floppy controller and drive N82077AA(config, m_fdc, 24_MHz_XTAL); - m_fdc->intrq_wr_callback().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<1>)); - m_fdc->drq_wr_callback().set(m_mct_adr, FUNC(jazz_mct_adr_device::drq<1>)); + m_fdc->intrq_wr_callback().set(m_mct_adr, FUNC(mct_adr_device::irq<1>)); + m_fdc->drq_wr_callback().set(m_mct_adr, FUNC(mct_adr_device::drq<1>)); FLOPPY_CONNECTOR(config, "fdc:0", "35hd", FLOPPY_35_HD, true, jazz_state::floppy_formats).enable_sound(false); m_mct_adr->dma_r_cb<1>().set(m_fdc, FUNC(n82077aa_device::dma_r)); m_mct_adr->dma_w_cb<1>().set(m_fdc, FUNC(n82077aa_device::dma_w)); @@ -282,18 +255,18 @@ void jazz_state::jazz(machine_config &config) // keyboard controller PS2_KEYBOARD_CONTROLLER(config, m_kbdc, 12_MHz_XTAL); // FIXME: reset is probably routed through the MCT-ADR - m_kbdc->hot_res().set([this](int state) { logerror("reset %d\n", state); }); + m_kbdc->hot_res().set([this] (int state) { machine().schedule_soft_reset(); }); m_kbdc->kbd_clk().set(kbd_con, FUNC(pc_kbdc_device::clock_write_from_mb)); m_kbdc->kbd_data().set(kbd_con, FUNC(pc_kbdc_device::data_write_from_mb)); - m_kbdc->kbd_irq().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<6>)); + m_kbdc->kbd_irq().set(m_mct_adr, FUNC(mct_adr_device::irq<6>)); m_kbdc->aux_clk().set(aux_con, FUNC(pc_kbdc_device::clock_write_from_mb)); m_kbdc->aux_data().set(aux_con, FUNC(pc_kbdc_device::data_write_from_mb)); - m_kbdc->aux_irq().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<7>)); + m_kbdc->aux_irq().set(m_mct_adr, FUNC(mct_adr_device::irq<7>)); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(78643200, 1280, 0, 1280, 1024, 0, 1024); - m_screen->set_screen_update("g364", FUNC(g364_device::screen_update)); - m_screen->screen_vblank().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<3>)); // maybe? + m_screen->set_screen_update(m_cvc, FUNC(g364_device::screen_update)); + m_screen->screen_vblank().set(m_mct_adr, FUNC(mct_adr_device::irq<3>)); // maybe? G364(config, m_cvc, 5_MHz_XTAL); // FIXME: guessed clock m_cvc->set_screen(m_screen); @@ -306,7 +279,7 @@ void jazz_state::jazz(machine_config &config) m_ace[0]->out_dtr_callback().set(serial0, FUNC(rs232_port_device::write_dtr)); m_ace[0]->out_rts_callback().set(serial0, FUNC(rs232_port_device::write_rts)); m_ace[0]->out_tx_callback().set(serial0, FUNC(rs232_port_device::write_txd)); - m_ace[0]->out_int_callback().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<8>)); + m_ace[0]->out_int_callback().set(m_mct_adr, FUNC(mct_adr_device::irq<8>)); serial0.cts_handler().set(m_ace[0], FUNC(ns16550_device::cts_w)); serial0.dcd_handler().set(m_ace[0], FUNC(ns16550_device::dcd_w)); @@ -320,7 +293,7 @@ void jazz_state::jazz(machine_config &config) m_ace[1]->out_dtr_callback().set(serial1, FUNC(rs232_port_device::write_dtr)); m_ace[1]->out_rts_callback().set(serial1, FUNC(rs232_port_device::write_rts)); m_ace[1]->out_tx_callback().set(serial1, FUNC(rs232_port_device::write_txd)); - m_ace[1]->out_int_callback().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<9>)); + m_ace[1]->out_int_callback().set(m_mct_adr, FUNC(mct_adr_device::irq<9>)); serial1.cts_handler().set(m_ace[1], FUNC(ns16550_device::cts_w)); serial1.dcd_handler().set(m_ace[1], FUNC(ns16550_device::dcd_w)); @@ -329,7 +302,7 @@ void jazz_state::jazz(machine_config &config) serial1.rxd_handler().set(m_ace[1], FUNC(ns16550_device::rx_w)); PC_LPT(config, m_lpt, 0); - m_lpt->irq_handler().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<0>)); + m_lpt->irq_handler().set(m_mct_adr, FUNC(mct_adr_device::irq<0>)); // TODO: sound, interrupt 2, drq 2(l) & 3(r) @@ -339,8 +312,8 @@ void jazz_state::jazz(machine_config &config) m_buzzer->add_route(ALL_OUTPUTS, "mono", 0.50); DP83932C(config, m_net, 20_MHz_XTAL); - m_net->out_int_cb().set(m_mct_adr, FUNC(jazz_mct_adr_device::irq<4>)); - m_net->set_ram(RAM_TAG); + m_net->out_int_cb().set(m_mct_adr, FUNC(mct_adr_device::irq<4>)); + m_net->set_bus(m_mct_adr, 1); I82357(config, m_isp, 14.318181_MHz_XTAL); m_isp->out_rtc_cb().set(m_rtc, FUNC(mc146818_device::write)); @@ -349,6 +322,35 @@ void jazz_state::jazz(machine_config &config) m_isp->out_spkr_cb().set(m_buzzer, FUNC(speaker_sound_device::level_w)); // TODO: 4 EISA slots + + config.set_default_layout(layout_jazz); +} + +void jazz_state::led_w(u8 data) +{ + // 7-segment diagnostic led + static u8 const patterns[16] = + { + // test output + 0x3f, // mct-adr 0 + 0x06, // network 1 + 0x5b, // scsi 2 + 0x4f, // floppy 3 + 0x66, // isp/rtc 4 + 0x6d, // keyboard 5 + 0x7d, // serial 6 + 0x07, // nvram 7 + 0x7f, // 8? + 0x6f, // video 9 + 0x77, // memory A + 0x40, // - + 0x39, // flash C + 0x00, // (blank) + 0x79, // cpu E + 0x71, // F? + }; + + m_led = patterns[data & 0xf] | (BIT(data, 4) ? 0x80 : 0); } void jazz_state::mmr4000be(machine_config &config) @@ -366,17 +368,30 @@ void jazz_state::mmr4000le(machine_config &config) } ROM_START(mmr4000be) - ROM_REGION64_BE(0x40000, "flash", 0) + ROM_REGION32_LE(0x40000, "flash", 0) ROM_SYSTEM_BIOS(0, "riscos", "R4000 RISC/os PROM") ROMX_LOAD("riscos.bin", 0x00000, 0x40000, CRC(cea6bc8f) SHA1(3e47b4ad5d1a0c7aac649e6aef3df1bf86fc938b), ROM_BIOS(0)) + + ROM_REGION32_LE(0x800000, "graphics", 0) + ROM_LOAD64_BYTE("mips_g364.bin", 0x00, 0x40, CRC(9265ccb6) SHA1(ef5c3a6bc5249274dd9c9a18d88a668cdd457370) BAD_DUMP) ROM_END ROM_START(mmr4000le) - ROM_REGION64_LE(0x40000, "flash", 0) + ROM_REGION32_LE(0x40000, "flash", 0) ROM_SYSTEM_BIOS(0, "ntprom", "R4000 Windows NT PROM") ROMX_LOAD("ntprom.bin", 0x00000, 0x40000, CRC(d91018d7) SHA1(316de17820192c89b8ee6d9936ab8364a739ca53), ROM_BIOS(0)) + + ROM_REGION32_LE(0x800000, "graphics", 0) + // Jazz G300 (8.125MHz video clock) + //ROM_LOAD64_BYTE("jazz_g300.bin", 0x00, 0x40, CRC(258eb00a) SHA1(6e3fd0272957524de82e7042d6e36aca492c4d26) BAD_DUMP) + // Jazz G364 (8.125MHz video clock) + //ROM_LOAD64_BYTE("jazz_g364.bin", 0x00, 0x40, CRC(6d1ee59f) SHA1(8ec928af5b72c52eae6a3e81942db7cfaf9b9c1d) BAD_DUMP) + // Jazz VXL (aka Jaguar, part number 09-00184) + //ROM_LOAD64_BYTE("jazz_vxl.bin", 0x00, 0x40, CRC(df86e670) SHA1(2a9e8b1a42e4a29242131fa26c493f53eb866484) BAD_DUMP) + // MIPS Video G364 (5MHz video clock, part number 09-00176) + ROM_LOAD64_BYTE("mips_g364.bin", 0x00, 0x40, CRC(9265ccb6) SHA1(ef5c3a6bc5249274dd9c9a18d88a668cdd457370) BAD_DUMP) ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1992, mmr4000be, 0, 0, mmr4000be, 0, jazz_state, init_common, "MIPS", "Magnum R4000 (big)", MACHINE_IS_SKELETON) -COMP( 1992, mmr4000le, 0, 0, mmr4000le, 0, jazz_state, init_common, "MIPS", "Magnum R4000 (little)", MACHINE_IS_SKELETON) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP(1992, mmr4000be, 0, 0, mmr4000be, 0, jazz_state, init_common, "MIPS", "Magnum R4000 (be)", MACHINE_NO_SOUND) +COMP(1992, mmr4000le, 0, 0, mmr4000le, 0, jazz_state, init_common, "MIPS", "Magnum R4000 (le)", MACHINE_NO_SOUND) diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp index 89fd060eaca..fa43809b9a9 100644 --- a/src/mame/drivers/jupace.cpp +++ b/src/mame/drivers/jupace.cpp @@ -790,7 +790,11 @@ void ace_state::ace(machine_config &config) m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("jupace_cass"); - SNAPSHOT(config, "snapshot", "ace", attotime::from_seconds(1)).set_load_callback(FUNC(ace_state::snapshot_cb)); + // snapshot + snapshot_image_device &snapshot(SNAPSHOT(config, "snapshot", "ace")); + snapshot.set_delay(attotime::from_double(1.0)); + snapshot.set_load_callback(FUNC(ace_state::snapshot_cb)); + snapshot.set_interface("jupace_snap"); I8255A(config, m_ppi); m_ppi->in_pb_callback().set(FUNC(ace_state::sby_r)); @@ -811,6 +815,7 @@ void ace_state::ace(machine_config &config) RAM(config, RAM_TAG).set_default_size("1K").set_extra_options("16K,32K,48K"); SOFTWARE_LIST(config, "cass_list").set_original("jupace_cass"); + SOFTWARE_LIST(config, "snap_list").set_original("jupace_snap"); } diff --git a/src/mame/drivers/jvh.cpp b/src/mame/drivers/jvh.cpp index 940102614fb..ca8311c20a5 100644 --- a/src/mame/drivers/jvh.cpp +++ b/src/mame/drivers/jvh.cpp @@ -8,7 +8,9 @@ ********************************************************************************/ #include "emu.h" #include "cpu/tms9900/tms9980a.h" +#include "cpu/tms9900/tms9995.h" #include "cpu/m6800/m6800.h" +#include "cpu/m6809/m6809.h" #include "machine/6522via.h" //#include "machine/74259.h" //#include "sound/ay8910.h" @@ -24,6 +26,7 @@ public: void common(machine_config &config); void jvh(machine_config &config); void jvh2(machine_config &config); + void jvh3(machine_config &config); void init_jvh(); @@ -144,7 +147,28 @@ void jvh_state::jvh2(machine_config &config) m_maincpu->set_addrmap(AS_IO, &jvh_state::movmastr_io); } +void jvh_state::jvh3(machine_config &config) +{ + TMS9995(config, m_maincpu, 12000000); + + M6809(config, "soundcpu", 2000000); + M6809(config, "soundcpu2", 2000000); + + // YM2203, YM3812, DAC +} + +/*------------------------------------------------------------------- +/ Ice Mania +/-------------------------------------------------------------------*/ +ROM_START(icemania) + ROM_REGION(0x4000, "maincpu", 0) + ROM_LOAD("1c1_ic1.bin", 0x0000, 0x2000, CRC(eae16d52) SHA1(9151e0ccec938d268a157cea30b4a23b69e194b8)) + ROM_LOAD("2b1_ic7.bin", 0x2000, 0x2000, CRC(7b5fc604) SHA1(22c1c1a030877df99c3db50e7dd41dffe6c21dec)) + + ROM_REGION(0x10000, "soundcpu", 0) + ROM_LOAD("im_snd.bin", 0xc000, 0x2000, CRC(0d861f65) SHA1(6c17d1f674c95a4c877b42100ab6e0ae8213264b)) +ROM_END /*------------------------------------------------------------------- / Escape @@ -170,6 +194,22 @@ ROM_START(movmastr) ROM_LOAD("snd.bin", 0xc000, 0x2000, NO_DUMP) ROM_END +/*------------------------------------------------------------------- +/ Formula 1 +/-------------------------------------------------------------------*/ +ROM_START(formula1) + ROM_REGION(0x4000, "maincpu", 0) + ROM_LOAD("f1_ic4.bin", 0x0000, 0x4000, CRC(6ca345da) SHA1(5532c5786d304744a69c7e892924edd03abe8209)) + + ROM_REGION(0x10000, "soundcpu", 0) + ROM_LOAD("f1_snd.bin", 0x8000, 0x8000, CRC(00562594) SHA1(3325ad4c0ec04457f4d5b78b9ac48218d6c7aef3)) + + ROM_REGION(0x10000, "soundcpu2", 0) + ROM_LOAD("f1_samples.bin", 0x0000, 0x10000, CRC(ecb7ff04) SHA1(1c11c8ce62ec2f0a4f7dae3b1661baddb04ad55a)) +ROM_END + +GAME( 1986, icemania, 0, jvh, jvh, jvh_state, init_jvh, ROT0, "Jac Van Ham (Royal)", "Ice Mania", MACHINE_IS_SKELETON_MECHANICAL) GAME( 1987, escape, 0, jvh, jvh, jvh_state, init_jvh, ROT0, "Jac Van Ham (Royal)", "Escape", MACHINE_IS_SKELETON_MECHANICAL) GAME( 19??, movmastr, 0, jvh2, jvh, jvh_state, init_jvh, ROT0, "Jac Van Ham (Royal)", "Movie Masters", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1988, formula1, 0, jvh3, jvh, jvh_state, init_jvh, ROT0, "Jac Van Ham (Royal)", "Formula 1", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp index 1e22ae2218b..75a4b126455 100644 --- a/src/mame/drivers/kaneko16.cpp +++ b/src/mame/drivers/kaneko16.cpp @@ -58,8 +58,10 @@ To Do: relevant registers aren't changed throughout the game (?) [gtmr2] -- Finish the Inputs (different wheels and pedals) -- Find infos about the communication stuff (even if it won't be supported) +- Finish the Inputs (different wheels and pedals); +- Implement LAN comms; +- Selecting Italian in the service mode settings causes no voice samples being played + (with lots of OKI invalid samples in logerror), sound bank bug or btanb? [brapboys / shogwarr] @@ -84,7 +86,6 @@ Dip locations verified from manual for: [general] - interrupt timing/behaviour -- replace sample bank copying with new ADDRESS MAP system for OKI and do banking like CPUs Non-Bugs (happen on real PCB) @@ -306,9 +307,7 @@ void kaneko16_state::bakubrkr_map(address_map &map) { map(0x000000, 0x07ffff).rom(); // ROM map(0x100000, 0x10ffff).ram(); // Work RAM - map(0x400000, 0x40001f).r(FUNC(kaneko16_state::ym2149_r<0>)); // Sound - map(0x400000, 0x40001d).w(FUNC(kaneko16_state::ym2149_w<0>)); - map(0x40001f, 0x40001f).w(FUNC(kaneko16_state::oki_bank0_w<7>)); // OKI bank Switch + map(0x400000, 0x40001f).rw(FUNC(kaneko16_state::ym2149_r<0>), FUNC(kaneko16_state::ym2149_w<0>)); // Sound map(0x400200, 0x40021f).rw(FUNC(kaneko16_state::ym2149_r<1>), FUNC(kaneko16_state::ym2149_w<1>)); // Sound map(0x400401, 0x400401).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // map(0x500000, 0x503fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map)); @@ -1657,6 +1656,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_state::interrupt) // main vblank interrupt if (scanline == 224) { + // 2 frame delayed normaly; differs per PCB? + m_kaneko_spr->render_sprites(m_screen->visible_area(), m_spriteram->buffer(), m_spriteram->bytes()); m_spriteram->copy(); m_maincpu->set_input_line(5, HOLD_LINE); } @@ -1787,6 +1788,7 @@ void kaneko16_state::bakubrkr(machine_config &config) YM2149(config, m_ym2149[0], XTAL(12'000'000)/6); /* verified on pcb */ m_ym2149[0]->add_route(ALL_OUTPUTS, "mono", 1.0); + m_ym2149[0]->port_b_write_callback().set(FUNC(kaneko16_state::oki_bank0_w<7>)); /* outputs B: OKI bank Switch */ YM2149(config, m_ym2149[1], XTAL(12'000'000)/6); /* verified on pcb */ m_ym2149[1]->add_route(ALL_OUTPUTS, "mono", 1.0); @@ -2137,8 +2139,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_shogwarr_state::shogwarr_interrupt) if (scanline == 224) { - m_spriteram->copy(); // TODO : shogwarr sprites are 1 frame delayed? reference : https://youtu.be/aj4ayOc4MuI - // the code for this interrupt is provided by the MCU.. + m_kaneko_spr->render_sprites(m_screen->visible_area(), m_spriteram->buffer(), m_spriteram->bytes()); + m_spriteram->copy(); m_maincpu->set_input_line(4, HOLD_LINE); } @@ -2922,7 +2924,6 @@ ROM_START( bloodwar ) ROM_REGION( 0x020000, "mcudata", 0 ) /* MCU Code */ ROM_LOAD16_WORD_SWAP( "ofd0x3.124", 0x000000, 0x020000, CRC(399f2005) SHA1(ff0370724770c35963953fd9596d9f808ba87d8f) ) - ROM_REGION( 0x1e00000, "kan_spr", 0 ) /* Sprites */ ROM_LOAD ( "of-200-0201.8", 0x0000000, 0x200000, CRC(bba63025) SHA1(daec5285469ee953f6f838fe3cb3903524e9ac39) ) ROM_LOAD ( "of-201-0202.9", 0x0200000, 0x200000, CRC(4ffd9ddc) SHA1(62bc8c0ed2efab407fc2956c514c3e732bcc47ee) ) diff --git a/src/mame/drivers/klax.cpp b/src/mame/drivers/klax.cpp index 54885b7360b..63d7ea87463 100644 --- a/src/mame/drivers/klax.cpp +++ b/src/mame/drivers/klax.cpp @@ -83,7 +83,7 @@ void klax_state::klax_map(address_map &map) map(0x000000, 0x03ffff).rom(); map(0x0e0000, 0x0e0fff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)).umask16(0x00ff); map(0x1f0000, 0x1fffff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); - map(0x260000, 0x260001).portr("P1").w(FUNC(klax_state::klax_latch_w)); + map(0x260000, 0x260001).portr("P1").w(FUNC(klax_state::latch_w)); map(0x260002, 0x260003).portr("P2"); map(0x270001, 0x270001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x2e0000, 0x2e0001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); @@ -96,12 +96,12 @@ void klax_state::klax_map(address_map &map) map(0x3f2800, 0x3f3fff).ram(); } -void klax_state::klax2bl_map(address_map &map) +void klax_state::klax5bl_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x0e0000, 0x0e0fff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)).umask16(0x00ff); map(0x1f0000, 0x1fffff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); - map(0x260000, 0x260001).portr("P1").w(FUNC(klax_state::klax_latch_w)); + map(0x260000, 0x260001).portr("P1").w(FUNC(klax_state::latch_w)); map(0x260002, 0x260003).portr("P2"); map(0x260006, 0x260007).w(FUNC(klax_state::interrupt_ack_w)); // map(0x270001, 0x270001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // no OKI here @@ -179,7 +179,7 @@ static const gfx_layout bootleg_layout = 8*8*4 }; -static GFXDECODE_START( gfx_klax2bl ) +static GFXDECODE_START( gfx_klax5bl ) GFXDECODE_ENTRY( "gfx1", 0, bootleg_layout, 256, 16 ) /* playfield */ GFXDECODE_ENTRY( "gfx2", 0, pfmolayout, 0, 16 ) /* sprites */ GFXDECODE_END @@ -231,18 +231,18 @@ void klax_state::bootleg_sound_map(address_map &map) map(0x0000, 0x7fff).rom(); } -void klax_state::klax2bl(machine_config &config) +void klax_state::klax5bl(machine_config &config) { klax(config); - m_maincpu->set_addrmap(AS_PROGRAM, &klax_state::klax2bl_map); + m_maincpu->set_addrmap(AS_PROGRAM, &klax_state::klax5bl_map); config.device_remove("oki"); // no 6295 here z80_device &audiocpu(Z80(config, "audiocpu", 6000000)); /* ? */ audiocpu.set_addrmap(AS_PROGRAM, &klax_state::bootleg_sound_map); - m_gfxdecode->set_info(gfx_klax2bl); + m_gfxdecode->set_info(gfx_klax5bl); // guess, probably something like this // 2 x msm at least on bootleg set 2 (ic18 and ic19) @@ -339,7 +339,7 @@ ROM_START( klax5bl ) // derived from 'klax5' set ROM_LOAD16_BYTE( "8.bin", 0x00001, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) ) ROM_END -ROM_START( klax5bl2 ) // derived from 'klax5' set, closer than klax2bl +ROM_START( klax5bl2 ) // derived from 'klax5' set, closer than klax5bl ROM_REGION( 0x40000, "maincpu", 0 ) /* 4*64k for 68000 code */ ROM_LOAD16_BYTE( "3.ic31", 0x00000, 0x10000, CRC(e43699f3) SHA1(2a78959ad065e1c0f69cc2ba4146a50102ccfd7e) ) ROM_LOAD16_BYTE( "1.ic13", 0x00001, 0x10000, CRC(dc67f13a) SHA1(6021f48b53f9000983bcd786b8366ba8638174de) ) @@ -367,6 +367,37 @@ ROM_START( klax5bl2 ) // derived from 'klax5' set, closer than klax2bl ROM_LOAD( "gal16v8.ic29", 0x600, 0x117, NO_DUMP ) ROM_END +ROM_START( klax5bl3 ) // almost identical to klax5bl2, only the first audiocpu ROM differs + ROM_REGION( 0x40000, "maincpu", 0 ) /* 4*64k for 68000 code */ + ROM_LOAD16_BYTE( "3.ic31", 0x00000, 0x10000, CRC(e43699f3) SHA1(2a78959ad065e1c0f69cc2ba4146a50102ccfd7e) ) + ROM_LOAD16_BYTE( "1.ic13", 0x00001, 0x10000, CRC(dc67f13a) SHA1(6021f48b53f9000983bcd786b8366ba8638174de) ) + ROM_LOAD16_BYTE( "4.ic30", 0x20000, 0x10000, CRC(f1b8e588) SHA1(080511f90aecb7526ab2107c196e73cb881a2bb5) ) + ROM_LOAD16_BYTE( "2.ic12", 0x20001, 0x10000, CRC(adbe33a8) SHA1(c6c4f9ea5224169dbf4dda1062954563ebab18d4) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) + ROM_LOAD( "6.ic22", 0x00000, 0x10000, CRC(d2c40941) SHA1(34d35d9333c315e116198aebc7db00fce6ccceb0) ) + ROM_LOAD( "5.ic23", 0x10000, 0x10000, CRC(a245e005) SHA1(8843edfa9deec405f491647d40007d0a38c25262) ) + + ROM_REGION( 0x40000, "gfx1", 0 ) + ROM_LOAD32_BYTE( "8.ic116", 0x00000, 0x10000, CRC(ebe4bd96) SHA1(31f941e39aeaed6a64b35827df4d234cd641b47d) ) + ROM_LOAD32_BYTE( "7.ic117", 0x00001, 0x10000, CRC(3b79c0d3) SHA1(f6910f2526e1d92eae260b5eb73b1672db891f4b) ) + ROM_LOAD32_BYTE( "12.ic134", 0x00002, 0x10000, CRC(ef7712fd) SHA1(9308b37a8b024837b32d10e358a5205fdc582214) ) + ROM_LOAD32_BYTE( "11.ic135", 0x00003, 0x10000, CRC(c2d8ce0c) SHA1(6b2f3c3f5f238dc00501646230dc8787dd862ed4) ) + + ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_LOAD16_BYTE( "10.ic101", 0x00000, 0x10000, CRC(5c551e92) SHA1(cbff8fc4f4d370b6db2b4953ecbedd249916b891) ) + ROM_LOAD16_BYTE( "9.ic102", 0x00001, 0x10000, CRC(36764bbc) SHA1(5762996a327b5f7f93f42dad7eccb6297b3e4c0b) ) + + ROM_REGION( 0x800, "eeprom", 0 ) // dumped from PCB after factory reset + ROM_LOAD( "28c16a.ic11", 0x000, 0x800, CRC(a853f611) SHA1(303d9032239a6b868bb010cee2e6292531686487) ) + + ROM_REGION( 0x800, "plds", 0) // protected + ROM_LOAD( "palce16v8.ic67", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "palce16v8.ic91", 0x200, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8.ic24", 0x400, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8.ic29", 0x600, 0x117, NO_DUMP ) +ROM_END + ROM_START( klax4 ) ROM_REGION( 0x40000, "maincpu", 0 ) /* 4*64k for 68000 code */ ROM_LOAD16_BYTE( "136075-5006.3n", 0x00000, 0x10000, CRC(65eb9a31) SHA1(3f47d58fe9eb154ab14ac282919f92679b5c7922) ) @@ -491,12 +522,13 @@ ROM_END * *************************************/ -GAME( 1989, klax, 0, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (version 6)", 0 ) -GAME( 1989, klax5, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (version 5)", 0 ) -GAME( 1989, klax4, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (version 4)", 0 ) -GAME( 1989, klaxj4, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (Japan, version 4)", 0 ) -GAME( 1989, klaxj3, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (Japan, version 3)", 0 ) -GAME( 1989, klaxd2, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (Germany, version 2)", 0 ) +GAME( 1989, klax, 0, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (version 6)", 0 ) +GAME( 1989, klax5, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (version 5)", 0 ) +GAME( 1989, klax4, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (version 4)", 0 ) +GAME( 1989, klaxj4, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (Japan, version 4)", 0 ) +GAME( 1989, klaxj3, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (Japan, version 3)", 0 ) +GAME( 1989, klaxd2, klax, klax, klax, klax_state, empty_init, ROT0, "Atari Games", "Klax (Germany, version 2)", 0 ) -GAME( 1989, klax5bl, klax, klax2bl, klax, klax_state, empty_init, ROT0, "bootleg", "Klax (version 5, bootleg set 1)", MACHINE_NOT_WORKING ) -GAME( 1989, klax5bl2, klax, klax2bl, klax, klax_state, empty_init, ROT0, "bootleg", "Klax (version 5, bootleg set 2)", MACHINE_NOT_WORKING ) +GAME( 1989, klax5bl, klax, klax5bl, klax, klax_state, empty_init, ROT0, "bootleg", "Klax (version 5, bootleg set 1)", MACHINE_NOT_WORKING ) +GAME( 1989, klax5bl2, klax, klax5bl, klax, klax_state, empty_init, ROT0, "bootleg", "Klax (version 5, bootleg set 2)", MACHINE_NOT_WORKING ) +GAME( 1989, klax5bl3, klax, klax5bl, klax, klax_state, empty_init, ROT0, "bootleg (Playmark)", "Klax (version 5, bootleg set 3)", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/konamigs.cpp b/src/mame/drivers/konamigs.cpp new file mode 100644 index 00000000000..c4a9c7cc375 --- /dev/null +++ b/src/mame/drivers/konamigs.cpp @@ -0,0 +1,1075 @@ +// license:BSD-3-Clause +// copyright-holders:MetalliC +/************************************************************************* + + Konami GSAN1 hardware + (c) 2000 + + CPU: Hitachi HD6417709 SH-3 + GPU: Hitachi HD64413AF 'Q2SD' Quick 2D Graphics Renderer with Synchronous DRAM Interface + SPU: Yamaha YMZ280B-F + Misc: + Altera Max EPM3256ATC144-10 + Altera Max EPM3064ATC100-10 + Epson RTC-4553 + + Known games (preliminary, some of listed below might not belong to this hardware): + *Dance Dance Revolution Kids + Muscle Ranking Football Masters + Muscle Ranking Kick Target + *Muscle Ranking Spray Hitter + Muscle Ranking Struck Out + Neratte Don Don + Pikkari Chance + Run Run Puppy + Soreike! Hanapuu + + * denotes these games are archived + + TODO: + - currently implemented very basic set of Q2SD GPU features, required/used by dumped games, should be improved if more games will be found. + - hook IRQs from GPU and SPU (not used by dumped games) + + Notes: + - hold Test + Service while booting to initialise RTC NVRAM + +**************************************************************************/ + +#include "emu.h" +#include "cpu/sh/sh3comn.h" +#include "cpu/sh/sh4.h" +#include "bus/ata/ataintf.h" +#include "machine/ataflash.h" +#include "machine/s3520cf.h" +#include "machine/ticket.h" +#include "sound/ymz280b.h" +#include "speaker.h" +#include "screen.h" + +class gsan_state : public driver_device +{ +public: + gsan_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ymz(*this, "ymz") + , m_ata(*this, "ata") + , m_rtc_r(*this, "RTCR") + , m_rtc_w(*this, "RTCW") + , m_dipsw_r(*this, "DSW") + , m_vram(*this, "vram", 0) + , m_gpuregs(*this, "gpu_regs", 0) + , m_ymzram(*this, "ymz_ram", 0) + , m_screen(*this, "screen") + , m_hopper(*this, "hopper") + { } + + void gsan(machine_config &config); + void gs_medal(machine_config &config); + void init_gsan(); + +protected: + required_device<sh34_base_device> m_maincpu; + required_device<ymz280b_device> m_ymz; + required_device<ata_interface_device> m_ata; + required_ioport m_rtc_r; + required_ioport m_rtc_w; + required_ioport m_dipsw_r; + required_shared_ptr<u16> m_vram; + required_shared_ptr<u16> m_gpuregs; + required_shared_ptr<u8> m_ymzram; + required_device<screen_device> m_screen; + optional_device<hopper_device> m_hopper; + + void main_map_common(address_map &map); + void main_map(address_map &map); + void main_map_medal(address_map &map); + void main_port(address_map &map); + void main_port_medal(address_map &map); + void ymz280b_map(address_map &map); + void ymz280b_map_medal(address_map &map); + + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_READ8_MEMBER(ymzram_r); + DECLARE_WRITE8_MEMBER(ymzram_w); + DECLARE_READ16_MEMBER(cf_regs_r); + DECLARE_WRITE16_MEMBER(cf_regs_w); + DECLARE_READ16_MEMBER(cf_data_r); + DECLARE_WRITE16_MEMBER(cf_data_w); + DECLARE_READ8_MEMBER(rtc_r); + DECLARE_WRITE8_MEMBER(rtc_w); + DECLARE_READ64_MEMBER(portc_r); + DECLARE_WRITE64_MEMBER(portc_w); + DECLARE_WRITE64_MEMBER(portc_medal_w); + DECLARE_READ64_MEMBER(porte_r); + DECLARE_WRITE64_MEMBER(porte_w); + DECLARE_READ16_MEMBER(dipsw_r); + u8 m_portc_data = 0xff; + u8 m_porte_data = 0xff; + + // Q2SD GPU + DECLARE_READ16_MEMBER(gpu_r); + DECLARE_WRITE16_MEMBER(gpu_w); + DECLARE_READ16_MEMBER(vram_r); + DECLARE_WRITE16_MEMBER(vram_w); + DECLARE_WRITE_LINE_MEMBER(vblank); + void do_render(bool vbkem); + void draw_quad_tex(u16 cmd, u16 *data); + void draw_quad_bin(u16 cmd, u16 *data); + void fill_quad(u16 cmd, u16 *data); + void draw_line(u16 cmd, u16 *data); + + int m_dbmode; + bool m_fg16bit; + bool m_bg16bit; + bool m_rend16bit; + bool m_width1024; + bool m_rsae; + bool m_vbkem; + s16 m_xo; + s16 m_yo; + s16 m_uxmin; + s16 m_uxmax; + s16 m_uymin; + s16 m_uymax; + s16 m_sxmax; + s16 m_symax; + + u32 get_rend_offset() + { + u16 val = m_rsae ? m_gpuregs[0x098 / 2] : m_gpuregs[0x014 / 2 + (BIT(m_gpuregs[0x002 / 2], 8) ? 0 : 1)]; + return (val & 0x7f) << 16; + }; + u16 get_color(u8 col) + { + return ((m_gpuregs[0x100 + col * 2] & 0x00f8) << 8) | ((m_gpuregs[0x101 + col * 2] & 0xfc00) >> 5) | ((m_gpuregs[0x101 + col * 2] & 0x00f8) >> 3); + }; + u16 get_pixel(u32 offset, u16 x, u16 y, bool bits16) + { + if (bits16) + { + if (!m_width1024) + offset += ((x & 0xf) << 1) + ((y & 0xf) << 5) + ((x & 0x01f0) << 5) + ((y & 0x1ff0) << 10); + else + offset += ((x & 0xf) << 1) + ((y & 0xf) << 5) + ((x & 0x03f0) << 5) + ((y & 0x0ff0) << 11); + offset &= 0x7fffff; + return m_vram[offset / 2]; + } + else + { + if (!m_width1024) + offset += ((x & 0x1f) << 0) + ((y & 0xf) << 5) + ((x & 0x01e0) << 4) + ((y & 0x3ff0) << 9); + else + offset += ((x & 0x1f) << 0) + ((y & 0xf) << 5) + ((x & 0x03e0) << 4) + ((y & 0x1ff0) << 10); + offset &= 0x7fffff; + return (m_vram[offset / 2] >> ((offset & 1) * 8)) & 0xff; + } + }; + void put_pixel(u32 offset, u16 x, u16 y, u16 color, bool bits16) + { + if (bits16) + { + if (!m_width1024) + offset += ((x & 0xf) << 1) + ((y & 0xf) << 5) + ((x & 0x01f0) << 5) + ((y & 0x1ff0) << 10); + else + offset += ((x & 0xf) << 1) + ((y & 0xf) << 5) + ((x & 0x03f0) << 5) + ((y & 0x0ff0) << 11); + offset &= 0x7fffff; + m_vram[offset / 2] = color; + } + else + { + if (!m_width1024) + offset += ((x & 0x1f) << 0) + ((y & 0xf) << 5) + ((x & 0x01e0) << 4) + ((y & 0x3ff0) << 9); + else + offset += ((x & 0x1f) << 0) + ((y & 0xf) << 5) + ((x & 0x03e0) << 4) + ((y & 0x1ff0) << 10); + offset &= 0x7fffff; + u8 shift = (offset & 1) * 8; + m_vram[offset / 2] = (m_vram[offset / 2] & (0xff00 >> shift)) | (color << shift); + } + }; + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); +}; + + + +// CF interface, looks like standard memory-mapped ATA layout, probably should be devicified +READ16_MEMBER(gsan_state::cf_regs_r) +{ + offset *= 2; + u16 data = 0; + if (ACCESSING_BITS_0_7) + data |= m_ata->read_cs0(offset, 0xff) & 0xff; + if (ACCESSING_BITS_8_15) + data |= (m_ata->read_cs0(offset + 1, 0xff) << 8); + return data; +} + +WRITE16_MEMBER(gsan_state::cf_regs_w) +{ + offset *= 2; + if (ACCESSING_BITS_0_7) + m_ata->write_cs0(offset, data & 0xff, 0xff); + if (ACCESSING_BITS_8_15) + m_ata->write_cs0(offset + 1, data >> 8, 0xff); +} + +READ16_MEMBER(gsan_state::cf_data_r) +{ + u16 data = m_ata->read_cs0(0, 0xffff); + return data; +} + +WRITE16_MEMBER(gsan_state::cf_data_w) +{ + m_ata->write_cs0(0, data, 0xffff); +} + +// misc I/O +READ16_MEMBER(gsan_state::dipsw_r) +{ + return m_dipsw_r->read(); +} +READ8_MEMBER(gsan_state::rtc_r) +{ + return m_rtc_r->read(); +} +WRITE8_MEMBER(gsan_state::rtc_w) +{ + m_rtc_w->write(data); +} + +READ8_MEMBER(gsan_state::ymzram_r) +{ + return m_ymzram[offset]; +} +WRITE8_MEMBER(gsan_state::ymzram_w) +{ + m_ymzram[offset] = data; +} + +// SH-3 GPIO output ports +READ64_MEMBER(gsan_state::portc_r) +{ + return m_portc_data; +} +WRITE64_MEMBER(gsan_state::portc_w) +{ + m_portc_data = data; + // TODO +} +WRITE64_MEMBER(gsan_state::portc_medal_w) +{ + m_portc_data = data; + + m_hopper->motor_w(data & 0x80); + machine().bookkeeping().coin_counter_w(0, data & 4); + machine().bookkeeping().coin_counter_w(1, data & 1); +} +READ64_MEMBER(gsan_state::porte_r) +{ + return m_porte_data; +} +WRITE64_MEMBER(gsan_state::porte_w) +{ + // lamps +#if 0 + u8 mask = m_porte_data ^ data; + if (mask) + logerror("PORT_E mask %02X val %02X\n", mask, data & mask); +#endif + m_porte_data = data; +} + + +// Q2SD GPU +READ16_MEMBER(gsan_state::vram_r) +{ + return m_vram[offset]; +} + +WRITE16_MEMBER(gsan_state::vram_w) +{ + COMBINE_DATA(&m_vram[offset]); +} + +READ16_MEMBER(gsan_state::gpu_r) +{ + return m_gpuregs[offset]; +} + +WRITE16_MEMBER(gsan_state::gpu_w) +{ + u16 prevval = m_gpuregs[offset]; + COMBINE_DATA(&m_gpuregs[offset]); + data = m_gpuregs[offset]; +#if 0 + if (prevval != data) + logerror("Q2SD reg %02X %04X\n", offset*2, data); +#endif + + switch (offset) + { + case 0x000: // System control + if (BIT(data, 15)) // reset + { + m_gpuregs[0x000 / 2] &= ~(1 << 10); + m_gpuregs[0x002 / 2] &= ~0x1680; + } + if (BIT(data, 14)) // display reset + { + m_gpuregs[0x002 / 2] &= ~(1 << 11); + } + if (BIT(data, 10)) // render break + { + if (m_vbkem) + { + m_gpuregs[0x002 / 2] |= 1 << 7; + m_vbkem = false; + } + } + if (BIT(data, 8)) // start render + { + m_gpuregs[0x000 / 2] &= ~(1 << 8); + do_render(false); + } + m_dbmode = (data >> 6) & 3; + break; + case 0x004 / 2: // Status register clear + m_gpuregs[0x002 / 2] &= ~(data & 0xff80); + break; + case 0x006 / 2: // Interrupt enable + if (data) + logerror("Q2SD interrupts not implemented! enabled %04\n", data); + break; + case 0x00c / 2: // Rendering mode + m_fg16bit = BIT(data, 0); + m_bg16bit = BIT(data, 1) ^ BIT(data, 0); + m_rend16bit = BIT(data, 2) ^ BIT(data, 0); + m_width1024 = BIT(data, 6); + m_rsae = BIT(data, 15); + break; + // R/O registers + case 0x002 / 2: // Status + case 0x03e / 2: case 0x040 / 2: + case 0x080 / 2: case 0x082 / 2: + case 0x084 / 2: case 0x086 / 2: + case 0x088 / 2: case 0x08a / 2: case 0x08c / 2: case 0x08e / 2: + case 0x090 / 2: case 0x092 / 2: + m_gpuregs[offset] = prevval; + break; + } +} + +WRITE_LINE_MEMBER(gsan_state::vblank) +{ + if (state) + { + switch (m_dbmode) + { + case 0: // Auto display + m_gpuregs[0x002 / 2] ^= 1 << 8; // DBF (display buffer) + m_vbkem = false; // kind of abort drawing + break; + case 1: // Auto render mode + if (m_vbkem) + { + m_vbkem = false; + do_render(true); + } + else + m_gpuregs[0x002 / 2] ^= 1 << 8; // DBF (display buffer) + break; + case 2: // Manual mode + case 3: + if (BIT(m_gpuregs[0x000 / 2], 9)) // DC (manual display area change) + { + m_gpuregs[0x000 / 2] &= ~(1 << 9); + m_gpuregs[0x002 / 2] ^= 1 << 8; // DBF (display buffer) + } + if (m_vbkem) + { + m_vbkem = false; + do_render(true); + } + break; + } + + m_gpuregs[0x002 / 2] |= 1 << 11; // VBK (vblank) + } +} + +void gsan_state::draw_quad_tex(u16 cmd, u16 *data) +{ + // logerror("Q2SD draw %04X src %d:%d sz %d:%d dst %d:%d %d:%d %d:%d %d:%d\n", cmd, data[0], data[1], data[2], data[3], (s16)data[4], (s16)data[5], (s16)data[6], (s16)data[7], (s16)data[8], (s16)data[9], (s16)data[10], (s16)data[11]); + if (cmd & 0x57f) + logerror("Q2SD unhandled draw tex mode %04X\n", cmd); + u32 ssx = data[0] & 0x3ff; + u32 ssy = data[1] & 0x3ff; + s16 sdx = data[4]; + s16 sdy = data[5]; + s16 edx = data[8]; + s16 edy = data[9]; + + sdx += m_xo; + edx += m_xo; + sdy += m_yo; + edy += m_yo; + + s16 sclipx, sclipy, eclipx, eclipy; + if (BIT(cmd, 7)) + { + sclipx = m_uxmin; + sclipy = m_uymin; + eclipx = std::min(m_uxmax, m_sxmax); + eclipy = std::min(m_uymax, m_symax); + } + else + { + sclipx = 0; sclipy = 0; + eclipx = m_sxmax; eclipy = m_symax; + } + u32 fg_offs = get_rend_offset(); + + s16 ddx = (edx >= sdx) ? 1 : -1; + s16 ddy = (edy >= sdy) ? 1 : -1; + edx += ddx; + edy += ddy; + + u32 src_offs = ((m_gpuregs[0x01c / 2] & 0x7f) << 16) | (m_gpuregs[0x01c / 2] & 0xe000); + + bool opaque = !BIT(cmd, 9); + + for (int y = sdy, sy = 0; y != edy; y += ddy, sy++) + for (int x = sdx, sx = 0; x != edx; x += ddx, sx++) + if (x >= sclipx && x <= eclipx && y >= sclipy && y <= eclipy) + { + u16 pix = get_pixel(src_offs, ssx + sx, ssy + sy, m_rend16bit); + if (pix || opaque) + put_pixel(fg_offs, x, y, pix, m_rend16bit); + } +} + +void gsan_state::draw_quad_bin(u16 cmd, u16 *data) +{ + // logerror("Q2SD draw %04X src %d:%d sz %d:%d dst %d:%d %d:%d %d:%d %d:%d\n", cmd, data[0], data[1], data[2], data[3], (s16)data[4], (s16)data[5], (s16)data[6], (s16)data[7], (s16)data[8], (s16)data[9], (s16)data[10], (s16)data[11]); + if (cmd & 0x57f) + logerror("Q2SD unhandled draw bin mode %04X\n", cmd); + + u32 src_offs = ((data[0] & 0x03ff) << 13) | (data[1] & 0x1fff); + u32 tdx = data[2]; + s16 sdx = data[4]; + s16 sdy = data[5]; + s16 edx = data[8]; + s16 edy = data[9]; + u16 color0 = data[0xc]; + u16 color1 = data[0xd]; + + sdx += m_xo; + edx += m_xo; + sdy += m_yo; + edy += m_yo; + + s16 sclipx, sclipy, eclipx, eclipy; + if (BIT(cmd, 7)) + { + sclipx = m_uxmin; + sclipy = m_uymin; + eclipx = std::min(m_uxmax, m_sxmax); + eclipy = std::min(m_uymax, m_symax); + } + else + { + sclipx = 0; sclipy = 0; + eclipx = m_sxmax; eclipy = m_symax; + } + u32 fg_offs = get_rend_offset(); + + s16 ddx = (edx >= sdx) ? 1 : -1; + s16 ddy = (edy >= sdy) ? 1 : -1; + edx += ddx; + edy += ddy; + + bool opaque = !BIT(cmd, 9); + if (!m_rend16bit) + { + color0 &= 0xff; + color1 &= 0xff; + } + + for (int y = sdy, sy = 0; y != edy; y += ddy, sy++) + for (int x = sdx, sx = 0; x != edx; x += ddx, sx++) + if (x >= sclipx && x <= eclipx && y >= sclipy && y <= eclipy) + { + u32 pixidx = sx + sy * tdx + src_offs * 8; + bool pix = (m_vram[pixidx / 16] >> (pixidx % 16)) & 1; + if (opaque || pix) + put_pixel(fg_offs, x, y, pix ? color1 : color0, m_rend16bit); + } +} + +void gsan_state::fill_quad(u16 cmd, u16 *data) +{ + // logerror("Q2SD fill dst %d:%d %d:%d %d:%d %d:%d col %04X\n", (s16)data[0], (s16)data[1], (s16)data[2], (s16)data[3], (s16)data[4], (s16)data[5], (s16)data[6], (s16)data[7], data[8]); + if (cmd & 0x77f) + logerror("Q2SD unhandled draw mode %04X\n", cmd); + s16 sdx = data[0]; + s16 sdy = data[1]; + s16 edx = data[4]; + s16 edy = data[5]; + u16 color = data[8]; + + sdx += m_xo; + edx += m_xo; + sdy += m_yo; + edy += m_yo; + + s16 sclipx, sclipy, eclipx, eclipy; + if (BIT(cmd, 7)) + { + sclipx = m_uxmin; + sclipy = m_uymin; + eclipx = std::min(m_uxmax, m_sxmax); + eclipy = std::min(m_uymax, m_symax); + } + else + { + sclipx = 0; sclipy = 0; + eclipx = m_sxmax; eclipy = m_symax; + } + u32 fg_offs = get_rend_offset(); + if (!m_rend16bit) + color &= 0xff; + + s16 ddx = (edx >= sdx) ? 1 : -1; + s16 ddy = (edy >= sdy) ? 1 : -1; + edx += ddx; + edy += ddy; + + for (int y = sdy; y != edy; y += ddy) + for (int x = sdx; x != edx; x += ddx) + { + if (x >= sclipx && x <= eclipx && y >= sclipy && y <= eclipy) + put_pixel(fg_offs, x, y, color, m_rend16bit); + } +} + +void gsan_state::draw_line(u16 cmd, u16 *data) +{ + if (cmd & 0x77f) + logerror("Q2SD unhandled line mode %04X\n", cmd); + + s16 sclipx, sclipy, eclipx, eclipy; + if (BIT(cmd, 7)) + { + sclipx = m_uxmin; + sclipy = m_uymin; + eclipx = std::min(m_uxmax, m_sxmax); + eclipy = std::min(m_uymax, m_symax); + } + else + { + sclipx = 0; sclipy = 0; + eclipx = m_sxmax; eclipy = m_symax; + } + u32 fg_offs = get_rend_offset(); + + u16 color = *data++; + if (!m_rend16bit) + color &= 0xff; + + u16 count = *data++; + while (count > 1) + { + s16 x0 = *data++ + m_xo; + s16 y0 = *data++ + m_yo; + s16 x1 = data[0] + m_xo; + s16 y1 = data[1] + m_yo; + --count; + + int dx = abs(x1 - x0); + int dy = -abs(y1 - y0); + int sx = x0 < x1 ? 1 : -1; + int sy = y0 < y1 ? 1 : -1; + int err = dx + dy; + + while (true) + { + if (x0 >= sclipx && x0 <= eclipx && y0 >= sclipy && y0 <= eclipy) + put_pixel(fg_offs, x0, y0, color, m_rend16bit); + + if (x0 == x1 && y0 == y1) + break; + + int e2 = 2 * err; + if (e2 >= dy) + { + err += dy; + x0 += sx; + } + if (e2 <= dx) + { + err += dx; + y0 += sy; + } + } + } +} + +void gsan_state::do_render(bool vbkem) +{ + u32 listoffs = (vbkem ? ((m_gpuregs[0x03e / 2] << 16) | m_gpuregs[0x040 / 2]) : ((m_gpuregs[0x018 / 2] << 16) | m_gpuregs[0x01a / 2])) / 2; + bool end_of_list = false; + do + { + u16 cmd = m_vram[listoffs++]; + switch (cmd >> 11) + { + case 0x00: // POLYGON4A + draw_quad_tex(cmd, &m_vram[listoffs]); + listoffs += 12; + break; + case 0x01: // POLYGON4B + draw_quad_bin(cmd, &m_vram[listoffs]); + listoffs += 14; + break; + case 0x02: // POLYGON4C + fill_quad(cmd, &m_vram[listoffs]); + listoffs += 9; + break; + case 0x0c: // LINE + draw_line(cmd, &m_vram[listoffs]); + listoffs += m_vram[listoffs + 1] * 2 + 2; + break; + case 0x12: // LCOFS + m_xo = m_gpuregs[0x84 / 2] = m_vram[listoffs++]; + m_yo = m_gpuregs[0x86 / 2] = m_vram[listoffs++]; + break; + case 0x15: // UCLIP + m_uxmin = m_gpuregs[0x88 / 2] = m_vram[listoffs++]; + m_uymin = m_gpuregs[0x8a / 2] = m_vram[listoffs++]; + m_uxmax = m_gpuregs[0x8c / 2] = m_vram[listoffs++]; + m_uymax = m_gpuregs[0x8e / 2] = m_vram[listoffs++]; + break; + case 0x16: // WPR + gpu_w(machine().dummy_space(), m_vram[listoffs] & 0x3ff, m_vram[listoffs + 1]); + listoffs += 2; + break; + case 0x17: // SCLIP + m_sxmax = m_gpuregs[0x90 / 2] = m_vram[listoffs++]; + m_symax = m_gpuregs[0x92 / 2] = m_vram[listoffs++]; + break; + case 0x1a: // VBKEM + listoffs += 2; + // remember current address and wait until vblank + m_gpuregs[0x03e / 2] = (listoffs * 2) >> 16; + m_gpuregs[0x040 / 2] = (listoffs * 2) & 0xffff; + m_vbkem = true; + end_of_list = true; + break; + case 0x1e: // NOP3 + listoffs += 2; + break; + case 0x1f: // TRAP + m_gpuregs[0x000 / 2] &= ~(1 << 10); + m_gpuregs[0x002 / 2] |= 1 << 10; + end_of_list = true; + break; + default: + logerror("Q2SD not implemented command %04X addr %08X\n", cmd, (listoffs - 1) * 2); + end_of_list = true; + break; + } + } while (!end_of_list); +} + +u32 gsan_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + if (BIT(m_gpuregs[0x000 / 2], 13)) + { + u32 fg_offs = (m_gpuregs[0x014/2 + BIT(m_gpuregs[0x002/2], 8)] & 0x7f) << 16; + bool fg_en = !BIT(m_gpuregs[0x056 / 2], 3); + bool bg_en = BIT(m_gpuregs[0x00a / 2], 10); + + int bgsx = m_gpuregs[0x04c / 2]; + int bgsy = m_gpuregs[0x04e / 2]; + + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + { + u16 col = 0; + if (fg_en) + { + col = get_pixel(fg_offs, x, y, m_fg16bit); + if (!m_fg16bit) + col = get_color(col); + } + if (bg_en && col == 0) + { + col = get_pixel(0, x + bgsx, y + bgsy, m_bg16bit); + if (!m_bg16bit) + col = get_color(col); + } + bitmap.pix32(y, x) = pal565(col, 11, 5, 0); + } + } + else + bitmap.fill(rgb_t::black(), cliprect); + return 0; +} + + + +void gsan_state::main_map_common(address_map &map) +{ + map(0x00000000, 0x0000ffff).rom().region("maincpu", 0); + map(0x0c000000, 0x0c3fffff).ram().share("main_ram"); + map(0x10000000, 0x100007ff).rw(FUNC(gsan_state::gpu_r), FUNC(gsan_state::gpu_w)).share("gpu_regs"); + // misc I/O + map(0x14000800, 0x14000807).rw(FUNC(gsan_state::cf_regs_r), FUNC(gsan_state::cf_regs_w)); + map(0x14000c00, 0x14000c03).rw(FUNC(gsan_state::cf_data_r), FUNC(gsan_state::cf_data_w)); + map(0x14001000, 0x14001001).r(FUNC(gsan_state::dipsw_r)); // write: pixel clock divider control, 1: /2, 2: /3, 4: /5 + map(0x14001019, 0x14001019).w(FUNC(gsan_state::rtc_w)); + map(0x14001039, 0x14001039).r(FUNC(gsan_state::rtc_r)); + + map(0x18000000, 0x18000001).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)); + + map(0x1f000000, 0x1f000fff).ram(); // cache RAM-mode (SH3 internal), actually should be 7Fxxxxxx, but current SH3 core doesn't like 7Fxxxxxx + map(0xa0000000, 0xa000ffff).rom().region("maincpu", 0); // uncached mirror, otherwise no disassembly can bee seen in debugger (bug?) +} +void gsan_state::main_map(address_map &map) +{ + main_map_common(map); + map(0x08000000, 0x087fffff).rw(FUNC(gsan_state::vram_r), FUNC(gsan_state::vram_w)).share("vram"); + map(0x18800000, 0x18ffffff).rw(FUNC(gsan_state::ymzram_r), FUNC(gsan_state::ymzram_w)).share("ymz_ram"); +} + +void gsan_state::main_port(address_map &map) +{ + map(SH3_PORT_C, SH3_PORT_C + 7).rw(FUNC(gsan_state::portc_r), FUNC(gsan_state::portc_w)); + map(SH3_PORT_E, SH3_PORT_E + 7).rw(FUNC(gsan_state::porte_r), FUNC(gsan_state::porte_w)); + map(SH3_PORT_F, SH3_PORT_F + 7).portr("PORT_F"); + map(SH3_PORT_L, SH3_PORT_L + 7).portr("PORT_L"); +} + +void gsan_state::ymz280b_map(address_map &map) +{ + map.global_mask(0x7fffff); + map(0x000000, 0x7fffff).ram().share("ymz_ram"); +} + +void gsan_state::main_map_medal(address_map &map) +{ + main_map_common(map); + map(0x08000000, 0x083fffff).rw(FUNC(gsan_state::vram_r), FUNC(gsan_state::vram_w)).share("vram"); + map(0x18800000, 0x18bfffff).rw(FUNC(gsan_state::ymzram_r), FUNC(gsan_state::ymzram_w)).share("ymz_ram"); +} + +void gsan_state::main_port_medal(address_map &map) +{ + main_port(map); + map(SH3_PORT_C, SH3_PORT_C + 7).rw(FUNC(gsan_state::portc_r), FUNC(gsan_state::portc_medal_w)); +} + +void gsan_state::ymz280b_map_medal(address_map &map) +{ + map.global_mask(0x3fffff); + map(0x000000, 0x3fffff).ram().share("ymz_ram"); +} + + +static INPUT_PORTS_START( ddrkids ) + PORT_START("PORT_F") + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Select R") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Select L") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused + + PORT_START("PORT_L") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("S2") // right-up hidden switch + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("S1") // left-down hidden switch + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_16WAY + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY + PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused + + PORT_START("DSW") + PORT_DIPNAME( 0x0007, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING( 0x0000, DEF_STR( Easiest ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( Very_Easy ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0003, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Medium_Hard ) ) + PORT_DIPSETTING( 0x0005, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x0006, DEF_STR( Very_Hard ) ) + PORT_DIPSETTING( 0x0007, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x0078, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:4,5,6,7") + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0018, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0028, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x0030, DEF_STR( 1C_7C ) ) + PORT_DIPSETTING( 0x0038, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0048, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0x0050, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0058, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x0060, DEF_STR( 3C_4C ) ) + PORT_DIPSETTING( 0x0068, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x0070, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x0078, DEF_STR( 4C_5C ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, "Demo Volume" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x0000, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( High ) ) + PORT_DIPNAME( 0x1c00, 0x0800, "Max Stage" ) PORT_DIPLOCATION("SW2:3,4,5") + PORT_DIPSETTING( 0x0000, "1" ) + PORT_DIPSETTING( 0x0400, "2" ) + PORT_DIPSETTING( 0x0800, "3" ) + PORT_DIPSETTING( 0x0c00, "4" ) + PORT_DIPSETTING( 0x1000, "5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x0000, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x0000, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x0000, "SW2:8" ) + + PORT_START("RTCW") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, set_dir_line) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, set_cs_line) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, write_bit) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, set_clock_line) + + PORT_START("RTCR") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("rtc", rtc4553_device, read_bit) + PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( muscl ) + PORT_START("PORT_L") + PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused + + PORT_START("PORT_F") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // looks like not regular coin in to play, but coins for medals exchange + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused + + PORT_START("DSW") + PORT_DIPNAME( 0x0007, 0x0007, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING( 0x0003, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0006, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0000, "5 Coins/2 Credits" ) + PORT_DIPNAME( 0x0078, 0x0078, "Coin Slot 2" ) PORT_DIPLOCATION("SW1:4,5,6,7") + PORT_DIPSETTING( 0x0078, "2 Medals" ) +// PORT_DIPSETTING( 0x0070, "2 Medals" ) + PORT_DIPSETTING( 0x0068, "3 Medals" ) + PORT_DIPSETTING( 0x0060, "4 Medals" ) + PORT_DIPSETTING( 0x0058, "5 Medals" ) + PORT_DIPSETTING( 0x0050, "6 Medals" ) + PORT_DIPSETTING( 0x0048, "7 Medals" ) + PORT_DIPSETTING( 0x0040, "8 Medals" ) + PORT_DIPSETTING( 0x0038, "9 Medals" ) + PORT_DIPSETTING( 0x0030, "10 Medals" ) + PORT_DIPSETTING( 0x0028, "11 Medals" ) + PORT_DIPSETTING( 0x0020, "12 Medals" ) + PORT_DIPSETTING( 0x0018, "13 Medals" ) + PORT_DIPSETTING( 0x0010, "14 Medals" ) + PORT_DIPSETTING( 0x0008, "15 Medals" ) + PORT_DIPSETTING( 0x0000, "16 Medals" ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0f00, 0x0000, "Standard of Payout" ) PORT_DIPLOCATION("SW2:1,2,3,4") + PORT_DIPSETTING( 0x0f00, "15%" ) + PORT_DIPSETTING( 0x0e00, "20%" ) + PORT_DIPSETTING( 0x0d00, "25%" ) + PORT_DIPSETTING( 0x0c00, "30%" ) + PORT_DIPSETTING( 0x0b00, "35%" ) + PORT_DIPSETTING( 0x0a00, "40%" ) + PORT_DIPSETTING( 0x0900, "45%" ) + PORT_DIPSETTING( 0x0800, "50%" ) + PORT_DIPSETTING( 0x0700, "55%" ) + PORT_DIPSETTING( 0x0600, "60%" ) + PORT_DIPSETTING( 0x0500, "65%" ) + PORT_DIPSETTING( 0x0400, "70%" ) + PORT_DIPSETTING( 0x0300, "75%" ) + PORT_DIPSETTING( 0x0200, "80%" ) + PORT_DIPSETTING( 0x0100, "85%" ) + PORT_DIPSETTING( 0x0000, "90%" ) + PORT_DIPNAME( 0x3000, 0x0000, "Play Timer" ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x3000, "1" ) + PORT_DIPSETTING( 0x2000, "2" ) + PORT_DIPSETTING( 0x1000, "3" ) + PORT_DIPSETTING( 0x0000, "4" ) + PORT_DIPNAME( 0x4000, 0x4000, "Backup Memory" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x4000, "Keep" ) + PORT_DIPSETTING( 0x0000, "Clear" ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("RTCW") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, set_dir_line) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, set_cs_line) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, write_bit) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("rtc", rtc4553_device, set_clock_line) + + PORT_START("RTCR") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("rtc", rtc4553_device, read_bit) + PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + +//************************************************************************** +// MACHINE DRIVERS +//************************************************************************** + +void gsan_state::machine_start() +{ + save_item(NAME(m_portc_data)); + save_item(NAME(m_porte_data)); + + save_item(NAME(m_dbmode)); + save_item(NAME(m_fg16bit)); + save_item(NAME(m_bg16bit)); + save_item(NAME(m_rend16bit)); + save_item(NAME(m_width1024)); + save_item(NAME(m_rsae)); + save_item(NAME(m_vbkem)); + save_item(NAME(m_xo)); + save_item(NAME(m_yo)); + save_item(NAME(m_uxmin)); + save_item(NAME(m_uxmax)); + save_item(NAME(m_uymin)); + save_item(NAME(m_uymax)); + save_item(NAME(m_sxmax)); + save_item(NAME(m_symax)); +} + +void gsan_state::machine_reset() +{ + memset(&m_gpuregs[0], 0, 0x800); + m_gpuregs[0x000 / 2] = 0xc000; + m_gpuregs[0x002 / 2] = 0x0044; + m_gpuregs[0x00a / 2] = 0x0088; + m_gpuregs[0x072 / 2] = 0xc000; + + m_dbmode = 0; + m_fg16bit = m_bg16bit = m_rend16bit = m_width1024 = m_rsae = m_vbkem = false; + m_xo = m_yo = m_uxmin = m_uxmax = m_uymin = m_uymax = m_sxmax = m_symax = 0; +} + +static void gsan_devices(device_slot_interface &device) +{ + device.option_add("cfcard", ATA_FLASH_PCCARD); +} + +void gsan_state::gsan(machine_config &config) +{ + // basic machine hardware + // SH7709 is earlier version of SH7709S (cv1k), not exact same, have minor differences + SH3BE(config, m_maincpu, 32_MHz_XTAL * 2); + m_maincpu->set_md(0, 0); + m_maincpu->set_md(1, 0); + m_maincpu->set_md(2, 0); + m_maincpu->set_md(3, 0); + m_maincpu->set_md(4, 0); + m_maincpu->set_md(5, 1); + m_maincpu->set_md(6, 0); + m_maincpu->set_md(7, 1); + m_maincpu->set_md(8, 0); + m_maincpu->set_sh4_clock(32_MHz_XTAL * 2); + m_maincpu->set_addrmap(AS_PROGRAM, &gsan_state::main_map); + m_maincpu->set_addrmap(AS_IO, &gsan_state::main_port); + + // misc + ATA_INTERFACE(config, m_ata).options(gsan_devices, "cfcard", nullptr, true); + RTC4553(config, "rtc"); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_screen_update(FUNC(gsan_state::screen_update)); + m_screen->set_raw(XTAL(36'000'000) / 3, 500, 0, 400, 400, 0, 300); + m_screen->screen_vblank().set(FUNC(gsan_state::vblank)); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + YMZ280B(config, m_ymz, 16.9344_MHz_XTAL); + m_ymz->set_addrmap(0, &gsan_state::ymz280b_map); + m_ymz->add_route(ALL_OUTPUTS, "mono", 1.0); +} + +void gsan_state::gs_medal(machine_config &config) +{ + gsan(config); + m_maincpu->set_addrmap(AS_PROGRAM, &gsan_state::main_map_medal); + m_maincpu->set_addrmap(AS_IO, &gsan_state::main_port_medal); + + m_ymz->set_addrmap(0, &gsan_state::ymz280b_map_medal); + + m_screen->set_raw(XTAL(36'000'000) / 5, 457, 0, 320, 262, 0, 240); + + HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); +} + +void gsan_state::init_gsan() +{ + m_maincpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS); + m_maincpu->sh2drc_add_fastram(0x00000000, 0x0000ffff, 0, memregion("maincpu")->base()); + m_maincpu->sh2drc_add_fastram(0x0c000000, 0x0c3fffff, 1, memshare("main_ram")->ptr()); +} + +//************************************************************************** +// ROM DEFINITIONS +//************************************************************************** + +ROM_START( ddrkids ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "gqan4-a.u17", 0x00000, 0x10000, CRC(f1346f33) SHA1(8e5d3fb64fb6e320bbde8e4cbde0689ad176a94e) ) + + ROM_REGION( 0x0f, "rtc", ROMREGION_ERASE00 ) + ROM_LOAD( "nvram.u9", 0x00, 0x0f, CRC(96a2e20b) SHA1(e857d915b1ddcb34f4dfb63b1cd743a439776009) ) + + DISK_REGION( "ata:0:cfcard:image" ) + DISK_IMAGE( "gqan4_b-005", 0, SHA1(6f9b190e06607766dea348f22f536aa1eb1336b5) ) +ROM_END + +ROM_START( musclhit ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "gsan5-a.u17", 0x00000, 0x10000, CRC(6ae1d1e8) SHA1(3224e4b8198aa38c094088456281cbd62c085407) ) + + ROM_REGION( 0x0f, "rtc", 0 ) + ROM_LOAD( "nvram.u9", 0x00, 0x0f, CRC(17614a6a) SHA1(f4714659937e7dd3eedc18bbedc4b3000134df16) ) + + DISK_REGION( "ata:0:cfcard:image" ) + DISK_IMAGE( "gsan6_a-213", 0, SHA1(d9e7a350428d1621fc70e81561390c01837a94c0) ) +ROM_END + + + +//************************************************************************** +// GAME DRIVERS +//************************************************************************** + +GAME( 2000, ddrkids, 0, gsan, ddrkids, gsan_state, init_gsan, ROT0, "Konami", "Dance Dance Revolution Kids (GQAN4 JAA)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_SUPPORTS_SAVE ) +GAME( 2000, musclhit, 0, gs_medal, muscl, gsan_state, init_gsan, ROT0, "Konami / TBS", "Muscle Ranking Kinniku Banzuke Spray Hitter", MACHINE_IMPERFECT_GRAPHICS|MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/konendev.cpp b/src/mame/drivers/konendev.cpp index d61bef2d23a..9a37ff66770 100644 --- a/src/mame/drivers/konendev.cpp +++ b/src/mame/drivers/konendev.cpp @@ -36,8 +36,10 @@ #include "emu.h" #include "cpu/powerpc/ppc.h" +#include "cpu/h8/h83006.h" #include "machine/eepromser.h" #include "machine/nvram.h" +#include "machine/msm6242.h" #include "sound/ymz280b.h" #include "video/k057714.h" #include "emupal.h" @@ -50,8 +52,11 @@ public: konendev_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_ifu(*this, "ifu") , m_gcu(*this, "gcu") , m_eeprom(*this, "eeprom") + , m_rtc(*this, "rtc") + , m_dpram(*this, "dpram") { } void init_konendev(); @@ -59,18 +64,25 @@ public: void konendev(machine_config &config); + virtual void machine_start() override + { + m_dpram_base = (uint16_t *)m_dpram.target(); + } + private: DECLARE_READ32_MEMBER(mcu2_r); DECLARE_READ32_MEMBER(ifu2_r); DECLARE_READ32_MEMBER(ctrl0_r); DECLARE_READ32_MEMBER(ctrl1_r); DECLARE_READ32_MEMBER(ctrl2_r); - DECLARE_READ32_MEMBER(rtc_r); - DECLARE_WRITE32_MEMBER(rtc_w); DECLARE_WRITE32_MEMBER(eeprom_w); DECLARE_READ32_MEMBER(sound_data_r); DECLARE_WRITE32_MEMBER(sound_data_w); + DECLARE_READ16_MEMBER(ifu_unk_r); + DECLARE_READ16_MEMBER(ifu_dpram_r); + DECLARE_WRITE16_MEMBER(ifu_dpram_w); + DECLARE_WRITE_LINE_MEMBER(gcu_interrupt); INTERRUPT_GEN_MEMBER(vbl_interrupt); @@ -79,11 +91,17 @@ private: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void konendev_map(address_map &map); + void ifu_map(address_map &map); // devices required_device<cpu_device> m_maincpu; + required_device<h83007_device> m_ifu; required_device<k057714_device> m_gcu; required_device<eeprom_serial_93cxx_device> m_eeprom; + required_device<rtc62423_device> m_rtc; + required_shared_ptr<uint32_t> m_dpram; + + uint16_t *m_dpram_base; }; uint32_t konendev_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -134,49 +152,6 @@ READ32_MEMBER(konendev_state::ifu2_r) return r; } -// This seems to be Epson RTC-72423 -uint8_t konendev_state::rtc_dev_r(uint32_t reg) -{ - switch (reg) - { - case 0x0: return 9; - case 0x1: return 5; - case 0x2: return 3; - case 0x3: return 2; - case 0x4: return 1; - case 0x5: return 0; - case 0x6: return 7; - case 0x7: return 2; - case 0x8: return 2; - case 0x9: return 1; - case 0xa: return 5; - case 0xb: return 1; - case 0xc: return 3; - } - - return 0; -} - -READ32_MEMBER(konendev_state::rtc_r) -{ - uint32_t r = 0; - - if (ACCESSING_BITS_24_31) - r |= (uint32_t)(rtc_dev_r(offset * 4)) << 24; - if (ACCESSING_BITS_16_23) - r |= (uint32_t)(rtc_dev_r((offset * 4)+1)) << 16; - if (ACCESSING_BITS_8_15) - r |= (uint32_t)(rtc_dev_r((offset * 4)+2)) << 8; - if (ACCESSING_BITS_0_7) - r |= (uint32_t)(rtc_dev_r((offset * 4)+3)); - - return r; -} - -WRITE32_MEMBER(konendev_state::rtc_w) -{ -} - READ32_MEMBER(konendev_state::ctrl0_r) { return ((uint32_t)(ioport("IN1")->read() & 0xffff) << 16) | 0xffff; @@ -218,12 +193,13 @@ void konendev_state::konendev_map(address_map &map) { map(0x00000000, 0x00ffffff).ram(); map(0x78000000, 0x78000003).r(FUNC(konendev_state::mcu2_r)); - map(0x78080000, 0x7808000f).rw(FUNC(konendev_state::rtc_r), FUNC(konendev_state::rtc_w)); + map(0x78080000, 0x7808000f).rw(m_rtc, FUNC(rtc62423_device::read), FUNC(rtc62423_device::write)); map(0x780c0000, 0x780c0003).rw(FUNC(konendev_state::sound_data_r), FUNC(konendev_state::sound_data_w)); map(0x78100000, 0x78100003).w(FUNC(konendev_state::eeprom_w)); map(0x78800000, 0x78800003).r(FUNC(konendev_state::ifu2_r)); map(0x78800004, 0x78800007).r(FUNC(konendev_state::ctrl0_r)); map(0x78a00000, 0x78a0001f).r(FUNC(konendev_state::ctrl1_r)); + map(0x78c00000, 0x78c003ff).ram().share("dpram"); map(0x78e00000, 0x78e00003).r(FUNC(konendev_state::ctrl2_r)); map(0x79000000, 0x79000003).w(m_gcu, FUNC(k057714_device::fifo_w)); map(0x79800000, 0x798000ff).rw(m_gcu, FUNC(k057714_device::read), FUNC(k057714_device::write)); @@ -233,6 +209,30 @@ void konendev_state::konendev_map(address_map &map) map(0x7ff00000, 0x7fffffff).rom().region("program", 0); } +READ16_MEMBER(konendev_state::ifu_unk_r) +{ + return 0xc3c3; // H8 program crashes immediately if it doesn't see +} + +READ16_MEMBER(konendev_state::ifu_dpram_r) +{ + return m_dpram_base[offset]; +} + +WRITE16_MEMBER(konendev_state::ifu_dpram_w) +{ + COMBINE_DATA(&m_dpram_base[offset]); +} + +void konendev_state::ifu_map(address_map &map) +{ + map(0x000000, 0x07ffff).rom().region("ifu", 0); + map(0x200000, 0x20ffff).ram(); + map(0x210000, 0x217fff).ram(); + map(0x800000, 0x8003ff).rw(FUNC(konendev_state::ifu_dpram_r), FUNC(konendev_state::ifu_dpram_w)); + map(0xa40000, 0xa40001).nopw(); + map(0xfee010, 0xfee011).r(FUNC(konendev_state::ifu_unk_r)); +}; static INPUT_PORTS_START( konendev ) PORT_START("IN0") @@ -311,6 +311,9 @@ void konendev_state::konendev(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &konendev_state::konendev_map); m_maincpu->set_vblank_int("screen", FUNC(konendev_state::vbl_interrupt)); + H83007(config, m_ifu, 8000000); // Clock unknown + m_ifu->set_addrmap(AS_PROGRAM, &konendev_state::ifu_map); + /* video hardware */ PALETTE(config, "palette", palette_device::RGB_555); @@ -325,6 +328,8 @@ void konendev_state::konendev(machine_config &config) K057714(config, m_gcu, 0); m_gcu->irq_callback().set(FUNC(konendev_state::gcu_interrupt)); + RTC62423(config, m_rtc, XTAL(32'768)); + NVRAM(config, "nvram0", nvram_device::DEFAULT_ALL_0); NVRAM(config, "nvram1", nvram_device::DEFAULT_ALL_0); @@ -340,9 +345,23 @@ void konendev_state::konendev(machine_config &config) } +#define ENDEAVOUR_BIOS \ + ROM_REGION( 0x200000, "ifu", 0 ) \ + ROM_LOAD( "2v02s502_ifu.bin", 0x000000, 0x080000, CRC(36122a98) SHA1(3d2c40c9d504358d890364e26c9562e40314d8a4) ) + +ROM_START( konendev ) + ENDEAVOUR_BIOS + + ROM_REGION32_BE( 0x200000, "program", ROMREGION_ERASE00 ) + ROM_REGION32_BE( 0x1800000, "flash", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x100, "eeprom", ROMREGION_ERASE00 ) +ROM_END + /* Interesting sets */ ROM_START( enchlamp ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "enl5rg26_01h.bin", 0x00000, 0x100000, CRC(fed5b988) SHA1(49442decd9b40f0a382c4fc7b231958f526ddbd1) ) ROM_LOAD32_WORD_SWAP( "enl5rg26_02l.bin", 0x00002, 0x100000, CRC(d0e42c9f) SHA1(10ff944ec0a626d47ec12be291ff5fe001342ed4) ) @@ -356,20 +375,20 @@ ROM_END ROM_START( whiterus ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "01h whr5ra26,c5df", 0x00000, 0x080000, CRC(d5a1ebb6) SHA1(14a8d1d8f8ae8919eaa878660c7e97e7ea7a02d8) ) ROM_LOAD32_WORD_SWAP( "02l whr5ra26,bc0a", 0x00002, 0x080000, CRC(48a2277c) SHA1(965d1da31e3bcde6fda4e15e8980a69e8bce5a84) ) - ROM_REGION( 0x200000, "others", 0 ) - ROM_LOAD( "u190.4 2v02s502.ifu_rus,95 7", 0x0000, 0x080000, CRC(36122a98) SHA1(3d2c40c9d504358d890364e26c9562e40314d8a4) ) - ROM_LOAD( "2v02s502_ifu.bin", 0x0000, 0x080000, CRC(36122a98) SHA1(3d2c40c9d504358d890364e26c9562e40314d8a4) ) // was in 2V02S502_IFU.zip looks similar to above tho - ROM_REGION32_BE( 0x1800000, "flash", ROMREGION_ERASE00 ) ROM_END /* Partial sets */ ROM_START( aadvent ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "afa5re26_01h.bin", 0x00000, 0x100000, CRC(65ce6f7a) SHA1(018742f13fea4c52f822e7f12e8efd0aff61a713) ) ROM_LOAD32_WORD_SWAP( "afa5re26_02l.bin", 0x00002, 0x100000, CRC(73945b3a) SHA1(5ace9c439048f3555fe631917c15bee76362e784) ) @@ -378,6 +397,8 @@ ROM_START( aadvent ) ROM_END ROM_START( dragnfly ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "drf5re26_01h.bin", 0x00000, 0x100000, CRC(ef6f1b69) SHA1(007a41cd1b08705184f69ce3e0e6c63bc2301e25) ) ROM_LOAD32_WORD_SWAP( "drf5re26_02l.bin", 0x00002, 0x100000, CRC(00e00c29) SHA1(a92d7220bf46655222ddc5d1c276dc469343f4c5) ) @@ -386,6 +407,8 @@ ROM_START( dragnfly ) ROM_END ROM_START( gypmagic ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "gym5rc26_01h.bin", 0x00000, 0x080000, CRC(8643be94) SHA1(fc63872a55ac2229652566bd9795ce9bf8442fee) ) ROM_LOAD32_WORD_SWAP( "gym5rc26_02l.bin", 0x00002, 0x080000, CRC(4ee33c46) SHA1(9e0ef66e9d53a47827d04e6a89d13d37429e0c16) ) @@ -394,6 +417,8 @@ ROM_START( gypmagic ) ROM_END ROM_START( incanp ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "inp5rg26_01h.bin", 0x00000, 0x100000, CRC(8434222e) SHA1(d03710e18f5b9e45db32685778a21a5dc598d043) ) ROM_LOAD32_WORD_SWAP( "inp5rg26_02l.bin", 0x00002, 0x100000, CRC(50c37109) SHA1(a638587f37f63b3f63ee51f541d991c3784c09f7) ) @@ -402,6 +427,8 @@ ROM_START( incanp ) ROM_END ROM_START( jestmagi ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "jem5rc26_01h.bin", 0x00000, 0x080000, CRC(9145324c) SHA1(366baa22bde1b8da19dba756829305d0fd69b4ff) ) ROM_LOAD32_WORD_SWAP( "jem5rc26_02l.bin", 0x00002, 0x080000, CRC(cb49f466) SHA1(e3987de2e640fe8116d66d2c1755e6500dedf8a5) ) @@ -410,6 +437,8 @@ ROM_START( jestmagi ) ROM_END ROM_START( luckfoun ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "luf5rd26_01h.bin", 0x00000, 0x080000, CRC(68b3d50a) SHA1(9b3d2a9f5d72db091e79b036017bd5d07f9fed00) ) ROM_LOAD32_WORD_SWAP( "luf5rd26_02l.bin", 0x00002, 0x080000, CRC(e7e9b8cd) SHA1(d8c421b0d58775f5a0ccae6395a604091b0acf1d) ) @@ -418,6 +447,8 @@ ROM_START( luckfoun ) ROM_END ROM_START( mohicans ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "moh5rf26_01h.bin", 0x00000, 0x100000, CRC(527dda20) SHA1(0a71484421738517c17d76e9bf92943b57cc4cc8) ) ROM_LOAD32_WORD_SWAP( "moh5rf26_02l.bin", 0x00002, 0x100000, CRC(a9bd3846) SHA1(02d80ff6c20e3732ae582de5d4392d4d6d8ba955) ) @@ -426,6 +457,8 @@ ROM_START( mohicans ) ROM_END ROM_START( monshow ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "tms5rc26_01h.bin", 0x00000, 0x100000, CRC(8209aafe) SHA1(e48a0524ad93a9b657d3efe67f7b5e1067b37e48) ) ROM_LOAD32_WORD_SWAP( "tms5rc26_02l.bin", 0x00002, 0x100000, CRC(78de8c59) SHA1(ad73bc926f5874d257171dfa6b727cb31e33bce9) ) @@ -434,6 +467,8 @@ ROM_START( monshow ) ROM_END ROM_START( romanl ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "rol5rg26_01h.bin", 0x00000, 0x100000, CRC(d441d30c) SHA1(025111699a7e29781bbb4d0f4151c808e3d06235) ) ROM_LOAD32_WORD_SWAP( "rol5rg26_02l.bin", 0x00002, 0x100000, CRC(08bd72ca) SHA1(a082cffeb1bccc8ec468a618eaabba7dac89882c) ) @@ -442,6 +477,8 @@ ROM_START( romanl ) ROM_END ROM_START( safemon ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "sam5rj26_01h.bin", 0x00000, 0x080000, CRC(7f82693f) SHA1(1c8540d209ab17f4fca5ff74bc687c83ec315208) ) ROM_LOAD32_WORD_SWAP( "sam5rj26_02l.bin", 0x00002, 0x080000, CRC(73bd981e) SHA1(f01b97201bd877c601cf3c742a6e0963de8e48dc) ) @@ -450,6 +487,8 @@ ROM_START( safemon ) ROM_END ROM_START( showqn ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "shq_1h.bin", 0x00000, 0x080000, CRC(3fc44415) SHA1(f0be1b90a2a374f9fb9e059e834bbdbf714b6607) ) ROM_LOAD32_WORD_SWAP( "shq_2l.bin", 0x00002, 0x080000, CRC(38a03281) SHA1(1b4552b0ce347df4d87e398111bbf72f126a8ec1) ) @@ -458,6 +497,8 @@ ROM_START( showqn ) ROM_END ROM_START( spiceup ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "siu5rc26_01h.bin", 0x00000, 0x100000, CRC(373bc2b1) SHA1(af3740fdcd028f162440701c952a3a87805bc65b) ) ROM_LOAD32_WORD_SWAP( "siu5rc26_02l.bin", 0x00002, 0x100000, CRC(2e584321) SHA1(ca98092dde76338117e989e774db2db672d87bfa) ) @@ -466,6 +507,8 @@ ROM_START( spiceup ) ROM_END ROM_START( sultanw ) + ENDEAVOUR_BIOS + ROM_REGION32_BE( 0x200000, "program", 0 ) ROM_LOAD32_WORD_SWAP( "suw5rc26_01h.bin", 0x00000, 0x100000, CRC(27760529) SHA1(b8970a706df52ee5792bbd7a4e719f2be87662ac) ) ROM_LOAD32_WORD_SWAP( "suw5rc26_02l.bin", 0x00002, 0x100000, CRC(1c98fd4d) SHA1(58ff948c0deba0bffb8866b15f46518524516501) ) @@ -480,6 +523,10 @@ ROM_START( konzero ) ROM_REGION32_BE( 0x1800000, "flash", ROMREGION_ERASE00 ) + // Normal Endeavour games use a standard IFU BIOS; this clear chip set uses an undumped alternate version + ROM_REGION( 0x200000, "ifu", 0 ) + ROM_LOAD( "konzero_ifu.bin", 0x000000, 0x080000, NO_DUMP ) + ROM_REGION16_BE( 0x100, "eeprom", 0 ) ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) ) // empty eeprom with Konami header ROM_END @@ -502,23 +549,26 @@ void konendev_state::init_enchlamp() rom[0] = 0x5782b930; // new checksum for program rom } +// BIOS +GAME( 200?, konendev, 0, konendev, konendev, konendev_state, init_enchlamp, ROT0, "Konami", "Konami Endeavour BIOS", MACHINE_NOT_WORKING|MACHINE_IS_BIOS_ROOT ) + // has a flash dump? -GAME( 200?, enchlamp, 0, konendev, konendev, konendev_state, init_enchlamp, ROT0, "Konami", "Enchanted Lamp (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, enchlamp, konendev, konendev, konendev, konendev_state, init_enchlamp, ROT0, "Konami", "Enchanted Lamp (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // missing flash but has other interesting files -GAME( 200?, whiterus, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "White Russia (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) - -// partial sets -GAME( 200?, aadvent, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "African Adventure (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, dragnfly, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Dragonfly (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, gypmagic, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Gypsy Magic (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, incanp, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Incan Pyramids (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, jestmagi, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Jester Magic (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, luckfoun, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Lucky Fountain (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, mohicans, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Mohican Sun (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, monshow, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "The Monster Show (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, romanl, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Roman Legions (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, safemon, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Safe Money (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, showqn, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Show Queen (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, spiceup, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Spice It Up (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, sultanw, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Sultan's Wish (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 200?, konzero, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Zero (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // doesn't seem to have a title string in it? +GAME( 200?, whiterus, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "White Russia (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) + +// partial setk +GAME( 200?, aadvent, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "African Adventure (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, dragnfly, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Dragonfly (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, gypmagic, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Gypsy Magic (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, incanp, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Incan Pyramids (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, jestmagi, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Jester Magic (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, luckfoun, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Lucky Fountain (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, mohicans, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Mohican Sun (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, monshow, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "The Monster Show (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, romanl, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Roman Legions (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, safemon, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Safe Money (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, showqn, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Show Queen (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, spiceup, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Spice It Up (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, sultanw, konendev, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Sultan's Wish (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 200?, konzero, 0, konendev, konendev, konendev_state, init_konendev, ROT0, "Konami", "Zero (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // doesn't seem to have a title string in it?k diff --git a/src/mame/drivers/konmedal.cpp b/src/mame/drivers/konmedal.cpp index f24de361357..7d39c0c4900 100644 --- a/src/mame/drivers/konmedal.cpp +++ b/src/mame/drivers/konmedal.cpp @@ -3,41 +3,56 @@ /*************************************************************************** konmedal.cpp: Konami Z80 based medal games + Driver by R. Belmont, MetalliC - Tsukande Toru Chicchi (つかんでとるちっち) - (c) 1995 Konami +Konami PWB 452093A boards + + Mario Roulette + Shuriken Boy (しゅりけんボーイ) + Fuusen Pentai (ふうせんペン太) + + Main CPU: Z80 + Sound: uPD7759C - Dam Dam Boy (ダムダム ボーイ) - (c) 1995 Konami + Konami Custom chips: + K052109 (tilemaps) + K051962 (tilemaps) + K051649 (sound) - Buttobi Striker - (c) 1994 Konami +Konami PWB 452574A boards - Driver by R. Belmont + Dam Dam Boy (ダムダムボーイ) + Buttobi Striker (ぶっとびストライカー) -Rundown of PCB: -Main CPU: Z80 -Sound: YMZ280B or OKIM6295 + Main CPU: Z80 + Sound: OKIM6295 -Konami Custom chips: -053252 (timing/interrupt controller?) -054156 (tilemaps) -054157 (tilemaps) + Konami Custom chips: + K053252 (timing/interrupt controller) + K054156 (tilemaps) + K054157 (tilemaps) + K051649 (sound) - Shuriken Boy - Fuusen Pentai +Konami PWB 402218 boards + + Tsukande Toru Chicchi (つかんでとるちっち) + Dam Dam Boy (ダムダムボーイ) -Konami Custom chips: -K052109 (tilemaps) -K051649 (sound) + Mostly same as 452574A but sound chips replaced with YMZ280B + + Notes and TODOs: + - Priorities not understood and wrong in places of GX-based games, apparently controlled by PROM + - X/Y scroll effects not 100% handled by current K052109(TMNT tilemaps) emulation. + Mario Roulette issues currently "resolved" using hack. ***************************************************************************/ #include "emu.h" #include "cpu/z80/z80.h" -#include "machine/eepromser.h" -#include "machine/gen_latch.h" +#include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" +#include "machine/k053252.h" #include "sound/ymz280b.h" #include "sound/okim6295.h" #include "sound/k051649.h" @@ -56,46 +71,61 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_k056832(*this, "k056832"), + m_k053252(*this, "k053252"), m_k052109(*this, "k052109"), m_palette(*this, "palette"), m_ymz(*this, "ymz"), m_oki(*this, "oki"), - m_upd7759(*this, "upd7759") + m_upd7759(*this, "upd"), + m_nvram(*this, "nvram"), + m_outport(*this, "OUT"), + m_lamps(*this, "lamp%u", 0U) { } void shuriboy(machine_config &config); void ddboy(machine_config &config); void tsukande(machine_config &config); void fuusenpn(machine_config &config); - + void mariorou(machine_config &config); + + void ddboy_init(); + void tsuka_init(); + void buttobi_init(); + void shuri_init(); + void mario_init(); + void fuusen_init(); private: void konmedal_palette(palette_device &palette) const; + void medal_nvram_init(nvram_device &nvram, void *base, size_t size); + void shuriboy_nvram_init(nvram_device &nvram, void *base, size_t size); + void fuusenpn_nvram_init(nvram_device &nvram, void *base, size_t size); + void mario_nvram_init(nvram_device &nvram, void *base, size_t size); DECLARE_MACHINE_START(shuriboy); DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); - DECLARE_READ8_MEMBER(magic_r); DECLARE_WRITE8_MEMBER(bankswitch_w); DECLARE_WRITE8_MEMBER(control2_w); - READ8_MEMBER(inputs_r) - { - return 0xff; - } + DECLARE_WRITE8_MEMBER(medalcnt_w); + DECLARE_WRITE8_MEMBER(lamps_w); uint32_t screen_update_konmedal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_shuriboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_fuusenpn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(konmedal_interrupt); K056832_CB_MEMBER(tile_callback); + TIMER_DEVICE_CALLBACK_MEMBER(konmedal_scanline); + WRITE_LINE_MEMBER(vbl_ack_w) { m_maincpu->set_input_line(0, CLEAR_LINE); } + WRITE_LINE_MEMBER(nmi_ack_w) { m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } + WRITE8_MEMBER(ccu_int_time_w) { m_ccu_int_time = data; } + WRITE8_MEMBER(k056832_w) { m_k056832->write(offset ^ 1, data); } + WRITE8_MEMBER(k056832_b_w) { m_k056832->b_w(offset ^ 1, data); } K052109_CB_MEMBER(shuriboy_tile_callback); - K052109_CB_MEMBER(fuusenpn_tile_callback); - TIMER_DEVICE_CALLBACK_MEMBER(scanline); + TIMER_DEVICE_CALLBACK_MEMBER(shuri_scanline); DECLARE_WRITE8_MEMBER(shuri_bank_w); - DECLARE_WRITE8_MEMBER(shuri_control_w); DECLARE_READ8_MEMBER(shuri_irq_r); DECLARE_WRITE8_MEMBER(shuri_irq_w); + DECLARE_WRITE8_MEMBER(mario_scrollhack_w); void ddboy_main(address_map &map); void medal_main(address_map &map); @@ -104,23 +134,65 @@ private: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; + void machine_start_common(); required_device<cpu_device> m_maincpu; optional_device<k056832_device> m_k056832; + optional_device<k053252_device> m_k053252; optional_device<k052109_device> m_k052109; required_device<palette_device> m_palette; optional_device<ymz280b_device> m_ymz; optional_device<okim6295_device> m_oki; optional_device<upd7759_device> m_upd7759; + required_device<nvram_device> m_nvram; + required_ioport m_outport; + output_finder<8> m_lamps; u8 m_control, m_control2, m_shuri_irq; - u32 m_vrom_base; + int m_ccu_int_time, m_ccu_int_time_count; + int m_avac; + int m_layer_colorbase[4]; + int m_layer_order[4]; }; WRITE8_MEMBER(konmedal_state::control2_w) { - //printf("%02x to control2\n", data); +/* CN3 + ---- ---x uPD7759 /ST (TMNT-based boards) + ---- --x- uPD7759 /RESET (TMNT-based boards) + ---- -x-- 10Y Counter + ---- x--- 100Y Counter + ---x ---- 10Y Lock + --x- ---- 100Y Lock + -x-- ---- Hopper On + x--- ---- K056832 RAM/ROM access switch (GX-based boards) +*/ m_control2 = data; + if (m_upd7759) // note: this is needed because games clear reset line and assert start line at the same time, but MAME's outport can't handle right order + m_upd7759->reset_w((data & 2) ? 1 : 0); + m_outport->write(data); + machine().bookkeeping().coin_counter_w(0, data & 4); + machine().bookkeeping().coin_counter_w(1, data & 8); + machine().bookkeeping().coin_lockout_w(0, (data & 0x10) ? 0 : 1); + machine().bookkeeping().coin_lockout_w(1, (data & 0x20) ? 0 : 1); +} + +WRITE8_MEMBER(konmedal_state::medalcnt_w) +{ +/* CN5 + ---- ---x Medal counter +1 (medal in) + ---- --x- Medal counter -1 (hopper out) + ---- -x-- Medal Lock +*/ + machine().bookkeeping().coin_counter_w(2, data & 2); + machine().bookkeeping().coin_lockout_w(2, (data & 4) ? 0 : 1); +} + +WRITE8_MEMBER(konmedal_state::lamps_w) +{ +// CN6 + for (int i = 0; i < 8; i++) + m_lamps[i] = BIT(data, i); } READ8_MEMBER(konmedal_state::vram_r) @@ -158,24 +230,59 @@ WRITE8_MEMBER(konmedal_state::vram_w) m_k056832->ram_code_lo_w(offset>>1, data); } -READ8_MEMBER(konmedal_state::magic_r) +void konmedal_state::ddboy_init() { - return 0xc1; // checked at 60f in tsukande before reading a page of the VROM + m_layer_colorbase[0] = 0; + m_layer_colorbase[1] = 8; + m_layer_colorbase[2] = 0; + m_layer_colorbase[3] = 8; + + // not 100% good, during gameplay should be 2 1 0 3, but this breaks title screen + m_layer_order[0] = 3; + m_layer_order[1] = 2; + m_layer_order[2] = 1; + m_layer_order[3] = 0; +} +void konmedal_state::buttobi_init() +{ + m_layer_colorbase[0] = 0; + m_layer_colorbase[1] = 8; + m_layer_colorbase[2] = 0; + m_layer_colorbase[3] = 8; + + // not 100% good, in case of loss goalkeeper gfx sometimes became on top of player + m_layer_order[0] = 1; + m_layer_order[1] = 0; + m_layer_order[2] = 3; + m_layer_order[3] = 2; +} +void konmedal_state::tsuka_init() +{ + m_layer_colorbase[0] = 0; + m_layer_colorbase[1] = 8; + m_layer_colorbase[2] = 0; + m_layer_colorbase[3] = 0; + + m_layer_order[0] = 3; + m_layer_order[1] = 1; + m_layer_order[2] = 0; + m_layer_order[3] = 2; } K056832_CB_MEMBER(konmedal_state::tile_callback) { - int codebits = *code; - //int bs; - //int bankshifts[4] = { 0, 4, 8, 12 }; - int mode, data; //, bank; - - m_k056832->read_avac(&mode, &data); - - *color = (codebits >> 12) & 0xf; - //bs = (codebits & 0xc00) >> 10; - //bank = (data >> bankshifts[bs]) & 0xf; - *code = (codebits & 0x3ff); // | (bank << 10); + u32 codebits = *code; + + int mode, avac; + m_k056832->read_avac(&mode, &avac); + if (mode) + *code = (((avac >> ((codebits >> 8) & 0xc)) & 0xf) << 10) | (codebits & 0x3ff); + else + *code = codebits & 0xfff; + + *code = bitswap<14>(*code, 8, 9, 13, 12, 11, 10, 7, 6, 5, 4, 3, 2, 1, 0); + *color = m_layer_colorbase[layer] + ((codebits >> 13) & 7); + *priority = BIT(codebits, 12); } void konmedal_state::video_start() @@ -187,9 +294,18 @@ uint32_t konmedal_state::screen_update_konmedal(screen_device &screen, bitmap_in bitmap.fill(0, cliprect); screen.priority().fill(0, cliprect); - // game only draws on this layer, apparently - m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1); + int mode, data; + m_k056832->read_avac(&mode, &data); + data |= mode << 3; + if (m_avac != data) + { + m_avac = data; + m_k056832->mark_all_tilemaps_dirty(); + } + for (int p = 0; p < 2; p++) + for (int l = 0; l < 4; l++) + m_k056832->tilemap_draw(screen, bitmap, cliprect, m_layer_order[l], TILEMAP_DRAW_CATEGORY(p), 0); return 0; } @@ -197,34 +313,19 @@ uint32_t konmedal_state::screen_update_shuriboy(screen_device &screen, bitmap_in { bitmap.fill(0, cliprect); screen.priority().fill(0, cliprect); - m_k052109->tilemap_update(); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 4); - + for (int p = 0; p < 2; p++) + for (int l = 0; l < 3; l++) + m_k052109->tilemap_draw(screen, bitmap, cliprect, m_layer_order[l], TILEMAP_DRAW_CATEGORY(p), 0); return 0; } -uint32_t konmedal_state::screen_update_fuusenpn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0, cliprect); - screen.priority().fill(0, cliprect); - - m_k052109->tilemap_update(); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 4); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1); - - return 0; -} void konmedal_state::konmedal_palette(palette_device &palette) const { uint8_t const *const PROM = memregion("proms")->base(); for (int i = 0; i < 256; i++) { - // this is extremely wrong, see the color test screen palette.set_pen_color(i, (PROM[i]) << 4, (PROM[0x100 + i]) << 4, @@ -232,10 +333,25 @@ void konmedal_state::konmedal_palette(palette_device &palette) const } } -INTERRUPT_GEN_MEMBER(konmedal_state::konmedal_interrupt) +TIMER_DEVICE_CALLBACK_MEMBER(konmedal_state::konmedal_scanline) { - m_maincpu->set_input_line(0, HOLD_LINE); - m_k056832->mark_plane_dirty(3); + int scanline = param; + + // z80 /IRQ is connected to the IRQ1(vblank) pin of k053252 CCU + if (scanline == 255) + { + m_maincpu->set_input_line(0, ASSERT_LINE); + } + + // z80 /NMI is connected to the IRQ2 pin of k053252 CCU + // the following code is emulating INT_TIME of the k053252, this code will go away + // when the new konami branch is merged. + m_ccu_int_time_count--; + if (m_ccu_int_time_count <= 0) + { + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_ccu_int_time_count = m_ccu_int_time; + } } WRITE8_MEMBER(konmedal_state::bankswitch_w) @@ -249,18 +365,19 @@ void konmedal_state::medal_main(address_map &map) { map(0x0000, 0x7fff).rom().region("maincpu", 0); map(0x8000, 0x9fff).bankr("bank1"); - map(0xa000, 0xafff).ram(); // work RAM? - map(0xb800, 0xbfff).ram(); // stack goes here - map(0xc000, 0xc03f).w(m_k056832, FUNC(k056832_device::write)); + map(0xa000, 0xbfff).ram().share("nvram"); // work RAM + map(0xc000, 0xc03f).w(FUNC(konmedal_state::k056832_w)); map(0xc100, 0xc100).w(FUNC(konmedal_state::control2_w)); + map(0xc200, 0xc200).w(FUNC(konmedal_state::medalcnt_w)); + map(0xc300, 0xc300).w(FUNC(konmedal_state::lamps_w)); map(0xc400, 0xc400).w(FUNC(konmedal_state::bankswitch_w)); - map(0xc500, 0xc500).noprw(); // read to reset watchdog + map(0xc500, 0xc500).nopr(); // read to reset watchdog + map(0xc600, 0xc60f).w(FUNC(konmedal_state::k056832_b_w)); map(0xc700, 0xc700).portr("DSW2"); map(0xc701, 0xc701).portr("DSW1"); map(0xc702, 0xc702).portr("IN1"); map(0xc703, 0xc703).portr("IN2"); - map(0xc800, 0xc80f).w(m_k056832, FUNC(k056832_device::b_w)); - map(0xc80f, 0xc80f).r(FUNC(konmedal_state::magic_r)); + map(0xc800, 0xc80f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)); map(0xd000, 0xd001).rw(m_ymz, FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)); map(0xe000, 0xffff).rw(FUNC(konmedal_state::vram_r), FUNC(konmedal_state::vram_w)); } @@ -269,15 +386,19 @@ void konmedal_state::ddboy_main(address_map &map) { map(0x0000, 0x7fff).rom().region("maincpu", 0); map(0x8000, 0x9fff).bankr("bank1"); - map(0xa000, 0xbfff).ram(); // work RAM - map(0xc000, 0xc03f).w(m_k056832, FUNC(k056832_device::write)); + map(0xa000, 0xbfff).ram().share("nvram"); // work RAM + map(0xc000, 0xc03f).w(FUNC(konmedal_state::k056832_w)); map(0xc100, 0xc100).w(FUNC(konmedal_state::control2_w)); + map(0xc200, 0xc200).w(FUNC(konmedal_state::medalcnt_w)); + map(0xc300, 0xc300).w(FUNC(konmedal_state::lamps_w)); map(0xc400, 0xc400).w(FUNC(konmedal_state::bankswitch_w)); - map(0xc500, 0xc500).noprw(); // read to reset watchdog + map(0xc500, 0xc500).nopr(); // read to reset watchdog + map(0xc600, 0xc60f).w(FUNC(konmedal_state::k056832_b_w)); + map(0xc700, 0xc700).portr("DSW1"); + map(0xc701, 0xc701).portr("DSW2"); map(0xc702, 0xc702).portr("IN1"); map(0xc703, 0xc703).portr("IN2"); - map(0xc800, 0xc80f).w(m_k056832, FUNC(k056832_device::b_w)); - map(0xc80f, 0xc80f).r(FUNC(konmedal_state::magic_r)); + map(0xc800, 0xc80f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)); map(0xcc00, 0xcc00).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xd000, 0xd000).nopw(); // ??? writes 00 and 3f every frame map(0xd800, 0xd8ff).m("k051649", FUNC(k051649_device::scc_map)); @@ -287,26 +408,28 @@ void konmedal_state::ddboy_main(address_map &map) void konmedal_state::shuriboy_main(address_map &map) { map(0x0000, 0x7fff).rom().region("maincpu", 0); - map(0x8000, 0x87ff).ram(); + map(0x8000, 0x87ff).ram().share("nvram"); // actual RAM chip is 8Kbyte, might be banked somewhow map(0x8800, 0x8800).portr("IN2"); map(0x8801, 0x8801).portr("IN1"); map(0x8802, 0x8802).portr("DSW1"); map(0x8803, 0x8803).portr("DSW2"); - map(0x8900, 0x8900).nopw(); + map(0x8900, 0x8900).w(FUNC(konmedal_state::control2_w)); + map(0x8a00, 0x8a00).w(FUNC(konmedal_state::medalcnt_w)); map(0x8b00, 0x8b00).nopw(); // watchdog? map(0x8c00, 0x8c00).w(FUNC(konmedal_state::shuri_bank_w)); map(0x8d00, 0x8d00).w(m_upd7759, FUNC(upd7759_device::port_w)); + map(0x8e00, 0x8e00).w(FUNC(konmedal_state::lamps_w)); map(0x9000, 0x9000).nopw(); // writes alternating 00 and 3F map(0x9800, 0x98ff).m("k051649", FUNC(k051649_device::scc_map)); map(0xa000, 0xbfff).bankr("bank1"); map(0xc000, 0xffff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); map(0xdd00, 0xdd00).rw(FUNC(konmedal_state::shuri_irq_r), FUNC(konmedal_state::shuri_irq_w)); - map(0xdd80, 0xdd80).w(FUNC(konmedal_state::shuri_control_w)); + map(0xdc80, 0xdc80).w(FUNC(konmedal_state::mario_scrollhack_w)); } static INPUT_PORTS_START( konmedal ) PORT_START("DSW1") - PORT_DIPNAME( 0x07, 0x00, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPNAME( 0x07, 0x07, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING( 0x00, "5 Coins/2 Credits" ) PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 2C_3C ) ) @@ -332,9 +455,9 @@ static INPUT_PORTS_START( konmedal ) PORT_DIPSETTING( 0x68, "3 Medals" ) PORT_DIPSETTING( 0x70, "2 Medals" ) // PORT_DIPSETTING( 0x78, "2 Medals" ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") // more like debug mode + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_START("DSW2") PORT_DIPNAME( 0x0f, 0x00, "Standard of Payout" ) PORT_DIPLOCATION("SW2:1,2,3,4") @@ -359,7 +482,7 @@ static INPUT_PORTS_START( konmedal ) PORT_DIPSETTING( 0x10, "24 sec" ) PORT_DIPSETTING( 0x20, "18 sec" ) PORT_DIPSETTING( 0x30, "12 sec" ) - PORT_DIPNAME( 0x40, 0x00, "Backup Memory" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPNAME( 0x40, 0x40, "Backup Memory" ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, "Keep" ) PORT_DIPSETTING( 0x00, "Clear" ) PORT_DIPNAME( 0x80, 0x00, "Demo Sound" ) PORT_DIPLOCATION("SW2:8") @@ -369,34 +492,136 @@ static INPUT_PORTS_START( konmedal ) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // medal + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal") PORT_BIT( 0xd0, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused PORT_START("IN2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // medal ack + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) // 10Y + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) // 100Y for medals exchange, not game coin in to play + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused + + PORT_START("OUT") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) INPUT_PORTS_END +static INPUT_PORTS_START( ddboy ) + PORT_INCLUDE( konmedal ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x30, 0x00, "Play Timer" ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x00, "18 sec" ) + PORT_DIPSETTING( 0x10, "15 sec" ) + PORT_DIPSETTING( 0x20, "12 sec" ) + PORT_DIPSETTING( 0x30, "10 sec" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( shuriboy ) + PORT_INCLUDE( konmedal ) + + PORT_MODIFY("IN1") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("upd", upd7759_device, busy_r) + + PORT_MODIFY("OUT") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("upd", upd7759_device, reset_w) // this should be called 1st, but it's not + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("upd", upd7759_device, start_w) +INPUT_PORTS_END + +static INPUT_PORTS_START( fuusenpn ) + PORT_INCLUDE( shuriboy ) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x07, 0x07, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING( 0x00, "5 Coins/0 Credits" ) + PORT_DIPSETTING( 0x01, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x04, "3 Coins/0 Credits" ) + PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( mario ) + PORT_INCLUDE( shuriboy ) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x07, 0x07, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING( 0x00, "5 Coins/2 Credits" ) + PORT_DIPSETTING( 0x01, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x04, "3 Coins/0 Credits" ) + PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) + PORT_DIPNAME( 0x38, 0x38, "Coin Slot 2" ) PORT_DIPLOCATION("SW1:4,5,6") + PORT_DIPSETTING( 0x00, "4 Medals" ) + PORT_DIPSETTING( 0x08, "5 Medals" ) + PORT_DIPSETTING( 0x10, "6 Medals" ) + PORT_DIPSETTING( 0x18, "8 Medals" ) + PORT_DIPSETTING( 0x20, "10 Medals" ) + PORT_DIPSETTING( 0x28, "11 Medals" ) + PORT_DIPSETTING( 0x30, "12 Medals" ) + PORT_DIPSETTING( 0x38, "15 Medals" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x07, 0x00, "Standard of Payout" ) PORT_DIPLOCATION("SW2:1,2,3") + PORT_DIPSETTING( 0x00, "90%" ) + PORT_DIPSETTING( 0x01, "80%" ) + PORT_DIPSETTING( 0x02, "70%" ) + PORT_DIPSETTING( 0x03, "60%" ) + PORT_DIPSETTING( 0x04, "50%" ) + PORT_DIPSETTING( 0x05, "40%" ) + PORT_DIPSETTING( 0x06, "30%" ) + PORT_DIPSETTING( 0x07, "20%" ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPNAME( 0x20, 0x20, "Play Timer" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x00, "15 sec" ) + PORT_DIPSETTING( 0x20, "20 sec" ) +INPUT_PORTS_END + + +void konmedal_state::machine_start_common() +{ + m_lamps.resolve(); + save_item(NAME(m_control)); + save_item(NAME(m_control2)); + save_item(NAME(m_shuri_irq)); + save_item(NAME(m_ccu_int_time)); + save_item(NAME(m_ccu_int_time_count)); +} + void konmedal_state::machine_start() { + machine_start_common(); membank("bank1")->configure_entries(0, 0x10, memregion("maincpu")->base(), 0x2000); membank("bank1")->set_entry(4); } MACHINE_START_MEMBER(konmedal_state, shuriboy) { + machine_start_common(); membank("bank1")->configure_entries(0, 0x8, memregion("maincpu")->base()+0x8000, 0x2000); membank("bank1")->set_entry(0); } void konmedal_state::machine_reset() { - m_vrom_base = 0; m_control = m_control2 = m_shuri_irq = 0; + m_ccu_int_time_count = 0; + m_ccu_int_time = 31; + m_avac = 0; } void konmedal_state::tsukande(machine_config &config) @@ -404,7 +629,17 @@ void konmedal_state::tsukande(machine_config &config) /* basic machine hardware */ Z80(config, m_maincpu, XTAL(14'318'181)/2); // z84c0008pec 8mhz part, 14.31818Mhz xtal verified on PCB, divisor unknown m_maincpu->set_addrmap(AS_PROGRAM, &konmedal_state::medal_main); - m_maincpu->set_vblank_int("screen", FUNC(konmedal_state::konmedal_interrupt)); + TIMER(config, "scantimer").configure_scanline(FUNC(konmedal_state::konmedal_scanline), "screen", 0, 1); + + NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); + m_nvram->set_custom_handler(FUNC(konmedal_state::medal_nvram_init));; + HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + + K053252(config, m_k053252, XTAL(14'318'181) / 2); // not verified + m_k053252->int1_ack().set(FUNC(konmedal_state::vbl_ack_w)); + m_k053252->int2_ack().set(FUNC(konmedal_state::nmi_ack_w)); + m_k053252->int_time().set(FUNC(konmedal_state::ccu_int_time_w)); + m_k053252->set_offsets(32, 16); // not accurate /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -437,7 +672,17 @@ void konmedal_state::ddboy(machine_config &config) /* basic machine hardware */ Z80(config, m_maincpu, XTAL(14'318'181)/2); // z84c0008pec 8mhz part, 14.31818Mhz xtal verified on PCB, divisor unknown m_maincpu->set_addrmap(AS_PROGRAM, &konmedal_state::ddboy_main); - m_maincpu->set_vblank_int("screen", FUNC(konmedal_state::konmedal_interrupt)); + TIMER(config, "scantimer").configure_scanline(FUNC(konmedal_state::konmedal_scanline), "screen", 0, 1); + + NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); + m_nvram->set_custom_handler(FUNC(konmedal_state::medal_nvram_init));; + HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + + K053252(config, m_k053252, XTAL(14'318'181) / 2); // not verified + m_k053252->int1_ack().set(FUNC(konmedal_state::vbl_ack_w)); + m_k053252->int2_ack().set(FUNC(konmedal_state::nmi_ack_w)); + m_k053252->int_time().set(FUNC(konmedal_state::ccu_int_time_w)); + m_k053252->set_offsets(32, 16); // not accurate /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -477,28 +722,49 @@ Other custom chip: 051550 Dips: 2 x 8 dips bank */ -K052109_CB_MEMBER(konmedal_state::shuriboy_tile_callback) +void konmedal_state::shuri_init() { - *code |= ((*color & 0xc) << 6) | (bank << 10); - if (*color & 0x2) *code |= 0x1000; - *flags = (*color & 0x1) ? TILE_FLIPX : 0; - u8 col = *color; - *color = (col >> 4); - if (layer > 0) *color |= 8; + m_layer_colorbase[0] = 0; + m_layer_colorbase[1] = 8; + m_layer_colorbase[2] = 8; + + m_layer_order[0] = 2; + m_layer_order[1] = 1; + m_layer_order[2] = 0; } +void konmedal_state::fuusen_init() +{ + m_layer_colorbase[0] = 0; + m_layer_colorbase[1] = 8; + m_layer_colorbase[2] = 8; + + m_layer_order[0] = 0; + m_layer_order[1] = 2; + m_layer_order[2] = 1; +} +void konmedal_state::mario_init() +{ + m_layer_colorbase[0] = 0; + m_layer_colorbase[1] = 8; + m_layer_colorbase[2] = 8; -K052109_CB_MEMBER(konmedal_state::fuusenpn_tile_callback) + m_layer_order[0] = 0; + m_layer_order[1] = 1; + m_layer_order[2] = 2; +} + +K052109_CB_MEMBER(konmedal_state::shuriboy_tile_callback) { *code |= ((*color & 0xc) << 6) | (bank << 10); if (*color & 0x2) *code |= 0x1000; *flags = (*color & 0x1) ? TILE_FLIPX : 0; - u8 col = *color; - *color = (col >> 4); - *color |= 8; + *priority = BIT(*color, 4); + *color = m_layer_colorbase[layer] + ((*color >> 5) & 7); } WRITE8_MEMBER(konmedal_state::shuri_bank_w) { + m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); membank("bank1")->set_entry(data&0x3); } @@ -521,7 +787,7 @@ WRITE8_MEMBER(konmedal_state::shuri_irq_w) m_shuri_irq = data; } -TIMER_DEVICE_CALLBACK_MEMBER(konmedal_state::scanline) +TIMER_DEVICE_CALLBACK_MEMBER(konmedal_state::shuri_scanline) { int scanline = param; @@ -537,11 +803,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(konmedal_state::scanline) } } -WRITE8_MEMBER(konmedal_state::shuri_control_w) +WRITE8_MEMBER(konmedal_state::mario_scrollhack_w) { - m_control = data; - m_k052109->set_rmrd_line((m_control & 0x10) ? ASSERT_LINE : CLEAR_LINE); - m_k052109->write(offset+0x1d80, data); + // Mario Roulette enable X and Y scroll in the same time for both layers, which is currently not supported by emulated K052109. + // here we hacky disable Y scroll for layer A and X scroll for layer B. + if (data == 0x36) + data = 0x22; + m_k052109->write(0x1c80, data); } void konmedal_state::shuriboy(machine_config &config) @@ -549,14 +817,18 @@ void konmedal_state::shuriboy(machine_config &config) /* basic machine hardware */ Z80(config, m_maincpu, XTAL(24'000'000) / 3); // divisor unknown m_maincpu->set_addrmap(AS_PROGRAM, &konmedal_state::shuriboy_main); - TIMER(config, "scantimer").configure_scanline(FUNC(konmedal_state::scanline), "screen", 0, 1); + TIMER(config, "scantimer").configure_scanline(FUNC(konmedal_state::shuri_scanline), "screen", 0, 1); + + NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); + m_nvram->set_custom_handler(FUNC(konmedal_state::shuriboy_nvram_init));; + HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // everything not verified, just a placeholder screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(30)); screen.set_size(64*8, 32*8); - screen.set_visarea(96, 416-1, 16, 240-1); + screen.set_visarea(112, 400-1, 16, 240-1); screen.set_screen_update(FUNC(konmedal_state::screen_update_shuriboy)); screen.set_palette(m_palette); @@ -576,22 +848,61 @@ void konmedal_state::shuriboy(machine_config &config) K051649(config, "k051649", XTAL(24'000'000) / 12).add_route(ALL_OUTPUTS, "mono", 0.45); // divisor unknown - UPD7759(config, m_upd7759); + UPD7759(config, m_upd7759, XTAL(640'000)).add_route(ALL_OUTPUTS, "mono", 0.60); } void konmedal_state::fuusenpn(machine_config &config) { shuriboy(config); + m_nvram->set_custom_handler(FUNC(konmedal_state::fuusenpn_nvram_init)); +} - screen_device &screen(SCREEN(config.replace(), "screen", SCREEN_TYPE_RASTER)); // everything not verified, just a placeholder - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(30)); - screen.set_size(64*8, 32*8); - screen.set_visarea(96, 416-1, 16, 240-1); - screen.set_screen_update(FUNC(konmedal_state::screen_update_fuusenpn)); - screen.set_palette(m_palette); +void konmedal_state::mariorou(machine_config &config) +{ + shuriboy(config); + m_nvram->set_custom_handler(FUNC(konmedal_state::mario_nvram_init)); +} + +void konmedal_state::medal_nvram_init(nvram_device &nvram, void *base, size_t size) +{ + memset(base, 0x00, size); + u8 *ram = (u8*)base; + ram[0x303] = 0xff; + ram[0x309] = 0xaa; +} + +void konmedal_state::shuriboy_nvram_init(nvram_device &nvram, void *base, size_t size) +{ + memset(base, 0x00, size); + u8 *ram = (u8*)base; + ram[0x08] = 0x01; + ram[0x09] = 0x02; + ram[0x0e] = 0x04; + ram[0x17] = 0x08; + ram[0x18] = 0x10; + ram[0x21] = 0x20; + ram[0x50] = 0x40; + ram[0x52] = 0x80; + ram[0x53] = 0x55; + ram[0x54] = 0xaa; + ram[0x5d] = 0x33; +} + +void konmedal_state::fuusenpn_nvram_init(nvram_device &nvram, void *base, size_t size) +{ + memset(base, 0x00, size); + u8 *ram = (u8*)base; + ram[0x203] = 0xff; + ram[0x209] = 0xaa; +} - m_k052109->set_tile_callback(FUNC(konmedal_state::fuusenpn_tile_callback)); +void konmedal_state::mario_nvram_init(nvram_device &nvram, void *base, size_t size) +{ + memset(base, 0x00, size); + u8 *ram = (u8*)base; + ram[0x502] = 0xff; + ram[0x506] = 0xaa; + ram[0x508] = 0x55; } ROM_START( tsukande ) @@ -654,7 +965,7 @@ ROM_START( ddboya ) ROM_LOAD32_BYTE( "342_a05.27c010.4h", 0x000000, 0x020000, CRC(e7e50901) SHA1(5e01377a3ad8ccb2a2b56610e8225b9b6bf15122) ) ROM_LOAD32_BYTE( "342_a06.27c010.4j", 0x000001, 0x020000, CRC(49f35d66) SHA1(3d5cf3b6eb6a3497609117acd002169a31130418) ) - ROM_REGION( 0x100000, "oki", 0 ) + ROM_REGION( 0x100000, "ymz", 0 ) ROM_LOAD( "342-a11-10d-=s1=.bin", 0x000000, 0x080000, CRC(b523bced) SHA1(87a814035af4dcf24454667d4346d301303d697e) ) ROM_LOAD( "342-a12-10e-=s2=.bin", 0x080000, 0x080000, CRC(6febafe7) SHA1(69e550dd067f326b4d20a859345f193b43a5af99) ) @@ -679,21 +990,21 @@ ROM_START( buttobi ) ROM_LOAD32_BYTE( "440-a05-4h.bin", 0x000000, 0x020000, CRC(11d3ec99) SHA1(4bc267fa58ba1dd83e1d43b0e981b9e65d688042) ) ROM_LOAD32_BYTE( "440-a06-4j.bin", 0x000001, 0x020000, CRC(f915c517) SHA1(26128fcdf9947efd7959deddb52575088fa492d4) ) - // temporarily borrowed from tsukande while the PROMs get dumped from this PCB ROM_REGION( 0x400, "proms", 0 ) // R (440a07.13f) - ROM_LOAD( "441a07.20k", 0x000000, 0x000100, BAD_DUMP CRC(7d0c53c2) SHA1(f357e0cb3d53374208ad1670e70be03b399a4c02) ) + ROM_LOAD( "440a07.13f", 0x000000, 0x000100, CRC(6ebce405) SHA1(778be32bf3cbc34014122d60c640979947d380ae) ) // G (440a08.14f) - ROM_LOAD( "441a08.21k", 0x000100, 0x000100, BAD_DUMP CRC(e2c3e853) SHA1(36a3008dde714ade53b9a01ac9d94c6cc655c293) ) + ROM_LOAD( "440a08.14f", 0x000100, 0x000100, CRC(7b36a53c) SHA1(021ff79289848e094dc3b23b7f0b1cc0e9fe55a6) ) // B (440a09.15f) - ROM_LOAD( "441a09.23k", 0x000200, 0x000100, BAD_DUMP CRC(3daca33a) SHA1(38644f574beaa593f3348b49eabea9e03d722013) ) + ROM_LOAD( "440a09.15f", 0x000200, 0x000100, CRC(2e4c9051) SHA1(ba5d3d96749ec8ae65595dba46dad6f2b1f8953e) ) // P(riority?) (440a10.14g) - ROM_LOAD( "441a10.21m", 0x000300, 0x000100, BAD_DUMP CRC(063722ff) SHA1(7ba43acfdccb02e7913dc000c4f9c57c54b1315f) ) + ROM_LOAD( "440a10.14g", 0x000300, 0x000100, CRC(c2739e08) SHA1(c409ddc94f80a185e9e382762126d3ae551bf414) ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "440-a01-8b.bin", 0x000000, 0x040000, CRC(955b1bd5) SHA1(1e8130a3634972d742ba4ad103e1738e44a4e28c) ) ROM_END + ROM_START( shuriboy ) ROM_REGION( 0x10000, "maincpu", 0 ) /* main program */ ROM_LOAD( "gs-341-b01.13g", 0x000000, 0x010000, CRC(3c0f36b6) SHA1(1d3838f45969228a8b2054cd5baf8892db68b644) ) @@ -733,10 +1044,36 @@ ROM_START( fuusenpn ) ROM_LOAD( "241a09.bin", 0x000200, 0x000100, CRC(79bd3e49) SHA1(ff94856d11acfba364f2d05ca955c10fbc02e265) ) ROM_LOAD( "241a10.bin", 0x000300, 0x000100, CRC(f7e3d8ee) SHA1(89c505873c884f9e1ec0cb113a3557d3f67943b9) ) ROM_END -GAME( 1994, buttobi, 0, ddboy, konmedal, konmedal_state, empty_init, ROT0, "Konami", "Buttobi Striker", MACHINE_NOT_WORKING) -GAME( 1995, tsukande, 0, tsukande, konmedal, konmedal_state, empty_init, ROT0, "Konami", "Tsukande Toru Chicchi", MACHINE_NOT_WORKING) -GAME( 1995, ddboy, 0, ddboy, konmedal, konmedal_state, empty_init, ROT0, "Konami", "Dam Dam Boy (on dedicated PCB)", MACHINE_NOT_WORKING) -GAME( 1995, ddboya, ddboy, ddboy, konmedal, konmedal_state, empty_init, ROT0, "Konami", "Dam Dam Boy (on Tsukande Toru Chicchi PCB)", MACHINE_NOT_WORKING) -GAME( 1993, shuriboy, 0, shuriboy, konmedal, konmedal_state, empty_init, ROT0, "Konami", "Shuriken Boy", MACHINE_NOT_WORKING) -GAME( 1993, fuusenpn, 0, fuusenpn, konmedal, konmedal_state, empty_init, ROT0, "Konami", "Fuusen Pentai", MACHINE_NOT_WORKING) +ROM_START( mariorou ) + ROM_REGION( 0x10000, "maincpu", 0 ) /* main program */ + ROM_LOAD( "111_d01.3g.27c512", 0x000000, 0x010000, CRC(96e075c1) SHA1(ca8170e1756c7c4610680f5c5a95020ea34fd1f5) ) + + ROM_REGION( 0x40000, "k052109", 0 ) /* tilemaps */ + ROM_LOAD32_BYTE( "111_c03.2h.27c256", 0x000000, 0x008000, CRC(b4e769ba) SHA1(5af1aa7768daa7cc844d64cfd13c8d81d801fc70) ) + ROM_LOAD32_BYTE( "111_c04.4h.27c256", 0x000001, 0x008000, CRC(c6081712) SHA1(308df4824e884cb7d1febd34d85b1c1b9f494166) ) + ROM_LOAD32_BYTE( "111_c05.5h.27c256", 0x000002, 0x008000, CRC(83eec257) SHA1(fcd0ff5050ef13f3a6d3a1d12c24f16ef6b4d25d) ) + ROM_LOAD32_BYTE( "111_c06.7h.27c256", 0x000003, 0x008000, CRC(d71554e9) SHA1(e388e705f2fd84d98f84d7b843ded5c509f05796) ) + + ROM_REGION( 0x200000, "upd", 0 ) + ROM_LOAD( "111_c02.13c.27c010", 0x000000, 0x020000, CRC(e42ba2d7) SHA1(4520353aa60c9ced87d94ef338903e08dff9f4cc) ) + + ROM_REGION( 0x400, "proms", ROMREGION_ERASE00 ) // am27s21apc + ROM_LOAD( "111_c07.2d.82s129", 0x000000, 0x000100, CRC(89bc3e83) SHA1(4089430cd48009ab1711a00ace81a5823cfafba6) ) + ROM_LOAD( "111_c08.3d.82s129", 0x000100, 0x000100, CRC(f9f7dfa8) SHA1(e502c7c554e3add5d27645ea3bddbe2339c93f7a) ) + ROM_LOAD( "111_c09.4d.82s129", 0x000200, 0x000100, CRC(879b796b) SHA1(f41d48013f0d55e7de4e40dc00dd30482946c14c) ) + ROM_LOAD( "111_a10.3e.82s129", 0x000300, 0x000100, CRC(07ffc2ed) SHA1(37955d1788a86b90439233bb098c59b191056f68) ) +ROM_END + +// Konami PWB 452093A boards (TMNT tilemaps) +GAME( 1991, mariorou, 0, mariorou, mario, konmedal_state, mario_init, ROT0, "Konami", "Mario Roulette", MACHINE_SUPPORTS_SAVE) +GAME( 1993, shuriboy, 0, shuriboy, shuriboy, konmedal_state, shuri_init, ROT0, "Konami", "Shuriken Boy", MACHINE_SUPPORTS_SAVE) +GAME( 1993, fuusenpn, 0, fuusenpn, fuusenpn, konmedal_state, fuusen_init, ROT0, "Konami", "Fuusen Pentai", MACHINE_SUPPORTS_SAVE) + +// Konami PWB 452574A boards (GX tilemaps) +GAME( 1994, buttobi, 0, ddboy, ddboy, konmedal_state, buttobi_init, ROT0, "Konami", "Buttobi Striker", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) +GAME( 1994, ddboy, 0, ddboy, ddboy, konmedal_state, ddboy_init, ROT0, "Konami", "Dam Dam Boy (on dedicated PCB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) + +// Konami PWB 402218 boards (GX tilemaps) +GAME( 1994, ddboya, ddboy, tsukande, ddboy, konmedal_state, ddboy_init, ROT0, "Konami", "Dam Dam Boy (on Tsukande Toru Chicchi PCB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) +GAME( 1995, tsukande, 0, tsukande, konmedal, konmedal_state, tsuka_init, ROT0, "Konami", "Tsukande Toru Chicchi", MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/drivers/konmedal68k.cpp b/src/mame/drivers/konmedal68k.cpp index b4f128eaae9..a69d77c2586 100644 --- a/src/mame/drivers/konmedal68k.cpp +++ b/src/mame/drivers/konmedal68k.cpp @@ -24,7 +24,9 @@ #include "cpu/m68000/m68000.h" #include "machine/eepromser.h" #include "machine/gen_latch.h" +#include "machine/nvram.h" #include "machine/timer.h" +#include "machine/ticket.h" #include "sound/ymz280b.h" #include "video/k054156_k054157_k056832.h" #include "video/k055555.h" @@ -204,11 +206,12 @@ uint32_t konmedal68k_state::screen_update_konmedal68k(screen_device &screen, bit void konmedal68k_state::kzaurus_main(address_map &map) { map(0x000000, 0x07ffff).rom().region("maincpu", 0); - map(0x400000, 0x403fff).ram(); + map(0x400000, 0x403fff).ram().share("nvram"); map(0x800000, 0x800001).w(FUNC(konmedal68k_state::control_w)); map(0x800004, 0x800005).portr("DSW"); map(0x800006, 0x800007).portr("IN1"); map(0x800008, 0x800009).portr("IN0"); + map(0x820000, 0x820001).portw("OUT"); map(0x810000, 0x810001).w(FUNC(konmedal68k_state::control2_w)); map(0x830000, 0x83003f).rw(m_k056832, FUNC(k056832_device::word_r), FUNC(k056832_device::word_w)); map(0x840000, 0x84000f).w(m_k056832, FUNC(k056832_device::b_word_w)); @@ -224,12 +227,13 @@ void konmedal68k_state::kzaurus_main(address_map &map) void konmedal68k_state::koropens_main(address_map &map) { map(0x000000, 0x07ffff).rom().region("maincpu", 0); - map(0x400000, 0x403fff).ram(); + map(0x400000, 0x403fff).ram().share("nvram"); map(0x800000, 0x800001).w(FUNC(konmedal68k_state::control_w)); map(0x800004, 0x800005).portr("DSW"); map(0x800006, 0x800007).portr("IN1"); map(0x800008, 0x800009).portr("IN0"); map(0x810000, 0x810001).w(FUNC(konmedal68k_state::control2_w)); + map(0x820000, 0x820001).portw("OUT"); map(0x830000, 0x83003f).rw(m_k056832, FUNC(k056832_device::word_r), FUNC(k056832_device::word_w)); map(0x840000, 0x84000f).w(m_k056832, FUNC(k056832_device::b_word_w)); map(0x85001c, 0x85001f).nopw(); @@ -249,14 +253,17 @@ static INPUT_PORTS_START( kzaurus ) PORT_BIT( 0xff1f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) // medal ack + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN3 ) // medal PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0xf0ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_START("OUT") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) + PORT_START("DSW") - PORT_DIPNAME( 0x07, 0x00, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPNAME( 0x07, 0x07, "Coin Slot 1" ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING( 0x00, "5 Coins/2 Credits" ) PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 2C_3C ) ) @@ -282,9 +289,9 @@ static INPUT_PORTS_START( kzaurus ) PORT_DIPSETTING( 0x68, "3 Medals" ) PORT_DIPSETTING( 0x70, "2 Medals" ) // PORT_DIPSETTING( 0x78, "2 Medals" ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPNAME( 0x0f00, 0x0000, "Standard of Payout" ) PORT_DIPLOCATION("SW2:1,2,3,4") PORT_DIPSETTING( 0x0000, "90%" ) @@ -331,6 +338,8 @@ void konmedal68k_state::kzaurus(machine_config &config) M68000(config, m_maincpu, XTAL(33'868'800)/4); // 33.8688 MHz crystal verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &konmedal68k_state::kzaurus_main); TIMER(config, "scantimer").configure_scanline(FUNC(konmedal68k_state::scanline), "screen", 0, 1); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -433,8 +442,8 @@ ROM_START( kattobas ) ROM_LOAD( "841-a02-4f.bin", 0x080000, 0x080000, CRC(685c1c10) SHA1(9884940df8c079e8129fc8d870f90e5b7987e6f4) ) ROM_END -GAME( 1995, kzaurus, 0, kzaurus, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Pittanko Zaurus", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, koropens, 0, koropens, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Korokoro Pensuke", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1998, kattobas, 0, koropens, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Kattobase Power Pro Kun", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1995, kzaurus, 0, kzaurus, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Pittanko Zaurus", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, koropens, 0, koropens, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Korokoro Pensuke", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1998, kattobas, 0, koropens, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Kattobase Power Pro Kun", MACHINE_IMPERFECT_GRAPHICS ) GAME( 1999, pwrchanc, 0, koropens, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Powerful Chance", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1999, ymcapsul, 0, kzaurus, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Yu-Gi-Oh Monster Capsule", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1999, ymcapsul, 0, kzaurus, kzaurus, konmedal68k_state, empty_init, ROT0, "Konami", "Yu-Gi-Oh Monster Capsule", MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/kungfur.cpp b/src/mame/drivers/kungfur.cpp index 3d99a7bef00..d747812eb9f 100644 --- a/src/mame/drivers/kungfur.cpp +++ b/src/mame/drivers/kungfur.cpp @@ -22,6 +22,9 @@ http://www.wshin.com/games/review/ka/kung-fu-roushi.htm http://www.youtube.com/watch?v=ssEfw-RbSjs http://www.youtube.com/watch?v=1YacVjpUG8g +TODO: +- verify XTAL and CPU type(small chance it's an "E") + --------------------------------------------------------------------------- Game Panel: @@ -54,74 +57,102 @@ menkyokaiden(full certification) The 4 buttons are labeled: mae(forward), migi(right), ushiro(back), hidari(left) - ***************************************************************************/ #include "emu.h" + #include "cpu/m6809/m6809.h" #include "machine/i8255.h" #include "sound/msm5205.h" + #include "speaker.h" +// internal artwork #include "kungfur.lh" +namespace { + class kungfur_state : public driver_device { public: kungfur_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_adpcm1(*this, "adpcm1"), - m_adpcm2(*this, "adpcm2"), + m_ppi(*this, "ppi%u", 0), + m_adpcm(*this, "adpcm%u", 0), + m_adpcm_region(*this, "adpcm%u", 0), m_digits(*this, "digit%u", 0U), m_lamps(*this, "lamp%u", 0U) { } + // machine configs void kungfur(machine_config &config); -private: - DECLARE_WRITE8_MEMBER(kungfur_output_w); - DECLARE_WRITE8_MEMBER(kungfur_latch1_w); - DECLARE_WRITE8_MEMBER(kungfur_latch2_w); - DECLARE_WRITE8_MEMBER(kungfur_latch3_w); - DECLARE_WRITE8_MEMBER(kungfur_control_w); - DECLARE_WRITE8_MEMBER(kungfur_adpcm1_w); - DECLARE_WRITE8_MEMBER(kungfur_adpcm2_w); - INTERRUPT_GEN_MEMBER(kungfur_irq); - DECLARE_WRITE_LINE_MEMBER(kfr_adpcm1_int); - DECLARE_WRITE_LINE_MEMBER(kfr_adpcm2_int); - void kungfur_map(address_map &map); - - uint8_t m_latch[3]; - uint8_t m_control; - uint32_t m_adpcm_pos[2]; - uint8_t m_adpcm_data[2]; - uint8_t m_adpcm_sel[2]; +protected: virtual void machine_start() override; virtual void machine_reset() override; + +private: + // devices/pointers required_device<cpu_device> m_maincpu; - required_device<msm5205_device> m_adpcm1; - required_device<msm5205_device> m_adpcm2; + required_device_array<i8255_device, 2> m_ppi; + required_device_array<msm5205_device, 2> m_adpcm; + required_memory_region_array<2> m_adpcm_region; output_finder<14> m_digits; output_finder<8> m_lamps; + + // address maps + void main_map(address_map &map); + + // I/O handlers + INTERRUPT_GEN_MEMBER(interrupt); + DECLARE_WRITE8_MEMBER(output_w); + DECLARE_WRITE8_MEMBER(control_w); + template<int N> DECLARE_WRITE8_MEMBER(digit_data_w) { m_digit_data[N] = data; } + template<int N> DECLARE_WRITE8_MEMBER(adpcm_data_w) { m_adpcm_data[N] = data; } + template<int N> DECLARE_WRITE_LINE_MEMBER(adpcm_int); + + u8 m_control = 0; + u8 m_digit_data[3] = { 0, 0, 0 }; + + u32 m_adpcm_pos[2] = { 0, 0 }; + u8 m_adpcm_data[2] = { 0, 0 }; + u8 m_adpcm_sel[2] = { 0, 0 }; }; +void kungfur_state::machine_start() +{ + m_digits.resolve(); + m_lamps.resolve(); + + // register for savestates + save_item(NAME(m_control)); + save_item(NAME(m_digit_data)); + + save_item(NAME(m_adpcm_pos)); + save_item(NAME(m_adpcm_data)); + save_item(NAME(m_adpcm_sel)); +} -INTERRUPT_GEN_MEMBER(kungfur_state::kungfur_irq) +void kungfur_state::machine_reset() { - if (m_control & 0x10) - device.execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); + m_control = 0; } -/*************************************************************************** - I/O +/****************************************************************************** + I/O +******************************************************************************/ -***************************************************************************/ +INTERRUPT_GEN_MEMBER(kungfur_state::interrupt) +{ + if (m_control & 0x10) + device.execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); +} -WRITE8_MEMBER(kungfur_state::kungfur_output_w) +WRITE8_MEMBER(kungfur_state::output_w) { // d0-d2: output led7seg static const u8 lut_digits[24] = @@ -134,14 +165,14 @@ WRITE8_MEMBER(kungfur_state::kungfur_output_w) { u8 offs = i << 3 | (data & 7); if (lut_digits[offs]) - m_digits[lut_digits[offs] - 1] = m_latch[i]; + m_digits[lut_digits[offs] - 1] = m_digit_data[i]; } // 2.6 goes to level lamps if ((data & 7) == 6) { for (u8 i = 0; i < 5; i++) - m_lamps[i] = BIT(m_latch[2], i); + m_lamps[i] = BIT(m_digit_data[2], i); } // d7: game-over lamp, d3-d4: marquee lamps @@ -154,98 +185,62 @@ WRITE8_MEMBER(kungfur_state::kungfur_output_w) machine().bookkeeping().coin_counter_w(0, data & 0x40); } - -// lamp output latches -WRITE8_MEMBER(kungfur_state::kungfur_latch1_w) -{ - m_latch[0] = data; -} - -WRITE8_MEMBER(kungfur_state::kungfur_latch2_w) -{ - m_latch[1] = data; -} - -WRITE8_MEMBER(kungfur_state::kungfur_latch3_w) -{ - m_latch[2] = data; -} - - -WRITE8_MEMBER(kungfur_state::kungfur_control_w) +WRITE8_MEMBER(kungfur_state::control_w) { // d0-d3: N/C // d4: irq ack if (~data & 0x10) m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); - // d5: ? + // d5: watchdog reset? + // d6-d7: sound trigger (edge) - if ((data ^ m_control) & 0x40) - { - m_adpcm1->reset_w(BIT(data, 6)); - m_adpcm_pos[0] = m_adpcm_data[0] * 0x400; - m_adpcm_sel[0] = 0; - } - if ((data ^ m_control) & 0x80) - { - m_adpcm2->reset_w(BIT(data, 7)); - m_adpcm_pos[1] = m_adpcm_data[1] * 0x400; - m_adpcm_sel[1] = 0; - } + for (int i = 0; i < 2; i++) + if (BIT(data ^ m_control, i + 6)) + { + m_adpcm[i]->reset_w(BIT(data, i + 6)); + m_adpcm_pos[i] = m_adpcm_data[i] * 0x400; + m_adpcm_sel[i] = 0; + } m_control = data; } -// adpcm latches -WRITE8_MEMBER(kungfur_state::kungfur_adpcm1_w) +template<int N> +WRITE_LINE_MEMBER(kungfur_state::adpcm_int) { - m_adpcm_data[0] = data; -} + if (!state) + return; -WRITE8_MEMBER(kungfur_state::kungfur_adpcm2_w) -{ - m_adpcm_data[1] = data; -} + u8 *ROM = m_adpcm_region[N]->base(); + u8 data = ROM[m_adpcm_pos[N] & (m_adpcm_region[N]->bytes() - 1)]; -// adpcm callbacks -WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm1_int) -{ - uint8_t *ROM = memregion("adpcm1")->base(); - uint8_t data = ROM[m_adpcm_pos[0] & 0x1ffff]; - - m_adpcm1->write_data(m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf); - m_adpcm_pos[0] += m_adpcm_sel[0]; - m_adpcm_sel[0] ^= 1; + m_adpcm[N]->write_data(m_adpcm_sel[N] ? data & 0xf : data >> 4 & 0xf); + m_adpcm_pos[N] += m_adpcm_sel[N]; + m_adpcm_sel[N] ^= 1; } -WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm2_int) -{ - uint8_t *ROM = memregion("adpcm2")->base(); - uint8_t data = ROM[m_adpcm_pos[1] & 0x3ffff]; - m_adpcm2->write_data(m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf); - m_adpcm_pos[1] += m_adpcm_sel[1]; - m_adpcm_sel[1] ^= 1; -} +/****************************************************************************** + Address Maps +******************************************************************************/ -void kungfur_state::kungfur_map(address_map &map) +void kungfur_state::main_map(address_map &map) { map(0x0000, 0x07ff).ram(); - map(0x4000, 0x4000).w(FUNC(kungfur_state::kungfur_adpcm1_w)); - map(0x4004, 0x4004).w(FUNC(kungfur_state::kungfur_adpcm2_w)); - map(0x4008, 0x400b).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x400c, 0x400f).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x4000, 0x4000).w(FUNC(kungfur_state::adpcm_data_w<0>)); + map(0x4004, 0x4004).w(FUNC(kungfur_state::adpcm_data_w<1>)); + map(0x4008, 0x400b).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x400c, 0x400f).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0xc000, 0xffff).rom(); } -/*************************************************************************** - - Inputs -***************************************************************************/ +/****************************************************************************** + Input Ports +******************************************************************************/ static INPUT_PORTS_START( kungfur ) PORT_START("IN0") @@ -273,85 +268,75 @@ static INPUT_PORTS_START( kungfur ) INPUT_PORTS_END -/*************************************************************************** - Machine Config +/****************************************************************************** + Machine Configs +******************************************************************************/ -***************************************************************************/ - -void kungfur_state::machine_start() +void kungfur_state::kungfur(machine_config &config) { - m_digits.resolve(); - m_lamps.resolve(); + /* basic machine hardware */ + MC6809(config, m_maincpu, 4000000); // 4MHz? + m_maincpu->set_addrmap(AS_PROGRAM, &kungfur_state::main_map); - save_item(NAME(m_control)); - save_item(NAME(m_latch)); + const attotime irq_period = attotime::from_hz(4000000 / 0x1000); // = 976.5Hz, accurate + m_maincpu->set_periodic_int(FUNC(kungfur_state::interrupt), irq_period); - save_item(NAME(m_adpcm_pos)); - save_item(NAME(m_adpcm_data)); - save_item(NAME(m_adpcm_sel)); -} + I8255(config, m_ppi[0]); // $4008 - always $83 (PPI mode 0, ports B & lower C as input) + m_ppi[0]->out_pa_callback().set(FUNC(kungfur_state::output_w)); + m_ppi[0]->tri_pa_callback().set_constant(0); + m_ppi[0]->in_pb_callback().set_ioport("IN0"); + m_ppi[0]->in_pc_callback().set_ioport("IN1"); + m_ppi[0]->out_pc_callback().set(FUNC(kungfur_state::control_w)); -void kungfur_state::machine_reset() -{ - m_control = 0; -} - -void kungfur_state::kungfur(machine_config &config) -{ - /* basic machine hardware */ - M6809(config, m_maincpu, 8000000/2); // 4MHz? - m_maincpu->set_addrmap(AS_PROGRAM, &kungfur_state::kungfur_map); - m_maincpu->set_periodic_int(FUNC(kungfur_state::kungfur_irq), attotime::from_hz(8000000/2 / 0x1000)); - - i8255_device &ppi0(I8255A(config, "ppi8255_0")); - // $4008 - always $83 (PPI mode 0, ports B & lower C as input) - ppi0.out_pa_callback().set(FUNC(kungfur_state::kungfur_output_w)); - ppi0.in_pb_callback().set_ioport("IN0"); - ppi0.in_pc_callback().set_ioport("IN1"); - ppi0.out_pc_callback().set(FUNC(kungfur_state::kungfur_control_w)); - - i8255_device &ppi1(I8255A(config, "ppi8255_1")); - // $400c - always $80 (PPI mode 0, all ports as output) - ppi1.out_pa_callback().set(FUNC(kungfur_state::kungfur_latch1_w)); - ppi1.out_pb_callback().set(FUNC(kungfur_state::kungfur_latch2_w)); - ppi1.out_pc_callback().set(FUNC(kungfur_state::kungfur_latch3_w)); + I8255(config, m_ppi[1]); // $400c - always $80 (PPI mode 0, all ports as output) + m_ppi[1]->out_pa_callback().set(FUNC(kungfur_state::digit_data_w<0>)); + m_ppi[1]->out_pb_callback().set(FUNC(kungfur_state::digit_data_w<1>)); + m_ppi[1]->out_pc_callback().set(FUNC(kungfur_state::digit_data_w<2>)); /* no video! */ /* sound hardware */ SPEAKER(config, "mono").front_center(); // 2 speakers, but likely mono sound mix - MSM5205(config, m_adpcm1, XTAL(384'000)); // clock verified with recording - m_adpcm1->vck_legacy_callback().set(FUNC(kungfur_state::kfr_adpcm1_int)); - m_adpcm1->set_prescaler_selector(msm5205_device::S48_4B); - m_adpcm1->add_route(ALL_OUTPUTS, "mono", 1.0); + MSM5205(config, m_adpcm[0], 384_kHz_XTAL); // clock verified with recording + m_adpcm[0]->vck_callback().set(FUNC(kungfur_state::adpcm_int<0>)); + m_adpcm[0]->set_prescaler_selector(msm5205_device::S48_4B); + m_adpcm[0]->add_route(ALL_OUTPUTS, "mono", 1.0); - MSM5205(config, m_adpcm2, XTAL(384'000)); // clock verified with recording - m_adpcm2->vck_legacy_callback().set(FUNC(kungfur_state::kfr_adpcm2_int)); - m_adpcm2->set_prescaler_selector(msm5205_device::S48_4B); - m_adpcm2->add_route(ALL_OUTPUTS, "mono", 1.0); + MSM5205(config, m_adpcm[1], 384_kHz_XTAL); // clock verified with recording + m_adpcm[1]->vck_callback().set(FUNC(kungfur_state::adpcm_int<1>)); + m_adpcm[1]->set_prescaler_selector(msm5205_device::S48_4B); + m_adpcm[1]->add_route(ALL_OUTPUTS, "mono", 1.0); } -/*************************************************************************** - - Game driver(s) -***************************************************************************/ +/****************************************************************************** + ROM Definitions +******************************************************************************/ ROM_START( kungfur ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "kr1.bin", 0x0c000, 0x04000, CRC(f5b93cc7) SHA1(ed962915aeafea823a6562e6f284a88422f09a08) ) + ROM_LOAD( "kr1.bin", 0x0c000, 0x04000, CRC(f5b93cc7) SHA1(ed962915aeafea823a6562e6f284a88422f09a08) ) - ROM_REGION( 0x20000, "adpcm1", 0 ) - ROM_LOAD( "kr2.bin", 0x00000, 0x10000, CRC(13f5eba8) SHA1(a3ae2d54ec60d48bfff6192e61033ec583e3603f) ) - ROM_LOAD( "kr3.bin", 0x10000, 0x10000, CRC(05fd1301) SHA1(6871d872315ffb025fea7d2ccd9a203863dc142d) ) + ROM_REGION( 0x20000, "adpcm0", 0 ) + ROM_LOAD( "kr2.bin", 0x00000, 0x10000, CRC(13f5eba8) SHA1(a3ae2d54ec60d48bfff6192e61033ec583e3603f) ) + ROM_LOAD( "kr3.bin", 0x10000, 0x10000, CRC(05fd1301) SHA1(6871d872315ffb025fea7d2ccd9a203863dc142d) ) - ROM_REGION( 0x40000, "adpcm2", 0 ) - ROM_LOAD( "kr4.bin", 0x00000, 0x10000, CRC(58929279) SHA1(d90f68dd8cf2ddc5e73ed40eb31ebbb0be7e35a4) ) - ROM_LOAD( "kr5.bin", 0x10000, 0x10000, CRC(31ed39c8) SHA1(8da50b2183a287fe3a41ec13078aff7fb40c43a3) ) - ROM_LOAD( "kr6.bin", 0x20000, 0x10000, CRC(9ea75d4a) SHA1(57445ccb961acb11a25cdac81f2e543d92bcb7f9) ) + ROM_REGION( 0x40000, "adpcm1", ROMREGION_ERASE00 ) + ROM_LOAD( "kr4.bin", 0x00000, 0x10000, CRC(58929279) SHA1(d90f68dd8cf2ddc5e73ed40eb31ebbb0be7e35a4) ) + ROM_LOAD( "kr5.bin", 0x10000, 0x10000, CRC(31ed39c8) SHA1(8da50b2183a287fe3a41ec13078aff7fb40c43a3) ) + ROM_LOAD( "kr6.bin", 0x20000, 0x10000, CRC(9ea75d4a) SHA1(57445ccb961acb11a25cdac81f2e543d92bcb7f9) ) ROM_END -GAMEL( 1987, kungfur, 0, kungfur, kungfur, kungfur_state, empty_init, ROT0, "Namco", "Kung-Fu Roushi", MACHINE_SUPPORTS_SAVE, layout_kungfur ) +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +/* YEAR NAME PARENT MACHINE INPUT CLASS INIT MONITOR COMPANY, FULLNAME, FLAGS */ +GAMEL( 1987, kungfur, 0, kungfur, kungfur, kungfur_state, empty_init, ROT0, "Namco", "Kung-Fu Roushi", MACHINE_SUPPORTS_SAVE, layout_kungfur ) diff --git a/src/mame/drivers/ldplayer.cpp b/src/mame/drivers/ldplayer.cpp index 0f7fa037b2a..6ff2df2b9c2 100644 --- a/src/mame/drivers/ldplayer.cpp +++ b/src/mame/drivers/ldplayer.cpp @@ -25,7 +25,7 @@ #include "pr8210.lh" -#include <ctype.h> +#include <cctype> class ldplayer_state : public driver_device diff --git a/src/mame/drivers/leapfrog_leappad.cpp b/src/mame/drivers/leapfrog_leappad.cpp index 2c010d3f593..26fa06782af 100644 --- a/src/mame/drivers/leapfrog_leappad.cpp +++ b/src/mame/drivers/leapfrog_leappad.cpp @@ -49,6 +49,7 @@ public: void leapfrog_leappad(machine_config &config); void leapfrog_mfleappad(machine_config &config); + void leapfrog_ltleappad(machine_config &config); private: virtual void machine_start() override; @@ -132,9 +133,24 @@ void leapfrog_leappad_state::leapfrog_mfleappad(machine_config &config) m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_mfleappad_cart"); - SOFTWARE_LIST(config, "cart_list2").set_original("leapfrog_ltleappad_cart"); } +void leapfrog_leappad_state::leapfrog_ltleappad(machine_config &config) +{ + I8032(config, m_maincpu, 96000000/10); // (which exact type is it?) + m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); + m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); + + // screenless + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_ltleappad_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_ltleappad_cart"); +} + + // All of these contain the string "Have you copied our ROM?" near the date codes ROM_START( leappad ) @@ -157,8 +173,14 @@ ROM_START( mfleappadus ) ROM_LOAD( "myfirstleappadbios.bin", 0x000000, 0x400000, CRC(19174c16) SHA1(e0ba644fdf38fd5f91ab8c4b673c4a658cc3e612) ) // contains "Feb 13 2004.10:58:53.152-10573.MFLP US Base ROM - 2004" and "Copyright (c) 2004 LeapFrog Enterprises, Inc." ROM_END +ROM_START( ltleappad ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "littletouchleappadbios.bin", 0x000000, 0x400000, CRC(13687b26) SHA1(6ec1a47aaef9c9ed134bb143c2631f4d89d7c236) ) // contains "Mar 10 2005 07:01:53 152-11244" and "Copyright (c) 2002-2005 LeapFrog Enterprises, Inc." +ROM_END + // year, name, parent, compat, machine, input, class, init, company, fullname, flags CONS( 2001, leappad, 0, 0, leapfrog_leappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "LeapPad (World)", MACHINE_IS_SKELETON ) CONS( 2004, leappadca, leappad, 0, leapfrog_leappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "LeapPad (Canada)", MACHINE_IS_SKELETON ) CONS( 2002, mfleappad, 0, 0, leapfrog_mfleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "My First LeapPad (World, V1.3)", MACHINE_IS_SKELETON ) CONS( 2004, mfleappadus, mfleappad, 0, leapfrog_mfleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "My First LeapPad (US)", MACHINE_IS_SKELETON ) +CONS( 2005, ltleappad, 0, 0, leapfrog_ltleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "Little Touch LeapPad", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/legionna.cpp b/src/mame/drivers/legionna.cpp index cbf0597ab45..233883403f6 100644 --- a/src/mame/drivers/legionna.cpp +++ b/src/mame/drivers/legionna.cpp @@ -1943,6 +1943,55 @@ ROM_END /* +Denjin Makai newer set +PCB labeled BP942KS +All "denjin" ROM labels from this set are actually written in kanji chars. + +*/ + +ROM_START( denjinmk ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD32_BYTE( "denjin_1.u025", 0x000000, 0x040000, CRC(b23a6e6f) SHA1(73ab330dfc0d2799984874f02da51deb8323b9e2) ) + ROM_LOAD32_BYTE( "denjin_2.u024", 0x000001, 0x040000, CRC(4fde59e7) SHA1(1618db14a18acc2acabdd93b8e2563d7221e643d) ) + ROM_LOAD32_BYTE( "denjin_3.u026", 0x000002, 0x040000, CRC(4f10292b) SHA1(c61c88cacc433bb9af6a4225ce5959dd0fefd084) ) + ROM_LOAD32_BYTE( "denjin_4.u023", 0x000003, 0x040000, CRC(209f1f6b) SHA1(3f6709dc79fae47ef4181d405d3aa94c2df5963a) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 code, banked data */ + ROM_LOAD( "denjin_7.u1016", 0x000000, 0x08000, CRC(970f36dd) SHA1(010a9edeaedb9e258cd02b3e9294264d00ec7c45) ) + ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ + ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 ) + + ROM_REGION( 0x020000, "char", 0 ) + ROM_LOAD16_BYTE( "denjin_6.u0620", 0x000000, 0x010000, CRC(e1f759b1) SHA1(ddc60e78e7791a59c59403dd4089b3f6e1ecf8cb) ) + ROM_LOAD16_BYTE( "denjin_5.u0615", 0x000001, 0x010000, CRC(cc36af0d) SHA1(69c2ae38f03be79be4d138fcc73a6a86407eb285) ) + + ROM_REGION( 0x500000, "sprite", 0 ) + ROM_LOAD16_WORD_SWAP( "obj-0-3.748", 0x000000, 0x200000, CRC(67c26a67) SHA1(20543ca9dcf3fed0884968b5249b34b59a14b791) ) /* banks 0,1,2,3 */ + ROM_LOAD16_WORD_SWAP( "obj-4-5.756", 0x200000, 0x100000, CRC(01f8d4e6) SHA1(25b69da693be8c3404f750b419c330a7a56e88ec) ) /* 4,5 */ + ROM_LOAD16_WORD_SWAP( "obj-6-7.743", 0x300000, 0x100000, CRC(e5805757) SHA1(9d392c27eef7c1fcda560dac17ba9d7ae2287ac8) ) /* 6,7 */ + ROM_LOAD16_WORD_SWAP( "obj-8-9.757", 0x400000, 0x100000, CRC(c8f7e1c9) SHA1(a746d187b50a0ecdd5a7f687a2601e5dc8bfe272) ) /* 8,9 */ + + ROM_REGION( 0x100000, "back", 0 ) /* MBK tiles */ + ROM_LOAD16_WORD_SWAP( "bg-1-ab.618", 0x000000, 0x100000, CRC(eaad151a) SHA1(bdd1d83ee8497efe20f21baf873e786446372bcb) ) + + ROM_REGION( 0x100000, "mid", 0 ) /* BK2 used (or LBK; just identification string differs?) */ + ROM_LOAD16_WORD_SWAP( "bg-2-ab.617", 0x000000, 0x100000, CRC(40938f74) SHA1(d68b0f8245a8b390ad5d4e6ebc7514a939b8ac51) ) + + ROM_REGION( 0x100000, "fore", 0 ) /* BK3 tiles */ + ROM_LOAD16_WORD_SWAP( "bg-3-ab.619", 0x000000, 0x100000, CRC(de7366ee) SHA1(0c3969d15f3cd963e579d4164b6e0a6b4012c9c6) ) + + ROM_REGION( 0x080000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "denjin_8.u0922", 0x000000, 0x040000, CRC(a11adb8f) SHA1(50e1158767b506d962bff861c2a6609246d764c4) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "s68e08.844", 0x000000, 0x000200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */ + + ROM_REGION( 0x080000, "user1", 0 ) + ROM_LOAD( "copx-d2.313", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) +ROM_END + +/* + Denjin Makai Banpresto, 1994 @@ -2013,19 +2062,18 @@ Notes: S68E08 : PROM type 82S147, labelled 'S68E08' - */ -ROM_START( denjinmk ) +ROM_START( denjinmka ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD32_BYTE( "rom1.025", 0x000000, 0x040000, CRC(44a648e8) SHA1(a3c1721e89ac6b9fc16f80682b2f701cb24b5d76) ) - ROM_LOAD32_BYTE( "rom2.024", 0x000001, 0x040000, CRC(e5ee8fe0) SHA1(2ebff4fdbe82062fb526598e10f11358b0b5c02f) ) - ROM_LOAD32_BYTE( "rom3.026", 0x000002, 0x040000, CRC(781b942e) SHA1(f1f4ddc332de3dc29b716a1b82c2ecc2045efb3a) ) - ROM_LOAD32_BYTE( "rom4.023", 0x000003, 0x040000, CRC(502a588b) SHA1(9055b631240fe52d33b572e34275d31a9f3d290f) ) + ROM_LOAD32_BYTE( "rom1.025", 0x000000, 0x040000, CRC(44a648e8) SHA1(a3c1721e89ac6b9fc16f80682b2f701cb24b5d76) ) + ROM_LOAD32_BYTE( "rom2.024", 0x000001, 0x040000, CRC(e5ee8fe0) SHA1(2ebff4fdbe82062fb526598e10f11358b0b5c02f) ) + ROM_LOAD32_BYTE( "rom3.026", 0x000002, 0x040000, CRC(781b942e) SHA1(f1f4ddc332de3dc29b716a1b82c2ecc2045efb3a) ) + ROM_LOAD32_BYTE( "rom4.023", 0x000003, 0x040000, CRC(502a588b) SHA1(9055b631240fe52d33b572e34275d31a9f3d290f) ) ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 code, banked data */ - ROM_LOAD( "rom5.016", 0x000000, 0x08000, CRC(7fe7e352) SHA1(1ceae22186751ca91dfffab7bd11f275e693451f) ) - ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ + ROM_LOAD( "rom5.016", 0x000000, 0x08000, CRC(7fe7e352) SHA1(1ceae22186751ca91dfffab7bd11f275e693451f) ) + ROM_CONTINUE( 0x010000, 0x08000 ) /* banked stuff */ ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 ) ROM_REGION( 0x020000, "char", 0 ) @@ -2033,10 +2081,10 @@ ROM_START( denjinmk ) ROM_LOAD16_BYTE( "rom8.615", 0x000001, 0x010000, CRC(cc36af0d) SHA1(69c2ae38f03be79be4d138fcc73a6a86407eb285) ) ROM_REGION( 0x500000, "sprite", 0 ) - ROM_LOAD16_WORD_SWAP( "obj-0-3.748", 0x000000, 0x200000, CRC(67c26a67) SHA1(20543ca9dcf3fed0884968b5249b34b59a14b791) ) /* banks 0,1,2,3 */ - ROM_LOAD16_WORD_SWAP( "obj-4-5.756", 0x200000, 0x100000, CRC(01f8d4e6) SHA1(25b69da693be8c3404f750b419c330a7a56e88ec) ) /* 4,5 */ - ROM_LOAD16_WORD_SWAP( "obj-6-7.743", 0x300000, 0x100000, CRC(e5805757) SHA1(9d392c27eef7c1fcda560dac17ba9d7ae2287ac8) ) /* 6,7 */ - ROM_LOAD16_WORD_SWAP( "obj-8-9.757", 0x400000, 0x100000, CRC(c8f7e1c9) SHA1(a746d187b50a0ecdd5a7f687a2601e5dc8bfe272) ) /* 8,9 */ + ROM_LOAD16_WORD_SWAP( "obj-0-3.748", 0x000000, 0x200000, CRC(67c26a67) SHA1(20543ca9dcf3fed0884968b5249b34b59a14b791) ) /* banks 0,1,2,3 */ + ROM_LOAD16_WORD_SWAP( "obj-4-5.756", 0x200000, 0x100000, CRC(01f8d4e6) SHA1(25b69da693be8c3404f750b419c330a7a56e88ec) ) /* 4,5 */ + ROM_LOAD16_WORD_SWAP( "obj-6-7.743", 0x300000, 0x100000, CRC(e5805757) SHA1(9d392c27eef7c1fcda560dac17ba9d7ae2287ac8) ) /* 6,7 */ + ROM_LOAD16_WORD_SWAP( "obj-8-9.757", 0x400000, 0x100000, CRC(c8f7e1c9) SHA1(a746d187b50a0ecdd5a7f687a2601e5dc8bfe272) ) /* 8,9 */ ROM_REGION( 0x100000, "back", 0 ) /* MBK tiles */ ROM_LOAD16_WORD_SWAP( "bg-1-ab.618", 0x000000, 0x100000, CRC(eaad151a) SHA1(bdd1d83ee8497efe20f21baf873e786446372bcb) ) @@ -2543,7 +2591,8 @@ GAME( 1992, heatbrle, heatbrl, heatbrl, heatbrl, legionna_state, empty_init, GAME( 1993, godzilla, 0, godzilla, godzilla, legionna_state, init_godzilla, ROT0, "Banpresto", "Godzilla (Japan)", 0 ) GAME( 1993, grainbow, 0, grainbow, grainbow, legionna_state, empty_init, ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki (Japan)", 0 ) GAME( 1993, grainbowk, grainbow, grainbow, grainbow, legionna_state, empty_init, ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki (Korea)", 0 ) -GAME( 1994, denjinmk, 0, denjinmk, denjinmk, legionna_state, empty_init, ROT0, "Winkysoft (Banpresto license)", "Denjin Makai", 0 ) +GAME( 1994, denjinmk, 0, denjinmk, denjinmk, legionna_state, empty_init, ROT0, "Winkysoft (Banpresto license)", "Denjin Makai (set 1)", 0 ) +GAME( 1994, denjinmka, denjinmk, denjinmk, denjinmk, legionna_state, empty_init, ROT0, "Winkysoft (Banpresto license)", "Denjin Makai (set 2)", 0 ) GAME( 1992, cupsoc, 0, cupsoc, cupsoc, legionna_state, init_cupsoc, ROT0, "Seibu Kaihatsu", "Seibu Cup Soccer (set 1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) GAME( 1992, cupsoca, cupsoc, cupsoc, cupsoc, legionna_state, init_cupsoc, ROT0, "Seibu Kaihatsu", "Seibu Cup Soccer (set 2)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/lexibook_jg7425.cpp b/src/mame/drivers/lexibook_jg7425.cpp index 482b84ce6a5..c8fecbcb964 100644 --- a/src/mame/drivers/lexibook_jg7425.cpp +++ b/src/mame/drivers/lexibook_jg7425.cpp @@ -55,9 +55,9 @@ private: void lexibook_jg7425_state::machine_start() { // I think this code should be running from RAM at least, probably some kind of bootstrap / internal ROM to copy it? (hyperscan.cpp indicates that SoC can have internal ROM at least) - + // first 0x20 bytes are probably pointers, code starts at 0x20 and is offset, maps at 0x500000 - + for (int i = 0; i < 0x80000 / 4; i++) { m_mainram[i+(0x500000/4) - (0x20/4)] = m_romregion[i]; @@ -101,7 +101,7 @@ void lexibook_jg7425_state::lexibook_jg7425(machine_config &config) ROM_START( lx_jg7425 ) ROM_REGION( 0x200000, "maincpu", ROMREGION_32BIT | ROMREGION_LE ) ROM_LOAD32_DWORD( "mx29lv160.u6", 0x000000, 0x200000, CRC(43c90080) SHA1(4c9e5c8f880d40bd684357ce67ae45c3f5d24b62) ) - + DISK_REGION( "ata:0:hdd:image" ) /* 4GB SD Card */ DISK_IMAGE( "lexibook_jg7425_4gbsd", 0, SHA1(dc0985103edec3992efdd493feef6185daedb3fd) ) ROM_END diff --git a/src/mame/drivers/ltd.cpp b/src/mame/drivers/ltd.cpp index a701dc3b60f..8b1fe3a2bcb 100644 --- a/src/mame/drivers/ltd.cpp +++ b/src/mame/drivers/ltd.cpp @@ -729,7 +729,7 @@ ROM_END /-------------------------------------------------------------------*/ ROM_START(tmacltd4) ROM_REGION(0x2000, "roms", 0) - ROM_LOAD("tm4-l.bin", 0x0000, 0x1000, NO_DUMP) + ROM_LOAD("tm4-l.bin", 0x0000, 0x1000, CRC(69691662) SHA1(3d86314967075e3f5b168c8d7bf6b26bbbb957bd)) ROM_LOAD("tm4-h.bin", 0x1000, 0x1000, CRC(f5f97992) SHA1(ba31f71a600e7061b500e0750f50643503e52a80)) ROM_END diff --git a/src/mame/drivers/lvcards.cpp b/src/mame/drivers/lvcards.cpp index 1ef5e5f099c..84f2a583d03 100644 --- a/src/mame/drivers/lvcards.cpp +++ b/src/mame/drivers/lvcards.cpp @@ -598,7 +598,7 @@ lc1.bin [2/4] 1.l4 [4/4] 0.317383% lc1.bin [4/4] 1.l4 [2/4] 0.317383% lc2.bin [even 2/2] 2.k4 [odd 2/2] 0.146484% */ -ROM_START( lvcardsa ) +ROM_START( lvcardsa ) // Tehkan 5910A-1 PCB ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "1.l4", 0x0000, 0x4000, CRC(81a25f70) SHA1(ce8917674b3374e5e138420f062d9b7aba3f6e11) ) ROM_LOAD( "2.k4", 0x4000, 0x2000, CRC(d1c72fc2) SHA1(496606e129046d253d716254ef4e58a93ca10aa0) ) diff --git a/src/mame/drivers/m68705prg.cpp b/src/mame/drivers/m68705prg.cpp index 77b080f65a7..80b07e07cf5 100644 --- a/src/mame/drivers/m68705prg.cpp +++ b/src/mame/drivers/m68705prg.cpp @@ -107,11 +107,14 @@ protected: m_addr = 0x0000; m_pb_val = 0xff; + m_input_poll_timer->adjust(attotime::from_hz(120), 0, attotime::from_hz(120)); + } + + virtual void machine_reset() override + { m_digits[0] = s_7seg[(m_addr >> 0) & 0x0f]; m_digits[1] = s_7seg[(m_addr >> 4) & 0x0f]; m_digits[2] = s_7seg[(m_addr >> 8) & 0x0f]; - - m_input_poll_timer->adjust(attotime::from_hz(120), 0, attotime::from_hz(120)); } required_ioport m_sw; @@ -174,6 +177,8 @@ protected: virtual void machine_reset() override { + m68705prg_state_base::machine_reset(); + m_sw->field(0x01)->live().value = 0; m_sw->field(0x02)->live().value = 0; diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp index 3a518026fcf..e8c0516153d 100644 --- a/src/mame/drivers/m72.cpp +++ b/src/mame/drivers/m72.cpp @@ -3209,7 +3209,7 @@ ROM_END | |74S74N XTAL 74LS368AN 74LS132N | | |___| |__________20.000MHz_________________________| |_____________________________________________| - Board 5 Sound Board (1/3) + Board 5 Sound Board 1/3 _____________________________________________ ______________________________________________ | | | | | __________ ________ ________ ________ | | ________ ________ ________ | @@ -3253,7 +3253,7 @@ IC64->PAL16R6A 74LS393N 74LS368AN 74LS377N |U|| | | |__| | |___| __________________________ | |____________________________________________| |__________| |_|_|_|_|_|_|_|_|_|_|_| |________| PRE-JAMMA - Board (6) + Board 7/4 __________________________________________________________ | _________ _________ __________ _________ _________ __|_ | 74LS163AP| 74LS163AP||_GAL20V8_| |74S174N_| |74S189N_|| | @@ -3269,10 +3269,10 @@ IC64->PAL16R6A 74LS393N 74LS368AN 74LS377N |U|| | | | 7536 |____________| _________ | | | _________ __________ _____________ |74S174N_| | | | |74LS283N| |74LS245P_| |KM62256AP-10| __________ | | - | |____________| |74LS245P_| | | + | _________ __________ |____________| |74LS245P_| | | + | |74LS20B1| |74LS245P_| | | | _________ __________ __________ _________ | | | |74LS20B1| |74LS374N_| |74LS273P_| |74LS74AP| | | - | | | | _________ __________ __________ _________ |___| | |74LS04N_| |_GAL16V8_| |74LS374N_| |74LS157N| | | 7336 | @@ -3306,9 +3306,9 @@ IC64->PAL16R6A 74LS393N 74LS368AN 74LS377N |U|| | | ROM_START( loht_ms ) // really similar to lohtb, even if it runs on 'Modular Hardware' ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_BYTE( "6_lg_604.ic17", 0x00001, 0x10000, CRC(7e84b6ce) SHA1(a9a54f045917a191b6d6bbe061fc7a3344efb3bb) ) - ROM_LOAD16_BYTE( "6_lg_604.ic20", 0x10001, 0x10000, CRC(abdcd211) SHA1(6ad79c4ef14d908032e4dbded7696a66fe5d31da) ) + ROM_LOAD16_BYTE( "6_lg_605.ic20", 0x20001, 0x10000, CRC(abdcd211) SHA1(6ad79c4ef14d908032e4dbded7696a66fe5d31da) ) ROM_LOAD16_BYTE( "6_lg_601.ic8", 0x00000, 0x10000, CRC(7e080cb8) SHA1(598bcd8ecebe1922735b61cc1305e8839d9d054e) ) - ROM_LOAD16_BYTE( "6_lg_602.ic11", 0x10000, 0x10000, CRC(150d1178) SHA1(71df3c9a49eb74cf40790e9b4cf7c6260fbd07d6) ) + ROM_LOAD16_BYTE( "6_lg_602.ic11", 0x20000, 0x10000, CRC(150d1178) SHA1(71df3c9a49eb74cf40790e9b4cf7c6260fbd07d6) ) ROM_LOAD16_BYTE( "6_lg_606.ic26", 0x40001, 0x20000, CRC(714778b5) SHA1(e2eaa35d6b5fa5df5163fe0d7b45fa66667f9947) ) ROM_RELOAD( 0xc0001, 0x20000 ) ROM_LOAD16_BYTE( "6_lg_603.ic25", 0x40000, 0x20000, CRC(2f049b03) SHA1(21047cb10912b1fc23795673af3ea7de249328b7) ) diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp index 99107023d23..4c3a01bedfc 100644 --- a/src/mame/drivers/mc1502.cpp +++ b/src/mame/drivers/mc1502.cpp @@ -209,6 +209,12 @@ MACHINE_RESET_MEMBER(mc1502_state, mc1502) * macros */ +void mc1502_state::fdc_config(device_t *device) +{ + mc1502_fdc_device &fdc = *downcast<mc1502_fdc_device*>(device); + fdc.set_cpu(m_maincpu); +} + void mc1502_state::mc1502_map(address_map &map) { map.unmap_value_high(); @@ -284,10 +290,11 @@ void mc1502_state::mc1502(machine_config &config) isa.irq5_callback().set(m_pic8259, FUNC(pic8259_device::ir5_w)); isa.irq6_callback().set(m_pic8259, FUNC(pic8259_device::ir6_w)); isa.irq7_callback().set(m_pic8259, FUNC(pic8259_device::ir7_w)); + isa.iochrdy_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); ISA8_SLOT(config, "board0", 0, "isa", mc1502_isa8_cards, "cga_mc1502", true); // FIXME: determine ISA bus clock - ISA8_SLOT(config, "isa1", 0, "isa", mc1502_isa8_cards, "fdc", false); - ISA8_SLOT(config, "isa2", 0, "isa", mc1502_isa8_cards, "rom", false); + ISA8_SLOT(config, "isa1", 0, "isa", mc1502_isa8_cards, "fdc", false).set_option_machine_config("fdc", [this](device_t *device) { fdc_config(device); }); + ISA8_SLOT(config, "isa2", 0, "isa", mc1502_isa8_cards, "rom", false).set_option_machine_config("fdc", [this](device_t* device) { fdc_config(device); }); SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.80); diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp index d3da3941779..deb73e7111c 100644 --- a/src/mame/drivers/megadriv.cpp +++ b/src/mame/drivers/megadriv.cpp @@ -166,23 +166,7 @@ WRITE16_MEMBER(md_cons_state::mess_md_io_write_data_port) *************************************/ -static INPUT_PORTS_START( md ) - PORT_START("CTRLSEL") /* Controller selection */ - PORT_CONFNAME( 0x0f, 0x00, "Player 1 Controller" ) - PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" ) - PORT_CONFSETTING( 0x01, "Joystick 6 Buttons" ) -// PORT_CONFSETTING( 0x02, "Sega Mouse" ) -/* there exists both a 2 buttons version of the Mouse (Jpn ver, to be used with RPGs, it - can aslo be used as trackball) and a 3 buttons version (US ver, no trackball feats.) */ -// PORT_CONFSETTING( 0x03, "Sega Menacer" ) -// PORT_CONFSETTING( 0x04, "Konami Justifier" ) -// PORT_CONFSETTING( 0x05, "Team Player (Sega Multitap)" ) -// PORT_CONFSETTING( 0x06, "4-Play (EA Multitap)" ) -// PORT_CONFSETTING( 0x07, "J-Cart" ) - PORT_CONFNAME( 0xf0, 0x00, "Player 2 Controller" ) - PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" ) - PORT_CONFSETTING( 0x10, "Joystick 6 Buttons" ) - +static INPUT_PORTS_START( md_base ) PORT_START("PAD1_3B") /* Joypad 1 (3 button + start) NOT READ DIRECTLY */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00) @@ -239,6 +223,43 @@ static INPUT_PORTS_START( md ) PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Reset Button") PORT_IMPULSE(1) // reset, resets 68k (and..?) INPUT_PORTS_END +static INPUT_PORTS_START( md ) + PORT_INCLUDE( md_base ) + + PORT_START("CTRLSEL") /* Controller selection */ + PORT_CONFNAME( 0x0f, 0x00, "Player 1 Controller" ) + PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" ) + PORT_CONFSETTING( 0x01, "Joystick 6 Buttons" ) +// PORT_CONFSETTING( 0x02, "Sega Mouse" ) +/* there exists both a 2 buttons version of the Mouse (Jpn ver, to be used with RPGs, it + can aslo be used as trackball) and a 3 buttons version (US ver, no trackball feats.) */ +// PORT_CONFSETTING( 0x03, "Sega Menacer" ) +// PORT_CONFSETTING( 0x04, "Konami Justifier" ) +// PORT_CONFSETTING( 0x05, "Team Player (Sega Multitap)" ) +// PORT_CONFSETTING( 0x06, "4-Play (EA Multitap)" ) +// PORT_CONFSETTING( 0x07, "J-Cart" ) + PORT_CONFNAME( 0xf0, 0x00, "Player 2 Controller" ) + PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" ) + PORT_CONFSETTING( 0x10, "Joystick 6 Buttons" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( megajet ) + PORT_INCLUDE( md_base ) + + PORT_START("CTRLSEL") /* Fixed controller setting for Player 1 */ + PORT_CONFNAME( 0x0f, 0x01, "Player 1 Controller" ) // Fixed + PORT_CONFSETTING( 0x01, "Joystick 6 Buttons" ) + PORT_CONFNAME( 0xf0, 0x00, "Player 2 Controller" ) + PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" ) + PORT_CONFSETTING( 0x10, "Joystick 6 Buttons" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( gen_nomd ) + PORT_INCLUDE( megajet ) + + PORT_MODIFY("RESET") /* No reset button */ + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END /************************************* @@ -402,6 +423,19 @@ void md_cons_state::ms_megadpal(machine_config &config) SOFTWARE_LIST(config, "cart_list").set_original("megadriv"); } +void md_cons_state::ms_megadriv2(machine_config &config) +{ + md2_ntsc(config); + + MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megadriv) + MCFG_MACHINE_RESET_OVERRIDE(md_cons_state, ms_megadriv) + + subdevice<screen_device>("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); + + MD_CART_SLOT(config, m_cart, md_cart, nullptr); + SOFTWARE_LIST(config, "cart_list").set_original("megadriv"); +} + void md_cons_state::genesis_tmss(machine_config &config) { ms_megadriv(config); @@ -461,6 +495,16 @@ ROM_START(dcat16) ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF) ROM_END +ROM_START(megajet) + ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF) + ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF) +ROM_END + +ROM_START(gen_nomd) + ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF) + ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF) +ROM_END + /************************************* * * Driver initialization @@ -756,6 +800,27 @@ void md_cons_state::genesis_scd(machine_config &config) SOFTWARE_LIST(config, "cd_list").set_original("segacd"); } +void md_cons_state::genesis2_scd(machine_config &config) +{ + md2_ntsc(config); + + MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd) + MCFG_MACHINE_RESET_OVERRIDE(md_cons_state, ms_megadriv) + + subdevice<screen_device>("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); + + SEGA_SEGACD_US(config, m_segacd, 0); + m_segacd->set_palette("gen_vdp:gfx_palette"); + m_segacd->set_hostcpu(m_maincpu); + m_segacd->set_screen("megadriv"); + + config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu + + CDROM(config, "cdrom").set_interface("scd_cdrom"); + + SOFTWARE_LIST(config, "cd_list").set_original("segacd"); +} + void md_cons_state::md_scd(machine_config &config) { md_pal(config); @@ -777,6 +842,27 @@ void md_cons_state::md_scd(machine_config &config) SOFTWARE_LIST(config, "cd_list").set_original("megacd"); } +void md_cons_state::md2_scd(machine_config &config) +{ + md2_pal(config); + + MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd) + MCFG_MACHINE_RESET_OVERRIDE(md_cons_state, ms_megadriv) + + subdevice<screen_device>("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); + + SEGA_SEGACD_EUROPE(config, m_segacd, 0); + m_segacd->set_palette("gen_vdp:gfx_palette"); + m_segacd->set_hostcpu(m_maincpu); + m_segacd->set_screen("megadriv"); + + config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu + + CDROM(config, "cdrom").set_interface("scd_cdrom"); + + SOFTWARE_LIST(config, "cd_list").set_original("megacd"); +} + void md_cons_state::mdj_scd(machine_config &config) { md_ntsc(config); @@ -798,6 +884,27 @@ void md_cons_state::mdj_scd(machine_config &config) SOFTWARE_LIST(config, "cd_list").set_original("megacdj"); } +void md_cons_state::md2j_scd(machine_config &config) +{ + md2_ntsc(config); + + MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd) + MCFG_MACHINE_RESET_OVERRIDE(md_cons_state, ms_megadriv) + + subdevice<screen_device>("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); + + SEGA_SEGACD_JAPAN(config, m_segacd, 0); + m_segacd->set_palette("gen_vdp:gfx_palette"); + m_segacd->set_hostcpu(m_maincpu); + m_segacd->set_screen("megadriv"); + + config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu + + CDROM(config, "cdrom").set_interface("scd_cdrom"); + + SOFTWARE_LIST(config, "cd_list").set_original("megacdj"); +} + /******************SEGA CD + 32X****************************/ void md_cons_state::genesis_32x_scd(machine_config &config) @@ -899,6 +1006,8 @@ ROM_START( megacdj ) // EEPROM had no SEGA's label, might be 14088(no rev) or 14088A ROM_SYSTEM_BIOS(5, "v100c", "v1.00C") // CRC: c3b60c13 when byteswapped ROMX_LOAD( "100c.bin", 0x000000, 0x020000, CRC(41af44c4) SHA1(f30d109d1c2f7c9feaf38600c65834261db73d1f), ROM_BIOS(5) ) + ROM_SYSTEM_BIOS(6, "v111", "v1.11") // CRC: e0a6179b when byteswapped + ROMX_LOAD( "mpr-14837.bin", 0x000000, 0x020000, CRC(4be18ff6) SHA1(204758d5a64c24e96e1a9fe6bd82e1878fef7ade), ROM_BIOS(6) ) ROM_END /* Asia bios, when run in USA region will show : @@ -1075,41 +1184,46 @@ ROM_END ***************************************************************************/ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ -CONS( 1989, genesis, 0, 0, ms_megadriv, md, md_cons_state, init_genesis, "Sega", "Genesis (USA, NTSC)", MACHINE_SUPPORTS_SAVE ) -CONS( 1990, megadriv, genesis, 0, ms_megadpal, md, md_cons_state, init_md_eur, "Sega", "Mega Drive (Europe, PAL)", MACHINE_SUPPORTS_SAVE ) -CONS( 1988, megadrij, genesis, 0, ms_megadriv, md, md_cons_state, init_md_jpn, "Sega", "Mega Drive (Japan, NTSC)", MACHINE_SUPPORTS_SAVE ) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ +CONS( 1989, genesis, 0, 0, ms_megadriv, md, md_cons_state, init_genesis, "Sega", "Genesis (USA, NTSC)", MACHINE_SUPPORTS_SAVE ) +CONS( 1990, megadriv, genesis, 0, ms_megadpal, md, md_cons_state, init_md_eur, "Sega", "Mega Drive (Europe, PAL)", MACHINE_SUPPORTS_SAVE ) +CONS( 1988, megadrij, genesis, 0, ms_megadriv, md, md_cons_state, init_md_jpn, "Sega", "Mega Drive (Japan, NTSC)", MACHINE_SUPPORTS_SAVE ) // 1990+ models had the TMSS security chip, leave this as a clone, it reduces compatibility and nothing more. -CONS( 1990, genesis_tmss, genesis, 0, genesis_tmss, md, md_cons_state, init_genesis, "Sega", "Genesis (USA, NTSC, with TMSS chip)", MACHINE_SUPPORTS_SAVE ) - +CONS( 1990, genesis_tmss, genesis, 0, genesis_tmss, md, md_cons_state, init_genesis, "Sega", "Genesis (USA, NTSC, with TMSS chip)", MACHINE_SUPPORTS_SAVE ) // the 32X plugged in the cart slot, games plugged into the 32x. Maybe it should be handled as an expansion device? -CONS( 1994, 32x, 0, 0, genesis_32x, md, md_cons_state, init_genesis, "Sega", "Genesis with 32X (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1994, 32xe, 32x, 0, md_32x, md, md_cons_state, init_md_eur, "Sega", "Mega Drive with 32X (Europe, PAL)", MACHINE_NOT_WORKING ) -CONS( 1994, 32xj, 32x, 0, mdj_32x, md, md_cons_state, init_md_jpn, "Sega", "Mega Drive with 32X (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1994, 32x, 0, 0, genesis_32x, md, md_cons_state, init_genesis, "Sega", "Genesis with 32X (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1994, 32xe, 32x, 0, md_32x, md, md_cons_state, init_md_eur, "Sega", "Mega Drive with 32X (Europe, PAL)", MACHINE_NOT_WORKING ) +CONS( 1994, 32xj, 32x, 0, mdj_32x, md, md_cons_state, init_md_jpn, "Sega", "Mega Drive with 32X (Japan, NTSC)", MACHINE_NOT_WORKING ) // the SegaCD plugged into the expansion port.. -CONS( 1992, segacd, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Sega", "Sega CD (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1993, megacd, segacd, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD (Europe, PAL)", MACHINE_NOT_WORKING ) -CONS( 1991, megacdj, segacd, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Sega", "Mega-CD (Japan, NTSC)", MACHINE_NOT_WORKING ) // this bios doesn't work with our ram interleave needed by a few games?! -CONS( 1991, megacda, segacd, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD (Asia, PAL)", MACHINE_NOT_WORKING ) -CONS( 1993, segacd2, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Sega", "Sega CD 2 (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1993, megacd2, segacd2, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD 2 (Europe, PAL)", MACHINE_NOT_WORKING ) -CONS( 1993, megacd2j, segacd2, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Sega", "Mega-CD 2 (Japan, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1994, aiwamcd, segacd2, 0, mdj_scd, md, md_cons_state, init_md_jpn, "AIWA", "Mega-CD CSD-G1M (Japan, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1993, laseract, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Pioneer","LaserActive (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1993, laseractj, laseract, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Pioneer","LaserActive (Japan, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1993, xeye, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "JVC", "X'eye (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1992, wmega, xeye, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Sega", "Wondermega (Japan, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1993, wmegam2, xeye, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Victor", "Wondermega M2 (Japan, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1994, cdx, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Sega", "CDX (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1994, multmega, cdx, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Multi-Mega (Europe, PAL)", MACHINE_NOT_WORKING ) +CONS( 1992, segacd, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Sega", "Sega CD (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1993, megacd, segacd, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD (Europe, PAL)", MACHINE_NOT_WORKING ) +CONS( 1991, megacdj, segacd, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Sega", "Mega-CD (Japan, NTSC)", MACHINE_NOT_WORKING ) // this bios doesn't work with our ram interleave needed by a few games?! +CONS( 1991, megacda, segacd, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD (Asia, PAL)", MACHINE_NOT_WORKING ) +CONS( 1993, segacd2, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Sega", "Sega CD 2 (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1993, megacd2, segacd2, 0, md_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD 2 (Europe, PAL)", MACHINE_NOT_WORKING ) +CONS( 1993, megacd2j, segacd2, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Sega", "Mega-CD 2 (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1994, aiwamcd, segacd2, 0, mdj_scd, md, md_cons_state, init_md_jpn, "AIWA", "Mega-CD CSD-G1M (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1993, laseract, 0, 0, genesis_scd, md, md_cons_state, init_genesis, "Pioneer","LaserActive (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1993, laseractj, laseract, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Pioneer","LaserActive (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1993, xeye, 0, 0, genesis2_scd, md, md_cons_state, init_genesis, "JVC", "X'eye (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1992, wmega, xeye, 0, mdj_scd, md, md_cons_state, init_md_jpn, "Sega", "Wondermega (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1993, wmegam2, xeye, 0, md2j_scd, md, md_cons_state, init_md_jpn, "Victor", "Wondermega M2 (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1994, cdx, 0, 0, genesis2_scd, md, md_cons_state, init_genesis, "Sega", "CDX (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1994, multmega, cdx, 0, md2_scd, md, md_cons_state, init_md_eur, "Sega", "Multi-Mega (Europe, PAL)", MACHINE_NOT_WORKING ) //32X plugged in the cart slot + SegaCD plugged into the expansion port.. -CONS( 1994, 32x_scd, 0, 0, genesis_32x_scd, md, md_cons_state, init_genesis, "Sega", "Sega CD with 32X (USA, NTSC)", MACHINE_NOT_WORKING ) -CONS( 1995, 32x_mcd, 32x_scd, 0, md_32x_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD with 32X (Europe, PAL)", MACHINE_NOT_WORKING ) -CONS( 1994, 32x_mcdj, 32x_scd, 0, mdj_32x_scd, md, md_cons_state, init_md_jpn, "Sega", "Mega-CD with 32X (Japan, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1994, 32x_scd, 0, 0, genesis_32x_scd, md, md_cons_state, init_genesis, "Sega", "Sega CD with 32X (USA, NTSC)", MACHINE_NOT_WORKING ) +CONS( 1995, 32x_mcd, 32x_scd, 0, md_32x_scd, md, md_cons_state, init_md_eur, "Sega", "Mega-CD with 32X (Europe, PAL)", MACHINE_NOT_WORKING ) +CONS( 1994, 32x_mcdj, 32x_scd, 0, mdj_32x_scd, md, md_cons_state, init_md_jpn, "Sega", "Mega-CD with 32X (Japan, NTSC)", MACHINE_NOT_WORKING ) + +// handheld hardware +CONS( 1995, gen_nomd, 0, 0, ms_megadriv2, gen_nomd, md_cons_state, init_genesis, "Sega", "Genesis Nomad (USA Genesis handheld)", MACHINE_SUPPORTS_SAVE ) + +// handheld without LCD +CONS( 1993, megajet, gen_nomd, 0, ms_megadriv2, megajet, md_cons_state, init_md_jpn, "Sega", "Mega Jet (Japan Mega Drive handheld)", MACHINE_SUPPORTS_SAVE ) /* clone hardware - not sure if this hardware is running some kind of emulator, or enhanced MD clone, or just custom banking */ -CONS( 200?, dcat16, 0, 0, dcat16_megadriv, md, md_cons_state, init_genesis, "Firecore", "D-CAT16 (Mega Drive handheld)", MACHINE_NOT_WORKING ) +CONS( 200?, dcat16, 0, 0, dcat16_megadriv, md, md_cons_state, init_genesis, "Firecore", "D-CAT16 (Mega Drive handheld)", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/megaplay.cpp b/src/mame/drivers/megaplay.cpp index 6d727960a23..1e43fa7126b 100644 --- a/src/mame/drivers/megaplay.cpp +++ b/src/mame/drivers/megaplay.cpp @@ -738,7 +738,7 @@ ROM_END This probably means the maximum 68k rom size is 0x2fffff for MegaPlay */ - +/* pcb 171-5834 */ ROM_START( mp_sonic ) /* Sonic */ ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ep15177.ic2", 0x000000, 0x040000, CRC(a389b03b) SHA1(8e9e1cf3dd65ddf08757f5a1ce472130c902ea2c) ) @@ -961,7 +961,7 @@ PCB 171-5834 has locations for 3 ROMs and is dated 1989. | | Game PCB # Sticker on PCB Sticker on cart IC1 IC2 IC3 ------------------------------------------------------------------------------------------------------------------------------------------- -Sonic The Hedgehog - -01 +Sonic The Hedgehog 171-5834 610-0298-01 610-0297-01 EPR-15176 (27C2001) EPR-15177 (27C2001) EPR-15175-01 (27C256) Golden Axe 2 - -02 Grand Slam 171-5834 837-9165-03 610-0297-03 EPR-15180 (27C020) EPR-15181 (27C020) EPR-15175-03 (27256) Tecmo World Cup - -04 diff --git a/src/mame/drivers/megatech.cpp b/src/mame/drivers/megatech.cpp index 424dc7a08c7..11077e1cacc 100644 --- a/src/mame/drivers/megatech.cpp +++ b/src/mame/drivers/megatech.cpp @@ -653,23 +653,23 @@ MACHINE_RESET_MEMBER(mtech_state, megatech) std::string region_tag; if (m_cart1->get_rom_size() > 0) - m_cart_reg[0] = memregion(region_tag.assign(m_cart1->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[0] = memregion(region_tag.assign(m_cart1->tag()).append(GENERIC_ROM_REGION_TAG)); else m_cart_reg[0] = memregion(":mt_slot1:cart"); if (m_cart2) - m_cart_reg[1] = memregion(region_tag.assign(m_cart2->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[1] = memregion(region_tag.assign(m_cart2->tag()).append(GENERIC_ROM_REGION_TAG)); if (m_cart3) - m_cart_reg[2] = memregion(region_tag.assign(m_cart3->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[2] = memregion(region_tag.assign(m_cart3->tag()).append(GENERIC_ROM_REGION_TAG)); if (m_cart4) - m_cart_reg[3] = memregion(region_tag.assign(m_cart4->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[3] = memregion(region_tag.assign(m_cart4->tag()).append(GENERIC_ROM_REGION_TAG)); if (m_cart5) - m_cart_reg[4] = memregion(region_tag.assign(m_cart5->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[4] = memregion(region_tag.assign(m_cart5->tag()).append(GENERIC_ROM_REGION_TAG)); if (m_cart6) - m_cart_reg[5] = memregion(region_tag.assign(m_cart6->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[5] = memregion(region_tag.assign(m_cart6->tag()).append(GENERIC_ROM_REGION_TAG)); if (m_cart7) - m_cart_reg[6] = memregion(region_tag.assign(m_cart7->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[6] = memregion(region_tag.assign(m_cart7->tag()).append(GENERIC_ROM_REGION_TAG)); if (m_cart8) - m_cart_reg[7] = memregion(region_tag.assign(m_cart8->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[7] = memregion(region_tag.assign(m_cart8->tag()).append(GENERIC_ROM_REGION_TAG)); switch_cart(0); } diff --git a/src/mame/drivers/mephisto_berlin.cpp b/src/mame/drivers/mephisto_berlin.cpp new file mode 100644 index 00000000000..b88a835b3a5 --- /dev/null +++ b/src/mame/drivers/mephisto_berlin.cpp @@ -0,0 +1,197 @@ +// license:BSD-3-Clause +// copyright-holders:Sandro Ronco +/****************************************************************************** + +Mephisto Berlin 68000 / Berlin Professional 68020 +Berlin Professional has the same engine as Mephisto Genius. + +TODO: +- does it have ROM waitstates like mephisto_modular? + +Undocumented buttons: +- holding ENTER and LEFT cursor on boot runs diagnostics +- holding CLEAR on boot clears battery backed RAM + +******************************************************************************/ + +#include "emu.h" + +#include "cpu/m68000/m68000.h" +#include "machine/bankdev.h" +#include "machine/nvram.h" +#include "machine/mmboard.h" +#include "video/mmdisplay2.h" + +// internal artwork +#include "mephisto_berlin.lh" + + +class berlin_state : public driver_device +{ +public: + berlin_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_board(*this, "board") + , m_keys(*this, "KEY") + { } + + void berlin(machine_config &config); + void berlinp(machine_config &config); + +private: + DECLARE_READ8_MEMBER(input_r); + + void berlin_mem(address_map &map); + void berlinp_mem(address_map &map); + void nvram_map(address_map &map); + + required_device<cpu_device> m_maincpu; + required_device<mephisto_board_device> m_board; + required_ioport m_keys; +}; + + + +/****************************************************************************** + I/O +******************************************************************************/ + +READ8_MEMBER(berlin_state::input_r) +{ + if (m_board->mux_r(space, offset) == 0xff) + return m_keys->read(); + else + return m_board->input_r(space, offset) ^ 0xff; +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void berlin_state::nvram_map(address_map &map) +{ + // nvram is 8-bit (8KB) + map(0x0000, 0x1fff).ram().share("nvram"); +} + +void berlin_state::berlin_mem(address_map &map) +{ + map(0x000000, 0x01ffff).rom(); + map(0x800000, 0x87ffff).ram(); + map(0x900000, 0x903fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask16(0xff00); + map(0xa00000, 0xa00000).r(FUNC(berlin_state::input_r)); + map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::mux_w)); + map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xd00008, 0xd00008).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0xe00000, 0xe00000).w(m_board, FUNC(mephisto_board_device::led_w)); +} + +void berlin_state::berlinp_mem(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); + map(0x400000, 0x4fffff).ram(); + map(0x800000, 0x800000).r(FUNC(berlin_state::input_r)); + map(0x900000, 0x900000).w(m_board, FUNC(mephisto_board_device::mux_w)); + map(0xa00000, 0xa00000).w(m_board, FUNC(mephisto_board_device::led_w)); + map(0xb00000, 0xb00000).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xd00000, 0xd07fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( berlin ) + PORT_START("KEY") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NEW GAME (1/2)") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_F1) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NEW GAME (2/2)") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_F1) +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void berlin_state::berlin(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 12_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &berlin_state::berlin_mem); + m_maincpu->set_periodic_int(FUNC(berlin_state::irq2_line_hold), attotime::from_hz(750)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + ADDRESS_MAP_BANK(config, "nvram_map").set_map(&berlin_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13); + + MEPHISTO_BUTTONS_BOARD(config, m_board); + MEPHISTO_DISPLAY_MODULE2(config, "display"); + config.set_default_layout(layout_mephisto_berlin); +} + +void berlin_state::berlinp(machine_config &config) +{ + berlin(config); + + /* basic machine hardware */ + M68EC020(config.replace(), m_maincpu, 24.576_MHz_XTAL); // M68EC020RP25 + m_maincpu->set_addrmap(AS_PROGRAM, &berlin_state::berlinp_mem); + + const attotime irq_period = attotime::from_hz(24.576_MHz_XTAL / 0x8000); // 750Hz + m_maincpu->set_periodic_int(FUNC(berlin_state::irq2_line_hold), irq_period); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( berl16 ) + ROM_REGION16_BE( 0x20000, "maincpu", 0 ) + ROM_SYSTEM_BIOS( 0, "v003", "V0.03" ) // B003 8C60 CA47 + ROMX_LOAD("berlin_68000_even.bin", 0x00000, 0x10000, CRC(31337f15) SHA1(0dcacb153a6f8376e6f1c2f3e57e60aad4370740), ROM_SKIP(1) | ROM_BIOS(0) ) + ROMX_LOAD("berlin_68000_odd_b003.bin", 0x00001, 0x10000, CRC(cc146819) SHA1(e4b2c6e496eff4a657a0718be292f563fb4e5688), ROM_SKIP(1) | ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v002", "V0.02" ) // B002 8C59 CA47 + ROMX_LOAD("berlin_68000_even.bin", 0x00000, 0x10000, CRC(31337f15) SHA1(0dcacb153a6f8376e6f1c2f3e57e60aad4370740), ROM_SKIP(1) | ROM_BIOS(1) ) + ROMX_LOAD("berlin_68000_odd_b002.bin", 0x00001, 0x10000, CRC(513a95f2) SHA1(cbaef0078a119163577e76a78b2110939b17be6b), ROM_SKIP(1) | ROM_BIOS(1) ) +ROM_END + +ROM_START( berlinp ) // B400 8AA1 E785 + ROM_REGION32_BE( 0x40000, "maincpu", 0 ) + ROM_LOAD("berlin_020_v400.u2", 0x00000, 0x40000, CRC(82fbaf6e) SHA1(729b7cef3dfaecc4594a6178fc4ba6015afa6202) ) +ROM_END + +ROM_START( berl16l ) // B500 ABD5 CA47 + ROM_REGION16_BE( 0x20000, "maincpu", 0 ) + ROM_LOAD16_BYTE("berlin_68000_london_even.bin", 0x00000, 0x10000, CRC(0ccddbc6) SHA1(90effdc9f2811a24d450b74ccfb24995ce896b86) ) + ROM_LOAD16_BYTE("berlin_68000_london_odd.bin", 0x00001, 0x10000, CRC(5edac658) SHA1(18ebebc5ceffd9a01798d8a3709875120bd096f7) ) +ROM_END + +ROM_START( berlinpl ) // B500 53CA 3DCE + ROM_REGION32_BE( 0x40000, "maincpu", 0 ) + ROM_LOAD("berlin_020_london.u2", 0x00000, 0x40000, CRC(d75e170f) SHA1(ac0ebdaa114abd4fef87361a03df56928768b1ae) ) +ROM_END + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +CONS( 1992, berl16, 0, 0, berlin, berlin, berlin_state, empty_init, "Hegener + Glaser", "Mephisto Berlin 68000", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1994, berlinp, 0, 0, berlinp, berlin, berlin_state, empty_init, "Hegener + Glaser", "Mephisto Berlin Professional 68020", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1996, berl16l, berl16, 0, berlin, berlin, berlin_state, empty_init, "Richard Lang", "Mephisto Berlin 68000 (London upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1996, berlinpl, berlinp, 0, berlinp, berlin, berlin_state, empty_init, "Richard Lang", "Mephisto Berlin Professional 68020 (London upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_brikett.cpp b/src/mame/drivers/mephisto_brikett.cpp index bb688c7b334..5fce26cd829 100644 --- a/src/mame/drivers/mephisto_brikett.cpp +++ b/src/mame/drivers/mephisto_brikett.cpp @@ -91,7 +91,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(reset_button) { if (newval) machine_reset(); } DECLARE_INPUT_CHANGED_MEMBER(switch_cpu_freq) { set_cpu_freq(); } - // machine drivers + // machine configs void mephisto(machine_config &config); void mephisto2(machine_config &config); void mephisto2e(machine_config &config); @@ -251,6 +251,7 @@ READ8_MEMBER(brikett_state::input_r) WRITE8_MEMBER(brikett_state::esb_w) { + // CDP1852 SR + DO0-DO7 goes to external port, to chessboard if (!m_inputs[5].read_safe(0)) { // chessboard disabled @@ -258,14 +259,14 @@ WRITE8_MEMBER(brikett_state::esb_w) return; } - // CDP1852 SR clocks CD4017, goes to external port together with DO0-DO7 + // SR clocks CD4017 // 4017 Q0: N/C // 4017 Q1 + d0-d7: 74374 to led data // 4017 Q2 + d0-d7: 74373 to row select // 4017 Q2-Q9: column select m_esb_select = (m_esb_select + 1) % 10; - // d0-d7 ANDed together: 4017 reset + // DO0-DO7 ANDed together: 4017 reset if (data == 0xff) m_esb_select = 0; @@ -405,7 +406,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void brikett_state::mephisto(machine_config &config) diff --git a/src/mame/drivers/mephisto_mm1.cpp b/src/mame/drivers/mephisto_mm1.cpp index f80a51e6490..bb21c67104d 100644 --- a/src/mame/drivers/mephisto_mm1.cpp +++ b/src/mame/drivers/mephisto_mm1.cpp @@ -67,7 +67,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(mirage_switch_sensor_type); - // machine drivers + // machine configs void mirage(machine_config &config); void mm1(machine_config &config); @@ -349,7 +349,7 @@ static INPUT_PORTS_START( mirage ) PORT_START("FAKE") // module came with buttons sensorboard by default PORT_CONFNAME( 0x01, 0x00, "Board Sensors" ) PORT_CHANGED_MEMBER(DEVICE_SELF, mm1_state, mirage_switch_sensor_type, 0) - PORT_CONFSETTING( 0x00, "Buttons (Mirage)" ) + PORT_CONFSETTING( 0x00, "Buttons (Mobil)" ) PORT_CONFSETTING( 0x01, "Magnets (Modular)" ) INPUT_PORTS_END @@ -361,7 +361,7 @@ INPUT_CHANGED_MEMBER(mm1_state::mirage_switch_sensor_type) /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void mm1_state::mirage(machine_config &config) diff --git a/src/mame/drivers/mephisto_mm2.cpp b/src/mame/drivers/mephisto_mm2.cpp index a34bc1aee5c..421b3d86445 100644 --- a/src/mame/drivers/mephisto_mm2.cpp +++ b/src/mame/drivers/mephisto_mm2.cpp @@ -1,4 +1,4 @@ -// license:LGPL-2.1+ +// license:BSD-3-Clause // copyright-holders:Dirk Verwiebe, Cowering /****************************************************************************** Mephisto 4 + 5 Chess Computer @@ -368,7 +368,7 @@ INPUT_CHANGED_MEMBER(mephisto_state::reset_button) /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void mephisto_state::rebel5(machine_config &config) @@ -471,50 +471,54 @@ void mephisto_state::mm2(machine_config &config) ROM_START( rebel5 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS("v2") + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) - ROMX_LOAD("rebel5_v1.rom", 0x8000, 0x8000, CRC(8d02e1ef) SHA1(9972c75936613bd68cfd3fe62bd222e90e8b1083), ROM_BIOS(0)) + ROMX_LOAD("rebell_5.12.86", 0x8000, 0x8000, CRC(8d02e1ef) SHA1(9972c75936613bd68cfd3fe62bd222e90e8b1083), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "v2", "V2" ) - ROMX_LOAD("rebel5_v2.rom", 0x8000, 0x8000, CRC(17232752) SHA1(3cd6893c0071f3dc02785bf99f1950eed81eba39), ROM_BIOS(1)) + ROMX_LOAD("rebel5_v2.rom", 0x8000, 0x8000, CRC(17232752) SHA1(3cd6893c0071f3dc02785bf99f1950eed81eba39), ROM_BIOS(1) ) ROM_END ROM_START( mm2 ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_DEFAULT_BIOS("v42") // no official versioning, chronological order is assumed here from hex compare + ROM_DEFAULT_BIOS("v41") // no official versioning, chronological order is assumed here from hex compare + ROM_SYSTEM_BIOS( 0, "v1", "V1 (2 EPROMs)" ) - ROMX_LOAD("mm2_v1_1.bin", 0x8000, 0x4000, CRC(b91dab77) SHA1(67762304afe51fb8f1eb91259567b2451bf9bbfd), ROM_BIOS(0)) - ROMX_LOAD("mm2_v1_2.bin", 0xc000, 0x4000, CRC(01143cc1) SHA1(f78474b410dbecb209aa23ef81e9f894e8b54942), ROM_BIOS(0)) + ROMX_LOAD("mm2_v1_1.bin", 0x8000, 0x4000, CRC(b91dab77) SHA1(67762304afe51fb8f1eb91259567b2451bf9bbfd), ROM_BIOS(0) ) + ROMX_LOAD("mm2_v1_2.bin", 0xc000, 0x4000, CRC(01143cc1) SHA1(f78474b410dbecb209aa23ef81e9f894e8b54942), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "v2", "V2 (2 EPROMs)" ) - ROMX_LOAD("mm2_v2_1.bin", 0x8000, 0x4000, CRC(e2daac82) SHA1(c9fa59ca92362f8ee770733073bfa2ab8c7904ad), ROM_BIOS(1)) - ROMX_LOAD("mm2_v2_2.bin", 0xc000, 0x4000, CRC(5e296939) SHA1(badd2a377259cf738cd076d8fb245c3dc284c24d), ROM_BIOS(1)) + ROMX_LOAD("mm2_v2_1.bin", 0x8000, 0x4000, CRC(e2daac82) SHA1(c9fa59ca92362f8ee770733073bfa2ab8c7904ad), ROM_BIOS(1) ) + ROMX_LOAD("mm2_v2_2.bin", 0xc000, 0x4000, CRC(5e296939) SHA1(badd2a377259cf738cd076d8fb245c3dc284c24d), ROM_BIOS(1) ) ROM_SYSTEM_BIOS( 2, "v3", "V3 (1 EPROM)" ) - ROMX_LOAD("300", 0x8000, 0x8000, CRC(60c777d4) SHA1(a77d678be60094073275558b4e8f0d34b43dd9ae), ROM_BIOS(2)) // D27C256D-20 + ROMX_LOAD("300", 0x8000, 0x8000, CRC(60c777d4) SHA1(a77d678be60094073275558b4e8f0d34b43dd9ae), ROM_BIOS(2) ) // D27C256D-20 ROM_SYSTEM_BIOS( 3, "v41", "V4 (1 EPROM)" ) // v41 and v42 are binary identical - ROMX_LOAD("400", 0x8000, 0x8000, CRC(e8c1f431) SHA1(c32dfa66eefbf3e539438d2fe6e6916f78a128be), ROM_BIOS(3)) // HN27C256G-20 + ROMX_LOAD("400", 0x8000, 0x8000, CRC(e8c1f431) SHA1(c32dfa66eefbf3e539438d2fe6e6916f78a128be), ROM_BIOS(3) ) // HN27C256G-20 ROM_SYSTEM_BIOS( 4, "v42", "V4 (2 EPROMs)" ) - ROMX_LOAD("mm2_v4_1.bin", 0x8000, 0x4000, CRC(e9adcb8f) SHA1(498f48f96678f7bf429fd43e4f392ec6dd649fc6), ROM_BIOS(4)) - ROMX_LOAD("mm2_v4_2.bin", 0xc000, 0x4000, CRC(d40cbfc2) SHA1(4e9b19b1a0ad97868b31d7a55143a1778110cc96), ROM_BIOS(4)) + ROMX_LOAD("mm2_v4_1.bin", 0x8000, 0x4000, CRC(e9adcb8f) SHA1(498f48f96678f7bf429fd43e4f392ec6dd649fc6), ROM_BIOS(4) ) + ROMX_LOAD("mm2_v4_2.bin", 0xc000, 0x4000, CRC(d40cbfc2) SHA1(4e9b19b1a0ad97868b31d7a55143a1778110cc96), ROM_BIOS(4) ) ROM_END ROM_START( bup ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS("v2") + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) - ROMX_LOAD("bup_v1_1.bin", 0x8000, 0x4000, CRC(e1e9625a) SHA1(8a757e28b7afca2a092f8ff419087e06b07b743e), ROM_BIOS(0)) - ROMX_LOAD("bup_v1_2.bin", 0xc000, 0x4000, CRC(708338ea) SHA1(d617c4aa2161865a22b4b0646ba793f8a1fda863), ROM_BIOS(0)) + ROMX_LOAD("bup_v1_1.bin", 0x8000, 0x4000, CRC(e1e9625a) SHA1(8a757e28b7afca2a092f8ff419087e06b07b743e), ROM_BIOS(0) ) + ROMX_LOAD("bup_v1_2.bin", 0xc000, 0x4000, CRC(708338ea) SHA1(d617c4aa2161865a22b4b0646ba793f8a1fda863), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "v2", "V2" ) - ROMX_LOAD("bup_v2_1.bin", 0x8000, 0x4000, CRC(e1e9625a) SHA1(8a757e28b7afca2a092f8ff419087e06b07b743e), ROM_BIOS(1)) - ROMX_LOAD("bup_v2_2.bin", 0xc000, 0x4000, CRC(6db30b80) SHA1(df4b379c4e916dff6b4110ec9c3591a9620c3424), ROM_BIOS(1)) + ROMX_LOAD("bup_v2_1.bin", 0x8000, 0x4000, CRC(e1e9625a) SHA1(8a757e28b7afca2a092f8ff419087e06b07b743e), ROM_BIOS(1) ) + ROMX_LOAD("bup_v2_2.bin", 0xc000, 0x4000, CRC(6db30b80) SHA1(df4b379c4e916dff6b4110ec9c3591a9620c3424), ROM_BIOS(1) ) ROM_END ROM_START( mm4 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS("v3") + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) - ROMX_LOAD("600", 0x8000, 0x8000, CRC(837d49b9) SHA1(9fb2dfaaeca2559ce582211137635c069180e95f), ROM_BIOS(0)) + ROMX_LOAD("600", 0x8000, 0x8000, CRC(837d49b9) SHA1(9fb2dfaaeca2559ce582211137635c069180e95f), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "v2", "V2" ) - ROMX_LOAD("700", 0x8000, 0x8000, CRC(c97da840) SHA1(10bd2a391338ed2e417b35dcb6396ab4a4e360f0), ROM_BIOS(1)) + ROMX_LOAD("700", 0x8000, 0x8000, CRC(c97da840) SHA1(10bd2a391338ed2e417b35dcb6396ab4a4e360f0), ROM_BIOS(1) ) ROM_SYSTEM_BIOS( 2, "v3", "V3" ) - ROMX_LOAD("710", 0x8000, 0x8000, CRC(f68a4124) SHA1(d1d03a9aacc291d5cb720d2ee2a209eeba13a36c), ROM_BIOS(2)) + ROMX_LOAD("710", 0x8000, 0x8000, CRC(f68a4124) SHA1(d1d03a9aacc291d5cb720d2ee2a209eeba13a36c), ROM_BIOS(2) ) ROM_END ROM_START( mm4tk ) @@ -525,15 +529,16 @@ ROM_END ROM_START( mm5 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS("v2") + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) - ROMX_LOAD("mm50.rom", 0x8000, 0x8000, CRC(fcfa7e6e) SHA1(afeac3a8c957ba58cefaa27b11df974f6f2066da), ROM_BIOS(0)) + ROMX_LOAD("mm50.rom", 0x8000, 0x8000, CRC(fcfa7e6e) SHA1(afeac3a8c957ba58cefaa27b11df974f6f2066da), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "v2", "V2" ) - ROMX_LOAD("mephisto5.rom", 0x8000, 0x8000, CRC(89c3d9d2) SHA1(77cd6f8eeb03c713249db140d2541e3264328048), ROM_BIOS(1)) + ROMX_LOAD("mephisto5.rom", 0x8000, 0x8000, CRC(89c3d9d2) SHA1(77cd6f8eeb03c713249db140d2541e3264328048), ROM_BIOS(1) ) ROM_END ROM_START( mm5p ) - ROM_REGION(0x10000,"maincpu",0) - ROM_LOAD("buch.bin", 0x0000, 0x8000, CRC(534607c7) SHA1(d0347a5f8dc4cf6001f649aa13e7a7fe75bec5b9) ) // 1st half empty + ROM_REGION( 0x10000,"maincpu", 0 ) + ROM_LOAD("buch.bin", 0x0000, 0x8000, CRC(534607c7) SHA1(d0347a5f8dc4cf6001f649aa13e7a7fe75bec5b9) ) // 1st half empty ROM_LOAD("programm.bin", 0x8000, 0x8000, CRC(ee22b974) SHA1(37267507be30ee84051bc94c3a63fb1298a00261) ) ROM_END diff --git a/src/mame/drivers/mephisto_modena.cpp b/src/mame/drivers/mephisto_modena.cpp index 65fd0319994..e41b0f59e7d 100644 --- a/src/mame/drivers/mephisto_modena.cpp +++ b/src/mame/drivers/mephisto_modena.cpp @@ -9,14 +9,15 @@ Hold Pawn + Knight buttons at boot for test mode. **************************************************************************************************/ - #include "emu.h" + #include "cpu/m6502/m65c02.h" #include "machine/nvram.h" #include "machine/mmboard.h" #include "machine/timer.h" #include "sound/dac.h" #include "sound/volt_reg.h" + #include "speaker.h" #include "mephisto_modena.lh" @@ -59,10 +60,30 @@ private: TIMER_DEVICE_CALLBACK_MEMBER(nmi_on) { m_maincpu->set_input_line(M6502_NMI_LINE, ASSERT_LINE); } TIMER_DEVICE_CALLBACK_MEMBER(nmi_off) { m_maincpu->set_input_line(M6502_NMI_LINE, CLEAR_LINE); } - uint8_t m_digits_idx; - uint8_t m_io_ctrl; + uint8_t m_digits_idx = 0; + uint8_t m_io_ctrl = 0; }; +void mephisto_modena_state::machine_start() +{ + m_digits.resolve(); + m_leds.resolve(); + + save_item(NAME(m_digits_idx)); + save_item(NAME(m_io_ctrl)); +} + +void mephisto_modena_state::machine_reset() +{ + m_digits_idx = 0; + m_io_ctrl = 0; +} + + + +/****************************************************************************** + I/O +******************************************************************************/ READ8_MEMBER(mephisto_modena_state::input_r) { @@ -98,6 +119,12 @@ WRITE8_MEMBER(mephisto_modena_state::digits_w) m_digits_idx = (m_digits_idx + 1) & 3; } + + +/****************************************************************************** + Address Maps +******************************************************************************/ + void mephisto_modena_state::modena_mem(address_map &map) { map(0x0000, 0x1fff).ram().share("nvram"); @@ -109,6 +136,11 @@ void mephisto_modena_state::modena_mem(address_map &map) } + +/****************************************************************************** + Input Ports +******************************************************************************/ + static INPUT_PORTS_START( modena ) PORT_START("KEY") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BOOK") PORT_CODE(KEYCODE_B) @@ -122,25 +154,14 @@ static INPUT_PORTS_START( modena ) INPUT_PORTS_END -void mephisto_modena_state::machine_start() -{ - m_digits.resolve(); - m_leds.resolve(); - - save_item(NAME(m_digits_idx)); - save_item(NAME(m_io_ctrl)); -} - -void mephisto_modena_state::machine_reset() -{ - m_digits_idx = 0; - m_io_ctrl = 0; -} +/****************************************************************************** + Machine Configs +******************************************************************************/ void mephisto_modena_state::modena(machine_config &config) { - M65C02(config, m_maincpu, XTAL(4'194'304)); // W65C02SP + M65C02(config, m_maincpu, XTAL(4'194'304)); // W65C02SP or RP65C02G m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_modena_state::modena_mem); timer_device &nmi_on(TIMER(config, "nmi_on")); nmi_on.configure_periodic(FUNC(mephisto_modena_state::nmi_on), attotime::from_hz(XTAL(4'194'304) / (1 << 13))); @@ -160,18 +181,28 @@ void mephisto_modena_state::modena(machine_config &config) } -ROM_START(modena) - ROM_REGION(0x8000, "maincpu", 0) - ROM_SYSTEM_BIOS( 0, "v1", "v1" ) - ROMX_LOAD("modena 12aug1992.bin", 0x0000, 0x8000, CRC(dd7b4920) SHA1(4606b9d1f8a30180aabedfc0ed3cca0c96618524), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v1alt", "v1alt" ) - ROMX_LOAD("27c256,457f.bin", 0x0000, 0x8000, CRC(2889082c) SHA1(b63f0d856793b4f87471837e2219ce2a42fe18de), ROM_BIOS(1)) + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( modena ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("v2") + + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) + ROMX_LOAD("modena_4929_270192.u3", 0x0000, 0x8000, CRC(99212677) SHA1(f0565e5441fb38df201176d01793c953886b0303), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v2", "V2" ) + ROMX_LOAD("modena_12aug1992_441d.u3", 0x0000, 0x8000, CRC(dd7b4920) SHA1(4606b9d1f8a30180aabedfc0ed3cca0c96618524), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS( 2, "v2a", "V2A" ) + ROMX_LOAD("27c256_457f.u3", 0x0000, 0x8000, CRC(2889082c) SHA1(b63f0d856793b4f87471837e2219ce2a42fe18de), ROM_BIOS(2) ) ROM_END + /*************************************************************************** Game driver(s) ***************************************************************************/ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -CONS( 1992, modena, 0, 0, modena, modena, mephisto_modena_state, empty_init, "Hegener + Glaser", "Mephisto Modena", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +CONS( 1992, modena, 0, 0, modena, modena, mephisto_modena_state, empty_init, "Hegener + Glaser", "Mephisto Modena", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_modular.cpp b/src/mame/drivers/mephisto_modular.cpp index 46c763dae83..5e344b0ba6e 100644 --- a/src/mame/drivers/mephisto_modular.cpp +++ b/src/mame/drivers/mephisto_modular.cpp @@ -1,223 +1,347 @@ -// license:LGPL-2.1+ -// copyright-holders:Dirk Verwiebe, Cowering, Sandro Ronco +// license:BSD-3-Clause +// copyright-holders:Dirk Verwiebe, Cowering, Sandro Ronco, hap /****************************************************************************** -Hegener + Glaser Mephisto Chess Computers using plugin modules +Hegener + Glaser Mephisto chesscomputers with plugin modules +3rd generation (2nd gen is Glasgow/Amsterdam, 1st gen is MM series) -(most of the magnetic sensor versions with 680x0 family modules) After Roma, H+G started naming the different versions 16 Bit/32 Bit instead of 68000/68020. With Genius and the TM versions, they still applied "68030". -Almeria 16 Bit 12Mhz -Almeria 32 Bit 12Mhz -Portorose 16 Bit 12Mhz -Portorose 32 Bit 12Mhz -Lyon 16 Bit 12Mhz -Lyon 32 Bit 12Mhz -Vancouver 16 Bit 12Mhz -Vancouver 32 Bit 12Mhz -Genius 68030 V4.00 33.333 Mhz -Genius 68030 V4.01 33.333 Mhz -Berlin Pro 68020 24.576 Mhz (not modular board, but otherwise close to milano) -Berlin Pro (London) 68020 24.576 Mhz (not modular board, but otherwise close to milano) -London 68030 V5.00k 33.333 Mhz (probably the Genius 3/4 update ROM) +Almeria 16 Bit 12MHz +Almeria 32 Bit 12MHz +Portorose 16 Bit 12MHz +Portorose 32 Bit 12MHz +Lyon 16 Bit 12MHz +Lyon 32 Bit 12MHz +Vancouver 16 Bit 12MHz +Vancouver 32 Bit 12MHz +Genius 68030 33.3330MHz The London program (1994 competition) is not a dedicated module, but an EPROM upgrade released by Richard Lang for Almeria, Lyon, Portorose and Vancouver modules, and also available as upgrades for Berlin/Berlin Pro and Genius. -No Mephisto modules were released anymore after Saitek took over H+G, engine is assumed -to be same as Saitek's 1996 Mephisto London 68030 (limited release TM version). +No Mephisto modules were released anymore after Saitek took over H+G, engine is the +same as Saitek's 1996 Mephisto London 68030 (limited release TM version). + +For the dedicated tournament machines, see mephisto_modular_tm.cpp TODO: -- add Bavaria sensor support (unknown1,2,3 handlers in current driver) -- custom handler to read/write the Battery RAM so 68000 can share files with 020/030 (real modular machine can do this) -- add the missing machines.. including the very rare overclocked 'TM' Tournament Machines -- match I/S= diag speed test with real hardware (good test for proper waitstates) -- remove gen32/gen32l ROM patch -- move berlin to its own driver file +- match I/S= diag speed test with real hardware (good test for proper waitstates), + especially gen32 is way too fast when comparing sound pitch Undocumented buttons: -- holding ENTER and LEFT cursor on cold boot runs diagnostics on modular 680x0 boards -- holding UP and RIGHT cursor will clear the Battery Backed RAM on modular 680x0 boards -- holding CLEAR clears Battery Backed RAM on the Berlin (Pro) 68020 +- holding ENTER and LEFT cursor on boot runs diagnostics +- holding CLEAR on boot will clear the battery backed RAM + +=============================================================================== + +Bavaria piece recognition board: +------------------------------------------------- +| | +| 74HC21 74HC74 74HC238 | +| 74HC4040 74HC574 74HC173 74HC374 | +| ROM XTAL 74HC368 74HC374 | +| 74HC4024 74HC32 74HC139 74HC374 | +| | +------------------------------------------------- +XTAL = 7.37280MHz +ROM = TC57256AD-12, sine table + +Only usable with Weltmeister modules, Portorose until London (aka this MAME driver), but +it does not work on Portorose 1.01. See German patent DE4207534 for detailed description. + +Each piece has a Tank circuit, and in each square of the board there is a coil. +By scanning all the squares at different frequencies, the resonance frequency +of every piece is obtained in order to identify it. + +Coil resonance frequency: +wJ, bJ, wK, bK, wQ, bQ, wP, bP, wB, bB, wN, bN, wR, bR (J = Joker) +460, 421, 381, 346, 316, 289, 259, 238, 217, 203, 180, 167, 154, 138 kHz +14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 piece ID + +In MAME, to switch between the magnets chessboard and the Bavaria board, there's +a configuration port. It's also doable by clicking on the sensorboard UI header +(where it says "SB.MAGNETS" or "SB.BAVARIA"). The board gets detected at boot, +so restart or reset(F3) afterwards. + +Reminder: unsupported on Almeria and Portorose 1.01, this is not a bug. ******************************************************************************/ #include "emu.h" + #include "cpu/m68000/m68000.h" +#include "machine/bankdev.h" #include "machine/nvram.h" +#include "machine/timer.h" #include "machine/mmboard.h" -#include "screen.h" -#include "speaker.h" +#include "video/mmdisplay2.h" // internal artwork -#include "mephisto_alm16.lh" -#include "mephisto_alm32.lh" -#include "mephisto_berlin.lh" -#include "mephisto_gen32.lh" +#include "mephisto_alm16.lh" // clickable +#include "mephisto_alm32.lh" // clickable +#include "mephisto_gen32.lh" // clickable + +namespace { class mmodular_state : public driver_device { public: - mmodular_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) + mmodular_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_board(*this, "board"), + m_bav_busy(*this, "bav_busy"), + m_fake(*this, "FAKE") { } + // machine configs + void alm16(machine_config &config); void alm32(machine_config &config); - void van32(machine_config &config); + void port16(machine_config &config); + void port32(machine_config &config); void van16(machine_config &config); - void alm16(machine_config &config); + void van32(machine_config &config); void gen32(machine_config &config); - void init_gen32(); + DECLARE_INPUT_CHANGED_MEMBER(switch_sensor_type) { set_sbtype(newval); } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; private: + // devices/pointers + required_device<cpu_device> m_maincpu; + required_device<mephisto_board_device> m_board; + required_device<timer_device> m_bav_busy; + optional_ioport m_fake; + + // address maps void alm16_mem(address_map &map); void alm32_mem(address_map &map); - void gen32_mem(address_map &map); + void port16_mem(address_map &map); + void port32_mem(address_map &map); void van16_mem(address_map &map); void van32_mem(address_map &map); + void gen32_mem(address_map &map); + void nvram_map(address_map &map); + + // I/O handlers + DECLARE_WRITE8_MEMBER(bavaria_w); + DECLARE_READ8_MEMBER(bavaria1_r); + DECLARE_READ8_MEMBER(bavaria2_r); + + u8 spawn_cb(offs_t offset); + void set_sbtype(ioport_value newval); + + u8 m_bav_data = 0; }; +void mmodular_state::machine_start() +{ + save_item(NAME(m_bav_data)); +} -class berlinp_state : public mmodular_state +void mmodular_state::machine_reset() { -public: - berlinp_state(const machine_config &mconfig, device_type type, const char *tag) - : mmodular_state(mconfig, type, tag) - , m_board(*this, "board") - , m_keys(*this, "KEY") - { } + m_bav_data = 0; + set_sbtype(m_fake.read_safe(0) & 1); +} - void berl16(machine_config &config); - void berlinp(machine_config &config); -private: - DECLARE_READ8_MEMBER(berlinp_input_r); - void berl16_mem(address_map &map); - void berlinp_mem(address_map &map); +/****************************************************************************** + I/O +******************************************************************************/ - required_device<mephisto_board_device> m_board; - required_ioport m_keys; -}; +// Bavaria board + +void mmodular_state::set_sbtype(ioport_value newval) +{ + m_board->get()->set_type(newval ? sensorboard_device::INDUCTIVE : sensorboard_device::MAGNETS); + + if (machine().phase() == machine_phase::RUNNING) + { + m_board->get()->cancel_hand(); + m_board->get()->refresh(); + } +} + +u8 mmodular_state::spawn_cb(offs_t offset) +{ + // ignore jokers + return (!m_board->get()->is_inductive() && offset > 12) ? 0 : offset; +} + +WRITE8_MEMBER(mmodular_state::bavaria_w) +{ + if (!m_board->get()->is_inductive()) + return; + + // d0-d5: select square + // d6: no function? + // d7: start search + if (m_bav_data & ~data & 0x80) + m_bav_busy->adjust(attotime::from_usec(3000)); + + m_bav_data = data; +} + +READ8_MEMBER(mmodular_state::bavaria1_r) +{ + if (!m_board->get()->is_inductive()) + return 0; + + // d0-d3: piece id + // other: unused? + static const u8 piece_id[0x10] = + { 0, 8, 4, 6, 2, 10, 12, 7, 3, 5, 1, 9, 11, 14, 13, 0 }; + + int x = m_bav_data >> 3 & 7; + int y = m_bav_data & 7; + + return piece_id[m_board->get()->read_sensor(x, y) & 0xf]; +} + +READ8_MEMBER(mmodular_state::bavaria2_r) +{ + if (!m_board->get()->is_inductive()) + return 0; + + // d7: busy signal + // other: unused? + return m_bav_busy->enabled() ? 0x80 : 0; +} + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void mmodular_state::nvram_map(address_map &map) +{ + // nvram is 8-bit (8KB) + map(0x0000, 0x1fff).ram().share("nvram"); +} + void mmodular_state::alm16_mem(address_map &map) { map(0x000000, 0x01ffff).rom(); - - map(0xc00000, 0xc00000).r("board", FUNC(mephisto_board_device::input_r)); + map(0x400000, 0x47ffff).ram(); + map(0x800000, 0x803fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask16(0xff00); + map(0xc00000, 0xc00000).r("board", FUNC(mephisto_board_device::input_r)); // 0xff on Bavaria map(0xc80000, 0xc80000).w("board", FUNC(mephisto_board_device::mux_w)); map(0xd00000, 0xd00000).w("board", FUNC(mephisto_board_device::led_w)); + map(0xd00000, 0xd00001).nopr(); // clr.b map(0xf00000, 0xf00003).portr("KEY1"); map(0xf00004, 0xf00007).portr("KEY2"); map(0xf00008, 0xf0000b).portr("KEY3"); - map(0xd80000, 0xd80000).w("display", FUNC(mephisto_display_modul_device::latch_w)); - map(0xd80008, 0xd80008).w("display", FUNC(mephisto_display_modul_device::io_w)); - - map(0x400000, 0x47ffff).ram(); - map(0x800000, 0x803fff).ram().share("nvram"); + map(0xd80000, 0xd80000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xd80008, 0xd80008).w("display", FUNC(mephisto_display_module2_device::io_w)); } -void mmodular_state::van16_mem(address_map &map) +void mmodular_state::port16_mem(address_map &map) { alm16_mem(map); - map(0x000000, 0x03ffff).rom(); + map(0xe80002, 0xe80002).r(FUNC(mmodular_state::bavaria1_r)); + map(0xe80004, 0xe80004).w(FUNC(mmodular_state::bavaria_w)); + map(0xe80006, 0xe80006).r(FUNC(mmodular_state::bavaria2_r)); +} + +void mmodular_state::van16_mem(address_map &map) +{ + port16_mem(map); -// map(0xe80004, 0xe80005).w(FUNC(mmodular_state::write_unknown2)); // Bavaria sensors -// map(0xe80002, 0xe80003).r(FUNC(mmodular_state::read_unknown1)); // Bavaria sensors -// map(0xe80006, 0xe80007).r(FUNC(mmodular_state::read_unknown3)); // Bavaria sensors + map(0x020000, 0x03ffff).rom(); } + void mmodular_state::alm32_mem(address_map &map) { map(0x00000000, 0x0001ffff).rom(); - - map(0x800000fc, 0x800000fc).r("board", FUNC(mephisto_board_device::input_r)); - map(0x88000000, 0x88000007).w("board", FUNC(mephisto_board_device::mux_w)).umask32(0xff000000); - map(0x90000000, 0x90000007).w("board", FUNC(mephisto_board_device::led_w)).umask32(0xff000000); + map(0x40000000, 0x400fffff).ram(); map(0x800000ec, 0x800000ef).portr("KEY1"); map(0x800000f4, 0x800000f7).portr("KEY2"); map(0x800000f8, 0x800000fb).portr("KEY3"); - map(0xa0000000, 0xa0000000).w("display", FUNC(mephisto_display_modul_device::latch_w)); - map(0xa0000010, 0xa0000010).w("display", FUNC(mephisto_display_modul_device::io_w)); - - map(0x40000000, 0x400fffff).ram(); - map(0xa8000000, 0xa8007fff).ram().share("nvram"); + map(0x800000fc, 0x800000fc).r("board", FUNC(mephisto_board_device::input_r)); + map(0x88000000, 0x88000007).w("board", FUNC(mephisto_board_device::mux_w)).umask32(0xff000000); + map(0x90000000, 0x90000007).w("board", FUNC(mephisto_board_device::led_w)).umask32(0xff000000); + map(0xa0000000, 0xa0000000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xa0000010, 0xa0000010).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0xa8000000, 0xa8007fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000); } - -void mmodular_state::van32_mem(address_map &map) +void mmodular_state::port32_mem(address_map &map) { alm32_mem(map); - map(0x00000000, 0x0003ffff).rom(); + map(0x98000004, 0x98000004).r(FUNC(mmodular_state::bavaria1_r)); + map(0x98000008, 0x98000008).w(FUNC(mmodular_state::bavaria_w)); + map(0x9800000c, 0x9800000c).r(FUNC(mmodular_state::bavaria2_r)); +} + +void mmodular_state::van32_mem(address_map &map) +{ + port32_mem(map); -// map(0x98000008, 0x9800000b).w(FUNC(mmodular_state::write_unknown2)); // Bavaria sensors -// map(0x98000004, 0x98000007).r(FUNC(mmodular_state::read_unknown1)); // Bavaria sensors -// map(0x9800000c, 0x9800000f).r(FUNC(mmodular_state::read_unknown3)); // Bavaria sensors + map(0x00020000, 0x0003ffff).rom(); } + void mmodular_state::gen32_mem(address_map &map) { map(0x00000000, 0x0003ffff).rom(); - + map(0x40000000, 0x4007ffff).ram(); + map(0x80000000, 0x8003ffff).ram(); + map(0xc0000000, 0xc0000000).r("board", FUNC(mephisto_board_device::input_r)); + map(0xc8000000, 0xc8000003).nopw(); map(0xc8000004, 0xc8000004).w("board", FUNC(mephisto_board_device::mux_w)); + map(0xd0000000, 0xd0000003).nopw(); map(0xd0000004, 0xd0000004).w("board", FUNC(mephisto_board_device::led_w)); - map(0xc0000000, 0xc0000000).r("board", FUNC(mephisto_board_device::input_r)); + map(0xd8000004, 0xd8000004).r(FUNC(mmodular_state::bavaria1_r)); + map(0xd8000008, 0xd8000008).w(FUNC(mmodular_state::bavaria_w)); + map(0xd800000c, 0xd800000c).r(FUNC(mmodular_state::bavaria2_r)); + map(0xe0000000, 0xe0000000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xe0000010, 0xe0000010).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0xe8000000, 0xe8007fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000); map(0xf0000004, 0xf0000007).portr("KEY1"); map(0xf0000008, 0xf000000b).portr("KEY2"); map(0xf0000010, 0xf0000013).portr("KEY3"); - map(0xe0000000, 0xe0000000).w("display", FUNC(mephisto_display_modul_device::latch_w)); - map(0xe0000010, 0xe0000010).w("display", FUNC(mephisto_display_modul_device::io_w)); - -// map(0xd8000008, 0xd800000b).w(FUNC(mmodular_state::write_unknown2)); // Bavaria sensors -// map(0xd8000004, 0xd8000007).r(FUNC(mmodular_state::read_unknown1)); // Bavaria sensors -// map(0xd800000c, 0xd800000f).r(FUNC(mmodular_state::read_unknown3)); // Bavaria sensors - - map(0x40000000, 0x4007ffff).ram(); - map(0x80000000, 0x8003ffff).ram(); - map(0xe8000000, 0xe8007fff).ram().share("nvram"); } -READ8_MEMBER(berlinp_state::berlinp_input_r) -{ - if (m_board->mux_r(space, offset) == 0xff) - return m_keys->read(); - else - return m_board->input_r(space, offset) ^ 0xff; -} -void berlinp_state::berl16_mem(address_map &map) -{ - map(0x000000, 0x01ffff).rom(); - map(0x800000, 0x87ffff).ram(); - map(0x900000, 0x907fff).ram().share("nvram"); - map(0xa00000, 0xa00000).r(FUNC(berlinp_state::berlinp_input_r)); - map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::mux_w)); - map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_modul_device::latch_w)); - map(0xd00008, 0xd00008).w("display", FUNC(mephisto_display_modul_device::io_w)); - map(0xe00000, 0xe00000).w(m_board, FUNC(mephisto_board_device::led_w)); -} +/****************************************************************************** + Input Ports +******************************************************************************/ -void berlinp_state::berlinp_mem(address_map &map) -{ - map(0x000000, 0x03ffff).rom(); +static INPUT_PORTS_START( bavaria ) + PORT_START("FAKE") + PORT_CONFNAME( 0x01, 0x00, "Board Sensors" ) PORT_CHANGED_MEMBER(DEVICE_SELF, mmodular_state, switch_sensor_type, 0) + PORT_CONFSETTING( 0x00, "Magnets (Exclusive)" ) // or Muenchen/Modular + PORT_CONFSETTING( 0x01, "Induction (Bavaria)" ) +INPUT_PORTS_END - map(0x800000, 0x800000).r(FUNC(berlinp_state::berlinp_input_r)); - map(0x900000, 0x900000).w(m_board, FUNC(mephisto_board_device::mux_w)); - map(0xa00000, 0xa00000).w(m_board, FUNC(mephisto_board_device::led_w)); - map(0xb00000, 0xb00000).w("display", FUNC(mephisto_display_modul_device::io_w)); - map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_modul_device::latch_w)); +static INPUT_PORTS_START( gen32 ) + PORT_INCLUDE( bavaria ) - map(0x400000, 0x4fffff).ram(); - map(0xd00000, 0xd07fff).ram().share("nvram"); -} + PORT_START("KEY1") + PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) + + PORT_START("KEY2") + PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) + PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) + PORT_START("KEY3") + PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) +INPUT_PORTS_END static INPUT_PORTS_START( alm16 ) PORT_START("KEY1") @@ -247,235 +371,219 @@ static INPUT_PORTS_START( alm32 ) PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) INPUT_PORTS_END -static INPUT_PORTS_START( gen32 ) - PORT_START("KEY1") - PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) - PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) - - PORT_START("KEY2") - PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) - - PORT_START("KEY3") - PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) - PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) +static INPUT_PORTS_START( port16 ) + PORT_INCLUDE( bavaria ) + PORT_INCLUDE( alm16 ) INPUT_PORTS_END -static INPUT_PORTS_START( berlinp ) - PORT_START("KEY") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NEW GAME (1/2)") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_F1) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NEW GAME (2/2)") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_F1) +static INPUT_PORTS_START( port32 ) + PORT_INCLUDE( bavaria ) + PORT_INCLUDE( alm32 ) INPUT_PORTS_END -void mmodular_state::init_gen32() -{ - // patch LCD delay loop - uint8_t *rom = memregion("maincpu")->base(); - if(rom[0x870] == 0x0c && rom[0x871] == 0x78) - rom[0x870] = 0x38; -} + +/****************************************************************************** + Machine Configs +******************************************************************************/ void mmodular_state::alm16(machine_config &config) { - m68000_device &maincpu(M68000(config, "maincpu", XTAL(12'000'000))); - maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::alm16_mem); - maincpu.set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(600)); + /* basic machine hardware */ + M68000(config, m_maincpu, 12_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::alm16_mem); + m_maincpu->set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(600)); - MEPHISTO_SENSORS_BOARD(config, "board"); - MEPHISTO_DISPLAY_MODUL(config, "display"); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + ADDRESS_MAP_BANK(config, "nvram_map").set_map(&mmodular_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13); + + MEPHISTO_SENSORS_BOARD(config, m_board); + m_board->subdevice<sensorboard_device>("board")->set_spawnpoints(12+2); // 2 jokers + m_board->subdevice<sensorboard_device>("board")->spawn_cb().set(FUNC(mmodular_state::spawn_cb)); + + TIMER(config, "bav_busy").configure_generic(nullptr); + + /* video hardware */ + MEPHISTO_DISPLAY_MODULE2(config, "display"); config.set_default_layout(layout_mephisto_alm16); } - -void mmodular_state::van16(machine_config &config) +void mmodular_state::port16(machine_config &config) { alm16(config); - subdevice<m68000_device>("maincpu")->set_addrmap(AS_PROGRAM, &mmodular_state::van16_mem); + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::port16_mem); } +void mmodular_state::van16(machine_config &config) +{ + port16(config); + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::van16_mem); +} void mmodular_state::alm32(machine_config &config) { - m68020_device &maincpu(M68020(config, "maincpu", XTAL(12'000'000))); - maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::alm32_mem); - maincpu.set_periodic_int(FUNC(mmodular_state::irq6_line_hold), attotime::from_hz(750)); + alm16(config); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* basic machine hardware */ + M68020(config.replace(), m_maincpu, 12_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::alm32_mem); + m_maincpu->set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(750)); - MEPHISTO_SENSORS_BOARD(config, "board"); - MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mephisto_alm32); } - -void mmodular_state::van32(machine_config &config) +void mmodular_state::port32(machine_config &config) { alm32(config); - subdevice<m68020_device>("maincpu")->set_addrmap(AS_PROGRAM, &mmodular_state::van32_mem); + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::port32_mem); } +void mmodular_state::van32(machine_config &config) +{ + port32(config); + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::van32_mem); +} void mmodular_state::gen32(machine_config &config) { - m68030_device &maincpu(M68030(config, "maincpu", XTAL(33'333'000))); - maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::gen32_mem); - maincpu.set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(375)); + van32(config); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* basic machine hardware */ + M68EC030(config.replace(), m_maincpu, 33.333_MHz_XTAL); // M68EC030RP40B + m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::gen32_mem); - MEPHISTO_SENSORS_BOARD(config, "board"); - MEPHISTO_DISPLAY_MODUL(config, "display"); + const attotime irq_period = attotime::from_hz(6.144_MHz_XTAL / 0x4000); // through 4060, 375Hz + m_maincpu->set_periodic_int(FUNC(mmodular_state::irq2_line_hold), irq_period); + + subdevice<hd44780_device>("display:hd44780")->set_busy_factor(0.25); // problem with waitstates config.set_default_layout(layout_mephisto_gen32); } -void berlinp_state::berlinp(machine_config &config) -{ - m68020_device &maincpu(M68020(config, "maincpu", XTAL(24'576'000))); - maincpu.set_addrmap(AS_PROGRAM, &berlinp_state::berlinp_mem); - maincpu.set_periodic_int(FUNC(berlinp_state::irq2_line_hold), attotime::from_hz(750)); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - MEPHISTO_BUTTONS_BOARD(config, m_board); - MEPHISTO_DISPLAY_MODUL(config, "display"); - config.set_default_layout(layout_mephisto_berlin); -} - -void berlinp_state::berl16(machine_config &config) -{ - berlinp(config); - m68000_device &maincpu(M68000(config.replace(), "maincpu", XTAL(12'000'000))); - maincpu.set_addrmap(AS_PROGRAM, &berlinp_state::berl16_mem); - maincpu.set_periodic_int(FUNC(berlinp_state::irq2_line_hold), attotime::from_hz(750)); -} +/****************************************************************************** + ROM Definitions +******************************************************************************/ -ROM_START( alm16 ) +ROM_START( alm16 ) // U013 65CE 2FCE ROM_REGION16_BE( 0x20000, "maincpu", 0 ) - ROM_LOAD16_BYTE("alm16eve.bin", 0x00000, 0x10000, CRC(ee5b6ec4) SHA1(30920c1b9e16ffae576da5afa0b56da59ada3dbb)) - ROM_LOAD16_BYTE("alm16odd.bin", 0x00001, 0x10000, CRC(d0be4ee4) SHA1(d36c074802d2c9099cd44e75f9de3fc7d1fd9908)) + ROM_LOAD16_BYTE("alm16eve.bin", 0x00000, 0x10000, CRC(ee5b6ec4) SHA1(30920c1b9e16ffae576da5afa0b56da59ada3dbb) ) + ROM_LOAD16_BYTE("alm16odd.bin", 0x00001, 0x10000, CRC(d0be4ee4) SHA1(d36c074802d2c9099cd44e75f9de3fc7d1fd9908) ) ROM_END -ROM_START( alm32 ) +ROM_START( alm32 ) // U012 D21A 2FCE ROM_REGION32_BE( 0x20000, "maincpu", 0 ) - ROM_LOAD("alm32.bin", 0x00000, 0x20000, CRC(38f4b305) SHA1(43459a057ff29248c74d656a036ac325202b9c15)) + ROM_LOAD("alm32.bin", 0x00000, 0x20000, CRC(38f4b305) SHA1(43459a057ff29248c74d656a036ac325202b9c15) ) ROM_END -ROM_START( port16 ) +ROM_START( port16 ) // V101 630D 1CD7 ROM_REGION16_BE( 0x20000, "maincpu", 0 ) - ROM_LOAD16_BYTE("port16ev.bin", 0x00000, 0x0d000, CRC(88f627d9) SHA1(8de93628d0c5bf9a2901750a7a05c5942cbf2601)) - ROM_LOAD16_BYTE("port16od.bin", 0x00001, 0x0d000, CRC(7b0d4228) SHA1(9186fd512eab9a663b2b506a3b7a1eeeb09fc7d8)) + ROM_LOAD16_BYTE("port16ev.bin", 0x00000, 0x10000, CRC(68e4a37d) SHA1(33e7216db664174a8448e455bba97738a29c0f31) ) + ROM_LOAD16_BYTE("port16od.bin", 0x00001, 0x10000, CRC(cae77a05) SHA1(9a0ca8bb37325698f8d208f64a340690b9a933b5) ) + + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END ROM_START( port32 ) ROM_REGION32_BE( 0x20000, "maincpu", 0 ) - ROM_SYSTEM_BIOS( 0, "v103", "V1.03" ) - ROMX_LOAD("portorose_32bit_v103", 0x00000, 0x20000, CRC(02c091b3) SHA1(f1d48e73b24093288dbb8a06617bb62420c07508), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v101", "V1.01" ) - ROMX_LOAD("portorose_32bit_v101", 0x00000, 0x20000, CRC(405bd668) SHA1(8c6eacff7f6784fa1d38344d594c7e52ac828a23), ROM_BIOS(1)) -ROM_END + ROM_SYSTEM_BIOS( 0, "v103", "V1.03" ) // V103 C734 1CD7 + ROMX_LOAD("portorose_32bit_v103", 0x00000, 0x20000, CRC(02c091b3) SHA1(f1d48e73b24093288dbb8a06617bb62420c07508), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v101", "V1.01" ) // V101 7805 1CD7 + ROMX_LOAD("portorose_32bit_v101", 0x00000, 0x20000, CRC(405bd668) SHA1(8c6eacff7f6784fa1d38344d594c7e52ac828a23), ROM_BIOS(1) ) -ROM_START( gen32 ) - ROM_REGION32_BE( 0x40000, "maincpu", 0 ) - ROM_SYSTEM_BIOS( 0, "v401", "V4.01" ) - ROMX_LOAD("gen32_41.bin", 0x00000, 0x40000, CRC(ea9938c0) SHA1(645cf0b5b831b48104ad6cec8d78c63dbb6a588c), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v400", "V4.00" ) - ROMX_LOAD("gen32_4.bin", 0x00000, 0x40000, CRC(6cc4da88) SHA1(ea72acf9c67ed17c6ac8de56a165784aa629c4a1), ROM_BIOS(1)) + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( gen32l ) - ROM_REGION32_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD("gen32l.bin", 0x00000, 0x40000, CRC(853baa4e) SHA1(946951081d4e91e5bdd9e93d0769568a7fe79bad)) -ROM_END +ROM_START( lyon16 ) // V207 EC82 5805 + ROM_REGION16_BE( 0x20000, "maincpu", 0 ) + ROM_LOAD16_BYTE("lyon16ev.bin", 0x00000, 0x10000, CRC(497bd41a) SHA1(3ffefeeac694f49997c10d248ec6a7aa932898a4) ) + ROM_LOAD16_BYTE("lyon16od.bin", 0x00001, 0x10000, CRC(f9de3f54) SHA1(4060e29566d2f40122ccde3c1f84c94a9c1ed54f) ) -ROM_START( van16 ) - ROM_REGION16_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD16_BYTE("va16even.bin", 0x00000, 0x20000, CRC(e87602d5) SHA1(90cb2767b4ae9e1b265951eb2569b9956b9f7f44)) - ROM_LOAD16_BYTE("va16odd.bin", 0x00001, 0x20000, CRC(585f3bdd) SHA1(90bb94a12d3153a91e3760020e1ea2a9eaa7ec0a)) + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( van32 ) - ROM_REGION32_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD("vanc32.bin", 0x00000, 0x40000, CRC(f872beb5) SHA1(9919f207264f74e2b634b723b048ae9ca2cefbc7)) +ROM_START( lyon32 ) // V207 AE64 5805 + ROM_REGION32_BE( 0x20000, "maincpu", 0 ) + ROM_LOAD("lyon32.bin", 0x00000, 0x20000, CRC(5c128b06) SHA1(954c8f0d3fae29900cb1e9c14a41a9a07a8e185f) ) + + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( lond16 ) +ROM_START( van16 ) // V309 C8F3 18D3 ROM_REGION16_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD16_BYTE("london_program_68000_module_even", 0x00000, 0x20000, CRC(68cfc2de) SHA1(93b551180f01f8ed6991c082795cd9ead922179a)) - ROM_LOAD16_BYTE("london_program_68000_module_odd", 0x00001, 0x20000, CRC(2d75e2cf) SHA1(2ec9222c95f4be9667fb3b4be1b6f90fd4ad11c4)) + ROM_LOAD16_BYTE("va16even.bin", 0x00000, 0x20000, CRC(e87602d5) SHA1(90cb2767b4ae9e1b265951eb2569b9956b9f7f44) ) + ROM_LOAD16_BYTE("va16odd.bin", 0x00001, 0x20000, CRC(585f3bdd) SHA1(90bb94a12d3153a91e3760020e1ea2a9eaa7ec0a) ) + + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( lond32 ) +ROM_START( van32 ) // V309 3FD3 18D3 ROM_REGION32_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD("london_program_68020_module", 0x00000, 0x40000, CRC(3225b8da) SHA1(fd8f6f4e9c03b6cdc86d8405e856c26041bfad12)) -ROM_END + ROM_LOAD("vanc32.bin", 0x00000, 0x40000, CRC(f872beb5) SHA1(9919f207264f74e2b634b723b048ae9ca2cefbc7) ) -ROM_START( lyon16 ) - ROM_REGION16_BE( 0x20000, "maincpu", 0 ) - ROM_LOAD16_BYTE("lyon16ev.bin", 0x00000, 0x10000, CRC(497bd41a) SHA1(3ffefeeac694f49997c10d248ec6a7aa932898a4)) - ROM_LOAD16_BYTE("lyon16od.bin", 0x00001, 0x10000, CRC(f9de3f54) SHA1(4060e29566d2f40122ccde3c1f84c94a9c1ed54f)) + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( lyon32 ) - ROM_REGION32_BE( 0x20000, "maincpu", 0 ) - ROM_LOAD("lyon32.bin", 0x00000, 0x20000, CRC(5c128b06) SHA1(954c8f0d3fae29900cb1e9c14a41a9a07a8e185f)) -ROM_END +ROM_START( gen32 ) + ROM_REGION32_BE( 0x40000, "maincpu", 0 ) + ROM_SYSTEM_BIOS( 0, "v401", "V4.01" ) // V401 D1BB 5A88 + ROMX_LOAD("genius_68030_version_4.01", 0x00000, 0x40000, CRC(ea9938c0) SHA1(645cf0b5b831b48104ad6cec8d78c63dbb6a588c), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v400", "V4.00" ) // V400 3B95 5A88 + ROMX_LOAD("gen32_4.bin", 0x00000, 0x40000, CRC(6cc4da88) SHA1(ea72acf9c67ed17c6ac8de56a165784aa629c4a1), ROM_BIOS(1) ) -ROM_START( berl16 ) - ROM_REGION16_BE( 0x20000, "maincpu", 0 ) - ROM_SYSTEM_BIOS( 0, "v003", "V0.03" ) - ROMX_LOAD("berlin_68000_even.bin", 0x00000, 0x10000, CRC(31337f15) SHA1(0dcacb153a6f8376e6f1c2f3e57e60aad4370740), ROM_SKIP(1) | ROM_BIOS(0)) - ROMX_LOAD("berlin_68000_odd_b003.bin", 0x00001, 0x10000, CRC(cc146819) SHA1(e4b2c6e496eff4a657a0718be292f563fb4e5688), ROM_SKIP(1) | ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v002", "V0.02" ) - ROMX_LOAD("berlin_68000_even.bin", 0x00000, 0x10000, CRC(31337f15) SHA1(0dcacb153a6f8376e6f1c2f3e57e60aad4370740), ROM_SKIP(1) | ROM_BIOS(1)) - ROMX_LOAD("berlin_68000_odd_b002.bin", 0x00001, 0x10000, CRC(513a95f2) SHA1(cbaef0078a119163577e76a78b2110939b17be6b), ROM_SKIP(1) | ROM_BIOS(1)) + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( berlinp ) +ROM_START( gen32l ) // V500 EDC1 B0D1 ROM_REGION32_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD("berlinp.bin", 0x00000, 0x40000, CRC(82fbaf6e) SHA1(729b7cef3dfaecc4594a6178fc4ba6015afa6202)) + ROM_LOAD("gen32l.bin", 0x00000, 0x40000, CRC(853baa4e) SHA1(946951081d4e91e5bdd9e93d0769568a7fe79bad) ) + + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( berl16l ) - ROM_REGION16_BE( 0x20000, "maincpu", 0 ) - ROM_LOAD16_BYTE("berlin_68000_london_even.bin", 0x00000, 0x10000, CRC(0ccddbc6) SHA1(90effdc9f2811a24d450b74ccfb24995ce896b86)) - ROM_LOAD16_BYTE("berlin_68000_london_odd.bin", 0x00001, 0x10000, CRC(5edac658) SHA1(18ebebc5ceffd9a01798d8a3709875120bd096f7)) +ROM_START( lond16 ) // V500 5ED1 B0D1 + ROM_REGION16_BE( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE("london_program_68000_module_even", 0x00000, 0x20000, CRC(68cfc2de) SHA1(93b551180f01f8ed6991c082795cd9ead922179a) ) + ROM_LOAD16_BYTE("london_program_68000_module_odd", 0x00001, 0x20000, CRC(2d75e2cf) SHA1(2ec9222c95f4be9667fb3b4be1b6f90fd4ad11c4) ) + + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END -ROM_START( bpl32 ) +ROM_START( lond32 ) // V500 DF8B B0D1 ROM_REGION32_BE( 0x40000, "maincpu", 0 ) - ROM_LOAD("bpl32.bin", 0x00000, 0x40000, CRC(d75e170f) SHA1(ac0ebdaa114abd4fef87361a03df56928768b1ae)) + ROM_LOAD("london_program_68020_module", 0x00000, 0x40000, CRC(3225b8da) SHA1(fd8f6f4e9c03b6cdc86d8405e856c26041bfad12) ) + + ROM_REGION( 0x8000, "bavaria", 0 ) + ROM_LOAD( "sinus_15_bavaria", 0x0000, 0x8000, CRC(84421306) SHA1(5aab13bf38d80a4233c11f6eb5657f2749c14547) ) ROM_END +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ -/*************************************************************************** - Game driver(s) -***************************************************************************/ - -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -CONS( 1988, alm32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Almeria 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1988, alm16, alm32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Almeria 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1989, port32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1989, port16, port32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1990, lyon32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1990, lyon16, lyon32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1991, van32, 0, 0, van32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Vancouver 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1991, van16, van32, 0, van16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Vancouver 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1993, gen32, 0, 0, gen32, gen32, mmodular_state, init_gen32, "Hegener + Glaser", "Mephisto Genius 68030", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1996, gen32l, gen32, 0, gen32, gen32, mmodular_state, init_gen32, "Richard Lang", "Mephisto Genius 68030 (London upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1996, lond32, 0, 0, van32, alm32, mmodular_state, empty_init, "Richard Lang", "Mephisto London 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) // for alm32/port32/lyon32/van32 -CONS( 1996, lond16, lond32, 0, van16, alm16, mmodular_state, empty_init, "Richard Lang", "Mephisto London 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) // for alm16/port16/lyon16/van16 - -// not modular boards -CONS( 1992, berl16, 0, 0, berl16, berlinp, berlinp_state, empty_init, "Hegener + Glaser", "Mephisto Berlin 68000", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1994, berlinp, 0, 0, berlinp, berlinp, berlinp_state, empty_init, "Hegener + Glaser", "Mephisto Berlin Professional 68020", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1996, berl16l, berl16, 0, berl16, berlinp, berlinp_state, empty_init, "Richard Lang", "Mephisto Berlin 68000 (London upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1996, bpl32, berlinp, 0, berlinp, berlinp, berlinp_state, empty_init, "Richard Lang", "Mephisto Berlin Professional 68020 (London upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +CONS( 1988, alm32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Almeria 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1988, alm16, alm32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Almeria 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1989, port32, 0, 0, port32, port32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1989, port16, port32, 0, port16, port16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1990, lyon32, 0, 0, port32, port32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1990, lyon16, lyon32, 0, port16, port16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, van32, 0, 0, van32, port32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Vancouver 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, van16, van32, 0, van16, port16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Vancouver 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1993, gen32, 0, 0, gen32, gen32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Genius 68030", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1996, gen32l, gen32, 0, gen32, gen32, mmodular_state, empty_init, "Richard Lang", "Mephisto Genius 68030 (London upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1996, lond32, 0, 0, van32, port32, mmodular_state, empty_init, "Richard Lang", "Mephisto London 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) // for alm32/port32/lyon32/van32 +CONS( 1996, lond16, lond32, 0, van16, port16, mmodular_state, empty_init, "Richard Lang", "Mephisto London 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) // for alm16/port16/lyon16/van16 diff --git a/src/mame/drivers/mephisto_modular_tm.cpp b/src/mame/drivers/mephisto_modular_tm.cpp new file mode 100644 index 00000000000..e27296a17e8 --- /dev/null +++ b/src/mame/drivers/mephisto_modular_tm.cpp @@ -0,0 +1,294 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/****************************************************************************** + +Mephisto Turniermaschinen (dedicated in-house chesscomputers used at tournaments), +and their limited-release home versions. These are mephisto_modular hardware +generation, see that driver for more information. + +V versions were sold in limited quantities by Hobby Computer Centrale. +T versions were the ones used in actual tournaments, some of them sold to fans. + +The Bavaria board does not work on these. Not only does it not have the connector +for it, but no software 'driver' either. + +Mephisto TM Almeria is not on this hardware. + +Mephisto TM Berlin is an unreleased dev version, an update to TM Vancouver, but +not used in any tournament. Internal string and version matches TM Vancouver, +but ROM has many differences. + +BTANB: +- lyon32t8 still says "2048Kbyte" even though it uses 8MB RAM + +=============================================================================== + +Hardware notes: + +V(Verkauf?) home version: +- 68030 @ 36MHz (not sure about type, big heatsink in the way) +- 256KB SRAM (8*TC55465P-25), 128KB or 256KB ROM +- 2MB DRAM (16*TC514256AP-70) +- 8KB battery-backed SRAM (TC5565PL-15) +- 8*8 LEDs, magnets chessboard + +T(Turnier) tournament version: (differences) +- XC68030RC50B, CPU frequency tuned for tournament (see set_cpu_freq) +- 3 more 2MB DRAM rows + +After boot, it copies ROM to RAM, probably to circumvent waitstates on slow ROM. + +******************************************************************************/ + +#include "emu.h" + +#include "cpu/m68000/m68000.h" +#include "machine/bankdev.h" +#include "machine/nvram.h" +#include "machine/timer.h" +#include "machine/mmboard.h" +#include "video/mmdisplay2.h" + +// internal artwork +#include "mephisto_modular_tm.lh" // clickable + + +namespace { + +class mmtm_state : public driver_device +{ +public: + mmtm_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_rom(*this, "maincpu"), + m_mainram(*this, "mainram"), + m_disable_bootrom(*this, "disable_bootrom"), + m_fake(*this, "FAKE") + { } + + // machine configs + void mmtm_v(machine_config &config); + void mmtm_t(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(cpu_freq) { set_cpu_freq(); } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // devices/pointers + required_device<cpu_device> m_maincpu; + required_region_ptr<u32> m_rom; + required_shared_ptr<u32> m_mainram; + required_device<timer_device> m_disable_bootrom; + optional_ioport m_fake; + + // address maps + void mmtm_2m_map(address_map &map); + void mmtm_8m_map(address_map &map); + void nvram_map(address_map &map); + + bool m_bootrom_enabled; + TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { m_bootrom_enabled = false; } + DECLARE_READ32_MEMBER(bootrom_r) { return (m_bootrom_enabled) ? m_rom[offset] : m_mainram[offset]; } + + void set_cpu_freq(); +}; + +void mmtm_state::machine_start() +{ + save_item(NAME(m_bootrom_enabled)); +} + +void mmtm_state::machine_reset() +{ + set_cpu_freq(); + + // disable bootrom after reset + m_bootrom_enabled = true; + m_disable_bootrom->adjust(m_maincpu->cycles_to_attotime(50)); +} + +void mmtm_state::set_cpu_freq() +{ + // "Mephisto X" were usually overclocked at tournaments + // rare versions sold to fans seen overclocked at 60MHz or 66MHz + // default frequency of TM version is 50MHz (also matches beeper pitch with V version) + ioport_value val = m_fake.read_safe(0); + + static const XTAL xtal[] = { 36_MHz_XTAL, 50_MHz_XTAL, 60_MHz_XTAL, 66_MHz_XTAL }; + m_maincpu->set_unscaled_clock(xtal[val]); + + // lcd busy flag timing problem when overclocked + subdevice<hd44780_device>("display:hd44780")->set_busy_factor((val > 1) ? 0.75 : 1.0); +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void mmtm_state::nvram_map(address_map &map) +{ + // nvram is 8-bit (8KB) - this makes sure that endianness is correct + map(0x0000, 0x1fff).ram().share("nvram"); +} + +void mmtm_state::mmtm_2m_map(address_map &map) +{ + map(0x00000000, 0x0003ffff).ram().share("mainram"); + map(0x00000000, 0x0000000b).r(FUNC(mmtm_state::bootrom_r)); + map(0x80000000, 0x801fffff).ram(); + map(0xf0000000, 0xf003ffff).rom().region("maincpu", 0); + map(0xfc000000, 0xfc001fff).m("nvram_map", FUNC(address_map_bank_device::amap8)); + map(0xfc020004, 0xfc020007).portr("KEY1"); + map(0xfc020008, 0xfc02000b).portr("KEY2"); + map(0xfc020010, 0xfc020013).portr("KEY3"); + map(0xfc040000, 0xfc040000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0xfc060000, 0xfc060000).w("display", FUNC(mephisto_display_module2_device::io_w)); + map(0xfc080000, 0xfc080000).w("board", FUNC(mephisto_board_device::mux_w)); + map(0xfc0a0000, 0xfc0a0000).w("board", FUNC(mephisto_board_device::led_w)); + map(0xfc0c0000, 0xfc0c0000).r("board", FUNC(mephisto_board_device::input_r)); +} + +void mmtm_state::mmtm_8m_map(address_map &map) +{ + mmtm_2m_map(map); + map(0x80200000, 0x803fffff).ram(); + map(0x80400000, 0x805fffff).ram(); + map(0x80600000, 0x807fffff).ram(); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( mmtm_v ) + PORT_START("KEY1") + PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) + + PORT_START("KEY2") + PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) + + PORT_START("KEY3") + PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) + PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) +INPUT_PORTS_END + +static INPUT_PORTS_START( mmtm_t ) + PORT_INCLUDE( mmtm_v ) + + PORT_START("FAKE") + PORT_CONFNAME( 0x03, 0x01, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, mmtm_state, cpu_freq, 0) + PORT_CONFSETTING( 0x01, "50MHz" ) + PORT_CONFSETTING( 0x02, "60MHz" ) + PORT_CONFSETTING( 0x03, "66MHz" ) +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void mmtm_state::mmtm_v(machine_config &config) +{ + /* basic machine hardware */ + M68030(config, m_maincpu, 36_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mmtm_state::mmtm_2m_map); + + const attotime irq_period = attotime::from_hz(12.288_MHz_XTAL / 0x8000); // through 4060, 375Hz + m_maincpu->set_periodic_int(FUNC(mmtm_state::irq2_line_hold), irq_period); + + TIMER(config, "disable_bootrom").configure_generic(FUNC(mmtm_state::disable_bootrom)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + ADDRESS_MAP_BANK(config, "nvram_map").set_map(&mmtm_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13); + + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODULE2(config, "display"); + config.set_default_layout(layout_mephisto_modular_tm); +} + +void mmtm_state::mmtm_t(machine_config &config) +{ + mmtm_v(config); + + /* basic machine hardware */ + m_maincpu->set_clock(50_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mmtm_state::mmtm_8m_map); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( port32t ) // V101 FA1D 1CD7 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("portorose_68030_tournament.bin", 0x00000, 0x20000, CRC(31f4c916) SHA1(d22572d224b7308d0d03617997a1ad90e63403c5) ) +ROM_END + +ROM_START( lyon32t ) // V207 6D28 5805 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("lyon_68030_tournament.bin", 0x00000, 0x20000, CRC(f07856af) SHA1(a1d5191a4ab4518f2df22f10e6e1305bea8afb37) ) +ROM_END + +ROM_START( lyon32t8 ) // T207 3C9F 5805 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("lyon_68030_tournament_8mb.bin", 0x00000, 0x20000, CRC(7b3e6db5) SHA1(28ce87c2d12d92e1a534aaa8dd5489fcf1b42964) ) +ROM_END + +ROM_START( van32t ) // V309 15C8 18D3 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("vancouver_68030_tournament.bin", 0x00000, 0x40000, CRC(7b25c9ec) SHA1(bf955b9521f52341754814a7c0bf5941989c8be6) ) +ROM_END + +ROM_START( van32t8 ) // T309 E04C 18D3 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("vancouver_68030_tournament_8mb.bin", 0x00000, 0x40000, CRC(d9f0190b) SHA1(7631d2499baad7b8075a1ca2c49f6544d7020c95) ) +ROM_END + +ROM_START( berl32t8p ) // T309 B138 C981 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("berlin_68030_tournament_8mb.bin", 0x00000, 0x40000, CRC(4fa6d99d) SHA1(4cda1ce11136e5055f5307f3de3a29b1d98d4f00) ) +ROM_END + +ROM_START( lond32t ) // V500 BAC6 B0D1 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("london_68030_tournament.bin", 0x00000, 0x40000, CRC(cc7a1a19) SHA1(860b84ac354280cec1cfcc36627e0a6e1d80c108) ) +ROM_END + +ROM_START( lond32t8 ) // T500 854A B0D1 + ROM_REGION32_BE( 0x40000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD("london_68030_tournament_8mb.bin", 0x00000, 0x40000, CRC(1ef51242) SHA1(7d4ffec7d80789aaf0a9e796baa8dac7ef2c2f1b) ) +ROM_END + +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +CONS( 1989, port32t, port32, 0, mmtm_v, mmtm_v, mmtm_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 68030", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +CONS( 1990, lyon32t, lyon32, 0, mmtm_v, mmtm_v, mmtm_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 68030", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1990, lyon32t8, lyon32, 0, mmtm_t, mmtm_t, mmtm_state, empty_init, "Hegener + Glaser", "Mephisto TM Lyon", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +CONS( 1991, van32t, van32, 0, mmtm_v, mmtm_v, mmtm_state, empty_init, "Hegener + Glaser", "Mephisto Vancouver 68030", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, van32t8, van32, 0, mmtm_t, mmtm_t, mmtm_state, empty_init, "Hegener + Glaser", "Mephisto TM Vancouver", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1991, berl32t8p, van32, 0, mmtm_t, mmtm_t, mmtm_state, empty_init, "Hegener + Glaser", "Mephisto TM Berlin (prototype)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) + +CONS( 1996, lond32t, lond32, 0, mmtm_v, mmtm_v, mmtm_state, empty_init, "Saitek", "Mephisto London 68030", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // after Saitek took over H+G +CONS( 1996, lond32t8, lond32, 0, mmtm_t, mmtm_t, mmtm_state, empty_init, "Saitek", "Mephisto TM London", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // " diff --git a/src/mame/drivers/mephisto_mondial68k.cpp b/src/mame/drivers/mephisto_mondial68k.cpp index 4ad322c5bd8..0812dd1d535 100644 --- a/src/mame/drivers/mephisto_mondial68k.cpp +++ b/src/mame/drivers/mephisto_mondial68k.cpp @@ -208,7 +208,7 @@ void mondial68k_state::mondial68k(machine_config &config) /* video hardware */ PWM_DISPLAY(config, m_display).set_size(4, 8); m_display->set_segmask(0xf, 0x7f); - m_display->output_digit().set([this] (offs_t offset, u8 data, u8 mem_mask) { m_digits[offset] = bitswap<8>(data, 7,4,5,0,1,2,3,6); }); + m_display->output_digit().set([this](offs_t offset, u8 data) { m_digits[offset] = bitswap<8>(data, 7,4,5,0,1,2,3,6); }); config.set_default_layout(layout_mephisto_mondial68k); /* sound hardware */ @@ -226,8 +226,8 @@ void mondial68k_state::mondial68k(machine_config &config) ROM_START( mondl68k ) ROM_REGION16_BE( 0x1000000, "maincpu", 0 ) - ROM_LOAD16_BYTE("68000xl-06-11-87-u.bin", 0x0000, 0x8000, CRC(aebe482a) SHA1(900c91ec836cd65e4cd38e50555976ab8064be41)) - ROM_LOAD16_BYTE("68000xl-06-11-87-l.bin", 0x0001, 0x8000, CRC(564e32c5) SHA1(8c9df46bc5ced114e72fb663f1055d775b8e2e0b)) + ROM_LOAD16_BYTE("68000xl_u_06.11.87", 0x0000, 0x8000, CRC(aebe482a) SHA1(900c91ec836cd65e4cd38e50555976ab8064be41) ) + ROM_LOAD16_BYTE("68000xl_l_06.11.87", 0x0001, 0x8000, CRC(564e32c5) SHA1(8c9df46bc5ced114e72fb663f1055d775b8e2e0b) ) ROM_END diff --git a/src/mame/drivers/mephisto_montec.cpp b/src/mame/drivers/mephisto_montec.cpp index 700abb676de..7f42c908b1d 100644 --- a/src/mame/drivers/mephisto_montec.cpp +++ b/src/mame/drivers/mephisto_montec.cpp @@ -14,8 +14,9 @@ - holding CL+INFO+BOOK on boot load the test mode TODO: - - split driver into several files? + - split driver into several files? need to make PCF2112T device - why are megaiv/smondial2 beeps noisy? + - add Monte Carlo IV (non-LE) **************************************************************************************************/ @@ -519,9 +520,9 @@ INPUT_PORTS_END void mephisto_montec_state::montec(machine_config &config) { - M65C02(config, m_maincpu, XTAL(4'000'000)); + M65C02(config, m_maincpu, XTAL(8'000'000) / 2); // R65C02P4 m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_montec_state::montec_mem); - m_maincpu->set_periodic_int(FUNC(mephisto_montec_state::nmi_line_assert), attotime::from_hz(XTAL(4'000'000) / (1 << 13))); + m_maincpu->set_periodic_int(FUNC(mephisto_montec_state::nmi_line_assert), attotime::from_hz(XTAL(8'000'000) / (1 << 14))); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -591,58 +592,65 @@ void mephisto_montec_state::smondial2(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_montec_state::smondial2_mem); GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "smondial2_cart"); - SOFTWARE_LIST(config, "cart_list").set_original("smondial2"); + SOFTWARE_LIST(config, "cart_list").set_original("mephisto_smondial2"); config.set_default_layout(layout_mephisto_smondial2); } -ROM_START(megaiv) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("megaiv.bin", 0x8000, 0x8000, CRC(dee355d2) SHA1(6bc79c0fb169020f017412f5f9696b9ecafbf99f)) +ROM_START( megaiv ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("v2") + + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) + ROMX_LOAD("mega_iv_17.03.88", 0x8000, 0x8000, CRC(85267e82) SHA1(654c9cf84bf2165fc94f8c4cf9c662786ef3283b), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v2", "V2" ) + ROMX_LOAD("megaiv.bin", 0x8000, 0x8000, CRC(dee355d2) SHA1(6bc79c0fb169020f017412f5f9696b9ecafbf99f), ROM_BIOS(1) ) ROM_END -ROM_START(monteciv) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("mciv.bin", 0x8000, 0x8000, CRC(c4887694) SHA1(7f482d2a40fcb3125266e7a5407da315b4f9b49c)) +ROM_START( monteciv ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("mciv.bin", 0x8000, 0x8000, CRC(c4887694) SHA1(7f482d2a40fcb3125266e7a5407da315b4f9b49c) ) ROM_END -ROM_START(montec) - ROM_REGION(0x10000, "maincpu", 0) +ROM_START( montec ) + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS("v2") - ROM_SYSTEM_BIOS( 0, "v1", "v1" ) - ROM_SYSTEM_BIOS( 1, "v2", "v2" ) - ROMX_LOAD("mc.bin", 0x8000, 0x8000, CRC(05524da9) SHA1(bee2ffe09a27095f733584e0fb1203b95c23e17e), ROM_BIOS(0)) - ROMX_LOAD("mc2.bin", 0x8000, 0x8000, CRC(8eb26043) SHA1(26454a37eea29283bbb2762a3a68e95e4be6aa1c), ROM_BIOS(1)) + + ROM_SYSTEM_BIOS( 0, "v1", "V1" ) + ROMX_LOAD("mc2_20.7.87", 0x8000, 0x8000, CRC(05524da9) SHA1(bee2ffe09a27095f733584e0fb1203b95c23e17e), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v2", "V2" ) + ROMX_LOAD("mc3_12.11.87", 0x8000, 0x8000, CRC(8eb26043) SHA1(26454a37eea29283bbb2762a3a68e95e4be6aa1c), ROM_BIOS(1) ) ROM_END -ROM_START(smondial) - ROM_REGION(0x10000, "maincpu", 0) +ROM_START( smondial ) + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS("ab") + ROM_SYSTEM_BIOS( 0, "a", "Ver A" ) + ROMX_LOAD("supermondial_a.bin", 0x8000, 0x8000, CRC(c1d7d0a5) SHA1(d7f0da6938458c06925f0936e63915319144d7e0), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "ab", "Ver AB" ) - ROMX_LOAD("supermondial_a.bin", 0x8000, 0x8000, CRC(c1d7d0a5) SHA1(d7f0da6938458c06925f0936e63915319144d7e0), ROM_BIOS(0)) - ROMX_LOAD("supermondial_ab.bin", 0x8000, 0x8000, CRC(a8781685) SHA1(fd4c97e13bd398dc4c85e3e1778bf7e59fccd71e), ROM_BIOS(1)) + ROMX_LOAD("supermondial_ab.bin", 0x8000, 0x8000, CRC(a8781685) SHA1(fd4c97e13bd398dc4c85e3e1778bf7e59fccd71e), ROM_BIOS(1) ) ROM_END -ROM_START(smondialb) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("supermondial_b.bin", 0x8000, 0x8000, CRC(6fb89e97) SHA1(b001e657b4fdc097322b28a25c31814f3da7b124)) +ROM_START( smondialb ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("supermondial_b.bin", 0x8000, 0x8000, CRC(6fb89e97) SHA1(b001e657b4fdc097322b28a25c31814f3da7b124) ) ROM_END -ROM_START(smondial2) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("supermondial_ii.bin", 0x8000, 0x8000, CRC(cd73df4a) SHA1(bad786074be613d7f48bf98b6fdf8178a4a85f5b)) +ROM_START( smondial2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("supermondial_ii.bin", 0x8000, 0x8000, CRC(cd73df4a) SHA1(bad786074be613d7f48bf98b6fdf8178a4a85f5b) ) ROM_END -ROM_START(mondial) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("mondial_1.bin", 0xc000, 0x4000, CRC(5cde2e26) SHA1(337be35d5120ca12143ca17f8aa0642b313b3851)) +ROM_START( mondial ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("mondial_1.bin", 0xc000, 0x4000, CRC(5cde2e26) SHA1(337be35d5120ca12143ca17f8aa0642b313b3851) ) ROM_END -ROM_START(mondial2) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("mondial ii 01 08 87 morsch.bin", 0x8000, 0x8000, CRC(e5945ce6) SHA1(e75bbf9d54087271d9d46fb1de7634eb957f8db0)) +ROM_START( mondial2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("mondial_ii_01.08.87", 0x8000, 0x8000, CRC(e5945ce6) SHA1(e75bbf9d54087271d9d46fb1de7634eb957f8db0) ) ROM_END @@ -652,6 +660,6 @@ CONS( 1986, smondial, 0, 0, smondial, megaiv, mephisto_montec_s CONS( 1986, smondialb, smondial, 0, megaiv, megaiv, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Super Mondial (Ver B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1987, montec, 0, 0, montec, montec, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Monte Carlo", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1987, mondial2, 0, 0, mondial2, mondial2, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Mondial II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1989, smondial2, 0, 0, smondial2, smondial2, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Super Mondial II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1989, megaiv, 0, 0, megaiv, megaiv, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Mega IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1990, monteciv, montec, 0, monteciv, montec, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Monte Carlo IV LE", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1988, smondial2, 0, 0, smondial2, smondial2, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Super Mondial II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1988, megaiv, 0, 0, megaiv, megaiv, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Mega IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1990, monteciv, montec, 0, monteciv, montec, mephisto_montec_state, empty_init, "Hegener + Glaser", "Mephisto Monte Carlo IV - Limited Edition", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/mephisto_polgar.cpp b/src/mame/drivers/mephisto_polgar.cpp index 838314807c5..4e056758454 100644 --- a/src/mame/drivers/mephisto_polgar.cpp +++ b/src/mame/drivers/mephisto_polgar.cpp @@ -7,20 +7,21 @@ Mephisto Polgar and RISC The chess engine in Mephisto Risc is also compatible with Tasc's The ChessMachine. TODO: -- Mephisto Risc maincpu is more likely 5MHz, but LCD doesn't like it - split driver into several files? mrisc for example is completely different hw **************************************************************************************************/ #include "emu.h" + #include "cpu/m6502/m65c02.h" #include "cpu/m6502/m65sc02.h" #include "machine/74259.h" #include "machine/nvram.h" #include "machine/mmboard.h" #include "machine/chessmachine.h" -#include "video/hd44780.h" +#include "video/mmdisplay2.h" + #include "speaker.h" // internal artwork @@ -91,7 +92,7 @@ protected: private: required_device<mephisto_board_device> m_board; - required_device<mephisto_display_modul_device> m_display; + required_device<mephisto_display_module2_device> m_display; output_finder<16> m_leds; uint8_t m_led_latch; }; @@ -130,8 +131,8 @@ READ8_MEMBER(mephisto_polgar_state::polgar_keys_r) void mephisto_polgar_state::polgar_mem(address_map &map) { map(0x0000, 0x1fff).ram().share("nvram"); - map(0x2000, 0x2000).w("display", FUNC(mephisto_display_modul_device::latch_w)); - map(0x2004, 0x2004).w("display", FUNC(mephisto_display_modul_device::io_w)); + map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w)); map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w)); map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w)); map(0x2c00, 0x2c07).r(FUNC(mephisto_polgar_state::polgar_keys_r)); @@ -157,8 +158,8 @@ void mephisto_risc_state::mrisc_mem(address_map &map) { map.unmap_value_high(); map(0x0000, 0x1fff).ram().share("nvram"); - map(0x2000, 0x2000).w("display", FUNC(mephisto_display_modul_device::latch_w)); - map(0x2004, 0x2004).w("display", FUNC(mephisto_display_modul_device::io_w)); + map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w)); + map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w)); map(0x2c00, 0x2c07).r(FUNC(mephisto_risc_state::polgar_keys_r)); map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w)); map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w)); @@ -203,7 +204,7 @@ void mephisto_milano_state::milano_mem(address_map &map) { map(0x0000, 0x1fbf).ram().share("nvram"); - map(0x1fc0, 0x1fc0).w(m_display, FUNC(mephisto_display_modul_device::latch_w)); + map(0x1fc0, 0x1fc0).w(m_display, FUNC(mephisto_display_module2_device::latch_w)); map(0x1fd0, 0x1fd0).w(FUNC(mephisto_milano_state::milano_led_w)); map(0x1fe0, 0x1fe0).r(FUNC(mephisto_milano_state::milano_input_r)); map(0x1fe8, 0x1fef).w("outlatch", FUNC(hc259_device::write_d7)); @@ -299,7 +300,7 @@ void mephisto_academy_state::machine_reset() void mephisto_polgar_state::polgar(machine_config &config) { - m65c02_device &maincpu(M65C02(config, "maincpu", XTAL(4'915'200))); + m65c02_device &maincpu(M65C02(config, "maincpu", XTAL(4'915'200))); // RP65C02G maincpu.set_addrmap(AS_PROGRAM, &mephisto_polgar_state::polgar_mem); maincpu.set_periodic_int(FUNC(mephisto_polgar_state::nmi_line_pulse), attotime::from_hz(XTAL(4'915'200) / (1 << 13))); @@ -314,14 +315,14 @@ void mephisto_polgar_state::polgar(machine_config &config) outlatch.q_out_cb<5>().set_output("led105"); MEPHISTO_SENSORS_BOARD(config, "board"); - MEPHISTO_DISPLAY_MODUL(config, "display"); + MEPHISTO_DISPLAY_MODULE2(config, "display"); config.set_default_layout(layout_mephisto_polgar); } void mephisto_polgar_state::polgar10(machine_config &config) { polgar(config); - subdevice<m65c02_device>("maincpu")->set_clock(XTAL(10'000'000)); + subdevice<m65c02_device>("maincpu")->set_clock(9.8304_MHz_XTAL); // W65C02P-8 } void mephisto_risc_state::mrisc(machine_config &config) @@ -345,13 +346,13 @@ void mephisto_risc_state::mrisc(machine_config &config) outlatch.parallel_out_cb().set_membank("rombank").rshift(6).mask(0x03).exor(0x01); MEPHISTO_SENSORS_BOARD(config, "board"); - MEPHISTO_DISPLAY_MODUL(config, "display"); + MEPHISTO_DISPLAY_MODULE2(config, "display"); config.set_default_layout(layout_mephisto_polgar); } void mephisto_milano_state::milano(machine_config &config) { - polgar(config); + polgar(config); // CPU: W65C02P-8, 4.9152Mhz subdevice<m65c02_device>("maincpu")->set_addrmap(AS_PROGRAM, &mephisto_milano_state::milano_mem); MEPHISTO_BUTTONS_BOARD(config.replace(), m_board); @@ -361,7 +362,7 @@ void mephisto_milano_state::milano(machine_config &config) void mephisto_academy_state::academy(machine_config &config) { - polgar(config); + polgar(config); // CPU: VL65NC02-04PC, 4.9152Mhz subdevice<m65c02_device>("maincpu")->set_addrmap(AS_PROGRAM, &mephisto_academy_state::academy_mem); hc259_device &outlatch(HC259(config.replace(), "outlatch")); @@ -372,57 +373,63 @@ void mephisto_academy_state::academy(machine_config &config) } -ROM_START(polgar) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("polgar.bin", 0x0000, 0x10000, CRC(88d55c0f) SHA1(e86d088ec3ac68deaf90f6b3b97e3e31b1515913)) +ROM_START( polgar ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("polgar_1.5_1.2.1990", 0x0000, 0x10000, CRC(88d55c0f) SHA1(e86d088ec3ac68deaf90f6b3b97e3e31b1515913) ) ROM_END -ROM_START(polgar10) - ROM_REGION(0x10000, "maincpu", 0) - ROM_SYSTEM_BIOS( 0, "v101", "V10.1" ) - ROMX_LOAD("polg_101.bin", 0x00000, 0x10000, CRC(8fb6afa4) SHA1(d1cf868302a665ff351686b26a149ced0045fc81), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v100", "V10.0" ) - ROMX_LOAD("polgar10.bin", 0x00000, 0x10000, CRC(7c1960d4) SHA1(4d15b51f9e6f7943815945cd56078ca512a964d4), ROM_BIOS(1)) +ROM_START( polgar10 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("v101") + + ROM_SYSTEM_BIOS( 0, "v100", "V10.0" ) + ROMX_LOAD("polg.10mhz_v_10.0", 0x00000, 0x10000, CRC(7c1960d4) SHA1(4d15b51f9e6f7943815945cd56078ca512a964d4), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v101", "V10.1" ) + ROMX_LOAD("polg_101.bin", 0x00000, 0x10000, CRC(8fb6afa4) SHA1(d1cf868302a665ff351686b26a149ced0045fc81), ROM_BIOS(1) ) ROM_END -ROM_START(mrisc) - ROM_REGION(0x20000, "maincpu", 0) +ROM_START( mrisc ) + ROM_REGION( 0x20000, "maincpu", 0 ) // contains ChessMachine engine at 0x0-0x03fff + 0x10000-0x1c74f, concatenate those sections and make a .bin file, // then it will work on ChessMachine software. It identifies as R E B E L ver. HG-021 03-04-92 - ROM_LOAD("meph-risci-v1-2.bin", 0x00000, 0x20000, CRC(19c6ab83) SHA1(0baab84e5aa6999c24250938d207145144945fd5)) + ROM_LOAD("meph-risci-v1-2.bin", 0x00000, 0x20000, CRC(19c6ab83) SHA1(0baab84e5aa6999c24250938d207145144945fd5) ) ROM_END -ROM_START(mrisc2) - ROM_REGION(0x20000, "maincpu", 0) +ROM_START( mrisc2 ) + ROM_REGION( 0x20000, "maincpu", 0 ) // contains ChessMachine engine at 0x0-0x03fff + 0x10000-0x1cb7f, concatenate those sections and make a .bin file, // then it will work on ChessMachine software. It identifies as R E B E L ver. 2.31 22-07-93, world champion Madrid 1992 - ROM_LOAD("meph-riscii-v2.bin", 0x00000, 0x20000, CRC(9ecf9cd3) SHA1(7bfc628183037a172242c9589f15aca218d8fb12)) + ROM_LOAD("risc_2.31", 0x00000, 0x20000, CRC(9ecf9cd3) SHA1(7bfc628183037a172242c9589f15aca218d8fb12) ) ROM_END -ROM_START(academy) - ROM_REGION(0x10000, "maincpu", 0) +ROM_START( academy ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("en") + ROM_SYSTEM_BIOS( 0, "en", "English" ) - ROMX_LOAD("acad4000.bin", 0x4000, 0x4000, CRC(ee1222b5) SHA1(98541d87755a7186b69b9723cc4adbd07f20f0e2), ROM_BIOS(0)) - ROMX_LOAD("acad8000.bin", 0x8000, 0x8000, CRC(a967922b) SHA1(1327903ff89bf96d72c930c400f367ae19e3ec68), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "de", "German" ) - ROMX_LOAD("academy_2_4000.bin", 0x4000, 0x4000, CRC(900a0001) SHA1(174a6bc3bde55994c603e232fcb45fccd62f11f6), ROM_BIOS(1)) - ROMX_LOAD("academy_1_8000.bin", 0x8000, 0x8000, CRC(e313d084) SHA1(ced5712d34fcc81bedcd741b7ac9e2ba17bf5235), ROM_BIOS(1)) - ROM_SYSTEM_BIOS( 2, "de_old", "German Old" ) - ROMX_LOAD("acad4000_de.bin", 0x4000, 0x4000, CRC(fb4d83c4) SHA1(f5132042c3b5a17c173f81eaa57e313ff0bb848e), ROM_BIOS(2)) - ROMX_LOAD("acad8000_de.bin", 0x8000, 0x8000, CRC(478155db) SHA1(d363ab6d5bc0f47a6cdfa5132b77535ef8da8256), ROM_BIOS(2)) + ROMX_LOAD("acad4000.bin", 0x4000, 0x4000, CRC(ee1222b5) SHA1(98541d87755a7186b69b9723cc4adbd07f20f0e2), ROM_BIOS(0) ) + ROMX_LOAD("acad8000.bin", 0x8000, 0x8000, CRC(a967922b) SHA1(1327903ff89bf96d72c930c400f367ae19e3ec68), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "de", "German (06-03-89)" ) + ROMX_LOAD("academy_16k_6.3.89", 0x4000, 0x4000, CRC(900a0001) SHA1(174a6bc3bde55994c603e232fcb45fccd62f11f6), ROM_BIOS(1) ) + ROMX_LOAD("academy_32k_6.3.89", 0x8000, 0x8000, CRC(e313d084) SHA1(ced5712d34fcc81bedcd741b7ac9e2ba17bf5235), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS( 2, "deo", "German (04-10-88)" ) + ROMX_LOAD("academy_16k_04.10.88", 0x4000, 0x4000, CRC(fb4d83c4) SHA1(f5132042c3b5a17c173f81eaa57e313ff0bb848e), ROM_BIOS(2) ) + ROMX_LOAD("academy_32k_04.10.88", 0x8000, 0x8000, CRC(478155db) SHA1(d363ab6d5bc0f47a6cdfa5132b77535ef8da8256), ROM_BIOS(2) ) ROM_END -ROM_START(milano) - ROM_REGION(0x10000, "maincpu", 0) - ROM_SYSTEM_BIOS( 0, "v102", "V1.02" ) - ROMX_LOAD("milano102.bin", 0x0000, 0x10000, CRC(0e9c8fe1) SHA1(e9176f42d86fe57e382185c703c7eff7e63ca711), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v101", "V1.01" ) - ROMX_LOAD("milano101.bin", 0x0000, 0x10000, CRC(22efc0be) SHA1(921607d6dacf72c0686b8970261c43e2e244dc9f), ROM_BIOS(1)) +ROM_START( milano ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("v102") + + ROM_SYSTEM_BIOS( 0, "v101", "V1.01" ) + ROMX_LOAD("milano101.bin", 0x0000, 0x10000, CRC(22efc0be) SHA1(921607d6dacf72c0686b8970261c43e2e244dc9f), ROM_BIOS(0) ) + ROM_SYSTEM_BIOS( 1, "v102", "V1.02" ) + ROMX_LOAD("milano102.bin", 0x0000, 0x10000, CRC(0e9c8fe1) SHA1(e9176f42d86fe57e382185c703c7eff7e63ca711), ROM_BIOS(1) ) ROM_END -ROM_START(nshort) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD("nshort.bin", 0x00000, 0x10000, CRC(4bd51e23) SHA1(3f55cc1c55dae8818b7e9384b6b8d43dc4f0a1af)) +ROM_START( nshort ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("nshort.bin", 0x00000, 0x10000, CRC(4bd51e23) SHA1(3f55cc1c55dae8818b7e9384b6b8d43dc4f0a1af) ) ROM_END @@ -433,8 +440,8 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ CONS( 1989, polgar, 0, 0, polgar, polgar, mephisto_polgar_state, empty_init, "Hegener + Glaser", "Mephisto Polgar", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, polgar10, polgar, 0, polgar10, polgar, mephisto_polgar_state, empty_init, "Hegener + Glaser", "Mephisto Polgar 10MHz", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1992, mrisc, 0, 0, mrisc, polgar, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto RISC 1MB", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1994, mrisc2, mrisc, 0, mrisc, polgar, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto RISC II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1992, mrisc, 0, 0, mrisc, polgar, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto Risc 1MB", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1994, mrisc2, mrisc, 0, mrisc, polgar, mephisto_risc_state, empty_init, "Hegener + Glaser / Tasc", "Mephisto Risc II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // not modular boards CONS( 1989, academy, 0, 0, academy, polgar, mephisto_academy_state, empty_init, "Hegener + Glaser", "Mephisto Academy", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/merit.cpp b/src/mame/drivers/merit.cpp index 7154cc1ff94..17cf8adbccf 100644 --- a/src/mame/drivers/merit.cpp +++ b/src/mame/drivers/merit.cpp @@ -2431,6 +2431,24 @@ ROM_START( couplei ) ROM_LOAD( "7.7a", 0x00000, 0x0800, CRC(6c36361e) SHA1(7a018eecf3d8b7cf8845dcfcf8067feb292933b2) ) /*video timing?*/ ROM_END +ROM_START( matchemg ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "6221-55_u5-1.u5", 0x00000, 0x8000, CRC(152ad9f6) SHA1(fdd90ea7e5bbcd7dc8f7d6f10ac9efc08515b112) ) + ROM_LOAD( "6221-55_u6-1.u6", 0x14000, 0x2000, CRC(0678d986) SHA1(c881aee9e977384a188f0f7b9e563b699da5fc0a) ) + ROM_RELOAD( 0x16000, 0x2000) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "gex_1_u39.u39", 0x00000, 0x8000, CRC(da94fbc6) SHA1(af008eceba2e4ef35d0815d5cb1a5a50f1a9817f) ) /* labeled GEX 1 U39 C1987 MII - U38 & U39 had a space between GEX and 1 */ + ROM_LOAD( "gex_1_u38.u38", 0x08000, 0x8000, CRC(211b75cc) SHA1(52497743457afbcf2969a967d5982d8934a29864) ) /* labeled GEX 1 U38 C1987 MII */ + ROM_LOAD( "gex1_u37.u37", 0x10000, 0x8000, CRC(dfc73155) SHA1(a922953ba238c3ca2f2f0a046109186d1057d76d) ) /* labeled GEX1 U37 C1987 MII - U37 & U40 had no space between GEX and 1 */ + + ROM_REGION( 0x08000, "gfx2", 0 ) + ROM_LOAD( "gex1_u40.u40", 0x00000, 0x8000, CRC(a6a9a73d) SHA1(f3cb1d434d730f6e00f48079eaf8b88f57779fa0) ) /* labeled GEX1 U40 C1987 MII */ + + ROM_REGION( 0x0800, "proms", 0 ) + ROM_LOAD( "crt-209_6221-55.cpu", 0x00000, 0x0800, CRC(2c22b3a8) SHA1(663e3b687d4f2adc34e421e23773f234ca35c629) ) //video timing? +ROM_END + void merit_state::init_key_0() { m_decryption_key = 0; @@ -2569,3 +2587,4 @@ GAME( 1987, dtrvwz5, 0, dtrvwz5, dtrvwh5, merit_state, init_dtrvwz5,ROT GAME( 1988, couple, 0, couple, couple, merit_state, init_couple, ROT0, "Merit", "The Couples (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) GAME( 1988, couplep, couple, couple, couplep, merit_state, init_couple, ROT0, "Merit", "The Couples (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) GAME( 1988, couplei, couple, couple, couple, merit_state, init_couple, ROT0, "Merit", "The Couples (set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1986, matchemg, couple, couple, couple, merit_state, init_couple, ROT0, "Merit", "Match'em Up (German)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/drivers/merits.cpp b/src/mame/drivers/merits.cpp new file mode 100644 index 00000000000..db8da9526e5 --- /dev/null +++ b/src/mame/drivers/merits.cpp @@ -0,0 +1,83 @@ +// license:BSD-3-Clause +// copyright-holders: +/******************************************************************************* + + Skeleton driver for Merit Scorpion darts machines + + Hardware overview: + Main CPU: Dallas DS80C3202-UM or compatible + Sound: DAC? + Other: Dallas DS1220Y-120 or compatible + OSCs: 12.000 MHz, 3.2768 MHz + Dips: 2 x 8 dips banks + +*******************************************************************************/ + +#include "emu.h" +#include "cpu/mcs51/mcs51.h" +#include "machine/nvram.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" +#include "speaker.h" + + +class merits_state : public driver_device +{ +public: + merits_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void scrpiond(machine_config &config); + +private: + void mem_map(address_map &map); + void io_map(address_map &map); + + required_device<cpu_device> m_maincpu; +}; + +void merits_state::mem_map(address_map &map) +{ + map(0x0000, 0xffff).rom().region("maincpu", 0); +} + +void merits_state::io_map(address_map &map) +{ + map(0x8000, 0x87ff).ram().share("nvram"); + //map(0x9000, 0x9000).r(); + //map(0xa000, 0xa000).r(); + //map(0xc000, 0xc000).w(); + //map(0xd000, 0xd000).w(); + //map(0xe000, 0xe000).w(); + //map(0xf000, 0xf000).w(); + //map(0xf800, 0xf800).w(); +} + +static INPUT_PORTS_START(scrpiond) +INPUT_PORTS_END + +void merits_state::scrpiond(machine_config &config) +{ + I80C32(config, m_maincpu, 12_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &merits_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &merits_state::io_map); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // DS1220Y +} + +ROM_START(scrpiond) + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD( "27c512.u7", 0x00000, 0x10000, CRC(06cdf965) SHA1(4cdac131063fc0dd954eaaee2ae40d5731f83469) ) +ROM_END + +ROM_START(scrpionda) + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD( "4978-22_u7-r5_c1997_mii.u7", 0x00000, 0x10000, CRC(e647a17e) SHA1(4a7b9e2af3656a1b6f4ffd8c17b68eec5c534776) ) +ROM_END + + +GAME(1999, scrpiond, 0, scrpiond, scrpiond, merits_state, empty_init, ROT0, "Merit", "Scorpion (Jun 15, 1999)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1997, scrpionda, scrpiond, scrpiond, scrpiond, merits_state, empty_init, ROT0, "Merit", "Scorpion (Oct 01, 1997)", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/meritum.cpp b/src/mame/drivers/meritum.cpp index 0e90b64320e..ecf542e0cac 100644 --- a/src/mame/drivers/meritum.cpp +++ b/src/mame/drivers/meritum.cpp @@ -531,7 +531,7 @@ void meritum_state::meritum2(machine_config &config) m_maincpu->set_addrmap(AS_IO, &meritum_state::io_map2); I8255(config, "flopppi", 0); // floppy disk interface m_screen->set_screen_update(FUNC(meritum_state::screen_update_meritum2)); - + } diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp index 9ffdcd847d7..d55a9a0ad94 100644 --- a/src/mame/drivers/micro3d.cpp +++ b/src/mame/drivers/micro3d.cpp @@ -346,11 +346,9 @@ void micro3d_state::micro3d(machine_config &config) mc68901_device &mfp(MC68901(config, "mfp", 4000000)); mfp.set_timer_clock(4000000); - mfp.set_rx_clock(0); - mfp.set_tx_clock(0); mfp.out_irq_cb().set_inputline("maincpu", M68K_IRQ_4); - //mfp.out_tao_cb().set("mfp", FUNC(mc68901_device::rc_w)); - //mfp.out_tao_cb().append("mfp", FUNC(mc68901_device::tc_w)); + mfp.out_tao_cb().set("mfp", FUNC(mc68901_device::rc_w)); + mfp.out_tao_cb().append("mfp", FUNC(mc68901_device::tc_w)); mfp.out_tco_cb().set("mfp", FUNC(mc68901_device::tbi_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/drivers/midxunit.cpp b/src/mame/drivers/midxunit.cpp index deb0bed4c25..445c5a6da2b 100644 --- a/src/mame/drivers/midxunit.cpp +++ b/src/mame/drivers/midxunit.cpp @@ -381,9 +381,10 @@ ROM_START( revx ) ROM_LOAD32_BYTE( "revx.53", 0x0e00002, 0x80000, CRC(a045b265) SHA1(b294d3a56e41f5ec4ab9bbcc0088833b1cab1879) ) ROM_LOAD32_BYTE( "revx.54", 0x0e00003, 0x80000, CRC(24471269) SHA1(262345bd147402100785459af422dafd1c562787) ) - ROM_REGION( 0x400, "plds", 0 ) + ROM_REGION( 0x600, "plds", 0 ) ROM_LOAD( "a-17722.u1", 0x000, 0x117, CRC(054de7a3) SHA1(bb7abaec50ed704c03b44d5d54296898f7c80d38) ) ROM_LOAD( "a-17721.u955", 0x200, 0x117, CRC(033fe902) SHA1(6efb4e519ed3c9d49fff046a679762b506b3a75b) ) + ROM_LOAD( "snd-gal16v8a.u17", 0x400, 0x117, NO_DUMP ) // Protected ROM_END ROM_START( revxp5 ) @@ -454,7 +455,6 @@ ROM_START( revxp5 ) ROM_END - /************************************* * * Game drivers diff --git a/src/mame/drivers/missbamby.cpp b/src/mame/drivers/missbamby.cpp index 146f00a5b5d..d876995fcf0 100644 --- a/src/mame/drivers/missbamby.cpp +++ b/src/mame/drivers/missbamby.cpp @@ -2,6 +2,18 @@ // copyright-holders: /* +Skeleton driver for Cirsa "Mini Super Fruits" and clones. +Known games on this hardware: + +Dumped Game Manufacturer +NO Mini Super Fruits Cirsa +YES Miss Bamby Automatics Pasqual +YES Golden Winer Reben +NO Golden Fruits unknown +NO St.-Tropez unknown + +*/ +/* Miss Bamby - Automatics Pasqual _____________________________________________________________ | _______ | diff --git a/src/mame/drivers/mitchell.cpp b/src/mame/drivers/mitchell.cpp index 1ae0a31f2e3..468cff115eb 100644 --- a/src/mame/drivers/mitchell.cpp +++ b/src/mame/drivers/mitchell.cpp @@ -1686,7 +1686,7 @@ ROM_END ROM_START( pkladiesbl ) ROM_REGION( 0x50000*2, "maincpu", 0 ) - // only 1.ic112 is encrypted (only opcodes). Encryption scheme seems to involve XORs and bitswaps, based on addresses. + // only 1.ic112 is encrypted (only opcodes). Encryption scheme seems to involve XORs and bitswaps, based on addresses. ROM_LOAD( "1.ic112", 0x50000, 0x08000, CRC(ca4cfaf9) SHA1(97ad3c526e4494f347db45c986ba23aff07e6321) ) ROM_CONTINUE(0x00000,0x08000) ROM_LOAD( "2.ic126", 0x60000, 0x10000, CRC(5c73e9b6) SHA1(5fbfb4c79e2df8e1edd3f29ac63f9961dd3724b1) ) diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index e9c63a5c4fc..6577dda9104 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -2,10 +2,20 @@ // copyright-holders:Olivier Galibert /* +Known functional issues: +- Star Wars Arcade + * After recent changes, ship models periodically disappear for a frame or two during attract mode + and while in-game. + * There are indeterminate issues with the analog controls in-game. +- Virtua Fighter + * Gameplay mechanics - specifically, collision detection - are significantly broken due to + imperfect TGP RAM port emulation or hookup. This is observable in both attract mode and + in-game. It seems to break when both characters attack at the same time. + Sega Model 1 Hardware Overview ------------------------------ -Note! This document is a Work-In-Progress and covers all the dumped Sega Model 1 games, including.... +Note! This document is a Work-In-Progress and covers all the dumped Sega Model 1 games, including... Star Wars Arcade (C) Sega, 1994 Virtua Fighter (C) Sega, 1993 @@ -1188,7 +1198,7 @@ ROM_START( vf ) ROM_LOAD16_BYTE( "mpr-16091.13", 0x1300001, 0x80000, CRC(53115448) SHA1(af798d5b1fcb720d7288a5ac48839d9ace16a2f2) ) ROM_REGION32_LE( 0x2000, "tgp_copro", 0) - ROM_LOAD("315-5724.bin", 0, 0x2000, CRC(09b4fb99) SHA1(7f3a3fb0b8d2e98d2238944c7526113d31af9d88) BAD_DUMP ) + ROM_LOAD("315-5724.bin", 0, 0x2000, CRC(4b4f330e) SHA1(8809d93d47593f808faca55161999677ac7a3eb0) BAD_DUMP ) ROM_REGION( 0xc0000, M1AUDIO_CPU_REGION, ROMREGION_BE|ROMREGION_16BIT ) /* 68K code */ ROM_LOAD16_WORD_SWAP( "epr-16120.7", 0x00000, 0x20000, CRC(2bff8378) SHA1(854b08ab983e4e98cb666f2f44de9a6829b1eb52) ) @@ -1214,11 +1224,17 @@ ROM_START( vf ) ROM_LOAD32_WORD( "mpr-16103.33", 0xc00002, 0x200000, CRC(526d1c76) SHA1(edc8dafc9261cd0e970c3b50e3c1ca51a32a4cdf) ) ROM_END +/* +Virtua Racing + + Sega game ID# 833-8942 VIRTUA RACING TWIN + Sega ROM board ID# 834-8941 +*/ ROM_START( vr ) MODEL1_CPU_BOARD ROM_REGION( 0x2000000, "maincpu", ROMREGION_ERASEFF ) /* v60 code */ - ROM_LOAD16_BYTE( "epr-14882.14", 0x200000, 0x80000, CRC(547d75ad) SHA1(a57c11966886c37de1d7df131ad60457669231dd) ) /* Rom board with Sega ID# 834-8941 */ + ROM_LOAD16_BYTE( "epr-14882.14", 0x200000, 0x80000, CRC(547d75ad) SHA1(a57c11966886c37de1d7df131ad60457669231dd) ) ROM_LOAD16_BYTE( "epr-14883.15", 0x200001, 0x80000, CRC(6bfad8b1) SHA1(c1f780e456b405abd42d92f4e03e40aad88f8c22) ) ROM_LOAD( "epr-14878a.4", 0xfc0000, 0x20000, CRC(6d69e695) SHA1(12d3612d3dfd474b8020cdfb8ffc5dcc64e2e1a3) ) @@ -1482,7 +1498,7 @@ ROM_START( wingwaru ) ROM_LOAD16_BYTE( "epr-16729.14", 0x200000, 0x80000, CRC(7edec2cc) SHA1(3e423a868ca7c8475fbb5bc1a10526e69d94d865) ) ROM_LOAD16_BYTE( "epr-16730.15", 0x200001, 0x80000, CRC(bab24dee) SHA1(26c95139c1aa7f34b6a5cce39e5bd1dd2ef0dd49) ) - ROM_LOAD( "epr-16951.4", 0xfc0000, 0x20000, CRC(8df5a798) SHA1(ef2756f237933ecf429dab0f362e572eb1965f4d) ) + ROM_LOAD( "epr-16951.4", 0xfc0000, 0x20000, BAD_DUMP CRC(8df5a798) SHA1(ef2756f237933ecf429dab0f362e572eb1965f4d) ) ROM_RELOAD( 0x000000, 0x20000 ) ROM_LOAD( "epr-16950.5", 0xfe0000, 0x20000, CRC(841e2195) SHA1(66f465aaf71955496e6f83335f7b836ad1d8c724) ) ROM_RELOAD( 0x020000, 0x20000 ) @@ -1699,14 +1715,6 @@ void model1_state::model1(machine_config &config) m_tgp_copro->set_addrmap(AS_IO, &model1_state::copro_io_map); m_tgp_copro->set_addrmap(mb86233_device::AS_RF, &model1_state::copro_rf_map); - model1io_device &ioboard(SEGA_MODEL1IO(config, "ioboard", 0)); - ioboard.read_callback().set(m_dpram, FUNC(mb8421_device::left_r)); - ioboard.write_callback().set(m_dpram, FUNC(mb8421_device::left_w)); - ioboard.in_callback<0>().set_ioport("IN.0"); - ioboard.in_callback<1>().set_ioport("IN.1"); - - MB8421(config, m_dpram, 0); - S24TILE(config, m_tiles, 0, 0x3fff).set_palette(m_palette); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1717,6 +1725,15 @@ void model1_state::model1(machine_config &config) PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 8192); + // create SEGA_MODEL1IO device *after* SCREEN device + model1io_device &ioboard(SEGA_MODEL1IO(config, "ioboard", 0)); + ioboard.read_callback().set(m_dpram, FUNC(mb8421_device::left_r)); + ioboard.write_callback().set(m_dpram, FUNC(mb8421_device::left_w)); + ioboard.in_callback<0>().set_ioport("IN.0"); + ioboard.in_callback<1>().set_ioport("IN.1"); + + MB8421(config, m_dpram, 0); + SEGAM1AUDIO(config, m_m1audio, 0); m_m1audio->rxd_handler().set(m_m1uart, FUNC(i8251_device::write_rxd)); @@ -1867,11 +1884,11 @@ void model1_state::netmerc(machine_config &config) //************************************************************************** // YEAR NAME PARENT MACHINE INPUT CLASS INIT ROTATION COMPANY FULLNAME FLAGS -GAME( 1993, vf, 0, vf, vf, model1_state, empty_init, ROT0, "Sega", "Virtua Fighter", 0 ) +GAME( 1993, vf, 0, vf, vf, model1_state, empty_init, ROT0, "Sega", "Virtua Fighter", MACHINE_NOT_WORKING ) GAMEL(1992, vr, 0, vr, vr, model1_state, empty_init, ROT0, "Sega", "Virtua Racing", 0, layout_vr ) GAME( 1993, vformula, vr, vformula, vr, model1_state, empty_init, ROT0, "Sega", "Virtua Formula", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1993, swa, 0, swa, swa, model1_state, empty_init, ROT0, "Sega", "Star Wars Arcade (US)", 0 ) -GAME( 1993, swaj, swa, swa, swa, model1_state, empty_init, ROT0, "Sega", "Star Wars Arcade (Japan)", 0 ) +GAME( 1993, swa, 0, swa, swa, model1_state, empty_init, ROT0, "Sega", "Star Wars Arcade (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_CONTROLS ) +GAME( 1993, swaj, swa, swa, swa, model1_state, empty_init, ROT0, "Sega", "Star Wars Arcade (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_CONTROLS ) GAME( 1994, wingwar, 0, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (World)", 0 ) GAME( 1994, wingwaru, wingwar, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (US)", 0 ) GAME( 1994, wingwarj, wingwar, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (Japan)", 0 ) diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp index a3cec69c9c7..38ea05498a9 100644 --- a/src/mame/drivers/model2.cpp +++ b/src/mame/drivers/model2.cpp @@ -2548,6 +2548,7 @@ void model2o_state::model2o(machine_config &config) model2_timers(config); model2_screen(config); + // create SEGA_MODEL1IO device *after* SCREEN device model1io_device &ioboard(SEGA_MODEL1IO(config, "ioboard", 0)); ioboard.set_default_bios_tag("epr14869c"); ioboard.read_callback().set("dpram", FUNC(mb8421_device::left_r)); @@ -2560,7 +2561,7 @@ void model2o_state::model2o(machine_config &config) SEGAM1AUDIO(config, m_m1audio, 0); m_m1audio->rxd_handler().set(m_uart, FUNC(i8251_device::write_rxd)); - I8251(config, m_uart, 8000000); // uPD71051C, clock unknown + I8251(config, m_uart, 8000000); // uPD71051C, clock unknown m_uart->txd_handler().set(m_m1audio, FUNC(segam1audio_device::write_txd)); clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate) @@ -7035,7 +7036,7 @@ GAME( 1995, srallycdx, srallyc, srallyc, srallyc, model2a_state, empty_in GAME( 1995, srallycdxa,srallyc, srallyc, srallyc, model2a_state, empty_init, ROT0, "Sega", "Sega Rally Championship - DX", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1995, vcop2, 0, vcop2, vcop2, model2a_state, empty_init, ROT0, "Sega", "Virtua Cop 2", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1995, skytargt, 0, skytargt, skytargt, model2a_state, empty_init, ROT0, "Sega", "Sky Target", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, doaa, doa, model2a_0229, doa, model2a_state, init_doa, ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, doaa, doa, model2a_0229, doa, model2a_state, init_doa, ROT0, "Tecmo", "Dead or Alive (Model 2A, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, zeroguna, zerogun, zeroguna, zerogun, model2a_state, init_zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, zerogunaj, zerogun, zeroguna, zerogun, model2a_state, init_zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, motoraid, 0, manxtt, motoraid, model2a_state, empty_init, ROT0, "Sega", "Motor Raid - Twin", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) @@ -7062,7 +7063,7 @@ GAME( 1996, sfight, schamp, model2b, schamp, model2b_state, empty_i GAME( 1996, lastbrnx, 0, model2b, vf2, model2b_state, empty_init, ROT0, "Sega", "Last Bronx (Export, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, lastbrnxu, lastbrnx, model2b, vf2, model2b_state, empty_init, ROT0, "Sega", "Last Bronx (USA, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, lastbrnxj, lastbrnx, model2b, vf2, model2b_state, empty_init, ROT0, "Sega", "Last Bronx (Japan, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, doa, 0, model2b_0229, doa, model2b_state, init_doa, ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, doa, 0, model2b_0229, doa, model2b_state, init_doa, ROT0, "Tecmo", "Dead or Alive (Model 2B, Revision B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, sgt24h, 0, overrev2b, sgt24h, model2b_state, init_sgt24h, ROT0, "Jaleco", "Super GT 24h", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, powsled, 0, powsled, powsled, model2b_state, empty_init, ROT0, "Sega", "Power Sled (Slave, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, powsledr, powsled, powsled, powsled, model2b_state, empty_init, ROT0, "Sega", "Power Sled (Relay, Revision A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp index 1d814bde944..a08ce549c17 100644 --- a/src/mame/drivers/model3.cpp +++ b/src/mame/drivers/model3.cpp @@ -5590,9 +5590,9 @@ ROM_START( ecap ) /* Step 2.1 - Proto or Location test - No security dongle */ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */ // CROM // Hand written SEGA labels in this form: TITLE: QQ ROM NO: IC17 CHECK SUM: 551B 9/12-'99 - ROM_LOAD64_WORD_SWAP( "qq.ic17", 0x000006, 0x200000, BAD_DUMP CRC(1db889e0) SHA1(b9a5f344685e1d8b5711d8ab426bb886c1008e48) ) /* Check sum: 551B, dated "9/12-'99" */ - ROM_LOAD64_WORD_SWAP( "qq.ic18", 0x000004, 0x200000, BAD_DUMP CRC(e33da02f) SHA1(2adf9b65b2f56db7f050115d002f520159364983) ) /* Check sum: AC51, dated "9/12-'99" */ - ROM_LOAD64_WORD_SWAP( "qq.ic19", 0x000002, 0x200000, BAD_DUMP CRC(ca02f571) SHA1(cd797d750d4ef3534225ceb83ad2840421efd192) ) /* Check sum: 9DB5, dated "9/12-'99" */ + ROM_LOAD64_WORD_SWAP( "qq.ic17", 0x000006, 0x200000, CRC(420b5eb8) SHA1(377afd200be441ceafa078c5a98d751b993e03d8) ) /* Check sum: 551B, dated "9/12-'99" */ + ROM_LOAD64_WORD_SWAP( "qq.ic18", 0x000004, 0x200000, CRC(17b0bb2c) SHA1(cde18b4d5438103b91806a3c5eaeb184e5c5311b) ) /* Check sum: AC51, dated "9/12-'99" */ + ROM_LOAD64_WORD_SWAP( "qq.ic19", 0x000002, 0x200000, CRC(a646c7e5) SHA1(3a420c05fad23dd5db0a49586c876ecdaa689c09) ) /* Check sum: 9DB5, dated "9/12-'99" */ ROM_LOAD64_WORD_SWAP( "qq.ic20", 0x000000, 0x200000, CRC(b12fe61c) SHA1(da8bb643a2b08857265f01a909f46bef98dab9cb) ) /* Check sum: C247, dated "9/12-'99" */ // CROM0 @@ -5609,9 +5609,9 @@ ROM_START( ecap ) /* Step 2.1 - Proto or Location test - No security dongle */ // CROM3 // Hand written SEGA labels in this form: TITLE: QQ ROM NO: IC13 CHECK SUM: 6B84 9/12-'99 - ROM_LOAD64_WORD_SWAP( "qq.ic13", 0x3800006, 0x400000, BAD_DUMP CRC(75413a76) SHA1(3c6d1c385938687f8c91c1f293e5e1e1874f5496) ) /* Check sum: 6B84, dated "9/12-'99" */ - ROM_LOAD64_WORD_SWAP( "qq.ic14", 0x3800004, 0x400000, BAD_DUMP CRC(678b9c2c) SHA1(04168df377850fd496cbd5eb2a3effa05c7c2e7b) ) /* Check sum: 3DC1, dated "9/12-'99" */ - ROM_LOAD64_WORD_SWAP( "qq.ic15", 0x3800002, 0x400000, BAD_DUMP CRC(6ee8af07) SHA1(1f7d01ad6094e9204d5e1e1674a0ea7b53832263) ) /* Check sum: 4988, dated "9/12-'99" */ + ROM_LOAD64_WORD_SWAP( "qq.ic13", 0x3800006, 0x400000, CRC(bf3aca1b) SHA1(895473cfc59bcd3e0b2f377e6029348de92dc37f) ) /* Check sum: 6B84, dated "9/12-'99" */ + ROM_LOAD64_WORD_SWAP( "qq.ic14", 0x3800004, 0x400000, CRC(b41db79b) SHA1(f3e50b5f85f7722188f21e2c71f5e827ad937ada) ) /* Check sum: 3DC1, dated "9/12-'99" */ + ROM_LOAD64_WORD_SWAP( "qq.ic15", 0x3800002, 0x400000, CRC(91c5a2a1) SHA1(dafc89fc9ca70174651faaf34f528c90eaa24630) ) /* Check sum: 4988, dated "9/12-'99" */ ROM_LOAD64_WORD_SWAP( "qq.ic16", 0x3800000, 0x400000, CRC(3634f178) SHA1(ac32cfb47c8a33e5f62cc99a99d5c6bebbc6b601) ) /* Check sum: 0461, dated "9/12-'99" */ ROM_REGION( 0x2000000, "user3", 0 ) /* Video ROMs Part 1 */ @@ -5636,7 +5636,7 @@ ROM_START( ecap ) /* Step 2.1 - Proto or Location test - No security dongle */ ROM_REGION( 0x080000, "audiocpu", 0 ) /* 68000 code */ // Hand written SEGA labels in this form: TITLE: QQ ROM NO: IC21 CHECK SUM: 0994 9/12-'99 - ROM_LOAD16_WORD_SWAP( "qq.ic21", 0x000000, 0x080000, BAD_DUMP CRC(d8496bca) SHA1(3fa76e2210f04b75c048979f90055854311e306c) ) /* Check sum: 0994, dated "9/12-'99" */ + ROM_LOAD16_WORD_SWAP( "qq.ic21", 0x000000, 0x080000, CRC(0c55ca5f) SHA1(74da1945714f8a512627124280d4302b1a7276cc) ) /* Check sum: 0994, dated "9/12-'99" */ ROM_REGION16_BE( 0x1000000, "samples", 0 ) /* SCSP samples */ ROM_LOAD16_WORD_SWAP( "mpr-22887.22", 0x000000, 0x400000, CRC(7d04a867) SHA1(053de98105880188b4daff183710d7932617547f) ) diff --git a/src/mame/drivers/mrdo.cpp b/src/mame/drivers/mrdo.cpp index c157b6f9b05..6b31dac3cb1 100644 --- a/src/mame/drivers/mrdo.cpp +++ b/src/mame/drivers/mrdo.cpp @@ -384,6 +384,38 @@ ROM_START( mrdoy ) ROM_LOAD( "j2-u001.bin", 0x0000, 0x0117, CRC(badf5876) SHA1(b301cfc7f8e83408fdcb742f552a0414af6aa16e) ) // PAL16R6 converted to GAL16V8 ROM_END +/* The white garbled graphics on the title screen should be the Fabremar logo (32px height), but it's drawn as + 16px height, like the original Taito logo. Since the F4 ROM had a different label than the others and it matches + with 'mrdot', someone probably replaced the original F4 Fabremar ROM with the one from Taito. */ +ROM_START( mrdofabr ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "md_fabre.a4", 0x0000, 0x2000, CRC(62593aed) SHA1(ac1cc4fa4ee3799e84938333a2a698d1ec0b527b) ) + ROM_LOAD( "md_fabre.b4", 0x2000, 0x2000, CRC(710058d8) SHA1(168cc179f2266bbf9437445bef9ff7d3358a8e6b) ) + ROM_LOAD( "md_fabre.c4", 0x4000, 0x2000, CRC(467d12d8) SHA1(7bb85e6a780de1c0c224229ee571cab39098f78d) ) + ROM_LOAD( "md_fabre.f4", 0x6000, 0x2000, BAD_DUMP CRC(fce9afeb) SHA1(26236a42c1c620975d4480c4315d0c6f112429b6) ) + + ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_LOAD( "md_fabre.t8", 0x0000, 0x1000, CRC(f2dff901) SHA1(ddc3b38bfd8b822d7803ee51e2c13443b25e39ee) ) + ROM_LOAD( "md_fabre.u8", 0x1000, 0x1000, CRC(f3e443bd) SHA1(10e134962b0c7500f57d4058cbd0475f5c5fa6ab) ) + + ROM_REGION( 0x2000, "gfx2", 0 ) + ROM_LOAD( "md_fabre.r8", 0x0000, 0x1000, CRC(dbdc9ffa) SHA1(93f29fc106283eecbba3fd69cf3c4658aa38ab9f) ) + ROM_LOAD( "md_fabre.n8", 0x1000, 0x1000, CRC(4b9973db) SHA1(8766c51a345a5e63446e65614c6f665ab5fbe0d7) ) + + ROM_REGION( 0x2000, "gfx3", 0 ) + ROM_LOAD( "md_fabre.h5", 0x0000, 0x1000, CRC(e1218cc5) SHA1(d946613a1cf1c97f7533a4f8c2d0078d1b7daaa8) ) + ROM_LOAD( "md_fabre.k5", 0x1000, 0x1000, CRC(b1f68b04) SHA1(25709cd81c03df51f27cd730fecf86a1daa9e27e) ) + + ROM_REGION( 0x0080, "proms", 0 ) + ROM_LOAD( "82s123.u2", 0x0000, 0x0020, CRC(238a65d7) SHA1(a5b20184a1989db23544296331462ec4d7be7516) ) /* palette (high bits) */ + ROM_LOAD( "82s123.t2", 0x0020, 0x0020, CRC(ae263dc0) SHA1(7072c100b9d692f5bb12b0c9e304425f534481e2) ) /* palette (low bits) */ + ROM_LOAD( "82s123.f10n", 0x0040, 0x0020, CRC(16ee4ca2) SHA1(fcba4d103708b9711452009cd29c4f88d2f64cd3) ) /* sprite color lookup table */ + ROM_LOAD( "82s123.j10", 0x0060, 0x0020, CRC(ff7fe284) SHA1(3ac8e30011c1fcba0ee8f4dc932f82296c3ba143) ) /* timing (not used) */ + + ROM_REGION( 0x0200, "pal16r6", 0 ) + ROM_LOAD( "pal16r6.j2", 0x0000, 0x0117, BAD_DUMP CRC(badf5876) SHA1(b301cfc7f8e83408fdcb742f552a0414af6aa16e) ) // From parent, protected on this set +ROM_END + ROM_START( yankeedo ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "a4-01.bin", 0x0000, 0x2000, CRC(03dcfba2) SHA1(c15e3d0c4225e0ca120bcd28aca39632575f8e11) ) @@ -414,11 +446,11 @@ ROM_START( yankeedo ) ROM_END - -GAME( 1982, mrdo, 0, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal", "Mr. Do!", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, mrdoy, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal", "Mr. Do! (prototype)", MACHINE_SUPPORTS_SAVE ) /* aka "Yukidaruma" */ -GAME( 1982, mrdot, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal (Taito license)", "Mr. Do! (Taito)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, mrdofix, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal (Taito license)", "Mr. Do! (bugfixed)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, mrlo, mrdo, mrlo, mrdo, mrdo_state, empty_init, ROT270, "bootleg", "Mr. Lo!", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, mrdu, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "bootleg", "Mr. Du!", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, yankeedo, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "hack", "Yankee DO!", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mrdo, 0, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal", "Mr. Do!", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mrdoy, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal", "Mr. Do! (prototype)", MACHINE_SUPPORTS_SAVE ) /* aka "Yukidaruma" */ +GAME( 1982, mrdot, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal (Taito license)", "Mr. Do! (Taito)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mrdofix, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "Universal (Taito license)", "Mr. Do! (bugfixed)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mrlo, mrdo, mrlo, mrdo, mrdo_state, empty_init, ROT270, "bootleg", "Mr. Lo!", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mrdu, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "bootleg", "Mr. Du!", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mrdofabr, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "bootleg (Fabremar)", "Mr. Do! (Fabremar bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, yankeedo, mrdo, mrdo, mrdo, mrdo_state, empty_init, ROT270, "hack", "Yankee DO!", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp index 95b3c3a3b5a..a45fc7f3b21 100644 --- a/src/mame/drivers/ms32.cpp +++ b/src/mame/drivers/ms32.cpp @@ -71,13 +71,16 @@ others are unknown Notes ----- -Some of the roms for each game are encrypted. +Some of the roms for each game are encrypted: + 16x16x8 'Scroll' Tiles (Non-Roz BG Layer) + 8x8x8 'Ascii' Tiles (FG Layer) -The only difference between the two Gratia sets is in the encrypted ROMs (they use -different custom chips). The program is the same. - -16x16x8 'Scroll' Tiles (Non-Roz BG Layer) -8x8x8 'Ascii' Tiles (FG Layer) +The only difference between the two Gratia sets are the encrypted ROMs in each set (they use +different custom chips). The program ROMs are the same, as is all non encrypted graphics data. +94019_30ver1.0.30 matches 94019_2.030 when both are decrypted with their respective encryption +routines. Due to the badly dumped mr94019-07.10, it hasn't been verified that it's data is +identical to 94019_2.07 when both are decrypted. Waiting for a proper redump of mr94019-07.10 +for verification. ToDo / Notes @@ -775,10 +778,10 @@ confirm them by looking at the code. The ROM string is in quotes. FFE00DE8 ; irq_0 probably "1msec interrupt" FFE00DF4 ; irq_1 "sound cpu interrupt" FFE00878 ; irq_2 probably "fpu 1-1 interrupt" -FFE00884 ; irq_3 unused and labelled "fpu 0-1 interrupt" -FFE00898 ; irq_4 unused and labelled "fpu 1-0 interrupt" +FFE00884 ; irq_3 unused and labeled "fpu 0-1 interrupt" +FFE00898 ; irq_4 unused and labeled "fpu 1-0 interrupt" FFE008AC ; irq_5 probably "fpu 0-0 interrupt", x coords (and y) populated from here -FFE008D0 ; irq_6 unused and labelled "option 2 interrupt" +FFE008D0 ; irq_6 unused and labeled "option 2 interrupt" FFE008E4 ; irq_7 same as 5 - probably "option 1 interrupt" FFE01034 ; irq_9 VBL at 60Hz this would be "16msec interrupt" FFE01094 ; irq_10 loads of processing in the 0xfc000000 area : must be "32msec interrupt" @@ -1491,21 +1494,27 @@ static INPUT_PORTS_START( f1superb ) PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("DSW") - PORT_DIPUNUSED_DIPLOC( 0x00000001, 0x00000001, "SW2:8" ) - PORT_DIPUNUSED_DIPLOC( 0x00000002, 0x00000002, "SW2:7" ) + PORT_DIPNAME( 0x00000001, 0x00000001, "Credit Counter" ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x00000000, "Eremite" ) // no idea what this means, taken from manual + PORT_DIPSETTING( 0x00000001, "Display" ) + PORT_DIPNAME( 0x00000002, 0x00000002, "Speed Meter Display" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x00000000, "mph" ) + PORT_DIPSETTING( 0x00000002, "km/h" ) PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000004, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x00000008, 0x00000008, "SW2:5" ) + PORT_DIPNAME( 0x00000008, 0x00000008, "Time Up Mode" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00000008, DEF_STR( On ) ) PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,3") PORT_DIPSETTING( 0x0000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0030, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0010, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0020, DEF_STR( Hardest ) ) - PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Region ) ) PORT_DIPLOCATION("SW2:2,1") + PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Region ) ) PORT_DIPLOCATION("SW2:2,1") // English manual only gives 0x48 and 0x80 as valid PORT_DIPSETTING( 0x0080, DEF_STR( USA ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Europe ) ) -// PORT_DIPSETTING( 0x0040, "Europe" ) + PORT_DIPSETTING( 0x0040, "Europe" ) PORT_DIPSETTING( 0x00c0, DEF_STR( Japan ) ) PORT_DIPUNUSED_DIPLOC( 0x00000100, 0x00000100, "SW1:8" ) PORT_DIPUNUSED_DIPLOC( 0x00000200, 0x00000200, "SW1:7" ) @@ -2022,7 +2031,8 @@ ROM_START( gratiaa ) ROM_LOAD( "mr94019-09.11", 0x200000, 0x200000, CRC(711ab08b) SHA1(185b80b965ac3aba4857b4f83637008c2c1cc6ff) ) ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */ - ROM_LOAD( "mr94019-07.10", 0x000000, 0x200000, BAD_DUMP CRC(acb75824) SHA1(3b43e00a2d240761565042c8feead25a83ef0eb1) ) // FIXED BITS (xxxxxxxx11111111) +// ROM_LOAD( "mr94019-07.10", 0x000000, 0x200000, BAD_DUMP CRC(acb75824) SHA1(3b43e00a2d240761565042c8feead25a83ef0eb1) ) // FIXED BITS (xxxxxxxx11111111) + ROM_LOAD( "mr94019-07.10", 0x000000, 0x200000, BAD_DUMP CRC(561a786b) SHA1(23df08d50801bd6e4a2f12dd3bb50632ff77f0f2) ) /* HAND CRAFTED: decrypted & re-encrypted 94019_2.07 - marked BAD_DUMP until proper ROM redump */ ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */ ROM_LOAD( "94019_30ver1.0.30",0x000000, 0x080000, CRC(026b5379) SHA1(b9237477f1bf8ae83174e8231492fe667e6d6a13) ) /* Labeled 94019 (21)Ver1,0 with the Kanji verson of the game name before "(30)" */ @@ -2328,12 +2338,13 @@ ROM_START( akiss ) ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */ ROM_END +// Version 1.1 known to exist, labeled as: P-47 ACES 3/31 ROM 26 Ver1.1 - uses the same MB-94166 EB91022-20101 rom board. ROM_START( p47aces ) ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */ - ROM_LOAD32_BYTE( "p47-26.26", 0x000003, 0x80000, CRC(e017b819) SHA1(942fb48e8bb3a263534a0351a1a9979d786bc475) ) /* Need to verify - might be: P-47 ACES 3/31 ROM 26 Ver1.1 - uses MB-94166 EB91022-20101 rom board */ - ROM_LOAD32_BYTE( "p47-27.27", 0x000002, 0x80000, CRC(bd1b81e0) SHA1(b15f157fe3a30295f999a4c285da2d6f22d7fba6) ) /* Need to verify - might be: P-47 ACES 3/31 ROM 27 Ver1.1 */ - ROM_LOAD32_BYTE( "p47-28.28", 0x000001, 0x80000, CRC(4742a5f7) SHA1(cd297aa150082c545647c9a755cf2cdbdc98c988) ) /* Need to verify - might be: P-47 ACES 3/31 ROM 28 Ver1.1 */ - ROM_LOAD32_BYTE( "p47-29.29", 0x000000, 0x80000, CRC(86e17d8b) SHA1(73004f243c6dfb86ce4cc61475dc7caaf452750e) ) /* Need to verify - might be: P-47 ACES 3/31 ROM 29 Ver1.1 */ + ROM_LOAD32_BYTE( "p47_ver1.0-26.26", 0x000003, 0x80000, CRC(e017b819) SHA1(942fb48e8bb3a263534a0351a1a9979d786bc475) ) /* Labeled "P-47 Ver1.0 -26" */ + ROM_LOAD32_BYTE( "p47_ver1.0-27.27", 0x000002, 0x80000, CRC(bd1b81e0) SHA1(b15f157fe3a30295f999a4c285da2d6f22d7fba6) ) /* Labeled "P-47 Ver1.0 -27" */ + ROM_LOAD32_BYTE( "p47_ver1.0-28.28", 0x000001, 0x80000, CRC(4742a5f7) SHA1(cd297aa150082c545647c9a755cf2cdbdc98c988) ) /* Labeled "P-47 Ver1.0 -28" */ + ROM_LOAD32_BYTE( "p47_ver1.0-29.29", 0x000000, 0x80000, CRC(86e17d8b) SHA1(73004f243c6dfb86ce4cc61475dc7caaf452750e) ) /* Labeled "P-47 Ver1.0 -29" */ ROM_REGION( 0xe00000, "sprite", 0 ) /* sprites */ ROM_LOAD32_WORD( "mr94020-02.1", 0x000002, 0x200000, CRC(28732d3c) SHA1(15b2687bcad31793fc7d6a9dc3eccb7ad9b5f659) ) @@ -2354,10 +2365,10 @@ ROM_START( p47aces ) ROM_LOAD( "mr94020-09.9", 0x200000, 0x200000, CRC(226014a6) SHA1(090bdc1f6d2b9d33b431dbb49a457a4bb36cd3ad) ) ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */ - ROM_LOAD( "p-47_ver1.0-30.30", 0x000000, 0x080000, CRC(7ba90fad) SHA1(c0a3d4458816f00b8f5eb4b6d4531d1abeaccbe5) ) + ROM_LOAD( "p-47_ver1.0-30.30", 0x000000, 0x080000, CRC(7ba90fad) SHA1(c0a3d4458816f00b8f5eb4b6d4531d1abeaccbe5) ) /* Labeled "P-47 Ver1.0 -30" */ ROM_REGION( 0x40000, "audiocpu", 0 ) /* z80 program */ - ROM_LOAD( "p-47_ver1.0-21.21", 0x000000, 0x040000, CRC(f2d43927) SHA1(69ac20f339a515d58cafbcd6f7d7982ca5cda681) ) + ROM_LOAD( "p-47_ver1.0-21.21", 0x000000, 0x040000, CRC(f2d43927) SHA1(69ac20f339a515d58cafbcd6f7d7982ca5cda681) ) /* Labeled "P-47 Ver1.0 -21" */ ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */ ROM_LOAD( "mr92042-01.22", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples @@ -2623,7 +2634,7 @@ GAME( 1994, suchie2o, suchie2, ms32, suchie2, ms32_state, init_suchie2, RO GAME( 1995, desertwr, 0, ms32, desertwr, ms32_state, init_ss91022_10, ROT270, "Jaleco", "Desert War / Wangan Sensou (ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1995, gametngk, 0, ms32, gametngk, ms32_state, init_ss91022_10, ROT270, "Jaleco", "The Game Paradise - Master of Shooting! / Game Tengoku - The Game Paradise (ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1995, tetrisp, 0, ms32, tetrisp, ms32_state, init_ss92046_01, ROT0, "Jaleco / BPS", "Tetris Plus (ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, p47aces, 0, ms32, p47aces, ms32_state, init_ss92048_01, ROT0, "Jaleco", "P-47 Aces", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1995, p47aces, 0, ms32, p47aces, ms32_state, init_ss92048_01, ROT0, "Jaleco", "P-47 Aces (ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1995, akiss, 0, ms32, suchie2, ms32_state, init_kirarast, ROT0, "Jaleco", "Mahjong Angel Kiss (ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1996, gratia, 0, ms32, gratia, ms32_state, init_ss92047_01, ROT0, "Jaleco", "Gratia - Second Earth (ver 1.0, 92047-01 version)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1996, gratiaa, gratia, ms32, gratia, ms32_state, init_ss91022_10, ROT0, "Jaleco", "Gratia - Second Earth (ver 1.0, 91022-10 version)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/namcofl.cpp b/src/mame/drivers/namcofl.cpp index ec19bb340e4..7742e890ac2 100644 --- a/src/mame/drivers/namcofl.cpp +++ b/src/mame/drivers/namcofl.cpp @@ -156,8 +156,8 @@ OSC3: 48.384MHz 13E : HN58C65 EEPROM TODO - finalapr : Some objects aren't displayed, Wrong shadow behavior - speedrcr : Incorrect ROZ layer + finalapr : Some objects aren't displayed, Wrong shadow behavior + speedrcr : Incorrect ROZ layer */ #include "emu.h" diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp index 3e939215503..ff49f38dd44 100644 --- a/src/mame/drivers/namcona1.cpp +++ b/src/mame/drivers/namcona1.cpp @@ -5,20 +5,21 @@ Namco NA-1 / NA-2 System NA-1 Games: -- Bakuretsu Quiz Ma-Q Dai Bouken -- F/A / Fighter & Attacker -- Super World Court (C354, C357) -- Exvania (C350, C354) +- Bakuretsu Quiz Ma-Q Dai Bouken (C348) +- F/A / Fighter & Attacker (C349) +- Super World Court (C357) +- Exvania (C350) - Cosmo Gang the Puzzle (C356) -- Tinkle Pit (C354, C367) -- Emeraldia (C354, C358) +- Tinkle Pit (C367) +- Emeraldia (C358) NA-2 Games: -- Knuckle Heads -- Numan Athletics -- Emeraldia (C354, C358) -- Nettou! Gekitou! Quiztou!! (C354, C365 - both are 32pin) -- X-Day 2 +- Knuckle Heads (C3??) +- Numan Athletics (C359) +- Emeraldia (C358) +- Nettou! Gekitou! Quiztou!! (C365) +- X-Day 2 (C394) + To Do: - Remove remaining MCU simulation hacks @@ -56,6 +57,11 @@ Notes: - Some NA-1 PCBs are known to have the NA-2 (C70) MCU BIOS, so that cannot be used to tell them apart. +- All rom pcb's have PLD's NA1R10 and NA1R2 OR they have a C354 in place of + the 2 PLD's doing the same job (enable lines on the rom board) + Most games have been seen in both configurations / board styles. + C354 is not to be confused with the Keycus, Both devices are 32pin and C3xx. + - Test mode for NA2 games includes an additional item: UART Test. No games are known to actually link up and use the UART feature. It's been confirmed that a Numan Athletics fails the UART test, @@ -122,7 +128,7 @@ Notes: C70 - rebadged M37702 (QFP80) 219 - (QFP160) 215 - (QFP176) - 210 - tied to some audio parts & C215 (SOP28) + 210 - Video output related, tied to C215 (SOP28) ROM Board --------- @@ -1097,8 +1103,8 @@ ROM_END ROM_START(cgangpzl) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("cp2-ep0l.bin", 0x000001, 0x080000, CRC(8f5cdcc5) SHA1(925db3f3f16224bc28f97a57aba0ab2b51c5067c)) /* 0xc00000 */ - ROM_LOAD16_BYTE("cp2-ep0u.bin", 0x000000, 0x080000, CRC(3a816140) SHA1(613c367e08a0a20ec62e1938faab0128743b26f8)) + ROM_LOAD16_BYTE("cp2-ep0l.4c", 0x000001, 0x080000, CRC(8f5cdcc5) SHA1(925db3f3f16224bc28f97a57aba0ab2b51c5067c)) /* 0xc00000 */ + ROM_LOAD16_BYTE("cp2-ep0u.4f", 0x000000, 0x080000, CRC(3a816140) SHA1(613c367e08a0a20ec62e1938faab0128743b26f8)) ROM_REGION16_BE(0x800000, "maskrom", ROMREGION_ERASE00) /* no mask roms */ @@ -1109,8 +1115,8 @@ ROM_END ROM_START(cgangpzlj) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("cp1-ep0l.bin", 0x000001, 0x080000, CRC(2825f7ba) SHA1(5f6f8df6bdf0f45656904411cdbb31fdcf8f3be0)) /* 0xc00000 */ - ROM_LOAD16_BYTE("cp1-ep0u.bin", 0x000000, 0x080000, CRC(94d7d6fc) SHA1(2460741e0dbb2ccff28f4fbc419a7507382467d2)) + ROM_LOAD16_BYTE("cp1-ep0l.4c", 0x000001, 0x080000, CRC(2825f7ba) SHA1(5f6f8df6bdf0f45656904411cdbb31fdcf8f3be0)) /* 0xc00000 */ + ROM_LOAD16_BYTE("cp1-ep0u.4f", 0x000000, 0x080000, CRC(94d7d6fc) SHA1(2460741e0dbb2ccff28f4fbc419a7507382467d2)) ROM_REGION16_BE(0x800000, "maskrom", ROMREGION_ERASE00) /* no mask roms */ @@ -1121,10 +1127,10 @@ ROM_END ROM_START(emeraldaj) /* NA-1 Game PCB, parent is NA-2 version listed below */ ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("em1-ep0lb.bin", 0x000001, 0x080000, CRC(fcd55293) SHA1(fdabf9d5f528c37196ac1e031b097618b4c887b5)) /* 0xc00000 */ - ROM_LOAD16_BYTE("em1-ep0ub.bin", 0x000000, 0x080000, CRC(a52f00d5) SHA1(85f95d2a69a2df2e9195f55583645c064b0b6fe6)) - ROM_LOAD16_BYTE("em1-ep1l.bin", 0x100001, 0x080000, CRC(373c1c59) SHA1(385cb3bc056b798878de890dbff97a8bdd48fe4e)) - ROM_LOAD16_BYTE("em1-ep1u.bin", 0x100000, 0x080000, CRC(4e969152) SHA1(2c89ae5d43585f479f16cf8278f8fc001e077e45)) + ROM_LOAD16_BYTE("em1-ep0lb.6c", 0x000001, 0x080000, CRC(fcd55293) SHA1(fdabf9d5f528c37196ac1e031b097618b4c887b5)) /* 0xc00000 */ + ROM_LOAD16_BYTE("em1-ep0ub.6f", 0x000000, 0x080000, CRC(a52f00d5) SHA1(85f95d2a69a2df2e9195f55583645c064b0b6fe6)) + ROM_LOAD16_BYTE("em1-ep1l.7c", 0x100001, 0x080000, CRC(373c1c59) SHA1(385cb3bc056b798878de890dbff97a8bdd48fe4e)) + ROM_LOAD16_BYTE("em1-ep1u.7f", 0x100000, 0x080000, CRC(4e969152) SHA1(2c89ae5d43585f479f16cf8278f8fc001e077e45)) ROM_REGION16_BE(0x800000, "maskrom", ROMREGION_ERASE00) /* no mask roms */ @@ -1132,10 +1138,10 @@ ROM_END ROM_START(emeraldaja) /* NA-1 Game PCB, parent is NA-2 version listed below */ ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("em1-ep0l.bin", 0x000001, 0x080000, CRC(443f3fce) SHA1(35b6c834e5716c1e9b55f1e39f4e7336dbbe2d9b)) /* 0xc00000 */ - ROM_LOAD16_BYTE("em1-ep0u.bin", 0x000000, 0x080000, CRC(484a2a81) SHA1(1b60c18dfb2aebfd4aa8b2a85a1e90883a1f8e61)) - ROM_LOAD16_BYTE("em1-ep1l.bin", 0x100001, 0x080000, CRC(373c1c59) SHA1(385cb3bc056b798878de890dbff97a8bdd48fe4e)) - ROM_LOAD16_BYTE("em1-ep1u.bin", 0x100000, 0x080000, CRC(4e969152) SHA1(2c89ae5d43585f479f16cf8278f8fc001e077e45)) + ROM_LOAD16_BYTE("em1-ep0l.6c", 0x000001, 0x080000, CRC(443f3fce) SHA1(35b6c834e5716c1e9b55f1e39f4e7336dbbe2d9b)) /* 0xc00000 */ + ROM_LOAD16_BYTE("em1-ep0u.6f", 0x000000, 0x080000, CRC(484a2a81) SHA1(1b60c18dfb2aebfd4aa8b2a85a1e90883a1f8e61)) + ROM_LOAD16_BYTE("em1-ep1l.7c", 0x100001, 0x080000, CRC(373c1c59) SHA1(385cb3bc056b798878de890dbff97a8bdd48fe4e)) + ROM_LOAD16_BYTE("em1-ep1u.7c", 0x100000, 0x080000, CRC(4e969152) SHA1(2c89ae5d43585f479f16cf8278f8fc001e077e45)) ROM_REGION16_BE(0x800000, "maskrom", ROMREGION_ERASE00) /* no mask roms */ @@ -1173,58 +1179,58 @@ ROM_END ROM_START(fghtatck) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("fa2-ep0l.bin", 0x000001, 0x080000, CRC(8996db9c) SHA1(ebbe7d4cb2960a346cfbdf38c77638d71b6ba20e)) /* 0xc00000 */ - ROM_LOAD16_BYTE("fa2-ep0u.bin", 0x000000, 0x080000, CRC(58d5e090) SHA1(950219d4e9bf440f92e3c8765f47e23a9019d2d1)) - ROM_LOAD16_BYTE("fa1-ep1l.bin", 0x100001, 0x080000, CRC(b23a5b01) SHA1(4ba9bc2102fffc93a5ff73a107d557fc0f3beefd)) - ROM_LOAD16_BYTE("fa1-ep1u.bin", 0x100000, 0x080000, CRC(de2eb129) SHA1(912993cab1c2edcaf986478f2ae22a2f10edf807)) + ROM_LOAD16_BYTE("fa2-ep0l.4c", 0x000001, 0x080000, CRC(8996db9c) SHA1(ebbe7d4cb2960a346cfbdf38c77638d71b6ba20e)) /* 0xc00000 */ + ROM_LOAD16_BYTE("fa2-ep0u.4f", 0x000000, 0x080000, CRC(58d5e090) SHA1(950219d4e9bf440f92e3c8765f47e23a9019d2d1)) + ROM_LOAD16_BYTE("fa1-ep1l.5c", 0x100001, 0x080000, CRC(b23a5b01) SHA1(4ba9bc2102fffc93a5ff73a107d557fc0f3beefd)) + ROM_LOAD16_BYTE("fa1-ep1u.5f", 0x100000, 0x080000, CRC(de2eb129) SHA1(912993cab1c2edcaf986478f2ae22a2f10edf807)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("fa1-ma0l.bin", 0x000001, 0x100000, CRC(a0a95e54) SHA1(da35f8a6a5bc9e2b5b6cacf8eb0d900ef1073a67)) /* 0x400000 */ - ROM_LOAD16_BYTE("fa1-ma0u.bin", 0x000000, 0x100000, CRC(1d0135bd) SHA1(2a7f8d09c213629a68376ce0379be61b37711d0a)) - ROM_LOAD16_BYTE("fa1-ma1l.bin", 0x200001, 0x100000, CRC(c4adf0a2) SHA1(4cc7adc68b1db7e725a973b31d52720bd7dc1140)) - ROM_LOAD16_BYTE("fa1-ma1u.bin", 0x200000, 0x100000, CRC(900297be) SHA1(57bb2078ff104c6f631c67219f80f8ede5ddbd09)) + ROM_LOAD16_BYTE("fa1-ma0l.2c", 0x000001, 0x100000, CRC(a0a95e54) SHA1(da35f8a6a5bc9e2b5b6cacf8eb0d900ef1073a67)) /* 0x400000 */ + ROM_LOAD16_BYTE("fa1-ma0u.2f", 0x000000, 0x100000, CRC(1d0135bd) SHA1(2a7f8d09c213629a68376ce0379be61b37711d0a)) + ROM_LOAD16_BYTE("fa1-ma1l.3c", 0x200001, 0x100000, CRC(c4adf0a2) SHA1(4cc7adc68b1db7e725a973b31d52720bd7dc1140)) + ROM_LOAD16_BYTE("fa1-ma1u.3f", 0x200000, 0x100000, CRC(900297be) SHA1(57bb2078ff104c6f631c67219f80f8ede5ddbd09)) ROM_END ROM_START(fa) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("fa1-ep0l.bin", 0x000001, 0x080000, CRC(182eee5c) SHA1(49769e3b72b59fc3e7b73364fe97168977dbe66b)) /* 0xc00000 */ - ROM_LOAD16_BYTE("fa1-ep0u.bin", 0x000000, 0x080000, CRC(7ea7830e) SHA1(79390943eea0b8029b2b8869233caf27228e776a)) - ROM_LOAD16_BYTE("fa1-ep1l.bin", 0x100001, 0x080000, CRC(b23a5b01) SHA1(4ba9bc2102fffc93a5ff73a107d557fc0f3beefd)) - ROM_LOAD16_BYTE("fa1-ep1u.bin", 0x100000, 0x080000, CRC(de2eb129) SHA1(912993cab1c2edcaf986478f2ae22a2f10edf807)) + ROM_LOAD16_BYTE("fa1-ep0l.4c", 0x000001, 0x080000, CRC(182eee5c) SHA1(49769e3b72b59fc3e7b73364fe97168977dbe66b)) /* 0xc00000 */ + ROM_LOAD16_BYTE("fa1-ep0u.4f", 0x000000, 0x080000, CRC(7ea7830e) SHA1(79390943eea0b8029b2b8869233caf27228e776a)) + ROM_LOAD16_BYTE("fa1-ep1l.5c", 0x100001, 0x080000, CRC(b23a5b01) SHA1(4ba9bc2102fffc93a5ff73a107d557fc0f3beefd)) + ROM_LOAD16_BYTE("fa1-ep1u.5f", 0x100000, 0x080000, CRC(de2eb129) SHA1(912993cab1c2edcaf986478f2ae22a2f10edf807)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("fa1-ma0l.bin", 0x000001, 0x100000, CRC(a0a95e54) SHA1(da35f8a6a5bc9e2b5b6cacf8eb0d900ef1073a67)) /* 0x400000 */ - ROM_LOAD16_BYTE("fa1-ma0u.bin", 0x000000, 0x100000, CRC(1d0135bd) SHA1(2a7f8d09c213629a68376ce0379be61b37711d0a)) - ROM_LOAD16_BYTE("fa1-ma1l.bin", 0x200001, 0x100000, CRC(c4adf0a2) SHA1(4cc7adc68b1db7e725a973b31d52720bd7dc1140)) - ROM_LOAD16_BYTE("fa1-ma1u.bin", 0x200000, 0x100000, CRC(900297be) SHA1(57bb2078ff104c6f631c67219f80f8ede5ddbd09)) + ROM_LOAD16_BYTE("fa1-ma0l.2c", 0x000001, 0x100000, CRC(a0a95e54) SHA1(da35f8a6a5bc9e2b5b6cacf8eb0d900ef1073a67)) /* 0x400000 */ + ROM_LOAD16_BYTE("fa1-ma0u.2f", 0x000000, 0x100000, CRC(1d0135bd) SHA1(2a7f8d09c213629a68376ce0379be61b37711d0a)) + ROM_LOAD16_BYTE("fa1-ma1l.3c", 0x200001, 0x100000, CRC(c4adf0a2) SHA1(4cc7adc68b1db7e725a973b31d52720bd7dc1140)) + ROM_LOAD16_BYTE("fa1-ma1u.3f", 0x200000, 0x100000, CRC(900297be) SHA1(57bb2078ff104c6f631c67219f80f8ede5ddbd09)) ROM_END ROM_START(swcourt) ROM_REGION(0x200000, "maincpu", 0) ROM_LOAD16_BYTE("sc2-ep0l.4c", 0x000001, 0x080000, CRC(5053a02e) SHA1(8ab5a085969cef5e01be01d8f531233002ea5bff)) /* 0xc00000 */ ROM_LOAD16_BYTE("sc2-ep0u.4f", 0x000000, 0x080000, CRC(7b3fc7fa) SHA1(f96c03a03339b7677b8dc8689d907f2c8895886c)) - ROM_LOAD16_BYTE("sc1-ep1l.bin", 0x100001, 0x080000, CRC(fb45cf5f) SHA1(6ded351daa9b39d0b8149100caefc4fa0c598e79)) - ROM_LOAD16_BYTE("sc1-ep1u.bin", 0x100000, 0x080000, CRC(1ce07b15) SHA1(b1b28cc480301c9ad642597c7cdd8e9cdec996a6)) + ROM_LOAD16_BYTE("sc1-ep1l.5c", 0x100001, 0x080000, CRC(fb45cf5f) SHA1(6ded351daa9b39d0b8149100caefc4fa0c598e79)) + ROM_LOAD16_BYTE("sc1-ep1u.5f", 0x100000, 0x080000, CRC(1ce07b15) SHA1(b1b28cc480301c9ad642597c7cdd8e9cdec996a6)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("sc1-ma0l.bin", 0x000001, 0x100000, CRC(3e531f5e) SHA1(6da56630bdfbb19f1639c539779c180d106f6ee2)) /* 0x400000 */ - ROM_LOAD16_BYTE("sc1-ma0u.bin", 0x000000, 0x100000, CRC(31e76a45) SHA1(5c278c167c1025c648ce2da2c3764645e96dcd55)) - ROM_LOAD16_BYTE("sc1-ma1l.bin", 0x200001, 0x100000, CRC(8ba3a4ec) SHA1(f881e7b4728f388d18450ba85e13e233071fbc88)) - ROM_LOAD16_BYTE("sc1-ma1u.bin", 0x200000, 0x100000, CRC(252dc4b7) SHA1(f1be6bd045495c7a0ecd97f01d1dc8ad341fecfd)) + ROM_LOAD16_BYTE("sc1-ma0l.2c", 0x000001, 0x100000, CRC(3e531f5e) SHA1(6da56630bdfbb19f1639c539779c180d106f6ee2)) /* 0x400000 */ + ROM_LOAD16_BYTE("sc1-ma0u.2f", 0x000000, 0x100000, CRC(31e76a45) SHA1(5c278c167c1025c648ce2da2c3764645e96dcd55)) + ROM_LOAD16_BYTE("sc1-ma1l.3c", 0x200001, 0x100000, CRC(8ba3a4ec) SHA1(f881e7b4728f388d18450ba85e13e233071fbc88)) + ROM_LOAD16_BYTE("sc1-ma1u.3f", 0x200000, 0x100000, CRC(252dc4b7) SHA1(f1be6bd045495c7a0ecd97f01d1dc8ad341fecfd)) ROM_END ROM_START(swcourtj) ROM_REGION(0x200000, "maincpu", 0) ROM_LOAD16_BYTE("sc1-ep0l.4c", 0x000001, 0x080000, CRC(145111dd) SHA1(f8f74f77fb80af2ea37ea8ddbf02c1f3fcaf3fdb)) /* 0xc00000 */ ROM_LOAD16_BYTE("sc1-ep0u.4f", 0x000000, 0x080000, CRC(c721c138) SHA1(5d30d66629d982b54c3bb62118be940dc7b69a6b)) - ROM_LOAD16_BYTE("sc1-ep1l.bin", 0x100001, 0x080000, CRC(fb45cf5f) SHA1(6ded351daa9b39d0b8149100caefc4fa0c598e79)) - ROM_LOAD16_BYTE("sc1-ep1u.bin", 0x100000, 0x080000, CRC(1ce07b15) SHA1(b1b28cc480301c9ad642597c7cdd8e9cdec996a6)) + ROM_LOAD16_BYTE("sc1-ep1l.5c", 0x100001, 0x080000, CRC(fb45cf5f) SHA1(6ded351daa9b39d0b8149100caefc4fa0c598e79)) + ROM_LOAD16_BYTE("sc1-ep1u.5f", 0x100000, 0x080000, CRC(1ce07b15) SHA1(b1b28cc480301c9ad642597c7cdd8e9cdec996a6)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("sc1-ma0l.bin", 0x000001, 0x100000, CRC(3e531f5e) SHA1(6da56630bdfbb19f1639c539779c180d106f6ee2)) /* 0x400000 */ - ROM_LOAD16_BYTE("sc1-ma0u.bin", 0x000000, 0x100000, CRC(31e76a45) SHA1(5c278c167c1025c648ce2da2c3764645e96dcd55)) - ROM_LOAD16_BYTE("sc1-ma1l.bin", 0x200001, 0x100000, CRC(8ba3a4ec) SHA1(f881e7b4728f388d18450ba85e13e233071fbc88)) - ROM_LOAD16_BYTE("sc1-ma1u.bin", 0x200000, 0x100000, CRC(252dc4b7) SHA1(f1be6bd045495c7a0ecd97f01d1dc8ad341fecfd)) + ROM_LOAD16_BYTE("sc1-ma0l.2c", 0x000001, 0x100000, CRC(3e531f5e) SHA1(6da56630bdfbb19f1639c539779c180d106f6ee2)) /* 0x400000 */ + ROM_LOAD16_BYTE("sc1-ma0u.2f", 0x000000, 0x100000, CRC(31e76a45) SHA1(5c278c167c1025c648ce2da2c3764645e96dcd55)) + ROM_LOAD16_BYTE("sc1-ma1l.3c", 0x200001, 0x100000, CRC(8ba3a4ec) SHA1(f881e7b4728f388d18450ba85e13e233071fbc88)) + ROM_LOAD16_BYTE("sc1-ma1u.3f", 0x200000, 0x100000, CRC(252dc4b7) SHA1(f1be6bd045495c7a0ecd97f01d1dc8ad341fecfd)) ROM_END /* @@ -1244,10 +1250,10 @@ Believed to be a Playmark bootleg because the PCB has the typical slightly blue ROM_START(swcourtb) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("0l.0l", 0x000001, 0x080000, CRC(669c9b10) SHA1(8c40f5331f899c458699ab856c5900c540e8471e)) /* 0xc00000 */ - ROM_LOAD16_BYTE("0u.0u", 0x000000, 0x080000, CRC(742f3da1) SHA1(b3df6afd9849af8dd1643991ac70c93bf9f8fcb2)) - ROM_LOAD16_BYTE("1l.1l", 0x100001, 0x080000, CRC(fb45cf5f) SHA1(6ded351daa9b39d0b8149100caefc4fa0c598e79)) - ROM_LOAD16_BYTE("1u.1u", 0x100000, 0x080000, CRC(1ce07b15) SHA1(b1b28cc480301c9ad642597c7cdd8e9cdec996a6)) + ROM_LOAD16_BYTE("0l0l.4c", 0x000001, 0x080000, CRC(669c9b10) SHA1(8c40f5331f899c458699ab856c5900c540e8471e)) /* 0xc00000 */ + ROM_LOAD16_BYTE("0u0u.4f", 0x000000, 0x080000, CRC(742f3da1) SHA1(b3df6afd9849af8dd1643991ac70c93bf9f8fcb2)) + ROM_LOAD16_BYTE("1l1l.5c", 0x100001, 0x080000, CRC(fb45cf5f) SHA1(6ded351daa9b39d0b8149100caefc4fa0c598e79)) + ROM_LOAD16_BYTE("1u.1u.5f", 0x100000, 0x080000, CRC(1ce07b15) SHA1(b1b28cc480301c9ad642597c7cdd8e9cdec996a6)) ROM_REGION16_BE(0x800000, "maskrom", 0) ROM_LOAD16_BYTE("oll.ol.2c", 0x000001, 0x80000, CRC(df0920ef) SHA1(c8d583d8967b3eb86ecfbabb906cc82d2a05d139)) /* 0x400000 */ @@ -1264,18 +1270,18 @@ ROM_END ROM_START(tinklpit) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("tk1-ep0l.bin", 0x000001, 0x080000, CRC(fdccae42) SHA1(398384482ccb3eb08bfb9db495513272a5188d92)) /* 0xc00000 */ - ROM_LOAD16_BYTE("tk1-ep0u.bin", 0x000000, 0x080000, CRC(62cdb48c) SHA1(73c7b99b117b8dc567bc254b0ffcc117c9d42fb5)) - ROM_LOAD16_BYTE("tk1-ep1l.bin", 0x100001, 0x080000, CRC(7e90f104) SHA1(79e371426b2e32dc8f687e4d124d23c251198937)) - ROM_LOAD16_BYTE("tk1-ep1u.bin", 0x100000, 0x080000, CRC(9c0b70d6) SHA1(eac44d3470f4c2ddd9c41f82e6398bca0cc8a4fd)) + ROM_LOAD16_BYTE("tk1-ep0l.6c", 0x000001, 0x080000, CRC(fdccae42) SHA1(398384482ccb3eb08bfb9db495513272a5188d92)) /* 0xc00000 */ + ROM_LOAD16_BYTE("tk1-ep0u.6f", 0x000000, 0x080000, CRC(62cdb48c) SHA1(73c7b99b117b8dc567bc254b0ffcc117c9d42fb5)) + ROM_LOAD16_BYTE("tk1-ep1l.7c", 0x100001, 0x080000, CRC(7e90f104) SHA1(79e371426b2e32dc8f687e4d124d23c251198937)) + ROM_LOAD16_BYTE("tk1-ep1u.7f", 0x100000, 0x080000, CRC(9c0b70d6) SHA1(eac44d3470f4c2ddd9c41f82e6398bca0cc8a4fd)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("tk1-ma0l.bin", 0x000001, 0x100000, CRC(c6b4e15d) SHA1(55252ba4d904b14940436f1b4dc5e2a6bd163bdf)) /* 0x400000 */ - ROM_LOAD16_BYTE("tk1-ma0u.bin", 0x000000, 0x100000, CRC(a3ad6f67) SHA1(54289eed5347defb5464ec5a610a6748909159f6)) - ROM_LOAD16_BYTE("tk1-ma1l.bin", 0x200001, 0x100000, CRC(61cfb92a) SHA1(eacf0e7557f33d552045f43a116ff08c533a2771)) - ROM_LOAD16_BYTE("tk1-ma1u.bin", 0x200000, 0x100000, CRC(54b77816) SHA1(9341d07858623e1920eaae7b2b90126c7057297e)) - ROM_LOAD16_BYTE("tk1-ma2l.bin", 0x400001, 0x100000, CRC(087311d2) SHA1(6fe50f9e08551e57d15a15b01e3822a6cb7c8352)) - ROM_LOAD16_BYTE("tk1-ma2u.bin", 0x400000, 0x100000, CRC(5ce20c2c) SHA1(7eaff21714bae44f8b21b6db98f055e04bfbae18)) + ROM_LOAD16_BYTE("tk1-ma0l.2c", 0x000001, 0x100000, CRC(c6b4e15d) SHA1(55252ba4d904b14940436f1b4dc5e2a6bd163bdf)) /* 0x400000 */ + ROM_LOAD16_BYTE("tk1-ma0u.2f", 0x000000, 0x100000, CRC(a3ad6f67) SHA1(54289eed5347defb5464ec5a610a6748909159f6)) + ROM_LOAD16_BYTE("tk1-ma1l.3c", 0x200001, 0x100000, CRC(61cfb92a) SHA1(eacf0e7557f33d552045f43a116ff08c533a2771)) + ROM_LOAD16_BYTE("tk1-ma1u.3f", 0x200000, 0x100000, CRC(54b77816) SHA1(9341d07858623e1920eaae7b2b90126c7057297e)) + ROM_LOAD16_BYTE("tk1-ma2l.4c", 0x400001, 0x100000, CRC(087311d2) SHA1(6fe50f9e08551e57d15a15b01e3822a6cb7c8352)) + ROM_LOAD16_BYTE("tk1-ma2u.4f", 0x400000, 0x100000, CRC(5ce20c2c) SHA1(7eaff21714bae44f8b21b6db98f055e04bfbae18)) ROM_END @@ -1354,38 +1360,38 @@ ROM_END ROM_START(numanath) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("nm2-ep0l.bin", 0x000001, 0x080000, CRC(f24414bb) SHA1(68b13dfdc2292afd5279edb891fe63972f991e7b)) /* 0xc00000 */ - ROM_LOAD16_BYTE("nm2-ep0u.bin", 0x000000, 0x080000, CRC(25c41616) SHA1(68ba67d3dd45f3bdddfa2fd21b574535306c1214)) - ROM_LOAD16_BYTE("nm1-ep1l.bin", 0x100001, 0x080000, CRC(4581dcb4) SHA1(1f46f98e63a7c9cdfde9e8ee2696a13c3f9bcc8e)) - ROM_LOAD16_BYTE("nm1-ep1u.bin", 0x100000, 0x080000, CRC(30cd589a) SHA1(74a14ec41fe4fc9f73e5357b0903f1199ed96337)) + ROM_LOAD16_BYTE("nm2-ep0l.6c", 0x000001, 0x080000, CRC(f24414bb) SHA1(68b13dfdc2292afd5279edb891fe63972f991e7b)) /* 0xc00000 */ + ROM_LOAD16_BYTE("nm2-ep0u.6f", 0x000000, 0x080000, CRC(25c41616) SHA1(68ba67d3dd45f3bdddfa2fd21b574535306c1214)) + ROM_LOAD16_BYTE("nm1-ep1l.7c", 0x100001, 0x080000, CRC(4581dcb4) SHA1(1f46f98e63a7c9cdfde9e8ee2696a13c3f9bcc8e)) + ROM_LOAD16_BYTE("nm1-ep1u.7f", 0x100000, 0x080000, CRC(30cd589a) SHA1(74a14ec41fe4fc9f73e5357b0903f1199ed96337)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("nm1-ma0l.bin", 0x000001, 0x100000, CRC(20faaa57) SHA1(9dbfc0dd48eec37b2c0715a5691c6e6f923fc7f7)) /* 0x400000 */ - ROM_LOAD16_BYTE("nm1-ma0u.bin", 0x000000, 0x100000, CRC(ed7c37f2) SHA1(829751af33754ade941f76982e196b494d56ab0a)) - ROM_LOAD16_BYTE("nm1-ma1l.bin", 0x200001, 0x100000, CRC(2232e3b4) SHA1(e9da3dc34eb2576c8a88e23cb9007129e885496d)) - ROM_LOAD16_BYTE("nm1-ma1u.bin", 0x200000, 0x100000, CRC(6cc9675c) SHA1(fec74da4479f2a088760efc6908e6acfaea3989f)) - ROM_LOAD16_BYTE("nm1-ma2l.bin", 0x400001, 0x100000, CRC(208abb39) SHA1(52d7247a71c6a14467f12f5270921bba1824cc3f)) - ROM_LOAD16_BYTE("nm1-ma2u.bin", 0x400000, 0x100000, CRC(03a3f204) SHA1(9cb0422c8ecc819d0cc8a65c29a228369d78d986)) - ROM_LOAD16_BYTE("nm1-ma3l.bin", 0x600001, 0x100000, CRC(42a539e9) SHA1(1c53a5a031648891ab7a37cf026c979404ce9589)) - ROM_LOAD16_BYTE("nm1-ma3u.bin", 0x600000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25)) + ROM_LOAD16_BYTE("nm1-ma0l.2c", 0x000001, 0x100000, CRC(20faaa57) SHA1(9dbfc0dd48eec37b2c0715a5691c6e6f923fc7f7)) /* 0x400000 */ + ROM_LOAD16_BYTE("nm1-ma0u.2f", 0x000000, 0x100000, CRC(ed7c37f2) SHA1(829751af33754ade941f76982e196b494d56ab0a)) + ROM_LOAD16_BYTE("nm1-ma1l.3c", 0x200001, 0x100000, CRC(2232e3b4) SHA1(e9da3dc34eb2576c8a88e23cb9007129e885496d)) + ROM_LOAD16_BYTE("nm1-ma1u.3f", 0x200000, 0x100000, CRC(6cc9675c) SHA1(fec74da4479f2a088760efc6908e6acfaea3989f)) + ROM_LOAD16_BYTE("nm1-ma2l.4c", 0x400001, 0x100000, CRC(208abb39) SHA1(52d7247a71c6a14467f12f5270921bba1824cc3f)) + ROM_LOAD16_BYTE("nm1-ma2u.4f", 0x400000, 0x100000, CRC(03a3f204) SHA1(9cb0422c8ecc819d0cc8a65c29a228369d78d986)) + ROM_LOAD16_BYTE("nm1-ma3l.5c", 0x600001, 0x100000, CRC(42a539e9) SHA1(1c53a5a031648891ab7a37cf026c979404ce9589)) + ROM_LOAD16_BYTE("nm1-ma3u.5f", 0x600000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25)) ROM_END ROM_START(numanathj) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD16_BYTE("nm1-ep0l.bin", 0x000001, 0x080000, CRC(4398b898) SHA1(0d1517409ba181f796f7f413cac704c60085b505)) /* 0xc00000 */ - ROM_LOAD16_BYTE("nm1-ep0u.bin", 0x000000, 0x080000, CRC(be90aa79) SHA1(6884a8d72dd34c889527e8e653f5e5b4cf3fb5d6)) - ROM_LOAD16_BYTE("nm1-ep1l.bin", 0x100001, 0x080000, CRC(4581dcb4) SHA1(1f46f98e63a7c9cdfde9e8ee2696a13c3f9bcc8e)) - ROM_LOAD16_BYTE("nm1-ep1u.bin", 0x100000, 0x080000, CRC(30cd589a) SHA1(74a14ec41fe4fc9f73e5357b0903f1199ed96337)) + ROM_LOAD16_BYTE("nm1-ep0l.6c", 0x000001, 0x080000, CRC(4398b898) SHA1(0d1517409ba181f796f7f413cac704c60085b505)) /* 0xc00000 */ + ROM_LOAD16_BYTE("nm1-ep0u.6f", 0x000000, 0x080000, CRC(be90aa79) SHA1(6884a8d72dd34c889527e8e653f5e5b4cf3fb5d6)) + ROM_LOAD16_BYTE("nm1-ep1l.7c", 0x100001, 0x080000, CRC(4581dcb4) SHA1(1f46f98e63a7c9cdfde9e8ee2696a13c3f9bcc8e)) + ROM_LOAD16_BYTE("nm1-ep1u.7f", 0x100000, 0x080000, CRC(30cd589a) SHA1(74a14ec41fe4fc9f73e5357b0903f1199ed96337)) ROM_REGION16_BE(0x800000, "maskrom", 0) - ROM_LOAD16_BYTE("nm1-ma0l.bin", 0x000001, 0x100000, CRC(20faaa57) SHA1(9dbfc0dd48eec37b2c0715a5691c6e6f923fc7f7)) /* 0x400000 */ - ROM_LOAD16_BYTE("nm1-ma0u.bin", 0x000000, 0x100000, CRC(ed7c37f2) SHA1(829751af33754ade941f76982e196b494d56ab0a)) - ROM_LOAD16_BYTE("nm1-ma1l.bin", 0x200001, 0x100000, CRC(2232e3b4) SHA1(e9da3dc34eb2576c8a88e23cb9007129e885496d)) - ROM_LOAD16_BYTE("nm1-ma1u.bin", 0x200000, 0x100000, CRC(6cc9675c) SHA1(fec74da4479f2a088760efc6908e6acfaea3989f)) - ROM_LOAD16_BYTE("nm1-ma2l.bin", 0x400001, 0x100000, CRC(208abb39) SHA1(52d7247a71c6a14467f12f5270921bba1824cc3f)) - ROM_LOAD16_BYTE("nm1-ma2u.bin", 0x400000, 0x100000, CRC(03a3f204) SHA1(9cb0422c8ecc819d0cc8a65c29a228369d78d986)) - ROM_LOAD16_BYTE("nm1-ma3l.bin", 0x600001, 0x100000, CRC(42a539e9) SHA1(1c53a5a031648891ab7a37cf026c979404ce9589)) - ROM_LOAD16_BYTE("nm1-ma3u.bin", 0x600000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25)) + ROM_LOAD16_BYTE("nm1-ma0l.2c", 0x000001, 0x100000, CRC(20faaa57) SHA1(9dbfc0dd48eec37b2c0715a5691c6e6f923fc7f7)) /* 0x400000 */ + ROM_LOAD16_BYTE("nm1-ma0u.2f", 0x000000, 0x100000, CRC(ed7c37f2) SHA1(829751af33754ade941f76982e196b494d56ab0a)) + ROM_LOAD16_BYTE("nm1-ma1l.3c", 0x200001, 0x100000, CRC(2232e3b4) SHA1(e9da3dc34eb2576c8a88e23cb9007129e885496d)) + ROM_LOAD16_BYTE("nm1-ma1u.3f", 0x200000, 0x100000, CRC(6cc9675c) SHA1(fec74da4479f2a088760efc6908e6acfaea3989f)) + ROM_LOAD16_BYTE("nm1-ma2l.4c", 0x400001, 0x100000, CRC(208abb39) SHA1(52d7247a71c6a14467f12f5270921bba1824cc3f)) + ROM_LOAD16_BYTE("nm1-ma2u.4f", 0x400000, 0x100000, CRC(03a3f204) SHA1(9cb0422c8ecc819d0cc8a65c29a228369d78d986)) + ROM_LOAD16_BYTE("nm1-ma3l.5c", 0x600001, 0x100000, CRC(42a539e9) SHA1(1c53a5a031648891ab7a37cf026c979404ce9589)) + ROM_LOAD16_BYTE("nm1-ma3u.5f", 0x600000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25)) ROM_END ROM_START(quiztou) diff --git a/src/mame/drivers/namconb1.cpp b/src/mame/drivers/namconb1.cpp index 337977f3f31..7517ede9687 100644 --- a/src/mame/drivers/namconb1.cpp +++ b/src/mame/drivers/namconb1.cpp @@ -888,7 +888,7 @@ static INPUT_PORTS_START( namconb1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) INPUT_PORTS_END - + /****************************************************************************/ void namconb1_state::init_nebulray() diff --git a/src/mame/drivers/namcos10.cpp b/src/mame/drivers/namcos10.cpp index 5eb58d2dc5a..a56294f1ff2 100644 --- a/src/mame/drivers/namcos10.cpp +++ b/src/mame/drivers/namcos10.cpp @@ -28,6 +28,7 @@ Golgo 13 Juusei no Chinkonka (GLT1 Ver.A) (C) Namco/8ing/Raizing, 2001 Gunbalina (GNN1 Ver. A) (C) Namco, 2000 *Hard Puncher Hajime no Ippo 2 Ouja e no Chousen (C) Namco/Taito, 2002 *Honne Hakkenki (C) Namco, 2001 +**Knock Down 2001 (C) Namco, 2001 Kotoba no Puzzle Mojipittan (KPM1 Ver.A) (C) Namco, 2001 *Kurukuru Food (C) Namco, 2002 Mr Driller 2 (DR21 Ver.A) (C) Namco, 2000 @@ -50,8 +51,10 @@ Taiko no Tatsujin 5 (TK51 Ver.A) (C) Namco, 2003 Taiko no Tatsujin 6 (TK61 Ver.A) (C) Namco, 2004 Tsukkomi Yousei Gips Nice Tsukkomi (NTK1 Ver.A) (C) Namco/Metro, 2002 Uchuu Daisakusen Chocovader Contactee (CVC1 Ver.A) (C) Namco, 2002 +Unknown medal (?) game (MTL1 SPR0B) (C) ?, 200? * - denotes not dumped yet. +** - denotes incomplete dump. The Namco System 10 system comprises 2 or 3 PCB's.... MAIN PCB - This is the mother board PCB. It holds the main CPU/GPU & SPU and all sound circuitry, program & video RAM, @@ -265,6 +268,7 @@ Game Sticker KEYCUS ROMs Populated Gamshara 10021 Ver.A KC020A 8E, 8D N/A Gekitoride-Jong Space 10011 Ver.A KC003A 8E, 8D, 7E, 7D N/A Gunbalina GNN1 Ver.A KC002A 8E, 8D N/A see note 3 +Knock Down 2001 KD11 Ver.B KC011A 8E, 8D N/A also has a Namco P-DRIVE PCB 1908961101 (1908971101) with an H8/3002 Kono Tako 10021 Ver.A KC034A 8E, 8D N/A Kotoba no Puzzle Mojipittan KPM1 Ver.A KC012A 8E, 8D, 7E N/A Mr Driller G DRG1 Ver.A KC007A 8E, 8D, 7E N/A @@ -279,6 +283,7 @@ Taiko no Tatsujin 4 TK41 Ver.A KC024A 8E, 8D, 7E Taiko no Tatsujin 5 TK51 Ver.A KC031A 8E, 8D, 7E not dumped Taiko no Tatsujin 6 TK61 Ver.A KC036A 8E, 8D, 7E TK-6 Utyuu Daisakusen Chocovader Contactee CVC1 Ver.A KC022A 8E, 8D, 7E, 7D, 6E N/A +unknown medal (?) game MTL1 SPR0B KC043A 8E, 8D N/A also has a Namco System10 EXFINAL PCB 8906962603 (8906962703) Notes: 1. The ROM PCB has locations for 16x 128MBit FlashROMs (Total capacity = 2048MBits) but usually only a few are populated. @@ -388,7 +393,7 @@ Notes: This PCB is required by Point Blank 3 since it controls the gun opto signal. Only the CPLD and J8 and some minor logic and other small support parts are populated. -This PCB has been found almost fully populated (minus J6) on some Taiko no Tatsujin games (TK51/TK61) but not +This PCB has been found almost fully populated (minus J6) on some Taiko no Tatsujin games (TK51/TK61) (and on Knock Down 2001) but not earlier TK games, so it appears to be optional or is only used by the later TK51 and TK61 games. */ @@ -1253,6 +1258,28 @@ ROM_START( taiko6 ) DISK_IMAGE_READONLY( "tk-6", 0, SHA1(ca8b8dfccc2022094c428b5e0b6391a77ec351f4) ) ROM_END +ROM_START( unks10md ) + ROM_REGION32_LE( 0x400000, "maincpu:rom", 0 ) /* bios */ + ROM_FILL( 0x0000000, 0x400000, 0x55 ) + + ROM_REGION16_LE( 0x2100000, "user2", 0 ) /* main prg */ + ROM_LOAD( "k9f2808u0c.8e", 0x0000000, 0x1080000, CRC(b8ce45c6) SHA1(cfc85e796e32f5f3cc16e12ce902f0ae088eea31) ) + ROM_LOAD( "k9f2808u0c.8d", 0x1080000, 0x1080000, CRC(49a2a732) SHA1(1a473177827a6d0e58c289d9af064665b941519b) ) +ROM_END + +ROM_START( kd2001 ) + ROM_REGION32_LE( 0x400000, "maincpu:rom", 0 ) /* bios */ + ROM_FILL( 0x0000000, 0x400000, 0x55 ) + + ROM_REGION16_LE( 0x2100000, "user2", 0 ) /* main prg */ + ROM_LOAD( "0.8e", 0x0000000, 0x1080000, NO_DUMP ) // broken flash ROM, couldn't be dumped + ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(2b0d0e8c) SHA1(d679e7044e1f93bb7bd449e6d8fcb7737d154025) ) + + ROM_REGION( 0x20000, "pdrivecpu", 0 ) + ROM_LOAD( "kd11-dr0-ic10.bin", 0x00000, 0x20000, CRC(59649293) SHA1(71c3a0e73d077398e7f3d95acedc47814e99fbc6) ) +ROM_END + + GAME( 2000, mrdrilr2, 0, ns10_mrdrilr2, namcos10, namcos10_state, init_mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (Japan, DR21 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks GAME( 2000, mrdrlr2a, mrdrilr2, ns10_mrdrilr2, namcos10, namcos10_state, init_mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (World, DR22 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks GAME( 2000, ptblank3, 0, namcos10_memn, namcos10, namcos10_state, init_gunbalna, ROT0, "Namco", "Point Blank 3 (World, GNN2 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) @@ -1262,6 +1289,7 @@ GAME( 2001, g13jnc, 0, namcos10_memn, namcos10, namcos10_state, empty_ GAME( 2001, mrdrilrg, 0, namcos10_memn, namcos10, namcos10_state, init_mrdrilrg, ROT0, "Namco", "Mr. Driller G (Japan, DRG1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks GAME( 2001, mrdrilrga, mrdrilrg, namcos10_memn, namcos10, namcos10_state, init_mrdrilrg, ROT0, "Namco", "Mr. Driller G ALT (Japan, DRG1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks GAME( 2001, knpuzzle, 0, ns10_knpuzzle, namcos10, namcos10_state, init_knpuzzle, ROT0, "Namco", "Kotoba no Puzzle Mojipittan (Japan, KPM1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 2001, kd2001, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Knock Down 2001 (Japan, KD11 Ver. B)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) GAME( 2002, chocovdr, 0, ns10_chocovdr, namcos10, namcos10_state, init_chocovdr, ROT0, "Namco", "Uchuu Daisakusen: Chocovader Contactee (Japan, CVC1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 2002, startrgn, 0, ns10_startrgn, namcos10, namcos10_state, init_startrgn, ROT0, "Namco", "Star Trigon (Japan, STT1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) GAME( 2002, panikuru, 0, namcos10_memn, namcos10, namcos10_state, init_panikuru, ROT0, "Namco", "Panicuru Panekuru (Japan, PPA1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) @@ -1271,3 +1299,4 @@ GAME( 2003, nflclsfb, 0, ns10_nflclsfb, namcos10, namcos10_state, init_n GAME( 2003, konotako, 0, ns10_konotako, namcos10, namcos10_state, init_konotako, ROT0, "Mitchell", "Kono Tako (10021 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) GAME( 2004, sekaikh, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Sekai Kaseki Hakken (Japan, SKH1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) GAME( 2004, taiko6, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Taiko no Tatsujin 6 (Japan, TK61 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +GAME( 200?, unks10md, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "unknown Namco System 10 medal game (MTL1 SPR0B)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) diff --git a/src/mame/drivers/namcos12.cpp b/src/mame/drivers/namcos12.cpp index e0ce39f1a64..06fd1d6e18f 100644 --- a/src/mame/drivers/namcos12.cpp +++ b/src/mame/drivers/namcos12.cpp @@ -3263,7 +3263,7 @@ GAME( 1996, tekken3a, tekken3, coh700, namcos12, namcos12_state, i GAME( 1996, tekken3ud, tekken3, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Tekken 3 (US, TET3/VER.D)", 0 ) /* KC006 */ GAME( 1996, tekken3ua, tekken3, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Tekken 3 (US, TET3/VER.A)", 0 ) /* KC006 */ GAME( 1996, tekken3je1,tekken3, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Tekken 3 (Japan, TET1/VER.E1)", 0 ) /* KC006 */ -GAME( 1996, tekken3ja, tekken3, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Tekken 3 (Japan, TET1/VER.A)", 0 ) /* KC014 */ +GAME( 1996, tekken3ja, tekken3, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Tekken 3 (Japan, TET1/VER.A)", 0 ) /* KC006 */ GAME( 1997, lbgrande, 0, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Libero Grande (World, LG2/VER.A)", 0 ) /* KC014 */ GAME( 1997, lbgrandeja,lbgrande, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco", "Libero Grande (Japan, LG1/VER.A)", MACHINE_NOT_WORKING ) /* KC014 */ GAME( 1997, toukon3, 0, coh700, namcos12, namcos12_state, init_namcos12, ROT0, "Namco / Tomy", "Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (Japan, TR1/VER.A)", 0 ) /* KC019 */ diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp index addc1f813fa..ffe7a124c4d 100644 --- a/src/mame/drivers/namcos23.cpp +++ b/src/mame/drivers/namcos23.cpp @@ -1269,7 +1269,7 @@ Notes: #include "speaker.h" #include "tilemap.h" -#include <float.h> +#include <cfloat> #define JVSCLOCK (XTAL(14'745'600)) diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index 20bd6326e0d..4bfe5dfb50a 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -320,7 +320,8 @@ Games known to use this PCB include.... Sticker EPROM FLASHROMs X76F100 EPM7064S 315-5881 Game on cart IC22# # of SOP56 IC37# IC41# IC42# Notes ---------------------------------------------------------------------------------------------------------------------------------- -Club Kart: European Session (2003, prototype) no cart * 21 (64Mb)** present 315-6206 not present * flash-PCB ** game data ROMs is not dumped +Club Kart (2003, prototype, set 1) no cart * 21 (64Mb) present 315-6206 not present * flash-PCB +Club Kart (2003, prototype, set 2) no cart * 21 (64Mb) present 315-6206 present * flash-PCB Crackin' DJ part 2 840-0068C 23674 20 (64Mb) present 315-6206 317-0311-COM PCB have label 840-0068B-01 837-14124, requires regular 837-13551 and 837-13938 rotary JVS boards, and turntable simulation Crazy Taxi 840-0002C ? 13 (64Mb) ? 315-6206 ? not dumped, likely same as regular 171-7919A cart Ferrari F355 Challenge (twin/deluxe, preview) no cart 22848P* 21 (64Mb) present 315-6206 317-0267-COM * other ROM board we've seen had 2x flashroms PCB instead of IC22 EEPROM, contents is the same. @@ -2922,6 +2923,17 @@ MACHINE_RESET_MEMBER(naomi_state,naomi) naomi_state::machine_reset(); } +WRITE_LINE_MEMBER(naomi_state::external_reset) +{ + // routine called by the dimm board to reboot the naomi mainboard + logerror("Received reset fromm dimm board !\n"); + naomi_state::machine_reset(); + m_maincpu->reset(); + // it will probably need to be adjusted + m_aica->reset(); + m_soundcpu->reset(); +} + /* * Common for Naomi 1, Naomi GD-Rom, Naomi 2, Atomiswave ... */ @@ -3011,6 +3023,8 @@ void naomi_state::naomi(machine_config &config) naomi_base(config); naomi_rom_board &rom_board(NAOMI_ROM_BOARD(config, "rom_board", 0, "naomibd_eeprom")); rom_board.irq_callback().set(FUNC(dc_state::g1_irq)); + rom_board.ext_irq_callback().set(FUNC(dc_state::external_irq)); + rom_board.reset_out_callback().set(FUNC(naomi_state::external_reset)); } /* @@ -3022,6 +3036,8 @@ void naomi_state::naomigd(machine_config &config) naomi_base(config); naomi_gdrom_board &rom_board(NAOMI_GDROM_BOARD(config, "rom_board", 0, "naomibd_eeprom", ":gdrom", "pic")); rom_board.irq_callback().set(FUNC(dc_state::g1_irq)); + rom_board.ext_irq_callback().set(FUNC(dc_state::external_irq)); + rom_board.reset_out_callback().set(FUNC(naomi_state::external_reset)); } /* @@ -8061,14 +8077,14 @@ G-MAIN2 | RTC72423 JP6 | | IC3 52256 52256 315-5338A | | TOS1 JP1 LEDs | -| CR2032 IC2 JP2-5 SW1 SW2 SW3 SW4 | +| CR2032 IC2 JP2-5 SW1 SW2 SW3 SW4 | |------------------------------------------------------------| Notes: MC68360 - Motorola MC68360EM25L 'QUICC' QUad Integrated Communications Controller IC2 - EPR-24482 27C4002 EEPROM (DIP40) IC3 - EEPROM DIP40 (not populated) 4C256K16 - 2x Alliance AS4C256K16F0 256k x16 CMOS DRAM (Fast Page Mode) - 52256 - 2x Sharp LH52256CN-70LL 32k x8 CMOS SRAM + 52256 - 2x Sharp LH52256CN-70LL 32k x8 CMOS SRAM COM20020 - 2x SMsC COM20020ILJP 5Mbps ARCNET controller 315-5296 - 2x Sega I/O ASIC 315-5338A - Sega I/O ASIC @@ -10028,32 +10044,63 @@ ROM_START( clubk2kp ) NAOMI_DEFAULT_EEPROM ROM_REGION( 0xa000000, "rom_board", ROMREGION_ERASEFF) - ROM_LOAD( "ic22.bin", 0x0000000, 0x400000, CRC(334fc561) SHA1(e8c8707b0d13216ec7071da05823e330deb810d4) ) // flash ROM module - // game data ROMs not dumped, not the same as regular revision. technically, all below should be marked as NO_DUMP. - ROM_LOAD32_WORD( "opr-24151.ic17s", 0x1000000, 0x800000, CRC(91594439) SHA1(a195bfe0c70a0c7048b547af0a92c98d126230c6) ) - ROM_LOAD32_WORD( "opr-24152.ic18", 0x1000002, 0x800000, CRC(fd131f88) SHA1(bc27b3ab5b41a3fe33b541b7cca28d6baed157b3) ) - ROM_LOAD32_WORD( "opr-24153.ic19s", 0x2000000, 0x800000, CRC(795df2a6) SHA1(80f740806dcaacc28752cea98b254cbee51972a4) ) - ROM_LOAD32_WORD( "opr-24154.ic20", 0x2000002, 0x800000, CRC(7bba9a33) SHA1(e50199ce5c893ea81668cbf2972500803265dc19) ) - ROM_LOAD32_WORD( "opr-24155.ic21s", 0x3000000, 0x800000, CRC(9e3b358d) SHA1(3dec18be49b2271f013e4f4a02f32fa515a4ca69) ) - ROM_LOAD32_WORD( "opr-24156.ic22", 0x3000002, 0x800000, CRC(dd5286f7) SHA1(37ea254997cef1c45b53786c8abb2521acf24b56) ) - ROM_LOAD32_WORD( "opr-24157.ic23s", 0x4000000, 0x800000, CRC(7edc4a7d) SHA1(f4ffa20c83226c0c0dccc3b1e9ec6601f145b01b) ) - ROM_LOAD32_WORD( "opr-24158.ic24", 0x4000002, 0x800000, CRC(4d546427) SHA1(74a399c40f56af76077d47f996629a7fb650c804) ) - ROM_LOAD32_WORD( "opr-24159.ic25s", 0x5000000, 0x800000, CRC(ae8d7de1) SHA1(15dadd9c5449d65310647e247a07da165c9e3d5e) ) - ROM_LOAD32_WORD( "opr-24160.ic26", 0x5000002, 0x800000, CRC(e75210c9) SHA1(315c077201023740f63eab5de1d81eb71613b06f) ) - ROM_LOAD32_WORD( "opr-24161.ic27s", 0x6000000, 0x800000, CRC(aeecf812) SHA1(d683f1c7f200481cf2342a387d7558d0d76f89f4) ) - ROM_LOAD32_WORD( "opr-24162.ic28", 0x6000002, 0x800000, CRC(0e349c02) SHA1(4d0b4efeb125e23b1e73db2febf99565969d71d2) ) - ROM_LOAD32_WORD( "opr-24163.ic29", 0x7000000, 0x800000, CRC(dab7f365) SHA1(9a707c8992ddfa58f81bb5278f66713e424b0f4f) ) - ROM_LOAD32_WORD( "opr-24164.ic30s", 0x7000002, 0x800000, CRC(03be6b1d) SHA1(40792314fada46648f4f98a3d5a14822e6b1cf36) ) - ROM_LOAD32_WORD( "opr-24165.ic31", 0x8000000, 0x800000, CRC(8fdb66a5) SHA1(32d2926328d9d804dcff781e2b758dd2a4b1a753) ) - ROM_LOAD32_WORD( "opr-24166.ic32s", 0x8000002, 0x800000, CRC(790a1b5e) SHA1(bb0ad6de62d758f6869b3bb62cce9947f8b08681) ) - ROM_LOAD32_WORD( "opr-24167.ic33", 0x9000000, 0x800000, CRC(15de1d97) SHA1(26a96644f183713a556a5ff2d491510589c9d7c8) ) - ROM_LOAD32_WORD( "opr-24168.ic34s", 0x9000002, 0x800000, CRC(90dfdd5a) SHA1(5c98bc84b310fa70e6bceee190508e9eaa60c82c) ) - - ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) + ROM_LOAD( "ic22.bin", 0x0000000, 0x400000, CRC(334fc561) SHA1(e8c8707b0d13216ec7071da05823e330deb810d4) ) // flash ROM module + + ROM_LOAD( "rom1.ic1s", 0x0800000, 0x800000, CRC(63bd7915) SHA1(3483f82ff801803c5abd04a0c66a1cecdff59c26) ) + ROM_LOAD( "rom2.ic2s", 0x1000000, 0x800000, CRC(9d0d5e68) SHA1(4b2535b968eff1fc1d3266194da54bb3c17b24ec) ) + ROM_LOAD( "rom3.ic3s", 0x1800000, 0x800000, CRC(ead5f480) SHA1(defcedeb150a9307f6fa36b36a53a59ab5ee274a) ) + ROM_LOAD( "rom4.ic4s", 0x2000000, 0x800000, CRC(c9b21961) SHA1(8c35378f65a14433965228cce26c7c8cebda8ece) ) + ROM_LOAD( "rom5.ic5s", 0x2800000, 0x800000, CRC(b42b5bdf) SHA1(da8c235f6e76ad5b4305a8d9722da8523a701924) ) + ROM_LOAD( "rom6.ic6s", 0x3000000, 0x800000, CRC(6e69792e) SHA1(25fa82e823ab12ba9a0aafe9cf09c16e74aff130) ) + ROM_LOAD( "rom7.ic7s", 0x3800000, 0x800000, CRC(0956796e) SHA1(69ed59a1e7f00cbf85ff72a47aa3eee75bc358fc) ) + ROM_LOAD( "rom8.ic8s", 0x4000000, 0x800000, CRC(9dba44f5) SHA1(8de0a836b1aa78e0babd4b186f991d44bc0f34b6) ) + ROM_LOAD( "rom9.ic9s", 0x4800000, 0x800000, CRC(1307b6a1) SHA1(a7108483e69994835e54f771a1f2ee05afda289d) ) + ROM_LOAD( "rom10.ic10s", 0x5000000, 0x800000, CRC(4ec15b61) SHA1(1484d00b780675df5178b0d686f152683b66e6df) ) + ROM_LOAD( "rom11.ic11s", 0x5800000, 0x800000, CRC(3c4a2f34) SHA1(f4b14ec9df023843bbbfeca174344c3f65a041b7) ) + ROM_LOAD( "rom12.ic12s", 0x6000000, 0x800000, CRC(55548b90) SHA1(3d791c13a142e78f0122a0ec0064023063255861) ) + ROM_LOAD( "rom13.ic13s", 0x6800000, 0x800000, CRC(373097e5) SHA1(561bf3ea396484b20ebb9fe63527329c005d067f) ) + ROM_LOAD( "rom14.ic14s", 0x7000000, 0x800000, CRC(7297efb8) SHA1(9c3acdbb01c178ff18f9fb21c62b982cad8775e3) ) + ROM_LOAD( "rom15.ic15s", 0x7800000, 0x800000, CRC(42dd18db) SHA1(8a0cc64128f2b823c99bcd1f45530ce85af6c6fe) ) + ROM_LOAD( "rom16.ic16s", 0x8000000, 0x800000, CRC(aaaa39cf) SHA1(8de90fefa81b3d5b8602335b18a86249deccc6a8) ) + ROM_LOAD( "rom17.ic17s", 0x8800000, 0x800000, CRC(382fc4cb) SHA1(8f79306fac4911748c362a4038ac6592ba0477c9) ) + ROM_LOAD( "rom18.ic18s", 0x9000000, 0x800000, CRC(cdd71385) SHA1(4b16d00b57b7fd96a7858e1b9146ee3f2ff0d200) ) + ROM_LOAD( "rom19.ic19s", 0x9800000, 0x800000, CRC(7ee9743b) SHA1(119f632c3d10d032fd15159aa37f3bcfe0938b06) ) ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") // 315-5881 not populated ROM_END +ROM_START( clubk2kpa ) + NAOMI2_BIOS + NAOMI_DEFAULT_EEPROM + + ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF) + ROM_LOAD( "rom0.ic22", 0x0000000, 0x400000, BAD_DUMP CRC(8514f0bf) SHA1(84ad7b8ccd41db38a5be8b0619e275b56482a5be) ) // one of ROM header bytes was clearly bad, manually fixed, but there might be more + // game data ROMs confirmed good, despite the fact they shown as all BAD in BIOS ROM TEST + ROM_LOAD( "rom1.ic1s", 0x0800000, 0x800000, CRC(63bd7915) SHA1(3483f82ff801803c5abd04a0c66a1cecdff59c26) ) + ROM_LOAD( "rom2.ic2s", 0x1000000, 0x800000, CRC(9d0d5e68) SHA1(4b2535b968eff1fc1d3266194da54bb3c17b24ec) ) + ROM_LOAD( "rom3.ic3s", 0x1800000, 0x800000, CRC(ead5f480) SHA1(defcedeb150a9307f6fa36b36a53a59ab5ee274a) ) + ROM_LOAD( "rom4.ic4s", 0x2000000, 0x800000, CRC(c9b21961) SHA1(8c35378f65a14433965228cce26c7c8cebda8ece) ) + ROM_LOAD( "rom5.ic5s", 0x2800000, 0x800000, CRC(b42b5bdf) SHA1(da8c235f6e76ad5b4305a8d9722da8523a701924) ) + ROM_LOAD( "rom6.ic6s", 0x3000000, 0x800000, CRC(6e69792e) SHA1(25fa82e823ab12ba9a0aafe9cf09c16e74aff130) ) + ROM_LOAD( "rom7.ic7s", 0x3800000, 0x800000, CRC(0956796e) SHA1(69ed59a1e7f00cbf85ff72a47aa3eee75bc358fc) ) + ROM_LOAD( "rom8.ic8s", 0x4000000, 0x800000, CRC(9dba44f5) SHA1(8de0a836b1aa78e0babd4b186f991d44bc0f34b6) ) + ROM_LOAD( "rom9.ic9s", 0x4800000, 0x800000, CRC(1307b6a1) SHA1(a7108483e69994835e54f771a1f2ee05afda289d) ) + ROM_LOAD( "rom10.ic10s", 0x5000000, 0x800000, CRC(4ec15b61) SHA1(1484d00b780675df5178b0d686f152683b66e6df) ) + ROM_LOAD( "rom11.ic11s", 0x5800000, 0x800000, CRC(3c4a2f34) SHA1(f4b14ec9df023843bbbfeca174344c3f65a041b7) ) + ROM_LOAD( "rom12.ic12s", 0x6000000, 0x800000, CRC(55548b90) SHA1(3d791c13a142e78f0122a0ec0064023063255861) ) + ROM_LOAD( "rom13.ic13s", 0x6800000, 0x800000, CRC(373097e5) SHA1(561bf3ea396484b20ebb9fe63527329c005d067f) ) + ROM_LOAD( "rom14.ic14s", 0x7000000, 0x800000, CRC(7297efb8) SHA1(9c3acdbb01c178ff18f9fb21c62b982cad8775e3) ) + ROM_LOAD( "rom15.ic15s", 0x7800000, 0x800000, CRC(42dd18db) SHA1(8a0cc64128f2b823c99bcd1f45530ce85af6c6fe) ) + ROM_LOAD( "rom16.ic16s", 0x8000000, 0x800000, CRC(aaaa39cf) SHA1(8de90fefa81b3d5b8602335b18a86249deccc6a8) ) + ROM_LOAD( "rom17.ic17s", 0x8800000, 0x800000, CRC(382fc4cb) SHA1(8f79306fac4911748c362a4038ac6592ba0477c9) ) + ROM_LOAD( "rom18.ic18s", 0x9000000, 0x800000, CRC(cdd71385) SHA1(4b16d00b57b7fd96a7858e1b9146ee3f2ff0d200) ) + ROM_LOAD( "rom19.ic19s", 0x9800000, 0x800000, CRC(7ee9743b) SHA1(119f632c3d10d032fd15159aa37f3bcfe0938b06) ) + ROM_LOAD( "rom20.ic20s", 0xa000000, 0x800000, CRC(99ef6bb7) SHA1(afcf187febe94035c989ca4a6e45bc0c3a806043) ) // not used by game, garbage + ROM_LOAD( "rom21.ic21s", 0xa800000, 0x800000, CRC(21bd0a9c) SHA1(b0709f627f2d2532f9cc10b5f89528f98336de61) ) // not used by game, garbage + + ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") // 315-5881 populated, not used +ROM_END + /********************************************** * @@ -11413,7 +11460,8 @@ ROM_END /* 0129 */ GAME( 2003, clubkprz, naomi2, naomi2m1, naomi, naomi2_state, init_naomi2, ROT0, "Sega", "Club Kart Prize (Export, Japan, Rev A)", GAME_FLAGS ) /* 0137 */ GAME( 2004, clubkpzb, naomi2, naomi2m1, naomi, naomi2_state, init_naomi2, ROT0, "Sega", "Club Kart Prize Version B (Export, Japan)", GAME_FLAGS ) /* 0139 */ GAME( 2003, clubk2k3, naomi2, naomi2m1, naomi, naomi2_state, init_naomi2, ROT0, "Sega", "Club Kart: European Session (2003, Rev A)", GAME_FLAGS ) -/* none */ GAME( 2003, clubk2kp, clubk2k3,naomi2m2, naomi, naomi2_state, init_naomi2, ROT0, "Sega", "Club Kart: European Session (2003, prototype)", GAME_FLAGS ) +/* none */ GAME( 2003, clubk2kp, clubk2k3,naomi2m2, naomi, naomi2_state, init_naomi2, ROT0, "Sega", "Club Kart: European Session (2003, prototype, set 1)", GAME_FLAGS ) +/* none */ GAME( 2003, clubk2kpa,clubk2k3,naomi2m2, naomi, naomi2_state, init_naomi2, ROT0, "Sega", "Club Kart: European Session (2003, prototype, set 2)", GAME_FLAGS ) /* 841-xxxxx ("Licensed by Sega" Naomi cart games)*/ /* 0001 */ GAME( 1999, pstone, naomi, naomim2, naomi, naomi_state, init_naomi, ROT0, "Capcom", "Power Stone", GAME_FLAGS ) diff --git a/src/mame/drivers/ncd88k.cpp b/src/mame/drivers/ncd88k.cpp new file mode 100644 index 00000000000..7cca778ad60 --- /dev/null +++ b/src/mame/drivers/ncd88k.cpp @@ -0,0 +1,70 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for MC88100-based NCD X terminals. + +****************************************************************************/ + +#include "emu.h" +#include "cpu/m88000/m88000.h" +#include "screen.h" + +class ncd88k_state : public driver_device +{ +public: + ncd88k_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_screen(*this, "screen") + { + } + + void ncd19c(machine_config &config); + +private: + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void code_map(address_map &map); + void data_map(address_map &map); + + required_device<cpu_device> m_maincpu; + required_device<screen_device> m_screen; +}; + +u32 ncd88k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void ncd88k_state::code_map(address_map &map) +{ + map(0x00000000, 0x000015fff).rom().region("program", 0); +} + +void ncd88k_state::data_map(address_map &map) +{ +} + +static INPUT_PORTS_START(ncd19c) +INPUT_PORTS_END + +void ncd88k_state::ncd19c(machine_config &config) +{ + MC88100(config, m_maincpu, 15'000'000); + m_maincpu->set_addrmap(AS_PROGRAM, &ncd88k_state::code_map); + m_maincpu->set_addrmap(AS_DATA, &ncd88k_state::data_map); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(125'000'000, 1680, 0, 1280, 1063, 0, 1024); // 74.4 kHz horizontal, 70 Hz vertical + m_screen->set_screen_update(FUNC(ncd88k_state::screen_update)); +} + +ROM_START(ncd19c) + ROM_REGION32_BE(0x16000, "program", 0) + // These dumps have very strange lengths. The actual ROMs should be standard EEPROM types. + ROM_LOAD16_BYTE("ncd19c-e.rom", 0x0000, 0xb000, CRC(01e31b42) SHA1(28da6e4465415d00a739742ded7937a144129aad) BAD_DUMP) + ROM_LOAD16_BYTE("ncd19c-o.rom", 0x0001, 0xb000, CRC(dfd9be7c) SHA1(2e99a325b039f8c3bb89833cd1940e6737b64d79) BAD_DUMP) +ROM_END + +COMP(1990, ncd19c, 0, 0, ncd19c, ncd19c, ncd88k_state, empty_init, "Network Computing Devices", "NCD19c", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index bfbc2daba77..eef93d8d906 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -15,15 +15,16 @@ This entire hardware series is generally called 'GX400' Salamander (Version J) (Game 587) PWB(B) 201012A GX587 Lifeforce (US) (Game 587) PWB(B) 201012A GX587 Lifeforce (Japan) (Game 587) PWB(B) 201012A GX587 + Black Panther (Game 604) GX604 PWB(B) 201017A City Bomber (World) (Game 787) PWB(B) 250102A City Bomber (Japan) (Game 787) PWB(B) 250102A Kitten Kaboodle (Game 712) PWB(B) 250102A Nyan Nyan Panic (Japan) (Game 712) PWB(B) 250102A Hyper Crash (Version D) (Game 790) GX790 PWB(B) 250093A Hyper Crash (Version C) (Game 790) GX790 PWB(B) 250093A -TODO: find pcb pics for below - Black Panther (Game 604) + Most of these boards share the same bottom/gfx board, labeled 'GX400PWB // (A)200204B' +Black Panther uses a 'GX400PWB // (A)200204C' bottom/gfx board driver by Bryan McPhail diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp index d83cea15476..3637024b7ed 100644 --- a/src/mame/drivers/neogeo.cpp +++ b/src/mame/drivers/neogeo.cpp @@ -4837,7 +4837,7 @@ ROM_START( janshin ) /* MVS ONLY RELEASE */ ROM_REGION( 0x400000, "cslot1:sprites", 0 ) ROM_LOAD16_BYTE( "048-c1.c1", 0x000000, 0x200000, CRC(3fa890e9) SHA1(e73d2802bacfbc2b2b16fbbedddde17488e4bbde) ) /* Plane 0,1 */ /* mask rom TC5316200 */ - ROM_LOAD16_BYTE( "048-c2.c1", 0x000001, 0x200000, CRC(59c48ad8) SHA1(2630817e735a6d197377558f4324c1442803fe15) ) /* Plane 2,3 */ /* mask rom TC5316200 */ + ROM_LOAD16_BYTE( "048-c2.c2", 0x000001, 0x200000, CRC(59c48ad8) SHA1(2630817e735a6d197377558f4324c1442803fe15) ) /* Plane 2,3 */ /* mask rom TC5316200 */ ROM_END /**************************************** diff --git a/src/mame/drivers/nes.cpp b/src/mame/drivers/nes.cpp index 59b38b9c1e7..4ad7f1966d4 100644 --- a/src/mame/drivers/nes.cpp +++ b/src/mame/drivers/nes.cpp @@ -27,11 +27,11 @@ WRITE8_MEMBER(nes_state::nes_vh_sprite_dma_w) void nes_state::nes_map(address_map &map) { - map(0x0000, 0x07ff).ram().mirror(0x1800); /* RAM */ - map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write)); /* PPU registers */ - map(0x4014, 0x4014).w(FUNC(nes_state::nes_vh_sprite_dma_w)); /* stupid address space hole */ - map(0x4016, 0x4016).rw(FUNC(nes_state::nes_in0_r), FUNC(nes_state::nes_in0_w)); /* IN0 - input port 1 */ - map(0x4017, 0x4017).r(FUNC(nes_state::nes_in1_r)); /* IN1 - input port 2 */ + map(0x0000, 0x07ff).ram().mirror(0x1800); // RAM + map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write)); // PPU registers + map(0x4014, 0x4014).w(FUNC(nes_state::nes_vh_sprite_dma_w)); // stupid address space hole + map(0x4016, 0x4016).rw(FUNC(nes_state::nes_in0_r), FUNC(nes_state::nes_in0_w)); // IN0 - input port 1 + map(0x4017, 0x4017).r(FUNC(nes_state::nes_in1_r)); // IN1 - input port 2 // 0x4100-0x5fff -> LOW HANDLER defined on a pcb base // 0x6000-0x7fff -> MID HANDLER defined on a pcb base // 0x8000-0xffff -> HIGH HANDLER defined on a pcb base @@ -91,6 +91,7 @@ void nes_state::nes(machine_config &config) void nes_state::nespal(machine_config &config) { nes(config); + /* basic machine hardware */ m_maincpu->set_clock(PAL_APU_CLOCK); @@ -111,6 +112,7 @@ void nes_state::nespal(machine_config &config) void nes_state::famicom(machine_config &config) { nes(config); + NES_CONTROL_PORT(config.replace(), m_ctrl1, fc_control_port1_devices, "joypad"); NES_CONTROL_PORT(config.replace(), m_ctrl2, fc_control_port2_devices, "joypad"); NES_CONTROL_PORT(config, m_exp, fc_expansion_devices, nullptr); @@ -125,6 +127,7 @@ void nes_state::famicom(machine_config &config) void nes_state::nespalc(machine_config &config) { nespal(config); + m_maincpu->set_clock(PALC_APU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &nes_state::nes_map); @@ -144,6 +147,7 @@ void nes_state::nespalc(machine_config &config) void nes_state::famipalc(machine_config &config) { nespalc(config); + NES_CONTROL_PORT(config.replace(), m_ctrl1, fc_control_port1_devices, "joypad"); NES_CONTROL_PORT(config.replace(), m_ctrl2, fc_control_port2_devices, "joypad"); NES_CONTROL_PORT(config, m_exp, fc_expansion_devices, nullptr); @@ -157,6 +161,7 @@ void nes_state::famipalc(machine_config &config) void nes_state::suborkbd(machine_config &config) { famipalc(config); + /* TODO: emulate the parallel port bus! */ m_exp->set_default_option("subor_keyboard"); m_exp->set_fixed(true); diff --git a/src/mame/drivers/nes_boot.cpp b/src/mame/drivers/nes_boot.cpp new file mode 100644 index 00000000000..f6b1395a11e --- /dev/null +++ b/src/mame/drivers/nes_boot.cpp @@ -0,0 +1,117 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +/* + NES bootlegs / Plug & Play (non-VT) +*/ + +#include "emu.h" +#include "cpu/m6502/n2a03.h" +#include "video/ppu2c0x.h" +#include "emupal.h" +#include "screen.h" +#include "speaker.h" + +class nes_boot_state : public driver_device +{ +public: + nes_boot_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_ppu(*this, "ppu") + { } + + void nes_boot(machine_config &config); + + void init_nes_boot(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + + WRITE8_MEMBER(sprite_dma_w); + +private: + required_device<n2a03_device> m_maincpu; + required_device<ppu2c0x_device> m_ppu; + + void nes_boot_map(address_map &map); +}; + + +WRITE8_MEMBER(nes_boot_state::sprite_dma_w) +{ + int source = (data & 7); + m_ppu->spriteram_dma(space, source); +} + +void nes_boot_state::nes_boot_map(address_map &map) +{ + map(0x0000, 0x07ff).ram(); + map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write)); + map(0x4014, 0x4014).w(FUNC(nes_boot_state::sprite_dma_w)); + map(0x8000, 0xffff).rom(); +} + +static INPUT_PORTS_START( nes_boot ) +INPUT_PORTS_END + +void nes_boot_state::video_start() +{ +} + +void nes_boot_state::machine_reset() +{ +} + + +void nes_boot_state::machine_start() +{ +// m_nt_ram = std::make_unique<uint8_t[]>(0x1000); +// m_nt_page[0] = m_nt_ram.get(); +// m_nt_page[1] = m_nt_ram.get() + 0x400; +// m_nt_page[2] = m_nt_ram.get() + 0x800; +// m_nt_page[3] = m_nt_ram.get() + 0xc00; + +// m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(*this, FUNC(nes_boot_state::nes_boot_nt_r)), write8_delegate(*this, FUNC(nes_boot_state::nes_boot_nt_w))); +// m_ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1"); +// membank("bank1")->set_base(memregion("gfx1")->base()); +} + +void nes_boot_state::nes_boot(machine_config &config) +{ + /* basic machine hardware */ + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_boot_state::nes_boot_map); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(32*8, 262); + screen.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update)); + + PPU_2C02(config, m_ppu); + m_ppu->set_cpu_tag("maincpu"); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + m_maincpu->add_route(ALL_OUTPUTS, "mono", 0.50); +} + +ROM_START( pjoypj001 ) + ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "powerjoy_pj001_lh28f008sc_89a6.bin", 0x00000, 0x100000, CRC(e655e0aa) SHA1(c96d3422e26451c366fee2151fedccb95014cbc7) ) + + ROM_REGION( 0x80000, "gfx1", ROMREGION_ERASE00 ) + ROM_LOAD( "powerjoy_pj001_te28f400ceb_00894471.bin", 0x00000, 0x80000, CRC(edca9b66) SHA1(f2f6d9043f524748282065b2fa0ca323ddd7d008) ) +ROM_END + + +void nes_boot_state::init_nes_boot() +{ +} + +CONS( 200?, pjoypj001, 0, 0, nes_boot, nes_boot, nes_boot_state, init_nes_boot, "Trump Grand", "PowerJoy (PJ001, NES based plug & play)", 0 ) diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp index 07e3e2d7228..187bc4ebc9b 100644 --- a/src/mame/drivers/nes_vt.cpp +++ b/src/mame/drivers/nes_vt.cpp @@ -76,6 +76,7 @@ #include "screen.h" #include "speaker.h" + class nes_vt_state : public nes_base_state { public: @@ -106,6 +107,7 @@ public: void nes_vt_ddr(machine_config& config); void nes_vt_xx(machine_config& config); + void nes_vt_sudopptv(machine_config& config); /* OneBus read callbacks for getting sprite and tile data during rendering */ DECLARE_READ8_MEMBER(spr_r); @@ -123,6 +125,8 @@ protected: virtual void machine_start() override; virtual void machine_reset() override; + uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); + void nes_vt_map(address_map& map); required_device<screen_device> m_screen; @@ -226,7 +230,6 @@ private: void do_dma(uint8_t data, bool has_ntsc_bug); }; - class nes_vt_vh2009_state : public nes_vt_state { public: @@ -258,7 +261,6 @@ protected: private: }; - class nes_vt_pjoy_state : public nes_vt_state { public: @@ -292,7 +294,6 @@ protected: virtual void machine_reset() override; }; - class nes_vt_ablping_state : public nes_vt_sp69_state { public: @@ -337,7 +338,6 @@ private: DECLARE_READ8_MEMBER(vt03_415c_r); }; - class nes_vt_dg_state : public nes_vt_state { public: @@ -393,9 +393,9 @@ public: nes_vt_ablpinb_state(const machine_config& mconfig, device_type type, const char* tag) : nes_vt_state(mconfig, type, tag), m_ablpinb_in0_val(0), - m_io0(*this,"IO0"), - m_io1(*this,"IO1"), - m_plunger(*this,"PLUNGER") + m_io0(*this, "IO0"), + m_io1(*this, "IO1"), + m_plunger(*this, "PLUNGER") { } void nes_vt_ablpinb(machine_config& config); @@ -421,8 +421,57 @@ private: required_ioport m_plunger; }; +class nes_vt_sudoku_state : public nes_vt_state +{ +public: + nes_vt_sudoku_state(const machine_config& mconfig, device_type type, const char* tag) : + nes_vt_state(mconfig, type, tag), + m_io0(*this, "IO0"), + m_io1(*this, "IO1") + { } + + void init_sudoku(); + + void nes_vt_sudoku(machine_config& config); + +protected: + //virtual void machine_start() override; + //virtual void machine_reset() override; + +private: + DECLARE_READ8_MEMBER(in0_r); + DECLARE_READ8_MEMBER(in1_r); + DECLARE_WRITE8_MEMBER(in0_w); + + void nes_vt_sudoku_map(address_map& map); + + required_ioport m_io0; + required_ioport m_io1; +}; + +class nes_vt_majgnc_state : public nes_vt_state +{ +public: + nes_vt_majgnc_state(const machine_config& mconfig, device_type type, const char* tag) : + nes_vt_state(mconfig, type, tag), + m_io0(*this, "IO0"), + m_io1(*this, "IO1") + { } + + void nes_vt_majgnc(machine_config& config); + +protected: +private: + DECLARE_READ8_MEMBER(in0_r); + DECLARE_READ8_MEMBER(in1_r); + DECLARE_WRITE8_MEMBER(in0_w); + void nes_vt_majgnc_map(address_map& map); + + required_ioport m_io0; + required_ioport m_io1; +}; uint32_t nes_vt_state::get_banks(uint8_t bnk) { @@ -459,11 +508,11 @@ void nes_vt_state::update_banks() else bank = 0xfe; - m_prgbank0->set_entry((amod | get_banks(bank)) & (m_numbanks-1)); + m_prgbank0->set_entry((amod | get_banks(bank)) & (m_numbanks - 1)); // a000-bfff bank = m_410x[0x8]; - m_prgbank1->set_entry((amod | get_banks(bank)) & (m_numbanks-1)); + m_prgbank1->set_entry((amod | get_banks(bank)) & (m_numbanks - 1)); // c000-dfff if ((m_410x[0xb] & 0x40) != 0 || (m_410x[0x5] & 0x40) != 0) @@ -476,14 +525,15 @@ void nes_vt_state::update_banks() else bank = 0xfe; - m_prgbank2->set_entry((amod | get_banks(bank)) & (m_numbanks-1)); + m_prgbank2->set_entry((amod | get_banks(bank)) & (m_numbanks - 1)); // e000 - ffff bank = m_initial_e000_bank; - m_prgbank3->set_entry((amod | get_banks(bank)) & (m_numbanks-1)); + m_prgbank3->set_entry((amod | get_banks(bank)) & (m_numbanks - 1)); } -uint16_t nes_vt_state::decode_nt_addr(uint16_t addr) { +uint16_t nes_vt_state::decode_nt_addr(uint16_t addr) +{ bool vert_mirror = !(m_410x[0x6] & 0x01); int a11 = (addr >> 11) & 0x01; int a10 = (addr >> 10) & 0x01; @@ -491,7 +541,6 @@ uint16_t nes_vt_state::decode_nt_addr(uint16_t addr) { return ((vert_mirror ? a10 : a11) << 10) | base; } - WRITE8_MEMBER(nes_vt_state::vt03_410x_w) { scrambled_410x_w(offset, data); @@ -517,8 +566,6 @@ WRITE8_MEMBER(nes_vt_ablping_state::ablping_410f_w) // Source: https://wiki.nesdev.com/w/index.php/NES_2.0_submappers/Proposals#NES_2.0_Mapper_256 - - void nes_vt_state::scrambled_410x_w(uint16_t offset, uint8_t data) { switch (offset) @@ -647,7 +694,6 @@ WRITE8_MEMBER(nes_vt_dg_state::vtfp_4242_w) m_4242 = data; } - WRITE8_MEMBER(nes_vt_hh_state::vtfp_411d_w) { logerror("vtfp_411d_w %02x\n", data); @@ -662,7 +708,7 @@ WRITE8_MEMBER(nes_vt_dg_state::vtfa_412c_w) m_ahigh |= (data & 0x01) ? (1 << 25) : 0x0; m_ahigh |= (data & 0x02) ? (1 << 24) : 0x0; - //m_ahigh |= (m_csel->read() == 0x01) ? (1 << 25) : 0x0; + //m_ahigh |= (m_csel->read() == 0x01) ? (1 << 25) : 0x0; update_banks(); } @@ -684,11 +730,12 @@ READ8_MEMBER(nes_vt_hh_state::vtfp_412d_r) READ8_MEMBER(nes_vt_cy_state::vt03_41bx_r) { - switch(offset) { - case 0x07: - return 0x04; - default: - return 0x00; + switch (offset) + { + case 0x07: + return 0x04; + default: + return 0x00; } } @@ -699,13 +746,14 @@ WRITE8_MEMBER(nes_vt_cy_state::vt03_48ax_w) READ8_MEMBER(nes_vt_cy_state::vt03_48ax_r) { - switch(offset) { - case 0x04: - return 0x01; - case 0x05: - return 0x01; - default: - return 0x00; + switch (offset) + { + case 0x04: + return 0x01; + case 0x05: + return 0x01; + default: + return 0x00; } } @@ -714,7 +762,8 @@ WRITE8_MEMBER(nes_vt_cy_state::vt03_413x_w) logerror("vt03_413x_w %02x %02x\n", offset, data); // VT168 style ALU ?? m_413x[offset] = data; - if(offset == 0x5) { + if (offset == 0x5) + { uint32_t res = uint32_t((m_413x[5] << 8) | m_413x[4]) * uint32_t((m_413x[1] << 8) | m_413x[0]); m_413x[0] = res & 0xFF; m_413x[1] = (res >> 8) & 0xFF; @@ -722,7 +771,9 @@ WRITE8_MEMBER(nes_vt_cy_state::vt03_413x_w) m_413x[3] = (res >> 24) & 0xFF; m_413x[6] = 0x00; - } else if(offset == 0x6) { + } + else if (offset == 0x6) + { /*uint32_t res = uint32_t((m_413x[5] << 8) | m_413x[4]) * uint32_t((m_413x[1] << 8) | m_413x[0]); m_413x[0] = res & 0xFF; m_413x[1] = (res >> 8) & 0xFF; @@ -730,7 +781,6 @@ WRITE8_MEMBER(nes_vt_cy_state::vt03_413x_w) m_413x[3] = (res >> 24) & 0xFF;*/ m_413x[6] = 0x00; } - } @@ -758,28 +808,35 @@ READ8_MEMBER(nes_vt_hh_state::vthh_414a_r) READ8_MEMBER(nes_vt_state::spr_r) { - if(m_4242 & 0x1 || m_411d & 0x04) { + if (m_4242 & 0x1 || m_411d & 0x04) + { return m_chrram[offset]; - } else { + } + else + { int realaddr = calculate_real_video_address(offset, 0, 1); - return m_prgrom[realaddr & (m_romsize-1)]; + return m_prgrom[realaddr & (m_romsize - 1)]; } } READ8_MEMBER(nes_vt_state::chr_r) { - if(m_4242 & 0x1 || m_411d & 0x04) { + if (m_4242 & 0x1 || m_411d & 0x04) + { return m_chrram[offset]; - } else { + } + else + { int realaddr = calculate_real_video_address(offset, 1, 0); - return m_prgrom[realaddr & (m_romsize-1)]; + return m_prgrom[realaddr & (m_romsize - 1)]; } } WRITE8_MEMBER(nes_vt_state::chr_w) { - if(m_4242 & 0x1 || m_411d & 0x04) { + if (m_4242 & 0x1 || m_411d & 0x04) + { logerror("vram write %04x %02x\n", offset, data); m_chrram[offset] = data; } @@ -787,15 +844,17 @@ WRITE8_MEMBER(nes_vt_state::chr_w) return m_prgrom[realaddr & (m_romsize-1)];*/ } -WRITE8_MEMBER(nes_vt_hh_state::vtfp_411e_w) { +WRITE8_MEMBER(nes_vt_hh_state::vtfp_411e_w) +{ logerror("411e_w %02x\n", data); - if(data == 0x05) + if (data == 0x05) dynamic_cast<m6502_vtscr&>(*m_maincpu).set_next_scramble(true); - else if(data == 0x00) + else if (data == 0x00) dynamic_cast<m6502_vtscr&>(*m_maincpu).set_next_scramble(false); } -WRITE8_MEMBER(nes_vt_hh_state::vtfp_4a00_w) { +WRITE8_MEMBER(nes_vt_hh_state::vtfp_4a00_w) +{ logerror("4a00_w %02x\n", data); //if(data == 0x80) // dynamic_cast<m6502_vtscr&>(*m_maincpu).set_scramble(false); @@ -815,7 +874,8 @@ void nes_vt_state::hblank_irq(int scanline, int vblank, int blanked) void nes_vt_state::video_irq(bool hblank, int scanline, int vblank, int blanked) { //TSYNEN - if(((m_410x[0xb] >> 7) & 0x01) == hblank) { + if (((m_410x[0xb] >> 7) & 0x01) == hblank) + { int irqstate = 0; //logerror("scanline_irq %d\n", scanline); @@ -839,7 +899,6 @@ void nes_vt_state::video_irq(bool hblank, int scanline, int vblank, int blanked) //else // m_maincpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE); } - } /* todo, handle custom VT nametable stuff here */ @@ -856,7 +915,7 @@ WRITE8_MEMBER(nes_vt_state::nt_w) void nes_vt_state::machine_start() { - m_romsize = memregion("mainrom")->bytes(); + m_romsize = memregion("mainrom")->bytes(); m_numbanks = m_romsize / 0x2000; m_prg->set_bank(0); @@ -884,8 +943,8 @@ void nes_vt_state::machine_start() m_ppu->set_scanline_callback(*this, FUNC(nes_vt_state::scanline_irq)); m_ppu->set_hblank_callback(*this, FUNC(nes_vt_state::hblank_irq)); -// m_ppu->set_hblank_callback(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::hblank_irq))); -// m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::chr_r)), write8_delegate(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::chr_w))); + //m_ppu->set_hblank_callback(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::hblank_irq))); + //m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::chr_r)), write8_delegate(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::chr_w))); m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(*this, FUNC(nes_vt_state::nt_r)), write8_delegate(*this, FUNC(nes_vt_state::nt_w))); m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(*this, FUNC(nes_vt_state::chr_r)), write8_delegate(*this, FUNC(nes_vt_state::chr_w))); } @@ -992,7 +1051,7 @@ int nes_vt_state::calculate_real_video_address(int addr, int extended, int readt int vbank_tva17_tva10 = 0x00; - switch ((sel>>10) & 0xf) + switch ((sel >> 10) & 0xf) { case 0x0: case 0x1: @@ -1067,13 +1126,13 @@ int nes_vt_state::calculate_real_video_address(int addr, int extended, int readt case 0x7: return -1; } - int va34 =m_ppu->get_va34(); + int va34 = m_ppu->get_va34(); if (!extended) { int is4bpp = 0; - if (readtype==0) is4bpp = m_ppu->get_201x_reg(0x0) & 0x02; - else if (readtype==1) is4bpp = m_ppu->get_201x_reg(0x0) & 0x04; + if (readtype == 0) is4bpp = m_ppu->get_201x_reg(0x0) & 0x02; + else if (readtype == 1) is4bpp = m_ppu->get_201x_reg(0x0) & 0x04; int va20_va18 = (m_ppu->get_201x_reg(0x8) & 0x70) >> 4; @@ -1083,7 +1142,7 @@ int nes_vt_state::calculate_real_video_address(int addr, int extended, int readt { if (!alt_order) { - finaladdr = ((finaladdr &~0xf) << 1) | (va34 << 4) | (finaladdr & 0xf); + finaladdr = ((finaladdr & ~0xf) << 1) | (va34 << 4) | (finaladdr & 0xf); } else { @@ -1131,7 +1190,7 @@ int nes_vt_state::calculate_real_video_address(int addr, int extended, int readt { if (!alt_order) { - finaladdr = ((finaladdr &~0xf) << 1) | (va34 << 4) | (finaladdr & 0xf); + finaladdr = ((finaladdr & ~0xf) << 1) | (va34 << 4) | (finaladdr & 0xf); } else { @@ -1153,9 +1212,10 @@ int nes_vt_state::calculate_real_video_address(int addr, int extended, int readt void nes_vt_state::scrambled_8000_w(address_space& space, uint16_t offset, uint8_t data) { uint16_t addr = offset + 0x8000; - if((m_411d & 0x01) && (m_411d & 0x03)) { + if ((m_411d & 0x01) && (m_411d & 0x03)) + { //CNROM compat - logerror("vtxx_cnrom_8000_w (%04x) %02x\n", offset+0x8000, data ); + logerror("vtxx_cnrom_8000_w (%04x) %02x\n", offset + 0x8000, data); m_ppu->set_201x_reg(0x6, data * 8); m_ppu->set_201x_reg(0x7, data * 8 + 2); m_ppu->set_201x_reg(0x2, data * 8 + 4); @@ -1163,82 +1223,109 @@ void nes_vt_state::scrambled_8000_w(address_space& space, uint16_t offset, uint8 m_ppu->set_201x_reg(0x4, data * 8 + 6); m_ppu->set_201x_reg(0x5, data * 8 + 7); - } else if(m_411d & 0x01) { + } + else if (m_411d & 0x01) + { //MMC1 compat, TODO - logerror("vtxx_mmc1_8000_w (%04x) %02x\n", offset+0x8000, data ); + logerror("vtxx_mmc1_8000_w (%04x) %02x\n", offset + 0x8000, data); - } else if(m_411d & 0x02) { + } + else if (m_411d & 0x02) + { //UNROM compat - logerror("vtxx_unrom_8000_w (%04x) %02x\n", offset+0x8000, data ); + logerror("vtxx_unrom_8000_w (%04x) %02x\n", offset + 0x8000, data); m_410x[0x7] = ((data & 0x0F) << 1); m_410x[0x8] = ((data & 0x0F) << 1) + 1; update_banks(); - } else { + } + else + { //logerror("vtxx_mmc3_8000_w (%04x) %02x\n", offset+0x8000, data ); //MMC3 compat - if((addr < 0xA000) && !(addr & 0x01)) { + if ((addr < 0xA000) && !(addr & 0x01)) + { + logerror("scrambled_8000_w (%04x) %02x (banking)\n", offset + 0x8000, data); // Bank select m_8000_addr_latch = data & 0x07; // Bank config m_410x[0x05] = data & ~(1 << 5); update_banks(); - } else if((addr < 0xA000) && (addr & 0x01)) { - switch(m_410x[0x05] & 0x07) { - case 0x00: - m_ppu->set_201x_reg(m_8000_scramble[0], data); - break; - - case 0x01: - m_ppu->set_201x_reg(m_8000_scramble[1], data); - break; - - case 0x02: // hand? - m_ppu->set_201x_reg(m_8000_scramble[2], data); - break; - - case 0x03: // dog? - m_ppu->set_201x_reg(m_8000_scramble[3], data); - break; - - case 0x04: // ball thrown - m_ppu->set_201x_reg(m_8000_scramble[4], data); - break; - - case 0x05: // ball thrown - m_ppu->set_201x_reg(m_8000_scramble[5], data); - break; - case 0x06: - m_410x[m_8000_scramble[6]] = data; - //m_410x[0x9] = data; - update_banks(); - break; - - case 0x07: - m_410x[m_8000_scramble[7]] = data; - update_banks(); - break; + } + else if ((addr < 0xA000) && (addr & 0x01)) + { + logerror("scrambled_8000_w (%04x) %02x (other scrambled stuff)\n", offset + 0x8000, data); + + switch (m_410x[0x05] & 0x07) + { + case 0x00: + m_ppu->set_201x_reg(m_8000_scramble[0], data); + break; + + case 0x01: + m_ppu->set_201x_reg(m_8000_scramble[1], data); + break; + + case 0x02: // hand? + m_ppu->set_201x_reg(m_8000_scramble[2], data); + break; + + case 0x03: // dog? + m_ppu->set_201x_reg(m_8000_scramble[3], data); + break; + + case 0x04: // ball thrown + m_ppu->set_201x_reg(m_8000_scramble[4], data); + break; + + case 0x05: // ball thrown + m_ppu->set_201x_reg(m_8000_scramble[5], data); + break; + case 0x06: + m_410x[m_8000_scramble[6]] = data; + //m_410x[0x9] = data; + update_banks(); + break; + + case 0x07: + m_410x[m_8000_scramble[7]] = data; + update_banks(); + break; } - } else if((addr >= 0xA000) && (addr < 0xC000) && !(addr & 0x01)) { + } + else if ((addr >= 0xA000) && (addr < 0xC000) && !(addr & 0x01)) + { // Mirroring m_410x[0x6] &= 0xFE; m_410x[0x6] |= data & 0x01; - } else if((addr >= 0xA000) && (addr < 0xC000) && (addr & 0x01)) { + } + else if ((addr >= 0xA000) && (addr < 0xC000) && (addr & 0x01)) + { // PRG RAM control, ignore - } else if((addr >= 0xC000) && (addr < 0xE000) && !(addr & 0x01)) { + } + else if ((addr >= 0xC000) && (addr < 0xE000) && !(addr & 0x01)) + { // IRQ latch vt03_410x_w(space, 1, data); - } else if((addr >= 0xC000) && (addr < 0xE000) && (addr & 0x01)) { + } + else if ((addr >= 0xC000) && (addr < 0xE000) && (addr & 0x01)) + { // IRQ reload vt03_410x_w(space, 2, data); - } else if((addr >= 0xE000) && !(addr & 0x01)) { + } + else if ((addr >= 0xE000) && !(addr & 0x01)) + { // IRQ disable vt03_410x_w(space, 3, data); - } else if((addr >= 0xE000) && (addr & 0x01)) { + } + else if ((addr >= 0xE000) && (addr & 0x01)) + { // IRQ enable vt03_410x_w(space, 4, data); - } else { + } + else + { } } @@ -1313,37 +1400,48 @@ void nes_vt_state::do_dma(uint8_t data, bool has_ntsc_bug) has_ntsc_bug = false; uint8_t dma_mode = m_vdma_ctrl & 0x01; - uint8_t dma_len = (m_vdma_ctrl >> 1) & 0x07; - uint8_t src_nib_74 = (m_vdma_ctrl >> 4) & 0x0F; + uint8_t dma_len = (m_vdma_ctrl >> 1) & 0x07; + uint8_t src_nib_74 = (m_vdma_ctrl >> 4) & 0x0F; + int length = 256; - switch(dma_len) { - case 0x0: length = 256; break; - case 0x4: length = 16; break; - case 0x5: length = 32; break; - case 0x6: length = 64; break; - case 0x7: length = 128; break; + switch (dma_len) + { + case 0x0: length = 256; break; + case 0x4: length = 16; break; + case 0x5: length = 32; break; + case 0x6: length = 64; break; + case 0x7: length = 128; break; } + uint16_t src_addr = (data << 8) | (src_nib_74 << 4); logerror("vthh dma start ctrl=%02x addr=%04x\n", m_vdma_ctrl, src_addr); - if(dma_mode == 1) { + + if (dma_mode == 1) + { logerror("vdma dest %04x\n", m_ppu->get_vram_dest()); } - if(has_ntsc_bug && (dma_mode == 1) && ((m_ppu->get_vram_dest() & 0xFF00) == 0x3F00) - && !(m_ppu->get_201x_reg(0x1) & 0x80)) { + + if (has_ntsc_bug && (dma_mode == 1) && ((m_ppu->get_vram_dest() & 0xFF00) == 0x3F00) && !(m_ppu->get_201x_reg(0x1) & 0x80)) + { length -= 1; src_addr += 1; - } else if((dma_mode == 1) && ((m_ppu->get_vram_dest() & 0xFF00) == 0x3F01) - && !(m_ppu->get_201x_reg(0x1) & 0x80)) { + } + else if ((dma_mode == 1) && ((m_ppu->get_vram_dest() & 0xFF00) == 0x3F01) && !(m_ppu->get_201x_reg(0x1) & 0x80)) + { // Legacy mode for DGUN-2573 compat m_ppu->set_vram_dest(0x3F00); m_ppu->set_palette_mode(PAL_MODE_VT0x); } + for (int i = 0; i < length; i++) { uint8_t spriteData = m_maincpu->space(AS_PROGRAM).read_byte(src_addr + i); - if(dma_mode) { + if (dma_mode) + { m_maincpu->space(AS_PROGRAM).write_byte(0x2007, spriteData); - } else { + } + else + { m_maincpu->space(AS_PROGRAM).write_byte(0x2004, spriteData); } //if(((src_addr + i) & 0xFF) == length && (i != 0)) break; @@ -1510,6 +1608,33 @@ WRITE8_MEMBER(nes_vt_ablpinb_state::ablpinb_in0_w) logerror("ablpinb_in0_w %02x\n", data); } +READ8_MEMBER(nes_vt_sudoku_state::in0_r) +{ + return machine().rand(); +} + +READ8_MEMBER(nes_vt_sudoku_state::in1_r) +{ + return machine().rand(); +} + +WRITE8_MEMBER(nes_vt_sudoku_state::in0_w) +{ +} + +READ8_MEMBER(nes_vt_majgnc_state::in0_r) +{ + return 0x00;// machine().rand(); +} + +READ8_MEMBER(nes_vt_majgnc_state::in1_r) +{ + return 0x00;// machine().rand(); +} + +WRITE8_MEMBER(nes_vt_majgnc_state::in0_w) +{ +} void nes_vt_state::nes_vt_map(address_map &map) { @@ -1552,6 +1677,25 @@ void nes_vt_ablpinb_state::nes_vt_ablpinb_map(address_map& map) map(0x4017, 0x4017).r(FUNC(nes_vt_ablpinb_state::ablpinb_in1_r)); } +void nes_vt_sudoku_state::nes_vt_sudoku_map(address_map& map) +{ + nes_vt_map(map); + + // override the inputs as specific non-standard 'controller' behavior is needed here and adding it to the generic NES controller bus wouldn't make sense. + map(0x4016, 0x4016).rw(FUNC(nes_vt_sudoku_state::in0_r),FUNC(nes_vt_sudoku_state::in0_w)); + map(0x4017, 0x4017).r(FUNC(nes_vt_sudoku_state::in1_r)); +} + +void nes_vt_majgnc_state::nes_vt_majgnc_map(address_map& map) +{ + nes_vt_map(map); + + map(0x4014, 0x4014).w(FUNC(nes_vt_majgnc_state::vt_dma_w)); + + map(0x4016, 0x4016).rw(FUNC(nes_vt_majgnc_state::in0_r),FUNC(nes_vt_majgnc_state::in0_w)); + map(0x4017, 0x4017).r(FUNC(nes_vt_majgnc_state::in1_r)); +} + /* Some later VT models have more RAM */ void nes_vt_state::nes_vt_xx_map(address_map &map) { @@ -1722,6 +1866,10 @@ static GFXDECODE_START( vt03_gfx_helper ) GFXDECODE_ENTRY( "mainrom", 0, helper2_layout, 0x0, 2 ) GFXDECODE_END +uint32_t nes_vt_state::screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) +{ + return m_ppu->screen_update(screen, bitmap, cliprect); +} void nes_vt_state::nes_vt_base(machine_config &config) { @@ -1735,7 +1883,7 @@ void nes_vt_state::nes_vt_base(machine_config &config) (ppu2c0x_device::VBLANK_LAST_SCANLINE_NTSC-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))); m_screen->set_size(32*8, 262); m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); - m_screen->set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update)); + m_screen->set_screen_update(FUNC(nes_vt_state::screen_update)); GFXDECODE(config, "gfxdecode", "ppu", vt03_gfx_helper); @@ -1783,6 +1931,19 @@ void nes_vt_ablpinb_state::nes_vt_ablpinb(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_ablpinb_state::nes_vt_ablpinb_map); } +void nes_vt_sudoku_state::nes_vt_sudoku(machine_config &config) +{ + nes_vt_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_sudoku_state::nes_vt_sudoku_map); +} + +void nes_vt_majgnc_state::nes_vt_majgnc(machine_config &config) +{ + nes_vt_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_majgnc_state::nes_vt_majgnc_map); + m_ppu->set_palette_mode(PAL_MODE_NEW_VG); +} + void nes_vt_state::nes_vt(machine_config &config) { nes_vt_base(config); @@ -1803,6 +1964,13 @@ void nes_vt_state::nes_vt_ddr(machine_config &config) m_ctrl2->set_screen_tag(m_screen); } +void nes_vt_state::nes_vt_sudopptv(machine_config &config) +{ + nes_vt(config); + m_ppu->set_201x_descramble(0x3, 0x2, 0x7, 0x6, 0x5, 0x4); // reasonable + // ^ ^ +} + void nes_vt_hum_state::machine_reset() { nes_vt_state::machine_reset(); @@ -1880,6 +2048,7 @@ void nes_vt_hh_state::nes_vt_vg_baddma(machine_config &config) m_ppu->set_palette_mode(PAL_MODE_NEW_VG); } + // New mystery handheld architecture, VTxx derived void nes_vt_hh_state::nes_vt_hh(machine_config &config) { @@ -1896,7 +2065,7 @@ void nes_vt_hh_state::nes_vt_hh(machine_config &config) } static INPUT_PORTS_START( nes_vt ) -PORT_START("CARTSEL") + PORT_START("CARTSEL") INPUT_PORTS_END void nes_vt_hh_state::nes_vt_fp(machine_config &config) @@ -1931,6 +2100,8 @@ void nes_vt_ts_state::nes_vt_ts(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_ts_state::nes_vt_ts_map); } + + static INPUT_PORTS_START( nes_vt_fp ) PORT_START("CARTSEL") PORT_DIPNAME( 0x06, 0x00, "Cartridge Select" ) PORT_CODE(KEYCODE_3) PORT_TOGGLE @@ -1968,6 +2139,102 @@ static INPUT_PORTS_START( ablpinb ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("NUDGE" ) INPUT_PORTS_END +static INPUT_PORTS_START( sudoku ) + PORT_START("IO0") + PORT_START("IO1") +INPUT_PORTS_END + +static INPUT_PORTS_START( majgnc ) + PORT_START("IO0") + PORT_DIPNAME( 0x01, 0x01, "0" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IO1") + PORT_DIPNAME( 0x01, 0x01, "1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + +void nes_vt_sudoku_state::init_sudoku() +{ + u8 *src = memregion("mainrom")->base(); + int len = memregion("mainrom")->bytes(); + + std::vector<u8> buffer(len); + { + for (int i = 0; i < len; i += 8) + { + buffer[i+0] = src[i+5]; + buffer[i+1] = src[i+4]; + buffer[i+2] = src[i+7]; + buffer[i+3] = src[i+6]; + buffer[i+4] = src[i+1]; + buffer[i+5] = src[i+0]; + buffer[i+6] = src[i+3]; + buffer[i+7] = src[i+2]; + } + + std::copy(buffer.begin(), buffer.end(), &src[0]); + } + + if (0) + { + FILE *fp; + char filename[256]; + sprintf(filename,"decrypted_%s", machine().system().name); + fp=fopen(filename, "w+b"); + if (fp) + { + fwrite(src, len, 1, fp); + fclose(fp); + } + } +} + + ROM_START( vdogdeme ) ROM_REGION( 0x100000, "mainrom", 0 ) @@ -1979,6 +2246,7 @@ ROM_START( vdogdemo ) ROM_LOAD( "rom.bin", 0x00000, 0x80000, CRC(054af705) SHA1(e730aeaa94b9cc28aa8b512a5bf411ec45226831) ) ROM_END + ROM_START( pinkjelly ) ROM_REGION( 0x200000, "mainrom", 0 ) ROM_LOAD( "seesaw.bin", 0x00000, 0x200000, CRC(67b5a079) SHA1(36ebfd64809af072b73acfa3a426b57017851bf4) ) @@ -2004,6 +2272,11 @@ ROM_START( vtboxing ) ROM_LOAD( "rom.bin", 0x00000, 0x80000, CRC(c115b1af) SHA1(82106e1c11c3279c5d8731c112f713fa3f290125) ) ROM_END +ROM_START( papsudok ) + ROM_REGION( 0x80000, "mainrom", 0 ) + ROM_LOAD( "sudoku2.bin", 0x00000, 0x80000, CRC(d1ffcc1e) SHA1(2010e60933a08d0b9271ef37f338758aacba6d2d) ) +ROM_END + ROM_START( mc_dgear ) ROM_REGION( 0x400000, "mainrom", 0 ) ROM_LOAD( "dreamgear 75-in-1.prg", 0x00000, 0x400000, CRC(9aabcb8f) SHA1(aa9446b7777fa64503871225fcaf2a17aafd9af1) ) @@ -2032,6 +2305,20 @@ ROM_START( lxcmcysw ) ROM_LOAD( "jl2365swr-1.u2", 0x00000, 0x4000000, CRC(60ece391) SHA1(655de6b36ba596d873de2839522b948ccf45e006) ) ROM_END +ROM_START( lxcmcyfz ) + ROM_REGION( 0x4000000, "mainrom", 0 ) + // sub-board was marked for 2GB capacity (A0-A26 address lines), but only address lines A0-A24 are connected to the chip + ROM_LOAD( "jl2365_frozen.u1", 0x00000, 0x4000000, CRC(64d4c708) SHA1(1bc2d161326ce3039ab9ba46ad62695060cfb2e1) ) +ROM_END + +ROM_START( lxcmc250 ) + ROM_REGION( 0x4000000, "mainrom", 0 ) + // sub-board was marked for 2GB capacity (A0-A26 address lines), but only address lines A0-A24 are connected to the chip + ROM_LOAD( "cca250in1.u1", 0x00000, 0x4000000, CRC(6ccd6ad6) SHA1(fafed339097c3d1538faa306021a8373c1b799b3) ) +ROM_END + + + ROM_START( cybar120 ) ROM_REGION( 0x2000000, "mainrom", 0 ) ROM_LOAD( "m2500p-vt09-epson,20091222ver05,_30r-sx1067-01_pcb,_12r0cob128m_12001-3d05_fw.bin", 0x00000, 0x1000000, CRC(f7138980) SHA1(de31264ee3a5a5c77a86733b2e2d6845fee91ea5) ) @@ -2068,6 +2355,11 @@ ROM_START( silv35 ) ROM_LOAD( "silverlit35.bin", 0x00000, 0x400000, CRC(7540e350) SHA1(a0cb456136560fa4d8a365dd44d815ec0e9fc2e7) ) ROM_END +ROM_START( lpgm240 ) + ROM_REGION( 0x800000, "mainrom", 0 ) + ROM_LOAD( "w25q64jv.u1", 0x00000, 0x800000, CRC(b973e65b) SHA1(36ff137068ea56b4679c2db386ac0067de0a9eaf) ) +ROM_END + ROM_START( pjoyn50 ) ROM_REGION( 0x400000, "mainrom", 0 ) ROM_LOAD( "power joy navigator 50-in-1.prg", 0x00000, 0x400000, CRC(d1bbadd4) SHA1(2186c71bcedf6c2eedf58233faa26fca9586aa40) ) @@ -2198,6 +2490,17 @@ ROM_START( majkon ) ROM_LOAD( "konamicollectorsseries.bin", 0x00000, 0x100000, CRC(47505e51) SHA1(3bfb05d7cfa2bb4c115335f0383fa4aa59db0b28) ) ROM_END +ROM_START( majgnc ) + ROM_REGION( 0x200000, "mainrom", ROMREGION_ERASEFF ) + ROM_LOAD( "majescogoldennuggetcasino_st29w800at_002000d7.bin", 0x00000, 0x100000, CRC(1a156a9d) SHA1(08be4079dd68c9cf05bb92e11a3da4f092d7cfea) ) +ROM_END + +ROM_START( sudopptv ) + ROM_REGION( 0x80000, "mainrom", ROMREGION_ERASEFF ) + ROM_LOAD( "sudokupnptvgame_29lv400tc_000422b9.bin", 0x00000, 0x80000, CRC(722cc36d) SHA1(1f6d1f57478cf175a36722b39c52eded4b669f81) ) +ROM_END + + ROM_START( ablping ) ROM_REGION( 0x200000, "mainrom", 0 ) ROM_LOAD( "abl_pingpong.bin", 0x00000, 0x200000, CRC(b31de1fb) SHA1(94e8afb2315ba1fa0892191c8e1832391e401c70) ) @@ -2261,14 +2564,19 @@ ROM_START( cbrs8 ) ROM_LOAD( "rs-8.bin", 0x00000, 0x1000000, BAD_DUMP CRC(10b2bed0) SHA1(0453a1e6769818ccf25dcf22b2c6198a5688a1d4) ) ROM_END +ROM_START( rfcp168 ) + ROM_REGION( 0x1000000, "mainrom", 0 ) + ROM_LOAD( "winbond_w29gl128c.bin", 0x00000, 0x1000000, CRC(d11caf71) SHA1(64b269cee30a51549a2d0491bbeed07751771559) ) +ROM_END + ROM_START( mc_tv200 ) ROM_REGION( 0x800000, "mainrom", 0 ) ROM_LOAD( "s29gl064n90.bin", 0x00000, 0x800000, CRC(ae1905d2) SHA1(11582055713ba937c1ad32c4ada8683eebc1c83c) ) ROM_END ROM_START( unkra200 ) // "Winbond 25Q64FVSIG 1324" SPI ROM - ROM_REGION( 0x800000, "mainrom", 0 ) - ROM_LOAD( "retro_machine_rom", 0x00000, 0x800000, CRC(0e824aa7) SHA1(957e98868559ecc22b3fa42c76692417b76bf132) ) + ROM_REGION( 0x800000, "mainrom", 0 ) + ROM_LOAD( "retro_machine_rom", 0x00000, 0x800000, CRC(0e824aa7) SHA1(957e98868559ecc22b3fa42c76692417b76bf132) ) ROM_END ROM_START( fcpocket ) @@ -2315,10 +2623,16 @@ CONS( 200?, vtsndtest, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "VRT // Bundled as "Demo for VT03 Pic32" on the V.R. Technology VT SDK CONS( 200?, vtboxing, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "VRT", "VRT VT SDK 'Boxing' (Demo for VT03 Pic32)", MACHINE_NOT_WORKING ) -// clearly started off as 'vtpinball' 050329 (29th March 2005) date on PCB +// Menu system clearly started off as 'vtpinball' Many elements seem similar to Family Pinball for the Famicom. +// 050329 (29th March 2005) date on PCB CONS( 2005, ablpinb, 0, 0, nes_vt_ablpinb, ablpinb, nes_vt_ablpinb_state, empty_init, "Advance Bright Ltd", "Pinball (P8002, ABL TV Game)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +// Black pad marked 'SUDOKU' with tails on the S and U characters looping over the logo. Box says "Plug and Play Sudoku" +// Has 2 sets of 4 buttons in circular 'direction pad' layouts (on the left for directions, on the right for functions) and 9 red numbered buttons with red power LED on left of them, and reset button on right +CONS( 200?, papsudok, 0, 0, nes_vt_sudoku, sudoku, nes_vt_sudoku_state, init_sudoku, "<unknown>", "Plug and Play Sudoku (VT based?)", MACHINE_NOT_WORKING ) + + // should be VT03 based // for testing 'Shark', 'Octopus', 'Harbor', and 'Earth Fighter' use the extended colour modes, other games just seem to use standard NES modes CONS( 200?, mc_dgear, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "dreamGEAR", "dreamGEAR 75-in-1", MACHINE_IMPERFECT_GRAPHICS ) @@ -2330,6 +2644,10 @@ CONS( 2006, vgtablet, 0, 0, nes_vt_vg, nes_vt, nes_vt_hh_state, empty_i // There is a 2004 Majesco Frogger "TV game" that appears to contain the same version of Frogger as above but with no other games, so probably fits here. CONS( 2004, majkon, 0, 0, nes_vt_vg_baddma, nes_vt, nes_vt_hh_state, empty_init, "Majesco (licensed from Konami)", "Konami Collector's Series Arcade Advanced", MACHINE_NOT_WORKING ) // raster timing is broken for Frogger, palette issues +CONS( 200?, majgnc, 0, 0, nes_vt_majgnc, majgnc, nes_vt_majgnc_state, empty_init, "Majesco", "Golden Nugget Casino", MACHINE_NOT_WORKING ) + +// small black unit, dpad on left, 4 buttons (A,B,X,Y) on right, Start/Reset/Select in middle, unit text "Sudoku Plug & Play TV Game" +CONS( 200?, sudopptv, 0, 0, nes_vt_sudopptv, nes_vt, nes_vt_state, empty_init, "Smart Planet", "Sudoku Plug & Play TV Game '6 Intelligent Games'", MACHINE_NOT_WORKING ) // this is VT09 based // it boots, most games correct, but palette issues in some games still (usually they appear greyscale) @@ -2337,7 +2655,9 @@ CONS( 2004, majkon, 0, 0, nes_vt_vg_baddma, nes_vt, nes_vt_hh_state, empty_i CONS( 2009, cybar120, 0, 0, nes_vt_vg, nes_vt, nes_vt_hh_state, empty_init, "Defender", "Defender M2500P 120-in-1", MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2005, vgpocket, 0, 0, nes_vt_vg, nes_vt, nes_vt_hh_state, empty_init, "Performance Designed Products", "VG Pocket (VG-2000)", MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS ) CONS( 200?, vgpmini, 0, 0, nes_vt_vg, nes_vt, nes_vt_hh_state, empty_init, "Performance Designed Products", "VG Pocket Mini (VG-1500)", MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS ) - +// VG Pocket Max (VG-2500) (blue case, 75 games) +// VG Pocket Max (VG-3000) (white case, 75 games) (does the game selection differ, or only the case?) +// VG Pocket Caplet is likely SunPlus hardware instead. (has common SunPlus games) // Runs fine, non-sport 121 in 1 games perfect, but minor graphical issues in // sport games, also no sound in menu or sport games due to missing PCM @@ -2347,16 +2667,20 @@ CONS( 200?, dgun2500, 0, 0, nes_vt_dg, nes_vt, nes_vt_dg_state, empty_init, " // don't even get to menu. very enhanced chipset, VT368/9? CONS( 2012, dgun2561, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "dreamGEAR", "dreamGEAR My Arcade Portable Gaming System (DGUN-2561)", MACHINE_NOT_WORKING ) CONS( 200?, lxcmcy, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade", MACHINE_NOT_WORKING ) +CONS( 200?, lxcmc250, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - 250-in-1 (JL2375)", MACHINE_NOT_WORKING ) CONS( 200?, lxcmcysw, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - Star Wars Rebels", MACHINE_NOT_WORKING ) +CONS( 200?, lxcmcyfz, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - Frozen", MACHINE_NOT_WORKING ) // Also Lexibook Compact Cyber Arcade - Disney Princesses // Lexibook Compact Cyber Arcade - Cars -// Lexibook Compact Cyber Arcade - Frozen // Lexibook Compact Cyber Arcade - Paw Patrol // Lexibook Compact Cyber Arcade - Barbie // Lexibook Compact Cyber Arcade - Finding Dory +// Lexibook Compact Cyber Arcade - Marvel Ultimate Spiderman +// Lexibook Compact Cyber Arcade - PJ Masks // more? + // boots, same platform with scrambled opcodes as FC pocket // palette issues in some games because they actually use the old VT style palette // but no way to switch? @@ -2370,6 +2694,10 @@ CONS( 200?, polmega, 0, 0, nes_vt_vh2009, nes_vt, nes_vt_vh2009_state CONS( 200?, silv35, 0, 0, nes_vt_vh2009, nes_vt, nes_vt_vh2009_state, empty_init, "SilverLit", "35 in 1 Super Twins", MACHINE_NOT_WORKING ) + +// same encryption as above, but seems like newer hardware (or the above aren't using most of the features) +CONS( 200?, lpgm240, 0, 0, nes_vt_vh2009, nes_vt, nes_vt_vh2009_state, empty_init, "<unknown>", "Let's Play! Game Machine 240 in 1", MACHINE_NOT_WORKING ) // mini 'retro-arcade' style cabinet + // this has 'Shark' and 'Octopus' etc. like mc_dgear but uses scrambled bank registers CONS( 200?, mc_sp69, 0, 0, nes_vt, nes_vt, nes_vt_sp69_state, empty_init, "<unknown>", "Sports Game 69 in 1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND) @@ -2396,6 +2724,8 @@ CONS( 200?, mc_138cb, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_ini // doesn't boot, bad dump CONS( 201?, cbrs8, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "CoolBoy", "CoolBoy RS-8 168 in 1", MACHINE_NOT_WORKING ) +CONS( 201?, rfcp168, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "<unknown>", "Retro FC Plus 168 in 1 Handheld", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // "RETRO_FC_V3.5" (doesn't boot, ends up in weeds after jumping to bank with no code, dump not verified) + CONS( 200?, gprnrs1, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "<unknown>", "Game Prince RS-1", MACHINE_IMPERFECT_GRAPHICS ) CONS( 200?, gprnrs16, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "<unknown>", "Game Prince RS-16", MACHINE_IMPERFECT_GRAPHICS ) @@ -2423,6 +2753,7 @@ CONS( 2004, mc_dcat8a, mc_dcat8, 0, nes_vt, nes_vt, nes_vt_state, empty_ini CONS( 2017, sy889, 0, 0, nes_vt_hh, nes_vt, nes_vt_hh_state, empty_init, "SY Corp", "SY-889 300 in 1 Handheld", MACHINE_IMPERFECT_GRAPHICS ) CONS( 2016, sy888b, 0, 0, nes_vt_hh, nes_vt, nes_vt_hh_state, empty_init, "SY Corp", "SY-888B 288 in 1 Handheld", MACHINE_IMPERFECT_GRAPHICS ) + // Same hardware as SY-889 CONS( 201?, mc_cb280, 0, 0, nes_vt_hh, nes_vt, nes_vt_hh_state, empty_init, "CoolBoy", "Coolboy RS-18 (280 in 1)", MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/ninjakd2.cpp b/src/mame/drivers/ninjakd2.cpp index 2bdcee7d420..1bc0762f53d 100644 --- a/src/mame/drivers/ninjakd2.cpp +++ b/src/mame/drivers/ninjakd2.cpp @@ -1065,183 +1065,174 @@ void omegaf_state::omegaf(machine_config &config) ROM_START( ninjakd2 ) ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "nk2_01.rom", 0x00000, 0x8000, CRC(3cdbb906) SHA1(f48f82528b5fc581ee3b1ccd0ef9cdecc7249bb3) ) - ROM_LOAD( "nk2_02.rom", 0x10000, 0x8000, CRC(b5ce9a1a) SHA1(295a7e1d41e1a8ee45f1250086a0c9314837eded) ) // banked at 8000-bfff - ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) - ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) - ROM_LOAD( "nk2_05.rom", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) + ROM_LOAD( "1.3s", 0x00000, 0x8000, CRC(3cdbb906) SHA1(f48f82528b5fc581ee3b1ccd0ef9cdecc7249bb3) ) + ROM_LOAD( "2.3q", 0x10000, 0x8000, CRC(b5ce9a1a) SHA1(295a7e1d41e1a8ee45f1250086a0c9314837eded) ) // banked at 8000-bfff + ROM_LOAD( "3.3r", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) + ROM_LOAD( "4.3p", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) + ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) - ROM_REGION( 0x10000, "soundcpu", 0 ) - ROM_LOAD( "nk2_06.rom", 0x00000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // encrypted + ROM_REGION( 0x10000, "soundcpu", 0 ) // NEC MC-8123 custom CPU block + ROM_LOAD( "6.3h", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // encrypted ROM_REGION( 0x2000, "soundcpu:key", 0 ) /* MC8123 key */ - ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) + ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles (need lineswapping) - ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) + ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) ROM_REGION( 0x20000, "gfx2", 0 ) // sprites (need lineswapping) - ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) - ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) + ROM_LOAD( "8.6l", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) + ROM_LOAD( "7.6n", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) ROM_REGION( 0x20000, "gfx3", 0 ) // bg tiles (need lineswapping) - ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) - ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) + ROM_LOAD( "11.2n", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) + ROM_LOAD( "10.2r", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) ROM_REGION( 0x10000, "pcm", 0 ) - ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples + ROM_LOAD( "9.6c", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples ROM_END ROM_START( ninjakd2a ) ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "nk2_01.bin", 0x00000, 0x8000, CRC(e6adca65) SHA1(33d483dde0853f37455cde32b461f4e919601b4b) ) - ROM_LOAD( "nk2_02.bin", 0x10000, 0x8000, CRC(d9284bd1) SHA1(e790fb1a718a1f7997931f2f390fe053655f231d) ) // banked at 8000-bfff - ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) - ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) - ROM_LOAD( "nk2_05.bin", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) + ROM_LOAD( "1.3s", 0x00000, 0x8000, CRC(e6adca65) SHA1(33d483dde0853f37455cde32b461f4e919601b4b) ) // sldh + ROM_LOAD( "2.3q", 0x10000, 0x8000, CRC(d9284bd1) SHA1(e790fb1a718a1f7997931f2f390fe053655f231d) ) // sldh - banked at 8000-bfff + ROM_LOAD( "3.3r", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) + ROM_LOAD( "4.3p", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) + ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) // sldh ROM_REGION( 2*0x10000, "soundcpu", 0 ) - ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // decrypted opcodes - ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data + ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // decrypted opcodes + ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles (need lineswapping) - ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) + ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) ROM_REGION( 0x20000, "gfx2", 0 ) // sprites (need lineswapping) - ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) - ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) + ROM_LOAD( "8.6l", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) + ROM_LOAD( "7.6n", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) ROM_REGION( 0x20000, "gfx3", 0 ) // bg tiles (need lineswapping) - ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) - ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) + ROM_LOAD( "11.2n", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) + ROM_LOAD( "10.2r", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) ROM_REGION( 0x10000, "pcm", 0 ) - ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples + ROM_LOAD( "9.6c", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples ROM_END ROM_START( ninjakd2b ) ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "1.3s", 0x00000, 0x8000, CRC(cb4f4624) SHA1(4fc66641adc0a2c0eca332f27c5777df62fa507b) ) - ROM_LOAD( "2.3q", 0x10000, 0x8000, CRC(0ad0c100) SHA1(c5bbc107ba07bd6950bb4d7377e827c084b8229b) ) // banked at 8000-bfff - ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) // 3.3p - ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) // 4.3n - ROM_LOAD( "nk2_05.rom", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) // 5.3l + ROM_LOAD( "1.3s", 0x00000, 0x8000, CRC(cb4f4624) SHA1(4fc66641adc0a2c0eca332f27c5777df62fa507b) ) // sldh + ROM_LOAD( "2.3q", 0x10000, 0x8000, CRC(0ad0c100) SHA1(c5bbc107ba07bd6950bb4d7377e827c084b8229b) ) // sldh - banked at 8000-bfff + ROM_LOAD( "3.3r", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) + ROM_LOAD( "4.3p", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) + ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) ROM_REGION( 2*0x10000, "soundcpu", 0 ) - ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // 6.3g decrypted opcodes - ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data + ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // 6.3g decrypted opcodes + ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles (need lineswapping) - ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) // 12.5m + ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) ROM_REGION( 0x20000, "gfx2", 0 ) // sprites (need lineswapping) - ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) // 8.6k - ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) // 7.6m + ROM_LOAD( "8.6l", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) + ROM_LOAD( "7.6n", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) ROM_REGION( 0x20000, "gfx3", 0 ) // bg tiles (need lineswapping) - ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) // 11.2m - ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) // 10.2p + ROM_LOAD( "11.2n", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) + ROM_LOAD( "10.2r", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) ROM_REGION( 0x10000, "pcm", 0 ) - ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // 9.6d unsigned 8-bit pcm samples + ROM_LOAD( "9.6c", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples ROM_END ROM_START( ninjakd2c ) ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(06096412) SHA1(4a84a9326248ff899a04f32950b4c4a5ff58cf75) ) // sldh w/rdaction - ROM_LOAD( "2.3t", 0x10000, 0x8000, CRC(9ed9a994) SHA1(ec95e09066ad51cf4514e269384b7609d6c345d9) ) // banked at 8000-bfff - ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) - ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) - ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(800d4951) SHA1(878516bd03a61ac970cd9e8c35116f8ec3020e79) ) + ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(06096412) SHA1(4a84a9326248ff899a04f32950b4c4a5ff58cf75) ) // sldh + ROM_LOAD( "2.3t", 0x10000, 0x8000, CRC(9ed9a994) SHA1(ec95e09066ad51cf4514e269384b7609d6c345d9) ) // sldh - banked at 8000-bfff + ROM_LOAD( "3.3r", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) + ROM_LOAD( "4.3p", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) + ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(800d4951) SHA1(878516bd03a61ac970cd9e8c35116f8ec3020e79) ) // sldh - ROM_REGION( 0x10000, "soundcpu", 0 ) - ROM_LOAD( "nk2_06.rom", 0x00000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // encrypted + ROM_REGION( 0x10000, "soundcpu", 0 ) // NEC MC-8123 custom CPU block + ROM_LOAD( "6.3h", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // encrypted ROM_REGION( 0x2000, "soundcpu:key", 0 ) /* MC8123 key */ - ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) + ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles (need lineswapping) - ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) + ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) ROM_REGION( 0x20000, "gfx2", 0 ) // sprites (need lineswapping) - ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) - ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) + ROM_LOAD( "8.6l", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) + ROM_LOAD( "7.6n", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) ROM_REGION( 0x20000, "gfx3", 0 ) // bg tiles (need lineswapping) - ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) - ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) + ROM_LOAD( "11.2n", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) + ROM_LOAD( "10.2r", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) ROM_REGION( 0x10000, "pcm", 0 ) - ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples + ROM_LOAD( "9.6c", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples ROM_END ROM_START( rdaction ) ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(5c475611) SHA1(2da88a95b5d68b259c8ae48af1438a82a1d601c1) ) // sldh w/ninjajd2c - ROM_LOAD( "2.3s", 0x10000, 0x8000, CRC(a1e23bd2) SHA1(c3b6574dc9fa66b4f41c37754a0d20a865f8bc28) ) // banked at 8000-bfff - ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) // 3.3r - ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) // 4.3p - ROM_LOAD( "nk2_05.bin", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) // 5.3m + ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(5c475611) SHA1(2da88a95b5d68b259c8ae48af1438a82a1d601c1) ) // sldh + ROM_LOAD( "2.3s", 0x10000, 0x8000, CRC(a1e23bd2) SHA1(c3b6574dc9fa66b4f41c37754a0d20a865f8bc28) ) // sldh - banked at 8000-bfff + ROM_LOAD( "3.3r", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) + ROM_LOAD( "4.3p", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) + ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) // sldh - == 5.3m from ninjakd2a - ROM_REGION( 0x10000, "soundcpu", 0 ) - ROM_LOAD( "nk2_06.rom", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // 6.3h encrypted + ROM_REGION( 0x10000, "soundcpu", 0 ) // NEC MC-8123 custom CPU block + ROM_LOAD( "6.3h", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // encrypted ROM_REGION( 0x2000, "soundcpu:key", 0 ) /* MC8123 key */ - ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) + ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles (need lineswapping) - ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(0936b365) SHA1(3705f42b76ab474357e77c1a9b8e3755c7ab2c0c) ) // 12.5n + ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(0936b365) SHA1(3705f42b76ab474357e77c1a9b8e3755c7ab2c0c) ) // sldh - this rom contains the new title / license ROM_REGION( 0x20000, "gfx2", 0 ) // sprites (need lineswapping) - ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) // 8.6l - ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) // 7.6n + ROM_LOAD( "8.6l", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) + ROM_LOAD( "7.6n", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) ROM_REGION( 0x20000, "gfx3", 0 ) // bg tiles (need lineswapping) - ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) // 11.2n - ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) // 10.2r + ROM_LOAD( "11.2n", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) + ROM_LOAD( "10.2r", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) ROM_REGION( 0x10000, "pcm", 0 ) - ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // 9.6c unsigned 8-bit pcm samples + ROM_LOAD( "9.6c", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples ROM_END -// Is this official? works with any program rom set, but nowhere in any program roms is the title JT-104 mentioned. -// It was found on a board with RAD ACTION program roms. -// -// In addition to the title screen text change the new graphic ROM has 'UNITED AMUSEMENTS' license text replacing -// the regular UPL copyright (used on the interludes) however because it is using the RAD ACTION program roms the -// title screen still shows the 'World Games' license text. -// -// Did this board have incorrect program roms, or is this just how it was? - - -ROM_START( jt104 ) // identical to radaction set with different gfx rom and decrypted sound rom +// Found on an official UPL board with an original encrypted sound CPU block and official UPL serial number sticker +// Other "JT 104" sets have been found with mismatched ROMs and the decrypted sound CPU + ROM hack +ROM_START( jt104 ) ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(5c475611) SHA1(2da88a95b5d68b259c8ae48af1438a82a1d601c1) ) - ROM_LOAD( "2.3s", 0x10000, 0x8000, CRC(a1e23bd2) SHA1(c3b6574dc9fa66b4f41c37754a0d20a865f8bc28) ) // banked at 8000-bfff - ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) // 3.3r - ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) // 4.3p - ROM_LOAD( "nk2_05.bin", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) // 5.3m + ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(5c475611) SHA1(2da88a95b5d68b259c8ae48af1438a82a1d601c1) ) // sldh - == 1.3u from rdaction + ROM_LOAD( "2.3s", 0x10000, 0x8000, CRC(87a91d11) SHA1(08bb9a0a691681c86ddd551af96d5742daa878c3) ) // sldh - banked at 8000-bfff + ROM_LOAD( "3.3r", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) + ROM_LOAD( "4.3p", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) + ROM_LOAD( "5.3m", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) // sldh - == 5.3m from ninjakd2a - ROM_REGION( 2*0x10000, "soundcpu", 0 ) - ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // decrypted opcodes - ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data + ROM_REGION( 0x10000, "soundcpu", 0 ) // NEC MC-8123 custom CPU block + ROM_LOAD( "6.3h", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // encrypted ROM_REGION( 0x2000, "soundcpu:key", 0 ) /* MC8123 key */ - ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) + ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles (need lineswapping) - ROM_LOAD( "jt_104_12.bin", 0x00000, 0x08000, CRC(c038fadb) SHA1(59e9b125ead3e9bdc9d66de75dffd58956eb922e) ) // this rom contains the new title / license + ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(c038fadb) SHA1(59e9b125ead3e9bdc9d66de75dffd58956eb922e) ) // sldh - this rom contains the new title / license ROM_REGION( 0x20000, "gfx2", 0 ) // sprites (need lineswapping) - ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) - ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) + ROM_LOAD( "8.6l", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) + ROM_LOAD( "7.6n", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) ROM_REGION( 0x20000, "gfx3", 0 ) // bg tiles (need lineswapping) - ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) - ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) + ROM_LOAD( "11.2n", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) + ROM_LOAD( "10.2r", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) ROM_REGION( 0x10000, "pcm", 0 ) - ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples + ROM_LOAD( "9.6c", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples ROM_END @@ -1694,12 +1685,12 @@ void robokid_state::init_robokidj() *************************************/ // YEAR, NAME, PARENT, MACHINE, INPUT, STATE, INIT, MONITOR,COMPANY,FULLNAME,FLAGS -GAME( 1987, ninjakd2, 0, ninjakd2, ninjakd2, ninjakd2_state, init_ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, ninjakd2a, ninjakd2, ninjakd2b, ninjakd2, ninjakd2_state, init_bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 2, bootleg?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, ninjakd2b, ninjakd2, ninjakd2b, rdaction, ninjakd2_state, init_bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3, bootleg?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, ninjakd2c, ninjakd2, ninjakd2, rdaction, ninjakd2_state, init_ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 4)", MACHINE_SUPPORTS_SAVE ) // close to set 3 +GAME( 1987, ninjakd2, 0, ninjakd2, ninjakd2, ninjakd2_state, init_ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, ninjakd2a, ninjakd2, ninjakd2b, ninjakd2, ninjakd2_state, init_bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 2, bootleg?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, ninjakd2b, ninjakd2, ninjakd2b, rdaction, ninjakd2_state, init_bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3, bootleg?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, ninjakd2c, ninjakd2, ninjakd2, rdaction, ninjakd2_state, init_ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 4)", MACHINE_SUPPORTS_SAVE ) // close to set 3 GAME( 1987, rdaction, ninjakd2, ninjakd2, rdaction, ninjakd2_state, init_ninjakd2, ROT0, "UPL (World Games license)", "Rad Action / NinjaKun Ashura no Shou", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, jt104, ninjakd2, ninjakd2, rdaction, ninjakd2_state, init_bootleg, ROT0, "UPL (United Amusements license)", "JT-104 (title screen modification of Rad Action)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, jt104, ninjakd2, ninjakd2, rdaction, ninjakd2_state, init_ninjakd2, ROT0, "UPL (United Amusements license)", "JT 104 / NinjaKun Ashura no Shou", MACHINE_SUPPORTS_SAVE ) GAME( 1987, mnight, 0, mnight, mnight, mnight_state, init_mnight, ROT0, "UPL", "Mutant Night", MACHINE_SUPPORTS_SAVE ) GAME( 1987, mnightj, mnight, mnight, mnight, mnight_state, init_mnight, ROT0, "UPL (Kawakus license)", "Mutant Night (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp index cea9eef8943..a12debf3214 100644 --- a/src/mame/drivers/nmk16.cpp +++ b/src/mame/drivers/nmk16.cpp @@ -124,6 +124,29 @@ remaps button 2 and 3 to button 1, so you can't enter the above sequence. --- +'gunnailp' observed differences (from notes by trap15) + + - Different introduction scene + - Many unique enemy types that ended up unused + - Tweaked enemy attack patterns + - Tweaked boss behavior and attack patterns + - Dramatically different stages (and only 7 of them): + - Stage 1: Became Stage 5, very different layouts + - Stage 2: Became Stage 7, with mostly slight enemy layout changes + - Stage 3: Became Stage 6, almost the same as final + - Stage 4: Stayed as Stage 4, with very minor enemy layout changes + - Stage 5: Entirely unique stage, majorly reworked to become final Stage 2 + - Stage 6: Became Stage 3, many enemy layout changes + - Stage 7: Entirely unique stage, majorly reworked to become final Stage 1 + - No ending, instead loops forever + - Loop has extremely fast bullets + - The difficulty seems the same on all loops + - Player's blue shot has a wider maximum and minimum spread + - Player's main shot hitbox is symmetrical and wider than final + - When the hitbox was shrunk for the final, it was only shrunk in one direction, making it extended to the right + +--- + Questions / Notes 'manybloc' : @@ -6639,6 +6662,34 @@ ROM_START( gunnail ) ROM_LOAD( "10_82s123.u96", 0x0200, 0x0020, CRC(c60103c8) SHA1(dfb05b704bb5e1f75f5aaa4fa36e8ddcc905f8b6) ) /* unknown */ ROM_END +ROM_START( gunnailp ) + ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_WORD_SWAP( "3.u132", 0x00000, 0x80000, CRC(93570f03) SHA1(54fb203b5bfceb0ac86627bff3e67863f460fe73) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Code for NMK004 CPU */ + ROM_LOAD( "92077_2.u101", 0x00000, 0x10000, CRC(cd4e55f8) SHA1(92182767ca0ec37ec4949bd1a88c2efdcdcb60ed) ) + + ROM_REGION( 0x020000, "fgtile", 0 ) + ROM_LOAD( "1.u21", 0x000000, 0x020000, CRC(bdf427e4) SHA1(e9cd178d1d9e2ed72f0fb013385d935f334b8fe3) ) /* 8x8 tiles */ + + ROM_REGION( 0x100000, "bgtile", 0 ) + ROM_LOAD( "92077-4.u19", 0x000000, 0x100000, CRC(a9ea2804) SHA1(14dbdb3c7986db5e44dc7c5be6fcf39f3d1e50b0) ) /* 16x16 tiles */ + + ROM_REGION( 0x200000, "sprites", 0 ) + ROM_LOAD16_WORD_SWAP( "92077-7.u134", 0x000000, 0x200000, CRC(d49169b3) SHA1(565ff7725dd6ace79b55706114132d8d867e81a9) ) /* Sprites */ + + ROM_REGION( 0x080000, "oki1", 0 ) /* OKIM6295 samples */ + ROM_LOAD( "92077-5.u56", 0x00000, 0x80000, CRC(feb83c73) SHA1(b44e9d20b4af02e218c4bc875d66a7d6b8551cae) ) /* 0x20000 - 0x80000 banked */ + + ROM_REGION( 0x080000, "oki2", 0 ) /* OKIM6295 samples */ + ROM_LOAD( "92077-6.u57", 0x00000, 0x80000, CRC(6d133f0d) SHA1(8a5e6e27a297196f20e4de0d060f1188115809bb) ) /* 0x20000 - 0x80000 banked */ + + ROM_REGION( 0x0220, "proms", 0 ) + ROM_LOAD( "8_82s129.u35", 0x0000, 0x0100, CRC(4299776e) SHA1(683d14d2ace14965f0fcfe0f0540c1b77d2cece5) ) /* unknown */ + ROM_LOAD( "9_82s135.u72", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) /* unknown */ + ROM_LOAD( "10_82s123.u96", 0x0200, 0x0020, CRC(c60103c8) SHA1(dfb05b704bb5e1f75f5aaa4fa36e8ddcc905f8b6) ) /* unknown */ +ROM_END + // bootleg board labeled 'GT ELEKTRONIK 16.04.93' with only 1 OKI and no NMK custom chips. Only sprites and bgtile ROMs are identical to the original. ROM_START( gunnailb ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ @@ -8420,6 +8471,7 @@ GAME( 1992, macross, 0, macross, macross, nmk16_state, init_ GAME( 1993, gunnail, 0, gunnail, gunnail, nmk16_state, init_nmk, ROT270, "NMK / Tecmo", "GunNail (28th May. 1992)", 0 ) // Tecmo is displayed only when set to Japan GAME( 1992, gunnailb, gunnail, gunnailb, gunnail, nmk16_state, init_gunnailb, ROT270, "bootleg", "GunNail (bootleg)", MACHINE_NO_SOUND ) // different sound hardware not hooked up +GAME( 1992, gunnailp, gunnail, gunnail, gunnail, nmk16_state, init_nmk, ROT270, "NMK", "GunNail (location test)", 0 ) // still has the 28th May. 1992 string, so unlikely that was the release date for either version. // a 1992 version of Gunnail exists, see https://www.youtube.com/watch?v=tf15Wz0zUiA 3:10; is this bootleg version 'gunnailb'? GAME( 1993, macross2, 0, macross2, macross2, nmk16_state, init_banked_audiocpu, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", MACHINE_NO_COCKTAIL ) diff --git a/src/mame/drivers/novag_cforte.cpp b/src/mame/drivers/novag_cforte.cpp index b6430420137..009a24e4003 100644 --- a/src/mame/drivers/novag_cforte.cpp +++ b/src/mame/drivers/novag_cforte.cpp @@ -47,7 +47,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void cforte(machine_config &config); protected: @@ -241,7 +241,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void cforte_state::cforte(machine_config &config) diff --git a/src/mame/drivers/novag_const.cpp b/src/mame/drivers/novag_const.cpp index 24ce1577239..d5a901b6d5a 100644 --- a/src/mame/drivers/novag_const.cpp +++ b/src/mame/drivers/novag_const.cpp @@ -91,7 +91,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void nconst(machine_config &config); void nconst36(machine_config &config); void nconst36a(machine_config &config); @@ -325,7 +325,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void const_state::nconst(machine_config &config) diff --git a/src/mame/drivers/novag_diablo.cpp b/src/mame/drivers/novag_diablo.cpp index 74f2f8979cf..6994a47ad6d 100644 --- a/src/mame/drivers/novag_diablo.cpp +++ b/src/mame/drivers/novag_diablo.cpp @@ -55,7 +55,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void diablo68k(machine_config &config); void scorpio68k(machine_config &config); @@ -279,7 +279,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void diablo_state::diablo68k(machine_config &config) diff --git a/src/mame/drivers/novag_presto.cpp b/src/mame/drivers/novag_presto.cpp index a461f733a7b..7ace511d73f 100644 --- a/src/mame/drivers/novag_presto.cpp +++ b/src/mame/drivers/novag_presto.cpp @@ -48,7 +48,7 @@ public: m_inputs(*this, "IN.0") { } - // machine drivers + // machine configs void presto(machine_config &config); void octo(machine_config &config); @@ -194,7 +194,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void presto_state::presto(machine_config &config) diff --git a/src/mame/drivers/novag_savant.cpp b/src/mame/drivers/novag_savant.cpp index e8dc57d7476..031ac4736ae 100644 --- a/src/mame/drivers/novag_savant.cpp +++ b/src/mame/drivers/novag_savant.cpp @@ -61,7 +61,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void savant(machine_config &config); protected: @@ -349,7 +349,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void savant_state::savant(machine_config &config) diff --git a/src/mame/drivers/novag_sexpert.cpp b/src/mame/drivers/novag_sexpert.cpp index 443cfccb767..7c5c8a09673 100644 --- a/src/mame/drivers/novag_sexpert.cpp +++ b/src/mame/drivers/novag_sexpert.cpp @@ -3,7 +3,7 @@ // thanks-to:Berger /****************************************************************************** -Novag Super Expert (model 878/887/902) / Novag Super Forte +Novag Super Expert (model 878/886/887/902) / Novag Super Forte Hardware notes (Super Expert) - 65C02 @ 5MHz or 6MHz (10MHz or 12MHz XTAL) @@ -18,6 +18,14 @@ I/O via TTL, hardware design was very awkward. Super Forte is very similar, just a cheaper plastic case and chessboard buttons instead of magnet sensors. +To distinguish between versions, press the Set Level button. +- version A: no selectivity setting (but can turn on/off with level H8) +- version B: default selectivity 3 +- version C: default selectivity 5 + +Note that the H8 option doesn't appear to work with sexperta1, but when doing a +hex compare with sexperta, the program differences are minor. + ******************************************************************************/ #include "emu.h" @@ -62,7 +70,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void sexpert(machine_config &config); void init_sexpert(); @@ -154,7 +162,7 @@ public: sexpert_state(mconfig, type, tag) { } - // machine drivers + // machine configs void sforte(machine_config &config); protected: @@ -397,7 +405,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void sexpert_state::sexpert(machine_config &config) @@ -469,27 +477,27 @@ void sforte_state::sforte(machine_config &config) ROM Definitions ******************************************************************************/ -ROM_START( sexperta ) +ROM_START( sexperta ) // from model 886 + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD("se_lo_608.u3", 0x0000, 0x8000, CRC(5c98264c) SHA1(fbbe0d0cf64944fd3a90a7e9711b1deef8b9b51d) ) + ROM_LOAD("se_hi1_608.u1", 0x8000, 0x8000, CRC(68009cb4) SHA1(ae8d1b5058eff72d3fcfd6a011608ae7b3de5060) ) + ROM_LOAD("se_sf_hi0_c22.u2", 0x10000, 0x8000, CRC(3e42cf7c) SHA1(b2faa36a127e08e5755167a25ed4a07f12d62957) ) +ROM_END + +ROM_START( sexperta1 ) // from model 878 ROM_REGION( 0x18000, "maincpu", 0 ) ROM_LOAD("se_lo_b15.u3", 0x0000, 0x8000, CRC(6cc9527c) SHA1(29bab809399f2863a88a9c41535ecec0a4fd65ea) ) ROM_LOAD("se_hi1_b15.u1", 0x8000, 0x8000, CRC(6e57f0c0) SHA1(ea44769a6f54721fd4543366bda932e86e497d43) ) ROM_LOAD("se_sf_hi0_a23.u2", 0x10000, 0x8000, CRC(7d4e1528) SHA1(53c7d458a5571afae402f00ae3d0f5066634b068) ) ROM_END -ROM_START( sexpertb ) +ROM_START( sexpertb ) // from model 887 ROM_REGION( 0x18000, "maincpu", 0 ) ROM_LOAD("se_lo_619.u3", 0x0000, 0x8000, CRC(92002eb6) SHA1(ed8ca16701e00b48fa55c856fa4a8c6613079c02) ) ROM_LOAD("se_hi1_619.u1", 0x8000, 0x8000, CRC(814b4420) SHA1(c553e6a8c048dcc1cf48d410111a86e06b99d356) ) ROM_LOAD("se_f_hi0_605.u2", 0x10000, 0x8000, CRC(bb07ad52) SHA1(30cf9005021ab2d7b03facdf2d3588bc94dc68a6) ) ROM_END -ROM_START( sexpertb1 ) - ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD("se_lo_608.u3", 0x0000, 0x8000, CRC(5c98264c) SHA1(fbbe0d0cf64944fd3a90a7e9711b1deef8b9b51d) ) - ROM_LOAD("se_hi1_608.u1", 0x8000, 0x8000, CRC(68009cb4) SHA1(ae8d1b5058eff72d3fcfd6a011608ae7b3de5060) ) - ROM_LOAD("se_sf_hi0_c22.u2", 0x10000, 0x8000, CRC(3e42cf7c) SHA1(b2faa36a127e08e5755167a25ed4a07f12d62957) ) -ROM_END - ROM_START( sexpertc ) ROM_REGION( 0x18000, "maincpu", 0 ) ROM_LOAD("se_lo_v3.6.u3", 0x0000, 0x8000, CRC(5a29105e) SHA1(be37bb29b530dbba847a5e8d27d81b36525e47f7) ) @@ -549,9 +557,9 @@ ROM_END ******************************************************************************/ // YEAR NAME PARENT CMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS -CONS( 1987, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1988, sexpertb, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version B, model 887)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1988, sexpertb1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version B, model 886)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1988, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1987, sexperta1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, older)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1988, sexpertb, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, sexpertc, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, V3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, sexpertc1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, V1.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/novag_supremo.cpp b/src/mame/drivers/novag_supremo.cpp new file mode 100644 index 00000000000..647128057ee --- /dev/null +++ b/src/mame/drivers/novag_supremo.cpp @@ -0,0 +1,139 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Berger +/****************************************************************************** + +Novag Supremo + +Hardware notes: +- Hitachi HD63A03YP MCU @ 8MHz (2MHz internal) +- 32KB ROM(TC57256AD-12), 2KB RAM(TC5516APL) +- LCD with 4 digits and custom segments, no LCD chip +- buzzer, 16 LEDs, 8*8 chessboard buttons + +Novag Primo is assumed to be on similar hardware +Supremo also had a "limited edition" rerelease in 1990, plastic is fake-wood +instead of black, otherwise it's the same game. + +TODO: +- does not work, most likely due to incomplete cpu emulation + (extra I/O ports, unemulated timer registers) + +******************************************************************************/ + +#include "emu.h" + +#include "cpu/m6800/m6801.h" +#include "machine/sensorboard.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" + +#include "speaker.h" + + +namespace { + +class supremo_state : public driver_device +{ +public: + supremo_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_board(*this, "board"), + m_dac(*this, "dac") + { } + + // machine configs + void supremo(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + // devices/pointers + required_device<hd6303y_cpu_device> m_maincpu; + required_device<sensorboard_device> m_board; + optional_device<dac_bit_interface> m_dac; + + void main_map(address_map &map); +}; + +void supremo_state::machine_start() +{ +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +// ... + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void supremo_state::main_map(address_map &map) +{ + map(0x0000, 0x000e).rw(m_maincpu, FUNC(hd6303y_cpu_device::m6801_io_r), FUNC(hd6303y_cpu_device::m6801_io_w)); + map(0x0040, 0x013f).ram(); // internal + map(0x4000, 0x47ff).ram(); + map(0x8000, 0xffff).rom(); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( supremo ) +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void supremo_state::supremo(machine_config &config) +{ + /* basic machine hardware */ + HD6303Y(config, m_maincpu, 8_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &supremo_state::main_map); + + SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); + m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); + m_board->set_delay(attotime::from_msec(150)); + + /* sound hardware */ + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); + VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( supremo ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("sp_a10.u5", 0x8000, 0x8000, CRC(745d010f) SHA1(365a8e2afcf63678ba0161b9082f6439a9d78c9f) ) +ROM_END + +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +CONS( 1988, supremo, 0, 0, supremo, supremo, supremo_state, empty_init, "Novag", "Supremo", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) + diff --git a/src/mame/drivers/ns5652.cpp b/src/mame/drivers/ns5652.cpp new file mode 100644 index 00000000000..6e4e25f474b --- /dev/null +++ b/src/mame/drivers/ns5652.cpp @@ -0,0 +1,91 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + unknown National Semiconductor INS8900 Multibus card (980305652) + +***************************************************************************/ + +#include "emu.h" +#include "cpu/pace/pace.h" +#include "machine/ins8250.h" + +class ns5652_state : public driver_device +{ +public: + ns5652_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ecprom(*this, "ecprom") + { + } + + void ns5652(machine_config &config); + +private: + void mem_map(address_map &map); + + required_device<pace_device> m_maincpu; + required_region_ptr<u8> m_ecprom; +}; + + +void ns5652_state::mem_map(address_map &map) +{ + map(0x0000, 0x0bff).mirror(0xd000).rom().region("program", 0); + map(0xe800, 0xebff).ram(); // 4x MM2114J-3 + map(0xec00, 0xecff).lr16([this](offs_t offset) { return m_ecprom[offset]; }, "ecprom_r"); + map(0xf600, 0xf600).nopw(); // shift register outputs? + map(0xf610, 0xf610).nopw(); + map(0xf620, 0xf620).nopw(); + map(0xf630, 0xf630).nopw(); + map(0xf640, 0xf640).nopw(); + map(0xf650, 0xf650).nopw(); + map(0xf660, 0xf660).nopw(); + map(0xf670, 0xf670).nopw(); + map(0xf680, 0xf680).nopw(); + map(0xf690, 0xf690).nopw(); + map(0xf6a0, 0xf6a0).nopw(); + map(0xf6b0, 0xf6b0).nopw(); + map(0xf6c0, 0xf6c0).nopw(); + map(0xf6d0, 0xf6d0).nopw(); + map(0xf6e0, 0xf6e0).nopw(); + map(0xf6f0, 0xf6f0).nopw(); + map(0xf700, 0xf700).nopw(); + map(0xf710, 0xf710).nopw(); + map(0xf720, 0xf720).nopw(); + map(0xf730, 0xf730).nopw(); + map(0xf740, 0xf740).nopw(); + map(0xf750, 0xf750).nopw(); + map(0xf760, 0xf760).nopw(); + map(0xf770, 0xf770).nopw(); + map(0xf780, 0xf780).nopw(); + map(0xf790, 0xf790).nopw(); +} + + +static INPUT_PORTS_START(ns5652) +INPUT_PORTS_END + +void ns5652_state::ns5652(machine_config &config) +{ + INS8900(config, m_maincpu, 1.8432_MHz_XTAL); // no other XTAL visible + m_maincpu->set_addrmap(AS_PROGRAM, &ns5652_state::mem_map); + + INS8250(config, "ace", 1.8432_MHz_XTAL); +} + +ROM_START(ns5652) + ROM_REGION16_LE(0x1800, "program", 0) // all MM2708Q + ROM_LOAD16_BYTE("5652_001b.bin", 0x0000, 0x0400, CRC(03acf738) SHA1(e512ccf64473e0b7291d8cc14f44858cac2048e6)) + ROM_LOAD16_BYTE("5652_004b.bin", 0x0001, 0x0400, CRC(b238b1ba) SHA1(90735194cc7f111fc7c1cdde1a9aab4945b00a7e)) + ROM_LOAD16_BYTE("5652_002b.bin", 0x0800, 0x0400, CRC(2fd33c25) SHA1(5f1bab6c149c19b8c57f9f014d7aecd5d287fae0)) + ROM_LOAD16_BYTE("5652_005b.bin", 0x0801, 0x0400, CRC(e1d559ed) SHA1(3093d28b661275c00de8145f8424f584a4854072)) + ROM_LOAD16_BYTE("5652_003b.bin", 0x1000, 0x0400, CRC(24abf1f8) SHA1(ef22ca58e59d8301aab9175ef7ac9dc97feae9ec)) + ROM_LOAD16_BYTE("5652_006b.bin", 0x1001, 0x0400, CRC(db1dca74) SHA1(05149e85237a742850446c01249c83ba373e66b3)) + + ROM_REGION(0x100, "ecprom", 0) // 256 bytes to be packed into top 128 words of RAM + ROM_LOAD("5930_001a.bin", 0x000, 0x100, NO_DUMP) // MM5203Q (256x8 organization) +ROM_END + +COMP(19??, ns5652, 0, 0, ns5652, ns5652, ns5652_state, empty_init, "National Semiconductor", "unknown INS8900 Multibus card (980305652)", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/o2.cpp b/src/mame/drivers/o2.cpp index cff35e4a99f..e4421e8648e 100644 --- a/src/mame/drivers/o2.cpp +++ b/src/mame/drivers/o2.cpp @@ -89,8 +89,13 @@ void o2_state::o2(machine_config &config) ROM_START( o2 ) ROM_REGION64_BE( 0x80000, "user1", 0 ) - ROMX_LOAD( "ip32prom.rev4.18.bin", 0x000000, 0x080000, CRC(02b3c53d) SHA1(f2cfa7246d67f88fe5490e40dac6c04b1deb4d28), ROM_GROUPDWORD ) + + ROM_SYSTEM_BIOS( 0, "ip32prom_4_3", "IP32 PROM V4.3" ) + ROMX_LOAD( "ip32prom.rev4.3.bin", 0x000000, 0x080000, CRC(029f3d06) SHA1(cf5a31299131488d8aaf085054d2a6614bb16974), ROM_GROUPDWORD | ROM_BIOS(0)) + + ROM_SYSTEM_BIOS( 1, "ip32prom_4_18", "IP32 PROM V4.18" ) + ROMX_LOAD( "ip32prom.rev4.18.bin", 0x000000, 0x080000, CRC(02b3c53d) SHA1(f2cfa7246d67f88fe5490e40dac6c04b1deb4d28), ROM_GROUPDWORD | ROM_BIOS(1)) ROM_END -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1996, o2, 0, 0, o2, o2, o2_state, empty_init, "Silicon Graphics Inc", "O2 (version 4.18)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1996, o2, 0, 0, o2, o2, o2_state, empty_init, "Silicon Graphics Inc.", "O2", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/drivers/omegrace.cpp b/src/mame/drivers/omegrace.cpp index 621cc9c67e6..2872bd50d16 100644 --- a/src/mame/drivers/omegrace.cpp +++ b/src/mame/drivers/omegrace.cpp @@ -246,16 +246,16 @@ public: void init_omegrace(); private: + TIMER_CALLBACK_MEMBER(periodic_int); DECLARE_READ8_MEMBER(omegrace_vg_go_r); DECLARE_READ8_MEMBER(omegrace_spinner1_r); DECLARE_WRITE8_MEMBER(omegrace_leds_w); - DECLARE_WRITE8_MEMBER(omegrace_soundlatch_w); void main_map(address_map &map); void port_map(address_map &map); void sound_map(address_map &map); void sound_port(address_map &map); - virtual void machine_start() override { m_leds.resolve(); } + virtual void machine_start() override; virtual void machine_reset() override; required_device<cpu_device> m_maincpu; @@ -263,6 +263,7 @@ private: required_device<dvg_device> m_dvg; required_device<generic_latch_8_device> m_soundlatch; output_finder<4> m_leds; + emu_timer *m_gbnmi; }; @@ -272,12 +273,28 @@ private: * *************************************/ +void omegrace_state::machine_start() +{ + m_leds.resolve(); + + // Interrupt caused by overflow pulses from 74LS161 clocked by 74LS393 dividing .75 MHz output of 74LS161 + attotime period = attotime::from_hz(12_MHz_XTAL/16/256/12); // ~250 Hz + m_gbnmi = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(omegrace_state::periodic_int), this)); + m_gbnmi->adjust(period, 0, period); // first NMI must not arrive immediately +} + void omegrace_state::machine_reset() { /* Omega Race expects the vector processor to be ready. */ m_dvg->reset_w(); } +TIMER_CALLBACK_MEMBER(omegrace_state::periodic_int) +{ + m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE); + m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); +} + /************************************* @@ -354,13 +371,6 @@ WRITE8_MEMBER(omegrace_state::omegrace_leds_w) } -WRITE8_MEMBER(omegrace_state::omegrace_soundlatch_w) -{ - m_soundlatch->write(data); - m_audiocpu->set_input_line(0, HOLD_LINE); -} - - /************************************* * @@ -390,7 +400,7 @@ void omegrace_state::port_map(address_map &map) map(0x11, 0x11).portr("IN0"); /* Player 1 input */ map(0x12, 0x12).portr("IN1"); /* Player 2 input */ map(0x13, 0x13).w(FUNC(omegrace_state::omegrace_leds_w)); /* coin counters, leds, flip screen */ - map(0x14, 0x14).w(FUNC(omegrace_state::omegrace_soundlatch_w)); /* Sound command */ + map(0x14, 0x14).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x15, 0x15).r(FUNC(omegrace_state::omegrace_spinner1_r)); /* 1st controller */ map(0x16, 0x16).portr("SPIN1"); /* 2nd controller (cocktail) */ } @@ -520,23 +530,21 @@ void omegrace_state::omegrace(machine_config &config) /* main CPU */ /* XTAL101 Crystal @ 12mhz */ /* through 74LS161, Pin 13 = divide by 4 */ - Z80(config, m_maincpu, XTAL(12'000'000)/4); + Z80(config, m_maincpu, 12_MHz_XTAL/4); m_maincpu->set_addrmap(AS_PROGRAM, &omegrace_state::main_map); m_maincpu->set_addrmap(AS_IO, &omegrace_state::port_map); - m_maincpu->set_periodic_int(FUNC(omegrace_state::irq0_line_hold), attotime::from_hz(250)); /* audio CPU */ /* XTAL101 Crystal @ 12mhz */ /* through 74LS161, Pin 12 = divide by 8 */ /* Fed to CPU as 1.5mhz though line J4-D */ - Z80(config, m_audiocpu, XTAL(12'000'000)/8); + Z80(config, m_audiocpu, 12_MHz_XTAL/8); m_audiocpu->set_addrmap(AS_PROGRAM, &omegrace_state::sound_map); m_audiocpu->set_addrmap(AS_IO, &omegrace_state::sound_port); - m_audiocpu->set_periodic_int(FUNC(omegrace_state::nmi_line_pulse), attotime::from_hz(250)); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 5101 + battery - WATCHDOG_TIMER(config, "watchdog"); + WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_hz(12_MHz_XTAL/16/256/256)); /* video hardware */ VECTOR(config, "vector", 0); @@ -553,12 +561,13 @@ void omegrace_state::omegrace(machine_config &config) SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); /* XTAL101 Crystal @ 12mhz */ /* through 74LS92, Pin 8 = divide by 12 */ - AY8912(config, "ay1", XTAL(12'000'000)/12).add_route(ALL_OUTPUTS, "mono", 0.25); + AY8912(config, "ay1", 12_MHz_XTAL/12).add_route(ALL_OUTPUTS, "mono", 0.25); - AY8912(config, "ay2", XTAL(12'000'000)/12).add_route(ALL_OUTPUTS, "mono", 0.25); + AY8912(config, "ay2", 12_MHz_XTAL/12).add_route(ALL_OUTPUTS, "mono", 0.25); } diff --git a/src/mame/drivers/pc.cpp b/src/mame/drivers/pc.cpp index f8b098d460a..aff8301e1c0 100644 --- a/src/mame/drivers/pc.cpp +++ b/src/mame/drivers/pc.cpp @@ -249,9 +249,22 @@ RAM: 512K / 640KB Bus: 4x ISA Video: Hercules/CGA/EGA Mass storage: 1 5.25" 360K floppy and 1 5.25" 360K floppy or 20MB hard drive -On board ports: floppy, graphics, parallel, serial, mouse +On board ports: floppy, external floppy (Atari ST style), graphics, parallel, serial, mouse Expansion: 8087 FPU +DIP switches: Sw.1 Sw.2 Sw.3 Sw.4 + EGA Monitor OFF ON OFF OFF + Color Monitor ON OFF OFF ON + Monochrome Monitor ON OFF ON ON + +EGA.COM, CGA.COM, HGC.COM, MDA.COM, PALETTE.COM, HCOLOR.COM and CURSOR are utilities to change +the behavior of the integrated graphics card. + +Turbo option: From DOS, commands "TURBO ON" and "TURRBO OFF or key combos [Ctrl][Alt][1] or +[Ctrl][Alt][+] for Turbo on, [Ctrl][Alt][2] or [Ctrl][Alt][-] for Turbo off +Keyboard click: From DOS, "CLICK ON" and "CLICK OFF" or key combos [Ctrl][Alt][<] +for click on, [Ctrl][Alt][>] for click off + ******************************************************************************/ void pc_state::ataripc1(machine_config &config) @@ -265,8 +278,10 @@ ROM_START ( ataripc1 ) ROM_REGION(0x10000,"bios", 0) ROM_SYSTEM_BIOS( 0, "v3.06", "v3.06" ) ROMX_LOAD("award_atari_pc_bios_3.06.bin", 0x8000, 0x8000, CRC(256427ce) SHA1(999f6af64b79f88c1d3492f386d9bee08efb50e7), ROM_BIOS(0)) - ROM_SYSTEM_BIOS( 1, "v3.08", "v3.08" ) - ROMX_LOAD("award_atari_pc_bios_3.08.bin", 0x8000, 0x8000, CRC(929a2443) SHA1(8e98f3c9180c55b1f5521727779c016083d27960), ROM_BIOS(1)) //same as on Atari PC3, also used on Atari PC2 + ROM_SYSTEM_BIOS( 1, "v3.07", "v3.07" ) + ROMX_LOAD("award_atari_pc_bios_3.07.bin", 0x8000, 0x8000, CRC(a73b80e6) SHA1(03af5902cdfd1cde217022b823162f24aba435ab), ROM_BIOS(1)) + ROM_SYSTEM_BIOS( 2, "v3.08", "v3.08" ) + ROMX_LOAD("award_atari_pc_bios_3.08.bin", 0x8000, 0x8000, CRC(929a2443) SHA1(8e98f3c9180c55b1f5521727779c016083d27960), ROM_BIOS(2)) //same as on Atari PC3, also used on Atari PC2 ROM_END @@ -282,6 +297,22 @@ Video: On-board MDA/CGA/Hercules/EGA Mass storage: 1x 5.25" 360K floppy + 30MB RLL harddisk On board ports: floppy, parallel, serial, mouse, speaker Options: 8087 FPU +DIP switches: 4 3 2 1 + EGA (smart on) OFF OFF ON OFF + EGA (smart OFF) OFF ON ON OFF + Color monitor ON OFF OFF ON + monochrome ON ON OFF ON + +If you add a monochrome adapter board, set the switches to "Smart OFF", the HGC, MDA and HCOLOR +options are meaningless, then. +EGA.COM, CGA.COM, HGC.COM, MDA.COM, PALETTE.COM, HCOLOR.COM and CURSOR are utilities to change +the behavior of the integrated graphics card. + +Turbo option: From DOS, commands "TURBO ON" and "TURRBO OFF or key combos [Ctrl][Alt][1] or +[Ctrl][Alt][+] for Turbo on, [Ctrl][Alt][2] or [Ctrl][Alt][-] for Turbo off +Keyboard click: From DOS, "CLICK ON" and "CLICK OFF" or key combos [Ctrl][Alt][<] +for click on, [Ctrl][Alt][>] for click off + ******************************************************************************/ ROM_START( ataripc3 ) @@ -345,7 +376,7 @@ ROM_END /****************************************** Columbia Data Products MPC 1600 *** -Links: http://www.old-computers.com/museum/computer.asp?st=1&c=633, https://winworldpc.com/download/6f07e280-9d12-7ae2-80a6-11c3a6e28094, +Links: https://www.old-computers.com/museum/computer.asp?st=1&c=633, https://winworldpc.com/download/6f07e280-9d12-7ae2-80a6-11c3a6e28094, http://www.minuszerodegrees.net/rom/rom.htm Form Factor: Desktop CPU: 8088 @ 4.77 MHz @@ -353,10 +384,18 @@ RAM: 128K, up to 1MB Bus: 8x ISA Video: CGA Mass storage: 2x 5.25" 320K -On board ports: Floppy -Options: 5MB harddisk +On board ports: Floppy, serial, console, Centronics, hard disk ("The Winchester disk interface is an 8 bit parallel data port with 4 control lines + for byte and unit synchronization. This interface connects the MPC system board to the CDP cache buffered Winchester controller.") +Options: 5MB harddisk, light pen ToDo: The ROM for the CGA is available (see ROM section) +If all of the testing is accomplished, the system will respond with a single 1/2 second tone and continue according to the input output media attached. +If a dumb terminal is used, another tone will sound and the system will produce another 1/2 second tone then wait until an ASCII period(.)is typed at the +terminal. The system uses the ASCII character to determine the baud-rate of the terminal device. If an ASCII(.)is not received in 5 seconds, the system +will default to 19200 baud. If a keyboard and monitor is attached, then no baud rate determination is required. +Note:Type[ESC] here to activate the ROM monitor for system testing. If a response is not made within five (5) seconds, the MPC will automatically +enter the system bootstrap sequence detailed below. + ******************************************************************************/ void pc_state::mpc1600(machine_config &config) @@ -385,7 +424,40 @@ Links: https://en.wikipedia.org/wiki/Compaq_Portable , http://oldcomputers.net/ http://www.digibarn.com/collections/systems/compaq/index.html , http://www.old-computers.com/museum/computer.asp?c=547 , https://www.seasip.info/VintagePC/compaq.html Form Factor: Luggable -CPU: +CPU: 8088 @ 4.77 MHz +RAM: 128K, up to 640KB +Bus: 5x ISA +Video: CGA/MDA capable card, both fonts available, Ctrl+Alt+> switches between internal and external monitor +Mass storage: 1/2x 5.25" double sided/double density (320K/360K), Plus: 10-21MB harddisk + +SW1: 1 2 3 4 5 6 7 8 Descr. + OFF Not used/always OFF (def.) + ON Coprocessor/always ON (def.) + OFF OFF Processor board memory/always OFF (def.) + ON OFF Compaq video display Controller board (def.) + OFF OFF Optional monochrome video board + ON ON 1 Diskette drive (def.) + OFF ON 2 + ON OFF 3 + OFF OFF + +SW2: 1 2 3 4 5 6 7 8 Descr. + ON OFF ON ON OFF OFF OFF OFF 128 Kbyte total memory + ON ON OFF ON OFF OFF OFF OFF 192 Kbyte total memory + ON OFF OFF ON OFF OFF OFF OFF 156 Kbyte total memory + ON ON ON OFF OFF OFF OFF OFF 320 Kbyte total memory + ON OFF ON OFF OFF OFF OFF OFF 384 Kbyte total memory + ON ON OFF OFF OFF OFF OFF OFF 448 Kbyte total memory + ON OFF OFF OFF OFF OFF OFF OFF 512 Kbyte total memory + OFF OFF OFF OFF OFF OFF OFF OFF 544 Kbyte total memory + +If the ROMs installed in socket(s) U40 (and U47 if available) are Revision C or above, +SW2 is ignored. Therefore, on system boards ofRevision J or above, SW2 has been removed. +If Revision C ROMs or above are installed, 256K x 1 RAM chips may be usedinstead of 64K x 1 bit +RAM chips in banks 2 and 3 of the system board. To dothis, however, a new decoder PROM must +be used in socket U35:o PN 101257-001 (No longer available) if banks 2 and 3 are filled with +256K x 1 RAM chips for a total of 640 Kbytes.o PN 101256-001 if only bank 3 is filled with +256K x 1 RAM chips for a total of 448 Kbytes. ******************************************************************************/ @@ -490,6 +562,7 @@ Links: http://www.digibarn.com/collections/systems/eagle-pc/index.html , https:/ Form Factor: Desktop Error message: Cannot read boot sector + ******************************************************************************/ ROM_START( eaglepc2 ) @@ -510,6 +583,26 @@ RAM: 128K, up to 640K Video: CGA Mass storage: 1/2x 5.25" 360KB floppy or 1x 360KB floppy and 10MB harddisk (XL model) +Pressing "T" after a hard reset brings up a ROM based test suite. + +DIP switches: +SW801: Sw.1 Sw.2 Sw.3 Sw.4 Max.RAM J13 Sw.5 Sw.6 Floppy Sw.7 Sw.8 Display@ + on mainbd. drives powerup + ON ON ON ON 64K OUT + OFF ON ON ON 128K OUT + ON OFF ON ON 192K OUT + OFF OFF ON ON 256K OUT + OFF ON OFF ON 384K IN + OFF ON ON OFF 640K IN + ON ON 1 + ON OFF 2 + OFF ON 3 + OFF OFF 4 + ON ON No Display + ON OFF Color 40x35 + OFF ON Color 80x25 + OFF OFF Monochrome + ******************************************************************************/ ROM_START( eaglespirit ) @@ -609,12 +702,42 @@ Info: Model I: 128K RAM, 14" mono (green or amber) or 12" colour screen; Model Model III: 256K RAM, 1 floppy, 10MB harddisk Form Factor: Desktop CPU: 8088 -RAM: 128K or 256K on board +RAM: 128K or 256K on board, expandable to 512K Bus: 5xISA Mass storage: 1/2x 5.25" floppy drives -Options: 8087 FPU, ISA Memory expansion cards, 10MB harddisk +Options: 8087 FPU, 10MB harddisk, combo board: "The optional Combo board plugs into one of the 62-pin motherboard expansion slots + and provides an additional 128KB of memory, a battery backup real-time clock, and an 8-bit general purpose port which can be + used for a parallel printer. Two "baby" add-on memory cards of 128KB each can also be plugged into the Combo board raising the + available memory on the board to 384K. On board connectors: Floppy, keyboard, serial, parallel -ToDo: Machine boots, but shows keyboard error; find dump of original graphics card ROM +ToDo: find dump of original graphics card ROM + +DIP switches: +SW1: 1 2 3 4 5 6 7 8 effect + OFF FPU installed + ON no FPU + OFF ON 128K mainboard memory + ON OFF 192K + OFF OFF 256K + ON ON 80x25 color monitor + OFF ON 40x25 color monitor + ON OFF color monitor in the 80x25 mode + OFF OFF monochrome or both mono and color monitors + ON ON 1 floppy drive + OFF ON 2 + ON OFF 3 + OFF OFF 4 + +SW2: 1 2 3 4 5 6 7 8 effect + ON ON Screen Time out ON + OFF ON Screen Time out OFF + OFF Power up Self Test ON + ON Power up Self Test OFF + OFF Normal Operation + ON Factory Testing + +The ROM contains a monitor program that can be activated by pressing "ESC" at the "Insert Diskette" prompt +or by pressing [Ctrl]-[Alt]-[Esc] ******************************************************************************/ @@ -641,6 +764,17 @@ Mass storage: 1x 5.25" 360K, 10MB harddisk (Seagate ST212) Options: 8087 FPU Misc: A Kaypro 16/2 is a configuration without harddisk but with two floppy disk drives (interface ics on mainboard were not populated) +DIP switches: +SW1 on the PROCESSOR CARD: Position 1 is used to specify the numeric processor option. Positions 2 and 3 are used to specify the size and type +of display interface. Positions 4 and 5 are used to specify the number of disk drives. +(1: on, 2: off, 3: on, 4: on, 5: on); Kapro 16/2: (1: on, 2: off, 3: on, 4: on, 5: off) +SW1 on the FLOPPY-RAM-I/O CARD: Positions 1,2,3 and 4 are used to specify the starting address for the RAM on the FLOPPY-RAM-I/O card (the +memory expansion). Positions 5 and 6 indicate the number of RAM banks on the FLOPPY-RAM-I/O card. Position 7 is used to specify whether those +banks contain 64K or 256K. Position 8 is used to enable or disable parity checking. +(1: off, 2: on, 3: on, 5: on, 5: on, 6: off, 7: on). +SW2 on the FLOPPY-RAM-I/O card: Positions 1 and 2 are used to select the serial port. Positions 3 and 4 are used to select the parallel port. +(1: on, 2: on, 3: on, 4: off). + ******************************************************************************/ void pc_state::kaypro16(machine_config &config) @@ -663,6 +797,8 @@ ROM_END Links: https://www.youtube.com/watch?v=2YAEOhYEZbc , +DIP switches: 2 blocks of 8 switches on the FLOPPY-RAM-I/O board, 1 block of 5 switches on the CPU board + ******************************************************************************/ ROM_START( kaypropc ) @@ -717,6 +853,20 @@ Mass storage: 1x 5.25" 360K floppy and 1x 5.25" 360K floppy or 10 MB harddisk On board ports: parallel, serial, speaker, floppy Options: 8087 FPU, K101 memory upgrade in 64K steps, 1.2MB floppy and controller board +Regular motherboard, an alternate board using more integrated components exists. +Jumpers: JP1 closed: enable flex. disk drives, JP2 closed: enable standad serial I/O +JP3 closed: enable parallel interface OR just JP5: closed, enable standard serial I/O + +DIP settings: Sw.1 Sw.2 Sw.3 Sw.4 Sw.5 Sw.6 Sw.7 Sw.8 effect + OFF normal operation + ON FPU not installed + OFF OFF 256KB RAM + OFF OFF Alpha Controller + OFF ON 40x25 Graphics Controller + ON OFF 80x25 Graphics Controller + ON ON 1 Flexible Disk Drive + OFF ON 2 Flexible Disk Drives + ******************************************************************************/ void pc_state::ncrpc4i(machine_config & config) @@ -787,13 +937,14 @@ Mass storage: 1x 3.5" 720K, 20MB Miniscribe harddisk On board ports: speaker Options: 8087 FPU +DIP switches: block with six switches on the CPU board ******************************************************************************/ void pc_state::olytext30(machine_config &config) { pccga(config); - v20_device &maincpu(V20(config.replace(), "maincpu", XTAL(14'318'181)/3)); /* 4.77 MHz */ + v20_device &maincpu(V20(config.replace(), "maincpu", XTAL(25'000'000)/3)); /* 8.33 MHz */ // determine divider, it's a 25MHz crystal and a 10MHz V20 maincpu.set_addrmap(AS_PROGRAM, &pc_state::pc8_map); maincpu.set_addrmap(AS_IO, &pc_state::pc8_io); maincpu.set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); @@ -986,7 +1137,9 @@ Video: MDA/Hercules, exchangable via ISA-slot Mass storage: 1x 5.25" 360K floppy and 1x 5.25" 360K floppy or MFM hard drive (10MB or 20MB) On board ports: parallel, serial, beeper Options: 8087 FPU +OSC: 24MHz, 1843.200KHz +Two blocks of dip switches, 8 switches each ******************************************************************************/ static DEVICE_INPUT_DEFAULTS_START( siemens ) @@ -996,7 +1149,7 @@ DEVICE_INPUT_DEFAULTS_END void pc_state::siemens(machine_config &config) { /* basic machine hardware */ - i8088_cpu_device &maincpu(I8088(config, "maincpu", XTAL(14'318'181)/3)); /* 4.77 MHz */ + i8088_cpu_device &maincpu(I8088(config, "maincpu", XTAL(24'000'000)/3)); /* 8.00 MHz */ // Turbo, can be changed to 4.77MHz maincpu.set_addrmap(AS_PROGRAM, &pc_state::pc8_map); maincpu.set_addrmap(AS_IO, &pc_state::pc8_io); maincpu.set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb)); @@ -1025,6 +1178,10 @@ void pc_state::siemens(machine_config &config) ROM_START( sicpc1605 ) ROM_REGION(0x10000,"bios", 0) ROM_LOAD("multitech pc-700 3.1.bin", 0xe000, 0x2000, CRC(0ac7a2e1) SHA1(b9c8504e21213d81a068dde9f51f9c973d726e7b)) + + // ROM for INS8039N-11 keyboard MCU in Siemens KB-097B/SI keyboard + ROM_REGION(0x8000,"kbd", 0) + ROM_LOAD("kb097b-st_v1.0.bin", 0x0000, 0x2000, CRC(5fc5903f) SHA1(5fc14d12800e22bb354e4b329c6ffc25efa0397c)) ROM_END @@ -1042,6 +1199,43 @@ Mass storage: 2x 5.25" 360K floppies and 1 or 2 harddisks (20MB / 30MB / 40MB) On board ports: speaker Options: 8087 FPU +DIP settings: +SW1: 1 2 3 4 5 6 7 8 effect + OFF normal operation + ON Factory Testing only + ON FPU absent + OFF FPU present + OFF ON 512K conventional memory + OFF OFF 640K conventional memory + ON ON normally on + ON ON 1 floppy drive + OFF ON 2 + ON OFF 3 + OFF OFF 4 + +Switch SW2 is used for the starting address for the expanded memory in the Turbo XT. If you have up to +one megabyte of expanded memory, the settings are easy: 512K: 01111111 1MB 01110111 +Expanded memory is broken into two bundles as you install it. For example, with 1MB you have 512K in both +bundle 1 and bundle 2. +The positions of switches 1, 2 and 3 determine the address of the first bundle of expanded memory. Likewise, +switches 4, 5 and 6 determine the second bundle's address. Each 512K must have a unique starting address + +SW2: 1/4 2/5 3/6 effect + OFF ON ON 208h I/O port expanded memory + ON OFF ON 218h + OFF OFF ON 258h + ON ON OFF 268h + OFF ON OFF 2A8h + ON OFF OFF 2B8h + OFF OFF OFF 2E8h + ON ON ON bundle disabled + +At 4.77MHz, memory accesses take four clock cycles (840ns), while I/O accesses take five clock +cycles (1050ns). At 10MHz, the internal RAM accesses take four cycles (400ns) while all other +memory accesses take 5 cycles (500ns). I/O accesses still take 5 cycles. However, the clock is +slowed down to 4.77MHz for all I/O accesses. The same is true for DMA cycles. This ensures the +Turbo XT is compatible with most expansion cards even when running at 10MHz. + ******************************************************************************/ ROM_START( laser_turbo_xt ) @@ -1064,6 +1258,34 @@ Mass storage: 2x 5.25" 360K or 1x 5.25" 360K and 1x 3.5" 720K, additional harddi On board ports: speaker Options: 8087 FPU +DIP settings: +SW1: 1 2 3 4 5 6 7 8 effect + OFF normal operation + ON Factory Testing only + ON FPU absent + OFF FPU present + ON 512K conventional memory + OFF 640K conventional memory + -- not used + ON ON EGA or VGA + OFF ON CGA 40x25 mode + ON OFF CGA 80x25 mode + OFF OFF MDA or Hercules + ON ON 1 floppy drive + OFF ON 2 + ON OFF 3 + OFF OFF 4 + +SW2: 1 2 3 effect + OFF ON ON 208h I/O port expanded memory + ON OFF ON 218h + OFF OFF ON 258h + ON ON OFF 268h + OFF ON OFF 2A8h + ON OFF OFF 2B8h + OFF OFF OFF 2E8h + ON ON ON expanded memory disabled + ******************************************************************************/ ROM_START( laser_xt3 ) @@ -1136,6 +1358,26 @@ ROM_END /****************************************************** Zenith Z-150 series *** Form factor: Desktop +Bus: 8 slot passive backplane: 1) CPU/memory card + 2) Floppy/Video card (color and monochrome) +CPU: Intel 8088 4.77MHz/8MHz, FPU socket present +RAM: up to 640KB +Mass storage: 2xDSDD 5.25" floppy disks / DSDD 5.25" floppy disk + winchester +on board: speaker + + +DIP settings: +SW202: 1 2 3 4 effect + ON 60Hz display frequency + OFF 50Hz display frequency + ON autoboot floppy drive + OFF autoboot winchester + ON floppy controller not installed + OFF floppy controller installed + ON color video adapter + OFF monochrome video adapter + +Pres "ESC" during powerup to enter the ROM monitor ******************************************************************************/ @@ -1161,8 +1403,16 @@ ROM_END http://mkgraham.dx.am/810.html https://smg.photobucket.com/user/zzm113/library?page=1 -System has an AT style enhanced keyboard, despite changing that, the emulated 810 +CPU: NEC V20@4.77MHZ/5.15MHZ/9.54 MHz / FPU socket provided +on board: dual disk drive controller, dual IDE hard drive interface, 2xser, game +Bus: 5 ISA slots on a riser +RAM: 640KB +mass storage: 5.25" DSDD floppy drive +options: 20MB/40MB hard drive, RTC + +System has an AT style enhanced keyboard, despite providing that, the emulated 810 emits a steady beep and waits for F1 to be pressed. +SW1 and SW2 DIP switch blocks ******************************************************************************/ @@ -1180,12 +1430,36 @@ ROM_START( cadd810 ) ROM_LOAD("wd_ide_bios_rev_2.0.bin",0x0000,0x2000, NO_DUMP) //missing: dump of hd controller ROM_END -/****************************** JUKO NEST true 16 bit variants (8086 and V30 *** +/**************************************** JUKO NEST N3 true 16 bit variants *** https://www.vogons.org/viewtopic.php?f=46&t=60077 https://sites.google.com/site/misterzeropage/ http://www.vcfed.org/forum/showthread.php?67127-Juko-nest-n3 +CPU: 8086 and V30, 4.77MHz/7.16MHz/10MHz hardware or software selectable +Bus: 8 ISA slots, dynamic bus speed control +RAM: 512K/640K/1MB on board, EMS 4.0 support (384K on board can be configured either as +RAMDISK in extended memory or EMS in expanded memory + +key commands: [Ctrl]-[Alt]-[1]/[2]/[3] to select CPU speed after running CONTROL.COM + +DIP switches: (SW3 to SW8 are autodetected by the NEST BIOS, they need to be set if another BIOS is used). +SWA: SW1 SW2 SW3 SW4 SW5 SW6 SW7 SW8 effect + --- reserved, ON/OFF don't matter + ON no 8087 + OFF 8087 present + ON ON 0KB memory size + OFF ON 512KB + ON OFF 640KB + OFF OFF 1MB + ON ON EGA + OFF ON CGA 40x25 + ON OFF CGA 80x25 + OFF OFF MDA + ON ON 1 diskette drive + OFF ON 2 + ON OFF 3 + OFF OFF 4 ******************************************************************************/ void pc_state::juko16(machine_config &config) @@ -1229,6 +1503,15 @@ ROM_END http://minuszerodegrees.net/xt_clone_bios/xt_clone_bios.htm +CPU: 8088, FPU socket provided +RAM: 27xKM41256AP-15 (768KB) +Bus: 5xISA +on board: 'Paradise' CGA (ROM not dumped), floppy controller (connector labelled DISC) (supporting 4 drives on the one connector), RTC + par(connector labelled PR), 2xser(connectors labelled ASYNC1 and ASYNC2), Light pen connector +OSC: 22.440000MHz, 14.31818, 16MHz, 1.8432MHz + +DIP switches: one block of 8 DIP switches + ******************************************************************************/ ROM_START( hyo88t ) @@ -1253,6 +1536,33 @@ Luggable machine with a 9" monochrome enhanced CGA display and an electrostatic ROM is identical between the Nixdorf and the Panasonic Displays "PIT1 ERROR" +CPU: Intel 8088 @ 4.77MHz +RAM: 256KB +Monitor: 9" amber +Bus: 2xISA +mass storage: 2xDSDD 5.25" +integrated thermal printer, 80/132 characters per line, Epson MX 80 compatible +on board: parallel port, serial port, RGB port for color monitor + +The version 8810/25 CPC has 256KB RAM on the mainboard, a harddisk and RAM can be expanded on the harddisk controller by 320/512KB +in addition to the DIP switches on the mainboard, DIP switches on the HD controller have to be set. + +DIP switches: 1 2 3 4 5 6 7 8 effect + ON OFF ON ON ON 128 KB RAM + ON OFF OFF ON ON 256 + ON ON ON OFF ON 320 + ON OFF ON OFF ON 384 + ON ON OFF OFF ON 448 + ON OFF OFF OFF ON 512 + ON ON ON ON OFF 576 + ON OFF ON ON OFF 640 + OFF 8087 present + ON 8087 absent + OFF 80 char/line + ON 40 char/line + OFF 1 FDD + ON 2 FDD + ******************************************************************************/ ROM_START( nixpc01 ) @@ -1265,6 +1575,8 @@ ROM_END Those use an Intel Wildcard 88, a XT computer sans slots and DRAM on a SIMM like module Chipset: Faraday FE2010A +0300-031F Clock port + ******************************************************************************/ ROM_START( ledgmodd ) @@ -1288,6 +1600,8 @@ acording to http://www.o3one.org/hwdocs/bios_doc/dosref22.html this machine had The "M" stood for a Mitsubishi made machine, the "Leading Edge Model D" was made by Daewoo Works with the "siemens" config, so instead of duplicating it until more is known we'll use that. +Interrupt 1Ah Time of Day, Function 02h, 03h, 04h, 05h are valid on the Model M + ******************************************************************************/ ROM_START( ledgmodm ) @@ -1304,6 +1618,8 @@ Circuit Cellar Project The ROMs are marked "Micromint MPX16 5/8 PC/Term 3/1/84" hangs on boot, maybe they are waiting for a serial connection +One block of eight DIP switches + ******************************************************************************/ ROM_START( mpx16 ) diff --git a/src/mame/drivers/pc1500.cpp b/src/mame/drivers/pc1500.cpp index e8985bc15f1..f36184f266b 100644 --- a/src/mame/drivers/pc1500.cpp +++ b/src/mame/drivers/pc1500.cpp @@ -274,7 +274,7 @@ void pc1500_state::pc1500_palette(palette_device &palette) const void pc1500_state::pc1500(machine_config &config) { - LH5801(config, m_maincpu, 1300000); // 1.3 MHz + LH5801(config, m_maincpu, 2.6_MHz_XTAL); // 1.3 MHz internally m_maincpu->set_addrmap(AS_PROGRAM, &pc1500_state::pc1500_mem); m_maincpu->set_addrmap(AS_IO, &pc1500_state::pc1500_mem_io); m_maincpu->in_func().set(FUNC(pc1500_state::pc1500_kb_r)); @@ -297,7 +297,7 @@ void pc1500_state::pc1500(machine_config &config) ioports.portc_w().set(FUNC(pc1500_state::port_c_w)); ioports.out_int().set_inputline("maincpu", LH5801_LINE_MI); - UPD1990A(config, m_rtc); + UPD1990A(config, m_rtc, 32.768_kHz_XTAL); } diff --git a/src/mame/drivers/pcfx.cpp b/src/mame/drivers/pcfx.cpp index 1af2bae8519..6a3e20ec232 100644 --- a/src/mame/drivers/pcfx.cpp +++ b/src/mame/drivers/pcfx.cpp @@ -455,7 +455,7 @@ void pcfx_state::pcfx(machine_config &config) huc6230_device &huc6230(HuC6230(config, "huc6230", XTAL(21'477'272))); huc6230.adpcm_update_cb<0>().set("huc6272", FUNC(huc6272_device::adpcm_update_0)); huc6230.adpcm_update_cb<1>().set("huc6272", FUNC(huc6272_device::adpcm_update_1)); - huc6230.cdda_cb().set("huc6272", FUNC(huc6272_device::cdda_update)); + huc6230.vca_callback().set("huc6272", FUNC(huc6272_device::cdda_update)); huc6230.add_route(0, "lspeaker", 1.0); huc6230.add_route(1, "rspeaker", 1.0); } diff --git a/src/mame/drivers/pgm.cpp b/src/mame/drivers/pgm.cpp index 20a0a4259b7..2d57288ec19 100644 --- a/src/mame/drivers/pgm.cpp +++ b/src/mame/drivers/pgm.cpp @@ -562,8 +562,8 @@ ROM_START( pgm ) ROM_REGION( 0x200000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ PGM_AUDIO_BIOS - ROM_REGION( 0x1000000, "sprcol", ROMREGION_ERASEFF ) /* Sprite Colour Data */ - ROM_REGION( 0x1000000, "sprmask", ROMREGION_ERASEFF ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprcol", ROMREGION_ERASEFF ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprmask", ROMREGION_ERASEFF ) /* Sprite Masks + Colour Indexes */ ROM_END ROM_START( orlegend ) @@ -575,7 +575,7 @@ ROM_START( orlegend ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -583,7 +583,7 @@ ROM_START( orlegend ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -602,7 +602,7 @@ ROM_START( orlegende ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -610,7 +610,7 @@ ROM_START( orlegende ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -629,7 +629,7 @@ ROM_START( orlegendc ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -637,7 +637,7 @@ ROM_START( orlegendc ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -656,7 +656,7 @@ ROM_START( orlegendca ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -664,7 +664,7 @@ ROM_START( orlegendca ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -718,7 +718,7 @@ ROM_START( orlegend111c ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -726,7 +726,7 @@ ROM_START( orlegend111c ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -749,7 +749,7 @@ ROM_START( orlegend111t ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -757,7 +757,7 @@ ROM_START( orlegend111t ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -779,7 +779,7 @@ ROM_START( orlegend111k ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -787,7 +787,7 @@ ROM_START( orlegend111k ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -840,7 +840,7 @@ ROM_START( orlegend105k ) PGM_VIDEO_BIOS ROM_LOAD( "t0100.u8", 0x180000, 0x400000, CRC(61425e1e) SHA1(20753b86fc12003cfd763d903f034dbba8010b32) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0100.u5", 0x0000000, 0x400000, CRC(8b3bd88a) SHA1(42db3a60c6ba9d83ebe2008c8047d094027f65a7) ) ROM_LOAD( "a0101.u6", 0x0400000, 0x400000, CRC(3b9e9644) SHA1(5b95ec1d25c3bc3504c93547f5adb5ce24376405) ) ROM_LOAD( "a0102.u7", 0x0800000, 0x400000, CRC(069e2c38) SHA1(9bddca8c2f5bd80f4abe4e1f062751736dc151dd) ) @@ -848,7 +848,7 @@ ROM_START( orlegend105k ) ROM_LOAD( "a0104.u11", 0x1000000, 0x400000, CRC(5f8abb56) SHA1(6c1ddc0309862a141aa0c0f63b641aec9257aaee) ) ROM_LOAD( "a0105.u12", 0x1400000, 0x400000, CRC(a17a7147) SHA1(44eeb43c6b0ebb829559a20ae357383fbdeecd82) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0100.u9", 0x0000000, 0x400000, CRC(69d2e48c) SHA1(5b5f759007264c07b3b39be8e03a713698e1fc2a) ) ROM_LOAD( "b0101.u10", 0x0400000, 0x400000, CRC(0d587bf3) SHA1(5347828b0a6e4ddd7a263663d2c2604407e4d49c) ) ROM_LOAD( "b0102.u15", 0x0800000, 0x400000, CRC(43823c1e) SHA1(e10a1a9a81b51b11044934ff702e35d8d7ab1b08) ) @@ -934,10 +934,10 @@ ROM_START( drgw2 ) PGM_VIDEO_BIOS ROM_LOAD( "pgmt0200.u7", 0x180000, 0x400000, CRC(b0f6534d) SHA1(174cacd81169a0e0d14790ac06d03caed737e05d) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "pgma0200.u5", 0x0000000, 0x400000, CRC(13b95069) SHA1(4888b06002afb18eab81c010e9362629045767af) ) - ROM_REGION( 0x400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "pgmb0200.u9", 0x0000000, 0x400000, CRC(932d0f13) SHA1(4b8e008f9c617cb2b95effeb81abc065b30e5c86) ) ROM_REGION( 0x400000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -953,10 +953,10 @@ ROM_START( dw2v100x ) PGM_VIDEO_BIOS ROM_LOAD( "pgmt0200.u7", 0x180000, 0x400000, CRC(b0f6534d) SHA1(174cacd81169a0e0d14790ac06d03caed737e05d) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "pgma0200.u5", 0x0000000, 0x400000, CRC(13b95069) SHA1(4888b06002afb18eab81c010e9362629045767af) ) - ROM_REGION( 0x400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "pgmb0200.u9", 0x0000000, 0x400000, CRC(932d0f13) SHA1(4b8e008f9c617cb2b95effeb81abc065b30e5c86) ) ROM_REGION( 0x400000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -972,10 +972,10 @@ ROM_START( drgw2c ) PGM_VIDEO_BIOS ROM_LOAD( "pgmt0200.u7", 0x180000, 0x400000, CRC(b0f6534d) SHA1(174cacd81169a0e0d14790ac06d03caed737e05d) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "pgma0200.u5", 0x0000000, 0x400000, CRC(13b95069) SHA1(4888b06002afb18eab81c010e9362629045767af) ) - ROM_REGION( 0x400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "pgmb0200.u9", 0x0000000, 0x400000, CRC(932d0f13) SHA1(4b8e008f9c617cb2b95effeb81abc065b30e5c86) ) ROM_REGION( 0x400000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -991,10 +991,10 @@ ROM_START( drgw2j ) PGM_VIDEO_BIOS ROM_LOAD( "pgmt0200.u7", 0x180000, 0x400000, CRC(b0f6534d) SHA1(174cacd81169a0e0d14790ac06d03caed737e05d) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "pgma0200.u5", 0x0000000, 0x400000, CRC(13b95069) SHA1(4888b06002afb18eab81c010e9362629045767af) ) - ROM_REGION( 0x400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "pgmb0200.u9", 0x0000000, 0x400000, CRC(932d0f13) SHA1(4b8e008f9c617cb2b95effeb81abc065b30e5c86) ) ROM_REGION( 0x400000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1010,10 +1010,10 @@ ROM_START( drgw2hk ) // the IGS025 has a "DRAGON-II 0004-1" sticker, the IGS012 PGM_VIDEO_BIOS ROM_LOAD( "pgmt0200.u7", 0x180000, 0x400000, CRC(b0f6534d) SHA1(174cacd81169a0e0d14790ac06d03caed737e05d) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "pgma0200.u5", 0x0000000, 0x400000, CRC(13b95069) SHA1(4888b06002afb18eab81c010e9362629045767af) ) - ROM_REGION( 0x400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0400000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "pgmb0200.u9", 0x0000000, 0x400000, CRC(932d0f13) SHA1(4b8e008f9c617cb2b95effeb81abc065b30e5c86) ) ROM_REGION( 0x400000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1049,11 +1049,11 @@ ROM_START( drgw3 ) PGM_VIDEO_BIOS ROM_LOAD( "dw3t0400.u18", 0x180000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "dw3a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "dw3a0401.u10", 0x0400000, 0x400000, CRC(cab6557f) SHA1(1904dd86645eea27ac1ab8a2462b20f6531356f8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "dw3b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1075,11 +1075,11 @@ ROM_START( drgw3105 ) PGM_VIDEO_BIOS ROM_LOAD( "dw3t0400.u18", 0x180000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "dw3a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "dw3a0401.u10", 0x0400000, 0x400000, CRC(cab6557f) SHA1(1904dd86645eea27ac1ab8a2462b20f6531356f8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "dw3b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1100,11 +1100,11 @@ ROM_START( drgw3103 ) PGM_VIDEO_BIOS ROM_LOAD( "dw3t0400.u18", 0x180000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "dw3a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "dw3a0401.u10", 0x0400000, 0x400000, CRC(cab6557f) SHA1(1904dd86645eea27ac1ab8a2462b20f6531356f8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "dw3b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1148,11 +1148,11 @@ ROM_START( drgw3100 ) PGM_VIDEO_BIOS ROM_LOAD( "dw3t0400.u18", 0x180000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "dw3a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "dw3a0401.u10", 0x0400000, 0x400000, CRC(cab6557f) SHA1(1904dd86645eea27ac1ab8a2462b20f6531356f8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "dw3b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1200,11 +1200,11 @@ ROM_START( dwex ) PGM_VIDEO_BIOS ROM_LOAD( "ex_t0400.u18", 0x180000, 0x200000, CRC(9ecc950d) SHA1(fd97f43818a3eb18254636166871fa09bd0d6c07) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "ex_a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) ROM_LOAD( "ex_a0401.u10", 0x0400000, 0x200000, CRC(d36c06a4) SHA1(f192e8bfdfbe3d82a49d8f0d3cb0603e39719773) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "ex_b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1225,11 +1225,11 @@ ROM_START( dwex101cn ) PGM_VIDEO_BIOS ROM_LOAD( "ex_t0400.u18", 0x180000, 0x200000, CRC(9ecc950d) SHA1(fd97f43818a3eb18254636166871fa09bd0d6c07) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "ex_a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) ROM_LOAD( "ex_a0401.u10", 0x0400000, 0x200000, CRC(d36c06a4) SHA1(f192e8bfdfbe3d82a49d8f0d3cb0603e39719773) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "ex_b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1250,13 +1250,13 @@ ROM_START( kov ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) @@ -1277,13 +1277,13 @@ ROM_START( kov115 ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) @@ -1339,13 +1339,13 @@ ROM_START( kov100 ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) @@ -1370,13 +1370,13 @@ ROM_START( kov100hk ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) @@ -1397,13 +1397,13 @@ ROM_START( kovplus ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) @@ -1460,13 +1460,13 @@ ROM_START( kovplusa ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) @@ -1487,13 +1487,13 @@ ROM_START( kovsgqyz ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "qyza0603.rom", 0x1800000, 0x0800000, CRC(c8b92220) SHA1(4f9c43970d92ac8a8f1563021022797ae8e32012) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "qyzb0601.rom", 0x0800000, 0x0800000, CRC(64f55882) SHA1(ab9ac1396587c3d78d06f6ec83cab61d6a9faacd) ) @@ -1514,13 +1514,13 @@ ROM_START( kovsgqyza ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "qyza0603.rom", 0x1800000, 0x0800000, CRC(c8b92220) SHA1(4f9c43970d92ac8a8f1563021022797ae8e32012) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "qyzb0601.rom", 0x0800000, 0x0800000, CRC(64f55882) SHA1(ab9ac1396587c3d78d06f6ec83cab61d6a9faacd) ) @@ -1541,13 +1541,13 @@ ROM_START( kovsgqyzb ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "qyza0603.rom", 0x1800000, 0x0800000, CRC(c8b92220) SHA1(4f9c43970d92ac8a8f1563021022797ae8e32012) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "qyzb0601.rom", 0x0800000, 0x0800000, CRC(64f55882) SHA1(ab9ac1396587c3d78d06f6ec83cab61d6a9faacd) ) @@ -1573,14 +1573,14 @@ ROM_START( kovsh ) ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) /* all roms below need checking to see if they're the same on this board */ - ROM_REGION( 0x1e00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) ROM_LOAD( "a0604.rom", 0x1a00000, 0x0400000, CRC(26b59fd3) SHA1(53219376056f4766dc5236735599d982ceb56b84) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) @@ -1603,14 +1603,14 @@ ROM_START( kovsh103 ) ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) /* all roms below need checking to see if they're the same on this board */ - ROM_REGION( 0x1e00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) ROM_LOAD( "a0604.rom", 0x1a00000, 0x0400000, CRC(26b59fd3) SHA1(53219376056f4766dc5236735599d982ceb56b84) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) // this dump had the same rom 4x bigger but with the data duplicated 4x, which is correct? @@ -1633,14 +1633,14 @@ ROM_START( kovsh102 ) ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) /* all roms below need checking to see if they're the same on this board */ - ROM_REGION( 0x1e00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) ROM_LOAD( "a0604.rom", 0x1a00000, 0x0400000, CRC(26b59fd3) SHA1(53219376056f4766dc5236735599d982ceb56b84) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) @@ -1663,14 +1663,14 @@ ROM_START( kovsh101 ) ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) /* all roms below need checking to see if they're the same on this board */ - ROM_REGION( 0x1e00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) ROM_LOAD( "a0604.rom", 0x1a00000, 0x0400000, CRC(26b59fd3) SHA1(53219376056f4766dc5236735599d982ceb56b84) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) @@ -1693,14 +1693,14 @@ ROM_START( kovsh100 ) ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) /* all roms below need checking to see if they're the same on this board */ - ROM_REGION( 0x1e00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603.rom", 0x1800000, 0x0400000, CRC(ec31abda) SHA1(ee526655369bae63b0ef0730e9768b765c9950fc) ) ROM_LOAD( "a0604.rom", 0x1a00000, 0x0400000, CRC(26b59fd3) SHA1(53219376056f4766dc5236735599d982ceb56b84) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) @@ -1723,12 +1723,12 @@ ROM_START( kovqhsgs ) ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) ROM_IGNORE( 0x800000 ) // second half identical - ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -1763,14 +1763,14 @@ ROM_START( photoy2k ) PGM_VIDEO_BIOS ROM_LOAD( "t0700.rom", 0x180000, 0x080000, CRC(93943b4d) SHA1(3b439903853727d45d62c781af6073024eb3c5a3) ) - ROM_REGION( 0x1080000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0700.l", 0x0000000, 0x0400000, CRC(26a9ae9c) SHA1(c977c89db6fdf47ee260ff687b80375caeab975c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0700.h", 0x0400000, 0x0400000, CRC(79bc1fc1) SHA1(a09472a9b75704c1d31ab828f92c2a5007b2b4ed) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.l", 0x0800000, 0x0400000, CRC(23607f81) SHA1(8b6dbcdce9b131370693847ed9771aa04b62711c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.h", 0x0c00000, 0x0400000, CRC(5f2efd37) SHA1(9a5bd9751691bc085b0751b9fa8ede9eb97b1248) ) ROM_LOAD( "a0702.rom", 0x1000000, 0x0080000, CRC(42239e1b) SHA1(2b6d20958abf8a67ce525d5c8964b6d225ccaeda) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0700.l", 0x0000000, 0x0400000, CRC(af096904) SHA1(8e86b36cc44720ece68022e409279bf9144341ba) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "b0700.h", 0x0400000, 0x0400000, CRC(6d53de26) SHA1(f3f93fd2f87adb815834ba0242b94073fbb5e333) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "cgv101.rom", 0x0800000, 0x0020000, CRC(da02ec3e) SHA1(7ee21d748c9b932f53e790a9040167f904fecefc) ) @@ -1793,14 +1793,14 @@ ROM_START( photoy2k104 ) PGM_VIDEO_BIOS ROM_LOAD( "t0700.rom", 0x180000, 0x080000, CRC(93943b4d) SHA1(3b439903853727d45d62c781af6073024eb3c5a3) ) - ROM_REGION( 0x1080000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0700.l", 0x0000000, 0x0400000, CRC(26a9ae9c) SHA1(c977c89db6fdf47ee260ff687b80375caeab975c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0700.h", 0x0400000, 0x0400000, CRC(79bc1fc1) SHA1(a09472a9b75704c1d31ab828f92c2a5007b2b4ed) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.l", 0x0800000, 0x0400000, CRC(23607f81) SHA1(8b6dbcdce9b131370693847ed9771aa04b62711c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.h", 0x0c00000, 0x0400000, CRC(5f2efd37) SHA1(9a5bd9751691bc085b0751b9fa8ede9eb97b1248) ) ROM_LOAD( "a0702.rom", 0x1000000, 0x0080000, CRC(42239e1b) SHA1(2b6d20958abf8a67ce525d5c8964b6d225ccaeda) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0700.l", 0x0000000, 0x0400000, CRC(af096904) SHA1(8e86b36cc44720ece68022e409279bf9144341ba) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "b0700.h", 0x0400000, 0x0400000, CRC(6d53de26) SHA1(f3f93fd2f87adb815834ba0242b94073fbb5e333) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "cgv101.rom", 0x0800000, 0x0020000, CRC(da02ec3e) SHA1(7ee21d748c9b932f53e790a9040167f904fecefc) ) @@ -1826,14 +1826,14 @@ ROM_START( photoy2k103j ) PGM_VIDEO_BIOS ROM_LOAD( "t0700.rom", 0x180000, 0x080000, CRC(93943b4d) SHA1(3b439903853727d45d62c781af6073024eb3c5a3) ) - ROM_REGION( 0x1080000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0700.l", 0x0000000, 0x0400000, CRC(26a9ae9c) SHA1(c977c89db6fdf47ee260ff687b80375caeab975c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0700.h", 0x0400000, 0x0400000, CRC(79bc1fc1) SHA1(a09472a9b75704c1d31ab828f92c2a5007b2b4ed) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.l", 0x0800000, 0x0400000, CRC(23607f81) SHA1(8b6dbcdce9b131370693847ed9771aa04b62711c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.h", 0x0c00000, 0x0400000, CRC(5f2efd37) SHA1(9a5bd9751691bc085b0751b9fa8ede9eb97b1248) ) ROM_LOAD( "a0702.rom", 0x1000000, 0x0080000, CRC(42239e1b) SHA1(2b6d20958abf8a67ce525d5c8964b6d225ccaeda) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0700.l", 0x0000000, 0x0400000, CRC(af096904) SHA1(8e86b36cc44720ece68022e409279bf9144341ba) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "b0700.h", 0x0400000, 0x0400000, CRC(6d53de26) SHA1(f3f93fd2f87adb815834ba0242b94073fbb5e333) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "cgv101.rom", 0x0800000, 0x0020000, CRC(da02ec3e) SHA1(7ee21d748c9b932f53e790a9040167f904fecefc) ) @@ -1889,14 +1889,14 @@ ROM_START( photoy2k102 ) PGM_VIDEO_BIOS ROM_LOAD( "t0700.rom", 0x180000, 0x080000, CRC(93943b4d) SHA1(3b439903853727d45d62c781af6073024eb3c5a3) ) - ROM_REGION( 0x1080000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0700.l", 0x0000000, 0x0400000, CRC(26a9ae9c) SHA1(c977c89db6fdf47ee260ff687b80375caeab975c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0700.h", 0x0400000, 0x0400000, CRC(79bc1fc1) SHA1(a09472a9b75704c1d31ab828f92c2a5007b2b4ed) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.l", 0x0800000, 0x0400000, CRC(23607f81) SHA1(8b6dbcdce9b131370693847ed9771aa04b62711c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0701.h", 0x0c00000, 0x0400000, CRC(5f2efd37) SHA1(9a5bd9751691bc085b0751b9fa8ede9eb97b1248) ) ROM_LOAD( "a0702.rom", 0x1000000, 0x0080000, CRC(42239e1b) SHA1(2b6d20958abf8a67ce525d5c8964b6d225ccaeda) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0700.l", 0x0000000, 0x0400000, CRC(af096904) SHA1(8e86b36cc44720ece68022e409279bf9144341ba) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "b0700.h", 0x0400000, 0x0400000, CRC(6d53de26) SHA1(f3f93fd2f87adb815834ba0242b94073fbb5e333) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "cgv101.rom", 0x0800000, 0x0020000, CRC(da02ec3e) SHA1(7ee21d748c9b932f53e790a9040167f904fecefc) ) @@ -1938,13 +1938,13 @@ ROM_START( py2k2 ) PGM_VIDEO_BIOS /* no extra tilemap rom */ - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "y2k2_a1100.u6", 0x0000000, 0x0800000, CRC(e32ce499) SHA1(f84c7daa55c25a05da467b5654ebf432b7ce1754) ) ROM_LOAD( "y2k2_a1101.u7", 0x0800000, 0x0800000, CRC(4e7568bc) SHA1(bf9cc453191bd5ec9fbcce62891809f253a44267) ) ROM_LOAD( "y2k2_a1102.u8", 0x1000000, 0x0800000, CRC(6da7c143) SHA1(9408ba7722bfc8013f851aadea5e2819f5263129) ) ROM_LOAD( "y2k2_a1103.u9", 0x1800000, 0x0800000, CRC(0ebebfdc) SHA1(4faad7f97c7e734f179ec934a37e75d8d6adccf4) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "y2k2_b1100.u4", 0x0000000, 0x0800000, CRC(fa53d6f6) SHA1(c2da55f4b7e721fa1c63bd7f9528f261643164e8) ) ROM_LOAD( "y2k2_b1101.u5", 0x0800000, 0x0800000, CRC(001e4c81) SHA1(21119055f8fd7f831529e73ff9c97bca3987a1dc)) @@ -1965,13 +1965,13 @@ ROM_START( py2k2100 ) PGM_VIDEO_BIOS /* no extra tilemap rom */ - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "y2k2_a1100.u6", 0x0000000, 0x0800000, CRC(e32ce499) SHA1(f84c7daa55c25a05da467b5654ebf432b7ce1754) ) ROM_LOAD( "y2k2_a1101.u7", 0x0800000, 0x0800000, CRC(4e7568bc) SHA1(bf9cc453191bd5ec9fbcce62891809f253a44267) ) ROM_LOAD( "y2k2_a1102.u8", 0x1000000, 0x0800000, CRC(6da7c143) SHA1(9408ba7722bfc8013f851aadea5e2819f5263129) ) ROM_LOAD( "y2k2_a1103.u9", 0x1800000, 0x0800000, CRC(0ebebfdc) SHA1(4faad7f97c7e734f179ec934a37e75d8d6adccf4) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "y2k2_b1100.u4", 0x0000000, 0x0800000, CRC(fa53d6f6) SHA1(c2da55f4b7e721fa1c63bd7f9528f261643164e8) ) ROM_LOAD( "y2k2_b1101.u5", 0x0800000, 0x0800000, CRC(001e4c81) SHA1(21119055f8fd7f831529e73ff9c97bca3987a1dc)) @@ -1995,14 +1995,14 @@ ROM_START( pgm3in1 ) PGM_VIDEO_BIOS ROM_LOAD( "u5.u5", 0x180000, 0x200000, CRC(da375a50) SHA1(62cd2fd3dfc1897528eaa38d243d7a9526eac71b) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "pgm_a1100.u4", 0x0000000, 0x0800000, CRC(e32ce499) SHA1(f84c7daa55c25a05da467b5654ebf432b7ce1754) ) // == y2k2_a1100.u6 ROM_LOAD( "pgm_a1101.u5", 0x0800000, 0x0800000, CRC(4e7568bc) SHA1(bf9cc453191bd5ec9fbcce62891809f253a44267) ) // == y2k2_a1101.u7 ROM_LOAD( "pgm_a1102.u6", 0x1000000, 0x0800000, CRC(6da7c143) SHA1(9408ba7722bfc8013f851aadea5e2819f5263129) ) // == y2k2_a1102.u8 ROM_LOAD( "pgm_a1103.u7", 0x1800000, 0x0800000, CRC(0ebebfdc) SHA1(4faad7f97c7e734f179ec934a37e75d8d6adccf4) ) // == y2k2_a1103.u9 ROM_LOAD( "ext_bit_cg.u20", 0x2000000, 0x0400000, CRC(fe314754) SHA1(ae3e8bbdce852a3fa39806a5221c053dee5abfd4) ) - ROM_REGION( 0x1000000, "sprmask", ROMREGION_ERASE00 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", ROMREGION_ERASE00 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "pgm_b1100.u8", 0x0000000, 0x0800000, CRC(fa53d6f6) SHA1(c2da55f4b7e721fa1c63bd7f9528f261643164e8) ) // == y2k2_b1100.u4 ROM_LOAD( "pgm_b1101.u9", 0x0800000, 0x0800000, CRC(001e4c81) SHA1(21119055f8fd7f831529e73ff9c97bca3987a1dc) ) // == y2k2_b1101.u5 ROM_LOAD( "ext_bit_map.u21", 0x0f00000, 0x0100000, CRC(fe31dca6) SHA1(825bab7342c944794514fc7fe3e41779de3b5cd4) ) // yes this loads over the empty part of u9 @@ -2108,7 +2108,7 @@ ROM_START( killbld ) PGM_VIDEO_BIOS ROM_LOAD( "t0300.u14", 0x180000, 0x400000, CRC(0922f7d9) SHA1(4302b4b7369e13f315fad14f7d6cad1321101d24) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0300.u9", 0x0000000, 0x0400000, CRC(3f9455d3) SHA1(3718ce00ad93975383aafc14e5a74dc297b011a1) ) ROM_LOAD( "a0301.u10", 0x0400000, 0x0400000, CRC(92776889) SHA1(6d677837fefff47bfd1c6166322f69f89989a5e2) ) ROM_LOAD( "a0303.u11", 0x0800000, 0x0400000, CRC(33f5cc69) SHA1(9cacd5058d4bb25b77f71658bbbbd4b38d0a6b6a) ) @@ -2118,7 +2118,7 @@ ROM_START( killbld ) // ROM_LOAD( "a0304.u4", 0x1600000, 0x0200000, CRC(3096de1c) SHA1(d010990d21cfda9cb8ab5b4bc0e329c23b7719f5) ) // from lord of gun! unused.. // ROM_LOAD( "a0305.u5", 0x1800000, 0x0200000, CRC(2234531e) SHA1(58a82e31a1c0c1a4dd026576319f4e7ecffd140e) ) // from lord of gun! unused.. - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0300.u13", 0x0000000, 0x0400000, CRC(7f876981) SHA1(43555a200929ad5ecc42137fc9aeb42dc4f50d20) ) ROM_LOAD( "b0302.u14", 0x0400000, 0x0400000, CRC(eea9c502) SHA1(04b3972c7111ea59a3cceab6ad124080c4ce3520) ) ROM_LOAD( "b0303.u15", 0x0800000, 0x0200000, CRC(77a9652e) SHA1(2342f643d37945fbda224a5034c013796e5134ca) ) @@ -2144,7 +2144,7 @@ ROM_START( killbld104 ) PGM_VIDEO_BIOS ROM_LOAD( "t0300.u14", 0x180000, 0x400000, CRC(0922f7d9) SHA1(4302b4b7369e13f315fad14f7d6cad1321101d24) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0300.u9", 0x0000000, 0x0400000, CRC(3f9455d3) SHA1(3718ce00ad93975383aafc14e5a74dc297b011a1) ) ROM_LOAD( "a0301.u10", 0x0400000, 0x0400000, CRC(92776889) SHA1(6d677837fefff47bfd1c6166322f69f89989a5e2) ) ROM_LOAD( "a0303.u11", 0x0800000, 0x0400000, CRC(33f5cc69) SHA1(9cacd5058d4bb25b77f71658bbbbd4b38d0a6b6a) ) @@ -2154,7 +2154,7 @@ ROM_START( killbld104 ) // ROM_LOAD( "a0304.u4", 0x1600000, 0x0200000, CRC(3096de1c) SHA1(d010990d21cfda9cb8ab5b4bc0e329c23b7719f5) ) // from lord of gun! unused.. // ROM_LOAD( "a0305.u5", 0x1800000, 0x0200000, CRC(2234531e) SHA1(58a82e31a1c0c1a4dd026576319f4e7ecffd140e) ) // from lord of gun! unused.. - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0300.u13", 0x0000000, 0x0400000, CRC(7f876981) SHA1(43555a200929ad5ecc42137fc9aeb42dc4f50d20) ) ROM_LOAD( "b0302.u14", 0x0400000, 0x0400000, CRC(eea9c502) SHA1(04b3972c7111ea59a3cceab6ad124080c4ce3520) ) ROM_LOAD( "b0303.u15", 0x0800000, 0x0200000, CRC(77a9652e) SHA1(2342f643d37945fbda224a5034c013796e5134ca) ) @@ -2180,7 +2180,7 @@ ROM_START( killbld106 ) PGM_VIDEO_BIOS ROM_LOAD( "t0300.u14", 0x180000, 0x400000, CRC(0922f7d9) SHA1(4302b4b7369e13f315fad14f7d6cad1321101d24) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0300.u9", 0x0000000, 0x0400000, CRC(3f9455d3) SHA1(3718ce00ad93975383aafc14e5a74dc297b011a1) ) ROM_LOAD( "a0301.u10", 0x0400000, 0x0400000, CRC(92776889) SHA1(6d677837fefff47bfd1c6166322f69f89989a5e2) ) ROM_LOAD( "a0303.u11", 0x0800000, 0x0400000, CRC(33f5cc69) SHA1(9cacd5058d4bb25b77f71658bbbbd4b38d0a6b6a) ) @@ -2190,7 +2190,7 @@ ROM_START( killbld106 ) // ROM_LOAD( "a0304.u4", 0x1600000, 0x0200000, CRC(3096de1c) SHA1(d010990d21cfda9cb8ab5b4bc0e329c23b7719f5) ) // from lord of gun! unused.. // ROM_LOAD( "a0305.u5", 0x1800000, 0x0200000, CRC(2234531e) SHA1(58a82e31a1c0c1a4dd026576319f4e7ecffd140e) ) // from lord of gun! unused.. - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0300.u13", 0x0000000, 0x0400000, CRC(7f876981) SHA1(43555a200929ad5ecc42137fc9aeb42dc4f50d20) ) ROM_LOAD( "b0302.u14", 0x0400000, 0x0400000, CRC(eea9c502) SHA1(04b3972c7111ea59a3cceab6ad124080c4ce3520) ) ROM_LOAD( "b0303.u15", 0x0800000, 0x0200000, CRC(77a9652e) SHA1(2342f643d37945fbda224a5034c013796e5134ca) ) @@ -2268,10 +2268,10 @@ ROM_START( puzlstar ) PGM_VIDEO_BIOS ROM_LOAD( "t0800.u5", 0x180000, 0x200000, CRC(f9d84e59) SHA1(80ec77025ac5bf355b1a60f2a678dd4c56071f6b) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0800.u1", 0x0000000, 0x0400000, CRC(e1e6ec40) SHA1(390432431f144ef63424a426582b311765a61771) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0800.u3", 0x0000000, 0x0200000, CRC(52e7bef5) SHA1(a678251b7e46a1016d0afc1d8d5c9928008ad5b1) ) ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -2349,7 +2349,7 @@ ROM_START( olds103t ) ROM_LOAD( "t0500.rom", 0x180000, 0x400000, CRC(d881726c) SHA1(a82517e665996f7b7017c940f1fcf016fccb65c2) ) ROM_LOAD( "t0501.rom", 0x580000, 0x200000, CRC(d2106864) SHA1(65d827135b87d82196433aea3279608ee263feca) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0500.rom", 0x0000000, 0x400000, CRC(80a59197) SHA1(7d0108e2f0d0347d43ace2d96c0388202c05fdfb) ) ROM_LOAD( "a0501.rom", 0x0400000, 0x400000, CRC(98c931b1) SHA1(9b70d1a7beb4c3a0c1436c25fd1fb76e47539538) ) ROM_LOAD( "a0502.rom", 0x0800000, 0x400000, CRC(c3fcdf1d) SHA1(107585fd103fcd0af0fb7db283be4f7c7058aef7) ) @@ -2358,7 +2358,7 @@ ROM_START( olds103t ) ROM_LOAD( "a0505.rom", 0x1400000, 0x400000, CRC(5b8cf3a5) SHA1(856d1e47b5d9a66dcfbdc74a51ed646fd7d96a35) ) ROM_LOAD( "a0506.rom", 0x1800000, 0x400000, CRC(087ac60c) SHA1(3d5bf7dd40c8a3c1224cf82e12410ca904c0c5db) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0500.rom", 0x0000000, 0x400000, CRC(cde07f74) SHA1(1fe90db7c57faa28f3a054b2c07909bef89e3efb) ) ROM_LOAD( "b0501.rom", 0x0400000, 0x400000, CRC(1546c2e9) SHA1(a7b9c8b44203db54a59d49fe469bb52bba807ba2) ) ROM_LOAD( "b0502.rom", 0x0800000, 0x400000, CRC(e97b31c3) SHA1(1a7ca4f6c8644e84a33ae41cd4637f21046b14c5) ) @@ -2390,7 +2390,7 @@ ROM_START( olds ) ROM_LOAD( "t0500.rom", 0x180000, 0x400000, CRC(d881726c) SHA1(a82517e665996f7b7017c940f1fcf016fccb65c2) ) ROM_LOAD( "t0501.rom", 0x580000, 0x200000, CRC(d2106864) SHA1(65d827135b87d82196433aea3279608ee263feca) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0500.rom", 0x0000000, 0x400000, CRC(80a59197) SHA1(7d0108e2f0d0347d43ace2d96c0388202c05fdfb) ) ROM_LOAD( "a0501.rom", 0x0400000, 0x400000, CRC(98c931b1) SHA1(9b70d1a7beb4c3a0c1436c25fd1fb76e47539538) ) ROM_LOAD( "a0502.rom", 0x0800000, 0x400000, CRC(c3fcdf1d) SHA1(107585fd103fcd0af0fb7db283be4f7c7058aef7) ) @@ -2399,13 +2399,12 @@ ROM_START( olds ) ROM_LOAD( "a0505.rom", 0x1400000, 0x400000, CRC(5b8cf3a5) SHA1(856d1e47b5d9a66dcfbdc74a51ed646fd7d96a35) ) ROM_LOAD( "a0506.rom", 0x1800000, 0x400000, CRC(087ac60c) SHA1(3d5bf7dd40c8a3c1224cf82e12410ca904c0c5db) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0500.rom", 0x0000000, 0x400000, CRC(cde07f74) SHA1(1fe90db7c57faa28f3a054b2c07909bef89e3efb) ) ROM_LOAD( "b0501.rom", 0x0400000, 0x400000, CRC(1546c2e9) SHA1(a7b9c8b44203db54a59d49fe469bb52bba807ba2) ) ROM_LOAD( "b0502.rom", 0x0800000, 0x400000, CRC(e97b31c3) SHA1(1a7ca4f6c8644e84a33ae41cd4637f21046b14c5) ) ROM_LOAD( "b0503.u16", 0x0c00000, 0x400000, CRC(e41d98e4) SHA1(f80b27fcee81762993e09bf1b3cad6e85274760c) ) - ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ PGM_AUDIO_BIOS ROM_LOAD( "m0500.rom", 0x400000, 0x200000, CRC(37928cdd) SHA1(e80498cabc2a6a54d4f3ebcb097d4b3fad96fe55) ) @@ -2432,7 +2431,7 @@ ROM_START( olds100 ) ROM_LOAD( "t0500.rom", 0x180000, 0x400000, CRC(d881726c) SHA1(a82517e665996f7b7017c940f1fcf016fccb65c2) ) ROM_LOAD( "t0501.rom", 0x580000, 0x200000, CRC(d2106864) SHA1(65d827135b87d82196433aea3279608ee263feca) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0500.rom", 0x0000000, 0x400000, CRC(80a59197) SHA1(7d0108e2f0d0347d43ace2d96c0388202c05fdfb) ) ROM_LOAD( "a0501.rom", 0x0400000, 0x400000, CRC(98c931b1) SHA1(9b70d1a7beb4c3a0c1436c25fd1fb76e47539538) ) ROM_LOAD( "a0502.rom", 0x0800000, 0x400000, CRC(c3fcdf1d) SHA1(107585fd103fcd0af0fb7db283be4f7c7058aef7) ) @@ -2441,7 +2440,7 @@ ROM_START( olds100 ) ROM_LOAD( "a0505.rom", 0x1400000, 0x400000, CRC(5b8cf3a5) SHA1(856d1e47b5d9a66dcfbdc74a51ed646fd7d96a35) ) ROM_LOAD( "a0506.rom", 0x1800000, 0x400000, CRC(087ac60c) SHA1(3d5bf7dd40c8a3c1224cf82e12410ca904c0c5db) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0500.rom", 0x0000000, 0x400000, CRC(cde07f74) SHA1(1fe90db7c57faa28f3a054b2c07909bef89e3efb) ) ROM_LOAD( "b0501.rom", 0x0400000, 0x400000, CRC(1546c2e9) SHA1(a7b9c8b44203db54a59d49fe469bb52bba807ba2) ) ROM_LOAD( "b0502.rom", 0x0800000, 0x400000, CRC(e97b31c3) SHA1(1a7ca4f6c8644e84a33ae41cd4637f21046b14c5) ) @@ -2471,7 +2470,7 @@ ROM_START( olds100a ) ROM_LOAD( "t0500.rom", 0x180000, 0x400000, CRC(d881726c) SHA1(a82517e665996f7b7017c940f1fcf016fccb65c2) ) ROM_LOAD( "t0501.rom", 0x580000, 0x200000, CRC(d2106864) SHA1(65d827135b87d82196433aea3279608ee263feca) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0500.rom", 0x0000000, 0x400000, CRC(80a59197) SHA1(7d0108e2f0d0347d43ace2d96c0388202c05fdfb) ) ROM_LOAD( "a0501.rom", 0x0400000, 0x400000, CRC(98c931b1) SHA1(9b70d1a7beb4c3a0c1436c25fd1fb76e47539538) ) ROM_LOAD( "a0502.rom", 0x0800000, 0x400000, CRC(c3fcdf1d) SHA1(107585fd103fcd0af0fb7db283be4f7c7058aef7) ) @@ -2480,7 +2479,7 @@ ROM_START( olds100a ) ROM_LOAD( "a0505.rom", 0x1400000, 0x400000, CRC(5b8cf3a5) SHA1(856d1e47b5d9a66dcfbdc74a51ed646fd7d96a35) ) ROM_LOAD( "a0506.rom", 0x1800000, 0x400000, CRC(087ac60c) SHA1(3d5bf7dd40c8a3c1224cf82e12410ca904c0c5db) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0500.rom", 0x0000000, 0x400000, CRC(cde07f74) SHA1(1fe90db7c57faa28f3a054b2c07909bef89e3efb) ) ROM_LOAD( "b0501.rom", 0x0400000, 0x400000, CRC(1546c2e9) SHA1(a7b9c8b44203db54a59d49fe469bb52bba807ba2) ) ROM_LOAD( "b0502.rom", 0x0800000, 0x400000, CRC(e97b31c3) SHA1(1a7ca4f6c8644e84a33ae41cd4637f21046b14c5) ) @@ -2507,14 +2506,14 @@ ROM_START( kov2 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2522,6 +2521,7 @@ ROM_START( kov2 ) PGM_AUDIO_BIOS ROM_LOAD( "m1200.rom", 0x800000, 0x800000, CRC(b0d88720) SHA1(44ab137e3f8e15b7cb5697ffbd9b1143d8210c4f) ) ROM_END + ROM_START( kov2106 ) ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ PGM_68K_BIOS @@ -2537,14 +2537,14 @@ ROM_START( kov2106 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2568,14 +2568,14 @@ ROM_START( kov2104 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2599,14 +2599,14 @@ ROM_START( kov2103 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2630,14 +2630,14 @@ ROM_START( kov2102 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2661,14 +2661,14 @@ ROM_START( kov2101 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2692,14 +2692,14 @@ ROM_START( kov2100 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2724,14 +2724,14 @@ ROM_START( kov2p ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2755,14 +2755,14 @@ ROM_START( kov2p204 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2786,14 +2786,14 @@ ROM_START( kov2p202 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2817,14 +2817,14 @@ ROM_START( kov2p200 ) PGM_VIDEO_BIOS ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) ROM_LOAD( "a1204.rom", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) @@ -2883,10 +2883,10 @@ Some logic IC's, resistors, caps etc. ROM_REGION( 0xa00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ \ PGM_VIDEO_BIOS \ ROM_LOAD( "t1300.u21", 0x180000, 0x800000, CRC(e748f0cb) SHA1(5843bee3a17c33648ce904af2b98c6a90aff7393) ) \ - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ \ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ \ ROM_LOAD( "a1300.u1", 0x0000000, 0x0800000, CRC(fc87a405) SHA1(115c21ecc56997652e527c92654076870bc9fa51) ) /* FIXED BITS (xxxxxxxx1xxxxxxx) */ \ ROM_LOAD( "a1301.u2", 0x0800000, 0x0800000, CRC(0c8520da) SHA1(390317857ae5baa94a4cc042874b00a811f06a63) ) /* FIXED BITS (xxxxxxxx1xxxxxxx) */ \ - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ \ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ \ ROM_LOAD( "b1300.u7", 0x0000000, 0x0800000, CRC(ef646604) SHA1(d737ff513792962f18df88c2caa9dd71de449079) ) \ ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ \ PGM_AUDIO_BIOS \ @@ -3055,11 +3055,11 @@ ROM_START( dw2001 ) PGM_VIDEO_BIOS ROM_LOAD( "2001.u11", 0x180000, 0x200000, CRC(b27cf093) SHA1(7c5736a3d72b89742da1c92b2604d66e48b95e56) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "2001.u2", 0x000000, 0x200000, CRC(d11c733c) SHA1(8faad32e8e215631a2263bdd51a9ae434540d028) ) ROM_LOAD( "2001.u3", 0x200000, 0x200000, CRC(1435aef2) SHA1(582eb9f6415c89418401be7ebad041adeb600515) ) - ROM_REGION( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "2001.u9", 0x000000, 0x200000, CRC(ccbca572) SHA1(4d3512e82cb65e5cdfcc6cb18deec9f4a6dd350a) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3083,11 +3083,11 @@ ROM_START( dwpc ) PGM_VIDEO_BIOS ROM_LOAD( "dwpc_v100jp.u11", 0x180000, 0x400000, CRC(3aa5a787) SHA1(ef7bb83f7141b24621c86237244fd9f280923ed1) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "dwpc_v100jp.u2", 0x000000, 0x200000, CRC(e7115763) SHA1(f1bf06e9434a3b962166849f51b9dc3a74d7f2a4) ) ROM_LOAD( "dwpc_v100jp.u3", 0x200000, 0x200000, CRC(49c184a4) SHA1(320504adf596c38db56247e9cef02e7c7a363ccb) ) - ROM_REGION( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "dwpc_v100jp.u9", 0x000000, 0x200000, CRC(412b9913) SHA1(52fc42a966575e02991aa92382b855744f44854a) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3161,10 +3161,10 @@ ROM_START( puzzli2 ) PGM_VIDEO_BIOS ROM_LOAD( "t0900.u9", 0x180000, 0x200000, CRC(70615611) SHA1(a46d4aa71396947b427f9ba4ba0e636876c09d6b) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0900.u3", 0x0000000, 0x0400000, CRC(14911251) SHA1(e0d10ef50c408dbcf0907f81d4f0e49aeb651a6c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) - ROM_REGION( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0900.u4", 0x0000000, 0x0200000, CRC(6f0638b6) SHA1(14b315fe9e80b3314bb63487e6ea9ce04c9703bd) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3186,10 +3186,10 @@ ROM_START( puzzli2s ) PGM_VIDEO_BIOS ROM_LOAD( "t0900.u9", 0x180000, 0x200000, CRC(70615611) SHA1(a46d4aa71396947b427f9ba4ba0e636876c09d6b) ) - ROM_REGION( 0x400000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x0400000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0900.u3", 0x0000000, 0x0400000, CRC(14911251) SHA1(e0d10ef50c408dbcf0907f81d4f0e49aeb651a6c) ) // FIXED BITS (xxxxxxxx1xxxxxxx) - ROM_REGION( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0200000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0900.u4", 0x0000000, 0x0200000, CRC(6f0638b6) SHA1(14b315fe9e80b3314bb63487e6ea9ce04c9703bd) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3272,14 +3272,14 @@ ROM_START( martmast ) PGM_VIDEO_BIOS ROM_LOAD( "t1000.u3", 0x180000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1000.u3", 0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) ) ROM_LOAD( "a1001.u4", 0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) ) ROM_LOAD( "a1002.u6", 0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) ) ROM_LOAD( "a1003.u8", 0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) ) ROM_LOAD( "a1004.u10", 0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1000.u9", 0x0000000, 0x0800000, CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) ) ROM_LOAD( "b1001.u11", 0x0800000, 0x0800000, CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) ) @@ -3304,14 +3304,14 @@ ROM_START( martmastc ) PGM_VIDEO_BIOS ROM_LOAD( "t1000.u3", 0x180000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1000.u3", 0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) ) ROM_LOAD( "a1001.u4", 0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) ) ROM_LOAD( "a1002.u6", 0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) ) ROM_LOAD( "a1003.u8", 0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) ) ROM_LOAD( "a1004.u10", 0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1000.u9", 0x0000000, 0x0800000, CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) ) ROM_LOAD( "b1001.u11", 0x0800000, 0x0800000, CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) ) @@ -3336,14 +3336,14 @@ ROM_START( martmastc103 ) PGM_VIDEO_BIOS ROM_LOAD( "t1000.u3", 0x180000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1000.u3", 0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) ) ROM_LOAD( "a1001.u4", 0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) ) ROM_LOAD( "a1002.u6", 0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) ) ROM_LOAD( "a1003.u8", 0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) ) ROM_LOAD( "a1004.u10", 0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1000.u9", 0x0000000, 0x0800000, CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) ) ROM_LOAD( "b1001.u11", 0x0800000, 0x0800000, CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) ) @@ -3368,14 +3368,14 @@ ROM_START( martmastc102 ) PGM_VIDEO_BIOS ROM_LOAD( "t1000.u3", 0x180000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1000.u3", 0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) ) ROM_LOAD( "a1001.u4", 0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) ) ROM_LOAD( "a1002.u6", 0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) ) ROM_LOAD( "a1003.u8", 0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) ) ROM_LOAD( "a1004.u10", 0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1000.u9", 0x0000000, 0x0800000, CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) ) ROM_LOAD( "b1001.u11", 0x0800000, 0x0800000, CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) ) @@ -3406,14 +3406,14 @@ ROM_START( martmasttw ) PGM_VIDEO_BIOS ROM_LOAD( "t1000.u3", 0x180000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) ) - ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a1000.u3", 0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) ) ROM_LOAD( "a1001.u4", 0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) ) ROM_LOAD( "a1002.u6", 0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) ) ROM_LOAD( "a1003.u8", 0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) ) ROM_LOAD( "a1004.u10", 0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b1000.u9", 0x0000000, 0x0800000, CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) ) ROM_LOAD( "b1001.u11", 0x0800000, 0x0800000, CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) ) @@ -3489,12 +3489,12 @@ ROM_START( dmnfrnt ) PGM_VIDEO_BIOS ROM_LOAD( "t04501.u29", 0x180000, 0x800000, CRC(900eaaac) SHA1(4033cb7b28fcadb92d5af3ea7fdd1c22747618fd) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04501.u3", 0x0000000, 0x0800000, CRC(9741bea6) SHA1(e3e904249be228628c8c2bd3495cda23586dc048) ) ROM_LOAD( "a04502.u4", 0x0800000, 0x0800000, CRC(e104f405) SHA1(124b3deed3e838f8bae6c7d78bdd788859597585) ) ROM_LOAD( "a04503.u6", 0x1000000, 0x0800000, CRC(bfd5cfe3) SHA1(fbe4c0a2987c2036df707b86597d78124ee2e665) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04501.u9", 0x0000000, 0x0800000, CRC(29320b7d) SHA1(59c78805e666f912df201c34616744f46057937b) ) ROM_LOAD( "b04502.u11", 0x0800000, 0x0200000, CRC(578c00e9) SHA1(14235cc8b0f8c7dd659512f017a2d4aacd91d89d) ) @@ -3518,12 +3518,12 @@ ROM_START( dmnfrnta ) PGM_VIDEO_BIOS ROM_LOAD( "t04501.u29", 0x180000, 0x800000, CRC(900eaaac) SHA1(4033cb7b28fcadb92d5af3ea7fdd1c22747618fd) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04501.u3", 0x0000000, 0x0800000, CRC(9741bea6) SHA1(e3e904249be228628c8c2bd3495cda23586dc048) ) ROM_LOAD( "a04502.u4", 0x0800000, 0x0800000, CRC(e104f405) SHA1(124b3deed3e838f8bae6c7d78bdd788859597585) ) ROM_LOAD( "a04503.u6", 0x1000000, 0x0800000, CRC(bfd5cfe3) SHA1(fbe4c0a2987c2036df707b86597d78124ee2e665) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04501.u9", 0x0000000, 0x0800000, CRC(29320b7d) SHA1(59c78805e666f912df201c34616744f46057937b) ) ROM_LOAD( "b04502.u11", 0x0800000, 0x0200000, CRC(578c00e9) SHA1(14235cc8b0f8c7dd659512f017a2d4aacd91d89d) ) @@ -3548,12 +3548,12 @@ ROM_START( dmnfrntb ) PGM_VIDEO_BIOS ROM_LOAD( "t04501.u29", 0x180000, 0x800000, CRC(900eaaac) SHA1(4033cb7b28fcadb92d5af3ea7fdd1c22747618fd) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04501.u3", 0x0000000, 0x0800000, CRC(9741bea6) SHA1(e3e904249be228628c8c2bd3495cda23586dc048) ) ROM_LOAD( "a04502.u4", 0x0800000, 0x0800000, CRC(e104f405) SHA1(124b3deed3e838f8bae6c7d78bdd788859597585) ) ROM_LOAD( "a04503.u6", 0x1000000, 0x0800000, CRC(bfd5cfe3) SHA1(fbe4c0a2987c2036df707b86597d78124ee2e665) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04501.u9", 0x0000000, 0x0800000, CRC(29320b7d) SHA1(59c78805e666f912df201c34616744f46057937b) ) ROM_LOAD( "b04502.u11", 0x0800000, 0x0200000, CRC(578c00e9) SHA1(14235cc8b0f8c7dd659512f017a2d4aacd91d89d) ) @@ -3577,12 +3577,12 @@ ROM_START( dmnfrntpcb ) PGM_VIDEO_BIOS ROM_LOAD( "t04501.u29", 0x180000, 0x800000, CRC(900eaaac) SHA1(4033cb7b28fcadb92d5af3ea7fdd1c22747618fd) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04501.u3", 0x0000000, 0x0800000, CRC(9741bea6) SHA1(e3e904249be228628c8c2bd3495cda23586dc048) ) ROM_LOAD( "a04502.u4", 0x0800000, 0x0800000, CRC(e104f405) SHA1(124b3deed3e838f8bae6c7d78bdd788859597585) ) ROM_LOAD( "a04503.u6", 0x1000000, 0x0800000, CRC(bfd5cfe3) SHA1(fbe4c0a2987c2036df707b86597d78124ee2e665) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04501.u9", 0x0000000, 0x0800000, CRC(29320b7d) SHA1(59c78805e666f912df201c34616744f46057937b) ) ROM_LOAD( "b04502.u11", 0x0800000, 0x0200000, CRC(578c00e9) SHA1(14235cc8b0f8c7dd659512f017a2d4aacd91d89d) ) @@ -3612,12 +3612,12 @@ ROM_START( theglad ) PGM_VIDEO_BIOS ROM_LOAD( "t04601.u33", 0x180000, 0x800000, CRC(e5dab371) SHA1(2e3c93958eb0326b6b84b95c2168626f26bbac76) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04601.u2", 0x0000000, 0x0800000, CRC(d9b2e004) SHA1(8e1882b800fe9f12d7d49303e7417ba5b6f8ef85) ) ROM_LOAD( "a04602.u4", 0x0800000, 0x0800000, CRC(14f22308) SHA1(7fad54704e8c97eab723f53dfb50fb3e7bb606d2) ) ROM_LOAD( "a04603.u6", 0x1000000, 0x0800000, CRC(8f621e17) SHA1(b0f87f378e0115d0c95017ca0f1b0d508827a7c6) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04601.u11", 0x0000000, 0x0800000, CRC(ee72bccf) SHA1(73c25fe659f6c903447066e4ef83d2f580449d76) ) ROM_LOAD( "b04602.u12", 0x0800000, 0x0400000, CRC(7dba9c38) SHA1(a03d509274e8f6a500a7ebe2da5aab8bed4e7f2f) ) @@ -3642,12 +3642,12 @@ ROM_START( theglad100 ) // is this actually a pre-v100 proto? PGM_VIDEO_BIOS ROM_LOAD( "t04601.u33", 0x180000, 0x800000, CRC(e5dab371) SHA1(2e3c93958eb0326b6b84b95c2168626f26bbac76) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04601.u2", 0x0000000, 0x0800000, CRC(d9b2e004) SHA1(8e1882b800fe9f12d7d49303e7417ba5b6f8ef85) ) ROM_LOAD( "a04602.u4", 0x0800000, 0x0800000, CRC(14f22308) SHA1(7fad54704e8c97eab723f53dfb50fb3e7bb606d2) ) ROM_LOAD( "a04603.u6", 0x1000000, 0x0800000, CRC(8f621e17) SHA1(b0f87f378e0115d0c95017ca0f1b0d508827a7c6) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04601.u11", 0x0000000, 0x0800000, CRC(ee72bccf) SHA1(73c25fe659f6c903447066e4ef83d2f580449d76) ) ROM_LOAD( "b04602.u12", 0x0800000, 0x0400000, CRC(7dba9c38) SHA1(a03d509274e8f6a500a7ebe2da5aab8bed4e7f2f) ) @@ -3673,12 +3673,12 @@ ROM_START( theglad101 ) PGM_VIDEO_BIOS ROM_LOAD( "t04601.u33", 0x180000, 0x800000, CRC(e5dab371) SHA1(2e3c93958eb0326b6b84b95c2168626f26bbac76) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04601.u2", 0x0000000, 0x0800000, CRC(d9b2e004) SHA1(8e1882b800fe9f12d7d49303e7417ba5b6f8ef85) ) ROM_LOAD( "a04602.u4", 0x0800000, 0x0800000, CRC(14f22308) SHA1(7fad54704e8c97eab723f53dfb50fb3e7bb606d2) ) ROM_LOAD( "a04603.u6", 0x1000000, 0x0800000, CRC(8f621e17) SHA1(b0f87f378e0115d0c95017ca0f1b0d508827a7c6) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04601.u11", 0x0000000, 0x0800000, CRC(ee72bccf) SHA1(73c25fe659f6c903447066e4ef83d2f580449d76) ) ROM_LOAD( "b04602.u12", 0x0800000, 0x0400000, CRC(7dba9c38) SHA1(a03d509274e8f6a500a7ebe2da5aab8bed4e7f2f) ) @@ -3704,12 +3704,12 @@ ROM_START( thegladpcb ) ROM_LOAD( "pgm_t01s.u72", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // standard PGM tx bios ROM_LOAD( "t04601.u71", 0x180000, 0x800000, CRC(e5dab371) SHA1(2e3c93958eb0326b6b84b95c2168626f26bbac76) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04601.u30", 0x0000000, 0x0800000, CRC(d9b2e004) SHA1(8e1882b800fe9f12d7d49303e7417ba5b6f8ef85) ) ROM_LOAD( "a04602.u31", 0x0800000, 0x0800000, CRC(14f22308) SHA1(7fad54704e8c97eab723f53dfb50fb3e7bb606d2) ) ROM_LOAD( "a04603.u32", 0x1000000, 0x0800000, CRC(8f621e17) SHA1(b0f87f378e0115d0c95017ca0f1b0d508827a7c6) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04601.u40", 0x0000000, 0x0800000, CRC(ee72bccf) SHA1(73c25fe659f6c903447066e4ef83d2f580449d76) ) ROM_LOAD( "b04602.u41", 0x0800000, 0x0400000, CRC(7dba9c38) SHA1(a03d509274e8f6a500a7ebe2da5aab8bed4e7f2f) ) @@ -3733,13 +3733,13 @@ ROM_START( oldsplus ) PGM_VIDEO_BIOS ROM_LOAD( "t05301.rom", 0x180000, 0x800000, CRC(8257bbb0) SHA1(b48067b7e7081a15fddf21739b641d677c2df3d9) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a05301.rom", 0x0000000, 0x0800000, CRC(57946fd2) SHA1(5d79bc71a1881f3099821a9b255a5f271e0eeff6) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a05302.rom", 0x0800000, 0x0800000, CRC(3459a0b8) SHA1(94ab6f980b5582f1db9bb12019d03f0b6e0a06df) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a05303.rom", 0x1000000, 0x0800000, CRC(13475d85) SHA1(4683a3bf304fdc15ffb1c61b7957ad68b023fa33) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a05304.rom", 0x1800000, 0x0800000, CRC(f03ef7a6) SHA1(c18b1b622b430d5e031e65daa6819b84c3e12ef5) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b05301.rom", 0x0000000, 0x0800000, CRC(fd98f503) SHA1(02046ab1aa89f63bff149003d9d61776e025a92a) ) ROM_LOAD( "b05302.rom", 0x0800000, 0x0800000, CRC(9f6094a8) SHA1(69f6f2003ab975eae13ea6b5c2ffa40df6e6bdf6) ) @@ -3760,13 +3760,13 @@ ROM_START( kovshp ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0540.rom", 0x1800000, 0x0800000, CRC(4fd3413e) SHA1(5e8f3e421342bf558c77e59635f9b5d713e825c2) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0540.rom", 0x0800000, 0x0800000, CRC(60999757) SHA1(118cf058e67858958bcb931e14f5d160c7de87cc) ) @@ -3787,13 +3787,13 @@ ROM_START( kovshpa ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0540.rom", 0x1800000, 0x0800000, CRC(4fd3413e) SHA1(5e8f3e421342bf558c77e59635f9b5d713e825c2) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0540.rom", 0x0800000, 0x0800000, CRC(60999757) SHA1(118cf058e67858958bcb931e14f5d160c7de87cc) ) @@ -3816,13 +3816,13 @@ ROM_START( kovytzy ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0540.rom", 0x1800000, 0x0800000, CRC(4fd3413e) SHA1(5e8f3e421342bf558c77e59635f9b5d713e825c2) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0540.rom", 0x0800000, 0x0800000, CRC(60999757) SHA1(118cf058e67858958bcb931e14f5d160c7de87cc) ) @@ -3843,13 +3843,13 @@ ROM_START( kovshxas ) PGM_VIDEO_BIOS ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) - ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) ROM_LOAD( "a0603xas.rom", 0x1800000, 0x0800000, CRC(7057b37e) SHA1(85a19f23303b4d581c4fa315b2c204af92fcb424) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) ROM_LOAD( "b0601xas.rom", 0x0800000, 0x0800000, CRC(3784fb49) SHA1(7e85fe5b5fb8746f1321c03ad2350d2a58969d7a) ) @@ -3872,12 +3872,12 @@ ROM_START( kovlsqh ) ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) ROM_IGNORE( 0x800000 ) // second half identical - ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3901,12 +3901,12 @@ ROM_START( kovlsqh2 ) ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) ROM_IGNORE( 0x800000 ) // second half identical - ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3931,12 +3931,12 @@ ROM_START( kovlsjb ) ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) ROM_IGNORE( 0x800000 ) // second half identical - ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3960,12 +3960,12 @@ ROM_START( kovlsjba ) ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) ROM_IGNORE( 0x800000 ) // second half identical - ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x4000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -3995,12 +3995,12 @@ ROM_START( killbldp ) PGM_VIDEO_BIOS ROM_LOAD( "t05701w032.bin",0x180000, 0x400000, CRC(567c714f) SHA1(b25b20e1ec9f077d6f7b9d41723a68d0d461bef2) ) - ROM_REGION( 0x1800000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a05701w064.bin", 0x0000000, 0x0800000, CRC(8c0c992c) SHA1(28391e50ca4400060676f1524bd49ede373292da) ) ROM_LOAD( "a05702w064.bin", 0x0800000, 0x0800000, CRC(7e5b0f27) SHA1(9e8d69f34c30216925fcb7af87f8b37f703317e7) ) ROM_LOAD( "a05703w064.bin", 0x1000000, 0x0800000, CRC(accbdb44) SHA1(d59b2452c7a5b4e666473dc973b73a0f2b4edc13) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b05701w064.bin", 0x0000000, 0x0800000, CRC(a20cdcef) SHA1(029a49971adf1e72ab556a207172bdfbd0b86b03) ) ROM_LOAD( "b05702w016.bin", 0x0800000, 0x0200000, CRC(fe7457df) SHA1(d66b1b31102b0210f9faf40e1473cd1511ccaf1f) ) @@ -4026,13 +4026,13 @@ ROM_START( svg ) PGM_VIDEO_BIOS ROM_LOAD( "t05601w016.bin",0x180000, 0x200000, CRC(03e110dc) SHA1(41c8f286e9303b24ba6235b341371c298226fb6a) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a05601w064.bin", 0x0000000, 0x0800000, CRC(ea6453e4) SHA1(b5c82edafa8008ad59b5f2219511947d078d446e) ) ROM_LOAD( "a05602w064.bin", 0x0800000, 0x0800000, CRC(6d00621b) SHA1(55a4bc357e14b975b0234a9cd49e2224f509dad9) ) ROM_LOAD( "a05603w064.bin", 0x1000000, 0x0800000, CRC(7b71c64f) SHA1(bec7c7edf0634cf8351a54abb867c56af08ad2c3) ) ROM_LOAD( "a05604w032.bin", 0x1800000, 0x0400000, CRC(9452a567) SHA1(01fdb8e1f131603843ef4c49ab76d7a56b2d6414) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b05601w064.bin", 0x0000000, 0x0800000, CRC(35c0a489) SHA1(a7d5527da01f8eaa7499fb6785b57094521bce97) ) ROM_LOAD( "b05602w064.bin", 0x0800000, 0x0800000, CRC(8aad3f85) SHA1(da6996d901d42b3a2ba7019ad014bb938a5e328b) ) @@ -4059,13 +4059,13 @@ ROM_START( svgtw ) PGM_VIDEO_BIOS ROM_LOAD( "t05601w016.bin",0x180000, 0x200000, CRC(03e110dc) SHA1(41c8f286e9303b24ba6235b341371c298226fb6a) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a05601w064.bin", 0x0000000, 0x0800000, CRC(ea6453e4) SHA1(b5c82edafa8008ad59b5f2219511947d078d446e) ) ROM_LOAD( "a05602w064.bin", 0x0800000, 0x0800000, CRC(6d00621b) SHA1(55a4bc357e14b975b0234a9cd49e2224f509dad9) ) ROM_LOAD( "a05603w064.bin", 0x1000000, 0x0800000, CRC(7b71c64f) SHA1(bec7c7edf0634cf8351a54abb867c56af08ad2c3) ) ROM_LOAD( "a05604w032.bin", 0x1800000, 0x0400000, CRC(9452a567) SHA1(01fdb8e1f131603843ef4c49ab76d7a56b2d6414) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b05601w064.bin", 0x0000000, 0x0800000, CRC(35c0a489) SHA1(a7d5527da01f8eaa7499fb6785b57094521bce97) ) ROM_LOAD( "b05602w064.bin", 0x0800000, 0x0800000, CRC(8aad3f85) SHA1(da6996d901d42b3a2ba7019ad014bb938a5e328b) ) @@ -4093,13 +4093,13 @@ ROM_START( svgpcb ) PGM_VIDEO_BIOS // IGS PGM T01S 1B8558A1 M002146 ROM_LOAD( "t05601w016.bin",0x180000, 0x200000, CRC(03e110dc) SHA1(41c8f286e9303b24ba6235b341371c298226fb6a) ) // IGS T05601W016 2C35 B270 2L464103 B050924 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a05601w064.bin", 0x0000000, 0x0800000, CRC(ea6453e4) SHA1(b5c82edafa8008ad59b5f2219511947d078d446e) ) // IGS A05601W064 44BF 2ECD 2E153602A1 S050914 ROM_LOAD( "a05602w064.bin", 0x0800000, 0x0800000, CRC(6d00621b) SHA1(55a4bc357e14b975b0234a9cd49e2224f509dad9) ) // IGS A05602W064 85C1 8A1F 2E153602A2 S050914 ROM_LOAD( "a05603w064.bin", 0x1000000, 0x0800000, CRC(7b71c64f) SHA1(bec7c7edf0634cf8351a54abb867c56af08ad2c3) ) // IGS A05603W064 8EC7 329A 2E153602A3 S050914 ROM_LOAD( "a05604w032.bin", 0x1800000, 0x0400000, CRC(9452a567) SHA1(01fdb8e1f131603843ef4c49ab76d7a56b2d6414) ) // IGS A05604W032 55F5 4CDB SL529808 S050912 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b05601w064.bin", 0x0000000, 0x0800000, CRC(35c0a489) SHA1(a7d5527da01f8eaa7499fb6785b57094521bce97) ) // IGS B05601W064 EED5 E656 2E350003A1 S050914 ROM_LOAD( "b05602w064.bin", 0x0800000, 0x0800000, CRC(8aad3f85) SHA1(da6996d901d42b3a2ba7019ad014bb938a5e328b) ) // IGS B05602W064 DD65 3D89 2E350004A2 S050914 @@ -4128,11 +4128,11 @@ ROM_START( happy6 ) PGM_VIDEO_BIOS ROM_LOAD( "t01w64m.u29",0x180000, 0x800000, CRC(2d3feb8b) SHA1(9832b1c46b1ee73febf5c5c8913859f4e0581665) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a01w64m.u5", 0x0000000, 0x0800000, CRC(bbaa3df3) SHA1(a72268d3989e96d571242279922291d0dc72db28) ) ROM_LOAD( "a02w64m.u6", 0x0800000, 0x0800000, CRC(f8c9cd36) SHA1(d9613a83bcc2364492fa922fde1c4f0d07b3009c) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b01w64m.u19", 0x0000000, 0x0800000, CRC(73f5f225) SHA1(507126fa96dcec967bdbc0978d79fbce9d25db37) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4158,11 +4158,11 @@ ROM_START( happy6101 ) PGM_VIDEO_BIOS ROM_LOAD( "t01w64m.u29",0x180000, 0x800000, CRC(2d3feb8b) SHA1(9832b1c46b1ee73febf5c5c8913859f4e0581665) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a01w64m.u5", 0x0000000, 0x0800000, CRC(bbaa3df3) SHA1(a72268d3989e96d571242279922291d0dc72db28) ) ROM_LOAD( "a02w64m.u6", 0x0800000, 0x0800000, CRC(f8c9cd36) SHA1(d9613a83bcc2364492fa922fde1c4f0d07b3009c) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b01w64m.u19", 0x0000000, 0x0800000, CRC(73f5f225) SHA1(507126fa96dcec967bdbc0978d79fbce9d25db37) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4188,11 +4188,11 @@ ROM_START( happy6100hk ) PGM_VIDEO_BIOS ROM_LOAD( "t01w64m.u29",0x180000, 0x800000, CRC(2d3feb8b) SHA1(9832b1c46b1ee73febf5c5c8913859f4e0581665) ) - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a01w64m.u5", 0x0000000, 0x0800000, CRC(bbaa3df3) SHA1(a72268d3989e96d571242279922291d0dc72db28) ) ROM_LOAD( "a02w64m.u6", 0x0800000, 0x0800000, CRC(f8c9cd36) SHA1(d9613a83bcc2364492fa922fde1c4f0d07b3009c) ) - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b01w64m.u19", 0x0000000, 0x0800000, CRC(73f5f225) SHA1(507126fa96dcec967bdbc0978d79fbce9d25db37) ) ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4214,11 +4214,11 @@ ROM_START( ket ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4241,11 +4241,11 @@ ROM_START( ket1 ) // only difference between this and ket1 is the rom fill on th ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4268,11 +4268,11 @@ ROM_START( keta ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4295,11 +4295,11 @@ ROM_START( ketb ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4323,11 +4323,11 @@ ROM_START( ketarr10 ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4351,11 +4351,11 @@ ROM_START( ketarrf ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4378,11 +4378,11 @@ ROM_START( ketarr15 ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4405,11 +4405,11 @@ ROM_START( ketarrs15 ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4432,11 +4432,11 @@ ROM_START( ketarr151 ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4459,11 +4459,11 @@ ROM_START( ketarrs151 ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4485,11 +4485,11 @@ ROM_START( ketarr ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) @@ -4529,11 +4529,11 @@ ROM_START( ketbl ) // this assumes a Dodonpachi 2 Bee Storm cart was used PGM_VIDEO_BIOS ROM_LOAD( "t04701w064.u19", 0x180000, 0x800000, CRC(2665b041) SHA1(fb1107778b66f2af0de77ac82e1ee2902f53a959) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04701w064.u7", 0x0000000, 0x0800000, CRC(5ef1b94b) SHA1(f10dfa46e0a4d297c3a856aea5b49d648f98935c) ) //image-1 ROM_LOAD( "a04702w064.u8", 0x0800000, 0x0800000, CRC(26d6da7f) SHA1(f20e07a7994f41b5ed917f8b0119dc5542f3541c) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04701w064.u1", 0x0000000, 0x0800000, CRC(1bec008d) SHA1(07d117dc2eebb35727fb18a7c563acbaf25a8d36) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4553,11 +4553,11 @@ ROM_START( espgal ) ROM_LOAD( "t01s.u18", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM text bios - surface scratched to remove details ROM_LOAD( "t04801w064.u19", 0x180000, 0x800000, CRC(6021c79e) SHA1(fbc340dafb18aa3094de29b881318a5a9794e4bc) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04801w064.u7", 0x0000000, 0x0800000, CRC(26dd4932) SHA1(9bbabb5a53cb5ba88397cc2c258980f3b70314ce) ) //image-1 ROM_LOAD( "a04802w064.u8", 0x0800000, 0x0800000, CRC(0e6bf7a9) SHA1(a7541e2b5a0df2bc62a5b347e54dbc2ed1922db2) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04801w064.u1", 0x0000000, 0x0800000, CRC(98dce13a) SHA1(61d48b7117459f7babc022b68231f6928177a71d) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4581,11 +4581,11 @@ ROM_START( espgalbl ) // this assumes a Dodonpachi 2 Bee Storm cart was used PGM_VIDEO_BIOS ROM_LOAD( "t04801w064.u19", 0x180000, 0x800000, CRC(6021c79e) SHA1(fbc340dafb18aa3094de29b881318a5a9794e4bc) ) //text-1 - ROM_REGION( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x1000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04801w064.u7", 0x0000000, 0x0800000, CRC(26dd4932) SHA1(9bbabb5a53cb5ba88397cc2c258980f3b70314ce) ) //image-1 ROM_LOAD( "a04802w064.u8", 0x0800000, 0x0800000, CRC(0e6bf7a9) SHA1(a7541e2b5a0df2bc62a5b347e54dbc2ed1922db2) ) //image-2 - ROM_REGION( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x0800000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04801w064.u1", 0x0000000, 0x0800000, CRC(98dce13a) SHA1(61d48b7117459f7babc022b68231f6928177a71d) ) //bitmap-1 ROM_REGION( 0x800000, "ics", ROMREGION_ERASE00 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4606,11 +4606,11 @@ ROM_START( ddp3 ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM bios ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4633,11 +4633,11 @@ ROM_START( ddpdoj ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM bios ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4661,11 +4661,11 @@ ROM_START( ddpdoja ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM bios ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4688,11 +4688,11 @@ ROM_START( ddpdojb ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM bios ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4716,11 +4716,11 @@ ROM_START( ddpdojblk ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM bios ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4743,11 +4743,11 @@ ROM_START( ddpdojblka ) ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // same as standard PGM bios ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4771,11 +4771,11 @@ ROM_START( ddpdojblkbl ) PGM_VIDEO_BIOS ROM_LOAD( "t04401w064.u19",0x180000, 0x800000, CRC(3a95f19c) SHA1(fd3c47cf0b8b1e20c6bec4be68a089fc8bbf4dbe) ) //text-1 - ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ + ROM_REGION16_LE( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, CRC(752167b0) SHA1(c33c3398dd8e479c9d5bd348924958a6aecbf0fc) ) //image-2 - ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_REGION16_LE( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, CRC(8cbff066) SHA1(eef1cd566bc70ebf45f047e56026803d5c1dac43) ) //bitmap-1 ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ @@ -4786,39 +4786,11 @@ ROM_END /*** Init Stuff **************************************************************/ -/* This function expands the sprite colour data (in the A Roms) from 3 pixels - in each word to a byte per pixel making it easier to use */ - -void pgm_state::expand_colourdata() -{ - u8 *src = memregion("sprcol")->base(); - size_t srcsize = memregion("sprcol")->bytes(); - size_t needed = srcsize / 2 * 3; - - /* work out how much ram we need to allocate to expand the sprites into - and be able to mask the offset */ - m_sprite_a_region_size = 1; - while (m_sprite_a_region_size < needed) - m_sprite_a_region_size <<= 1; - - m_sprite_a_region = std::make_unique<u8[]>(m_sprite_a_region_size); - - for (int cnt = 0 ; cnt < srcsize / 2 ; cnt++) - { - const u16 colpack = ((src[cnt * 2]) | (src[cnt * 2 + 1] << 8)); - m_sprite_a_region[cnt * 3 + 0] = (colpack >> 0 ) & 0x1f; - m_sprite_a_region[cnt * 3 + 1] = (colpack >> 5 ) & 0x1f; - m_sprite_a_region[cnt * 3 + 2] = (colpack >> 10) & 0x1f; - } -} - void pgm_state::pgm_basic_init(bool set_bank) { u8 *ROM = memregion("maincpu")->base(); if (set_bank) membank("bank1")->set_base(&ROM[0x100000]); - expand_colourdata(); - m_bg_videoram = &m_videoram[0]; m_tx_videoram = &m_videoram[0x4000/2]; m_rowscrollram = &m_videoram[0x7000/2]; diff --git a/src/mame/drivers/photoply.cpp b/src/mame/drivers/photoply.cpp index d8931345334..4ef96054f21 100644 --- a/src/mame/drivers/photoply.cpp +++ b/src/mame/drivers/photoply.cpp @@ -372,3 +372,4 @@ ROM_END GAME( 199?, photoply, 0, photoply, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2000 (v2.01)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) GAME( 2004, photoply2k4, 0, photoply, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2004", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) + diff --git a/src/mame/drivers/play_3.cpp b/src/mame/drivers/play_3.cpp index b051fb2089c..11358219336 100644 --- a/src/mame/drivers/play_3.cpp +++ b/src/mame/drivers/play_3.cpp @@ -722,6 +722,18 @@ ROM_START(phntmshp) ROM_END /*------------------------------------------------------------------- +/ ??/84 Flashman (Sport Matic) +/-------------------------------------------------------------------*/ +ROM_START(flashman) + ROM_REGION(0x4000, "maincpu", 0) + ROM_LOAD("pf7-1a0.u9", 0x0000, 0x2000, CRC(2cd16521) SHA1(bf9aa293e2ded3f5b1e61a10e6a8ebb8b4e9d4e1)) + + ROM_REGION(0x4000, "audiocpu", 0) + ROM_LOAD("mfm-1a0.u3", 0x00000, 0x2000, CRC(456fd555) SHA1(e91d6df15fdfc330ee9edb691ff925ad24afea35)) + ROM_LOAD("mfm-1b0.u4", 0x02000, 0x0800, CRC(90256257) SHA1(c7f2554e500c4e512999b4edc54c86f3335a2b30)) +ROM_END + +/*------------------------------------------------------------------- / ??/86 Rider's Surf (JocMatic) /-------------------------------------------------------------------*/ ROM_START(ridersrf) @@ -780,8 +792,9 @@ GAME(1986, fldragona, fldragon, play_3, play_3, play_3_state, empty_init, R GAME(1987, phntmshp, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Phantom Ship", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) GAME(1987, sklflite, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Skill Flight (Playmatic)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // not by Playmatic, but same hardware -GAME(1986, ridersrf, 0, play_3, play_3, play_3_state, empty_init, ROT0, "JocMatic", "Rider's Surf", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) -GAME(1987, ironball, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Stargame", "Iron Balls", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) -GAME(198?, terrlake, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Terrific Lake", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1984, flashman, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Flashman", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +GAME(1986, ridersrf, 0, play_3, play_3, play_3_state, empty_init, ROT0, "JocMatic", "Rider's Surf", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +GAME(1987, ironball, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Stargame", "Iron Balls", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +GAME(1987, terrlake, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Terrific Lake", MACHINE_IS_SKELETON_MECHANICAL) // bingo hardware, to be split (?) GAME(1983, msdisco, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Miss Disco (Bingo)", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/playmark.cpp b/src/mame/drivers/playmark.cpp index 1adc160f6ea..68e75995f4e 100644 --- a/src/mame/drivers/playmark.cpp +++ b/src/mame/drivers/playmark.cpp @@ -76,9 +76,9 @@ A |__ |_MCT1413P_| | |__ ____________ |___| |__ |S87C751-4N24 | |__ ______ | - ___| |XTAL|<-12.000 | + ___| |XTAL|<-12.000 | | |____| | - |__________________________| + |__________________________| TODO: diff --git a/src/mame/drivers/poisk1.cpp b/src/mame/drivers/poisk1.cpp index 0fce384ab3a..7e6b36023b2 100644 --- a/src/mame/drivers/poisk1.cpp +++ b/src/mame/drivers/poisk1.cpp @@ -34,6 +34,7 @@ #include "machine/ram.h" #include "sound/spkrdev.h" #include "video/cgapal.h" +#include "bus/isa/p1_fdc.h" #include "emupal.h" #include "screen.h" @@ -85,6 +86,8 @@ public: void init_poisk1(); + void fdc_config(device_t *device); + protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -613,6 +616,12 @@ void p1_state::machine_reset() * macros */ +void p1_state::fdc_config(device_t *device) +{ + p1_fdc_device &fdc = *downcast<p1_fdc_device*>(device); + fdc.set_cpu(m_maincpu); +} + void p1_state::poisk1_map(address_map &map) { map.unmap_value_high(); @@ -673,11 +682,13 @@ void p1_state::poisk1(machine_config &config) m_isabus->irq4_callback().set(m_pic8259, FUNC(pic8259_device::ir4_w)); m_isabus->irq5_callback().set(m_pic8259, FUNC(pic8259_device::ir5_w)); m_isabus->irq7_callback().set(m_pic8259, FUNC(pic8259_device::ir7_w)); + m_isabus->iochrdy_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); - ISA8_SLOT(config, "isa1", 0, m_isabus, p1_isa8_cards, "fdc", false); // FIXME: determine ISA bus clock - ISA8_SLOT(config, "isa2", 0, m_isabus, p1_isa8_cards, nullptr, false); - ISA8_SLOT(config, "isa3", 0, m_isabus, p1_isa8_cards, nullptr, false); - ISA8_SLOT(config, "isa4", 0, m_isabus, p1_isa8_cards, nullptr, false); + // FIXME: determine ISA bus clock + ISA8_SLOT(config, "isa1", 0, m_isabus, p1_isa8_cards, "fdc", false).set_option_machine_config("fdc", [this](device_t *device) { fdc_config(device); }); + ISA8_SLOT(config, "isa2", 0, m_isabus, p1_isa8_cards, nullptr, false).set_option_machine_config("fdc", [this](device_t *device) { fdc_config(device); }); + ISA8_SLOT(config, "isa3", 0, m_isabus, p1_isa8_cards, nullptr, false).set_option_machine_config("fdc", [this](device_t *device) { fdc_config(device); }); + ISA8_SLOT(config, "isa4", 0, m_isabus, p1_isa8_cards, nullptr, false).set_option_machine_config("fdc", [this](device_t *device) { fdc_config(device); }); SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00); diff --git a/src/mame/drivers/pong.cpp b/src/mame/drivers/pong.cpp index ea4ad14e7ab..7d6980a9c9b 100644 --- a/src/mame/drivers/pong.cpp +++ b/src/mame/drivers/pong.cpp @@ -109,7 +109,7 @@ static const int NS_PER_CLOCK_PONG = static_cast<int>((double) NETLIST_INTERNAL static const int MASTER_CLOCK_PONG = static_cast<int>((double) NETLIST_INTERNAL_RES / (double) NS_PER_CLOCK_PONG + 0.5); #define V_TOTAL_PONG (0x105+1) // 262 -#define H_TOTAL_PONG (0x1C6+1) // 454 +#define H_TOTAL_PONG (0x1C5+1) // 454 /* * Breakout's H1 signal: @@ -490,14 +490,15 @@ void pong_state::pong(machine_config &config) /* video hardware */ SCREEN(config, "screen", SCREEN_TYPE_RASTER); //SCREEN(config, "screen", SCREEN_TYPE_VECTOR); - FIXFREQ(config, m_video).set_screen("screen"); - m_video->set_monitor_clock(MASTER_CLOCK_PONG); - m_video->set_horz_params(H_TOTAL_PONG-67,H_TOTAL_PONG-40,H_TOTAL_PONG-8,H_TOTAL_PONG); - m_video->set_vert_params(V_TOTAL_PONG-22,V_TOTAL_PONG-19,V_TOTAL_PONG-12,V_TOTAL_PONG); - m_video->set_fieldcount(1); - m_video->set_threshold(0.11); - m_video->set_horz_scale(4); - + FIXFREQ(config, m_video) + .set_monitor_clock(MASTER_CLOCK_PONG) + .set_horz_params(H_TOTAL_PONG-66,H_TOTAL_PONG-40,H_TOTAL_PONG-8,H_TOTAL_PONG) + .set_vert_params(V_TOTAL_PONG-22,V_TOTAL_PONG-10,V_TOTAL_PONG-8,V_TOTAL_PONG) + .set_fieldcount(1) + .set_threshold(0.11) + .set_gain(2.37) + .set_horz_scale(4) + .set_screen("screen"); /* sound hardware */ SPEAKER(config, "speaker").front_center(); DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC @@ -540,19 +541,20 @@ void breakout_state::breakout(machine_config &config) NETLIST_ANALOG_OUTPUT(config, "maincpu:coin_counter", 0).set_params("CON_T", FUNC(breakout_state::coin_counter_cb)); /* video hardware */ - FIXFREQ(config, m_video).set_screen("screen"); - SCREEN(config, "screen", SCREEN_TYPE_RASTER); - //SCREEN(config, "screen", SCREEN_TYPE_VECTOR); /* The Pixel width is a 2,1,2,1,2,1,1,1 repeating pattern * Thus we must use double resolution horizontally */ - m_video->set_monitor_clock(MASTER_CLOCK_BREAKOUT); - m_video->set_horz_params((H_TOTAL_BREAKOUT-208),(H_TOTAL_BREAKOUT-144),(H_TOTAL_BREAKOUT-16), (H_TOTAL_BREAKOUT)); - m_video->set_vert_params(V_TOTAL_BREAKOUT-22,V_TOTAL_BREAKOUT-23,V_TOTAL_BREAKOUT-4, V_TOTAL_BREAKOUT); - m_video->set_fieldcount(1); - m_video->set_threshold(1.0); - m_video->set_gain(1.5); - m_video->set_horz_scale(2); + SCREEN(config, "screen", SCREEN_TYPE_RASTER); + //SCREEN(config, "screen", SCREEN_TYPE_VECTOR); + FIXFREQ(config, m_video) + .set_monitor_clock(MASTER_CLOCK_BREAKOUT) + .set_horz_params((H_TOTAL_BREAKOUT-176),(H_TOTAL_BREAKOUT-144),(H_TOTAL_BREAKOUT-80), (H_TOTAL_BREAKOUT)) + .set_vert_params(V_TOTAL_BREAKOUT-24,V_TOTAL_BREAKOUT-24,V_TOTAL_BREAKOUT-20, V_TOTAL_BREAKOUT) + .set_fieldcount(1) + .set_threshold(1.0) + .set_gain(2.66) + .set_horz_scale(2) + .set_screen("screen"); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -594,12 +596,15 @@ void pong_state::pongd(machine_config &config) /* video hardware */ SCREEN(config, "screen", SCREEN_TYPE_RASTER); - FIXFREQ(config, m_video).set_screen("screen"); - m_video->set_monitor_clock(MASTER_CLOCK_PONG); - m_video->set_horz_params(H_TOTAL_PONG-67,H_TOTAL_PONG-52,H_TOTAL_PONG-8,H_TOTAL_PONG); - m_video->set_vert_params(V_TOTAL_PONG-22,V_TOTAL_PONG-19,V_TOTAL_PONG-12,V_TOTAL_PONG); - m_video->set_fieldcount(1); - m_video->set_threshold(0.11); + FIXFREQ(config, m_video) + .set_monitor_clock(MASTER_CLOCK_PONG) + .set_horz_params(H_TOTAL_PONG-76,H_TOTAL_PONG-56,H_TOTAL_PONG-8,H_TOTAL_PONG) + .set_vert_params(V_TOTAL_PONG-22,V_TOTAL_PONG-10,V_TOTAL_PONG-8,V_TOTAL_PONG) + .set_fieldcount(1) + .set_threshold(0.11) + .set_gain(2.7) + .set_horz_scale(2) + .set_screen("screen"); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -633,15 +638,15 @@ void rebound_state::rebound(machine_config &config) /* video hardware */ SCREEN(config, "screen", SCREEN_TYPE_RASTER); - FIXFREQ(config, m_video).set_screen("screen"); - m_video->set_monitor_clock(MASTER_CLOCK_PONG); - //m_video->set_horz_params(H_TOTAL_PONG-67,H_TOTAL_PONG-40,H_TOTAL_PONG-8,H_TOTAL_PONG); - m_video->set_horz_params(H_TOTAL_PONG-51,H_TOTAL_PONG-40,H_TOTAL_PONG-8,H_TOTAL_PONG); - m_video->set_vert_params(V_TOTAL_PONG-22,V_TOTAL_PONG-19,V_TOTAL_PONG-12,V_TOTAL_PONG); - m_video->set_fieldcount(1); - m_video->set_threshold(1.0); - m_video->set_gain(0.6); - m_video->set_horz_scale(2); + FIXFREQ(config, m_video) + .set_monitor_clock(MASTER_CLOCK_PONG) + .set_horz_params(H_TOTAL_PONG-66,H_TOTAL_PONG-56,H_TOTAL_PONG-8,H_TOTAL_PONG) + .set_vert_params(V_TOTAL_PONG-22,V_TOTAL_PONG-12,V_TOTAL_PONG-8,V_TOTAL_PONG) + .set_fieldcount(1) + .set_threshold(1.0) + .set_gain(1.8) + .set_horz_scale(2) + .set_screen("screen"); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -661,7 +666,7 @@ void rebound_state::rebound(machine_config &config) ROM_START( pong ) /* dummy to satisfy game entry*/ ROM_REGION( 0x10000, "maincpu", 0 ) /* enough for netlist */ - ROM_LOAD( "pong.netlist", 0x000000, 0x00473b, CRC(eadaf087) SHA1(4cb9a79f5cb53502105974be61b99ff16ee930e9) ) + ROM_LOAD( "pong.netlist", 0x000000, 18273, CRC(d249ce49) SHA1(e1d2cfca74b75f0520965639e6947a351650fc3e) ) ROM_END ROM_START( breakout ) @@ -721,7 +726,7 @@ ROM_END */ GAME( 1972, pong, 0, pong, pong, pong_state, empty_init, ROT0, "Atari", "Pong (Rev E) external [TTL]", MACHINE_SUPPORTS_SAVE) -GAME( 1972, pongf, 0, pongf, pong, pong_state, empty_init, ROT0, "Atari", "Pong (Rev E) [TTL]", MACHINE_SUPPORTS_SAVE) +GAME( 1972, pongf, pong, pongf, pong, pong_state, empty_init, ROT0, "Atari", "Pong (Rev E) [TTL]", MACHINE_SUPPORTS_SAVE) GAME( 1973, pongd, 0, pongd, pongd, pong_state, empty_init, ROT0, "Atari", "Pong Doubles [TTL]", MACHINE_SUPPORTS_SAVE) GAMEL( 1974, rebound, 0, rebound, rebound, rebound_state, empty_init, ROT0, "Atari", "Rebound (Rev B) [TTL]", MACHINE_SUPPORTS_SAVE, layout_rebound) GAMEL( 1976, breakout, 0, breakout, breakout, breakout_state, empty_init, ROT90, "Atari", "Breakout [TTL]", MACHINE_SUPPORTS_SAVE, layout_breakout) diff --git a/src/mame/drivers/prestige.cpp b/src/mame/drivers/prestige.cpp index 85525613f86..85cb6d7e66b 100644 --- a/src/mame/drivers/prestige.cpp +++ b/src/mame/drivers/prestige.cpp @@ -56,10 +56,10 @@ Notes: | ____ |Z80 | S2564RL-100->| || | ______________ ____ | | | || | | 27-5560-01 | ____ | |<-Z84C0008PEC | || - | |_____________| | | | | __________ |____|| + | |_____________| | | | | __________ |____|| \ | | |____| |_________| ________| - \_____ ____________| | SN74HC244N | - |||||||||||||| |__|||||_____ ___| + \_____ ____________| | SN74HC244N | + |||||||||||||| |__|||||_____ ___| |||||||||||||| ||||||||||| */ @@ -883,7 +883,7 @@ ROM_END ROM_START( pcscolor ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "27-5560-01.u5", 0x00000, 0x080000, CRC(e21e7ecd) SHA1(f3eeb19a88f1856406b357f2966880113b7340dc) ) - + ROM_REGION( 0x2000, "speech", 0 ) ROM_LOAD( "csm10233an.u1", 0x0000, 0x2000, NO_DUMP ) // TSP50C10 (8K bytes of ROM) labeled "51CTCJT VIDEO TECH CSM10233AN" ROM_END diff --git a/src/mame/drivers/psion5.cpp b/src/mame/drivers/psion5.cpp new file mode 100644 index 00000000000..6e86916795c --- /dev/null +++ b/src/mame/drivers/psion5.cpp @@ -0,0 +1,971 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, Ash Wolf +/*************************************************************************** + + Psion 5mx (EPOC R5) series + + Driver by Ryan Holtz, ported from work by Ash Wolf + + TODO: + - Audio + - UART support + - Probably more + + More info: + https://github.com/Treeki/WindEmu + +****************************************************************************/ + +#include "includes/psion5.h" + +#define LOG_UNKNOWNS (1 << 0) +#define LOG_IRQ (1 << 1) +#define LOG_DISPLAY (1 << 2) +#define LOG_DRAM_READS (1 << 3) +#define LOG_LCD_READS (1 << 4) +#define LOG_POWER_READS (1 << 5) +#define LOG_EOI_READS (1 << 6) +#define LOG_INT_READS (1 << 7) +#define LOG_CODEC_READS (1 << 8) +#define LOG_SSP_READS (1 << 9) +#define LOG_TIMER_READS (1 << 10) +#define LOG_BUZZER_READS (1 << 11) +#define LOG_RTC_READS (1 << 12) +#define LOG_GPIO_READS (1 << 13) +#define LOG_KBD_READS (1 << 14) +#define LOG_DRAM_WRITES (1 << 15) +#define LOG_LCD_WRITES (1 << 16) +#define LOG_POWER_WRITES (1 << 17) +#define LOG_EOI_WRITES (1 << 18) +#define LOG_INT_WRITES (1 << 19) +#define LOG_CODEC_WRITES (1 << 20) +#define LOG_SSP_WRITES (1 << 21) +#define LOG_TIMER_WRITES (1 << 22) +#define LOG_BUZZER_WRITES (1 << 23) +#define LOG_RTC_WRITES (1 << 24) +#define LOG_GPIO_WRITES (1 << 25) +#define LOG_PIN_WRITES (1 << 26) +#define LOG_KBD_WRITES (1 << 27) + +#define LOG_WRITES (LOG_DRAM_WRITES | LOG_LCD_WRITES | LOG_POWER_WRITES | LOG_EOI_WRITES | LOG_INT_WRITES | LOG_CODEC_WRITES \ + | LOG_SSP_WRITES | LOG_TIMER_WRITES | LOG_BUZZER_WRITES | LOG_RTC_WRITES | LOG_GPIO_WRITES | LOG_PIN_WRITES | LOG_KBD_WRITES) +#define LOG_READS (LOG_DRAM_READS | LOG_LCD_READS | LOG_POWER_READS | LOG_EOI_READS | LOG_INT_READS | LOG_CODEC_READS \ + | LOG_SSP_READS | LOG_TIMER_READS | LOG_BUZZER_READS | LOG_RTC_READS | LOG_GPIO_READS | LOG_KBD_READS) +#define LOG_ALL_IRQ (LOG_IRQ | LOG_EOI_WRITES | LOG_INT_WRITES | LOG_EOI_READS | LOG_INT_READS) +#define LOG_ALL (LOG_UNKNOWNS | LOG_IRQ | LOG_DISPLAY | LOG_WRITES | LOG_READS) + +#define VERBOSE (LOG_CODEC_READS | LOG_CODEC_WRITES | LOG_BUZZER_WRITES) +#include "logmacro.h" + +void psion5mx_state::machine_start() +{ + save_item(NAME(m_memcfg)); + save_item(NAME(m_dramcfg)); + + save_item(NAME(m_timer_reload)); + save_item(NAME(m_timer_value)); + save_item(NAME(m_timer_ctrl)); + + save_item(NAME(m_pending_ints)); + save_item(NAME(m_int_mask)); + + save_item(NAME(m_lcd_display_base_addr)); + + save_item(NAME(m_rtc)); + save_item(NAME(m_pwrsr)); + save_item(NAME(m_last_ssi_request)); + save_item(NAME(m_ssi_read_counter)); + + save_item(NAME(m_kbd_scan)); + + save_item(NAME(m_ports)); + + m_timers[0] = timer_alloc(TID_TIMER1); + m_timers[1] = timer_alloc(TID_TIMER2); + m_periodic = timer_alloc(TID_PERIODIC); + m_rtc_ticker = timer_alloc(TID_RTC_TICKER); +} + +void psion5mx_state::machine_reset() +{ + memset(m_memcfg, 0, sizeof(uint32_t) * ARRAY_LENGTH(m_memcfg)); + m_dramcfg = 0; + + m_timers[0]->adjust(attotime::never); + m_timers[1]->adjust(attotime::never); + m_timer_reload[0] = m_timer_reload[1] = 0; + m_timer_ctrl[0] = m_timer_ctrl[1] = 0; + + m_pending_ints = 0; + m_int_mask = 0; + + m_lcd_display_base_addr = 0; + + m_rtc = time(nullptr) - 946684800; + m_pwrsr = (1 << 10) | (1 << 13); + m_last_ssi_request = 0; + m_ssi_read_counter = 0; + m_kbd_scan = 0; + + memset(m_ports, 0, ARRAY_LENGTH(m_ports)); + + m_periodic->adjust(attotime::from_hz(64), 0, attotime::from_hz(64)); + + m_rtc_ticker->adjust(attotime::from_hz(64), 0, attotime::from_hz(64)); +} + +void psion5mx_state::check_interrupts() +{ + LOGMASKED(LOG_IRQ, "Pending FIQs is %08x & %08x & %08x\n", m_pending_ints, m_int_mask, IRQ_FIQ_MASK); + LOGMASKED(LOG_IRQ, "Pending IRQs is %08x & %08x & %08x\n", m_pending_ints, m_int_mask, IRQ_IRQ_MASK); + bool any_interrupts = (m_pending_ints & m_int_mask) != 0; + if (any_interrupts) + { + m_maincpu->resume(SUSPEND_REASON_HALT); + } + m_maincpu->set_input_line(ARM7_FIRQ_LINE, m_pending_ints & m_int_mask & IRQ_FIQ_MASK ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(ARM7_IRQ_LINE, m_pending_ints & m_int_mask & IRQ_IRQ_MASK ? ASSERT_LINE : CLEAR_LINE); +} + +void psion5mx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch (id) + { + case TID_TIMER1: + update_timer(0); + if (BIT(m_buzzer_ctrl, 1)) + { + m_speaker->level_w(BIT(m_timer_value[0], 15)); + } + break; + case TID_TIMER2: + update_timer(1); + break; + case TID_PERIODIC: + LOGMASKED(LOG_IRQ, "Flagging periodic IRQ\n"); + m_pending_ints |= (1 << IRQ_TINT); + check_interrupts(); + break; + case TID_RTC_TICKER: + if ((m_pwrsr & 0x3f) == 0x3f) + { + m_rtc++; + m_pwrsr &= ~0x3f; + } + else + { + m_pwrsr++; + } + break; + } +} + +void psion5mx_state::update_timer(int timer) +{ + m_timer_value[timer]--; + if (m_timer_value[timer] == 0) + { + LOGMASKED(LOG_IRQ, "Flagging Timer %d IRQ\n", timer + 1); + m_pending_ints |= (1 << (IRQ_TC1OI + timer)); + check_interrupts(); + if (BIT(m_timer_ctrl[timer], 6)) + { + m_timer_value[timer] = m_timer_reload[timer]; + } + } +} + +void psion5mx_state::set_timer_ctrl(int timer, uint32_t value) +{ + const uint32_t old = m_timer_ctrl[timer]; + const uint32_t changed = old ^ value; + m_timer_ctrl[timer] = value; + if (changed != 0) + { + attotime interval = BIT(m_timer_ctrl[timer], 3) ? attotime::from_ticks(1, 512000) : attotime::from_ticks(1, 2000); + if (BIT(old, 7) && BIT(value, 7)) + { + m_timers[timer]->adjust(m_timers[timer]->remaining(), 0, interval); + } + else if (BIT(value, 7)) + { + m_timers[timer]->adjust(interval, 0, interval); + } + else + { + m_timers[timer]->adjust(attotime::never); + } + } +} + +READ32_MEMBER(psion5mx_state::periphs_r) +{ + const uint32_t reg = offset << 2; + uint32_t data = 0; + switch (reg) + { + case REG_MEMCFG1: + data = m_memcfg[0]; + LOGMASKED(LOG_DRAM_READS, "%s: peripheral read, MEMCFG1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_MEMCFG2: + data = m_memcfg[1]; + LOGMASKED(LOG_DRAM_READS, "%s: peripheral read, MEMCFG2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_DRAMCFG: + data = m_dramcfg; + LOGMASKED(LOG_DRAM_READS, "%s: peripheral read, DRAMCFG = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_LCDCTL: + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCDCTL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDST: + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCDST = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCD_DBAR1: + data = m_lcd_display_base_addr; + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCD_DBAR1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDT0: + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCDT0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDT1: + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCDT1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDT2: + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCDT2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_PWRSR: + data = m_pwrsr; + LOGMASKED(LOG_POWER_READS, "%s: peripheral read, PWRSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PWRCNT: + LOGMASKED(LOG_POWER_READS, "%s: peripheral read, PWRCNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_HALT: + LOGMASKED(LOG_POWER_READS, "%s: peripheral read, HALT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_STBY: + LOGMASKED(LOG_POWER_READS, "%s: peripheral read, STBY = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_BLEOI: + LOGMASKED(LOG_EOI_READS, "%s: peripheral read, BLEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_MCEOI: + LOGMASKED(LOG_EOI_READS, "%s: peripheral read, MCEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TEOI: + LOGMASKED(LOG_EOI_READS, "%s: peripheral read, TEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_STFCLR: + LOGMASKED(LOG_POWER_READS, "%s: peripheral read, STFCLR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_E2EOI: + LOGMASKED(LOG_EOI_READS, "%s: peripheral read, E2EOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_INTSR: + data = m_pending_ints & m_int_mask; + LOGMASKED(LOG_INT_READS, "%s: peripheral read, INTSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTRSR: + data = m_pending_ints; + LOGMASKED(LOG_INT_READS, "%s: peripheral read, INTRSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTENS: + data = m_int_mask; + LOGMASKED(LOG_INT_READS, "%s: peripheral read, INTENS = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTENC: + LOGMASKED(LOG_INT_READS, "%s: peripheral read, INTENC = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTTEST1: + LOGMASKED(LOG_INT_READS, "%s: peripheral read, INTTEST1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTTEST2: + LOGMASKED(LOG_INT_READS, "%s: peripheral read, INTTEST2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_PUMPCON: + LOGMASKED(LOG_POWER_READS, "%s: peripheral read, PUMPCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_CODR: + LOGMASKED(LOG_CODEC_READS, "%s: peripheral read, CODR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_CONFG: + LOGMASKED(LOG_CODEC_READS, "%s: peripheral read, CONFG = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_COLFG: + LOGMASKED(LOG_CODEC_READS, "%s: peripheral read, COLFG = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_COEOI: + LOGMASKED(LOG_CODEC_READS | LOG_EOI_READS, "%s: peripheral read, COEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_COTEST: + LOGMASKED(LOG_CODEC_READS, "%s: peripheral read, COTEST = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_SSCR0: + LOGMASKED(LOG_SSP_READS, "%s: peripheral read, SSCR0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_SSCR1: + LOGMASKED(LOG_SSP_READS, "%s: peripheral read, SSCR1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_SSDR: + { + // TODO: Proper SSP support + uint16_t value = 0; + switch (m_last_ssi_request) + { + case 0xd0d3: // Touch X + value = 50 + (uint16_t)(m_touchx->read() * 5.7); + break; + case 0x9093: // Touch Y + value = 3834 - (uint16_t)(m_touchy->read() * 13.225); + break; + case 0xa4a4: // Main Battery + case 0xe4e4: // Backup Battery + value = 3100; + break; + } + + if (m_ssi_read_counter == 4) data = (value >> 5) & 0x7f; + if (m_ssi_read_counter == 5) data = (value << 3) & 0xf8; + m_ssi_read_counter++; + if (m_ssi_read_counter == 6) m_ssi_read_counter = 0; + + // We should be clearing SSEOTI here, possibly, + // but for now we just leave it on to simplify things + LOGMASKED(LOG_SSP_READS, "%s: peripheral read, SSDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + } + case REG_SSSR: + data = 0; + LOGMASKED(LOG_SSP_READS, "%s: peripheral read, SSSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_TC1LOAD: + data = m_timer_reload[0]; + LOGMASKED(LOG_TIMER_READS, "%s: peripheral read, TC1LOAD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC1VAL: + data = m_timer_value[0]; + LOGMASKED(LOG_TIMER_READS, "%s: peripheral read, TC1VAL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC1CTRL: + data = m_timer_ctrl[0]; + LOGMASKED(LOG_TIMER_READS, "%s: peripheral read, TC1CTRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC1EOI: + LOGMASKED(LOG_TIMER_READS | LOG_EOI_READS, "%s: peripheral read, TC1EOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC2LOAD: + data = m_timer_reload[1]; + LOGMASKED(LOG_TIMER_READS, "%s: peripheral read, TC2LOAD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC2VAL: + data = m_timer_value[1]; + LOGMASKED(LOG_TIMER_READS, "%s: peripheral read, TC2VAL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC2CTRL: + data = m_timer_ctrl[1]; + LOGMASKED(LOG_TIMER_READS, "%s: peripheral read, TC2CTRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC2EOI: + LOGMASKED(LOG_EOI_READS, "%s: peripheral read, TC2EOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_BZCONT: + data = m_buzzer_ctrl; + LOGMASKED(LOG_BUZZER_READS, "%s: peripheral read, BZCONT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_RTCDRL: + data = (uint16_t)m_rtc; + LOGMASKED(LOG_RTC_READS, "%s: peripheral read, RTCDRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_RTCDRU: + data = m_rtc >> 16; + LOGMASKED(LOG_RTC_READS, "%s: peripheral read, RTCDRU = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_RTCMRL: + LOGMASKED(LOG_RTC_READS, "%s: peripheral read, RTCMRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_RTCMRU: + LOGMASKED(LOG_RTC_READS, "%s: peripheral read, RTCMRU = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_RTCEOI: + LOGMASKED(LOG_RTC_READS | LOG_EOI_READS, "%s: peripheral read, RTCEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_PADR: + data = read_keyboard(); + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PADR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PBDR: + data = m_ports[PORTB]; + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PBDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PCDR: + data = m_ports[PORTC]; + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PCDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PDDR: + data = m_ports[PORTD]; + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PADDR: + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PADDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PBDDR: + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PBDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PCDDR: + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PCDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PDDDR: + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PDDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PEDR: + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PEDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PEDDR: + LOGMASKED(LOG_GPIO_READS, "%s: peripheral read, PEDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_KSCAN: + data = m_kbd_scan; + LOGMASKED(LOG_KBD_READS, "%s: peripheral read, KSCAN = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDMUX: + LOGMASKED(LOG_LCD_READS, "%s: peripheral read, LCDMUX = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + default: + LOGMASKED(LOG_UNKNOWNS, "%s: peripheral read, Unknown = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + } + return data; +} + +WRITE32_MEMBER(psion5mx_state::periphs_w) +{ + const uint32_t reg = offset << 2; + switch (reg) + { + case REG_MEMCFG1: + m_memcfg[0] = data; + LOGMASKED(LOG_DRAM_WRITES, "%s: peripheral write, MEMCFG1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_MEMCFG2: + m_memcfg[1] = data; + LOGMASKED(LOG_DRAM_WRITES, "%s: peripheral write, MEMCFG2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_DRAMCFG: + m_dramcfg = data; + LOGMASKED(LOG_DRAM_WRITES, "%s: peripheral write, DRAMCFG = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_LCDCTL: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCDCTL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDST: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCDST = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCD_DBAR1: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCD_DBAR1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + COMBINE_DATA(&m_lcd_display_base_addr); + break; + case REG_LCDT0: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCDT0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDT1: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCDT1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDT2: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCDT2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_PWRSR: + COMBINE_DATA(&m_pwrsr); + LOGMASKED(LOG_POWER_WRITES, "%s: peripheral write, PWRSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PWRCNT: + LOGMASKED(LOG_POWER_WRITES, "%s: peripheral write, PWRCNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_HALT: + m_maincpu->suspend(SUSPEND_REASON_HALT, 1); + LOGMASKED(LOG_POWER_WRITES, "%s: peripheral write, HALT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_STBY: + LOGMASKED(LOG_POWER_WRITES, "%s: peripheral write, STBY = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_BLEOI: + LOGMASKED(LOG_EOI_WRITES, "%s: peripheral write, BLEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_MCEOI: + LOGMASKED(LOG_EOI_WRITES, "%s: peripheral write, MCEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TEOI: + LOGMASKED(LOG_EOI_WRITES, "%s: peripheral write, TEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_pending_ints &= ~(1 << IRQ_TINT); + check_interrupts(); + break; + case REG_STFCLR: + m_pwrsr &= ~0x00003e00; + LOGMASKED(LOG_POWER_WRITES, "%s: peripheral write, STFCLR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_E2EOI: + LOGMASKED(LOG_EOI_WRITES, "%s: peripheral write, E2EOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_INTSR: + LOGMASKED(LOG_INT_WRITES, "%s: peripheral write, INTSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTRSR: + LOGMASKED(LOG_INT_WRITES, "%s: peripheral write, INTRSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTENS: + m_int_mask |= data & mem_mask; + LOGMASKED(LOG_INT_WRITES, "%s: peripheral write, INTENS = %08x & %08x\n", machine().describe_context(), data, mem_mask); + check_interrupts(); + break; + case REG_INTENC: + m_int_mask &= ~(data & mem_mask); + LOGMASKED(LOG_INT_WRITES, "%s: peripheral write, INTENC = %08x & %08x\n", machine().describe_context(), data, mem_mask); + check_interrupts(); + break; + case REG_INTTEST1: + LOGMASKED(LOG_INT_WRITES, "%s: peripheral write, INTTEST1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_INTTEST2: + LOGMASKED(LOG_INT_WRITES, "%s: peripheral write, INTTEST2 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_PUMPCON: + LOGMASKED(LOG_POWER_WRITES, "%s: peripheral write, PUMPCON = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_CODR: + LOGMASKED(LOG_CODEC_WRITES, "%s: peripheral write, CODR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_CONFG: + LOGMASKED(LOG_CODEC_WRITES, "%s: peripheral write, CONFG = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_COLFG: + LOGMASKED(LOG_CODEC_WRITES, "%s: peripheral write, COLFG = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_COEOI: + LOGMASKED(LOG_CODEC_WRITES | LOG_EOI_WRITES, "%s: peripheral write, COEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_COTEST: + LOGMASKED(LOG_CODEC_WRITES, "%s: peripheral write, COTEST = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_SSCR0: + LOGMASKED(LOG_SSP_WRITES, "%s: peripheral write, SSCR0 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_SSCR1: + LOGMASKED(LOG_SSP_WRITES, "%s: peripheral write, SSCR1 = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_SSDR: + LOGMASKED(LOG_SSP_WRITES, "%s: peripheral write, SSDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + // TODO: Proper SPI support + if (data != 0) + { + m_last_ssi_request = (m_last_ssi_request >> 8) | (data & 0xff00); + } + break; + case REG_SSSR: + LOGMASKED(LOG_SSP_WRITES, "%s: peripheral write, SSSR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_TC1LOAD: + LOGMASKED(LOG_TIMER_WRITES, "%s: peripheral write, TC1LOAD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_timer_reload[0] = data; + m_timer_value[0] = data; + break; + case REG_TC1VAL: + LOGMASKED(LOG_TIMER_WRITES, "%s: peripheral write, TC1VAL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC1CTRL: + LOGMASKED(LOG_TIMER_WRITES, "%s: peripheral write, TC1CTRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + set_timer_ctrl(0, data); + break; + case REG_TC1EOI: + LOGMASKED(LOG_TIMER_WRITES | LOG_EOI_WRITES, "%s: peripheral write, TC1EOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_pending_ints &= ~(1 << IRQ_TC1OI); + check_interrupts(); + break; + case REG_TC2LOAD: + LOGMASKED(LOG_TIMER_WRITES, "%s: peripheral write, TC2LOAD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_timer_reload[1] = data; + m_timer_value[1] = data; + break; + case REG_TC2VAL: + LOGMASKED(LOG_TIMER_WRITES, "%s: peripheral write, TC2VAL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_TC2CTRL: + LOGMASKED(LOG_TIMER_WRITES, "%s: peripheral write, TC2CTRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + set_timer_ctrl(1, data); + break; + case REG_TC2EOI: + LOGMASKED(LOG_TIMER_WRITES | LOG_EOI_WRITES, "%s: peripheral write, TC2EOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_pending_ints &= ~(1 << IRQ_TC2OI); + check_interrupts(); + break; + + case REG_BZCONT: + m_buzzer_ctrl = data; + if (!BIT(m_buzzer_ctrl, 1)) + { + m_speaker->level_w(BIT(m_buzzer_ctrl, 0)); + } + LOGMASKED(LOG_BUZZER_WRITES, "%s: peripheral write, BZCONT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_RTCDRL: + LOGMASKED(LOG_RTC_WRITES, "%s: peripheral write, RTCDRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_rtc &= 0xffff0000; + m_rtc |= (uint16_t)data; + break; + case REG_RTCDRU: + LOGMASKED(LOG_RTC_WRITES, "%s: peripheral write, RTCDRU = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_rtc &= 0x0000ffff; + m_rtc |= data << 16; + break; + case REG_RTCMRL: + LOGMASKED(LOG_RTC_WRITES, "%s: peripheral write, RTCMRL = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_RTCMRU: + LOGMASKED(LOG_RTC_WRITES, "%s: peripheral write, RTCMRU = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_RTCEOI: + LOGMASKED(LOG_RTC_WRITES | LOG_EOI_WRITES, "%s: peripheral write, RTCEOI = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_PADR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PADR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + m_ports[PORTA] = data; + case REG_PBDR: + { + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PBDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + const uint8_t old = m_ports[PORTB]; + m_ports[PORTB] = data; + const uint8_t diff = old ^ data; + if (BIT(diff, 0)) + m_etna->eeprom_cs_in(BIT(data, 0)); + if (BIT(diff, 1)) + m_etna->eeprom_clk_in(BIT(data, 1)); + if (diff & 0x3c) + LOGMASKED(LOG_PIN_WRITES, "Contrast: %d\n", (data >> 2) & 0x0f); + if (BIT(diff, 6)) + LOGMASKED(LOG_PIN_WRITES, "Case Open: %d\n", BIT(data, 6)); + if (BIT(diff, 7)) + LOGMASKED(LOG_PIN_WRITES, "ETNA CompactFlash Power: %d\n", BIT(data, 7)); + break; + } + case REG_PCDR: + { + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PCDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + const uint8_t old = m_ports[PORTC]; + m_ports[PORTC] = data; + const uint8_t diff = old ^ data; + if (BIT(diff, 0)) + LOGMASKED(LOG_PIN_WRITES, "RS232 RTS: %d\n", BIT(data, 0)); + if (BIT(diff, 1)) + LOGMASKED(LOG_PIN_WRITES, "RS232 DTR Toggle: %d\n", BIT(data, 1)); + if (BIT(diff, 2)) + LOGMASKED(LOG_PIN_WRITES, "Disable Power LED: %d\n", BIT(data, 2)); + if (BIT(diff, 3)) + LOGMASKED(LOG_PIN_WRITES, "Enable UART1: %d\n", BIT(data, 3)); + if (BIT(diff, 4)) + LOGMASKED(LOG_PIN_WRITES, "LCD Backlight: %d\n", BIT(data, 4)); + if (BIT(diff, 5)) + LOGMASKED(LOG_PIN_WRITES, "Enable UART0: %d\n", BIT(data, 5)); + if (BIT(diff, 6)) + LOGMASKED(LOG_PIN_WRITES, "Dictaphone: %d\n", BIT(data, 6)); + break; + } + case REG_PDDR: + { + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + const uint8_t old = m_ports[PORTD]; + m_ports[PORTD] = data; + const uint8_t diff = old ^ data; + if (BIT(diff, 0)) + LOGMASKED(LOG_PIN_WRITES, "Codec Enable: %d\n", BIT(data, 0)); + if (BIT(diff, 1)) + LOGMASKED(LOG_PIN_WRITES, "Audio Amp Enable: %d\n", BIT(data, 1)); + if (BIT(diff, 2)) + LOGMASKED(LOG_PIN_WRITES, "LCD Power: %d\n", BIT(data, 2)); + if (BIT(diff, 3)) + LOGMASKED(LOG_PIN_WRITES, "ETNA Door: %d\n", BIT(data, 3)); + if (BIT(diff, 4)) + LOGMASKED(LOG_PIN_WRITES, "Sled: %d\n", BIT(data, 4)); + if (BIT(diff, 5)) + LOGMASKED(LOG_PIN_WRITES, "Pump Power2: %d\n", BIT(data, 5)); + if (BIT(diff, 6)) + LOGMASKED(LOG_PIN_WRITES, "Pump Power1: %d\n", BIT(data, 6)); + if (BIT(diff, 7)) + LOGMASKED(LOG_PIN_WRITES, "ETNA Error: %d\n", BIT(data, 7)); + break; + } + case REG_PADDR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PADDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PBDDR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PBDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PCDDR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PCDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PDDDR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PDDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PEDR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PEDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_PEDDR: + LOGMASKED(LOG_GPIO_WRITES, "%s: peripheral write, PEDDR = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + case REG_KSCAN: + m_kbd_scan = data; + LOGMASKED(LOG_KBD_WRITES, "%s: peripheral write, KSCAN = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + case REG_LCDMUX: + LOGMASKED(LOG_LCD_WRITES, "%s: peripheral write, LCDMUX = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + + default: + LOGMASKED(LOG_UNKNOWNS, "%s: peripheral write, Unknown = %08x & %08x\n", machine().describe_context(), data, mem_mask); + break; + } +} + +uint8_t psion5mx_state::read_keyboard() +{ + if (BIT(m_kbd_scan, 3)) + { + return m_kbd_cols[m_kbd_scan & 7]->read(); + } + else if (m_kbd_scan == 0) + { + uint8_t rows = 0; + for (int i = 0; i < 8; i++) + { + rows |= m_kbd_cols[i]->read(); + } + return rows; + } + return 0x00; +} + +void psion5mx_state::main_map(address_map &map) +{ + map(0x00000000, 0x009fffff).rom().region("maincpu", 0); + map(0x20000000, 0x20000fff).rw(m_etna, FUNC(etna_device::regs_r), FUNC(etna_device::regs_w)); + map(0x80000000, 0x80000fff).rw(FUNC(psion5mx_state::periphs_r), FUNC(psion5mx_state::periphs_w)); + map(0xc0000000, 0xc03fffff).ram().mirror(0x1fc00000).share("lcd_ram"); +} + +void psion5mx_state::palette_init(palette_device &palette) +{ + for (int i = 0; i < 16; i++) + { + const int r = (0x99 * i) / 15; + const int g = (0xaa * i) / 15; + const int b = (0x88 * i) / 15; + m_palette->set_pen_color(15 - i, rgb_t(r, g, b)); + } +} + +uint32_t psion5mx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + const uint8_t *lcd_buf = (uint8_t*)&m_lcd_ram[(m_lcd_display_base_addr & 0x003fffff) >> 2]; + static const int width = 640; + static const int height = 240; + + // fetch palette + LOGMASKED(LOG_DISPLAY, "%02x %02x %02x %02x\n", lcd_buf[0], lcd_buf[1], lcd_buf[2], lcd_buf[3]); + + const int bpp = 1 << (lcd_buf[1] >> 4); + const int ppb = 8 / bpp; + LOGMASKED(LOG_DISPLAY, "bpp: %d, ppb: %d\n", bpp, ppb); + uint16_t palette[16] = {}; + for (int i = 0; i < 16; i++) + { + palette[i] = lcd_buf[i*2] | ((lcd_buf[i*2+1] << 8) & 0xf00); + LOGMASKED(LOG_DISPLAY, "palette[%d]: %04x\n", i, palette[i]); + } + + const pen_t *pen = m_palette->pens(); + + // build our image out + const int line_width = (width * bpp) / 8; + for (int y = 0; y < height; y++) + { + const int line_offs = 0x20 + (line_width * y); + uint32_t *line = &bitmap.pix(y); + for (int x = 0; x < width; x++) + { + const uint8_t byte = lcd_buf[line_offs + (x / ppb)]; + const int shift = (x & (ppb - 1)) * bpp; + const int mask = (1 << bpp) - 1; + const int pal_idx = (byte >> shift) & mask; + + line[x] = pen[palette[pal_idx]]; + } + } + return 0; +} + +INPUT_CHANGED_MEMBER(psion5mx_state::touch_down) +{ + if (newval) + { + logerror("Flagging EINT3\n"); + m_pending_ints |= (1 << IRQ_EINT3); + } + else + { + logerror("Unflagging EINT3\n"); + m_pending_ints &= ~(1 << IRQ_EINT3); + } + check_interrupts(); +} + +/* Input ports */ +INPUT_PORTS_START( psion5mx ) + PORT_START("TOUCHX") + PORT_BIT(0x3ff, 362, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(42,681) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) + + PORT_START("TOUCHY") + PORT_BIT(0x0ff, 125, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(5,244) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) + + PORT_START("TOUCH") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Touch") PORT_CHANGED_MEMBER(DEVICE_SELF, psion5mx_state, touch_down, 0) + PORT_BIT(0xfffe, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Dictaphone Record") PORT_CODE(KEYCODE_INSERT) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("'") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Dictaphone Play") PORT_CODE(KEYCODE_HOME) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Menu") PORT_CODE(KEYCODE_END) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL4") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL5") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Down Arrow") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Func") PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL6") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL7") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Arrow") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Arrow") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Up Arrow") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Dictaphone Stop") PORT_CODE(KEYCODE_PGUP) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) +INPUT_PORTS_END + +/* basic configuration for 2 lines display */ +void psion5mx_state::psion5mx(machine_config &config) +{ + /* basic machine hardware */ + ARM710T(config, m_maincpu, 36000000); // 36MHz, per wikipedia + m_maincpu->set_addrmap(AS_PROGRAM, &psion5mx_state::main_map); + + ETNA(config, m_etna); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); /* not accurate */ + screen.set_screen_update(FUNC(psion5mx_state::screen_update)); + screen.set_size(640, 240); + screen.set_visarea(0, 640-1, 0, 240-1); + + PALETTE(config, m_palette, FUNC(psion5mx_state::palette_init), 16); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00); +} + +/* ROM definition */ + +ROM_START( psion5mx ) + ROM_REGION( 0xa00000, "maincpu", 0 ) + ROM_LOAD( "5mx.rom", 0x000000, 0xa00000, CRC(a1e2d038) SHA1(4c082321264e1ae7fe77699e59b8960460690fa6) ) +ROM_END + +/* Driver */ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1999, psion5mx, 0, 0, psion5mx, psion5mx, psion5mx_state, empty_init, "Psion", "Series 5mx", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/pubint_storyreader.cpp b/src/mame/drivers/pubint_storyreader.cpp new file mode 100644 index 00000000000..108d4d8f5b0 --- /dev/null +++ b/src/mame/drivers/pubint_storyreader.cpp @@ -0,0 +1,171 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/****************************************************************************** + + Non-video 'electronic book' reader that takes cartridges + + Cartridges are accessed using serial read methods, contain data, not code + so must be internal ROMs on the systems. + + + --- + + V1 - rectangular cart + glob up, pins toward you, pins 1-10, left to right + + 1 tied high + 2 CE1 left glob + 3 CE2 right glob + 4 pin 5 + 5 pin 4 + 6 data + 7 ground + 8 clock + 9 3.3 volts + 10 tied high + + ---- + + V2 - rounded top cart + + 1 CE1 left glob + 2 CE2 right glob + 3 tied high + 4 ground + 5 clock + 6 data + 7 ground + 8 ground + 9 3.3 volts + 10 tied high + + V2 PCB silkscreened with GPR23L822A - 8Mbit serial ROM + + ---- + + To dump: + set data and clock high, CE1 low for 1 mS + set CE1 high for 3 uS + set data low for 2 uS + set clock low for 2 uS + set data high for 2 uS + set clock high for 2 uS + set clock low for 2 uS + set data low for 2 uS + loop 24 times: + set clock high for 1 uS + set clock low for 1 uS + make data high Z + loop 8M tims: + set clock high for 1 uS + sample data + set clock low for 1 uS + set CE1 low + + if 2 globs, repeat with CE2 + +*******************************************************************************/ + +#include "emu.h" + +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include "screen.h" +#include "softlist.h" +#include "speaker.h" + +class pi_storyreader_state : public driver_device +{ +public: + pi_storyreader_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_cart(*this, "cartslot"), + m_cart_region(nullptr) + { } + + void pi_storyreader(machine_config &config); + void pi_storyreader_v2(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + + required_device<generic_slot_device> m_cart; + memory_region *m_cart_region; +}; + + + +void pi_storyreader_state::machine_start() +{ + // if there's a cart, override the standard mapping + if (m_cart && m_cart->exists()) + { + std::string region_tag; + m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + } +} + +void pi_storyreader_state::machine_reset() +{ +} + +DEVICE_IMAGE_LOAD_MEMBER(pi_storyreader_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + +static INPUT_PORTS_START( pi_storyreader ) +INPUT_PORTS_END + + +void pi_storyreader_state::pi_storyreader(machine_config &config) +{ + // unknown CPU / MCU type + + // screenless + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "pi_storyreader_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(pi_storyreader_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("pi_storyreader_cart"); +} + +void pi_storyreader_state::pi_storyreader_v2(machine_config &config) +{ + // unknown CPU / MCU type + + // screenless + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "pi_storyreader_v2_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(pi_storyreader_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("pi_storyreader_v2_cart"); +} + + +ROM_START( pi_stry ) + ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "internal.mcu.rom", 0x0000, 0x1000, NO_DUMP ) // unknown type / size +ROM_END + +ROM_START( pi_stry2 ) + ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "internal.mcu.rom", 0x0000, 0x1000, NO_DUMP ) // unknown type / size +ROM_END + +// year, name, parent, compat, machine, input, class, init, company, fullname, flags + +// These are said to not be compatible with each other +CONS( 200?, pi_stry, 0, 0, pi_storyreader, pi_storyreader, pi_storyreader_state, empty_init, "Publications International Ltd", "Story Reader", MACHINE_IS_SKELETON ) +CONS( 200?, pi_stry2, 0, 0, pi_storyreader_v2, pi_storyreader, pi_storyreader_state, empty_init, "Publications International Ltd", "Story Reader 2.0", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp index 70844f5f3df..331443d8df4 100644 --- a/src/mame/drivers/rainbow.cpp +++ b/src/mame/drivers/rainbow.cpp @@ -3391,7 +3391,7 @@ ROM_START(rainbow100a) ROM_LOAD("23-176e4-00.e89", 0xfa000, 0x2000, CRC(405e9619) SHA1(86604dccea84b46e05d705abeda25b12f7cc8c59)) // ROM (FA000-FBFFF) (E89) 8 K ROM_LOAD("23-177e4-00.e90", 0xfc000, 0x2000, CRC(1ec72a66) SHA1(ed19944ae711e97d6bec34c885be04c4c3c95852)) // ROM (FC000-FDFFF) (E90) 8 K - ROM_FILL(0xfa26d, 1, 0x00) // [0xFA000 + 0x026d] disable CRC check [100-A ROM] + ROM_FILL(0xfa26d, 1, 0x00) // [0xFA000 + 0x026d] disable CRC check [100-A ROM] ROM_FILL(0xfadea, 1, 0x00) // [0xFA000 + 0x0dea] Floppy workaround: in case of Z80 RESPONSE FAILURE ($80 bit set in AL), don't block floppy access // SOCKETED LANGUAGE ROM (E91) with 1 single localization per ROM - @@ -3424,7 +3424,7 @@ ROM_START(rainbow) // BOOT ROM ROM_LOAD("23-022e5-00.bin", 0xf0000, 0x4000, CRC(9d1332b4) SHA1(736306d2a36bd44f95a39b36ebbab211cc8fea6e)) ROM_RELOAD(0xf4000, 0x4000) - ROM_FILL(0xf4303, 1, 0x00) // [0xf4000 + 0x0303] disable CRC check [100-B ROM] + ROM_FILL(0xf4303, 1, 0x00) // [0xf4000 + 0x0303] disable CRC check [100-B ROM] ROM_FILL(0xf535e, 1, 0x00) // [0xf4000 + 0x135e] Floppy workaround: in case of Z80 RESPONSE FAILURE ($80 bit set in AL), don't block floppy access diff --git a/src/mame/drivers/rampart.cpp b/src/mame/drivers/rampart.cpp index 4d414967a9a..eeaa3b0a3d8 100644 --- a/src/mame/drivers/rampart.cpp +++ b/src/mame/drivers/rampart.cpp @@ -7,7 +7,7 @@ driver by Aaron Giles Games supported: - * Rampart (1990) [3 sets] + * Rampart (1990) [4 sets] Known bugs: * P3 trackball doesn't work, maybe it needs some kind of fake input port @@ -30,8 +30,6 @@ #include "cpu/m68000/m68000.h" #include "machine/eeprompar.h" #include "machine/watchdog.h" -#include "sound/okim6295.h" -#include "sound/ym2413.h" #include "emupal.h" #include "speaker.h" @@ -436,6 +434,37 @@ ROM_START( rampart2p ) ROM_END +ROM_START( rampart2pa ) // original Atari PCB but with mostly hand-written labels, uses smaller ROMs for the main CPU + ROM_REGION( 0x148000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "0h.13k-l", 0x00000, 0x20000, CRC(d4e26d0f) SHA1(5106549e6d003711bfd390aa2e19e6e5f33f2cf9) ) + ROM_LOAD16_BYTE( "0l.13h", 0x00001, 0x20000, CRC(ed2a49bd) SHA1(b97ee41b7f930ba7b8b113c1b19c7729a5880b1f) ) + ROM_LOAD16_BYTE( "1h.13l", 0x40000, 0x20000, CRC(b232b807) SHA1(1e405371595d97d44dec97387a0dedc6bc1ad1d2) ) + ROM_LOAD16_BYTE( "1l.13h-j", 0x40001, 0x20000, CRC(a2db78b1) SHA1(586ee0b5901b685ac3c2bfad1d8ce1cd51def292) ) + ROM_LOAD16_BYTE( "2h.13m", 0x80000, 0x20000, CRC(37b32b7e) SHA1(3f6c969829b5ca866e8e162ccecdf9ec7c17d808) ) + ROM_LOAD16_BYTE( "2l.13j", 0x80001, 0x20000, CRC(00cd567b) SHA1(1d6ee16dd5af3328365dafb2fc771396f53dbc44) ) + ROM_LOAD16_BYTE( "3h.13n", 0xc0000, 0x20000, CRC(c23b1c98) SHA1(abd8e2738bb945476dc9f848290880d7ece92081) ) + ROM_LOAD16_BYTE( "3l.13k", 0xc0001, 0x20000, CRC(0a12ca83) SHA1(2f44420b94b981af1d65cb775e4799bc43898041) ) + + ROM_REGION( 0x20000, "gfx1", ROMREGION_INVERT ) + ROM_LOAD( "atr.2n", 0x000000, 0x20000, CRC(efa38bef) SHA1(d38448138134e7a0be2a75c3cd6ab0729da5b83b) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM data */ + ROM_LOAD( "arom0_2_player_136082-1007.2d", 0x00000, 0x20000, CRC(c96a0fc3) SHA1(6e7e242d0afa4714ca31d77ccbf8ee487bbdb1e4) ) + ROM_LOAD( "arom1_2_player_136082-1006.1d", 0x20000, 0x20000, CRC(518218d9) SHA1(edf1b11579dcfa9a872fa4bd866dc2f95fac767d) ) + + ROM_REGION( 0x800, "eeprom", 0 ) + ROM_LOAD( "rampart-eeprom.bin", 0x0000, 0x800, CRC(0be57615) SHA1(bd1f9eef410c78c091d2c925d6275427c77c7ecd) ) + + ROM_REGION( 0x0c00, "plds", 0 ) + ROM_LOAD( "gal16v8-136082-1000.1j", 0x0000, 0x0117, CRC(18f82b38) SHA1(2ffd43a143396617704ced51da78fec2cf12cced) ) // not dumped for this set but same part number as rampart2p + ROM_LOAD( "gal16v8-136082-1001.4l", 0x0200, 0x0117, CRC(74d75d68) SHA1(dc3ee765ec48a76af6433026243284437958a39a) ) // not dumped for this set but same part number as rampart2p + ROM_LOAD( "gal16v8-136082-1002.7k", 0x0400, 0x0117, CRC(f593401f) SHA1(fbc258cd389f397a005a522812d412f4ed9bf407) ) // not dumped for this set but same part number as rampart2p + ROM_LOAD( "gal20v8-136082-1003.8j", 0x0600, 0x0157, CRC(67bb9705) SHA1(65bb31421f1303fce546781a463cc76921e58b25) ) // not dumped for this set but same part number as rampart2p + ROM_LOAD( "gal20v8-136082-1004.8m", 0x0800, 0x0157, CRC(0001ed7d) SHA1(c16a695361ee17d7508f6fb46854a9189549e3a3) ) // not dumped for this set but same part number as rampart2p + ROM_LOAD( "gal16v8-136082-1005.12c", 0x0a00, 0x0117, CRC(42c05114) SHA1(869a7f07da2d096b5a62f694db0dc1ca62d62242) ) // dumped for this set, matches rampartj (same part number) +ROM_END + + ROM_START( rampartj ) ROM_REGION( 0x148000, "maincpu", 0 ) ROM_LOAD16_BYTE( "136082-3451.bin", 0x00000, 0x20000, CRC(c6596d32) SHA1(3e3e0cbb3b5fc6dd9685bbc4b18c22e0858d9282) ) @@ -490,6 +519,7 @@ void rampart_state::init_rampart() * *************************************/ -GAME( 1990, rampart, 0, rampart, rampart, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Trackball)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, rampart2p,rampart, rampart, ramprt2p, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Joystick)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, rampartj, rampart, rampart, rampartj, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Japan, Joystick)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, rampart, 0, rampart, rampart, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Trackball)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, rampart2p, rampart, rampart, ramprt2p, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Joystick, bigger ROMs)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, rampart2pa, rampart, rampart, ramprt2p, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Joystick, smaller ROMs)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, rampartj, rampart, rampart, rampartj, rampart_state, init_rampart, ROT0, "Atari Games", "Rampart (Japan, Joystick)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/regence.cpp b/src/mame/drivers/regence.cpp index c57a2a25cd5..0301ece923e 100644 --- a/src/mame/drivers/regence.cpp +++ b/src/mame/drivers/regence.cpp @@ -47,7 +47,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void regence(machine_config &config); protected: @@ -174,7 +174,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void regence_state::regence(machine_config &config) diff --git a/src/mame/drivers/relief.cpp b/src/mame/drivers/relief.cpp index a3a798316a0..cfa21876b00 100644 --- a/src/mame/drivers/relief.cpp +++ b/src/mame/drivers/relief.cpp @@ -7,11 +7,57 @@ driver by Aaron Giles Games supported: - * Relief Pitcher (1990) [2 sets] + * Relief Pitcher (1990) [3 sets] Known bugs: * none at this time +From Atari Games Bulletin: + + ATARI + GAMES + BULLENTIN + From Atari field Service + +Attention Service Managers June 4th 1992 + + Relief Pitcher Software updates + +The codes on two EPROMS have been updated, the part numbers +and locations are 13693-0011 Rev D location 19E and +136093-0012 Rev D location 19J + +The main features of the NEW program are: + +REDUCE GAME TIME +If you are experiencing long game time on your Relief Pitcher +game these two new Rev D EPROMS will give you more difficulty +settings to help eliminate that problem. + +Eight new difficulty settings have been added to the Rev D +EPROMS, with the default set to Hard. + +RESET PROBLEM: +There is a possibility the game my HANG UP and RESET if +there is a problem with the base running or when the fielder +catches a flyball. + +MISCELLANEOUS. +When set to NO, AUDIO IN THE ATTRACT will be completely +disabled + +In the two player game, the players were given a free second +inning - this has been eliminated. + +Fix the various cosmetic problems in the newspaper and audio. + +Eprom updates will be available upon request through you +Atari Distributor + +If you have any questions please call your +Atari Distributor or Atari Games Customer Service + + **************************************************************************** Memory map (TBA) @@ -307,8 +353,8 @@ ROM_START( relief ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 8*64k for 68000 code */ ROM_LOAD16_BYTE( "136093-0011d.19e", 0x00000, 0x20000, CRC(cb3f73ad) SHA1(533a96095e678b4a414d6d9b861b1d4010ced30f) ) ROM_LOAD16_BYTE( "136093-0012d.19j", 0x00001, 0x20000, CRC(90655721) SHA1(f50a2f317215a864d09e33a4acd927b873350425) ) - ROM_LOAD16_BYTE( "136093-0013.17e", 0x40000, 0x20000, CRC(1e1e82e5) SHA1(d33c84ae950db9775f9db9bf953aa63188d3f2f9) ) - ROM_LOAD16_BYTE( "136093-0014.17j", 0x40001, 0x20000, CRC(19e5decd) SHA1(8d93d93f966df46d59cf9f4cdaa689e4dcd2689a) ) + ROM_LOAD16_BYTE( "136093-0013.17e", 0x40000, 0x20000, CRC(1e1e82e5) SHA1(d33c84ae950db9775f9db9bf953aa63188d3f2f9) ) + ROM_LOAD16_BYTE( "136093-0014.17j", 0x40001, 0x20000, CRC(19e5decd) SHA1(8d93d93f966df46d59cf9f4cdaa689e4dcd2689a) ) ROM_REGION( 0x280000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "136093-0025a.14s", 0x000000, 0x80000, CRC(1b9e5ef2) SHA1(d7d14e75ca2d56c5c67154506096570c9ccbcf8e) ) @@ -322,7 +368,7 @@ ROM_START( relief ) ROM_LOAD( "136093-0031a.10b", 0x080000, 0x80000, CRC(ba908d73) SHA1(a83afd86f4c39394cf624b728a87b8d8b6de1944) ) ROM_REGION( 0x800, "eeprom", 0 ) - ROM_LOAD( "relief-eeprom.bin", 0x0000, 0x800, CRC(66069f60) SHA1(fac3797888f7ffe972f642aca44c6ca7d208c814) ) + ROM_LOAD( "relief_rev_d-eeprom.bin", 0x0000, 0x800, CRC(66069f60) SHA1(fac3797888f7ffe972f642aca44c6ca7d208c814) ) ROM_REGION( 0x001000, "plds", 0 ) ROM_LOAD( "gal16v8a-136093-0002.15f", 0x0000, 0x0117, CRC(b111d5f2) SHA1(0fe5b4ca786e839e6927a485109d33fe31c737a2) ) @@ -340,10 +386,10 @@ ROM_END // MAIN: 26 APR 1992 21:18:13 ROM_START( relief2 ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 8*64k for 68000 code */ - ROM_LOAD16_BYTE( "19e", 0x00000, 0x20000, CRC(41373e02) SHA1(1982be3d2b959f3504cd7e4afacd96bbebc27b8e) ) - ROM_LOAD16_BYTE( "19j", 0x00001, 0x20000, CRC(8187b026) SHA1(1408b5482194161c1fbb30911bb5b64a14b8ffb0) ) - ROM_LOAD16_BYTE( "136093-0013.17e", 0x40000, 0x20000, CRC(1e1e82e5) SHA1(d33c84ae950db9775f9db9bf953aa63188d3f2f9) ) - ROM_LOAD16_BYTE( "136093-0014.17j", 0x40001, 0x20000, CRC(19e5decd) SHA1(8d93d93f966df46d59cf9f4cdaa689e4dcd2689a) ) + ROM_LOAD16_BYTE( "136093-0011c.19e", 0x00000, 0x20000, CRC(41373e02) SHA1(1982be3d2b959f3504cd7e4afacd96bbebc27b8e) ) + ROM_LOAD16_BYTE( "136093-0012c.19j", 0x00001, 0x20000, CRC(8187b026) SHA1(1408b5482194161c1fbb30911bb5b64a14b8ffb0) ) + ROM_LOAD16_BYTE( "136093-0013.17e", 0x40000, 0x20000, CRC(1e1e82e5) SHA1(d33c84ae950db9775f9db9bf953aa63188d3f2f9) ) + ROM_LOAD16_BYTE( "136093-0014.17j", 0x40001, 0x20000, CRC(19e5decd) SHA1(8d93d93f966df46d59cf9f4cdaa689e4dcd2689a) ) ROM_REGION( 0x280000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "136093-0025a.14s", 0x000000, 0x80000, CRC(1b9e5ef2) SHA1(d7d14e75ca2d56c5c67154506096570c9ccbcf8e) ) @@ -357,7 +403,7 @@ ROM_START( relief2 ) ROM_LOAD( "136093-0031a.10b", 0x080000, 0x80000, CRC(ba908d73) SHA1(a83afd86f4c39394cf624b728a87b8d8b6de1944) ) ROM_REGION( 0x800, "eeprom", 0 ) - ROM_LOAD( "relief2-eeprom.bin", 0x0000, 0x800, CRC(2131fc40) SHA1(72a9f5f6647fbc74e645b6639db2fdbfbe6456e2) ) + ROM_LOAD( "relief-eeprom.bin", 0x0000, 0x800, CRC(2131fc40) SHA1(72a9f5f6647fbc74e645b6639db2fdbfbe6456e2) ) ROM_REGION( 0x001000, "plds", 0 ) ROM_LOAD( "gal16v8a-136093-0002.15f", 0x0000, 0x0117, CRC(b111d5f2) SHA1(0fe5b4ca786e839e6927a485109d33fe31c737a2) ) @@ -376,8 +422,8 @@ ROM_START( relief3 ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 8*64k for 68000 code */ ROM_LOAD16_BYTE( "136093-0011b.19e", 0x00000, 0x20000, CRC(794cea33) SHA1(6e9830ce04a505746dea5aafaf37c629c28b061d) ) ROM_LOAD16_BYTE( "136093-0012b.19j", 0x00001, 0x20000, CRC(577495f8) SHA1(f45b0928b13db7f49b7688620008fc03fca08cde) ) - ROM_LOAD16_BYTE( "136093-0013.17e", 0x40000, 0x20000, CRC(1e1e82e5) SHA1(d33c84ae950db9775f9db9bf953aa63188d3f2f9) ) - ROM_LOAD16_BYTE( "136093-0014.17j", 0x40001, 0x20000, CRC(19e5decd) SHA1(8d93d93f966df46d59cf9f4cdaa689e4dcd2689a) ) + ROM_LOAD16_BYTE( "136093-0013.17e", 0x40000, 0x20000, CRC(1e1e82e5) SHA1(d33c84ae950db9775f9db9bf953aa63188d3f2f9) ) + ROM_LOAD16_BYTE( "136093-0014.17j", 0x40001, 0x20000, CRC(19e5decd) SHA1(8d93d93f966df46d59cf9f4cdaa689e4dcd2689a) ) ROM_REGION( 0x280000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "136093-0025a.14s", 0x000000, 0x80000, CRC(1b9e5ef2) SHA1(d7d14e75ca2d56c5c67154506096570c9ccbcf8e) ) @@ -391,7 +437,7 @@ ROM_START( relief3 ) ROM_LOAD( "136093-0031a.10b", 0x080000, 0x80000, CRC(ba908d73) SHA1(a83afd86f4c39394cf624b728a87b8d8b6de1944) ) ROM_REGION( 0x800, "eeprom", 0 ) - ROM_LOAD( "relief3-eeprom.bin", 0x0000, 0x800, CRC(2131fc40) SHA1(72a9f5f6647fbc74e645b6639db2fdbfbe6456e2) ) + ROM_LOAD( "relief-eeprom.bin", 0x0000, 0x800, CRC(2131fc40) SHA1(72a9f5f6647fbc74e645b6639db2fdbfbe6456e2) ) ROM_REGION( 0x001000, "plds", 0 ) ROM_LOAD( "gal16v8a-136093-0002.15f", 0x0000, 0x0117, CRC(b111d5f2) SHA1(0fe5b4ca786e839e6927a485109d33fe31c737a2) ) @@ -427,6 +473,6 @@ void relief_state::init_relief() * *************************************/ -GAME( 1992, relief, 0, relief, relief, relief_state, init_relief, ROT0, "Atari Games", "Relief Pitcher (set 1, 07 Jun 1992 / 28 May 1992)", 0 ) -GAME( 1992, relief2, relief, relief, relief, relief_state, init_relief, ROT0, "Atari Games", "Relief Pitcher (set 2, 26 Apr 1992 / 08 Apr 1992)", 0 ) -GAME( 1992, relief3, relief, relief, relief, relief_state, init_relief, ROT0, "Atari Games", "Relief Pitcher (set 3, 10 Apr 1992 / 08 Apr 1992)", 0 ) +GAME( 1992, relief, 0, relief, relief, relief_state, init_relief, ROT0, "Atari Games", "Relief Pitcher (Rev D, 07 Jun 1992 / 28 May 1992)", 0 ) +GAME( 1992, relief2, relief, relief, relief, relief_state, init_relief, ROT0, "Atari Games", "Relief Pitcher (Rev C, 26 Apr 1992 / 08 Apr 1992)", 0 ) +GAME( 1992, relief3, relief, relief, relief, relief_state, init_relief, ROT0, "Atari Games", "Relief Pitcher (Rev B, 10 Apr 1992 / 08 Apr 1992)", 0 ) diff --git a/src/mame/drivers/riscpc.cpp b/src/mame/drivers/riscpc.cpp index c7726fdb86f..3910ea42127 100644 --- a/src/mame/drivers/riscpc.cpp +++ b/src/mame/drivers/riscpc.cpp @@ -8,11 +8,11 @@ based on work by Tomasz Slanina and Sarah Walker TODO: - - IOMD currently hardwired with ARM7500FE flavour for all machines, needs information about - which uses what; - - PS/2 keyboard doesn't work properly; + - IOMD currently hardwired with ARM7500FE flavour for all machines, needs information about + which uses what; + - PS/2 keyboard doesn't work properly; - Fix pendingUnd fatalerror from ARM7 core; - - Fix pendingAbtD fatalerror for RiscOS 4.xx; + - Fix pendingAbtD fatalerror for RiscOS 4.xx; ****************************************************************************/ @@ -65,7 +65,7 @@ private: void a7000_map(address_map &map); void riscpc_map(address_map &map); - + bool m_i2cmem_clock; DECLARE_READ_LINE_MEMBER(iocr_od0_r); DECLARE_READ_LINE_MEMBER(iocr_od1_r); @@ -196,7 +196,7 @@ void riscpc_state::base_config(machine_config &config) m_vidc->set_screen("screen"); m_vidc->vblank().set(m_iomd, FUNC(arm_iomd_device::vblank_irq)); m_vidc->sound_drq().set(m_iomd, FUNC(arm_iomd_device::sound_drq)); - + m_iomd->set_host_cpu_tag(m_maincpu); m_iomd->set_vidc_tag(m_vidc); m_iomd->set_kbdc_tag(m_kbdc); @@ -209,7 +209,7 @@ void riscpc_state::base_config(machine_config &config) void riscpc_state::rpc600(machine_config &config) { constexpr XTAL cpuxtal(60_MHz_XTAL/2); - + ARM7(config, m_maincpu, cpuxtal); // really ARM610 m_maincpu->set_addrmap(AS_PROGRAM, &riscpc_state::riscpc_map); @@ -252,7 +252,7 @@ void riscpc_state::a7000p(machine_config &config) void riscpc_state::sarpc(machine_config &config) { // TODO: ranges from 160 to 233 MHz - constexpr XTAL cpuxtal(200'000'000); + constexpr XTAL cpuxtal(200'000'000); SA1110(config, m_maincpu, cpuxtal); // StrongARM m_maincpu->set_addrmap(AS_PROGRAM, &riscpc_state::riscpc_map); diff --git a/src/mame/drivers/route16.cpp b/src/mame/drivers/route16.cpp index 55d678d6b15..772ffb3c0b3 100644 --- a/src/mame/drivers/route16.cpp +++ b/src/mame/drivers/route16.cpp @@ -71,7 +71,8 @@ New code to better emulate the protection was added in 0.194, but it turned out to harbour a bug (see MT 07310). Therefore the previous patches have been restored, and the protection routine has been nullified (but still there in case someone wants to revisit it). - ***************************************************************************/ + +***************************************************************************/ #include "emu.h" #include "includes/route16.h" @@ -87,11 +88,120 @@ case someone wants to revisit it). /************************************* * - * Shared RAM handling + * Drivers specific initialization * *************************************/ +MACHINE_START_MEMBER(route16_state, speakres) +{ + save_item(NAME(m_speakres_vrx)); +} + +MACHINE_START_MEMBER(route16_state, jongpute) +{ + save_item(NAME(m_jongpute_port_select)); +} + +void route16_state::init_route16() +{ + // hack out the protection + u8 *rom = memregion("cpu1")->base(); + rom[0x105] = 0; // remove jp nz,4109 + rom[0x106] = 0; + rom[0x107] = 0; + + rom[0x72a] = 0; // remove jp nz,4238 + rom[0x72b] = 0; + rom[0x72c] = 0; + init_route16c(); +} + +void route16_state::init_route16a() +{ + save_item(NAME(m_protection_data)); + // hack out the protection + u8 *rom = memregion("cpu1")->base(); + rom[0x105] = 0; // remove jp nz,4109 + rom[0x106] = 0; + rom[0x107] = 0; + + rom[0x731] = 0; // remove jp nz,4238 + rom[0x732] = 0; + rom[0x733] = 0; + + rom[0x0e9] = 0x3a; // remove call 2CCD + rom[0x747] = 0xc3; // skip protection checking + rom[0x748] = 0x56; + rom[0x749] = 0x07; +} + +void route16_state::init_route16c() +{ + save_item(NAME(m_protection_data)); + // hack out the protection + u8 *rom = memregion("cpu1")->base(); + rom[0x0e9] = 0x3a; // remove call 2CD8 + + rom[0x754] = 0xc3; // skip protection checking + rom[0x755] = 0x63; + rom[0x756] = 0x07; +} + +void route16_state::init_vscompmj() // only opcodes encrypted +{ + uint8_t *rom = memregion("cpu1")->base(); + + uint8_t unk0 = 0x00; + uint8_t unk1 = 0x00; + + static const uint8_t xor_table_00[0x08][0x08] = + { + { 0x04, 0x01, 0x14, 0x14, 0x05, 0x10, 0x54, 0x05 }, // 0x0x and 0x2x + { 0x15, 0x51, 0x01, 0x44, 0x50, 0x44, 0x11, 0x50 }, // 0x1x and 0x3x + { 0x14, 0x50, 0x41, 0x15, 0x50, 0x15, 0x15, 0x41 }, // 0x4x and 0x6x + { 0x11, 0x04, 0x40, 0x11, 0x11, 0x45, 0x10, 0x14 }, // 0x5x and 0x7x + { 0x40, unk0, 0x15, unk0, 0x01, 0x44, 0x14, 0x54 }, // 0x8x and 0xax + { 0x11, 0x40, unk0, unk0, 0x14, 0x01, 0x54, 0x51 }, // 0x9x and 0xbx + { 0x05, 0x45, 0x10, 0x55, 0x51, 0x15, 0x55, 0x11 }, // 0xcx and 0xex + { unk0, 0x41, 0x51, 0x10, 0x01, 0x44, 0x50, 0x50 }, // 0xdx and 0xfx + }; + + static const uint8_t xor_table_01[0x08][0x08] = + { + { 0x41, 0x41, 0x45, 0x54, 0x44, 0x40, 0x55, 0x41 }, // 0x0x and 0x2x + { 0x14, 0x14, 0x04, 0x45, 0x44, 0x01, 0x05, 0x05 }, // 0x1x and 0x3x + { 0x40, 0x14, 0x01, 0x11, 0x45, 0x14, 0x04, 0x50 }, // 0x4x and 0x6x + { 0x04, 0x40, 0x55, 0x55, 0x44, 0x40, 0x55, 0x55 }, // 0x5x and 0x7x + { 0x01, 0x05, 0x14, 0x10, 0x01, unk1, 0x04, 0x04 }, // 0x8x and 0xax + { 0x10, 0x04, 0x51, 0x01, 0x04, 0x04, 0x45, 0x51 }, // 0x9x and 0xbx + { 0x11, 0x01, 0x44, 0x44, 0x05, 0x15, 0x10, 0x05 }, // 0xcx and 0xex + { unk1, 0x14, 0x05, unk1, 0x01, 0x41, 0x04, 0x40 }, // 0xdx and 0xfx + }; + + for (int i = 0; i < 0x8000; i++) + { + uint8_t x = rom[i]; + + uint8_t row = (BIT(x, 4) + (BIT(x, 6) << 1) + (BIT(x, 7) << 2)); + + uint8_t xor_v = x & 0x07; + + switch(i & 0x01) + { + case 0x00: x ^= xor_table_00[row][xor_v]; break; + case 0x01: x ^= xor_table_01[row][xor_v]; break; + } + + m_decrypted_opcodes[i] = x; + } +} + +/************************************* + * + * Shared RAM handling + * + *************************************/ template<bool cpu1> WRITE8_MEMBER(route16_state::route16_sharedram_w) { @@ -109,6 +219,29 @@ template<bool cpu1> WRITE8_MEMBER(route16_state::route16_sharedram_w) /************************************* * + * Protection handling + * + *************************************/ + +READ8_MEMBER(route16_state::routex_prot_read) +{ + if (m_cpu1->pc() == 0x2f) return 0xfb; + + logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", m_cpu1->tag(), m_cpu1->pc()); + return 0x00; +} + +// never called, see notes. +READ8_MEMBER(route16_state::route16_prot_read) +{ + m_protection_data++; + return (1 << ((m_protection_data >> 1) & 7)); +} + + + +/************************************* + * * Stratovox's extra sound effects * *************************************/ @@ -139,12 +272,10 @@ WRITE8_MEMBER(route16_state::stratvox_sn76477_w) /*************************************************** * - * Jongputer and T.T Mahjong's multiplixed ports + * Jongputer and T.T Mahjong's multiplexed ports * ***************************************************/ - - WRITE8_MEMBER(route16_state::jongpute_input_port_matrix_w) { m_jongpute_port_select = data; @@ -280,6 +411,19 @@ void route16_state::jongpute_cpu1_map(address_map &map) map(0x8000, 0xbfff).ram().share("videoram1"); } +void route16_state::vscompmj_cpu1_map(address_map &map) +{ + jongpute_cpu1_map(map); + + map(0x6900, 0x6900).r("ay8910", FUNC(ay8910_device::data_r)); // TODO: check this, stuck notes + map(0x7000, 0x7fff).rom(); +} + +void route16_state::vscompmj_decrypted_opcodes(address_map &map) +{ + map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); +} + void route16_state::route16_cpu2_map(address_map &map) { @@ -307,16 +451,22 @@ void route16_state::cpu1_io_map(address_map &map) +/************************************* + * + * Input ports + * + *************************************/ + static INPUT_PORTS_START( route16 ) PORT_START("DSW") /* DSW 1 */ PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x01, "5" ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // Doesn't seem to - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // be referenced + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // Doesn't seem to be referenced + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) // Doesn't seem to - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // be referenced + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) // Doesn't seem to be referenced + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) @@ -360,7 +510,7 @@ static INPUT_PORTS_START( stratvox ) PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x01, "5" ) - PORT_DIPNAME( 0x02, 0x00, "Replenish Astronouts" ) + PORT_DIPNAME( 0x02, 0x00, "Replenish Astronauts" ) PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_DIPNAME( 0x0c, 0x00, "2 Attackers At Wave" ) @@ -451,7 +601,7 @@ static INPUT_PORTS_START( spacecho ) PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x01, "5" ) - PORT_DIPNAME( 0x02, 0x00, "Replenish Astronouts" ) + PORT_DIPNAME( 0x02, 0x00, "Replenish Astronauts" ) PORT_DIPSETTING( 0x02, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_DIPNAME( 0x0c, 0x00, "2 Attackers At Wave" ) @@ -494,7 +644,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( jongpute ) PORT_START("DSW") /* IN0 */ - PORT_DIPNAME( 0x0c, 0x08, "Timer Descrement Speed" ) + PORT_DIPNAME( 0x0c, 0x08, "Timer Decrement Speed" ) PORT_DIPSETTING( 0x00, "Very Fast" ) PORT_DIPSETTING( 0x04, "Fast" ) PORT_DIPSETTING( 0x08, "Normal" ) @@ -581,61 +731,13 @@ static INPUT_PORTS_START( jongpute ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) INPUT_PORTS_END -MACHINE_START_MEMBER(route16_state, speakres) -{ - save_item(NAME(m_speakres_vrx)); -} - -MACHINE_START_MEMBER(route16_state, jongpute) -{ - save_item(NAME(m_jongpute_port_select)); -} - -void route16_state::init_route16() -{ - // hack out the protection - u8 *rom = memregion("cpu1")->base(); - rom[0x105] = 0; // remove jp nz,4109 - rom[0x106] = 0; - rom[0x107] = 0; - - rom[0x72a] = 0; // remove jp nz,4238 - rom[0x72b] = 0; - rom[0x72c] = 0; - init_route16c(); -} - -void route16_state::init_route16a() -{ - save_item(NAME(m_protection_data)); - // hack out the protection - u8 *rom = memregion("cpu1")->base(); - rom[0x105] = 0; // remove jp nz,4109 - rom[0x106] = 0; - rom[0x107] = 0; - - rom[0x731] = 0; // remove jp nz,4238 - rom[0x732] = 0; - rom[0x733] = 0; - rom[0x0e9] = 0x3a; // remove call 2CCD - rom[0x747] = 0xc3; // skip protection checking - rom[0x748] = 0x56; - rom[0x749] = 0x07; -} - -void route16_state::init_route16c() -{ - save_item(NAME(m_protection_data)); - // hack out the protection - u8 *rom = memregion("cpu1")->base(); - rom[0x0e9] = 0x3a; // remove call 2CD8 - - rom[0x754] = 0xc3; // skip protection checking - rom[0x755] = 0x63; - rom[0x756] = 0x07; -} +/************************************* + * + * Machine configs + * + *************************************/ void route16_state::route16(machine_config &config) { @@ -741,7 +843,13 @@ void route16_state::jongpute(machine_config &config) PALETTE(config.replace(), m_palette, palette_device::BGR_3BIT); } +void route16_state::vscompmj(machine_config &config) +{ + jongpute(config); + m_cpu1->set_addrmap(AS_PROGRAM, &route16_state::vscompmj_cpu1_map); + m_cpu1->set_addrmap(AS_OPCODES, &route16_state::vscompmj_decrypted_opcodes); +} /************************************* * @@ -749,7 +857,7 @@ void route16_state::jongpute(machine_config &config) * *************************************/ - ROM_START( route16 ) +ROM_START( route16 ) ROM_REGION( 0x10000, "cpu1", 0 ) ROM_LOAD( "tvg54.a0", 0x0000, 0x0800, CRC(aef9ffc1) SHA1(178d23e4963336ded93c13cb17940a4ae98270c5) ) ROM_LOAD( "tvg55.a1", 0x0800, 0x0800, CRC(389bc077) SHA1(b0606f6e647e81ceae7148bda96bd4673a51e823) ) @@ -1088,38 +1196,25 @@ ROM_START( jongpute ) ROM_LOAD( "ju09", 0x0100, 0x0100, BAD_DUMP CRC(27d47624) SHA1(ee04ce8043216be8b91413b546479419fca2b917) ) ROM_END +ROM_START( vscompmj ) + ROM_REGION( 0x8000, "cpu1", 0 ) // all 2732 + ROM_LOAD( "j2_1.0r", 0x0000, 0x1000, CRC(e112ac58) SHA1(a274080dfd89c547335f93cb8f99e80ec7b972df) ) + ROM_LOAD( "j2_2.0n", 0x1000, 0x1000, CRC(c751c041) SHA1(69063549e616fdd9d175b47275331986f1d3e0bd) ) + ROM_LOAD( "j2_3.0l", 0x2000, 0x1000, CRC(e85bf26b) SHA1(8bb6625433c9f86808a41bde7dd587bdc430b934) ) + ROM_LOAD( "j2_4.0k", 0x3000, 0x1000, CRC(ead1b054) SHA1(fa0940391968541cdfd3d306c7bfd6781617b580) ) + ROM_LOAD( "j2_5.0j", 0x7000, 0x1000, CRC(cbf49c08) SHA1(064054fd9e36c8a359926ade4fc10855d3058f01) ) -/************************************* - * - * Protection handling - * - *************************************/ - -READ8_MEMBER(route16_state::routex_prot_read) -{ - if (m_cpu1->pc() == 0x2f) return 0xfb; - - logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", m_cpu1->tag(), m_cpu1->pc()); - return 0x00; -} - -// never called, see notes. -READ8_MEMBER(route16_state::route16_prot_read) -{ - m_protection_data++; - return (1 << ((m_protection_data >> 1) & 7)); -} - - -/************************************* - * - * Drivers specific initialization - * - *************************************/ - - + ROM_REGION( 0x2000, "cpu2", 0 ) + ROM_LOAD( "j2_6.0e", 0x0000, 0x1000, CRC(3a559328) SHA1(dd6333ddcc8aa6097d83b21cfde740b2cb7c908b) ) // 2732 + ROM_REGION( 0x0200, "proms", 0 ) + // The upper 128 bytes are 0's, used by the hardware to blank the display + ROM_LOAD( "82s129.6k", 0x0000, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) + ROM_LOAD( "82s129.6h", 0x0100, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) + ROM_REGION( 0x0100, "proms2", 0 ) // currently unused by the emulation + ROM_LOAD( "82s129.9r", 0x0000, 0x0100, CRC(20ac25d8) SHA1(6f06472ac7fcb22c9060092a2d456be5d3ca6d5f) ) +ROM_END /************************************* @@ -1145,3 +1240,4 @@ GAME( 1980, speakhlp, speakres, spacecho, spacecho, route16_state, empty_init, GAME( 1981, jongpute, 0, jongpute, jongpute, route16_state, empty_init, ROT0, "Alpha Denshi Co.", "Jongputer", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING ) // sampling voice is not emulated, bug with colors makes tile recognition difficult GAME( 1981, ttmahjng, jongpute, jongpute, jongpute, route16_state, empty_init, ROT0, "Alpha Denshi Co. (Taito license)", "T.T Mahjong", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, vscompmj, jongpute, vscompmj, jongpute, route16_state, init_vscompmj, ROT0, "Nichibutsu", "VS Computer Mahjong", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING ) // decryption might be incomplete (attract resets), inputs seem read differently diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp index 641a7a29d34..adf39076d85 100644 --- a/src/mame/drivers/royalmah.cpp +++ b/src/mame/drivers/royalmah.cpp @@ -20,6 +20,7 @@ Year + Game Board(s) CPU Company Not 82 Royal Mahjong ? + FRM-03 Z80 Falcon bootleg 83 Janyou Part II Z80 Cosmo Denshi 84? Jan Oh FRM-00? Z80 Toaplan Incomplete program roms +84? Challenge Girl FRM-03 + SK-1B Z80 Paradise Denshi The dumped set is a bootleg by Falcon 86 Ippatsu Gyakuten Z80 Public/Paradais 86 Don Den Mahjong D039198L-0 Z80 Dyna Electronics 86 Jong Shin D8702158L1-0 Z80 Dyna Electronics @@ -5263,6 +5264,23 @@ ROM_START( rkjanoh2 ) ROM_LOAD( "82s123", 0x000, 0x020, CRC(74a53e94) SHA1(ca9114bd9b2b07f5abe82616b41ae9fdb9537a4f) ) ROM_END +ROM_START( chalgirl ) + ROM_REGION( 0x10000, "maincpu", 0 ) // the first 6 ROMs are on the FRM-03 board, the following on the SK-1B sub board + ROM_LOAD( "cg_11.o1", 0x0000, 0x1000, CRC(1c064d3e) SHA1(cfe7e536efb377f009d7c9bee5b5a814ad1404ad) ) // 2732 + ROM_LOAD( "cg_22.o2", 0x1000, 0x1000, CRC(3244fe61) SHA1(3163f14b8977fe4b05aa11d332347c5f3cc2fbfa) ) // 2732 + ROM_LOAD( "cg_33.o3", 0x2000, 0x1000, CRC(692ef940) SHA1(c5a54161bedf26695aedad66016b5a789dbe13e5) ) // 2732 + ROM_LOAD( "cg_4.o3", 0x3000, 0x1000, CRC(562aa45f) SHA1(fc052b8f3b2f105c9282468d385a9ad554ec00f5) ) // 2732 + ROM_LOAD( "cg_5.o4", 0x4000, 0x1000, CRC(c0849a41) SHA1(1d901d59248cf0d8beff03207c46e3c50d0011cf) ) // 2732 + ROM_LOAD( "cg_6.o4", 0x5000, 0x1000, CRC(92687327) SHA1(4fafba5881dca2a147616d94dd055eba6aa3c653) ) // 2732 + ROM_LOAD( "7.f1", 0x6000, 0x1000, CRC(465db6e1) SHA1(e08fe431ab8676372fc13c51a2684a0320e01031) ) // 2732 + ROM_LOAD( "8.e1", 0x7000, 0x2000, CRC(42fafb6f) SHA1(32d06ee4fe28033ae04058d806917bf5b5690246) ) // 2764 + ROM_LOAD( "9.c1", 0x9000, 0x2000, CRC(8291e28a) SHA1(9a05cae191babdf3f78a7131985d8c6583f7c973) ) // 2764 + ROM_LOAD( "10.b1", 0xb000, 0x2000, CRC(04e76413) SHA1(e85db89084a8ae448fde4e202e8516b2e14a8265) ) // 2764 + + ROM_REGION( 0x0020, "proms", 0 ) + ROM_LOAD( "f-rom.bpr", 0x0000, 0x0020, BAD_DUMP CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) ) // not dumped for this set, using the one from royalmah for now +ROM_END + void royalmah_state::init_tahjong() { m_mainbank->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000); @@ -5327,6 +5345,7 @@ void royalmah_state::init_janptr96() GAME( 1981, royalmj, 0, royalmah, royalmah, royalmah_state, empty_init, ROT0, "Nichibutsu", "Royal Mahjong (Japan, v1.13)", 0 ) GAME( 1981?, openmj, royalmj, royalmah, royalmah, royalmah_state, empty_init, ROT0, "Sapporo Mechanic", "Open Mahjong [BET] (Japan)", 0 ) GAME( 1982, royalmah, royalmj, royalmah, royalmah, royalmah_state, empty_init, ROT0, "bootleg", "Royal Mahjong (Falcon bootleg, v1.01)", 0 ) +GAME( 1984?, chalgirl, 0, royalmah, royalmah, royalmah_state, empty_init, ROT0, "bootleg", "Challenge Girl (Falcon bootleg)", MACHINE_NOT_WORKING ) // correct rom loading / banking, girls aren't shown GAME( 1983, seljan, 0, seljan, seljan, royalmah_state, empty_init, ROT0, "Jem / Dyna Corp", "Sel-Jan [BET] (Japan)", 0 ) GAME( 1983, janyoup2, royalmj, janyoup2, janyoup2, royalmah_state, empty_init, ROT0, "Cosmo Denshi", "Janyou Part II (ver 7.03, July 1 1983)",0 ) GAME( 1985, tahjong, royalmj, tahjong, tahjong, royalmah_state, init_tahjong, ROT0, "Bally Pond / Nasco", "Tahjong Yakitori (ver. 2-1)", 0 ) // 1985 Jun. 17 diff --git a/src/mame/drivers/rpunch.cpp b/src/mame/drivers/rpunch.cpp index 56d9e4a7faa..10f4a43e483 100644 --- a/src/mame/drivers/rpunch.cpp +++ b/src/mame/drivers/rpunch.cpp @@ -138,8 +138,11 @@ void rpunch_state::machine_start() void rpunch_state::machine_reset() { - uint8_t *snd = memregion("upd")->base(); - memcpy(snd, snd + 0x20000, 0x20000); + if (memregion("upd")) + { + uint8_t *snd = memregion("upd")->base(); + memcpy(snd, snd + 0x20000, 0x20000); + } } @@ -213,7 +216,7 @@ void rpunch_state::main_map(address_map &map) map(0x0c0000, 0x0c0007).w(FUNC(rpunch_state::rpunch_scrollreg_w)); map(0x0c0009, 0x0c0009).select(0x20).w(FUNC(rpunch_state::rpunch_gga_w)); map(0x0c000c, 0x0c000d).w(FUNC(rpunch_state::rpunch_videoreg_w)); - map(0x0c000f, 0x0c000f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0x0c000f, 0x0c000f).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask16(0x00ff); map(0x0c0010, 0x0c0013).w(FUNC(rpunch_state::rpunch_ins_w)); map(0x0c0018, 0x0c0019).portr("P1"); map(0x0c001a, 0x0c001b).portr("P2"); @@ -222,7 +225,16 @@ void rpunch_state::main_map(address_map &map) map(0x0fc000, 0x0fffff).ram(); } +void rpunch_state::svolleybl_main_map(address_map &map) +{ + main_map(map); + // TODO: sound latch hook up is incomplete + map(0x090000, 0x090fff).ram(); // ? + map(0x0c000e, 0x0c000f).unmapw(); + map(0x0c001e, 0x0c001f).unmapr(); + map(0x0b0001, 0x0b0001).w(m_soundlatch, FUNC(generic_latch_8_device::write)); +} /************************************* * @@ -240,7 +252,15 @@ void rpunch_state::sound_map(address_map &map) map(0xf800, 0xffff).ram(); } - +void rpunch_state::svolleybl_sound_map(address_map &map) +{ + map(0x0000, 0xdfff).rom(); + map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xe800, 0xe800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + //map(0xf000, 0xf000) // OKI M5205? + //map(0xf400, 0xf400) // OKI M5205? + map(0xf800, 0xffff).ram(); +} /************************************* * @@ -510,15 +530,13 @@ void rpunch_state::svolleybl(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, MASTER_CLOCK/2); - m_maincpu->set_addrmap(AS_PROGRAM, &rpunch_state::main_map); + m_maincpu->set_addrmap(AS_PROGRAM, &rpunch_state::svolleybl_main_map); Z80(config, m_audiocpu, MASTER_CLOCK/4); - m_audiocpu->set_addrmap(AS_PROGRAM, &rpunch_state::sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &rpunch_state::svolleybl_sound_map); GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set("soundirq", FUNC(input_merger_device::in_w<0>)); - - INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -541,11 +559,9 @@ void rpunch_state::svolleybl(machine_config &config) SPEAKER(config, "mono").front_center(); ym2151_device &ymsnd(YM2151(config, "ymsnd", MASTER_CLOCK/4)); - ymsnd.irq_handler().set("soundirq", FUNC(input_merger_device::in_w<1>)); - ymsnd.add_route(0, "mono", 0.50); - ymsnd.add_route(1, "mono", 0.50); + ymsnd.add_route(ALL_OUTPUTS, "mono", 0.50); - UPD7759(config, m_upd7759).add_route(ALL_OUTPUTS, "mono", 0.50); + // TODO: OKI M5205 } @@ -775,10 +791,8 @@ ROM_START( svolleybl ) ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Sound CPU */ - ROM_LOAD( "2-snd.bin", 0x00000, 0x10000, CRC(e3065b1d) SHA1(c4a3a95ba7f43cdf1b0c574f41de06d007ad2bd8) ) // matches 1.ic140 from pspikes91 - ROM_LOAD( "1-snd.bin", 0x10000, 0x08000, CRC(009d7157) SHA1(2cdda7094c7476289d75a78ee25b34fa3b3225c0) ) - - ROM_REGION( 0x60000, "upd", ROMREGION_ERASEFF ) + ROM_LOAD( "2-snd.bin", 0x00000, 0x10000, CRC(e3065b1d) SHA1(c4a3a95ba7f43cdf1b0c574f41de06d007ad2bd8) ) // matches 1.ic140 from spikes91 + ROM_LOAD( "1-snd.bin", 0x10000, 0x08000, CRC(009d7157) SHA1(2cdda7094c7476289d75a78ee25b34fa3b3225c0) ) // matches 2.ic141 from spikes91, when halved ROM_END diff --git a/src/mame/drivers/saitek_corona.cpp b/src/mame/drivers/saitek_corona.cpp index 48fd6bbdb3a..da8f0528e87 100644 --- a/src/mame/drivers/saitek_corona.cpp +++ b/src/mame/drivers/saitek_corona.cpp @@ -42,7 +42,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void corona(machine_config &config); protected: @@ -264,7 +264,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void corona_state::corona(machine_config &config) diff --git a/src/mame/drivers/saitek_cp2000.cpp b/src/mame/drivers/saitek_cp2000.cpp index 0dce91909e5..c8f31d5127d 100644 --- a/src/mame/drivers/saitek_cp2000.cpp +++ b/src/mame/drivers/saitek_cp2000.cpp @@ -45,7 +45,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void cp2000(machine_config &config); protected: @@ -207,7 +207,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void cp2000_state::cp2000(machine_config &config) diff --git a/src/mame/drivers/saitek_delta1.cpp b/src/mame/drivers/saitek_delta1.cpp index 6731223dd5f..4b0384d9feb 100644 --- a/src/mame/drivers/saitek_delta1.cpp +++ b/src/mame/drivers/saitek_delta1.cpp @@ -38,7 +38,7 @@ public: // New Game button is directly tied to F3850 EXT RES pin DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } - // machine drivers + // machine configs void delta1(machine_config &config); protected: @@ -200,7 +200,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void delta1_state::delta1(machine_config &config) diff --git a/src/mame/drivers/saitek_mark5.cpp b/src/mame/drivers/saitek_mark5.cpp index d327069bedc..6b0ecbb5f6a 100644 --- a/src/mame/drivers/saitek_mark5.cpp +++ b/src/mame/drivers/saitek_mark5.cpp @@ -80,7 +80,7 @@ public: m_out_x(*this, "%u.%u.%u", 0U, 0U, 0U) { } - // machine drivers + // machine configs void mark5(machine_config &config); void mark6(machine_config &config); @@ -403,7 +403,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void mark5_state::mark5(machine_config &config) diff --git a/src/mame/drivers/saitek_risc2500.cpp b/src/mame/drivers/saitek_risc2500.cpp index bd4b2de5543..be99836ebd5 100644 --- a/src/mame/drivers/saitek_risc2500.cpp +++ b/src/mame/drivers/saitek_risc2500.cpp @@ -18,6 +18,7 @@ TODO: Is cpu cycle timing wrong? I suspect conditional branch timing due to cache miss (pipeline has to refill). The delay loop between writing to the speaker is simply: SUBS R2, R2, #$1, BNE $2000cd8 +- does it have an LCDC? if so, what chip? ******************************************************************************/ @@ -102,7 +103,7 @@ void risc2500_state::remove_boot_rom() void risc2500_state::lcd_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(131, 136, 139)); // lcd pixel off - palette.set_pen_color(1, rgb_t(92, 83, 88)); // lcd pixel on + palette.set_pen_color(1, rgb_t(51, 42, 43)); // lcd pixel on palette.set_pen_color(2, rgb_t(138, 146, 148)); // background } @@ -118,7 +119,7 @@ uint32_t risc2500_state::screen_update(screen_device &screen, bitmap_ind16 &bitm uint8_t gfx = bitswap<8>(m_vram[c*5 + x], 6,5,0,1,2,3,4,7); for(int y=0; y<7; y++) - bitmap.pix16(y, 71 - (c*6 + x)) = (gfx >> (y + 1)) & 1; + bitmap.pix16(y + 1, 71 - (c*6 + x)) = (gfx >> (y + 1)) & 1; } // LCD digits and symbols @@ -287,8 +288,8 @@ void risc2500_state::risc2500(machine_config &config) screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); screen.set_refresh_hz(50); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ - screen.set_size(12*6+1, 7); - screen.set_visarea(0, 12*6, 0, 7-1); + screen.set_size(12*6+1, 7+2); + screen.set_visarea_full(); screen.set_screen_update(FUNC(risc2500_state::screen_update)); screen.set_palette("palette"); diff --git a/src/mame/drivers/saitek_ssystem3.cpp b/src/mame/drivers/saitek_ssystem3.cpp index 2cef2729391..4d0d6f81511 100644 --- a/src/mame/drivers/saitek_ssystem3.cpp +++ b/src/mame/drivers/saitek_ssystem3.cpp @@ -94,7 +94,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void ssystem3(machine_config &config); protected: @@ -288,7 +288,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void ssystem3_state::ssystem3(machine_config &config) diff --git a/src/mame/drivers/saitek_stratos.cpp b/src/mame/drivers/saitek_stratos.cpp index e0f757e3292..70883a631ea 100644 --- a/src/mame/drivers/saitek_stratos.cpp +++ b/src/mame/drivers/saitek_stratos.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert, hap // thanks-to:Berger -/*************************************************************************** +/****************************************************************************** SciSys/Saitek Stratos chesscomputer family (1987-1990) (SciSys renamed themselves to Saitek in 1987) @@ -18,7 +18,17 @@ When not using -autosave, press that button before exiting MAME, or NVRAM can ge If that happens, the chesscomputer will become unresponsive on next boot. To force a cold boot, press ACL, then hold the PLAY button and press GO. -******************************************************************************* +TODO: +- emulate LCD at lower level, probably an MCU with embedded LCDC +- LCD status bit handling is guessed. stratos expects it to be high after lcd command 0xf, + but tking2 won't work if it's done that way, and corona is different too +- irq timing is derived from the main XTAL, but result should be similar with 5MHz and 5.67MHz, + there are a couple of "FREQ. SEL" nodes on the PCB, maybe related (not the ones in input ports) +- tking(old revisions) and stratos slow responsive buttons, related to irq timing, but if that's changed, + the led blinking and in-game clock is too fast +- does nvram.u7 work? it's cleared during boot, but not used after + +=============================================================================== Hardware notes: - W65C02 or R65C02 at 5MHz or ~5.6MHz (for latter, box says 6MHz but that's a marketing lie) @@ -40,17 +50,7 @@ as such by the chesscomputer community. Saitek simply advertised them as an impr The initial Stratos/Turbo King (PRG ROM labels known: M,K,L,P) are probably engine version B, very few bytes difference between revisions. The first Corona is engine version C. -TODO: -- emulate LCD at lower level, probably an MCU with embedded LCDC -- LCD status bit handling is guessed. stratos expects it to be high after lcd command 0xf, - but tking2 won't work if it's done that way, and corona is different too -- irq timing is derived from the main XTAL, but result should be similar with 5MHz and 5.67MHz, - there are a couple of "FREQ. SEL" nodes on the PCB, maybe related (not the ones in input ports) -- tking(old revisions) and stratos slow responsive buttons, related to irq timing, but if that's changed, - the led blinking and in-game clock is too fast -- does nvram.u7 work? it's cleared during boot, but not used after - -***************************************************************************/ +******************************************************************************/ #include "emu.h" #include "includes/saitek_stratos.h" @@ -84,7 +84,7 @@ public: int lcd_ready_r() { return m_lcd_ready ? 1 : 0; } - // machine drivers + // machine configs void stratos(machine_config &config); void tking(machine_config &config); void tking2(machine_config &config); @@ -485,7 +485,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void stratos_state::stratos(machine_config &config) diff --git a/src/mame/drivers/saitek_superstar.cpp b/src/mame/drivers/saitek_superstar.cpp index 29921bbfad7..4c45c489963 100644 --- a/src/mame/drivers/saitek_superstar.cpp +++ b/src/mame/drivers/saitek_superstar.cpp @@ -65,7 +65,7 @@ public: m_inputs(*this, "IN.%u", 0) { } - // machine drivers + // machine configs void sstar28k(machine_config &config); void tstar432(machine_config &config); @@ -202,7 +202,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void star_state::sstar28k(machine_config &config) diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp index a95336bd29a..c3fc4bf18fc 100644 --- a/src/mame/drivers/samcoupe.cpp +++ b/src/mame/drivers/samcoupe.cpp @@ -235,7 +235,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_keyboard_r) /* bit 7, external memory */ data |= 1 << 7; - + /* joysticks */ if (!BIT(offset, 12)) data &= m_joy1->read() | (0xff ^ 0x1f); if (!BIT(offset, 11)) data &= m_joy2->read() | (0xff ^ 0x1f); diff --git a/src/mame/drivers/sc2.cpp b/src/mame/drivers/sc2.cpp index a02ef31e703..5fe89abab11 100644 --- a/src/mame/drivers/sc2.cpp +++ b/src/mame/drivers/sc2.cpp @@ -193,7 +193,7 @@ INPUT_PORTS_END /****************************************************************************** - Machine Drivers + Machine Configs ******************************************************************************/ void sc2_state::sc2(machine_config &config) diff --git a/src/mame/drivers/sdk85.cpp b/src/mame/drivers/sdk85.cpp index 2eeff6a9a4e..78bbad3e976 100644 --- a/src/mame/drivers/sdk85.cpp +++ b/src/mame/drivers/sdk85.cpp @@ -20,6 +20,12 @@ Download the User Manual to get the operating procedures. An example is Press SUBST key, enter an address, press NEXT key, enter data, then press NEXT to increment the address. +Warning: the default cold start routine fails to initialize SP properly, which will cause the GO +command to fail. SP can be set to point to the end of onboard RAM by the following sequence of +button presses: EXAM REG, 4, 2, 0, EXEC, EXAM REG, 5, F, F, EXEC. In TTY mode, use the "XS" +command to change SP. Another option is to push the RESET button again, which will leave SP +wherever it was in the monitor's scratchpad area. + ToDo: - Artwork @@ -38,10 +44,13 @@ Press 0 to restart. *************************************************************************************************************************************/ #include "emu.h" +#include "bus/rs232/rs232.h" +#include "bus/sdk85/memexp.h" #include "cpu/i8085/i8085.h" #include "machine/i8155.h" #include "machine/i8355.h" #include "machine/i8279.h" +#include "softlist.h" #include "sdk85.lh" @@ -51,23 +60,42 @@ public: sdk85_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_kdc(*this, "kdc") + , m_romio(*this, "romio") + , m_expromio(*this, "expromio") + , m_ramio(*this, "ramio") + , m_expramio(*this, "expramio") + , m_tty(*this, "tty") , m_keyboard(*this, "X%u", 0) , m_digits(*this, "digit%u", 0U) { } void sdk85(machine_config &config); + DECLARE_WRITE_LINE_MEMBER(reset_w); + DECLARE_WRITE_LINE_MEMBER(vect_intr_w); + private: - DECLARE_WRITE8_MEMBER(scanlines_w); - DECLARE_WRITE8_MEMBER(digit_w); - DECLARE_READ8_MEMBER(kbd_r); + DECLARE_READ_LINE_MEMBER(sid_r); + + void scanlines_w(u8 data); + void digit_w(u8 data); + u8 kbd_r(); + void sdk85_io(address_map &map); void sdk85_mem(address_map &map); u8 m_digit; virtual void machine_reset() override; virtual void machine_start() override { m_digits.resolve(); } - required_device<cpu_device> m_maincpu; + + required_device<i8085a_cpu_device> m_maincpu; + required_device<i8279_device> m_kdc; + required_device<i8355_device> m_romio; + required_device<sdk85_romexp_device> m_expromio; + required_device<i8155_device> m_ramio; + required_device<i8155_device> m_expramio; + required_device<rs232_port_device> m_tty; required_ioport_array<3> m_keyboard; output_finder<6> m_digits; }; @@ -78,103 +106,150 @@ void sdk85_state::machine_reset() m_maincpu->reset(); } +WRITE_LINE_MEMBER(sdk85_state::reset_w) +{ + m_maincpu->set_input_line(INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE); + if (!state) + { + m_kdc->reset(); + m_romio->reset(); + m_expromio->reset(); + m_ramio->reset(); + m_expramio->reset(); + } +} + +WRITE_LINE_MEMBER(sdk85_state::vect_intr_w) +{ + m_maincpu->set_input_line(I8085_RST75_LINE, state ? ASSERT_LINE : CLEAR_LINE); +} + +READ_LINE_MEMBER(sdk85_state::sid_r) +{ + // Actual HW has S25 switch to ground SID when using keyboard input instead of TTY RX + if (m_tty->get_card_device() == nullptr) + return 0; + else + return m_tty->rxd_r(); +} + void sdk85_state::sdk85_mem(address_map &map) { map.unmap_value_high(); - map(0x0000, 0x07ff).r("romio", FUNC(i8355_device::memory_r)); - map(0x0800, 0x0fff).r("expromio", FUNC(i8355_device::memory_r)); - map(0x1800, 0x1800).mirror(0x06ff).rw("kdc", FUNC(i8279_device::data_r), FUNC(i8279_device::data_w)); - map(0x1900, 0x1900).mirror(0x06ff).rw("kdc", FUNC(i8279_device::status_r), FUNC(i8279_device::cmd_w)); - map(0x2000, 0x20ff).mirror(0x0700).rw("ramio", FUNC(i8155_device::memory_r), FUNC(i8155_device::memory_w)); - map(0x2800, 0x28ff).mirror(0x0700).rw("expramio", FUNC(i8155_device::memory_r), FUNC(i8155_device::memory_w)); + map(0x0000, 0x07ff).r(m_romio, FUNC(i8355_device::memory_r)); + map(0x0800, 0x0fff).rw(m_expromio, FUNC(sdk85_romexp_device::memory_r), FUNC(sdk85_romexp_device::memory_w)); + map(0x1800, 0x1800).mirror(0x06ff).rw(m_kdc, FUNC(i8279_device::data_r), FUNC(i8279_device::data_w)); + map(0x1900, 0x1900).mirror(0x06ff).rw(m_kdc, FUNC(i8279_device::status_r), FUNC(i8279_device::cmd_w)); + map(0x2000, 0x20ff).mirror(0x0700).rw(m_ramio, FUNC(i8155_device::memory_r), FUNC(i8155_device::memory_w)); + map(0x2800, 0x28ff).mirror(0x0700).rw(m_expramio, FUNC(i8155_device::memory_r), FUNC(i8155_device::memory_w)); } void sdk85_state::sdk85_io(address_map &map) { map.unmap_value_high(); - map(0x00, 0x03).mirror(0x04).rw("romio", FUNC(i8355_device::io_r), FUNC(i8355_device::io_w)); - map(0x08, 0x0b).mirror(0x04).rw("expromio", FUNC(i8355_device::io_r), FUNC(i8355_device::io_w)); - map(0x20, 0x27).rw("ramio", FUNC(i8155_device::io_r), FUNC(i8155_device::io_w)); - map(0x28, 0x2f).rw("expramio", FUNC(i8155_device::io_r), FUNC(i8155_device::io_w)); + map(0x00, 0x03).mirror(0x04).rw(m_romio, FUNC(i8355_device::io_r), FUNC(i8355_device::io_w)); + map(0x08, 0x0b).mirror(0x04).rw(m_expromio, FUNC(sdk85_romexp_device::io_r), FUNC(sdk85_romexp_device::io_w)); + map(0x20, 0x27).rw(m_ramio, FUNC(i8155_device::io_r), FUNC(i8155_device::io_w)); + map(0x28, 0x2f).rw(m_expramio, FUNC(i8155_device::io_r), FUNC(i8155_device::io_w)); } /* Input ports */ static INPUT_PORTS_START( sdk85 ) PORT_START("X0") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("3 I") PORT_CODE(KEYCODE_3) PORT_CHAR('3') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("4 SPH") PORT_CODE(KEYCODE_4) PORT_CHAR('4') + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("5 SPL") PORT_CODE(KEYCODE_5) PORT_CHAR('5') + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("6 PCH") PORT_CODE(KEYCODE_6) PORT_CHAR('6') + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("7 PCL") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_START("X1") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("8 H") PORT_CODE(KEYCODE_8) PORT_CHAR('8') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("9 L") PORT_CODE(KEYCODE_9) PORT_CHAR('9') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_START("X2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("EXEC") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("NEXT") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GO") PORT_CODE(KEYCODE_R) PORT_CHAR('R') - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SUBST") PORT_CODE(KEYCODE_T) PORT_CHAR('T') - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("EXAM") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SINGLE") PORT_CODE(KEYCODE_U) PORT_CHAR('U') + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("EXEC .") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("NEXT ,") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("GO") PORT_CODE(KEYCODE_G) PORT_CHAR('G') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("SUBST MEM") PORT_CODE(KEYCODE_S) PORT_CHAR('S') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("EXAM REG") PORT_CODE(KEYCODE_X) PORT_CHAR('X') + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("SINGLE STEP") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("INTR") // buttons hardwired to 8085 inputs + PORT_BIT(1, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("VECT INTR") PORT_WRITE_LINE_MEMBER(sdk85_state, vect_intr_w) PORT_CODE(KEYCODE_F2) + PORT_BIT(2, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("RESET") PORT_WRITE_LINE_MEMBER(sdk85_state, reset_w) PORT_CODE(KEYCODE_F1) INPUT_PORTS_END -WRITE8_MEMBER( sdk85_state::scanlines_w ) +void sdk85_state::scanlines_w(u8 data) { m_digit = data; } -WRITE8_MEMBER( sdk85_state::digit_w ) +void sdk85_state::digit_w(u8 data) { if (m_digit < 6) m_digits[m_digit] = bitswap<8>(~data, 3, 2, 1, 0, 7, 6, 5, 4); } -READ8_MEMBER( sdk85_state::kbd_r ) +u8 sdk85_state::kbd_r() { u8 data = (m_digit < 3) ? m_keyboard[m_digit]->read() : 0xff; return data; } +static DEVICE_INPUT_DEFAULTS_START( terminal ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_110 ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_110 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 ) +DEVICE_INPUT_DEFAULTS_END + void sdk85_state::sdk85(machine_config &config) { /* basic machine hardware */ I8085A(config, m_maincpu, 6.144_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &sdk85_state::sdk85_mem); m_maincpu->set_addrmap(AS_IO, &sdk85_state::sdk85_io); + m_maincpu->in_sid_func().set(FUNC(sdk85_state::sid_r)); + m_maincpu->out_sod_func().set(m_tty, FUNC(rs232_port_device::write_txd)).invert(); - I8355(config, "romio", 6.144_MHz_XTAL / 2); // Monitor ROM (A14) + I8355(config, m_romio, 6.144_MHz_XTAL / 2); // Monitor ROM (A14) - I8355(config, "expromio", 6.144_MHz_XTAL / 2); // Expansion ROM (A15) + SDK85_ROMEXP(config, m_expromio, 6.144_MHz_XTAL / 2, sdk85_romexp_device::rom_options, nullptr); // Expansion ROM (A15) - i8155_device &i8155(I8155(config, "ramio", 6.144_MHz_XTAL / 2)); // Basic RAM (A16) - i8155.out_to_callback().set_inputline(m_maincpu, I8085_TRAP_LINE); + I8155(config, m_ramio, 6.144_MHz_XTAL / 2); // Basic RAM (A16) + m_ramio->out_to_callback().set_inputline(m_maincpu, I8085_TRAP_LINE); - I8155(config, "expramio", 6.144_MHz_XTAL / 2); // Expansion RAM (A17) + I8155(config, m_expramio, 6.144_MHz_XTAL / 2); // Expansion RAM (A17) /* video hardware */ config.set_default_layout(layout_sdk85); /* Devices */ - i8279_device &kdc(I8279(config, "kdc", 6.144_MHz_XTAL / 2)); // Keyboard/Display Controller (A13) - kdc.out_irq_callback().set_inputline("maincpu", I8085_RST55_LINE); // irq - kdc.out_sl_callback().set(FUNC(sdk85_state::scanlines_w)); // scan SL lines - kdc.out_disp_callback().set(FUNC(sdk85_state::digit_w)); // display A&B - kdc.in_rl_callback().set(FUNC(sdk85_state::kbd_r)); // kbd RL lines - kdc.in_shift_callback().set_constant(1); // Shift key - kdc.in_ctrl_callback().set_constant(1); + I8279(config, m_kdc, 6.144_MHz_XTAL / 2); // Keyboard/Display Controller (A13) + m_kdc->out_irq_callback().set_inputline(m_maincpu, I8085_RST55_LINE); // irq + m_kdc->out_sl_callback().set(FUNC(sdk85_state::scanlines_w)); // scan SL lines + m_kdc->out_disp_callback().set(FUNC(sdk85_state::digit_w)); // display A&B + m_kdc->in_rl_callback().set(FUNC(sdk85_state::kbd_r)); // kbd RL lines + m_kdc->in_shift_callback().set_constant(1); // Shift key + m_kdc->in_ctrl_callback().set_constant(1); + + RS232_PORT(config, m_tty, default_rs232_devices, nullptr); // actually a 20 mA current loop + m_tty->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); + + SOFTWARE_LIST(config, "rom_list").set_original("sdk85"); } /* ROM definition */ @@ -184,8 +259,6 @@ ROM_START( sdk85 ) ROMX_LOAD( "sdk85.a14", 0x0000, 0x0800, CRC(9d5a983f) SHA1(54e218560fbec009ac3de5cfb64b920241ef2eeb), ROM_BIOS(0) ) ROM_SYSTEM_BIOS(1, "mastermind", "Mastermind") ROMX_LOAD( "mastermind.a14", 0x0000, 0x0800, CRC(36b694ae) SHA1(4d8a5ae5d10e8f72a6e349c7eeaf1aa00c4e45e1), ROM_BIOS(1) ) - - ROM_REGION( 0x800, "expromio", ROMREGION_ERASEFF ) ROM_END /* Driver */ diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp index ce5350b1ec5..a7720ff19a8 100644 --- a/src/mame/drivers/segac2.cpp +++ b/src/mame/drivers/segac2.cpp @@ -1750,7 +1750,7 @@ ROM_START( tfrceac ) /* Thunder Force AC (c)1990 Technosoft / Sega - 834-7745-0 ROM_END -ROM_START( tfrceacj ) /* Thunder Force AC (Japan) (c)1990 Technosoft / Sega - 834-7745 THUNDER FORCE AC (EMP5032 labeled 317-0172) */ +ROM_START( tfrceacj ) /* Thunder Force AC (Japan) (c)1990 Technosoft / Sega - 834-7745 THUNDER FORCE AC (EMP5032 labeled 317-0172) */ ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "epr-13657.ic32", 0x000000, 0x040000, CRC(a0f38ffd) SHA1(da548e7f61aed0e82a460553a119941da8857bc4) ) ROM_LOAD16_BYTE( "epr-13656.ic31", 0x000001, 0x040000, CRC(b9438d1e) SHA1(598209c9fec3527fde720af09e5bebd7379f5b2b) ) @@ -2005,7 +2005,7 @@ ROM_START( stkclmns ) /* Stack Columns (c)1994 Sega */ ROM_END -ROM_START( stkclmnsj ) /* Stack Columns (c)1994 Sega */ +ROM_START( stkclmnsj ) /* Stack Columns (c)1994 Sega - 834-10853 (EMP5032 labeled 317-0219) */ ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "epr-16795.ic32", 0x000000, 0x080000, CRC(b478fd02) SHA1(aaf9d9f9f4dc900b4e8ff6f258f26e782e5c3166) ) ROM_LOAD16_BYTE( "epr-16794.ic31", 0x000001, 0x080000, CRC(6d0e8c56) SHA1(8f98d9fd98a1faa70b173cfd72f15102d11e79ae) ) @@ -2037,7 +2037,7 @@ ROM_START( potopoto ) /* Poto Poto (c)1994 Sega - 834-10778 (EMP5032 labeled 31 ROM_END -ROM_START( zunkyou ) /* Zunzunkyou no Yabou (c)1994 Sega - 834-9029 (EMP5032 labeled 317-0221) */ +ROM_START( zunkyou ) /* Zunzunkyou no Yabou (c)1994 Sega - 834-9029 (EMP5032 labeled 317-0221) */ ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "epr-16812.ic32", 0x000000, 0x080000, CRC(eb088fb0) SHA1(69089a3516ad50f35e81971ef3c33eb3f5d52374) ) ROM_LOAD16_BYTE( "epr-16811.ic31", 0x000001, 0x080000, CRC(9ac7035b) SHA1(1803ffbadc1213e04646d483e27da1591e22cd06) ) diff --git a/src/mame/drivers/segahang.cpp b/src/mame/drivers/segahang.cpp index 3e2d08d1653..6677235f7ea 100644 --- a/src/mame/drivers/segahang.cpp +++ b/src/mame/drivers/segahang.cpp @@ -1539,10 +1539,16 @@ ROM_END // CPU: FD1089B (317-0013A) // YM2151 sound board // +// ASSY CPU BD 837-6000 ENDURO RACER // ASSY CPU BD 837-6001-01 // ASSY CONTROL BD 837-6002-01 // ASSY ROM BD 837-6004-01 -// ASSY SOUND BD 837-6003-01? (not verified) +// ASSY SOUND BD 834-6003 ENDURO RACER (production sticker: 860715.0509E) +// ASSY SOUND BD 837-6005 +// +// Missing dumps from the ASSY SOUND BD: +// 315-5205 - silckscreened CK2605 (DIP20) at IC67 (8J) +// 315-5206 - silckscreened 82S153 (DIP20) at IC38 (5E) // ROM_START( enduror ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code @@ -1600,11 +1606,11 @@ ROM_START( enduror ) ROM_LOAD( "epr-7633.ic1", 0x0000, 0x8000, CRC(6f146210) SHA1(2f58f0c3563b434ed02700b9ca1545a696a5716e) ) ROM_REGION( 0x10000, "soundcpu", 0 ) // sound CPU - ROM_LOAD( "epr-7682.rom", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) + ROM_LOAD( "epr-7682.ic58", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) ROM_REGION( 0x20000, "pcm", 0 ) // Sega PCM sound data - ROM_LOAD( "epr-7681.rom", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) - ROM_LOAD( "epr-7680.rom", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) + ROM_LOAD( "epr-7681.ic8", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) + ROM_LOAD( "epr-7680.ic7", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) ) @@ -1618,10 +1624,16 @@ ROM_END // CPU: FD1089B (317-0013A) // YM2151 sound board // +// ASSY CPU BD 837-6000 ENDURO RACER // ASSY CPU BD 837-6001-01 // ASSY CONTROL BD 837-6002-01 // ASSY ROM BD 837-6004-02 (with jumpers J2, J3, J7 & J8 made) -// ASSY SOUND BD 837-6003-01? (not verified) +// ASSY SOUND BD 834-6003 ENDURO RACER (production sticker: 860715.0509E) +// ASSY SOUND BD 837-6005 +// +// Missing dumps from the ASSY SOUND BD: +// 315-5205 - silckscreened CK2605 (DIP20) at IC67 (8J) +// 315-5206 - silckscreened 82S153 (DIP20) at IC38 (5E) // ROM_START( endurora ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code @@ -1655,11 +1667,96 @@ ROM_START( endurora ) ROM_LOAD( "epr-7633.ic1", 0x0000, 0x8000, CRC(6f146210) SHA1(2f58f0c3563b434ed02700b9ca1545a696a5716e) ) ROM_REGION( 0x10000, "soundcpu", 0 ) // sound CPU - ROM_LOAD( "epr-7682.rom", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) + ROM_LOAD( "epr-7682.ic58", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) + + ROM_REGION( 0x20000, "pcm", 0 ) // Sega PCM sound data + ROM_LOAD( "epr-7681.ic8", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) + ROM_LOAD( "epr-7680.ic7", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) + + ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table + ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) ) + + ROM_REGION( 0x2000, "maincpu:key", 0 ) // decryption key + ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(a965b2da) SHA1(046f800f258163b6935f4f75326d9dc225b27dde) ) +ROM_END + +//************************************************************************************************************************* +// Enduro Racer +// CPU: FD1089B (317-0013A) +// YM2151 sound board +// +// ASSY CPU BD 837-6000 ENDURO RACER +// ASSY CPU BD 837-6001-01 +// ASSY CONTROL BD 837-6002-01 +// ASSY ROM BD 837-6004-01 +// ASSY SOUND BD 834-6003 ENDURO RACER (production sticker: 860715.0509E) +// ASSY SOUND BD 837-6005 +// +// Missing dumps from the ASSY SOUND BD: +// 315-5205 - silckscreened CK2605 (DIP20) at IC67 (8J) +// 315-5206 - silckscreened 82S153 (DIP20) at IC38 (5E) +// +ROM_START( endurorb ) + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_BYTE( "epr-7640.ic97", 0x00000, 0x8000, CRC(193a495b) SHA1(6418959cddf2678ddfccf67a29440a896e427cdc) ) + ROM_LOAD16_BYTE( "epr-7636.ic84", 0x00001, 0x8000, CRC(d8cedbbe) SHA1(e9f96251732e19651789a93c0cf2349d4f038157) ) + ROM_LOAD16_BYTE( "epr-7641.ic98", 0x10000, 0x8000, CRC(2503ae7c) SHA1(27009d5b47dc207145048edfcc1ac8ffda5f0b78) ) + ROM_LOAD16_BYTE( "epr-7637.ic85", 0x10001, 0x8000, CRC(82a27a8c) SHA1(4b182d8c23454aed7d786c9824932957319b6eff) ) + ROM_LOAD16_BYTE( "epr-7642.ic99", 0x20000, 0x8000, CRC(1c453bea) SHA1(c6e606cdcb1690de05ef5283b48a8a61b2e0ad51) ) + ROM_LOAD16_BYTE( "epr-7638.ic86", 0x20001, 0x8000, CRC(70544779) SHA1(e6403edd7fc0ad5d447c25be5d7f10889aa109ff) ) + + ROM_REGION( 0x40000, "subcpu", 0 ) // second 68000 CPU + ROM_LOAD16_BYTE("epr-7634.ic54", 0x0000, 0x8000, CRC(3e07fd32) SHA1(7acb9e9712ecfe928c421c84dece783e75077746) ) + ROM_LOAD16_BYTE("epr-7635.ic67", 0x0001, 0x8000, CRC(22f762ab) SHA1(70fa87da76c714db7213c42128a0b6a27644a1d4) ) + + ROM_REGION( 0x18000, "gfx1", 0 ) // tiles + ROM_LOAD( "epr-7644.ic31", 0x00000, 0x08000, CRC(e7a4ff90) SHA1(06d18470019041e32be9a969870cd995de626cd6) ) + ROM_LOAD( "epr-7645.ic46", 0x08000, 0x08000, CRC(4caa0095) SHA1(a24c741cdca0542e462f17ff94f132c62710e198) ) + ROM_LOAD( "epr-7646.ic60", 0x10000, 0x08000, CRC(7e432683) SHA1(c8249b23fce77eb456166161c2d9aa34309efe31) ) + + ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites + ROM_LOAD32_BYTE( "epr-7678.ic36", 0x00000, 0x8000, CRC(9fb5e656) SHA1(264b0ad017eb0fc7e0b542e6dd160ba964c100fd) ) + ROM_LOAD32_BYTE( "epr-7670.ic28", 0x00001, 0x8000, CRC(dbbe2f6e) SHA1(310797a61f91d6866e728e0da3b30828e06d1b52) ) + ROM_LOAD32_BYTE( "epr-7662.ic18", 0x00002, 0x8000, CRC(cb0c13c5) SHA1(856d1234fd8f8146e20fe6c65c0a535b7b7512cd) ) + ROM_LOAD32_BYTE( "epr-7654.ic8", 0x00003, 0x8000, CRC(2db6520d) SHA1(d16739e84316b4bd26963b729208169bbf01f499) ) + ROM_LOAD32_BYTE( "epr-7677.ic35", 0x20000, 0x8000, CRC(7764765b) SHA1(62543130816c084d292f229a15b3ce1305c99bb3) ) + ROM_LOAD32_BYTE( "epr-7669.ic27", 0x20001, 0x8000, CRC(f9525faa) SHA1(fbe2f67a9baee069dbca26a669d0a263bcca0d09) ) + ROM_LOAD32_BYTE( "epr-7661.ic17", 0x20002, 0x8000, CRC(fe93a79b) SHA1(591025a371a451c9cddc8c7480c9841a18bb9a7f) ) + ROM_LOAD32_BYTE( "epr-7653.ic7", 0x20003, 0x8000, CRC(46a52114) SHA1(d646ab03c1985953401619457d03072833edc6c7) ) + ROM_LOAD32_BYTE( "epr-7676.ic34", 0x40000, 0x8000, CRC(2e42e0d4) SHA1(508f6f89e681b59272884ba129a5c6ffa1b6ba05) ) + ROM_LOAD32_BYTE( "epr-7668.ic26", 0x40001, 0x8000, CRC(e115ce33) SHA1(1af591bc1567b89d0de399e4a02d896fba938bab) ) + ROM_LOAD32_BYTE( "epr-7660.ic16", 0x40002, 0x8000, CRC(86dfbb68) SHA1(a05ac16fbe3aaf34dd46229d4b71fc1f72a3a556) ) + ROM_LOAD32_BYTE( "epr-7652.ic6", 0x40003, 0x8000, CRC(2880cfdb) SHA1(94b78d78d82c324ca108970d8689f1d6b2ca8a24) ) + ROM_LOAD32_BYTE( "epr-7675.ic33", 0x60000, 0x8000, CRC(05cd2d61) SHA1(51688a5a9bc4da3f88ce162ff30affe8c6d3d0c8) ) + ROM_LOAD32_BYTE( "epr-7667.ic25", 0x60001, 0x8000, CRC(923bde9d) SHA1(7722a7fdbf45f862f1011d1afae8dedd5885bf52) ) + ROM_LOAD32_BYTE( "epr-7659.ic15", 0x60002, 0x8000, CRC(629dc8ce) SHA1(4af2a53678890b02922dee54f7cd3c5550001572) ) + ROM_LOAD32_BYTE( "epr-7651.ic5", 0x60003, 0x8000, CRC(d7902bad) SHA1(f4872d1a42dcf7d5dbdbc1233606a706b39478d7) ) + ROM_LOAD32_BYTE( "epr-7674.ic32", 0x80000, 0x8000, CRC(1a129acf) SHA1(ebaa60ccedc95c58af3ce99105b924b303827f6e) ) + ROM_LOAD32_BYTE( "epr-7666.ic24", 0x80001, 0x8000, CRC(23697257) SHA1(19453b14e8e6789e4c48a80d1b83dbaf37fbdceb) ) + ROM_LOAD32_BYTE( "epr-7658.ic14", 0x80002, 0x8000, CRC(1677f24f) SHA1(4786996cc8a04344e82ec9be7c4e7c8a005914a3) ) + ROM_LOAD32_BYTE( "epr-7650.ic4", 0x80003, 0x8000, CRC(642635ec) SHA1(e42bbae178e9a139325633e8c85a606c91e39e36) ) + ROM_LOAD32_BYTE( "epr-7673.ic31", 0xa0000, 0x8000, CRC(82602394) SHA1(d714f397f33a52429f394fc4c403d39be7911ccf) ) + ROM_LOAD32_BYTE( "epr-7665.ic23", 0xa0001, 0x8000, CRC(12d77607) SHA1(5b5d25646336a8ceae449d5b7a6b70372d81dd8b) ) + ROM_LOAD32_BYTE( "epr-7657.ic13", 0xa0002, 0x8000, CRC(8158839c) SHA1(f22081caf11d6b57488c969b5935cd4686e11197) ) + ROM_LOAD32_BYTE( "epr-7649.ic3", 0xa0003, 0x8000, CRC(4edba14c) SHA1(db0aab94de50f8f9501b7afd2fff70fb0a6b2b36) ) + ROM_LOAD32_BYTE( "epr-7672.ic30", 0xc0000, 0x8000, CRC(d11452f7) SHA1(f68183053005a26c0014050592bad6d63325895e) ) + ROM_LOAD32_BYTE( "epr-7664.ic22", 0xc0001, 0x8000, CRC(0df2cfad) SHA1(d62d12922be921967da37fbc624aaed72c4a2a98) ) + ROM_LOAD32_BYTE( "epr-7656.ic12", 0xc0002, 0x8000, CRC(6c741272) SHA1(ccaedda1436ddc339377e610d51e13726bb6c7eb) ) + ROM_LOAD32_BYTE( "epr-7648.ic2", 0xc0003, 0x8000, CRC(983ea830) SHA1(9629476a300ba711893775ca94dce81a00afd246) ) + ROM_LOAD32_BYTE( "epr-7671.ic29", 0xe0000, 0x8000, CRC(b0c7fdc6) SHA1(c9e0993fed36526e0e46ab2da9413af24b96cae8) ) + ROM_LOAD32_BYTE( "epr-7663.ic21", 0xe0001, 0x8000, CRC(2b0b8f08) SHA1(14aa1e6866f1c23c9ff271e8f216f6ecc21601ab) ) + ROM_LOAD32_BYTE( "epr-7655.ic11", 0xe0002, 0x8000, CRC(3433fe7b) SHA1(636449a0707d6629bf6ea503cfb52ad24af1c017) ) + ROM_LOAD32_BYTE( "epr-7647.ic1", 0xe0003, 0x8000, CRC(2e7fbec0) SHA1(a59ec5fc3341833671fb948cd21b47f3a49db538) ) + + ROM_REGION( 0x8000, "segaic16road", 0 ) // road gfx + ROM_LOAD( "epr-7633.ic1", 0x0000, 0x8000, CRC(6f146210) SHA1(2f58f0c3563b434ed02700b9ca1545a696a5716e) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) // sound CPU + ROM_LOAD( "epr-7682.ic58", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) ROM_REGION( 0x20000, "pcm", 0 ) // Sega PCM sound data - ROM_LOAD( "epr-7681.rom", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) - ROM_LOAD( "epr-7680.rom", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) + ROM_LOAD( "epr-7681.ic8", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) + ROM_LOAD( "epr-7680.ic7", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) ) @@ -1727,11 +1824,11 @@ ROM_START( endurord ) ROM_LOAD( "epr-7633.ic1", 0x0000, 0x8000, CRC(6f146210) SHA1(2f58f0c3563b434ed02700b9ca1545a696a5716e) ) ROM_REGION( 0x10000, "soundcpu", 0 ) // sound CPU - ROM_LOAD( "epr-7682.rom", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) + ROM_LOAD( "epr-7682.ic58", 0x00000, 0x8000, CRC(c4efbf48) SHA1(2bcbc4757d98f291fcaec467abc36158b3f59be3) ) ROM_REGION( 0x20000, "pcm", 0 ) // Sega PCM sound data - ROM_LOAD( "epr-7681.rom", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) - ROM_LOAD( "epr-7680.rom", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) + ROM_LOAD( "epr-7681.ic8", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) + ROM_LOAD( "epr-7680.ic7", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) ) @@ -2028,8 +2125,8 @@ ROM_START( endurob2 ) ROM_LOAD( "enduro.a16", 0x00000, 0x8000, CRC(d2cb6eb5) SHA1(80c5fab16ec4ddfa67fae94808026b2e6285b7f1) ) ROM_REGION( 0x20000, "pcm", 0 ) // Sega PCM sound data - ROM_LOAD( "epr-7681.rom", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) - ROM_LOAD( "epr-7680.rom", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) + ROM_LOAD( "epr-7681.ic8", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) ) + ROM_LOAD( "epr-7680.ic7", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) ) ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) ) @@ -2107,12 +2204,13 @@ GAME( 1987, shangonrb2, shangon, shangupb, shangupb, segahang_state, init_gene GAME( 1985, sharrier, 0, sharrier, sharrier, segahang_state, init_sharrier, ROT0, "Sega", "Space Harrier (Rev A, 8751 315-5163A)", 0 ) GAME( 1985, sharrier1, sharrier, sharrier, sharrier, segahang_state, init_sharrier, ROT0, "Sega", "Space Harrier (8751 315-5163)", 0 ) -GAME( 1986, enduror, 0, enduror, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (YM2151) (FD1089B 317-0013A)", 0 ) -GAME( 1986, endurora, enduror, enduror, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (YM2151) (mask ROM sprites, FD1089B 317-0013A)", 0 ) -GAME( 1986, enduror1, enduror, enduror1, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (YM2203) (FD1089B 317-0013A)", 0 ) +GAME( 1986, enduror, 0, enduror, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (Rev A, YM2151, FD1089B 317-0013A)", 0 ) +GAME( 1986, endurora, enduror, enduror, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (Rev A, YM2151, mask ROM sprites, FD1089B 317-0013A)", 0 ) +GAME( 1986, endurorb, enduror, enduror, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (YM2151, FD1089B 317-0013A)", 0 ) +GAME( 1986, enduror1, enduror, enduror1, enduror, segahang_state, init_enduror, ROT0, "Sega", "Enduro Racer (YM2203, FD1089B 317-0013A)", 0 ) GAME( 1986, endurobl, enduror, endurobl, enduror, segahang_state, init_endurobl, ROT0, "bootleg", "Enduro Racer (bootleg set 1)", 0 ) GAME( 1986, endurob2, enduror, endurob2, enduror, segahang_state, init_endurob2, ROT0, "bootleg", "Enduro Racer (bootleg set 2)", MACHINE_NOT_WORKING ) -GAME( 1986, endurord, enduror, endurord, enduror, segahang_state, init_enduror, ROT0, "bootleg", "Enduro Racer (YM2151) (bootleg of FD1089B 317-0013A set)", 0 ) -GAME( 1986, enduror1d, enduror, enduror1d, enduror, segahang_state, init_enduror, ROT0, "bootleg", "Enduro Racer (YM2203) (bootleg of FD1089B 317-0013A set)", 0 ) +GAME( 1986, endurord, enduror, endurord, enduror, segahang_state, init_enduror, ROT0, "bootleg", "Enduro Racer (bootleg of Rev A, YM2151, FD1089B 317-0013A set)", 0 ) +GAME( 1986, enduror1d, enduror, enduror1d, enduror, segahang_state, init_enduror, ROT0, "bootleg", "Enduro Racer (bootleg of YM2203, FD1089B 317-0013A set)", 0 ) diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp index 7a518ad90fc..7b2cc5a6a47 100644 --- a/src/mame/drivers/segas16b.cpp +++ b/src/mame/drivers/segas16b.cpp @@ -876,6 +876,13 @@ S11 S13 S15 S17 |EPR12194 - - - EPR12195 - - #include "sound/okim6295.h" #include "speaker.h" +#define USE_NL (1) + +#if USE_NL +#include "machine/netlist.h" +#include "netlist/nl_setup.h" +#include "audio/nl_segas16b.h" +#endif //************************************************************************** // CONSTANTS @@ -3933,12 +3940,37 @@ void segas16b_state::system16b(machine_config &config) // sound hardware SPEAKER(config, "mono").front_center(); +#if USE_NL + YM2151(config, m_ym2151, MASTER_CLOCK_8MHz/2) + .add_route(0, "netlist", 1.0, 0) + .add_route(1, "netlist", 1.0, 1); + UPD7759(config, m_upd7759); + m_upd7759->md_w(0); + m_upd7759->drq().set(FUNC(segas16b_state::upd7759_generate_nmi)); + m_upd7759->add_route(0, "netlist", 1.0, 2); + + NETLIST_SOUND(config, "netlist", 48000) + .set_source(netlist_segas16b_audio) + .add_route(ALL_OUTPUTS, "mono", 1.0); + + // please refer to the netlist code for details about + // the multipliers and offsets. + NETLIST_STREAM_INPUT(config, "netlist:cin0", 0, "CH1.IN") + .set_mult_offset(0.5/32768.0, 2.5); + NETLIST_STREAM_INPUT(config, "netlist:cin1", 1, "CH2.IN") + .set_mult_offset(0.5/32768.0, 2.5); + NETLIST_STREAM_INPUT(config, "netlist:cin2", 2, "SPEECH.I") + .set_mult_offset(0.001020/32768.0/2.0, 0.001020/2.0); + + NETLIST_STREAM_OUTPUT(config, "netlist:cout0", 0, "OUT").set_mult_offset(30000.0 / 0.2, 0.0); +#else YM2151(config, m_ym2151, MASTER_CLOCK_8MHz/2).add_route(ALL_OUTPUTS, "mono", 0.43); UPD7759(config, m_upd7759); m_upd7759->md_w(0); m_upd7759->drq().set(FUNC(segas16b_state::upd7759_generate_nmi)); m_upd7759->add_route(ALL_OUTPUTS, "mono", 0.48); +#endif } void segas16b_state::system16b_mc8123(machine_config &config) diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp index 640aa111813..bda88956de1 100644 --- a/src/mame/drivers/segas32.cpp +++ b/src/mame/drivers/segas32.cpp @@ -2985,7 +2985,7 @@ void segas32_new_state::sega_multi32_6p(machine_config &config) ROM PCB No: 834-8526-01 (US) 834-8526-02 (Export) 834-8526-03 (Japan) - 834-8526-05 (Export) + 834-8526-05 (Export, had the DSP 837-8341 board attached) Link PCB No: 837-8223-01 A/D BD No: 837-7536 (one for each mainboard) DSP BD No: 837-8341 diff --git a/src/mame/drivers/segasp.cpp b/src/mame/drivers/segasp.cpp index db29c66da11..b06ed7b7e65 100644 --- a/src/mame/drivers/segasp.cpp +++ b/src/mame/drivers/segasp.cpp @@ -61,7 +61,7 @@ Love & Berry 3 CHN ???-????? MDA-C0071 CF EXP Marine & Marine ???-????? no ???-????-???? AAFE-xxxxxxxxxxx Medalink 837-14699 no Medalink 837-14700 no -Mirage World ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal +Mirage World (SP MRW SATL) 834-14713 ROM ANY ???-????-???? AAFG-01A3xxxxxxx, Medal Monopoly: The Medal ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal Monopoly: The Medal 2nd Edition ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal Mushiking 2K6 2ND ???-????? no ???-????-???? AAFE-xxxxxxxxxxx @@ -341,6 +341,7 @@ void segasp_state::init_segasp() // net_firm_119.ic72 - Network/Media Board firmware VER 1.19(VxWorks), 1st half contain original 1.10 version // fpr-24208a.ic72 - version 1.23, 1st half - 1.10 +// fpr-24329.ic72 - version 1.21, 1st half - 1.20 // fpr-24407_123.ic72 - version 1.23, 1st half - 1.20 // fpr-24407.ic72 - version 1.25, 1st half - 1.20 #define SEGASP_NETFIRM \ @@ -348,6 +349,7 @@ void segasp_state::init_segasp() ROM_LOAD( "net_eeprom.ic74s", 0x00000000, 0x200, CRC(77cc5a6c) SHA1(cbfba546256b70bce6c6fd0030d7e2e410a25526) ) \ ROM_LOAD( "net_firm_119.ic72", 0x00000000, 0x200000, CRC(a738ea1c) SHA1(d25187a973a7e166e70334f964363adf2be87257) ) \ ROM_LOAD( "fpr-24208a.ic72", 0x00000000, 0x200000, CRC(a738ea1c) SHA1(3c32ddfb3c40be66b9fb2ba35fbfd5b534bb3da0) ) \ + ROM_LOAD( "fpr-24329.ic72", 0x00000000, 0x200000, CRC(a738ea1c) SHA1(d0d062a4089a2d3404df45eb015faaf7eee9b8c2) ) \ ROM_LOAD( "fpr-24407.ic72", 0x00000000, 0x200000, CRC(a738ea1c) SHA1(fbcc3d119b47a6da4d194e3fe4a98126c7049edf) ) \ ROM_LOAD( "fpr-24407_123.ic72",0x00000000, 0x200000, CRC(a738ea1c) SHA1(3f5a2fb03bbb1bd9af9fe32ad76a224c97aa9b7a) ) @@ -502,6 +504,25 @@ ROM_START( lovebero ) ROM_LOAD( "317-0446-com.ic15", 0, 0x800, BAD_DUMP CRC(60f56bf2) SHA1(35e697aca7213e3fb1ebe75bb8991b1b992af6d9) ) ROM_END +// Mirage World +// "coin pusher" type medal game machine, consists of "Main", "Center" and several "Satellite" units connected via Ethernet. +// Only Satellite unit was dumped, Main and Center units is missing. +// 834-14713 SP MRW SATL +ROM_START( mirworld ) + SEGASP_BIOS + ROM_DEFAULT_BIOS( "v201" ) + SEGASP_JP + SEGASP_MISC + + ROM_REGION( 0x08000000, "rom_board", ROMREGION_ERASE) + ROM_LOAD( "ic62", 0x00000000, 0x4000000, CRC(beda1ded) SHA1(a493a298d8fbe1fa2c66423da2dee378e691a7f4) ) + ROM_LOAD( "ic63", 0x04000000, 0x4000000, CRC(ec7e58cb) SHA1(8c6a45da31cd87a71b8e2f7454dc31bc2891210b) ) + + ROM_PARAMETER( ":rom_board:id", "5502" ) // 2x 512Mbit FlashROMs + + ROM_REGION( 0x800, "pic_readout", ROMREGION_ERASEFF ) // not populated +ROM_END + ROM_START( ochaken ) SEGASP_BIOS ROM_DEFAULT_BIOS( "v201" ) @@ -673,6 +694,7 @@ GAME( 2009, brickppl,segasp, segasp, segasp, segasp_state, init_segasp, R GAME( 2005, dinoking,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Dinosaur King (USA)", GAME_FLAGS ) GAME( 2006, lovebery,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Love And Berry - 1st-2nd Collection (Export, Ver 2.000)", GAME_FLAGS ) GAME( 2006, lovebero,lovebery, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Love And Berry - 1st-2nd Collection (Export, Ver 1.003)", GAME_FLAGS ) +GAME( 2007, mirworld,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Mirage World (satellite)", GAME_FLAGS ) GAME( 2007, ochaken, segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Ocha-Ken Hot Medal", GAME_FLAGS ) GAME( 2009, tetgiant,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Tetris Giant / Tetris Dekaris (Ver.2.000)", GAME_FLAGS ) // These use a CF card diff --git a/src/mame/drivers/seicupbl.cpp b/src/mame/drivers/seicupbl.cpp index 8865dc8f113..1e0ea9b02db 100644 --- a/src/mame/drivers/seicupbl.cpp +++ b/src/mame/drivers/seicupbl.cpp @@ -750,8 +750,6 @@ ROM_START( cupsocsb2 ) ROM_REGION( 0x080000, "gfx6", ROMREGION_INVERT ) /* LBK tiles */ ROM_COPY( "gfx5", 0x00000, 0x00000, 0x080000 ) - // A dump of 02.u26 from a second PCB had 3 different bytes: 0x8000 from 0x80 to 0xff; 0x10000 from 0xa4 to 0x4a; 0x18000 from 0x4a to 0xa4. - // However the first dump matches all the other sets and all the other ROMs from the second PCB match the ones from the first. ROM_REGION( 0x100000, "adpcm", ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_LOAD( "2.27010.u26", 0x000000, 0x020000, CRC(a70d4f03) SHA1(c2482e624c8a828a94206a36d10c1021ad8ca1d0) ) // 27c010a ROM_LOAD( "3.27040.u25", 0x080000, 0x080000, CRC(6e254d12) SHA1(857779dbd276b688201a8ea3afd5817e38acad2e) ) // actually was a 27c4001 @@ -839,7 +837,72 @@ ROM_START( cupsocsb3 ) ROM_LOAD16_BYTE( "sc_14.bin", 0x00001, 0x080000, CRC(566086c2) SHA1(b7d09ce978f99ecc0d1975b31330ed49317701d5) ) ROM_END +// almost identical to cupsocsb2, but for 02.u26 (OKI ROM) which has 3 different bytes: 0x8000 from 0x80 to 0xff; 0x10000 from 0xa4 to 0x4a; 0x18000 from 0x4a to 0xa4. +// this has been found on 2 different PCBs, so it seems intentional +ROM_START( cupsocsb4 ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_LOAD16_BYTE( "4.u11", 0x00001, 0x80000, CRC(83db76f8) SHA1(ffcd0a728de58871b945c15cc27da374b587e170) ) // 27c4001 + ROM_LOAD16_BYTE( "5.u17", 0x00000, 0x80000, CRC(c01e88c6) SHA1(8f90261792343c92ddd877ab8a2480b5aac82961) ) // 27c4001 + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */ + ROM_LOAD( "1.u20", 0x000000, 0x08000, CRC(cea39d6d) SHA1(f0b79c03ffafdd1e57673d6d4836becbe415110b) ) // 27c512 + ROM_CONTINUE( 0x000000, 0x08000 ) + + ROM_REGION( 0x200000, "sprite", ROMREGION_INVERT ) /* bootleg sprite gfx */ + ROM_LOAD( "7.u86", 0x000000, 0x080000, CRC(dcb29d01) SHA1(72b4234622605f0ab03f21fdb6a61c6dac36000d) ) // 27c4001 + ROM_LOAD( "6.u87", 0x080000, 0x080000, CRC(2dc70e05) SHA1(f1d0beb8428a7e1d7c7818e6719abdc543b2fa80) ) // 27c4001 + ROM_COPY( "sprite", 0x00000, 0x100000, 0x100000 ) + + ROM_REGION( 0x200000, "test1", 0 ) /* bootleg tile gfx */ + ROM_LOAD16_BYTE( "9.u36", 0x000000, 0x080000, CRC(695b6342) SHA1(dfccb43789021ba2568b9284ae61e64f7f89b152) ) // 27c4001 + ROM_LOAD16_BYTE( "10.u37", 0x000001, 0x080000, CRC(27e172b8) SHA1(ed86db2f42c8061607d46f2407b0130aaf692a02) ) // 27c4001 + ROM_LOAD16_BYTE( "8.u38", 0x100000, 0x080000, CRC(637120f3) SHA1(b4b2ad192e46ff80d4cb440d7fb6dac215a353ed) ) // 27c4001 + ROM_LOAD16_BYTE( "11.u39", 0x100001, 0x080000, CRC(0cd5ca5e) SHA1(a59665e543e9383355de2576e6693348ec356591) ) // 27c4001 + + ROM_REGION( 0x020000, "char", ROMREGION_INVERT ) + ROM_COPY( "test1", 0x080000, 0x00000, 0x020000 ) + + ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT ) /* MBK tiles */ + ROM_COPY( "test1", 0x000000, 0x00000, 0x080000 ) + ROM_COPY( "test1", 0x100000, 0x80000, 0x080000 ) + + ROM_REGION( 0x100000, "gfx4", ROMREGION_INVERT ) /* not used */ + ROM_COPY("gfx3",0x00000,0x00000,0x100000) + + ROM_REGION( 0x080000, "gfx5", ROMREGION_INVERT ) /* BK3 tiles */ + ROM_COPY( "test1", 0x180000, 0x00000, 0x080000 ) + + ROM_REGION( 0x080000, "gfx6", ROMREGION_INVERT ) /* LBK tiles */ + ROM_COPY( "gfx5", 0x00000, 0x00000, 0x080000 ) + + ROM_REGION( 0x100000, "adpcm", ROMREGION_ERASEFF ) /* ADPCM samples */ + ROM_LOAD( "2.u26", 0x000000, 0x020000, CRC(4d8e554a) SHA1(9f8adaed10222216c9db8869fe2c9d02f8b1ef1f) ) // 27c010a + ROM_LOAD( "3.u25", 0x080000, 0x080000, CRC(6e254d12) SHA1(857779dbd276b688201a8ea3afd5817e38acad2e) ) // 27c4001 + + ROM_REGION( 0x200000, "oki", ROMREGION_ERASEFF ) + ROM_COPY( "adpcm", 0x00000, 0x000000, 0x20000 ) //bank 0 + ROM_COPY( "adpcm", 0x00000, 0x020000, 0x20000 ) + ROM_COPY( "adpcm", 0x00000, 0x100000, 0x20000 ) //bank 4 + ROM_COPY( "adpcm", 0x80000, 0x120000, 0x20000 ) + ROM_COPY( "adpcm", 0x00000, 0x140000, 0x20000 ) //bank 5 + ROM_COPY( "adpcm", 0xa0000, 0x160000, 0x20000 ) + ROM_COPY( "adpcm", 0x00000, 0x180000, 0x20000 ) //bank 6 + ROM_COPY( "adpcm", 0xc0000, 0x1a0000, 0x20000 ) + ROM_COPY( "adpcm", 0x00000, 0x1c0000, 0x20000 ) //bank 7 + ROM_COPY( "adpcm", 0xe0000, 0x1e0000, 0x20000 ) + + + /* these are maths tables, for whatever COP replacement the bootlegs use */ + ROM_REGION( 0x500000, "unknown0", 0 ) + ROM_LOAD16_BYTE( "13.bin", 0x00000, 0x010000, CRC(229bddd8) SHA1(0924bf29db9c5a970546f154e7752697fdce6a58) ) // 27c512 + ROM_LOAD16_BYTE( "12.bin", 0x00001, 0x010000, CRC(dabfa826) SHA1(0db587c846755491b169ef7751ba8e7cdc2607e6) ) // 27c512 + ROM_REGION( 0x500000, "unknown1", 0 ) + ROM_LOAD16_BYTE( "15.bin", 0x00000, 0x080000, CRC(8fd87e65) SHA1(acc9fd0289fa9ab60bec16d3e642039380e5180a) ) // 27c4001 + ROM_LOAD16_BYTE( "14.bin", 0x00001, 0x080000, CRC(566086c2) SHA1(b7d09ce978f99ecc0d1975b31330ed49317701d5) ) // 27c4001 +ROM_END + GAME( 1992, cupsocsb, cupsoc, cupsocbl, cupsoc, seicupbl_state, empty_init, ROT0, "bootleg", "Seibu Cup Soccer :Selection: (bootleg, set 1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) GAME( 1992, cupsocsb2, cupsoc, cupsocbl, cupsoc, seicupbl_state, empty_init, ROT0, "bootleg", "Seibu Cup Soccer :Selection: (bootleg, set 2)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) GAME( 1992, cupsocsb3, cupsoc, cupsocbl, cupsoc, seicupbl_state, empty_init, ROT0, "bootleg", "Seibu Cup Soccer :Selection: (bootleg, set 3)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) +GAME( 1992, cupsocsb4, cupsoc, cupsocbl, cupsoc, seicupbl_state, empty_init, ROT0, "bootleg", "Seibu Cup Soccer :Selection: (bootleg, set 4)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index 0331f240dc2..474d8f236fb 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -6344,6 +6344,9 @@ static INPUT_PORTS_START( twineagl ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + // default taken off original Japanese DIP sheet + // Cabinet is user choice + // We use Licensor Option 2 instead of 1 just to avoid the "For use in Japan" PORT_START("DSW") //2 DSWs - $600001 & 3.b PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" ) PORT_DIPLOCATION("SW1:1") /* Always "Seta" if sim. players = 1 */ PORT_DIPSETTING( 0x0000, "Taito America / Romstar" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000) @@ -6375,12 +6378,12 @@ static INPUT_PORTS_START( twineagl ) PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000) PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000) PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000) - PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x0300, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0100, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) - PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4") PORT_DIPSETTING( 0x0c00, "Never" ) PORT_DIPSETTING( 0x0800, "500K Only" ) PORT_DIPSETTING( 0x0400, "1000K Only" ) diff --git a/src/mame/drivers/skopro.cpp b/src/mame/drivers/skopro.cpp new file mode 100644 index 00000000000..e7f883296d6 --- /dev/null +++ b/src/mame/drivers/skopro.cpp @@ -0,0 +1,106 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Skonec SkoPro v1.0 PC hardware + + Intel Pentium E2160 1M Cache, 1.80 GHz, 800 MHz FSB + Biostar MG31-M7 TE motherboard + 1GB RAM + nVidia GeForce 8400GS + Integrated sound? + Hitachi Deskstar HDS721680PLA320 80 GB + EGIS2JVS V1.2 card + Windows XP embedded + + The system was meant to be modular, but only 2 titles are said to have been actually released. + + Announced titles: + Douga De Puzzle - Idol Paradise + Dragon Dance + Exception + Otenami Haiken Ritaanzu! + Shangai +*/ + +#include "emu.h" +#include "cpu/i386/i386.h" +#include "screen.h" + +class skopro_state : public driver_device +{ +public: + skopro_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void skopro(machine_config &config); + +private: + required_device<cpu_device> m_maincpu; + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void skopro_map(address_map &map); +}; + +void skopro_state::video_start() +{ +} + +uint32_t skopro_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void skopro_state::skopro_map(address_map &map) +{ +} + +static INPUT_PORTS_START( skopro ) +INPUT_PORTS_END + + +void skopro_state::machine_start() +{ +} + +void skopro_state::machine_reset() +{ +} + +void skopro_state::skopro(machine_config &config) +{ + /* basic machine hardware */ + PENTIUM4(config, m_maincpu, 100000000); // actually a Pentium E2160 at 1.80 GHz + m_maincpu->set_addrmap(AS_PROGRAM, &skopro_state::skopro_map); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(640, 480); + screen.set_visarea(0, 640-1, 0, 480-1); + screen.set_screen_update(FUNC(skopro_state::screen_update)); +} + +/*************************************************************************** + + Game drivers + +***************************************************************************/ + +ROM_START( drgdance) + ROM_REGION(0x20000, "bios", 0) \ + ROM_LOAD("mbbios", 0x10000, 0x10000, NO_DUMP ) + + + DISK_REGION( "ide:0:hdd:image" ) + DISK_IMAGE( "dragon_dance", 0, SHA1(73868dd9354d936100ba56f460e872087ede012c) ) +ROM_END + + +GAME( 2008, drgdance, 0, skopro, skopro, skopro_state, empty_init, ROT0, "Success", "Dragon Dance (V1.02J)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/skyfox.cpp b/src/mame/drivers/skyfox.cpp index 27e9099ac1a..ac12ffe7025 100644 --- a/src/mame/drivers/skyfox.cpp +++ b/src/mame/drivers/skyfox.cpp @@ -14,8 +14,8 @@ Other: 2 HM6116LP-3 (one on each board) TODO: - The background rendering is entirely guesswork; -- DMA trigger happens at vpos 24 with legacy video parameters, - needs H/VSync PCB calculations, also notice that 62.65 Hz comes from the +- DMA trigger happens at vpos 24 with legacy video parameters, + needs H/VSync PCB calculations, also notice that 62.65 Hz comes from the bootleg and may be different for original; 2008-07 @@ -64,7 +64,7 @@ void skyfox_state::skyfox_map(address_map &map) map(0xe001, 0xe001).portr("DSW0"); map(0xe002, 0xe002).portr("DSW1"); map(0xe008, 0xe009).w(FUNC(skyfox_state::output_w)); -// map(0xe00a, 0xe00e) // POST only? +// map(0xe00a, 0xe00e) // POST only? map(0xe00f, 0xe00f).nopw(); // DMA trigger map(0xf001, 0xf001).portr("DSW2"); } @@ -223,8 +223,8 @@ void skyfox_state::skyfox(machine_config &config) /* basic machine hardware */ Z80(config, m_maincpu, XTAL(8'000'000)/2); /* Verified at 4MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &skyfox_state::skyfox_map); - // IM0, never enables ei opcode - + // IM0, never enables ei opcode + Z80(config, m_audiocpu, XTAL(14'318'181)/8); /* Verified at 1.789772MHz */ m_audiocpu->set_addrmap(AS_PROGRAM, &skyfox_state::skyfox_sound_map); diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp index 67b7867be51..1854e3605fc 100644 --- a/src/mame/drivers/snesb.cpp +++ b/src/mame/drivers/snesb.cpp @@ -4,7 +4,7 @@ Arcade games (hacks of console games) running on SNES hardware. - Driver (based on nss.cpp) by Tomasz Slanina analog[at]op.pl + Driver (based on nss.cpp) by Tomasz Slanina Supported games: - Killer Instinct @@ -29,8 +29,8 @@ TODO: - sblast2b : dipswitches - sblast2b : pressing start during gameplay changes the character used. Intentional? - denseib,2: fix gfx glitches, missing texts - - legendsb : dipswitches - - rushbets : everything + - legendsb : unknown dipswitches + - rushbets : dipswitches (stored at memory locations $785006 and $785008) - venom : gfx glitches on second level *************************************************************************** @@ -185,6 +185,8 @@ private: DECLARE_READ8_MEMBER(endless_580xxx_r); DECLARE_READ8_MEMBER(endless_624b7f_r); DECLARE_READ8_MEMBER(endless_800b_r); + DECLARE_READ8_MEMBER(rushbets_75axxx_r); + DECLARE_READ8_MEMBER(rushbets_5b8e3c_r); DECLARE_READ8_MEMBER(sharedram2_r); DECLARE_WRITE8_MEMBER(sharedram2_w); DECLARE_READ8_MEMBER(snesb_dsw1_r); @@ -230,7 +232,7 @@ READ8_MEMBER(snesb_state::sb2b_6a6xxx_r) case 0xfb7: return 0x47; } - logerror("Unknown protection read read %x @ %x\n",offset, m_maincpu->pc()); + logerror("Unknown protection read %x @ %x\n",offset, m_maincpu->pc()); return 0; } @@ -254,7 +256,7 @@ READ8_MEMBER(snesb_state::endless_580xxx_r) case 0xe83: return 0x6b; } - logerror("Unknown protection read read %x @ %x\n",offset, m_maincpu->pc()); + logerror("Unknown protection read %x @ %x\n",offset, m_maincpu->pc()); return 0; } @@ -285,6 +287,31 @@ WRITE8_MEMBER(snesb_state::sharedram2_w) m_shared_ram2[offset]=data; } +/* Rushing Beat Shura */ + +READ8_MEMBER(snesb_state::rushbets_75axxx_r) +{ +/* protection checks */ + switch(offset) + { + case 0xf49: return 0xe3; + case 0x05a: return 0xf4; + case 0x16b: return 0x05; + case 0x27c: return 0x16; + case 0x38d: return 0x27; + } + + logerror("Unknown protection read %x @ %x\n",offset, m_maincpu->pc()); + + return 0; +} + +READ8_MEMBER(snesb_state::rushbets_5b8e3c_r) +{ + /* protection check */ + return ++m_cnt; +} + /* Generic read handlers for Dip Switches and coins inputs */ READ8_MEMBER(snesb_state::snesb_dsw1_r) { @@ -698,6 +725,39 @@ static INPUT_PORTS_START( endless ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) INPUT_PORTS_END +static INPUT_PORTS_START( rushbets ) + PORT_INCLUDE(snes_common) + + PORT_START("DSW1") + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) /* duplicate setting */ + PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) + PORT_DIPNAME( 0x38, 0x38, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x38, "0" ) + PORT_DIPSETTING( 0x30, "1" ) + PORT_DIPSETTING( 0x28, "2" ) + PORT_DIPSETTING( 0x20, "2" ) + PORT_DIPSETTING( 0x18, "2" ) + PORT_DIPSETTING( 0x10, "2" ) + PORT_DIPSETTING( 0x08, "2" ) + PORT_DIPSETTING( 0x00, "2" ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0xc0, "0" ) + PORT_DIPSETTING( 0x80, "1" ) + PORT_DIPSETTING( 0x40, "2" ) + PORT_DIPSETTING( 0x00, "3" ) + + PORT_START("COIN") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) +INPUT_PORTS_END + static INPUT_PORTS_START( venom ) PORT_INCLUDE(snes_common) @@ -1206,6 +1266,17 @@ void snesb_state::init_rushbets() } } + /* protection checks */ + m_maincpu->space(AS_PROGRAM).install_read_handler(0x75a000, 0x75afff, read8_delegate(*this, FUNC(snesb_state::rushbets_75axxx_r))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x5b8e3c, 0x5b8e3c, read8_delegate(*this, FUNC(snesb_state::rushbets_5b8e3c_r))); + + m_shared_ram = std::make_unique<int8_t[]>(0x10); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x785000, 0x78500f, read8_delegate(*this, FUNC(snesb_state::sharedram_r)), write8_delegate(*this, FUNC(snesb_state::sharedram_w))); + + /* extra inputs */ + m_maincpu->space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(*this, FUNC(snesb_state::snesb_dsw1_r))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(*this, FUNC(snesb_state::snesb_coin_r))); + // boot vector dst[0xfffc] = 0xec; dst[0xfffd] = 0x80; @@ -1499,5 +1570,5 @@ GAME( 1996, denseib2, denseib, kinstb, denseib, snesb_state, init_d GAME( 1997, sblast2b, 0, kinstb, sblast2b, snesb_state, init_sblast2b, ROT0, "bootleg", "Sonic Blast Man 2 Special Turbo (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS) GAME( 1996, endless, 0, kinstb, endless, snesb_state, init_endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, legendsb, 0, kinstb, kinstb, snesb_state, init_legendsb, ROT0, "bootleg", "Legend (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, rushbets, 0, kinstb, kinstb, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, rushbets, 0, kinstb, rushbets, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, venom, 0, kinstb, venom, snesb_state, init_venom, ROT0, "bootleg", "Venom & Spider-Man - Separation Anxiety (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/socrates.cpp b/src/mame/drivers/socrates.cpp index cb2da3bab1c..0db4607e67e 100644 --- a/src/mame/drivers/socrates.cpp +++ b/src/mame/drivers/socrates.cpp @@ -3,7 +3,7 @@ /****************************************************************************** * * V-tech Socrates-series devices -* Copyright (C) 2009-2019 Jonathan Gevaryahu AKA Lord Nightmare +* Copyright (C) 2009-2020 Jonathan Gevaryahu AKA Lord Nightmare * with dumping help from Kevin 'kevtris' Horton * * The devices in this driver all use a similar ASIC, presumably produced by diff --git a/src/mame/drivers/spg110.cpp b/src/mame/drivers/spg110.cpp index cc61b63037c..2978bf934bc 100644 --- a/src/mame/drivers/spg110.cpp +++ b/src/mame/drivers/spg110.cpp @@ -10,12 +10,13 @@ JAKKS Classic Arcade Pinball JAKKS Spiderman 5-in-1 (original release) Conny TV Virtual Tennis + Conny Ping Pong + Conny TV Virtual Fighter assumed: JAKKS EA Sports (NHL 95 + Madden 95) (US) JAKKS EA Sports (NHL 95 + Fifa 96) (US) JAKKS Bob the Builder - Conny Ping Pong JAKKS Disney (original release) *******************************************************************************/ @@ -532,6 +533,14 @@ ROM_START( conyping ) // MCU (I/O?) read protected TODO: add NO_DUMP ROM_END +ROM_START( conyfght ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "mx29lw320.u2", 0x000000, 0x400000, CRC(515cce2c) SHA1(647cee206d23ff815d01f49cec391701b9a87de9) ) + + // MCU (I/O?) read protected TODO: add NO_DUMP +ROM_END + + // JAKKS Pacific Inc TV games @@ -546,3 +555,6 @@ CONS( 2003, conyteni, 0, 0, spg110_base, conyteni, spg110_game_state, e // from a US SDW Games unit, has SDW Games banners in background so ROM might differ to other regsions CONS( 2003, conyping, 0, 0, spg110_base, conyteni, spg110_game_state, empty_init, "Conny / SDW Games", "Virtual Ping Pong (Conny / SDW Games)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// from a Big Ben 'TV Virtual Fighter' unit, although shows Free Fight Kung Fu on title screen +// Also sold by SDW Games as both TV Virtual Fighter and TV Kickboxing (unit still has TV Virtual Fighter stickers even when box is TV Kickboxing - possibly just box changed due to Sega?) +CONS( 200?, conyfght, 0, 0, spg110_base, conyteni, spg110_game_state, empty_init, "Conny / Big Ben", "TV Virtual Fighter / Free Fight Kung Fu (Conny / Big Ben)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx.cpp b/src/mame/drivers/spg2xx.cpp new file mode 100644 index 00000000000..e17b256d820 --- /dev/null +++ b/src/mame/drivers/spg2xx.cpp @@ -0,0 +1,899 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood +/****************************************************************************** + + Short Description: + + Systems which run on the SPG243 SoC + + die markings show + "SunPlus QL8041" ( also known as Sunplus SPG240 & PAC300 ) + + All GameKeyReady units + Disney Princess (GKR) + Wheel of Fortune (GKR) + JAKKS WWE (GKR) + Fantastic 4 (GKR) + Justice League (GKR) + Dora the Explorer Nursery Rhyme (GKR) + Dora the Explorer Play Park (GKR) + Spiderman 5-in-1 (GKR) + etc. + + (other non GKR JAKKS games) + X-Men (Wolverine pad) + Avatar: The Last Airbender + Superman in Super Villain Showdown + + (other games) + Mattel Classic Sports + + "SunPlus QL8041C" ( known as Sunplus SPG2??, seems to be compatible with above, so probably just a chip revision ) + + Clickstart ( see clickstart.cpp instead) + Wheel of Fortune 2nd Edition + Spider-man - Villain Roundup + + "SunPlus QU7074-P69A" + + The Batman + Star Wars (non-gamekey, which model? falcon? - check) + Dream Life + + "SunPlus QL8167b" (is the scrambling built into the CPU, or external?) + + Lexibook Zeus IG900 20-in-1 + + "SunPlus QL8139C" + + Radica Cricket + V Smile Baby (Sweden) - see vsmileb.cpp + + --- + + Very likely the same + + "Sunplus QL8167" (these might have ROM scrambling if that is a 8167 feature) + + Disney Princess Magical Adventure + Go Diego Go + Shrek - Over the Hedge (this unit shows a 'GameKey Unlock More Games' on startup, but has no port, not even on the internal PCB) + Marvel Heroes (Spider-man) + Spiderman 3 (Movie - black) + + + --- + + It is unknown if the following are close to this architecture or not (no dumps yet) + + "SunPlus QU7073-P69A" + + Mortal Kombat + + "Sunplus PU7799-P680?" (difficult to read) + + Mission Paintball + + --- + + These are definitely different but still unSP based + + "SunPlus PA7801" ( known as Sunplus SPG110? ) + - see spg110.cpp instead + + "GCM394" (this is clearly newer, has extra opcodes, different internal map etc. also scaling and higher resolutions based on Spongebob) + - see sunplus_gcm394.cpp instead + + Status: + + Mostly working + + To-Do: + + Proper driver_device inheritance to untangle the mess of members + + Detailed list of bugs: + + All systems: + Various inaccuracies in samples/envelopes. + + jak_wall, jak_sdoo: + Game seems unhappy with NVRAM, clears contents on each boot. + jak_pooh: + In the 'Light Tag' minigame (select the rock) the game usually softlocks when you find a friend (with or without DRC) + jak_care: + All but one mini-game waits on RAM address 0x0165 changing from 0x00f9 to 0x00f8 + The bottom left game "Wish Bear's Wishing Tree" appears to fail for more complex reasons. + jak_disf: + Shows corrupt logo on first boot with no valid nvram (possibly hardware does too - verify if possible to invalidate EEPROM on device) + lexizeus: + Some corrupt sound effects and a few corrupt ground tiles a few minutes in. (checksum is good, and a video recorded + from one of these doesn't exhibit these problems, so either emulation issue or alt revision?) + pvmil: + Question order depends on SoC RNG, only reads when it wants a new value, so unless RNG runs on a timer question order ends up the same + + vii: + When loading a cart from file manager, sometimes MAME will crash. + The "MOTOR" option in the diagnostic menu does nothing when selected. + The "SPEECH IC" option in the diagnostic menu does nothing when selected. + On 'vii_vc1' & 'vii_vc2' cart, the left-right keys are transposed with the up-down keys. + - This is not a bug per se, as the games are played with the controller physically rotated 90 degrees. + + Note: + Cricket, Skateboarder, Skannerz and Football 2 list a 32-bit checksum at the start of ROM. + This is the byte sum of the file, excluding the first 16 byte (where the checksum is stored) + + Test Modes: + Justice League : press UP, DOWN, LEFT, BT3 on the JAKKS logo in that order, quickly, to get test menu + WWE : press UP, BT1, BT2 together during startup logos + + Disney Friends, MS Pacman, WallE, Batman (and some other HotGen GameKeys) for test mode, hold UP, + press A, press DOWN during startup + + Capcom test (same access as other Hotgen games) mode looks like this (tested on PAL unit, same ROM as dumped one) + + RAM OK 2800 + 111111 + 5432109876543210 + IOA ............111. (values go from . to 1 when inputs are moved, never 0 as in MAME!, core bug?) + GAMEKEY E0 + IOB0 + IOC XXX.........X... + SPRITES + + Care Bears : Hold analog stck up, rotate stick 360 degress back to up, press 'A' while still holding up + + TODO: + Work out how to access the hidden TEST menus for all games (most JAKKS games should have one at least) + +*******************************************************************************/ + +#include "includes/spg2xx.h" + +/************************* +* Machine Hardware * +*************************/ + +void spg2xx_game_state::switch_bank(uint32_t bank) +{ + if (m_bank) + { + if (bank != m_current_bank) + { + m_current_bank = bank; + m_bank->set_entry(bank); + m_maincpu->invalidate_cache(); + } + } +} + +WRITE16_MEMBER(spg2xx_game_state::porta_w) +{ + logerror("%s: porta_w %04x\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(spg2xx_game_state::portb_w) +{ + logerror("%s: portb_w %04x\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(spg2xx_game_state::portc_w) +{ + logerror("%s: portc_w %04x\n", machine().describe_context(), data); +} + +WRITE8_MEMBER(spg2xx_game_state::i2c_w) +{ + logerror("%s: i2c_w %05x %04x\n", machine().describe_context(), offset, data); +} + +READ8_MEMBER(spg2xx_game_state::i2c_r) +{ + logerror("%s: i2c_r %04x\n", machine().describe_context(), offset); + return 0x0000; +} + +READ16_MEMBER(spg2xx_game_state::rad_porta_r) +{ + uint16_t data = m_io_p1->read(); + logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); + return data; +} + +READ16_MEMBER(spg2xx_game_state::rad_portb_r) +{ + uint16_t data = m_io_p2->read(); + logerror("%s: Port B Read: %04x\n", machine().describe_context(), data); + return data; +} + +READ16_MEMBER(spg2xx_game_state::rad_portc_r) +{ + uint16_t data = m_io_p3->read(); + logerror("%s: Port C Read: %04x\n", machine().describe_context(), data); + return data; +} + +void spg2xx_game_state::mem_map_4m(address_map &map) +{ + map(0x000000, 0x3fffff).bankr("cartbank"); +} + +void spg2xx_game_state::mem_map_2m(address_map &map) +{ + map(0x000000, 0x1fffff).mirror(0x200000).bankr("cartbank"); +} + +void spg2xx_game_state::mem_map_1m(address_map &map) +{ + map(0x000000, 0x0fffff).mirror(0x300000).bankr("cartbank"); +} + +static INPUT_PORTS_START( rad_skat ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Full Left") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Full Right") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("Slight Left") // you have to use this for the menus (eg trick lists) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("Slight Right") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Front") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Back") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + // there only seem to be 3 buttons on the pad part, so presumably all the above are the skateboard, and below are the pad? + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("M Button") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("X Button") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("O Button") + PORT_BIT( 0xf800, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) // read but unused? + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag +INPUT_PORTS_END + +static INPUT_PORTS_START( rad_skatp ) + PORT_INCLUDE(rad_skat) + + PORT_MODIFY("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag +INPUT_PORTS_END + +static INPUT_PORTS_START( rad_sktv ) + /* how does the Scanner connect? probably some serial port with comms protocol, not IO ports? + internal test mode shows 'uart' ports (which currently fail) + + To access internal test hold DOWN and BUTTON1 together on startup until a coloured screen appears. + To cycle through the tests again hold DOWN and press BUTTON1 */ + + PORT_START("P1") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "IN1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +static INPUT_PORTS_START( wiwi18 ) + PORT_START("P1") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, "Possible Input" ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "IN1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag +INPUT_PORTS_END + + + +static INPUT_PORTS_START( tvsprt10 ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x0180, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Start + PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( mattelcs ) // there is a 'secret test mode' that previously got activated before inputs were mapped, might need unused inputs to active? + PORT_START("P1") + PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) // must be IP_ACTIVE_LOW or you can't switch to Football properly? + PORT_DIPNAME( 0x0018, 0x0000, "Game Select Slider" ) // technically not a dipswitch, a 3 position slider, but how best map it? + PORT_DIPSETTING( 0x0008, "Baseball (Left)" ) + PORT_DIPSETTING( 0x0010, "Basketball (Middle)" ) + PORT_DIPSETTING( 0x0000, "Football (Right)" ) + // no 4th position possible + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Difficulty ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_BIT( 0xffa0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Joypad Up") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Joypad Down") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Joypad Left") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Joypad Right") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Sound") // toggles between sound+music, sound only, and no sound + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Hike / Pitch") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Shoot / Run") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Kick / Hit") + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +/* hold 'Console Down' while powering up to get the test menu, including input tests + the ball (Wired) and bat (IR) are read some other way as they don't seem to appear in the ports. */ +static INPUT_PORTS_START( rad_crik ) + PORT_START("P1") + PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Console Enter") // these are the controls on the base unit + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Console Down") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("Console Left") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("Console Right") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Console Up") + PORT_BIT( 0xf800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( rad_fb2 ) // controls must be multiplexed somehow, as there's no room for P2 controls otherwise (unless P2 controls were never finished and it was only sold in a single mat version, Radica left useless P2 menu options in the mini Genesis consoles) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) // 'left' + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // 'up' + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) // 'right' + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // acts a 'motion ball' in menu (this is an analog input from the ball tho? at least in rad_fb in xavix.cpp so this might just be a debug input here) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // 'p2 right' + // none of the remaining inputs seem to do anything + PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag +INPUT_PORTS_END + +static INPUT_PORTS_START( abltenni ) + PORT_START("P1") // Down and both buttons on startup for Diagnostics Menu + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + // all remaining bits in this port will stop the demo mode, also having them high/low determines if you get 2P demos or Vs. CPU demos, not sure what the real state would be + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, "Used" ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_DIPNAME( 0x0001, 0x0001, "P3" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +void spg2xx_game_state::machine_start() +{ + if (m_bank) + { + m_bank->configure_entries(0, (memregion("maincpu")->bytes() + 0x7fffff) / 0x800000, memregion("maincpu")->base(), 0x800000); + m_bank->set_entry(0); + } + + save_item(NAME(m_current_bank)); +} + +void spg2xx_game_state::machine_reset() +{ + m_current_bank = -1; + switch_bank(0); + m_maincpu->reset(); +} + +void spg2xx_game_state::spg2xx_base(machine_config &config) +{ + m_maincpu->porta_out().set(FUNC(spg2xx_game_state::porta_w)); + m_maincpu->portb_out().set(FUNC(spg2xx_game_state::portb_w)); + m_maincpu->portc_out().set(FUNC(spg2xx_game_state::portc_w)); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320, 262); + m_screen->set_visarea(0, 320-1, 0, 240-1); + m_screen->set_screen_update("maincpu", FUNC(spg2xx_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(spg2xx_device::vblank)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); +} + +void spg2xx_game_state::non_spg_base(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); + + spg2xx_base(config); +} + +void spg2xx_game_state::rad_skat(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); + m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); +} + +void spg2xx_game_state::abltenni(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); + + m_maincpu->set_rowscroll_offset(8); +} + +void spg2xx_game_state::tvsprt10(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_2m); + m_maincpu->set_force_no_drc(true); // uses JVS opcode, not implemented in recompiler + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(spg2xx_game_state::rad_porta_r)); + m_maincpu->portb_in().set(FUNC(spg2xx_game_state::rad_portb_r)); + m_maincpu->portc_in().set(FUNC(spg2xx_game_state::rad_portc_r)); +} + + +void spg2xx_game_state::rad_skatp(machine_config &config) +{ + rad_skat(config); + m_maincpu->set_pal(true); + m_screen->set_refresh_hz(50); +// m_screen->set_size(320, 312); +} + +void spg2xx_game_state::rad_sktv(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(spg2xx_game_state::rad_porta_r)); + m_maincpu->portb_in().set(FUNC(spg2xx_game_state::rad_portb_r)); + m_maincpu->portc_in().set(FUNC(spg2xx_game_state::rad_portc_r)); + m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); +} + +void spg2xx_game_state::rad_crik(machine_config &config) +{ + SPG28X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); + m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); +} + +ROM_START( rad_skat ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "skateboarder.bin", 0x000000, 0x400000, CRC(08b9ab91) SHA1(6665edc4740804956136c68065890925a144626b) ) +ROM_END + +ROM_START( rad_skatp ) // rom was dumped from the NTSC version, but region comes from an io port, so ROM is probably the same + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "skateboarder.bin", 0x000000, 0x400000, CRC(08b9ab91) SHA1(6665edc4740804956136c68065890925a144626b) ) +ROM_END + +ROM_START( rad_sktv ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "skannerztv.bin", 0x000000, 0x200000, CRC(e92278e3) SHA1(eb6bee5e661128d83784960dfff50379c36bfaeb) ) + + /* The external scanner MCU is a Winbond from 2000: SA5641 + the scanner plays sound effects when scanning, without being connected to the main unit, so a way to dump / emulate + this MCU is also needed for complete emulation + + TODO: find details on MCU so that we know capacity etc. */ +ROM_END + +ROM_START( rad_fb2 ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "football2.bin", 0x000000, 0x400000, CRC(96b4f0d2) SHA1(e91f2ac679fb0c026ffe216eb4ab58802f361a17) ) +ROM_END + +ROM_START( rad_crik ) // only released in EU? + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "cricket.bin", 0x000000, 0x200000, CRC(6fa0aaa9) SHA1(210d2d4f542181f59127ce2f516d0408dc6de7a8) ) +ROM_END + +ROM_START( mattelcs ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "mattelclassicsports.bin", 0x000000, 0x100000, CRC(e633e7ad) SHA1(bf3e325a930cf645a7e32195939f3c79c6d35dac) ) +ROM_END + +ROM_START( abltenni ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "ablpnpwirelesstennis.bin", 0x000000, 0x400000, CRC(66bd8ef1) SHA1(a83640d5d9e84e10d29a065a61e0d7bbec16c6e4) ) +ROM_END + +ROM_START( tvsprt10 ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "tvsports10in1.bin", 0x000000, 0x400000, CRC(98b79889) SHA1(b0ba534d59b794bb38c071c70ab5bcf711364e06) ) +ROM_END + +ROM_START( wiwi18 ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "26gl128.bin", 0x000000, 0x1000000, CRC(0b103ac9) SHA1(14434908f429942096fb8db5b5630603fd54fb2c) ) +ROM_END + +void spg2xx_game_state::init_crc() +{ + // several games have a byte sum checksum listed at the start of ROM, this little helper function logs what it should match. + const int length = memregion("maincpu")->bytes(); + const uint8_t* rom = memregion("maincpu")->base(); + + uint32_t checksum = 0x00000000; + // the first 0x10 bytes are where the "chksum:xxxxxxxx " string is listed, so skip over them + for (int i = 0x10; i < length; i++) + { + checksum += rom[i]; + } + + logerror("Calculated Byte Sum of bytes from 0x10 to 0x%08x is %08x)\n", length - 1, checksum); +} + +void spg2xx_game_state::init_wiwi18() +{ + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); + rom[0x1ca259] = 0xf165; +} + +void spg2xx_game_state::init_tvsprt10() +{ + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); + // hack 'MASK' check (some kind of EEPROM maybe?) + // this hack means the ROM CRC fails, but without it the CRC is OK, so dump is good. + /* + port b 0010 = chip select? / always set when accessing? + 0008 = write enable (set when writing, not when reading) + 0004 = chip select? / always set when accessing? + 0002 = clock? (toggles) + 0001 = data in / out + */ + rom[0x18c55d] ^= 0x0001; +} + + + +// year, name, parent, compat, machine, input, class, init, company, fullname, flags + +// Radica TV games +CONS( 2006, rad_skat, 0, 0, rad_skat, rad_skat, spg2xx_game_state, init_crc, "Radica", "Play TV Skateboarder (NTSC)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2006, rad_skatp, rad_skat, 0, rad_skatp,rad_skatp, spg2xx_game_state, init_crc, "Radica", "Connectv Skateboarder (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2006, rad_crik, 0, 0, rad_crik, rad_crik, spg2xx_game_state, init_crc, "Radica", "Connectv Cricket (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // Version 3.00 20/03/06 is listed in INTERNAL TEST +CONS( 2007, rad_sktv, 0, 0, rad_sktv, rad_sktv, spg2xx_game_state, init_crc, "Radica", "Skannerz TV", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +CONS( 2007, rad_fb2, 0, 0, rad_skat, rad_fb2, spg2xx_game_state, init_crc, "Radica", "Play TV Football 2", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // offers a 2 player option in menus, but seems to have only been programmed for, and released as, a single player unit, P2 controls appear unfinished. + +// ABL TV Games +CONS( 2006, abltenni, 0, 0, abltenni, abltenni, spg2xx_game_state, empty_init, "Advance Bright Ltd / V-Tac Technology Co Ltd.", "Wireless Tennis (WT2000, ABL TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +// same as Excalibur Decathlon? not the same as the ABL game +CONS( 2006, tvsprt10, 0, 0, tvsprt10, tvsprt10, spg2xx_game_state, init_tvsprt10, "Simba / V-Tac Technology Co Ltd.", "TV Sports 10-in-1 / Decathlon Atlhetic Sport Games", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +// Mattel games +CONS( 2005, mattelcs, 0, 0, rad_skat, mattelcs, spg2xx_game_state, empty_init, "Mattel", "Mattel Classic Sports", MACHINE_IMPERFECT_SOUND ) + +// box marked 'Wireless game console' 'Drahtlose Spielekonsole' 87 Sports games included : 18 hyper sports games, 69 arcade games. +// Unit marked 'Hamy System' 'WiWi' +// actually a cartridge, but all hardware is in the cart, overriding any internal hardware entirely. see nes_vt.cp 'mc_sp69' for the '69 arcade game' part +CONS( 200?, wiwi18, 0, 0, rad_skat, wiwi18, spg2xx_game_state, init_wiwi18, "Hamy System", "WiWi 18-in-1 Sports Game", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_dreamlife.cpp b/src/mame/drivers/spg2xx_dreamlife.cpp new file mode 100644 index 00000000000..53fb40bd29e --- /dev/null +++ b/src/mame/drivers/spg2xx_dreamlife.cpp @@ -0,0 +1,83 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" +#include "machine/eepromser.h" + +class dreamlif_state : public spg2xx_game_state +{ +public: + dreamlif_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_eeprom(*this, "eeprom") + { } + + void dreamlif(machine_config &config); + +private: + DECLARE_READ16_MEMBER(portb_r); + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + + required_device<eeprom_serial_93cxx_device> m_eeprom; +}; + + +READ16_MEMBER(dreamlif_state::portb_r) +{ + uint16_t ret = 0x0000; + logerror("%s: portb_r\n", machine().describe_context()); + ret |= m_eeprom->do_read() << 3; + return ret; +} + +WRITE16_MEMBER(dreamlif_state::portb_w) +{ + logerror("%s: portb_w (%04x)\n", machine().describe_context(), data); + m_eeprom->di_write(BIT(data, 2)); + m_eeprom->cs_write(BIT(data, 0) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->clk_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); +} + + + +static INPUT_PORTS_START( dreamlif ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("B") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("C") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Yes") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("No") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be low or the Tiger logo gets skipped, also must be low for service mode (hold pause while booting) to work + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Pause") + PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +void dreamlif_state::dreamlif(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &dreamlif_state::mem_map_4m); + + spg2xx_base(config); + + EEPROM_93C66_16BIT(config, m_eeprom); // HT93LC66A + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set(FUNC(dreamlif_state::portb_r)); + m_maincpu->portb_out().set(FUNC(dreamlif_state::portb_w)); + +} + +ROM_START( dreamlif ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "dreamlife.bin", 0x000000, 0x800000, CRC(632e0237) SHA1(a8586e8a626d75cf7782f13cfd9f1b938af23d56) ) +ROM_END + + +// Hasbro games +CONS( 2005, dreamlif, 0, 0, dreamlif, dreamlif, dreamlif_state, empty_init, "Hasbro", "Dream Life (Version 1.0, Feb 07 2005)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/spg2xx_ican.cpp b/src/mame/drivers/spg2xx_ican.cpp new file mode 100644 index 00000000000..01e2f570fa9 --- /dev/null +++ b/src/mame/drivers/spg2xx_ican.cpp @@ -0,0 +1,505 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +/* Fisher Price / Mattel "I Can..." systems */ + +#include "includes/spg2xx.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +class icanguit_state : public spg2xx_game_state +{ +public: + icanguit_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_cart(*this, "cartslot"), + m_cart_region(nullptr), + m_porta_in(*this, "P1_%u", 0U), + m_portc_in(*this, "P3_%u", 0U) + { } + + void icanguit(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_icanguit); + + DECLARE_READ16_MEMBER(porta_r); + virtual DECLARE_READ16_MEMBER(portb_r); + DECLARE_READ16_MEMBER(portc_r); + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + virtual DECLARE_WRITE16_MEMBER(portc_w) override; + + required_device<generic_slot_device> m_cart; + memory_region *m_cart_region; + + uint16_t m_inlatch_a; + uint16_t m_inlatch_c; + optional_ioport_array<6> m_porta_in; + optional_ioport_array<6> m_portc_in; + +}; + +class icanpian_state : public icanguit_state +{ +public: + icanpian_state(const machine_config &mconfig, device_type type, const char *tag) : + icanguit_state(mconfig, type, tag) + // m_eeprom(*this, "eeprom") + { } + + void icanpian(machine_config &config); + +protected: + virtual DECLARE_READ16_MEMBER(portb_r) override; + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + + //optional_device<eeprom_serial_93cxx_device> m_eeprom; +}; + + +// there is a speaker volume for the 'guitar' mode, but it's presumably an analog feature, not read by the game. +static INPUT_PORTS_START( icanguit ) + PORT_START("P1") + // uses multiplexed ports instead, see below + + PORT_START("P1_0") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Fret 1, Row 1") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("Fret 2, Row 1") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_NAME("Fret 3, Row 1") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_NAME("Fret 4, Row 1") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("Fret 5, Row 1") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("Fret 6, Row 1") // Frets 6-12 only have 2 rows (1 and 6) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_NAME("Fret 9, Row 1") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_NAME("Fret 10, Row 1") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Fret 11, Row 1") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("Fret 12, Row 1") + PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_NAME("Fret 1, Row 2") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Fret 2, Row 2") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Fret 3, Row 2") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_NAME("Fret 4, Row 2") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_NAME("Fret 5, Row 2") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_NAME("Fret 7, Row 1") + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Fret 1, Row 3") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("Fret 2, Row 3") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("Fret 3, Row 3") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("Fret 4, Row 3") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("Fret 5, Row 3") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Fret 8, Row 1") + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("Fret 1, Row 4") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_NAME("Fret 2, Row 4") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("Fret 3, Row 4") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME("Fret 4, Row 4") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("Fret 5, Row 4") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_NAME("Fret 8, Row 6") + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Fret 1, Row 5") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("Fret 2, Row 5") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_NAME("Fret 3, Row 5") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Fret 4, Row 5") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_NAME("Fret 5, Row 5") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("Fret 7, Row 6") + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_5") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Fret 1, Row 6") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("Fret 2, Row 6") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("Fret 3, Row 6") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Fret 4, Row 6") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_NAME("Fret 5, Row 6") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Fret 6, Row 6") // Frets 6-12 only have 2 rows (1 and 6) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_NAME("Fret 9, Row 6") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Fret 10, Row 6") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Fret 11, Row 6") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Fret 12, Row 6") + PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // might be some kind of seeprom in here? + + PORT_START("P3") + // uses multiplexed ports instead, see below + + PORT_START("P3_0") + PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("String 1") // these seem to respond on release, but are definitely active high based on visual indicators + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("String 2") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("String 3") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("String 4") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("String 5") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("String 6") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_DIPNAME( 0x0400, 0x0000, "TV or Guitar Mode" ) + PORT_DIPSETTING( 0x0000, "TV Mode" ) + PORT_DIPSETTING( 0x0400, "Guitar Mode" ) + PORT_BIT( 0xf800, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3_1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0xfffc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3_2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Home") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Enter") + PORT_BIT( 0xfffc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3_3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Pause") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0xfffc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3_4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // doesn't highlight during menus, but changes sound in 'Guitar Mode' and switches between levels after selecting song + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // doesn't highlight during menus, but changes sound in 'Guitar Mode' and switches between levels after selecting song + PORT_BIT( 0xfff8, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3_5") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("Whammy Up") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("Whammy Down") + PORT_BIT( 0xfff8, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + +// this has an entire piano keyboard + extras +// there is a volume dial for the internal speakers when used in non-TV mode, but presumably it is not CPU visible +// there should be a metronome key, but nothing seems to have that effect, maybe due to incomplete sound emulation? +static INPUT_PORTS_START( icanpian ) + PORT_START("P1") + // uses multiplexed ports instead, see below + + PORT_START("P1_0") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2)PORT_NAME("Octave 0 F (Green)") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("Octave 0 F# (Purple)") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Octave 0 G (Yellow)") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Octave 0 G# (Dark Blue)") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("Octave 0 A (Flesh)") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("Octave 0 A# (Dark Green)") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("Octave 0 B (Pink)") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_NAME("Octave 0 C (White)") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("Octave 0 C# (Black)") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("Octave 0 D (Blue)") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("Octave 0 D# (Red)") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("Octave 0 E (Orange)") + PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_NAME("Octave 1 F (Green)") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_NAME("Octave 1 F# (Purple)") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Octave 1 G (Yellow)") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("Octave 1 G# (Dark Blue)") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_NAME("Octave 1 A (Flesh)") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("Octave 1 A# (Dark Green)") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Octave 1 B (Pink)") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_NAME("Octave 1 C (White)") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Octave 1 C# (Black)") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Octave 1 D (Blue)") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("Octave 1 D# (Red)") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("Octave 1 E (Orange)") + PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P1_2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Octave 2 F (Green)") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Octave 2 F# (Purple)") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Octave 2 G (Yellow)") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Octave 2 G# (Dark Blue)") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_NAME("Octave 2 A (Flesh)") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Octave 2 A# (Dark Green)") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_NAME("Octave 2 B (Pink)") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("Octave 2 C (White)") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_NAME("Octave 2 C# (Black)") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME("Octave 2 D (Blue)") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Octave 2 D# (Red)") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Octave 2 E (Orange)") + PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // might be some kind of seeprom in here? (or not? only I Can Play Guitar seems to offer a 'resume', something does get accessed on startup tho? and the machine tells you 'high scores') + + PORT_START("P3") + // uses multiplexed ports instead, see below + + PORT_START("P3_0") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Change Instrument") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Cycle Hands") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Display Mode 1") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Display Mode 2") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Display Mode 3") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Display Mode 4") + PORT_BIT( 0x07c0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // unused? + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // presumably power / low battery, kils the game + PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3_1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("Tempo Up") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Tempo Default") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("Tempo Down") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Pause") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Metronome") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) // will skip intro scenes etc. like other buttons but no more physical buttons on KB to map here + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3_2") // the system ALWAYS requires a cartridge, but has 2 modes of operation depending on a switch. The only way to use it as a normal keyboard is by flipping this switch. + PORT_DIPNAME( 0x0001, 0x0000, "System Mode" ) // or implement this as a toggle key? (it's a slider switch) + PORT_DIPSETTING( 0x0001, "Keyboard Mode (no TV output)" ) + PORT_DIPSETTING( 0x0000, "TV Mode" ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Scroll Up") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Scroll Down") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Enter") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Home") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) // will skip intro scenes etc. like other buttons but no more physical buttons on KB to map here + PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + + + +READ16_MEMBER(icanguit_state::porta_r) +{ + logerror("%s: porta_r\n", machine().describe_context()); + return m_inlatch_a; +} + + +READ16_MEMBER(icanguit_state::portc_r) +{ + logerror("%s: portc_r\n", machine().describe_context()); + return m_inlatch_c; +} + + +WRITE16_MEMBER(icanguit_state::portc_w) +{ + logerror("%s: portc_w (%04x)\n", machine().describe_context(), data); +} + + +READ16_MEMBER(icanguit_state::portb_r) +{ + logerror("%s: portb_r\n", machine().describe_context()); + return m_io_p2->read(); +} + +WRITE16_MEMBER(icanguit_state::portb_w) +{ + logerror("%s: portb_w (%04x)\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(icanguit_state::porta_w) +{ + //logerror("%s: porta_w (%04x)\n", machine().describe_context(), data); + + if (data == 0x0000) + { + m_inlatch_a = m_inlatch_c = 0x0000; + } + else if (data == 0x0400) + { + m_inlatch_a = m_porta_in[5]->read(); + m_inlatch_c = m_portc_in[5]->read(); + } + else if (data == 0x0800) + { + m_inlatch_a = m_porta_in[4]->read(); + m_inlatch_c = m_portc_in[4]->read(); + } + else if (data == 0x1000) + { + m_inlatch_a = m_porta_in[3]->read(); + m_inlatch_c = m_portc_in[3]->read(); + } + else if (data == 0x2000) + { + m_inlatch_a = m_porta_in[2]->read(); + m_inlatch_c = m_portc_in[2]->read(); + } + else if (data == 0x4000) + { + m_inlatch_a = m_porta_in[1]->read(); + m_inlatch_c = m_portc_in[1]->read(); + } + else if (data == 0x8000) + { + m_inlatch_a = m_porta_in[0]->read(); + m_inlatch_c = m_portc_in[0]->read(); + } + else + { + logerror("%s: unknown porta_w (%04x)\n", machine().describe_context(), data); + } +} + +// icanpian differences + +WRITE16_MEMBER(icanpian_state::porta_w) +{ + if (data == 0x0000) + { + m_inlatch_a = m_inlatch_c = 0x0000; + } + else if (data == 0x1000) + { + m_inlatch_a = m_porta_in[2]->read(); + m_inlatch_c = m_portc_in[2]->read(); + } + else if (data == 0x2000) + { + m_inlatch_a = m_porta_in[1]->read(); + m_inlatch_c = m_portc_in[1]->read(); + } + else if (data == 0x4000) + { + m_inlatch_a = m_porta_in[0]->read(); + m_inlatch_c = m_portc_in[0]->read(); + } + else + { + logerror("%s: unknown porta_w (%04x)\n", machine().describe_context(), data); + } +} + +// accesses are made for what appears to be a serial eeprom on port B, very similar to dreamlif, but beyond blanking it at the start it doesn't +// seem to ever be used, maybe it was never added to hardware, or just never used? +READ16_MEMBER(icanpian_state::portb_r) +{ +/* + uint16_t ret = 0x0000; + logerror("%s: portbxx_r\n", machine().describe_context()); + ret |= m_eeprom->do_read() ? 0xffff : 0x0000; + return ret; +*/ + return 0x0000; +} + +WRITE16_MEMBER(icanpian_state::portb_w) +{ +/* + logerror("%s: portbxx_w (%04x)\n", machine().describe_context(), data); + m_eeprom->di_write(BIT(data, 2)); + m_eeprom->cs_write(BIT(data, 0) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->clk_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); +*/ +} + +void icanguit_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + // if there's a cart, override the standard banking + if (m_cart && m_cart->exists()) + { + std::string region_tag; + m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); + m_bank->set_entry(0); + } +} + +void icanguit_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); + m_inlatch_a = 0x0000; + m_inlatch_c = 0x0000; +} + + +DEVICE_IMAGE_LOAD_MEMBER(icanguit_state::cart_load_icanguit) +{ + uint32_t size = m_cart->common_get_size("rom"); + + if (size < 0x800000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); + return image_init_result::FAIL; + } + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + + + +void icanguit_state::icanguit(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &icanguit_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(icanguit_state::porta_r)); + m_maincpu->porta_out().set(FUNC(icanguit_state::porta_w)); + m_maincpu->portb_in().set(FUNC(icanguit_state::portb_r)); + m_maincpu->portb_out().set(FUNC(icanguit_state::portb_w)); + m_maincpu->portc_in().set(FUNC(icanguit_state::portc_r)); + m_maincpu->portc_out().set(FUNC(icanguit_state::portc_w)); + + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "icanguit_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(icanguit_state::cart_load_icanguit)); + m_cart->set_must_be_loaded(true); + + SOFTWARE_LIST(config, "icanguit_cart").set_original("icanguit"); +} + +void icanpian_state::icanpian(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &icanpian_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(icanpian_state::porta_r)); + m_maincpu->porta_out().set(FUNC(icanpian_state::porta_w)); + m_maincpu->portb_in().set(FUNC(icanpian_state::portb_r)); + m_maincpu->portb_out().set(FUNC(icanpian_state::portb_w)); + m_maincpu->portc_in().set(FUNC(icanpian_state::portc_r)); + m_maincpu->portc_out().set(FUNC(icanpian_state::portc_w)); + +// EEPROM_93C66_16BIT(config, m_eeprom); // unknown part +// m_eeprom->erase_time(attotime::from_usec(1)); +// m_eeprom->write_time(attotime::from_usec(1)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "icanpian_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(icanpian_state::cart_load_icanguit)); + m_cart->set_must_be_loaded(true); + + SOFTWARE_LIST(config, "icanpian_cart").set_original("icanpian"); +} + +ROM_START( icanguit ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + // no internal ROM, requires a cartridge +ROM_END + +ROM_START( icanpian ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + // no internal ROM, requires a cartridge +ROM_END + + +// Fisher-Price games +CONS( 2007, icanguit, 0, 0, icanguit, icanguit, icanguit_state, empty_init, "Fisher-Price", "I Can Play Guitar", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // how is data saved? +CONS( 2006, icanpian, 0, 0, icanpian, icanpian, icanpian_state, empty_init, "Fisher-Price", "I Can Play Piano", MACHINE_IMPERFECT_SOUND ) // 2006 date from Manual + diff --git a/src/mame/drivers/spg2xx_jakks.cpp b/src/mame/drivers/spg2xx_jakks.cpp new file mode 100644 index 00000000000..18590249053 --- /dev/null +++ b/src/mame/drivers/spg2xx_jakks.cpp @@ -0,0 +1,781 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +// Note: even after the GameKey port was physically removed and the PCBs redesigned, many of the test modes still show the value read from the port (and many games still show the Game Key Ready splash screen on startup) + +#include "includes/spg2xx.h" +#include "bus/jakks_gamekey/slot.h" + +class jakks_gkr_state : public spg2xx_game_state +{ +public: + jakks_gkr_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_porta_key_mode(false), + m_cart(*this, "cartslot"), + m_cart_region(nullptr) + { } + + void jakks(machine_config &config); + void jakks_i2c(machine_config &config); + void walle(machine_config &config); + + void jakks_gkr(machine_config &config); + void jakks_gkr_i2c(machine_config &config); + void jakks_gkr_1m_i2c(machine_config &config); + void jakks_gkr_2m_i2c(machine_config &config); + void jakks_gkr_nk(machine_config &config); + void jakks_gkr_nk_i2c(machine_config &config); + void jakks_gkr_dy(machine_config &config); + void jakks_gkr_dy_i2c(machine_config &config); + void jakks_gkr_dp_i2c(machine_config &config); + void jakks_gkr_sw_i2c(machine_config &config); + void jakks_gkr_nm_i2c(machine_config &config); + void jakks_gkr_cc_i2c(machine_config &config); + void jakks_gkr_wf_i2c(machine_config &config); + void jakks_gkr_mv_i2c(machine_config &config); + void jakks_gkr_wp(machine_config &config); + void jakks_gkr_cb(machine_config &config); + + DECLARE_READ_LINE_MEMBER(i2c_gkr_r); + +protected: + DECLARE_READ16_MEMBER(jakks_porta_r); + DECLARE_READ16_MEMBER(walle_portc_r); + + DECLARE_WRITE16_MEMBER(jakks_porta_w); + DECLARE_WRITE16_MEMBER(jakks_portb_w); + DECLARE_WRITE16_MEMBER(walle_portc_w); + + uint16_t m_walle_portc_data; + +private: + virtual void machine_start() override; + + DECLARE_READ16_MEMBER(jakks_porta_key_io_r); + + DECLARE_WRITE16_MEMBER(gkr_portc_w); + DECLARE_WRITE16_MEMBER(jakks_porta_key_io_w); + bool m_porta_key_mode; + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_gamekey); + + optional_device<jakks_gamekey_slot_device> m_cart; + memory_region *m_cart_region; +}; + +READ_LINE_MEMBER(jakks_gkr_state::i2c_gkr_r) +{ + if (m_cart && m_cart->exists()) + { + return m_cart->read_cart_seeprom(); + } + else + { + return m_i2cmem->read_sda(); + } +} + +WRITE16_MEMBER(jakks_gkr_state::walle_portc_w) +{ + m_walle_portc_data = data & mem_mask; + if (BIT(mem_mask, 1)) + m_i2cmem->write_scl(BIT(data, 1)); + if (BIT(mem_mask, 0)) + m_i2cmem->write_sda(BIT(data, 0)); +} + +WRITE16_MEMBER(jakks_gkr_state::gkr_portc_w) +{ + m_walle_portc_data = data & mem_mask; + + if (m_cart && m_cart->exists()) + { + m_cart->write_cart_seeprom(space,offset,data,mem_mask); + } + else + { + if (m_i2cmem) + { + if (BIT(mem_mask, 1)) + m_i2cmem->write_scl(BIT(data, 1)); + if (BIT(mem_mask, 0)) + m_i2cmem->write_sda(BIT(data, 0)); + } + } +} + +READ16_MEMBER(jakks_gkr_state::jakks_porta_r) +{ + //logerror("%s: jakks_porta_r\n", machine().describe_context()); + return m_io_p1->read(); +} + +WRITE16_MEMBER(jakks_gkr_state::jakks_porta_w) +{ + //logerror("%s: jakks_porta_w %04x\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(jakks_gkr_state::jakks_portb_w) +{ + //logerror("%s: jakks_portb_w %04x\n", machine().describe_context(), data); +} + +READ16_MEMBER(jakks_gkr_state::jakks_porta_key_io_r) +{ + //logerror("%s: jakks_porta_key_io_r\n", machine().describe_context()); + if (m_porta_key_mode == false) + { + return m_io_p1->read(); + } + else + { + /* masks with 0xf, inverts, and combines it with a previous read (when data written to jakks_porta_key_io_w was 0x0000) and expects result to be 0x0000 + could just expect data written to be returned, but that would be a strange check. + all systems seem to respond to the same result, so how is the per-system lock implemented? */ + return (m_io_p1->read() & 0xfff0) | 0x000f; + } +} + +WRITE16_MEMBER(jakks_gkr_state::jakks_porta_key_io_w) +{ + logerror("%s: jakks_porta_key_io_w %04x\n", machine().describe_context(), data); + // only seen 0xffff and 0x0000 written here.. writes 0xffff before the 2nd part of the port a gamekey check read. + if (data == 0xffff) + { + m_porta_key_mode = true; + } + else + { + m_porta_key_mode = false; + } +} + + +static INPUT_PORTS_START( batman ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("A Button") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Menu") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("B Button") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("X Button") +INPUT_PORTS_END + +static INPUT_PORTS_START( walle ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("A Button") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button") + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda) + PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_sith_i2c ) + PORT_START("P1") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0xf3df, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) + PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("JOYX") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) + + PORT_START("JOYY") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_pooh ) + PORT_START("P1") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Menu / Pause") + PORT_BIT( 0xf7df, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0xfff7, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) + + PORT_START("JOYX") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) + + PORT_START("JOYY") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_care ) + PORT_START("P1") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Menu / Pause") + PORT_BIT( 0xf7df, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0xfff7, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) + + PORT_START("JOYX") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) + + PORT_START("JOYY") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_nm_i2c ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Menu") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC + PORT_BIT( 0xfff0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + + PORT_START("DIALX") // for Pole Position, joystick can be twisted like a dial/wheel (limited?) (check range) + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_cc_i2c ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("A") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("C") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("D") + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC + PORT_BIT( 0xfff0, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_wf_i2c ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("A") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x01c0, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Menu") + PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) + PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC + + /* on real unit you can spin the wheel (and must make sure it completes a full circle, or you lose your turn) instead of pressing 'B' for a random spin but where does it map? (it can be tested in secret test mode) + PORT_START("DIALX") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) + + PORT_START("DIALY") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) + */ +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_gkr ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) + PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Menu / Pause") + PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (not verified for all games, state can be seen in secret test menu of many tho) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) // this causes WWE to think the unit is a '2nd Controller' and tells you to plug the 1st one in. + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_sdoo_i2c ) // GameKeyReady units had 2 main buttons, later releases reduced that to 1 button (as the internal games don't require 2 and no GameKeys were released) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) // debug input, skips levels! + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) // must be low or other inputs don't work? + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Menu / Pause") + PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) // is this correct? doesn't seem to work + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( jak_gkr_i2c ) + PORT_INCLUDE(jak_gkr) + + PORT_MODIFY("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_dpr_i2c ) + PORT_START("P1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Start / Menu / Pause") + PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) + PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + + + +void jakks_gkr_state::jakks(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(jakks_gkr_state::jakks_porta_r)); + m_maincpu->porta_out().set(FUNC(jakks_gkr_state::jakks_porta_w)); + m_maincpu->portb_out().set(FUNC(jakks_gkr_state::jakks_portb_w)); +} + +void jakks_gkr_state::jakks_i2c(machine_config &config) +{ + jakks(config); + I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); +} + +void jakks_gkr_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + // if there's a cart, override the standard banking + if (m_cart && m_cart->exists()) + { + std::string region_tag; + m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(JAKKSSLOT_ROM_REGION_TAG).c_str()); + m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); + m_bank->set_entry(0); + } + + save_item(NAME(m_walle_portc_data)); +} + +DEVICE_IMAGE_LOAD_MEMBER(jakks_gkr_state::cart_load_gamekey) +{ + return m_cart->call_load(); +} + +void jakks_gkr_state::jakks_gkr(machine_config &config) +{ + jakks(config); + + m_maincpu->porta_in().set(FUNC(jakks_gkr_state::jakks_porta_key_io_r)); + m_maincpu->porta_out().set(FUNC(jakks_gkr_state::jakks_porta_key_io_w)); + m_maincpu->portc_in().set_ioport("P3"); + m_maincpu->portc_out().set(FUNC(jakks_gkr_state::gkr_portc_w)); + + m_maincpu->set_rowscroll_offset(0); + + JAKKS_GAMEKEY_SLOT(config, m_cart, 0, jakks_gamekey, nullptr); +} + +void jakks_gkr_state::jakks_gkr_i2c(machine_config &config) +{ + jakks_gkr(config); + I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); +} + + +void jakks_gkr_state::jakks_gkr_1m_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); +} + +void jakks_gkr_state::jakks_gkr_2m_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_2m); +} + +void jakks_gkr_state::jakks_gkr_nk(machine_config &config) +{ + jakks_gkr(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + SOFTWARE_LIST(config, "jakks_gamekey_nk").set_original("jakks_gamekey_nk"); +} + +void jakks_gkr_state::jakks_gkr_nk_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + SOFTWARE_LIST(config, "jakks_gamekey_nk").set_original("jakks_gamekey_nk"); +} + +void jakks_gkr_state::jakks_gkr_dy(machine_config &config) +{ + jakks_gkr(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + SOFTWARE_LIST(config, "jakks_gamekey_dy").set_original("jakks_gamekey_dy"); +} + +void jakks_gkr_state::jakks_gkr_dy_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + SOFTWARE_LIST(config, "jakks_gamekey_dy").set_original("jakks_gamekey_dy"); +} + +void jakks_gkr_state::jakks_gkr_mv_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + SOFTWARE_LIST(config, "jakks_gamekey_mv").set_original("jakks_gamekey_mv"); +} + + +void jakks_gkr_state::jakks_gkr_dp_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + SOFTWARE_LIST(config, "jakks_gamekey_dp").set_original("jakks_gamekey_dp"); +} + +void jakks_gkr_state::jakks_gkr_sw_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + m_maincpu->adc_in<0>().set_ioport("JOYX"); + m_maincpu->adc_in<1>().set_ioport("JOYY"); + SOFTWARE_LIST(config, "jakks_gamekey_sw").set_original("jakks_gamekey_sw"); +} + +void jakks_gkr_state::jakks_gkr_wp(machine_config &config) +{ + jakks_gkr(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + m_maincpu->adc_in<0>().set_ioport("JOYX"); + m_maincpu->adc_in<1>().set_ioport("JOYY"); + //SOFTWARE_LIST(config, "jakks_gamekey_wp").set_original("jakks_gamekey_wp"); // NO KEYS RELEASED +} + +void jakks_gkr_state::jakks_gkr_cb(machine_config &config) +{ + jakks_gkr(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + m_maincpu->adc_in<0>().set_ioport("JOYX"); + m_maincpu->adc_in<1>().set_ioport("JOYY"); + //SOFTWARE_LIST(config, "jakks_gamekey_cb").set_original("jakks_gamekey_cb"); // NO KEYS RELEASED +} + +void jakks_gkr_state::jakks_gkr_nm_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + m_maincpu->adc_in<0>().set_ioport("DIALX"); + SOFTWARE_LIST(config, "jakks_gamekey_nm").set_original("jakks_gamekey_nm"); +} + +void jakks_gkr_state::jakks_gkr_cc_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + // shows 'E0' in gamekey test menu on real HW (maybe related to value key needs to return if one existed) + //SOFTWARE_LIST(config, "jakks_gamekey_cc").set_original("jakks_gamekey_cc"); // no game keys were released +} + +void jakks_gkr_state::jakks_gkr_wf_i2c(machine_config &config) +{ + jakks_gkr_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + //m_maincpu->adc_in<0>().set_ioport("DIALX"); // wheel does not seem to map here + //m_maincpu->adc_in<1>().set_ioport("DIALY"); + //SOFTWARE_LIST(config, "jakks_gamekey_wf").set_original("jakks_gamekey_wf"); // no game keys were released +} + + + +void jakks_gkr_state::walle(machine_config &config) +{ + jakks_i2c(config); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_2m); + m_maincpu->portc_in().set_ioport("P3"); + m_maincpu->portc_out().set(FUNC(jakks_gkr_state::walle_portc_w)); +} + + +ROM_START( jak_batm ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "batman.bin", 0x000000, 0x400000, CRC(46f848e5) SHA1(5875d57bb3fe0cac5d20e626e4f82a0e5f9bb94c) ) +ROM_END + +ROM_START( jak_wall ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "walle.bin", 0x000000, 0x400000, BAD_DUMP CRC(bd554cba) SHA1(6cd06a036ab12e7b0e1fd8003db873b0bb783868) ) + // both of these dumps are bad, but in slightly different ways, note the random green pixels around the text (bad data is reported in secret test mode) + //ROM_LOAD16_WORD_SWAP( "walle.bin", 0x000000, 0x400000, BAD_DUMP CRC(6bc90b16) SHA1(184d72de059057aae7800da510fcf05ed1da9ec9)) +ROM_END + +ROM_START( jak_wwe ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakkswwegkr.bin", 0x000000, 0x200000, CRC(b078a812) SHA1(7d97c0e2171b3fd91b280480c9ffd5651828195a) ) +ROM_END + +ROM_START( jak_fan4 ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksffgkr.bin", 0x000000, 0x200000, CRC(8755a1f7) SHA1(7214da15fe61881da27b81575fbdb54cc0f1d6aa) ) +ROM_END + +ROM_START( jak_just ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksjlagkr.bin", 0x000000, 0x200000, CRC(182989f0) SHA1(799229c537d6fe629ba9e1e4051d1bb9ca445d44) ) +ROM_END + +ROM_START( jak_dora ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksdoragkr.bin", 0x000000, 0x200000, CRC(bcaa132d) SHA1(3894b980fbc4144731b2a7a94acebb29e30de67c) ) +ROM_END + +ROM_START( jak_nick ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksnicktoonsgkr.bin", 0x000000, 0x200000, CRC(4dec1656) SHA1(b3002ab15e75068102f4955a3f0c52fb6d5cda56) ) +ROM_END + +ROM_START( jak_sbfc ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksspongebobgkr.bin", 0x000000, 0x200000, CRC(9871303c) SHA1(78bc2687e1514094db8bb875e1117df3fcb3d201) ) +ROM_END + +ROM_START( jak_dorr ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksdora2gkr.bin", 0x000000, 0x200000, CRC(6c09bcd9) SHA1(4bcad79658832f319d16b4f63257e127f6862d79) ) +ROM_END + + +ROM_START( jak_spdm ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksspidermangkr.bin", 0x000000, 0x200000, CRC(1b2ee700) SHA1(30ea69c489e1238b004f473f972b682e35573138) ) +ROM_END + +ROM_START( jak_pooh ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakkspoohgkr.bin", 0x000000, 0x200000, CRC(0d97df55) SHA1(f108621a83c7b2263dd1531d82311627c3a02002) ) +ROM_END + +ROM_START( jak_care ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "carebeargkr.bin", 0x000000, 0x200000, CRC(e6096eb7) SHA1(92ee1a6df374f8b355ba2280dc43d764f6f69dfe) ) +ROM_END + +ROM_START( jak_wof ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakkswheeloffortunegkr.bin", 0x000000, 0x200000, CRC(6a879620) SHA1(95478764a61741569041c2299528f6464651d593) ) +ROM_END + +ROM_START( jak_disn ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "disneygkr.bin", 0x000000, 0x100000, CRC(7a5ebcd7) SHA1(9add8c2a6e3f0409c8957a2ba2d054fd2c4c39c1) ) +ROM_END + +ROM_START( jak_disf ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "disneyfriendsgkr.bin", 0x000000, 0x200000, CRC(77bca50b) SHA1(6e0f4fd229ee11eac721b5dbe79cf9002d3dbd64) ) +ROM_END + +ROM_START( jak_dpr ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksdisneyprincessgkr.bin", 0x000000, 0x200000, CRC(e26003ce) SHA1(ee15243281df6f09b96185c34582d7091604c954) ) +ROM_END + +ROM_START( jak_dprs ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "disneyprincess2gkr.bin", 0x000000, 0x200000, CRC(b670bdde) SHA1(c33ce7ada72a0c44bc881b5792cd33a9f2f0fb08) ) +ROM_END + +ROM_START( jak_mpac ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksmspacmangkr.bin", 0x000000, 0x100000, CRC(cab40f77) SHA1(30731acc461150d96aafa7a0451cfb1a25264678) ) +ROM_END + +ROM_START( jak_sdoo ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksscoobydoogkr.bin", 0x000000, 0x400000, CRC(61062ce5) SHA1(9d21767fd855385ef83e4209c429ecd4bf7e5384) ) +ROM_END + +ROM_START( jak_dbz ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksdragonballzgkr.bin", 0x000000, 0x200000, CRC(d52c3b20) SHA1(fd5ce41c143cad9bca3372054f4ff98b52c33874) ) +ROM_END + +ROM_START( jak_sith ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "jakksstarwarsgkr.bin", 0x000000, 0x200000, CRC(932cde19) SHA1(b88b748c235e9eeeda574e4d5b4077ae9da6fbd0) ) +ROM_END + +ROM_START( jak_capc ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "capcomgkr.bin", 0x000000, 0x200000, CRC(6d47cce4) SHA1(263926a991d55459aa3cee90049d2202c1e3a70e) ) +ROM_END + + + +// JAKKS Pacific Inc TV games +CONS( 2004, jak_batm, 0, 0, jakks, batman, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "The Batman (JAKKS Pacific TV Game)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2008, jak_wall, 0, 0, walle, walle, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Wall-E (JAKKS Pacific TV Game)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +// 'Game-Key Ready' JAKKS games (these can also take per-game specific expansion cartridges, although not all games had them released) +// Some of these were available in versions without Game-Key ports, it is unconfirmed if code was the same unless otherwise stated +// For units released AFTER the GameKey promotion was cancelled it appears the code is the same as the PCB inside is the same, just the external port closed off, earlier units might be different hardware in some cases. +// units released BEFORE the GameKey support were sometimes different hardware, eg. the Spider-Man and Disney units were SPG110 based +CONS( 2005, jak_wwe, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "WWE (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WW (no game-keys released) +CONS( 2005, jak_fan4, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) +CONS( 2005, jak_just, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Taniko", "Justice League (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DC (no game-keys released) +CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Nursery Rhyme Adventure (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3 released) - The upper part of this one is pink/purple. +CONS( 2005, jak_dorr, 0, 0, jakks_gkr_nk_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Race to Play Park (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3 released) - The upper part of this one is blue +CONS( 2004, jak_nick, 0, 0, jakks_gkr_nk_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Nicktoons (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys +CONS( 2005, jak_sbfc, 0, 0, jakks_gkr_nk_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "SpongeBob SquarePants - The Fry Cook Games (JAKKS Pacific TV Game, Game-Key Ready) (AUG 18 2005 21:31:56)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys +CONS( 2005, jak_sdoo, 0, 0, jakks_gkr_2m_i2c, jak_sdoo_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Jolliford Management", "Scooby-Doo! and the Mystery of the Castle (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // SD (no game-keys released) (was dumped from a later unit with GameKey port missing, but internal PCB still supported it, code likely the same) +CONS( 2005, jak_disn, 0, 0, jakks_gkr_dy, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney (JAKKS Pacific TV Game, Game-Key Ready) (08 FEB 2005 A)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) +CONS( 2005, jak_disf, 0, 0, jakks_gkr_dy_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney Friends (JAKKS Pacific TV Game, Game-Key Ready) (17 MAY 2005 A)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) +CONS( 2005, jak_dpr, 0, 0, jakks_gkr_dp_i2c, jak_dpr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / 5000ft, Inc", "Disney Princess (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DP keys (1 key released) +CONS( 2005, jak_dprs, 0, 0, jakks_gkr_dp_i2c, jak_dpr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / 5000ft, Inc", "Disney Princesses (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DP keys (1 key released) (unit looks identical to above, including just having 'Disney Princess' logo, but this one has the 'board game' as a frontend and a slightly different on-screen title) +CONS( 2005, jak_sith, 0, 0, jakks_gkr_sw_i2c, jak_sith_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Griptonite Games", "Star Wars - Revenge of the Sith (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses SW keys (1 released) +CONS( 2005, jak_dbz, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dragon Ball Z (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DB (no game-keys released, 1 in development but cancelled) +CONS( 2005, jak_mpac, 0, 0, jakks_gkr_nm_i2c, jak_nm_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Namco / HotGen Ltd", "Ms. Pac-Man 5-in-1 (Ms. Pac-Man, Pole Position, Galaga, Xevious, Mappy) (JAKKS Pacific TV Game, Game-Key Ready) (07 FEB 2005 A SKU F)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NM (3 keys available [Dig Dug, New Rally-X], [Rally-X, Pac-Man, Bosconian], [Pac-Man, Bosconian]) +CONS( 2005, jak_capc, 0, 0, jakks_gkr_cc_i2c, jak_cc_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Capcom / HotGen Ltd", "Capcom 3-in-1 (1942, Commando, Ghosts'n Goblins) (JAKKS Pacific TV Game, Game-Key Ready) (29 MAR 2005 B)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses CC keys (no game-keys released) +CONS( 2005, jak_wof, 0, 0, jakks_gkr_wf_i2c, jak_wf_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Wheel of Fortune (JAKKS Pacific TV Game, Game-Key Ready) (Jul 11 2005 ORIG)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses WF keys (no game-keys released) analog wheel not emulated +// There is a 'Second Edition' version of Wheel of Fortune with a Gold case, GameKey port removed, and a '2' over the usual Game Key Ready logo, internals are different too, not Game-Key Ready +CONS( 2004, jak_spdm, 0, 0, jakks_gkr_mv_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Spider-Man (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // MV (1 key available) +CONS( 2005, jak_pooh, 0, 0, jakks_gkr_wp, jak_pooh, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Backbone Entertainment", "Winnie the Pooh - Piglet's Special Day (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WP (no game-keys released) +CONS( 2005, jak_care, 0, 0, jakks_gkr_cb, jak_care, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Backbone Entertainment", "Care Bears TV Games (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // CB (no game-keys released) + +// Some versions of the Shrek - Over the Hedge unit show the GameKey logo on startup (others don't) there is no evidence to suggest it was ever released with a GameKey port tho, and the internal PCB has no place for one on the versions we've seen (which show the logo) diff --git a/src/mame/drivers/spg2xx_lexibook.cpp b/src/mame/drivers/spg2xx_lexibook.cpp new file mode 100644 index 00000000000..4519dd4dde1 --- /dev/null +++ b/src/mame/drivers/spg2xx_lexibook.cpp @@ -0,0 +1,261 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" + +class spg2xx_lexiseal_game_state : public spg2xx_game_state +{ +public: + spg2xx_lexiseal_game_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag) + { } + + void lexiseal(machine_config& config); + void lexizeus(machine_config &config); + + void init_zeus(); + +protected: + //virtual void machine_start() override; + //virtual void machine_reset() override; + + virtual DECLARE_WRITE16_MEMBER(portb_w) override; +}; + + +static INPUT_PORTS_START( lexizeus ) // how many buttons does this have? I accidentally entered a secret test mode before that seemed to indicate 6, but can't get there again + PORT_START("P1") + PORT_DIPNAME( 0x0001, 0x0001, "P1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Button 1") // shoot in Tiger Rescue & Deep + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pause") + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Button 1 Rapid") // same function as button 1 but with rapid toggle on/off + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Button 2 Rapid") // same function as button 2 but with rapid toggle on/off + PORT_DIPNAME( 0x0004, 0x0004, "P3" ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Button 2") // toggles ball / number view in pool + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + + +static INPUT_PORTS_START( lexiseal ) + PORT_START("P1") + PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) // doesn't respond as 'select' + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) // pause / start + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) + PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + + + +WRITE16_MEMBER(spg2xx_lexiseal_game_state::portb_w) +{ + //logerror("%s: portb_w %04x\n", machine().describe_context(), data); + + // only 2 banks + if (data == 0x5f) + switch_bank(0); + else if (data == 0xdf) + switch_bank(1); +} + + +void spg2xx_lexiseal_game_state::lexiseal(machine_config &config) +{ + non_spg_base(config); + m_maincpu->portb_out().set(FUNC(spg2xx_lexiseal_game_state::portb_w)); + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); +} + +void spg2xx_lexiseal_game_state::lexizeus(machine_config &config) +{ + non_spg_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_lexiseal_game_state::mem_map_4m); + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); +} + +void spg2xx_lexiseal_game_state::init_zeus() +{ + uint16_t *ROM = (uint16_t*)memregion("maincpu")->base(); + int size = memregion("maincpu")->bytes(); + + for (int i = 0x8000 / 2; i < size / 2; i++) + { + // global 16-bit xor + ROM[i] = ROM[i] ^ 0x8a1d; + + // 4 single bit conditional xors + if (ROM[i] & 0x0020) + ROM[i] ^= 0x0100; + + if (ROM[i] & 0x0040) + ROM[i] ^= 0x1000; + + if (ROM[i] & 0x4000) + ROM[i] ^= 0x0001; + + if (ROM[i] & 0x0080) + ROM[i] ^= 0x0004; + + // global 16-bit bitswap + ROM[i] = bitswap<16>(ROM[i], 7, 12, 9, 14, 4, 6, 0, 10, 15, 1, 3, 2, 5, 13, 8, 11); + } +} + + + +ROM_START( lexizeus ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "lexibook1g900us.bin", 0x0000, 0x800000, CRC(c2370806) SHA1(cbb599c29c09b62b6a9951c724cd9fc496309cf9)) +ROM_END + +ROM_START( lexiseal ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "lexibook_seal.bin", 0x0000, 0x1000000, CRC(3529f154) SHA1(f5f142600c6b2d037b97e007364ea2fa228e0163) ) +ROM_END + + + + +// Similar, SPG260?, scrambled +CONS( 200?, lexizeus, 0, 0, lexizeus, lexizeus, spg2xx_lexiseal_game_state, init_zeus, "Lexibook", "Zeus IG900 20-in-1 (US?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad sound and some corrupt bg tilemap entries in Tiger Rescue, verify ROM data (same game runs in Zone 60 without issue) +CONS( 200?, lexiseal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Lexibook / Sit Up Limited", "Seal 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // also has bad sound in Tiger Rescue, but no corrupt tilemap + diff --git a/src/mame/drivers/spg2xx_pdc.cpp b/src/mame/drivers/spg2xx_pdc.cpp new file mode 100644 index 00000000000..37bd32d212d --- /dev/null +++ b/src/mame/drivers/spg2xx_pdc.cpp @@ -0,0 +1,107 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" + +class spg2xx_pdc100_game_state : public spg2xx_game_state +{ +public: + spg2xx_pdc100_game_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_numbanks(-1) + { } + + void pdc100(machine_config& config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + +private: + int m_numbanks; +}; + + +static INPUT_PORTS_START( pdc100 ) + PORT_START("P1") + PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Left Trigger") + PORT_BIT( 0x0e00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Right Trigger") + PORT_BIT( 0xe000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Pause") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + +void spg2xx_pdc100_game_state::machine_start() +{ + spg2xx_game_state::machine_start(); + m_numbanks = memregion("maincpu")->bytes() / 0x800000; +} + +void spg2xx_pdc100_game_state::machine_reset() +{ + m_current_bank = -1; + switch_bank(m_numbanks - 1); // pdc100 must boot from upper bank + m_maincpu->reset(); +} + +WRITE16_MEMBER(spg2xx_pdc100_game_state::porta_w) +{ + // pdc100 simply writes 0000 at times during bootup while initializing stuff, which causes an invalid bankswitch mid-code execution + if (data & 0xff00) + switch_bank(data & (m_numbanks - 1)); +} + + +void spg2xx_pdc100_game_state::pdc100(machine_config &config) +{ + non_spg_base(config); + m_maincpu->porta_out().set(FUNC(spg2xx_pdc100_game_state::porta_w)); + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); // not used? +} + +ROM_START( pdc100 ) + ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) + // only 1st half of this is used "Jumper resistor (0 ohm) that short A25 to ground" + // 2nd half just contains what seems to be random garbage + ROM_LOAD16_WORD_SWAP( "pdc100.bin", 0x000000, 0x4000000, CRC(57285b49) SHA1(cfb4be7877ec263d24063a004c56985db5c0f4e2) ) + ROM_IGNORE(0x4000000) +ROM_END + +ROM_START( tmntpdc ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "pdc_turtles.bin", 0x000000, 0x800000, CRC(ee9e70a3) SHA1(7620f1b7aeaec8032faa8eb7552f775e8d6d14ba) ) +ROM_END + + +// there were older models eg. PDC30 with fewer games, and some differences (eg "Jo Ma" instead of "Jo Ma 2") +// "Jo Ma 2" shows "Licensed by Mitchell Corporation" (Mitchell made the original Puzzloop on which this style of game is based) Videos of the original Jo Ma show it lacking this text. + +// Other known units +// PDC Dora the Explorer +// PDC 30 +// PDC 40 +// PDC 200 + +// This was dumped from an Anncia branded unit, although there's no ingame branding, so ROM is probably the same for all PDC100 units +CONS( 2008, pdc100, 0, 0, pdc100, pdc100, spg2xx_pdc100_game_state, empty_init, "Conny", "PDC100 - Pocket Dream Console", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +CONS( 2013, tmntpdc, 0, 0, pdc100, pdc100, spg2xx_pdc100_game_state, empty_init, "Conny / VideoJet", "Teenage Mutant Ninja Turtles - Pocket Dream Console (France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_playvision.cpp b/src/mame/drivers/spg2xx_playvision.cpp new file mode 100644 index 00000000000..7d8650d345b --- /dev/null +++ b/src/mame/drivers/spg2xx_playvision.cpp @@ -0,0 +1,230 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" +#include "pvmil.lh" + + +class pvmil_state : public spg2xx_game_state +{ +public: + pvmil_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_portcdata(0x0000), + m_latchcount(0), + m_latchbit(0), + m_outdat(0), + m_p4inputs(*this, "EXTRA"), + m_leds(*this, "led%u", 0U) + { } + + void pvmil(machine_config &config); + + DECLARE_READ_LINE_MEMBER(pvmil_p4buttons_r); + +protected: + virtual void machine_start() override; + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + virtual DECLARE_WRITE16_MEMBER(portc_w) override; + +private: + uint16_t m_portcdata; + int m_latchcount; + int m_latchbit; + uint16_t m_outdat; + optional_ioport m_p4inputs; + output_finder<4> m_leds; +}; + + +void pvmil_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + m_leds.resolve(); + save_item(NAME(m_portcdata)); + save_item(NAME(m_latchcount)); + save_item(NAME(m_latchbit)); + save_item(NAME(m_outdat)); +} + + +WRITE16_MEMBER(pvmil_state::porta_w) +{ + logerror("%s: pvmil_porta_w %04x\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(pvmil_state::portb_w) +{ + logerror("%s: pvmil_portb_w %04x\n", machine().describe_context(), data); +} + + +READ_LINE_MEMBER(pvmil_state::pvmil_p4buttons_r) +{ + return m_latchbit; +} + + +WRITE16_MEMBER(pvmil_state::portc_w) +{ + // ---- -432 1--- r-?c + // 4,3,2,1 = player controller LEDs + // r = reset input multiplexer + // ? = unknown + // m = input multiplexer clock + + // p4 input reading + // the code to read them is interesting tho, it even includes loops that poll port a 16 times before/after, why? + logerror("%s: pvmil_portc_w %04x\n", machine().describe_context(), data); + + uint16_t bit; + + // for logging bits changed on the port + if (0) + { + for (int i = 0; i < 16; i++) + { + bit = 1 << i; + if ((m_portcdata & bit) != (data & bit)) + { + if (data & bit) + { + logerror("port c %04x low to high\n", bit); + } + else + { + logerror("port c %04x high to low\n", bit); + } + } + + if ((m_portcdata & 0x0400) != (data & 0x0400)) + { + logerror("-------------------------------------------------\n"); + } + } + } + + // happens on startup, before it starts reading inputs for the first time, assume 'reset counter' + bit = 0x0008; + if ((m_portcdata & bit) != (data & bit)) + { + if (data & bit) + { + logerror("reset read counter\n"); + m_latchcount = 0; + } + } + + bit = 0x0001; + if ((m_portcdata & bit) != (data & bit)) + { + if (!(data & bit)) + { + //logerror("latch with count of %d (outbit is %d)\n", m_latchcount, (m_portcdata & 0x0002)>>1 ); + // what is bit 0x0002? it gets flipped in the same code as the inputs are read. + // it doesn't follow any obvious pattern + m_outdat &= ~(1 << m_latchcount); + m_outdat |= ((data & 0x0002) >> 1) << m_latchcount; + if (0) + popmessage("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + (m_outdat & 0x8000) ? 1 : 0, (m_outdat & 0x4000) ? 1 : 0, (m_outdat & 0x2000) ? 1 : 0, (m_outdat & 0x1000) ? 1 : 0, + (m_outdat & 0x0800) ? 1 : 0, (m_outdat & 0x0400) ? 1 : 0, (m_outdat & 0x0200) ? 1 : 0, (m_outdat & 0x0100) ? 1 : 0, + (m_outdat & 0x0080) ? 1 : 0, (m_outdat & 0x0040) ? 1 : 0, (m_outdat & 0x0020) ? 1 : 0, (m_outdat & 0x0010) ? 1 : 0, + (m_outdat & 0x0008) ? 1 : 0, (m_outdat & 0x0004) ? 1 : 0, (m_outdat & 0x0002) ? 1 : 0, (m_outdat & 0x0001) ? 1 : 0); + + + m_latchbit = (((m_p4inputs->read()) << m_latchcount) & 0x8000) ? 1 : 0; + + m_latchcount++; + if (m_latchcount == 16) + m_latchcount = 0; + } + } + + m_portcdata = data; + + if (0) + popmessage("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + (m_portcdata & 0x8000) ? 1 : 0, (m_portcdata & 0x4000) ? 1 : 0, (m_portcdata & 0x2000) ? 1 : 0, (m_portcdata & 0x1000) ? 1 : 0, + (m_portcdata & 0x0800) ? 1 : 0, (m_portcdata & 0x0400) ? 1 : 0, (m_portcdata & 0x0200) ? 1 : 0, (m_portcdata & 0x0100) ? 1 : 0, + (m_portcdata & 0x0080) ? 1 : 0, (m_portcdata & 0x0040) ? 1 : 0, (m_portcdata & 0x0020) ? 1 : 0, (m_portcdata & 0x0010) ? 1 : 0, + (m_portcdata & 0x0008) ? 1 : 0, (m_portcdata & 0x0004) ? 1 : 0, (m_portcdata & 0x0002) ? 1 : 0, (m_portcdata & 0x0001) ? 1 : 0); + + m_leds[0] = (m_portcdata & 0x0080) ? 0 : 1; + m_leds[1] = (m_portcdata & 0x0100) ? 0 : 1; + m_leds[2] = (m_portcdata & 0x0200) ? 0 : 1; + m_leds[3] = (m_portcdata & 0x0400) ? 0 : 1; +} + + +static INPUT_PORTS_START( pvmil ) // hold "console start" + "console select" on boot for test mode + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Player 1 A") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Player 1 B") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Player 1 C") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Player 1 D") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Player 2 A") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Player 2 B") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Player 2 C") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Player 2 D") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("Player 3 A") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("Player 3 B") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("Player 3 C") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(3) PORT_NAME("Player 3 D") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("Player 1 Lifeline") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Start") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pvmil_state, pvmil_p4buttons_r) // Player 4 buttons read through here + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("Player 2 Lifeline") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(3) PORT_NAME("Player 3 Lifeline") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(4) PORT_NAME("Player 4 Lifeline") + PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("EXTRA") + PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("Player 4 A") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("Player 4 B") + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("Player 4 C") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_NAME("Player 4 D") +INPUT_PORTS_END + + +void pvmil_state::pvmil(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &pvmil_state::mem_map_4m); + m_maincpu->set_pal(true); + + spg2xx_base(config); + + m_screen->set_refresh_hz(50); + //m_screen->set_size(320, 312); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); + m_maincpu->porta_out().set(FUNC(pvmil_state::porta_w)); + m_maincpu->portb_out().set(FUNC(pvmil_state::portb_w)); + m_maincpu->portc_out().set(FUNC(pvmil_state::portc_w)); + + config.set_default_layout(layout_pvmil); +} + +ROM_START( pvmil ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) // Fujistu 29Z0002TN, read as ST M29W320FB + ROM_LOAD16_WORD_SWAP( "millionare4.bin", 0x000000, 0x400000, CRC(9c43d0f2) SHA1(fb4ba0115000b10b7c0e0d44b9fa3234c900e694) ) +ROM_END + +// there are other regions of this, including a Finnish version "Haluatko miljonääriksi?" (see https://millionaire.fandom.com/wiki/Haluatko_miljon%C3%A4%C3%A4riksi%3F_(Play_Vision_game) ) +CONS( 2006, pvmil, 0, 0, pvmil, pvmil, pvmil_state, empty_init, "Play Vision", "Who Wants to Be a Millionaire? (Play Vision, Plug and Play, UK)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_senario.cpp b/src/mame/drivers/spg2xx_senario.cpp new file mode 100644 index 00000000000..4b217e1063a --- /dev/null +++ b/src/mame/drivers/spg2xx_senario.cpp @@ -0,0 +1,324 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +/* + General Senario games on SunPlus hardware + + these check for flash ROM and actually save user data at 0x700000 (senmil/senbbs/senapren) in the flash ROM + + TODO: + senmil - Are the LEDs on the controllers meant to go out as players select answers like with pvmil, or are they just to show that the controller is connected? + sencosmo - fix Flash hookup (crashes if you use a Flash chip right now) + senapren - should it actually save data? chip really seems to be 2MB, data written at 7MB can't be saved at mirrored 1MB address or it would erase game code / data + senpmate - again seems to actually be a 2MB chip + +*/ + +#include "includes/spg2xx.h" +#include "machine/intelfsh.h" + +class spg2xx_senario_state : public spg2xx_game_state +{ +public: + spg2xx_senario_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_game_state(mconfig, type, tag) + { } + +protected: + //virtual void machine_start() override; + //virtual void machine_reset() override; + +private: +}; + +class spg2xx_senario_bbs_state : public spg2xx_senario_state +{ +public: + spg2xx_senario_bbs_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_senario_state(mconfig, type, tag) + { } + + void senbbs(machine_config& config); + void mem_map_flash(address_map &map); + +protected: + //virtual void machine_start() override; + //virtual void machine_reset() override; + +private: +}; + +class spg2xx_senario_cosmo_state : public spg2xx_senario_bbs_state +{ +public: + spg2xx_senario_cosmo_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_senario_bbs_state(mconfig, type, tag), + m_romregion(*this, "flash") + { } + + void sencosmo(machine_config& config); + void mem_map_flash_bypass(address_map& map); + +protected: + //virtual void machine_start() override; + //virtual void machine_reset() override; + + DECLARE_READ16_MEMBER(read_bypass) { return m_romregion[offset]; } + DECLARE_WRITE16_MEMBER(write_bypass) { logerror("Write to ROM area %08x %04x\n", offset, data); } + +private: + required_region_ptr<uint16_t> m_romregion; +}; + + +class spg2xx_senario_mil_state : public spg2xx_senario_bbs_state +{ +public: + spg2xx_senario_mil_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_senario_bbs_state(mconfig, type, tag), + m_portc_data(0) + { } + + void senmil(machine_config& config); + +protected: + //virtual void machine_start() override; + //virtual void machine_reset() override; + + DECLARE_READ16_MEMBER(portc_r); + + virtual DECLARE_WRITE16_MEMBER(portc_w) override; + +private: + uint16_t m_portc_data; +}; + +static INPUT_PORTS_START( senmil ) // reset with Console Start and Console Select held down for test mode + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Player 1 A") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Player 1 B") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Player 1 C") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Player 1 D") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Player 2 A") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Player 2 B") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Player 2 C") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Player 2 D") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("Player 3 A") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("Player 3 B") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("Player 3 C") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) PORT_NAME("Player 3 D") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("Player 4 A") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("Player 4 B") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("Player 4 C") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_NAME("Player 4 D") + + PORT_START("P2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("Player 1 Select") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("Player 1 OK") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("Player 2 Select") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("Player 2 OK") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(3) PORT_NAME("Player 3 Select") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(3) PORT_NAME("Player 3 OK") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) PORT_NAME("Player 4 Select") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) PORT_NAME("Player 4 OK") + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Pad Connection Status (see spg2xx_senario_mil_state::portc_r) + PORT_BIT( 0x0300, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Low Battery sensor + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Start") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SELECT ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") + PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( senbbs ) // reset with Select and Spin held down for test mode + PORT_START("P1") + // To use Gambling controls or not? This is a Plug and Play themed controller, not an actual gambling unit + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Spin") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Lever") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Select") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("OK") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Bet") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cash Out") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Bet Max") + PORT_BIT( 0x7f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Low Battery sensor + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( senappren ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Red Team Select") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Red Team Ok") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Blue Team Select") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Blue Team Ok") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Ok") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") + PORT_BIT( 0x7f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Low Battery sensor + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( sencosmo ) // hold Pause during power on for Test Menu + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Player 1 A") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Player 1 B") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Player 1 C") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Player 1 D") + PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Pause") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Player 2 A") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Player 2 B") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Player 2 C") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Player 2 D") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Power") + PORT_BIT( 0x6000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Low Battery sensor + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( senpmate ) // hold Pause during power on for Test Menu + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player A") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Player B") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Player C") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Player D") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_F2) PORT_NAME("Console Reset") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Player Select") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Player Start") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // responds for 'any button' presses, doesn't appear to be a real button + PORT_BIT( 0x7f00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Low Battery sensor + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + +void spg2xx_senario_bbs_state::mem_map_flash(address_map &map) +{ + map(0x000000, 0x3fffff).rw("flash", FUNC(spansion_s29gl064s_device::read), FUNC(spansion_s29gl064s_device::write)); +} + +// this is meant to be flash, but it crashes with invalid flash command when answering questions? +void spg2xx_senario_cosmo_state::mem_map_flash_bypass(address_map &map) +{ + map(0x000000, 0x1fffff).rw(FUNC(spg2xx_senario_cosmo_state::read_bypass), FUNC(spg2xx_senario_cosmo_state::write_bypass)); +} + + +WRITE16_MEMBER(spg2xx_senario_mil_state::portc_w) +{ + // -4-3 -2-1 + // change when a button for that player is pressed, none of these seem to be for the LEDs on the controllers (or are they 'always on') + + logerror("%s: spg2xx_senario_mil_state::portc_w %04x ---- %04x %04x \n", machine().describe_context(), data, data & 0x55, data & 0xaa); + m_portc_data = data; +} + +READ16_MEMBER(spg2xx_senario_mil_state::portc_r) +{ + uint16_t ret = m_io_p3->read() & 0xffaa; // 0xaa must be set to register all controllers as turned on + ret |= m_portc_data & 0x0055; + return ret; +} + +void spg2xx_senario_bbs_state::senbbs(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_senario_bbs_state::mem_map_flash); + + spg2xx_base(config); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); + + SPANSION_S29GL064S(config, "flash"); +} + +void spg2xx_senario_cosmo_state::sencosmo(machine_config& config) +{ + senbbs(config); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_senario_cosmo_state::mem_map_flash_bypass); + /* the game crashes if you get no matches after the 2nd spin on the 'Fashion Disaster' slot machine mini-game. + this could be a real game bug (as to trigger it you'd have to make a poor choice not to hold any matches after the first spin) + however with the recompiler execution of bad data causes MAME to immediately drop to commandline with no error message + without recompiler the game just hangs */ + m_maincpu->set_force_no_drc(true); + +} + + +void spg2xx_senario_mil_state::senmil(machine_config& config) +{ + senbbs(config); + + m_maincpu->portc_in().set(FUNC(spg2xx_senario_mil_state::portc_r)); + m_maincpu->portc_out().set(FUNC(spg2xx_senario_mil_state::portc_w)); +} + +// is ROM_REGION16_BE correct here, allows us to use ROM_LOAD16_WORD_SWAP as when loading SunPlus stuff in other cases + +ROM_START( senapren ) + ROM_REGION16_BE( 0x800000, "flash", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "apprentice.bin", 0x000000, 0x200000, CRC(1c919e72) SHA1(20efcb992bd3ff8ab78470bd484f4f0b226e6c15) ) + // That one has a SOP44 COB instead of a TSOP48 chip. Pin 1 is N/C, 32 is grounded, and 33 is tied high. That means a max of A0-A20 = 21 16-bit address lines, for 4MB + // Data repeated dumped as 4MB, so 2MB? (but game attempts to write to 0x700000 for flash user data which would erase game data in a 2MB ROM) + // ROM also had a sticker that says D44B 16M 050818. 16Mbit is 2MB, and the 16-bit sum of the 2MB file is D44B. + // Maybe the Flash ROM save just isn't meant to work here? +ROM_END + +ROM_START( senpmate ) + ROM_REGION16_BE( 0x800000, "flash", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "perfectmate.bin", 0x000000, 0x200000, CRC(fa7f8ca0) SHA1(fcc78f8efb183e9c65545eb502da475225253a94) ) + // Perfect Mate's COB also had a sticker: 7DC1 16M 050822. The 2MB file I dumped sums to 7DC1 + // The Perfect Mate checksum in the ROM header matches the sum of bytes from 0x10 to the end. +ROM_END + +ROM_START( sencosmo ) + ROM_REGION16_BE( 0x400000, "flash", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "cosmo.bin", 0x000000, 0x400000, CRC(1ec50795) SHA1(621c4e03b5713f3678d2935f8938f15c5d4a5fdf) ) + // attempts to write to 0x380000 for flash user data? different Flash type? +ROM_END + +ROM_START( senmil ) + ROM_REGION16_BE( 0x800000, "flash", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "wwtbam_nouserdata.bin", 0x000000, 0x800000, CRC(b2626df6) SHA1(f06943d63dbb1c9d211cb35b40dcb18cb8b39ecd) ) +ROM_END + +ROM_START( senbbs ) + ROM_REGION16_BE( 0x800000, "flash", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "bigbonusslots.bin", 0x000000, 0x800000, CRC(071effc3) SHA1(892c05a8b64a388b331ad0d361bf4c523c6c14c9) ) +ROM_END + + + +CONS( 2005, senbbs, 0, 0, senbbs, senbbs, spg2xx_senario_bbs_state, empty_init, "Senario", "Big Bonus Slots (Senario, Plug and Play)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2005, senapren, 0, 0, senbbs, senappren, spg2xx_senario_bbs_state, empty_init, "Senario", "The Apprentice (Senario, Plug and Play)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2005, senpmate, 0, 0, senbbs, senpmate, spg2xx_senario_bbs_state, empty_init, "Senario", "The Perfect Mate (Senario, Plug and Play)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2005, sencosmo, 0, 0, sencosmo, sencosmo, spg2xx_senario_cosmo_state, empty_init, "Senario", "Cosmo Girl (Senario, Plug and Play)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2005?,senmil, 0, 0, senmil, senmil, spg2xx_senario_mil_state, empty_init, "Senario", "Who Wants to Be a Millionaire? (Senario, Plug and Play, US)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_senario_poker.cpp b/src/mame/drivers/spg2xx_senario_poker.cpp new file mode 100644 index 00000000000..3a532ba3d30 --- /dev/null +++ b/src/mame/drivers/spg2xx_senario_poker.cpp @@ -0,0 +1,726 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +/* Senario 6 Player Poker systems + +TODO: +improve controller hookup / simulation and remove PC-based hacks! + +*/ + +#include "includes/spg2xx.h" +#include "sentx6p.lh" + + +class sentx6p_state : public spg2xx_game_state +{ +public: + sentx6p_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_porta_data(0x0000), + m_suite1(*this, "SUITE_LEFT_BZ%u", 0U), + m_suite2(*this, "SUITE_RIGHT_BZ%u", 0U), + m_number1(*this, "NUMBER_LEFT_BZ%u", 0U), + m_number2(*this, "NUMBER_RIGHT_BZ%u", 0U), + m_select_fold(*this, "SELECT_FOLD_BZ%u", 0U), + m_select_check(*this, "SELECT_CHECK_BZ%u", 0U), + m_select_bet(*this, "SELECT_BET_BZ%u", 0U), + m_select_call(*this, "SELECT_CALL_BZ%u", 0U), + m_select_raise(*this, "SELECT_RAISE_BZ%u", 0U), + m_select_allin(*this, "SELECT_ALLIN_BZ%u", 0U), + m_option_fold(*this, "OPTION_FOLD_BZ%u", 0U), + m_option_check(*this, "OPTION_CHECK_BZ%u", 0U), + m_option_bet(*this, "OPTION_BET_BZ%u", 0U), + m_option_call(*this, "OPTION_CALL_BZ%u", 0U), + m_option_raise(*this, "OPTION_RAISE_BZ%u", 0U), + m_option_allin(*this, "OPTION_ALLIN_BZ%u", 0U), + + m_led(*this, "LED_BZ%u", 0U) + { } + + void sentx6p(machine_config &config); + + void init_sentx6p(); + void init_sentx6puk(); + void init_sentx6pd(); + + void mem_map_2m_texas(address_map &map); + + DECLARE_INPUT_CHANGED_MEMBER(ok_latch) + { + if (newval == 1) + { + m_inputlatches[param] |= 0x02; + logerror("latching OK button for Player %d\n", param+1); + } + } + + DECLARE_INPUT_CHANGED_MEMBER(select_latch) + { + if (newval == 1) + { + m_inputlatches[param] |= 0x01; + logerror("latching Select button for Player %d\n", param+1); + } + } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + READ16_MEMBER(sentx_porta_r); + READ16_MEMBER(sentx_portb_r); + READ16_MEMBER(sentx_portc_r); + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + virtual DECLARE_WRITE16_MEMBER(portc_w) override; + + DECLARE_WRITE8_MEMBER(sentx_tx_w); + + uint8_t m_lcd_card1[6]; + uint8_t m_lcd_card2[6]; + uint8_t m_lcd_options[6]; + uint8_t m_lcd_options_select[6]; + uint8_t m_lcd_led[6]; + + void set_card1(uint8_t value, int select_bits); + void set_card2(uint8_t value, int select_bits); + void set_options(uint8_t value, int select_bits); + void set_options_select(uint8_t value, int select_bits); + void set_controller_led(uint8_t value, int select_bits); + + void controller_send_data(int which); + + uint8_t m_inputlatches[6]; + + uint16_t m_porta_data; + + output_finder<6> m_suite1; + output_finder<6> m_suite2; + output_finder<6> m_number1; + output_finder<6> m_number2; + + output_finder<6> m_select_fold; + output_finder<6> m_select_check; + output_finder<6> m_select_bet; + output_finder<6> m_select_call; + output_finder<6> m_select_raise; + output_finder<6> m_select_allin; + + output_finder<6> m_option_fold; + output_finder<6> m_option_check; + output_finder<6> m_option_bet; + output_finder<6> m_option_call; + output_finder<6> m_option_raise; + output_finder<6> m_option_allin; + + output_finder<6> m_led; + + // for I/O hacks + uint32_t m_pchackaddress1; + uint32_t m_pchackaddress2; + uint16_t m_controller_sense_addr; +}; + + +void sentx6p_state::mem_map_2m_texas(address_map &map) +{ + map(0x000000, 0x3fffff).bankr("cartbank"); + map(0x3f0000, 0x3f7fff).ram(); +} + +static INPUT_PORTS_START( sentx6p ) + PORT_START("P1") + PORT_DIPNAME( 0x0001, 0x0001, "Port 1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + // is this really just the battery sensor, or does it have some other meaning, like data ready? + PORT_DIPNAME( 0x8000, 0x0000, "Low Battery" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("P2") + // these must be sense lines + PORT_DIPNAME( 0x0001, 0x0001, "Player 1 Connected" ) + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x0002, 0x0002, "Player 2 Connected" ) + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x0004, 0x0004, "Player 3 Connected" ) + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x0008, 0x0008, "Player 4 Connected" ) + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x0010, 0x0010, "Player 5 Connected" ) + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x0020, 0x0020, "Player 6 Connected" ) + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) + + PORT_DIPNAME( 0x0040, 0x0040, "Port 2" ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_DIPNAME( 0x0001, 0x0001, "Port 3" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") // the Console buttons also work for Player 1 + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Ok") + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + // these are presuambly read through the UART as the LCD screens are driven by it, currently not hooked up + // using PORT_CHANGED_MEMBER because we assume the controller latches them for sending as inputs are only read every few frames + PORT_START("CTRL1") + PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 0) + PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 0) + + PORT_START("CTRL2") + PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 1) + PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 1) + + PORT_START("CTRL3") + PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 2) + PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 2) + + PORT_START("CTRL4") + PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 3) + PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 3) + + PORT_START("CTRL5") + PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(5) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 4) + PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(5) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 4) + + PORT_START("CTRL6") + PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(6) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 5) + PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(6) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 5) + +INPUT_PORTS_END + + +void sentx6p_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + m_suite1.resolve(); + m_suite2.resolve(); + m_number1.resolve(); + m_number2.resolve(); + + m_select_fold.resolve(); + m_select_check.resolve(); + m_select_bet.resolve(); + m_select_call.resolve(); + m_select_raise.resolve(); + m_select_allin.resolve(); + + m_option_fold.resolve(); + m_option_check.resolve(); + m_option_bet.resolve(); + m_option_call.resolve(); + m_option_raise.resolve(); + m_option_allin.resolve(); + + m_led.resolve(); +} + +void sentx6p_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); + + for (int i = 0; i < 6; i++) + { + m_lcd_card1[i] = 0x00; + m_lcd_card2[i] = 0x00; + m_lcd_options[i] = 0x00; + m_lcd_options_select[i] = 0x00; + m_lcd_led[i] = 0x00; + + m_inputlatches[i] = 0x00; + } + + /* HACK: this address needs to contain '1' so that it thinks the first controller + is present, otherwise it hangs on boot. How does this get set? + following addresses are for the other controllers, and get set based on Port B + status flags */ + address_space &mem = m_maincpu->space(AS_PROGRAM); + mem.write_word(m_controller_sense_addr,0x0001); +} + +void sentx6p_state::controller_send_data(int which) +{ + // 0x78 have to be set, this is probably because there is an unused space in the commands + // going the other way at 0x78 - 0x7f + // bit 3 (0x04) can also be set, doesn't care + + uint8_t send = m_inputlatches[which] | 0x78; + + m_maincpu->uart_rx( send ); + + if (m_inputlatches[which] & 0x03) + { + m_inputlatches[which] = 0x00; + logerror("clearing input latches for player %d\n", which + 1); + } +} + +READ16_MEMBER(sentx6p_state::sentx_porta_r) +{ + int select_bits = (m_porta_data >> 8) & 0x3f; + //logerror("%s: sentx_porta_r (with controller select bits %02x)\n", machine().describe_context(), select_bits); + + /* 0000 = no controller? (system buttons only?) + 0100 = controller 1? + 0200 = controller 2? + 0400 = controller 3? + 0800 = controller 4? + 1000 = controller 5? + 2000 = controller 6? + + this is an assumption based on startup, where the port is polled after writing those values + */ + + // the code around 029811 uses a ram value shifted left 8 times as the select bits (select_bits) on write + // then does a mask with them on the reads from this port, without shifting, comparing with 0 + + // the 'select bits' must also be active when the controller wants to send data, the UART read function + // won't proceed if they're zero, but the port is written with 0 before that + + //logerror("%08x\n", m_maincpu->pc()); + + // regular logic for writing to the LCDs + uint16_t ret = (m_io_p1->read() & 0xffc0) | select_bits; + + // hacks needed for reading from the UART to work + + // the select bit must be high here to read from the controller? + if (m_maincpu->pc() == m_pchackaddress1) + { + ret ^= 0x3f; + } + + // but must be low again here after writing the select bits in order to not + // get stuck in a timeout loop + if (m_maincpu->pc() == m_pchackaddress2) + { + ret &= ~0x3f; + + // presumably the inputs can only be sent once the controller is actually selected, otherwise + // there would be competing UART sources? + for (int i = 0; i < 6; i++) + { + if (select_bits & (1 << i)) + { + controller_send_data(i); + } + } + } + + return ret; +} + +READ16_MEMBER(sentx6p_state::sentx_portb_r) +{ + return m_io_p2->read(); +} + +READ16_MEMBER(sentx6p_state::sentx_portc_r) +{ + return m_io_p3->read(); +} + +WRITE16_MEMBER(sentx6p_state::porta_w) +{ + logerror("%s: sentx_porta_w %04x\n", machine().describe_context(), data); + + COMBINE_DATA(&m_porta_data); +} + +WRITE16_MEMBER(sentx6p_state::portb_w) +{ + logerror("%s: sentx_portb_w %04x\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(sentx6p_state::portc_w) +{ + logerror("%s: sentx_portc_w %04x\n", machine().describe_context(), data); +} + +/* + Card Table + (the controller must contain an MCU under the glob to receive thes commands + and convert them to actual LCD segments) + + off 00 + | A diamonds 01 | A hearts 0e | A spades 1b | A clubs 28 | + | 2 diamonds 02 | 2 hearts 0f | 2 spades 1c | 2 clubs 29 | + | 3 diamonds 03 | 3 hearts 10 | 3 spades 1d | 3 clubs 2a | + | 4 diamonds 04 | 4 hearts 11 | 4 spades 1e | 4 clubs 2b | + | 5 diamonds 05 | 5 hearts 12 | 5 spades 1f | 5 clubs 2c | + | 6 diamonds 06 | 6 hearts 13 | 6 spades 20 | 6 clubs 2d | + | 7 diamonds 07 | 7 hearts 14 | 7 spades 21 | 7 clubs 2e | + | 8 diamonds 08 | 8 hearts 15 | 8 spades 22 | 8 clubs 2f | + | 9 diamonds 09 | 9 hearts 16 | 9 spades 23 | 9 clubs 30 | + | 10 diamonds 0a | 10 hearts 17 | 10 spades 24 | 10 clubs 31 | + | J diamonds 0b | J hearts 18 | J spades 25 | J clubs 32 | + | Q diamonds 0c | Q hearts 19 | Q spades 26 | Q clubs 33 | + | K diamonds 0d | K hearts 1a | K spades 27 | K clubs 34 | + +*/ + +void sentx6p_state::set_card1(uint8_t value, int select_bits) +{ + for (int i = 0; i < 6; i++) + { + if (select_bits & (1 << i)) + { + m_lcd_card1[i] = value; + + int val = m_lcd_card1[i]; + if (val == 0) + { + m_suite1[i] = 0; + m_number1[i] = 0; + } + else + { + int suite = (val-1) / 13; + int number = (val-1) % 13; + + m_suite1[i] = suite+1; + m_number1[i] = number+1; + } + } + } +} + +void sentx6p_state::set_card2(uint8_t value, int select_bits) +{ + for (int i = 0; i < 6; i++) + { + if (select_bits & (1 << i)) + { + m_lcd_card2[i] = value; + + int val = m_lcd_card2[i]; + if (val == 0) + { + m_suite2[i] = 0; + m_number2[i] = 0; + } + else + { + int suite = (val-1) / 13; + int number = (val-1) % 13; + + m_suite2[i] = suite+1; + m_number2[i] = number+1; + } + } + } +} + +void sentx6p_state::set_options(uint8_t value, int select_bits) +{ + for (int i = 0; i < 6; i++) + { + if (select_bits & (1 << i)) + { + m_lcd_options[i] = value; + + // assume same mapping as selector bit below + m_option_fold[i] = (value & 0x01) ? 1 : 0; + m_option_check[i] = (value & 0x02) ? 1 : 0; + m_option_bet[i] = (value & 0x04) ? 1 : 0; + m_option_call[i] = (value & 0x08) ? 1 : 0; + m_option_raise[i] = (value & 0x10) ? 1 : 0; + m_option_allin[i] = (value & 0x20) ? 1 : 0; + } + } +} + +/* + c0 = no selection highlight (00) + c1 = fold selected (01) + c2 = check selected (02) + c4 = bet selected (04) + c8 = call selected (08) + d0 = raise selected (10) + e0 = all in selected (20) +*/ + +void sentx6p_state::set_options_select(uint8_t value, int select_bits) +{ + for (int i = 0; i < 6; i++) + { + if (select_bits & (1 << i)) + { + m_lcd_options_select[i] = value; + + m_select_fold[i] = (value & 0x01) ? 1 : 0; + m_select_check[i] = (value & 0x02) ? 1 : 0; + m_select_bet[i] = (value & 0x04) ? 1 : 0; + m_select_call[i] = (value & 0x08) ? 1 : 0; + m_select_raise[i] = (value & 0x10) ? 1 : 0; + m_select_allin[i] = (value & 0x20) ? 1 : 0; + } + } +} + + + +void sentx6p_state::set_controller_led(uint8_t value, int select_bits) +{ + for (int i = 0; i < 6; i++) + { + if (select_bits & (1 << i)) + { + m_lcd_led[i] = value; + + m_led[i] = value ^ 1; + } + } +} + +WRITE8_MEMBER(sentx6p_state::sentx_tx_w) +{ + int select_bits = (m_porta_data >> 8) & 0x3f; + + // TX function is at 0x029773 + // starts by writing controller select, then checking if controller is selected, then transmits data + + // RX function is at 0x029811 + // similar logic to write controller ID, check if selected, then recieve data + + switch (data) + { + case 0x00: // card 1 off + case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: // card 1 show Diamonds A,2,3,4,5,6,7,8,10,J,Q,K + case 0x0e: case 0x0f: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: // card 1 show Hearts A,2,3,4,5,6,7,8,10,J,Q,K + case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: // card 1 show Spades A,2,3,4,5,6,7,8,10,J,Q,K + case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // card 1 show Clubs A,2,3,4,5,6,7,8,10,J,Q,K + set_card1(data & 0x3f, select_bits); + break; + + case 0x40: // card 2 off + case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: // card 1 show Diamonds A,2,3,4,5,6,7,8,10,J,Q,K + case 0x4e: case 0x4f: case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: // card 1 show Hearts A,2,3,4,5,6,7,8,10,J,Q,K + case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: // card 1 show Spades A,2,3,4,5,6,7,8,10,J,Q,K + case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: // card 1 show Clubs A,2,3,4,5,6,7,8,10,J,Q,K + set_card2(data & 0x3f, select_bits); + break; + + // cases 0x78 - 0x7f are transmissions in the other direction (from controller to main unit, used for sending buttons) + + case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: // show selection options + case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: + case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: + case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: + set_options(data & 0x3f, select_bits); + break; + + case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: // show selection cursor + case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: + case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef: + case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: + set_options_select(data & 0x3f, select_bits); + break; + + case 0x38: + case 0x39: + set_controller_led(data & 0x01, select_bits); + break; + + case 0x3a: + // reset controller? (the input code also seems to check for 3a in one place coming in the other direction) + break; + + default: + logerror("unknown LCD command %02x with controller select %02x\n", data, select_bits); + break; + } + +} + + + + +void sentx6p_state::sentx6p(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &sentx6p_state::mem_map_2m_texas); + m_maincpu->set_pal(true); + + spg2xx_base(config); + + m_screen->set_refresh_hz(50); + + m_maincpu->porta_in().set(FUNC(sentx6p_state::sentx_porta_r)); + m_maincpu->portb_in().set(FUNC(sentx6p_state::sentx_portb_r)); + m_maincpu->portc_in().set(FUNC(sentx6p_state::sentx_portc_r)); + + m_maincpu->porta_out().set(FUNC(sentx6p_state::porta_w)); + m_maincpu->portb_out().set(FUNC(sentx6p_state::portb_w)); + m_maincpu->portc_out().set(FUNC(sentx6p_state::portc_w)); + + m_maincpu->uart_tx().set(FUNC(sentx6p_state::sentx_tx_w)); + + config.set_default_layout(layout_sentx6p); +} + +ROM_START( sentx6p ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "vsmaxxtexasholdem.bin", 0x000000, 0x200000, CRC(d9d7ea1d) SHA1(ae531958d6074ea2034910f53e043d5fa10eaf8c) ) +ROM_END + +ROM_START( sentx6puk ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + // chksum:05B58350 is @ 0x3000. + // This is the correct sum of 0x3010 - 0x1fffff (the first half of the ROM area after the checksum string) + // The 2nd half is not summed (and not used by the game?) but definitely exists in ROM (same data on 2 units) + ROM_LOAD16_WORD_SWAP( "senario texas holdem.bin", 0x000000, 0x400000, CRC(7c7d2d33) SHA1(71631074ba66e3b0cdeb86ebca3931599f3a911c) ) +ROM_END + +ROM_START( sentx6pd ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "senariodeluxetvpoker.bin", 0x000000, 0x800000, CRC(e2b6844e) SHA1(2413195dfe7a08d16ca870c070a19034c9fe8c30) ) +ROM_END + +void sentx6p_state::init_sentx6puk() +{ + m_pchackaddress1 = 0x2981e; + m_pchackaddress2 = 0x29834; + m_controller_sense_addr = 0x1e08; +} + +void sentx6p_state::init_sentx6p() +{ + m_pchackaddress1 = 0x29754; + m_pchackaddress2 = 0x2976a; + m_controller_sense_addr = 0x0804; +} + +void sentx6p_state::init_sentx6pd() +{ + m_pchackaddress1 = 0xca20; + m_pchackaddress2 = 0xca36; + m_controller_sense_addr = 0x1e3a; +} + +CONS( 2004, sentx6p, 0, 0, sentx6p, sentx6p, sentx6p_state, init_sentx6p, "Senario", "Vs Maxx Texas Hold'em TV Poker - 6 Player Edition (US)", MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // from a US version, values in USD +CONS( 2004, sentx6puk, sentx6p, 0, sentx6p, sentx6p, sentx6p_state, init_sentx6puk, "Senario / Play Vision", "Vs Maxx Texas Hold'em TV Poker - 6 Player Edition (UK)", MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // from a UK Play Vision branded box, values in GBP + +CONS( 2004, sentx6pd, 0, 0, sentx6p, sentx6p, sentx6p_state, init_sentx6pd, "Senario", "Deluxe TV Poker - Texas Hold'em, Blackjack & Video Poker (US)", MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// Deluxe version wasn't released outside of US? diff --git a/src/mame/drivers/spg2xx_shredmjr.cpp b/src/mame/drivers/spg2xx_shredmjr.cpp new file mode 100644 index 00000000000..bc6304e12ed --- /dev/null +++ b/src/mame/drivers/spg2xx_shredmjr.cpp @@ -0,0 +1,190 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" + +class shredmjr_game_state : public spg2xx_game_state +{ +public: + shredmjr_game_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_porta_data(0x0000), + m_shiftamount(0) + { } + + void shredmjr(machine_config &config); + void taikeegr(machine_config &config); + + void init_taikeegr(); + +protected: + DECLARE_READ16_MEMBER(porta_r); + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + +private: + uint16_t m_porta_data; + int m_shiftamount; + +}; + + +// Shredmaster Jr uses the same input order as the regular Taikee Guitar, but reads all inputs through a single multplexed bit +WRITE16_MEMBER(shredmjr_game_state::porta_w) +{ + if (data != m_porta_data) + { + if ((data & 0x0800) != (m_porta_data & 0x0800)) + { + if (data & 0x0800) + { + //logerror("0x0800 low -> high\n"); + } + else + { + //logerror("0x0800 high -> low\n"); + } + } + + if ((data & 0x0200) != (m_porta_data & 0x0200)) + { + if (data & 0x0200) + { + //logerror("0x0200 low -> high\n"); + m_shiftamount++; + } + else + { + //logerror("0x0200 high -> low\n"); + } + } + + if ((data & 0x0100) != (m_porta_data & 0x0100)) + { + if (data & 0x0100) + { + //logerror("0x0100 low -> high\n"); + m_shiftamount = 0; + } + else + { + //logerror("0x0100 high -> low\n"); + } + } + } + + m_porta_data = data; +} + +READ16_MEMBER(shredmjr_game_state::porta_r) +{ + //logerror("porta_r with shift amount %d \n", m_shiftamount); + uint16_t ret = 0x0000; + + uint16_t portdata = m_io_p1->read(); + + portdata = (portdata >> m_shiftamount) & 0x1; + + if (portdata) + ret |= 0x0400; + + return ret; +} + +static INPUT_PORTS_START( taikeegr ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Strum Bar Down") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Strum Bar Up") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Whamming Bar") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Yellow") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Green") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Red") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Blue") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pink") + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +void shredmjr_game_state::shredmjr(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &shredmjr_game_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(shredmjr_game_state::porta_r)); + m_maincpu->porta_out().set(FUNC(shredmjr_game_state::porta_w)); +} + +void shredmjr_game_state::taikeegr(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &shredmjr_game_state::mem_map_4m); + m_maincpu->set_pal(true); + + spg2xx_base(config); + + m_screen->set_refresh_hz(50); +// m_screen->set_size(320, 312); + + m_maincpu->porta_in().set_ioport("P1"); +// m_maincpu->portb_in().set_ioport("P2"); +// m_maincpu->portc_in().set_ioport("P3"); +} + + +void shredmjr_game_state::init_taikeegr() +{ + u16 *src = (u16*)memregion("maincpu")->base(); + + for (int i = 0x00000; i < 0x800000/2; i++) + { + u16 dat = src[i]; + dat = bitswap<16>(dat, 15,14,13,12, 11,10,9,8, 7,6,5,4, 0,1,2,3 ); + src[i] = dat; + } + + std::vector<u16> buffer(0x800000/2); + + for (int i = 0; i < 0x800000/2; i++) + { + int j = 0; + + switch (i & 0x00e00) + { + case 0x00000: j = (i & 0xfff1ff) | 0x000; break; + case 0x00200: j = (i & 0xfff1ff) | 0x800; break; + case 0x00400: j = (i & 0xfff1ff) | 0x400; break; + case 0x00600: j = (i & 0xfff1ff) | 0xc00; break; + case 0x00800: j = (i & 0xfff1ff) | 0x200; break; + case 0x00a00: j = (i & 0xfff1ff) | 0xa00; break; + case 0x00c00: j = (i & 0xfff1ff) | 0x600; break; + case 0x00e00: j = (i & 0xfff1ff) | 0xe00; break; + } + + buffer[j] = src[i]; + } + + std::copy(buffer.begin(), buffer.end(), &src[0]); +} + + +ROM_START( taikeegr ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "taikee_guitar.bin", 0x000000, 0x800000, CRC(8cbe2feb) SHA1(d72e816f259ba6a6260d6bbaf20c5e9b2cf7140b) ) +ROM_END + +ROM_START( shredmjr ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "shredmasterjr.bin", 0x000000, 0x800000, CRC(95a6dcf1) SHA1(44893cd6ebe6b7f33a73817b72ae7be70c3126dc) ) +ROM_END + +// there are multiple versions of this with different songs, was also sold by dreamGEAR as 'Shredmaster Jr.' (different title screen) +// for the UK version the title screen always shows "Guitar Rock", however there are multiple boxes with different titles and song selections. +// ROM is glued on the underside and soldered to the PCB, very difficult to remove without damaging. +CONS( 2007, taikeegr, 0, 0, taikeegr, taikeegr, shredmjr_game_state, init_taikeegr, "TaiKee", "Rockstar Guitar / Guitar Rock (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad music timings (too slow) +CONS( 2007, shredmjr, taikeegr, 0, shredmjr, taikeegr, shredmjr_game_state, init_taikeegr, "dreamGEAR", "Shredmaster Jr (NTSC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad music timings (too slow) diff --git a/src/mame/drivers/spg2xx_telestory.cpp b/src/mame/drivers/spg2xx_telestory.cpp new file mode 100644 index 00000000000..bfc9537bd8e --- /dev/null +++ b/src/mame/drivers/spg2xx_telestory.cpp @@ -0,0 +1,303 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +class telestory_state : public spg2xx_game_state +{ +public: + telestory_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_cart(*this, "cartslot"), + m_cart_region(nullptr) + { } + + void telestory(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void mem_map_4m_tsram(address_map& map); + + DECLARE_READ16_MEMBER(porta_r); + DECLARE_READ16_MEMBER(portb_r); + DECLARE_READ16_MEMBER(portc_r); + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + virtual DECLARE_WRITE16_MEMBER(portc_w) override; + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_telestory); + + required_device<generic_slot_device> m_cart; + memory_region *m_cart_region; +}; + + +void telestory_state::mem_map_4m_tsram(address_map &map) +{ + map(0x000000, 0x3fffff).bankr("cartbank"); + map(0x3e0000, 0x3fffff).ram(); // is this in the cart or in the system? +} + +static INPUT_PORTS_START( telestory ) // there is a hidden test mode, if you return rand() on this port you get it, TODO: figure out button combination + PORT_START("P1") // I/O test also lists 'Headphone 1' but it isn't mapped to any of these ports? + PORT_DIPNAME( 0x0001, 0x0001, "Port 1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Pause / Menu") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Read To Me") + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Red / Triangle") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Blue / Square") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Yellow / Star") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Green / Circle") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Right Arrow / Next Page") // Test mode calls this Right Arrow / LED (so probalby LED output too) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) // port changes on these bits advance the word in manual mode (scroll wheel) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) // port changes on these bits advance the word in manual mode (scroll wheel) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Left Arrow / Previous Page") + + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "Port 2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_DIPNAME( 0x0001, 0x0001, "Port 3" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + +READ16_MEMBER(telestory_state::porta_r) +{ + uint16_t data = m_io_p1->read(); + //logerror("%s: porta_r: %04x\n", machine().describe_context(), data); + return data; +} + +WRITE16_MEMBER(telestory_state::porta_w) +{ + /* + not used as an output very often + + ':maincpu' (0145D5): porta_w (0000) + ':maincpu' (0145DC): porta_w (0000) + ':maincpu' (0145F4): porta_w (0000) + ':maincpu' (0145F4): porta_w (6000) + */ + logerror("%s: porta_w (%04x)\n", machine().describe_context(), data); +} + +READ16_MEMBER(telestory_state::portb_r) +{ + // not used? + uint16_t data = m_io_p2->read(); + logerror("%s: portb_r %04x\n", machine().describe_context(), data); + return data; +} + +WRITE16_MEMBER(telestory_state::portb_w) +{ + // not used? + logerror("%s: portb_w (%04x)\n", machine().describe_context(), data); +} + +// What is here? accessed using serial protocol with clocked bits +READ16_MEMBER(telestory_state::portc_r) +{ + //logerror("%s: portc_r\n", machine().describe_context()); + return machine().rand() & 0x0c00; // bits need to change state or it doesn't boot +} + +WRITE16_MEMBER(telestory_state::portc_w) +{ + //logerror("%s: portc_w (%04x)\n", machine().describe_context(), data); +} + + + +void telestory_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + // if there's a cart, override the standard banking + if (m_cart && m_cart->exists()) + { + std::string region_tag; + m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); + m_bank->set_entry(0); + } +} + +void telestory_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); +} + +DEVICE_IMAGE_LOAD_MEMBER(telestory_state::cart_load_telestory) +{ + uint32_t size = m_cart->common_get_size("rom"); + + if (size > 0x800000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); + return image_init_result::FAIL; + } + + m_cart->rom_alloc(0x800000, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + +void telestory_state::telestory(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &telestory_state::mem_map_4m_tsram); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(telestory_state::porta_r)); + m_maincpu->porta_out().set(FUNC(telestory_state::porta_w)); + m_maincpu->portb_in().set(FUNC(telestory_state::portb_r)); + m_maincpu->portb_out().set(FUNC(telestory_state::portb_w)); + m_maincpu->portc_in().set(FUNC(telestory_state::portc_r)); + m_maincpu->portc_out().set(FUNC(telestory_state::portc_w)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "telestory_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(telestory_state::cart_load_telestory)); + m_cart->set_must_be_loaded(true); + + SOFTWARE_LIST(config, "telestory_cart").set_original("telestory_cart"); +} + +ROM_START( telestry ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + // no internal ROM, only RAM +ROM_END + + +/* Sound data for the narrator is written to the SIO data port + 013127: D319 3D54 [3d54] = r1 (Cinderella) - 4-bit data? + The hidden test mode calls the speech test 'CELP' (possibly "Code-excited linear prediction" based?) + https://en.wikipedia.org/wiki/Code-excited_linear_prediction + + TODO: check if it's a common implementation eg. Speex + SIO port is not currently implemented in spg2xx_io.cpp however +*/ +CONS( 2006, telestry, 0, 0, telestory, telestory, telestory_state, empty_init, "JAKKS Pacific Inc / Toymax", "Telestory", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/spg2xx_tvgogo.cpp b/src/mame/drivers/spg2xx_tvgogo.cpp new file mode 100644 index 00000000000..47208b85a09 --- /dev/null +++ b/src/mame/drivers/spg2xx_tvgogo.cpp @@ -0,0 +1,265 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +#include "includes/spg2xx.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +class tvgogo_state : public spg2xx_game_state +{ +public: + tvgogo_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_cart(*this, "cartslot"), + m_cart_region(nullptr) + { } + + void tvgogo(machine_config &config); + +private: + uint8_t m_i2cunk; + + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_WRITE8_MEMBER(tvg_i2c_w); + DECLARE_READ8_MEMBER(tvg_i2c_r); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_tvgogo); + + required_device<generic_slot_device> m_cart; + memory_region *m_cart_region; +}; + + +static INPUT_PORTS_START( tvgogo ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Back") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Select") + PORT_DIPNAME( 0x0004, 0x0004, "P1" ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_DIPNAME( 0x0001, 0x0001, "P3" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + +void tvgogo_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + // if there's a cart, override the standard banking + if (m_cart && m_cart->exists()) + { + std::string region_tag; + m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); + m_bank->set_entry(0); + } +} + +void tvgogo_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); +} + + +DEVICE_IMAGE_LOAD_MEMBER(tvgogo_state::cart_load_tvgogo) +{ + uint32_t size = m_cart->common_get_size("rom"); + + if (size > 0x800000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); + return image_init_result::FAIL; + } + + m_cart->rom_alloc(0x800000, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + + +WRITE8_MEMBER(tvgogo_state::tvg_i2c_w) +{ + // unsure what is mapped here (Camera?) but it expects to be able to read back the same byte it writes before it boots. + m_i2cunk = data; + logerror("%s: tvg_i2c_w %04x %02x\n", machine().describe_context(), offset, data); +} + +READ8_MEMBER(tvgogo_state::tvg_i2c_r) +{ + uint8_t ret = m_i2cunk; + logerror("%s: tvg_i2c_r %04x %02x\n", machine().describe_context(), offset, ret); + return ret; +} + + +void tvgogo_state::tvgogo(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &tvgogo_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "tvgogo_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(tvgogo_state::cart_load_tvgogo)); + m_cart->set_must_be_loaded(true); + + m_maincpu->i2c_w().set(FUNC(tvgogo_state::tvg_i2c_w)); + m_maincpu->i2c_r().set(FUNC(tvgogo_state::tvg_i2c_r)); + + SOFTWARE_LIST(config, "tvgogo_cart").set_original("tvgogo"); +} + +ROM_START( tvgogo ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + // no internal ROM? (Camera might have an MCU tho) +ROM_END + + +// Toyquest games +CONS( 2005, tvgogo, 0, 0, tvgogo, tvgogo, tvgogo_state, empty_init, "Toyquest", "GoGo TV Video Vision", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // or TV Go Go - the game addons call it the 'Video Vision console' diff --git a/src/mame/drivers/spg2xx_vii.cpp b/src/mame/drivers/spg2xx_vii.cpp new file mode 100644 index 00000000000..00f71242817 --- /dev/null +++ b/src/mame/drivers/spg2xx_vii.cpp @@ -0,0 +1,189 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +/* 'Zone' systems */ + +#include "includes/spg2xx.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +class vii_state : public spg2xx_game_state +{ +public: + vii_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_cart(*this, "cartslot"), + m_io_motionx(*this, "MOTIONX"), + m_io_motiony(*this, "MOTIONY"), + m_io_motionz(*this, "MOTIONZ"), + m_cart_region(nullptr), + m_ctrl_poll_timer(nullptr) + { } + + void vii(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + static const device_timer_id TIMER_CTRL_POLL = 0; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + DECLARE_WRITE16_MEMBER(vii_portb_w); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_vii); + + virtual void poll_controls(); + + required_device<generic_slot_device> m_cart; + required_ioport m_io_motionx; + required_ioport m_io_motiony; + required_ioport m_io_motionz; + memory_region *m_cart_region; + + emu_timer *m_ctrl_poll_timer; + uint8_t m_controller_input[8]; +}; + + +void vii_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch (id) + { + case TIMER_CTRL_POLL: + poll_controls(); + break; + default: + logerror("Unknown timer ID: %d\n", id); + break; + } +} + +WRITE16_MEMBER(vii_state::vii_portb_w) +{ + switch_bank(((data & 0x80) >> 7) | ((data & 0x20) >> 4)); +} + + +static INPUT_PORTS_START( vii ) + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Button A") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Button B") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Button C") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Button D") + + PORT_START("MOTIONX") + PORT_BIT( 0x3ff, 0x200, IPT_PADDLE ) PORT_MINMAX(0x000, 0x3ff) PORT_SENSITIVITY(50) PORT_KEYDELTA(50) PORT_NAME("Motion Control X") + + PORT_START("MOTIONY") + PORT_BIT( 0x3ff, 0x200, IPT_PADDLE ) PORT_MINMAX(0x000, 0x3ff) PORT_SENSITIVITY(50) PORT_KEYDELTA(50) PORT_NAME("Motion Control Y") PORT_PLAYER(2) + + PORT_START("MOTIONZ") + PORT_BIT( 0x3ff, 0x200, IPT_PADDLE ) PORT_MINMAX(0x000, 0x3ff) PORT_SENSITIVITY(50) PORT_KEYDELTA(50) PORT_NAME("Motion Control Z") PORT_PLAYER(3) +INPUT_PORTS_END + +void vii_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + // if there's a cart, override the standard banking + if (m_cart && m_cart->exists()) + { + std::string region_tag; + m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); + m_bank->set_entry(0); + } + + m_ctrl_poll_timer = timer_alloc(TIMER_CTRL_POLL); + m_ctrl_poll_timer->adjust(attotime::never); + + save_item(NAME(m_controller_input)); +} + +void vii_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); + + m_controller_input[0] = 0; + m_controller_input[4] = 0; + m_controller_input[6] = 0xff; + m_controller_input[7] = 0; + + m_ctrl_poll_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); +} + + +void vii_state::poll_controls() +{ + int32_t x = m_io_motionx ? ((int32_t)m_io_motionx->read() - 0x200) : 0; + int32_t y = m_io_motiony ? ((int32_t)m_io_motiony->read() - 0x200) : 0; + int32_t z = m_io_motionz ? ((int32_t)m_io_motionz->read() - 0x200) : 0; + + uint8_t old_input[8]; + memcpy(old_input, m_controller_input, 8); + + m_controller_input[0] = m_io_p1->read(); + m_controller_input[1] = (uint8_t)x; + m_controller_input[2] = (uint8_t)y; + m_controller_input[3] = (uint8_t)z; + m_controller_input[4] = 0; + x = (x >> 8) & 3; + y = (y >> 8) & 3; + z = (z >> 8) & 3; + m_controller_input[5] = (z << 4) | (y << 2) | x; + m_controller_input[6] = 0xff; + m_controller_input[7] = 0; + + if (memcmp(old_input, m_controller_input, 8)) + { + for(int i = 0; i < 8; i++) + m_maincpu->uart_rx(m_controller_input[i]); + } +} + +DEVICE_IMAGE_LOAD_MEMBER(vii_state::cart_load_vii) +{ + uint32_t size = m_cart->common_get_size("rom"); + + if (size < 0x800000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); + return image_init_result::FAIL; + } + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + +void vii_state::vii(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &vii_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->portb_out().set(FUNC(vii_state::vii_portb_w)); + m_maincpu->i2c_w().set(FUNC(vii_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(vii_state::i2c_r)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "vii_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(vii_state::cart_load_vii)); + + SOFTWARE_LIST(config, "vii_cart").set_original("vii"); +} + +ROM_START( vii ) + ROM_REGION( 0x2000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "vii.bin", 0x0000, 0x2000000, CRC(04627639) SHA1(f883a92d31b53c9a5b0cdb112d07cd793c95fc43)) +ROM_END + +// Jungle Soft TV games +CONS( 2007, vii, 0, 0, vii, vii, vii_state, empty_init, "Jungle Soft / KenSingTon / Siatronics", "Vii", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // motion controls are awkward, but playable for the most part diff --git a/src/mame/drivers/spg2xx_zone.cpp b/src/mame/drivers/spg2xx_zone.cpp new file mode 100644 index 00000000000..e31a57533a4 --- /dev/null +++ b/src/mame/drivers/spg2xx_zone.cpp @@ -0,0 +1,356 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +/* 'Zone' systems */ + +#include "includes/spg2xx.h" + +class wireless60_state : public spg2xx_game_state +{ +public: + wireless60_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_game_state(mconfig, type, tag), + m_bankmask(0x7) + { } + + void wireless60(machine_config& config); + + void init_lx_jg7415(); + void init_zone100(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + uint8_t m_w60_controller_input; + uint16_t m_w60_porta_data; + uint16_t m_w60_p1_ctrl_mask; + uint16_t m_w60_p2_ctrl_mask; + uint8_t m_bankmask; + + DECLARE_WRITE16_MEMBER(wireless60_porta_w); + DECLARE_WRITE16_MEMBER(wireless60_portb_w); + DECLARE_READ16_MEMBER(wireless60_porta_r); + +private: +}; + +class zone40_state : public wireless60_state +{ +public: + zone40_state(const machine_config& mconfig, device_type type, const char* tag) : + wireless60_state(mconfig, type, tag), + m_romregion(*this, "maincpu") + { } + + void zone40(machine_config &config); + void zone40p(machine_config &config); + + void init_zone40(); + void init_reactmd(); + + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + virtual void mem_map_z40(address_map &map); + DECLARE_READ16_MEMBER(z40_rom_r); + DECLARE_READ16_MEMBER(zone40_porta_r); + DECLARE_WRITE16_MEMBER(zone40_porta_w); + required_region_ptr<uint16_t> m_romregion; + uint16_t m_z40_rombase; + uint16_t m_porta_dat; + int m_romsize; +}; + + +WRITE16_MEMBER(wireless60_state::wireless60_porta_w) +{ + //logerror("%s: wireless60_porta_w %04x\n", machine().describe_context(), data); + + m_w60_porta_data = (data & 0x300) | m_w60_p1_ctrl_mask | m_w60_p2_ctrl_mask; + switch (m_w60_porta_data & 0x300) + { + case 0x300: + m_w60_controller_input = -1; + break; + + case 0x200: + m_w60_controller_input++; + break; + + default: + uint16_t temp1 = m_io_p1->read(); + uint16_t temp2 = m_io_p2->read(); + uint16_t temp3 = 1 << m_w60_controller_input; + if (temp1 & temp3) m_w60_porta_data ^= m_w60_p1_ctrl_mask; + if (temp2 & temp3) m_w60_porta_data ^= m_w60_p2_ctrl_mask; + break; + } +} + +READ16_MEMBER(wireless60_state::wireless60_porta_r) +{ + //logerror("%s: wireless60_porta_r\n", machine().describe_context()); + return m_w60_porta_data; +} + +WRITE16_MEMBER(wireless60_state::wireless60_portb_w) +{ + logerror("%s: wireless60_portb_w (bankswitch) %04x\n", machine().describe_context(), data); + switch_bank(data & m_bankmask); +} + +WRITE16_MEMBER(zone40_state::zone40_porta_w) +{ + wireless60_porta_w(space, offset, data); + + m_z40_rombase = (m_z40_rombase & 0xff00) | (data & 0x0ff); + + // toggled twice before games in the same 64MB bank, toggled once before games in a different 64MB bank + if ((data & 0x2000) && (!(m_porta_dat & 0x2000))) + m_z40_rombase ^= 0x0100; + + m_porta_dat = data; + + //logerror("%s: zone40_porta_w %04x z80 bank is now %04x \n", machine().describe_context(), data, m_z40_rombase); + + m_maincpu->invalidate_cache(); + +} + +READ16_MEMBER(zone40_state::zone40_porta_r) +{ + uint16_t ret = wireless60_porta_r(space, offset) & (0x0300 | m_w60_p1_ctrl_mask | m_w60_p2_ctrl_mask); + ret = (ret & 0xdf00) | (m_porta_dat & 0x20ff); + return ret; +} + + +READ16_MEMBER(zone40_state::z40_rom_r) +{ + // due to granularity of rom bank this manual method is safer + return m_romregion[(offset + (m_z40_rombase * 0x20000)) & (m_romsize-1)]; +} + +void zone40_state::mem_map_z40(address_map &map) +{ + map(0x000000, 0x3fffff).r(FUNC(zone40_state::z40_rom_r)); +} + +void wireless60_state::machine_start() +{ + spg2xx_game_state::machine_start(); + + save_item(NAME(m_w60_controller_input)); + save_item(NAME(m_w60_porta_data)); + + m_w60_p1_ctrl_mask = 0x0400; + m_w60_p2_ctrl_mask = 0x0800; +} + +void zone40_state::machine_start() +{ + wireless60_state::machine_start(); + + save_item(NAME(m_z40_rombase)); + save_item(NAME(m_porta_dat)); + + m_z40_rombase = 0xe0; + m_porta_dat = 0x20e0; + m_w60_p1_ctrl_mask = 0x0400; + m_w60_p2_ctrl_mask = 0x1000; + + m_romsize = (memregion("maincpu")->bytes()/2); +} + +void wireless60_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); + m_w60_controller_input = -1; + m_w60_porta_data = 0; +} + +void zone40_state::machine_reset() +{ + wireless60_state::machine_reset(); + m_z40_rombase = 0x1e0; + m_maincpu->invalidate_cache(); + m_maincpu->reset(); +} + +static INPUT_PORTS_START( wirels60 ) + PORT_START("P1") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("A Button") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Menu") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Start") + + PORT_START("P2") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("Joypad Up") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_NAME("Joypad Down") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("Joypad Left") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("Joypad Right") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("A Button") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("B Button") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Menu") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Start") +INPUT_PORTS_END + + +void wireless60_state::wireless60(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &wireless60_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_out().set(FUNC(wireless60_state::wireless60_porta_w)); + m_maincpu->portb_out().set(FUNC(wireless60_state::wireless60_portb_w)); + m_maincpu->porta_in().set(FUNC(wireless60_state::wireless60_porta_r)); +} + +void zone40_state::zone40(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &zone40_state::mem_map_z40); + + spg2xx_base(config); + + m_maincpu->porta_out().set(FUNC(zone40_state::zone40_porta_w)); + m_maincpu->porta_in().set(FUNC(zone40_state::zone40_porta_r)); +} + +void zone40_state::zone40p(machine_config &config) +{ + zone40(config); + m_maincpu->set_pal(true); + m_screen->set_refresh_hz(50); +} + + +void wireless60_state::init_lx_jg7415() +{ + uint8_t blocks[32] = { + // these parts of the ROM contain the code that gets selected + 0x00, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0e, 0x0f, 0x10, 0x11, 0x16, 0x17, 0x18, 0x19, 0x1e, 0x1f, + // these parts of the ROM contain code / data but go unused, this seems intentional, some of these areas don't read consistently so likely this double size ROM was used knowing that some areas were bad and could be avoided + 0x02, 0x03, 0x04, 0x05, 0x0a, 0x0b, 0x0c, 0x0d, 0x12, 0x13, 0x14, 0x15, 0x1a, 0x1b, 0x1c, 0x1d + }; + + uint8_t *src = memregion("maincpu")->base(); + std::vector<u8> buffer(0x10000000); + + for (int addr = 0; addr < 0x10000000; addr++) + { + int bank = (addr & 0xf800000) >> 23; + int newbank = blocks[bank]; + int newaddr = (addr & 0x07fffff) | (newbank << 23); + buffer[addr] = src[newaddr]; + } + + std::copy(buffer.begin(), buffer.end(), &src[0]); + + m_bankmask = 0xf; +} + +void wireless60_state::init_zone100() +{ + m_bankmask = 0xf; +} + +void zone40_state::init_zone40() +{ + uint16_t *ROM = (uint16_t*)memregion("maincpu")->base(); + int size = memregion("maincpu")->bytes(); + + for (int i = 0; i < size/2; i++) + { + ROM[i] = ROM[i] ^ 0xbb88; + + ROM[i] = bitswap<16>(ROM[i], 11, 10, 3, 2, 4, 12, 5, 13, + 9, 1, 8, 0, 6, 7, 14, 15); + } +} + + +void zone40_state::init_reactmd() +{ + uint16_t *ROM = (uint16_t*)memregion("maincpu")->base(); + int size = memregion("maincpu")->bytes(); + + for (int i = 0; i < size/2; i++) + { + ROM[i] = ROM[i] ^ 0xca53; + + ROM[i] = bitswap<16>(ROM[i], 15, 13, 14, 12, 7, 6, 5, 4, + 11, 10, 9, 8, 3, 1, 2, 0); + + } +} + + + +ROM_START( zone40 ) + ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "zone40.bin", 0x0000, 0x4000000, CRC(4ba1444f) SHA1(de83046ab93421486668a247972ad6d3cda19440) ) +ROM_END + +ROM_START( reactmd ) + ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) // this contains the SunPlus games + ROM_LOAD16_WORD_SWAP( "reactor_md_sunplus-full.bin", 0x0000, 0x4000000, CRC(843aa58c) SHA1(07cdc6d4aa0057939c145ece01a9aca73c7f1f2b) ) + ROM_IGNORE(0x4000000) // the 2nd half of the ROM can't be accessed by the PCB (address line tied low) (contains garbage? data) + + ROM_REGION( 0x2000000, "mdrom", ROMREGION_ERASE00 ) // this contains the MD games and main boot menu + ROM_LOAD16_WORD_SWAP( "reactormd.bin", 0x0000, 0x2000000, CRC(fe9664a4) SHA1(d475b524f576c9d1d90aed20c7467cc652396baf) ) +ROM_END + +ROM_START( itvg49 ) + ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "49in1sports.bin", 0x0000, 0x8000000, CRC(bb8a1c4e) SHA1(a493177de7365037b67ead0155a902313722a61c) ) +ROM_END + + +ROM_START( zone60 ) + ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "zone60.bin", 0x0000, 0x4000000, CRC(4cb637d1) SHA1(1f97cbdb4299ac0fbafc2a3aa592066cb0727066)) +ROM_END + +ROM_START( wirels60 ) + ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "wirels60.bin", 0x0000, 0x4000000, CRC(b4df8b28) SHA1(00e3da542e4bc14baf4724ad436f66d4c0f65c84)) +ROM_END + +ROM_START( zone100 ) + ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "zone100.bin", 0x0000, 0x8000000, CRC(b966a54e) SHA1(e38156ebc4e2f2935b1acbeca33d1866d45c4f65) ) +ROM_END + +// PCB marked 'Zone 100 110728 V2.1' +ROM_START( lx_jg7415 ) + ROM_REGION( 0x10000000, "maincpu", ROMREGION_ERASE00 ) + // reads of some unused areas were not 100% consistent, but this seems intentional, the game has a ROM twice the size it needs and is wired up in such a way that those bad areas are unused by the game + // if adding a clone make sure to check if there are actual differences in the used areas + ROM_LOAD16_WORD_SWAP( "rom.bin", 0x0000, 0x10000000, CRC(59442e00) SHA1(7e91cf6b19c37f9b4fa4dc21e241c6634d6a6f95) ) +ROM_END + + +CONS( 2009, zone40, 0, 0, zone40, wirels60, zone40_state, init_zone40, "Jungle Soft / Ultimate Products (HK) Ltd", "Zone 40", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2009, itvg49, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "TaiKee", "Interactive TV Games 49-in-1 (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Badminton hangs, otherwise everything runs + +CONS( 2010, zone60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Jungle's Soft / Ultimate Products (HK) Ltd", "Zone 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, zone100, 0, 0, wireless60, wirels60, wireless60_state, init_zone100, "Jungle's Soft / Ultimate Products (HK) Ltd", "Zone 100", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // unit was black, menus still show white controllers, unlike wireless 60 +CONS( 2010, wirels60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Jungle Soft / Kids Station Toys Inc", "Wireless 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2011, lx_jg7415,0, 0, wireless60, wirels60, wireless60_state, init_lx_jg7415, "Lexibook", "Lexibook JG7415 120-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + + +// Two systems in one unit - Genesis on a Chip and SunPlus, only the SunPlus part is currently emulated. Genesis on a chip is a very poor implementation with many issues on real hardware. +// This should actually boot to a menu on the MD size, with the SunPlus only being enabled if selected from that menu. MD side menu runs in some enhanced / custom MD mode tho. +// Badminton hangs, as it does in the 49-in-1 above +CONS( 2009, reactmd, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "AtGames / Sega", "Reactor MD (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
\ No newline at end of file diff --git a/src/mame/drivers/spg2xx_zone_32bit.cpp b/src/mame/drivers/spg2xx_zone_32bit.cpp new file mode 100644 index 00000000000..7a048a4b2e8 --- /dev/null +++ b/src/mame/drivers/spg2xx_zone_32bit.cpp @@ -0,0 +1,476 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood + +/* 'Zone' '32-bit' systems */ + +#include "includes/spg2xx.h" + +class zon32bit_state : public spg2xx_game_state +{ +public: + zon32bit_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_game_state(mconfig, type, tag), + m_romregion(*this, "maincpu") + { } + + void zon32bit(machine_config& config); + + void mem_map_zon32bit(address_map &map); + + void init_zon32bit() { m_game = 0; }; + void init_mywicodx() { m_game = 1; }; + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_READ16_MEMBER(z32_rom_r); + + required_region_ptr<uint16_t> m_romregion; + + DECLARE_READ16_MEMBER(porta_r); + DECLARE_READ16_MEMBER(portb_r); + DECLARE_READ16_MEMBER(portc_r); + + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + virtual DECLARE_WRITE16_MEMBER(portb_w) override; + virtual DECLARE_WRITE16_MEMBER(portc_w) override; + +private: + int m_porta_dat; + int m_portb_dat; + int m_portc_dat; + + int m_upperbank; + + int m_hackbank; + int m_game; +}; + +READ16_MEMBER(zon32bit_state::porta_r) +{ + return m_porta_dat; +} + + +WRITE16_MEMBER(zon32bit_state::porta_w) +{ + //if (data != 0x0101) + // logerror("%s: porta_w (%04x)\n", machine().describe_context(), data); + + m_porta_dat = data; + + // where is the banking?! this gets written from the RAM-based code when the lower bank needs to change, but the upper bank needs to change in places too + // (and all these bits get unset again after this write, so this probably isn't the bank) + if (data == 0x0e01) + { + m_hackbank ^= 1; + } + + if (data == 0x0301) + { + m_hackbank = 2; + } + + /* + if (data == 0x0335) + { + logerror("%s: port a write 0x0355, port c is %04x %04X\n", machine().describe_context(), data, data & 0x1800); + + m_upperbank = (m_portc_dat & 0x1800); + } + */ +} + +READ16_MEMBER(zon32bit_state::portc_r) +{ + // 0x03ff seem to be inputs for buttons (and some kind of output?) + // 0xfc00 gets masked for other reasons (including banking?) + + // returning same value written for 0x0400 means controls don't respond (some kind of direction flag?) + + uint16_t dat = m_io_p3->read() & ~0xf800; + + dat |= (m_portc_dat & 0xf800); + + return dat; +} + + +READ16_MEMBER(zon32bit_state::portb_r) +{ + return m_portb_dat; +} + +WRITE16_MEMBER(zon32bit_state::portb_w) +{ + if (data != 0x0001) + logerror("%s: portb_w (%04x)\n", machine().describe_context(), data); + + m_portb_dat = data; +} + +WRITE16_MEMBER(zon32bit_state::portc_w) +{ + // very noisy + // is the code actually sending the sound to the remotes? + + //logerror("%s: portc_w (%04x)\n", machine().describe_context(), data); + + //if ((pc >= 0x77261) && (pc <= 0x77268)) + // logerror("%s: port c %04x %04X-- BANK STUFF\n", machine().describe_context(), data, data & 0x1800); + + //logerror("%s: port c %04x %04x\n", machine().describe_context(), data, data & 0x1800); + + /* + + this logic seems to apply for some of the mini-games, but cases where the lower bank doesn't change, this sequence doesn't happen either... + + we can only trigger bank on 0335 writes, because it gets lost shortly after (unless that's an issue with the io code in spg2xx_io.cpp) + + ':maincpu' (077250): port c 0000 0000 + ':maincpu' (077263): port c fe00 1800-- BANK STUFF + ':maincpu' (0677DC): porta_w (0311) + ':maincpu' (0677E9): porta_w (0301) + ':maincpu' (0677F6): porta_w (0335) // bank take effect? + ':maincpu' (067803): port c fc00 1800 + ':maincpu' (067810): port c fe00 1800 + ':maincpu' (06781B): port c f800 1800 + */ + +// bits 0x0600 are explicitly set when changing bank, but this logic doesn't work for all cases, causes bad bank changes after boot in some games +#if 0 + if ((data & 0x0600) == (0x0600)) + { + if ((m_portc_dat & 0x0600) != 0x0600) + m_upperbank = data & 0x1800; + } + +#else // ugly PC based hacked to ensure we always have the correct bank + int pc = m_maincpu->pc(); + if (m_game == 0) + { + if ((pc == 0x077263) && m_hackbank == 1) // when using upper code bank + { + //printf("zon32bit change upper bank from upper code bank %04x\n", data & 0x1800); + m_upperbank = data & 0x1800; + } + + if ((pc == 0x05ff63) && m_hackbank == 0) // when using lower code bank + { + //printf("zon32bit change upper bank from lower code bank %04x\n", data & 0x1800); + m_upperbank = data & 0x1800; + } + } + else if (m_game == 1) + { + if ((pc == 0x09369c) && m_hackbank == 0) // when using lower code bank + { + printf("mywicodx change upper bank from main menu code bank %04x\n", data & 0x1800); + m_upperbank = data & 0x1800; + } + + if ((pc == 0x530) && m_hackbank == 1) + { + printf("mywicodx change upper bank from other menu code bank %04x\n", data & 0x1800); + m_upperbank = data & 0x1800; + } + + if ((pc == 0x159E2) && m_hackbank == 2) + { + printf("mywicodx change guitar music bank %04x\n", data & 0x1800); + m_upperbank = data & 0x1800; + } + + } +#endif + + m_portc_dat = data; + +//077261: r4 = r2 +//077262: [r4] = r3 // writes to 3d0b (port c?) +//077263: sp += 04 +} + + +void zon32bit_state::mem_map_zon32bit(address_map &map) +{ + map(0x000000, 0x3fffff).r(FUNC(zon32bit_state::z32_rom_r)); +} + +READ16_MEMBER(zon32bit_state::z32_rom_r) +{ + /* + This has upper and lower bank, which can be changed independently. + Banking hookup is currently very hacky as bank values are written + to ports then erased at the moment, maybe they latch somehow? + */ + + if (m_game == 0) // zon32bit + { + if (offset < 0x200000) + { + if (m_hackbank == 0) // if lower bank is 0 + return m_romregion[offset + 0x000000]; + else + { // if lower bank is 1 + return m_romregion[offset + 0x400000]; + } + } + else + { + offset &= 0x1fffff; + + if (m_hackbank == 0) // if lower bank is 0 + { + if ((m_upperbank & 0x1800) == 0x1000) return m_romregion[offset + (0x0400000 / 2)]; // this upper bank is needed to boot to the menu + else if ((m_upperbank & 0x1800) == 0x0800) return m_romregion[offset + (0x1000000 / 2)]; // golf, tennis, several mini games + else if ((m_upperbank & 0x1800) == 0x1800) return m_romregion[offset + (0x1400000 / 2)]; // baseball, more minigames + else if ((m_upperbank & 0x1800) == 0x0000) return m_romregion[offset + (0x0400000 / 2)]; // ? (not used?) + } + else // if lower bank is 1 + { + // these banks are used for different 'mini' games (and boxing) with the 2nd lower bank enabled + if ((m_upperbank & 0x1800) == 0x1000) return m_romregion[offset + (0x0c00000 / 2)]; // 31-44 some mini games + else if ((m_upperbank & 0x1800) == 0x0800) return m_romregion[offset + (0x1800000 / 2)]; // 45-49 some mini games + boxing + else if ((m_upperbank & 0x1800) == 0x1800) return m_romregion[offset + (0x1c00000 / 2)]; // 50-59 some mini games + else if ((m_upperbank & 0x1800) == 0x0000) return m_romregion[offset + (0x0400000 / 2)]; // ? (not used?) + } + } + } + else if (m_game == 1) // mywicodx + { + if (offset < 0x200000) + { + if (m_hackbank == 0) // if lower bank is 0 (main menu) + { + return m_romregion[offset + (0x2000000 / 2)]; + } + else if (m_hackbank == 1) // if lower bank is 0 (debug menu code / extra cames) + { + return m_romregion[offset + (0x3000000 / 2)]; + } + else // Mi Guitar + { + return m_romregion[offset + (0x0000000 / 2)]; + } + } + else + { + offset &= 0x1fffff; + + if (m_hackbank == 0) + { + if ((m_upperbank & 0x1800) == 0x1000) return m_romregion[offset + (0x2400000 / 2)]; // this upper bank is needed to boot to the menu, boxing + else if ((m_upperbank & 0x1800) == 0x0800) return m_romregion[offset + (0x2800000 / 2)]; // ? tennis, golf + else if ((m_upperbank & 0x1800) == 0x1800) return m_romregion[offset + (0x2c00000 / 2)]; // ? table tennis, bowling, basketball, baseball + else if ((m_upperbank & 0x1800) == 0x0000) return m_romregion[offset + (0x2400000 / 2)]; // ? (not used?) + } + else if (m_hackbank == 1) + { + if ((m_upperbank & 0x1800) == 0x1000) return m_romregion[offset + (0x3400000 / 2)]; // base code for other bank + else if ((m_upperbank & 0x1800) == 0x0800) return m_romregion[offset + (0x3800000 / 2)]; // + else if ((m_upperbank & 0x1800) == 0x1800) return m_romregion[offset + (0x3c00000 / 2)]; // + else if ((m_upperbank & 0x1800) == 0x0000) return m_romregion[offset + (0x3400000 / 2)]; // + } + else + { + if ((m_upperbank & 0x1800) == 0x1000) return m_romregion[offset + (0x0400000 / 2)]; // song data 1 + else if ((m_upperbank & 0x1800) == 0x0800) return m_romregion[offset + (0x0800000 / 2)]; // song data 2 + else if ((m_upperbank & 0x1800) == 0x1800) return m_romregion[offset + (0x0c00000 / 2)]; // song data 3 + else if ((m_upperbank & 0x1800) == 0x0000) return m_romregion[offset + (0x0400000 / 2)]; // + } + } + } + + return 0x0000;// m_romregion[offset]; +} + +void zon32bit_state::machine_start() +{ + spg2xx_game_state::machine_start(); +} + + +void zon32bit_state::machine_reset() +{ + spg2xx_game_state::machine_reset(); + + m_porta_dat = 0x0000; + m_portb_dat = 0x0000; + + m_hackbank = 0; +} + + +static INPUT_PORTS_START( zon32bit ) + PORT_START("P1") + PORT_DIPNAME( 0x0001, 0x0001, "P1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Up (vertical) Left (horizontal)") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Down (vertical) Right (horizontal)") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Left (vertical) Down (horizontal)") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Right (vertical) Up (horizontal)") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Pause / Menu") + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +void zon32bit_state::zon32bit(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &zon32bit_state::mem_map_zon32bit); + m_maincpu->set_force_no_drc(true); // uses JVS opcode, not implemented in recompiler + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(zon32bit_state::porta_r)); + m_maincpu->portb_in().set(FUNC(zon32bit_state::portb_r)); + m_maincpu->portc_in().set(FUNC(zon32bit_state::portc_r)); + + m_maincpu->porta_out().set(FUNC(zon32bit_state::porta_w)); + m_maincpu->portb_out().set(FUNC(zon32bit_state::portb_w)); + m_maincpu->portc_out().set(FUNC(zon32bit_state::portc_w)); +} + +ROM_START( mywicodx ) + ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) + // the first bank contains the Mi Guitar game, the 2nd half of the ROM is where the Menu starts + ROM_LOAD16_WORD_SWAP( "mywicodx.u2", 0x0000000, 0x4000000, CRC(ec7c5d2f) SHA1(330fb839c485713f7bec5bf9d2d42841612c5b45)) +ROM_END + + +ROM_START( zon32bit ) + ROM_REGION( 0x2000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "41sports.bin", 0x0000, 0x2000000, CRC(86eee6e0) SHA1(3f6cab6649aebf596de5a8af21658bb1a27edb10) ) +ROM_END + + +// Box advertises this as '40 Games Included' but the cartridge, which was glued directly to the PCB, not removable, is a 41-in-1. Maybe some versions exist with a 40 game selection. +CONS( 200?, zon32bit, 0, 0, zon32bit, zon32bit, zon32bit_state, init_zon32bit, "Jungle Soft / Ultimate Products (HK) Ltd", "Zone 32-bit Gaming Console System (Family Sport 41-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// My Wico Deluxe was also available under the MiWi brand (exact model unknown, but it was a cart there instead of built in) +// Box claimed 53 Arcade Games + 8 Sports games + 24 Music games, although it's unclear where 24 Music Games comes from, there are 3, which are identical aside from the title screen. +// The Mi Guitar menu contains 24 games, but they're dupes, and just counting those would exclude the other Mi Fit and Mi Papacon menus (which also contain dupes) +CONS( 200?, mywicodx, 0, 0, zon32bit, zon32bit, zon32bit_state, init_mywicodx, "<unknown>", "My Wico Deluxe (Family Sport 85-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + diff --git a/src/mame/drivers/splash.cpp b/src/mame/drivers/splash.cpp index d49b6069dd1..501213dc9f5 100644 --- a/src/mame/drivers/splash.cpp +++ b/src/mame/drivers/splash.cpp @@ -360,7 +360,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( funystrp ) PORT_START("DSW1") - PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_DIPSETTING( 0x06, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) @@ -373,7 +373,7 @@ static INPUT_PORTS_START( funystrp ) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x00, "1C/1C or Free Play (if Coin B too)" ) - PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) + PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") PORT_DIPSETTING( 0x60, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) ) @@ -388,26 +388,26 @@ static INPUT_PORTS_START( funystrp ) PORT_DIPSETTING( 0x00, "1C/1C or Free Play (if Coin A too)" ) PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4") PORT_DIPSETTING( 0x04, "1" ) PORT_DIPSETTING( 0x08, "2" ) PORT_DIPSETTING( 0x0c, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x30, 0x30, "Bonus" ) + PORT_DIPNAME( 0x30, 0x30, "Bonus" ) PORT_DIPLOCATION("SW2:5,6") PORT_DIPSETTING( 0x30, "Bonus Chance HI/LO Cards" ) PORT_DIPSETTING( 0x10, "Life at Stage 10" ) PORT_DIPSETTING( 0x00, "Life at Stage 20" ) PORT_DIPSETTING( 0x20, DEF_STR( None ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) - PORT_DIPNAME( 0x80, 0x80, "Strip Mode" ) + PORT_DIPNAME( 0x80, 0x80, "Strip Mode" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x80, "Soft" ) PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) @@ -807,7 +807,7 @@ Note 001-937 */ -ROM_START( rebus ) +ROM_START( rebus ) // there's also a year hack dumped: it has 4 different bytes total, 2 to change 1995 to 1997 in two places and 2 corresponding changes to fix the checksum ROM_REGION( 0x408000, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "2.u16", 0x000000, 0x080000, CRC(7c8a717f) SHA1(00b1e7986046a7705fc65a5c7d4701a002b2ea6f) ) ROM_LOAD16_BYTE( "6.u12", 0x000001, 0x080000, CRC(8f73d548) SHA1(210d95dc0db41da3252a09e598719d98bca41983) ) diff --git a/src/mame/drivers/ssfindo.cpp b/src/mame/drivers/ssfindo.cpp index 26a14c43de2..fe301fe9879 100644 --- a/src/mame/drivers/ssfindo.cpp +++ b/src/mame/drivers/ssfindo.cpp @@ -158,7 +158,7 @@ protected: required_device<arm7500fe_iomd_device> m_iomd; optional_device<i2cmem_device> m_i2cmem; required_region_ptr<uint16_t> m_flashrom; - + void init_common(); virtual void machine_start() override; virtual void machine_reset() override; @@ -194,7 +194,7 @@ private: void ppcar_map(address_map &map); void ssfindo_map(address_map &map); - + DECLARE_READ8_MEMBER(iolines_r); DECLARE_WRITE8_MEMBER(iolines_w); bool m_flash_bank_select; @@ -301,7 +301,7 @@ READ32_MEMBER(ssfindo_state::io_r) { case 0: //bit 0 of IOLINES = flash select ( 5/6 or 3/2 ) - if (m_flash_bank_select) + if (m_flash_bank_select) adr+=0x400000; break; @@ -565,7 +565,7 @@ void ssfindo_state::ssfindo(machine_config &config) m_vidc->set_screen("screen"); m_vidc->vblank().set(m_iomd, FUNC(arm_iomd_device::vblank_irq)); m_vidc->sound_drq().set(m_iomd, FUNC(arm_iomd_device::sound_drq)); - + ARM7500FE_IOMD(config, m_iomd, 54000000); m_iomd->set_host_cpu_tag(m_maincpu); m_iomd->set_vidc_tag(m_vidc); @@ -589,7 +589,7 @@ void tetfight_state::tetfight(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &tetfight_state::tetfight_map); I2C_24C02(config, m_i2cmem); - + m_iomd->iocr_read_od<0>().set(FUNC(tetfight_state::iocr_od0_r)); m_iomd->iocr_read_od<1>().set(FUNC(tetfight_state::iocr_od1_r)); m_iomd->iocr_write_od<0>().set(FUNC(tetfight_state::iocr_od0_w)); diff --git a/src/mame/drivers/storio.cpp b/src/mame/drivers/storio.cpp index 4907ff02968..b1733f21229 100644 --- a/src/mame/drivers/storio.cpp +++ b/src/mame/drivers/storio.cpp @@ -15,6 +15,10 @@ TODO: everything! + NAND types + + Storio Spanish old BIOS TC58NVG0S3ETA00 (2048+64) x 64 x 1024 + *******************************************************************************/ #include "emu.h" diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp index f82a5470c29..f62a0d6bfc8 100644 --- a/src/mame/drivers/stv.cpp +++ b/src/mame/drivers/stv.cpp @@ -1191,19 +1191,19 @@ MACHINE_RESET_MEMBER(stv_state,stv) std::string region_tag; if (m_cart1) - m_cart_reg[0] = memregion(region_tag.assign(m_cart1->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[0] = memregion(region_tag.assign(m_cart1->tag()).append(GENERIC_ROM_REGION_TAG)); else m_cart_reg[0] = memregion("cart"); if (m_cart2) - m_cart_reg[1] = memregion(region_tag.assign(m_cart2->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[1] = memregion(region_tag.assign(m_cart2->tag()).append(GENERIC_ROM_REGION_TAG)); else m_cart_reg[1] = nullptr; if (m_cart3) - m_cart_reg[2] = memregion(region_tag.assign(m_cart3->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[2] = memregion(region_tag.assign(m_cart3->tag()).append(GENERIC_ROM_REGION_TAG)); else m_cart_reg[2] = nullptr; if (m_cart4) - m_cart_reg[3] = memregion(region_tag.assign(m_cart4->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_reg[3] = memregion(region_tag.assign(m_cart4->tag()).append(GENERIC_ROM_REGION_TAG)); else m_cart_reg[3] = nullptr; diff --git a/src/mame/drivers/subsino2.cpp b/src/mame/drivers/subsino2.cpp index 7818c36cf2a..a9f78c69020 100644 --- a/src/mame/drivers/subsino2.cpp +++ b/src/mame/drivers/subsino2.cpp @@ -1098,7 +1098,7 @@ void subsino2_state::new2001_base_map(address_map &map) map(0xc00000, 0xc00001).portr("DSW"); map(0xc00002, 0xc00003).portr("IN C"); - map(0xc00004, 0xc00005).portr("IN A & B"); + map(0xc00004, 0xc00005).portr("IN AB"); map(0xc00006, 0xc00007).r(FUNC(subsino2_state::bishjan_serial_r)); } @@ -1728,7 +1728,7 @@ static INPUT_PORTS_START( new2001 ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // high byte not read - PORT_START("IN A & B") // c00004 + PORT_START("IN AB") // c00004 PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_IMPULSE(1) // service mode (press twice for inputs) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / Black") @@ -1776,7 +1776,7 @@ static INPUT_PORTS_START( humlan ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // high byte not read - PORT_START("IN A & B") // c00004 + PORT_START("IN AB") // c00004 // 1st-type panel PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) diff --git a/src/mame/drivers/suna8.cpp b/src/mame/drivers/suna8.cpp index 9ee1e95d674..18270ce7032 100644 --- a/src/mame/drivers/suna8.cpp +++ b/src/mame/drivers/suna8.cpp @@ -1533,7 +1533,7 @@ static INPUT_PORTS_START( brickzn ) PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) - PORT_DIPNAME( 0x38, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW-A:4,5,6") + PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW-A:4,5,6") PORT_DIPSETTING( 0x38, DEF_STR( Easiest ) ) PORT_DIPSETTING( 0x30, DEF_STR( Very_Easy) ) PORT_DIPSETTING( 0x28, DEF_STR( Easy ) ) @@ -1557,7 +1557,7 @@ static INPUT_PORTS_START( brickzn ) PORT_DIPNAME( 0x04, 0x04, "Play Together" ) PORT_DIPLOCATION("SW-B:3") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x38, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW-B:4,5,6") + PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW-B:4,5,6") PORT_DIPSETTING( 0x30, "10K" ) PORT_DIPSETTING( 0x28, "30K" ) PORT_DIPSETTING( 0x18, "50K, Every 50K" ) @@ -1599,14 +1599,13 @@ static INPUT_PORTS_START( brickzn ) PORT_CONFSETTING( 0x40, DEF_STR( Off ) ) PORT_CONFSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Finish Stage (Cheat)") - INPUT_PORTS_END static INPUT_PORTS_START( brickznv6 ) PORT_INCLUDE(brickzn) PORT_MODIFY("DSW2") // DSW 2 - $c103 - PORT_DIPNAME( 0x18, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW-B:4,5") + PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW-B:4,5") PORT_DIPSETTING( 0x18, "None" ) PORT_DIPSETTING( 0x10, "10K" ) PORT_DIPSETTING( 0x08, "30K" ) diff --git a/src/mame/drivers/sunplus_gcm394.cpp b/src/mame/drivers/sunplus_gcm394.cpp index 7663c87ab96..e66df242f9d 100644 --- a/src/mame/drivers/sunplus_gcm394.cpp +++ b/src/mame/drivers/sunplus_gcm394.cpp @@ -5,22 +5,135 @@ Compared to vii.cpp this is clearly newer, has extra opcodes, different internal map etc. also scaling and higher resolutions based on Spongebob + note, these SoC types always have a 128Kwords internal ROM, which the JAKKS games appear to use for basic bootstrap purposes. + + GPAC800 / GCM394 (SpongeBob Bikini Bottom 500 Test Mode also calls this GPAC800, even if the mappings appear different to the NAND version below - different CS base, maybe just depends on boot mode?) Smart Fit Park SpongeBob SquarePants Bikini Bottom 500 Spiderman - The Masked Menace 'Spider Sense' (pad type with Spiderman model) (Wireless Hunting? - maybe, register map looks the same even if it sets stack to 2fff not 6fff) - as these use newer opcodes in the FExx range they probably need a derived unSP type too + GPAC800 (with NAND support) + Wireless Air 60 + Golden Tee Golf + Cars 2 + Toy Story Mania + V.Baby + Playskool Heroes Transformers Rescue Bots Beam Box + + GPAC500 (based on test modes, unknown hardware, might be GPAC800 but without the higher resolution support?) + The Price is Right + Bejeweled? (might be GPAC800) + + Notes + smartfp: hold button Circle, Star and Home on startup for Test Menu + + these are all unsp 2.0 type, as they use the extended ocpodes + + + NAND types: + + Toy Story Mania H27U518S2C dumped as HY27US08121A (512+16) x 32 x 4096 + Beam Box GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 + Golden Tee GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 + Cars 2 GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 + + V.Baby HY27UF081G2A (2048+64) x 64 x 1024 + */ #include "emu.h" #include "machine/sunplus_gcm394.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "screen.h" #include "speaker.h" + + +class full_memory_device : + public device_t, + public device_memory_interface +{ +public: + // construction/destruction + full_memory_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + // configuration helpers + template <typename... T> full_memory_device& set_map(T &&... args) { set_addrmap(0, std::forward<T>(args)...); return *this; } + + template <typename... T> full_memory_device& map(T &&... args) { set_addrmap(0, std::forward<T>(args)...); return *this; } + + address_space* get_program() { return m_program; } + +protected: + virtual void device_start() override; + virtual void device_config_complete() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + +private: + // internal state + address_space_config m_program_config; + address_space *m_program; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(FULL_MEMORY, full_memory_device) + +// device type definition +DEFINE_DEVICE_TYPE(FULL_MEMORY, full_memory_device, "full_memory", "SunPlus Full CS Memory Map") + +full_memory_device::full_memory_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, FULL_MEMORY, tag, owner, clock), + device_memory_interface(mconfig, *this), + m_program(nullptr) +{ +} + +device_memory_interface::space_config_vector full_memory_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config) + }; +} + +/* +':maincpu' (00F87F):possible DMA operation (7abf) (trigger 0001) with params mode:4009 source:00040000 (word offset) dest:00830000 (word offset) length:00007800 (words) +':maincpu' (002384):possible DMA operation (7abf) (trigger 0001) with params mode:0009 source:00180000 (word offset) dest:00840000 (word offset) length:00160000 (words) + +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:000025bc (word offset) length:000001e0 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:000024cc (word offset) length:000000f0 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000002 (word offset) length:00000400 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000402 (word offset) length:00000400 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000802 (word offset) length:00000400 (words) + +gtg +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030000 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030100 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030200 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030300 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030400 (word offset) length:00000200 (words) + +*/ + +void full_memory_device::device_config_complete() +{ + m_program_config = address_space_config( "program", ENDIANNESS_BIG, 16, 32, -1 ); +} + +void full_memory_device::device_start() +{ + m_program = &space(AS_PROGRAM); +} + + class gcm394_game_state : public driver_device { public: @@ -28,81 +141,94 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), - m_bank(*this, "cartbank"), - m_io_p1(*this, "P1"), - m_io_p2(*this, "P2"), - m_romregion(*this, "maincpu") + m_io(*this, "IN%u", 0U), + m_romregion(*this, "maincpu"), + m_memory(*this, "memory") { } void base(machine_config &config); + void cs_map_base(address_map &map); + + virtual DECLARE_READ16_MEMBER(cs0_r); + virtual DECLARE_WRITE16_MEMBER(cs0_w); + virtual DECLARE_READ16_MEMBER(cs1_r); + virtual DECLARE_WRITE16_MEMBER(cs1_w); + virtual DECLARE_READ16_MEMBER(cs2_r); + virtual DECLARE_WRITE16_MEMBER(cs2_w); + virtual DECLARE_READ16_MEMBER(cs3_r); + virtual DECLARE_WRITE16_MEMBER(cs3_w); + virtual DECLARE_READ16_MEMBER(cs4_r); + virtual DECLARE_WRITE16_MEMBER(cs4_w); + + void cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4); protected: virtual void machine_start() override; virtual void machine_reset() override; - void switch_bank(uint32_t bank); required_device<sunplus_gcm394_base_device> m_maincpu; required_device<screen_device> m_screen; - optional_memory_bank m_bank; - - required_ioport m_io_p1; - required_ioport m_io_p2; - virtual void mem_map_4m(address_map &map); + required_ioport_array<3> m_io; - required_region_ptr<uint16_t> m_romregion; - DECLARE_READ16_MEMBER(porta_r); - DECLARE_READ16_MEMBER(portb_r); - DECLARE_WRITE16_MEMBER(porta_w); + optional_region_ptr<uint16_t> m_romregion; + required_device<full_memory_device> m_memory; - virtual DECLARE_WRITE16_MEMBER(mapping_w) {} + virtual DECLARE_READ16_MEMBER(porta_r); + virtual DECLARE_READ16_MEMBER(portb_r); + virtual DECLARE_READ16_MEMBER(portc_r); + virtual DECLARE_WRITE16_MEMBER(porta_w); virtual DECLARE_READ16_MEMBER(read_external_space); virtual DECLARE_WRITE16_MEMBER(write_external_space); private: - - uint32_t m_current_bank; - int m_numbanks; - }; -class wrlshunt_game_state : public gcm394_game_state +READ16_MEMBER(gcm394_game_state::cs0_r) { -public: - wrlshunt_game_state(const machine_config& mconfig, device_type type, const char* tag) : - gcm394_game_state(mconfig, type, tag), - m_mapping(0), - m_mainram(*this, "mainram") - { - } + return m_romregion[offset & 0x3fffff]; +} - void wrlshunt(machine_config &config); +WRITE16_MEMBER(gcm394_game_state::cs0_w) +{ + logerror("cs0_w %04x %04x (to ROM!)\n", offset, data); +} -protected: - //virtual void machine_start() override; - //virtual void machine_reset() override; +READ16_MEMBER(gcm394_game_state::cs1_r) { logerror("cs1_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs1_w) { logerror("cs1_w %06x %04x\n", offset, data); } +READ16_MEMBER(gcm394_game_state::cs2_r) { logerror("cs2_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs2_w) { logerror("cs2_w %06x %04x\n", offset, data); } +READ16_MEMBER(gcm394_game_state::cs3_r) { logerror("cs3_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs3_w) { logerror("cs3_w %06x %04x\n", offset, data); } +READ16_MEMBER(gcm394_game_state::cs4_r) { logerror("cs4_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs4_w) { logerror("cs4_w %06x %04x\n", offset, data); } - void wrlshunt_map(address_map &map); -private: +/* + map info (NAND type) - DECLARE_READ16_MEMBER(hunt_porta_r); - DECLARE_WRITE16_MEMBER(hunt_porta_w); + map(0x000000, 0x006fff) internal RAM + map(0x007000, 0x007fff) internal peripherals + map(0x008000, 0x00ffff) internal ROM (lower 32kwords) - can also be configured to mirror CS0 308000 area with external pin for boot from external ROM + map(0x010000, 0x027fff) internal ROM (upper 96kwords) - can't be switched + map(0x028000, 0x02ffff) reserved - virtual DECLARE_WRITE16_MEMBER(mapping_w) override; - uint16_t m_mapping; + map(0x030000, 0x0.....) view into external spaces (CS0 area starts here. followed by CS1 area, CS2 area etc.) - required_shared_ptr<u16> m_mainram; + map(0x200000, 0x3fffff) continued view into external spaces, but this area is banked with m_membankswitch_7810 (valid bank values 0x00-0x3f) +*/ - virtual DECLARE_READ16_MEMBER(read_external_space) override; - virtual DECLARE_WRITE16_MEMBER(write_external_space) override; -}; + + +void gcm394_game_state::cs_map_base(address_map& map) +{ +} class generalplus_gpac800_game_state : public gcm394_game_state @@ -110,7 +236,8 @@ class generalplus_gpac800_game_state : public gcm394_game_state public: generalplus_gpac800_game_state(const machine_config& mconfig, device_type type, const char* tag) : gcm394_game_state(mconfig, type, tag), - m_mainram(*this, "mainram") + m_has_nand(false), + m_initial_copy_words(0x2000) { } @@ -118,129 +245,360 @@ public: void nand_init210(); void nand_init840(); + void nand_wlsair60(); + void nand_vbaby(); + void nand_tsm(); + void nand_beambox(); protected: + virtual void machine_start() override; virtual void machine_reset() override; - void generalplus_gpac800_map(address_map &map); + DECLARE_READ8_MEMBER(read_nand); + std::vector<uint16_t> m_sdram; + std::vector<uint16_t> m_sdram2; + + virtual DECLARE_READ16_MEMBER(cs0_r) override; + virtual DECLARE_WRITE16_MEMBER(cs0_w) override; + virtual DECLARE_READ16_MEMBER(cs1_r) override; + virtual DECLARE_WRITE16_MEMBER(cs1_w) override; + bool m_has_nand; private: void nand_init(int blocksize, int blocksize_stripped); - required_shared_ptr<u16> m_mainram; std::vector<uint8_t> m_strippedrom; + int m_strippedsize; + + int m_initial_copy_words; + int m_vectorbase; }; +class generalplus_gpac800_vbaby_game_state : public generalplus_gpac800_game_state +{ +public: + generalplus_gpac800_vbaby_game_state(const machine_config& mconfig, device_type type, const char* tag) : + generalplus_gpac800_game_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { + } + void generalplus_gpac800_vbaby(machine_config &config); +protected: + required_device<generic_slot_device> m_cart; + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); -READ16_MEMBER(gcm394_game_state::read_external_space) -{ - //logerror("reading offset %04x\n", offset * 2); - return m_romregion[offset]; -} +private: +}; -WRITE16_MEMBER(gcm394_game_state::write_external_space) + +class generalplus_gpspispi_game_state : public gcm394_game_state { - logerror("DMA writing to external space (RAM?) %08x %04x\n", offset, data); -} +public: + generalplus_gpspispi_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag) + { + } + + void generalplus_gpspispi(machine_config &config); + + void init_spi(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: +}; + + -WRITE16_MEMBER(wrlshunt_game_state::mapping_w) +class generalplus_gpspispi_bkrankp_game_state : public generalplus_gpspispi_game_state { - m_mapping = data; - logerror("change mapping %04x\n", data); -} +public: + generalplus_gpspispi_bkrankp_game_state(const machine_config& mconfig, device_type type, const char* tag) : + generalplus_gpspispi_game_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { + } + + void generalplus_gpspispi_bkrankp(machine_config &config); + +protected: + required_device<generic_slot_device> m_cart; + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); -READ16_MEMBER(wrlshunt_game_state::read_external_space) +private: +}; + + + +class tkmag220_game_state : public gcm394_game_state { - if (m_mapping == 0x7f8a) +public: + tkmag220_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag) { - //logerror("reading offset %04x\n", offset * 2); - return m_romregion[offset]; } - else if (m_mapping == 0x008a) + + void tkmag220(machine_config &config); + +protected: + + /* + virtual DECLARE_READ16_MEMBER(porta_r) override { - address_space& mem = m_maincpu->space(AS_PROGRAM); - uint16_t retdata = mem.read_word(offset + 0x20000); - logerror("reading from RAM instead offset %08x returning %04x\n", offset * 2, retdata); - return retdata; + return machine().rand(); } - else + + virtual DECLARE_READ16_MEMBER(portb_r) override { - uint16_t retdata = 0x0000; - logerror("reading from unknown source instead offset %08x returning %04x\n", offset * 2, retdata); - return retdata; + return machine().rand(); } -} + virtual DECLARE_WRITE16_MEMBER(porta_w) override + { + } + */ +private: + virtual DECLARE_READ16_MEMBER(cs0_r) override + { + return m_romregion[offset & 0x3ffffff]; + } +}; -WRITE16_MEMBER(wrlshunt_game_state::write_external_space) +class wrlshunt_game_state : public gcm394_game_state { -// logerror("DMA writing to external space (RAM?) %08x %04x\n", offset, data); - - if (offset & 0x0800000) +public: + wrlshunt_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag) { - offset &= 0x03fffff; + } - if (offset < 0x03d0000) - { - m_mainram[offset] = data; - //logerror("DMA writing to external space (RAM?) %08x %04x\n", offset, data); + void wrlshunt(machine_config &config); - } - else - { - logerror("DMA writing to external space (RAM?) (out of bounds) %08x %04x\n", offset, data); - } - } - else + void init_wrlshunt(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + std::vector<uint16_t> m_sdram; + + virtual DECLARE_READ16_MEMBER(porta_r) override; + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + +private: + + + //required_shared_ptr<u16> m_mainram; + + virtual DECLARE_READ16_MEMBER(cs0_r) override; + virtual DECLARE_WRITE16_MEMBER(cs0_w) override; + virtual DECLARE_READ16_MEMBER(cs1_r) override; + virtual DECLARE_WRITE16_MEMBER(cs1_w) override; +}; + +class jak_s500_game_state : public wrlshunt_game_state +{ +public: + jak_s500_game_state(const machine_config& mconfig, device_type type, const char* tag) : + wrlshunt_game_state(mconfig, type, tag) { - logerror("DMA writing to external space (RAM?) (unknown handling) %08x %04x\n", offset, data); } + +protected: + //virtual void machine_start() override; + virtual void machine_reset() override; + + virtual DECLARE_READ16_MEMBER(porta_r) override; + virtual DECLARE_READ16_MEMBER(portb_r) override; + +private: +}; + + + + +READ16_MEMBER(wrlshunt_game_state::cs0_r) +{ + return m_romregion[offset & 0x3ffffff]; +} + +WRITE16_MEMBER(wrlshunt_game_state::cs0_w) +{ + logerror("cs0_w write to ROM?\n"); + //m_romregion[offset & 0x3ffffff] = data; +} + +READ16_MEMBER(wrlshunt_game_state::cs1_r) +{ + return m_sdram[offset & 0x3fffff]; +} + +WRITE16_MEMBER(wrlshunt_game_state::cs1_w) +{ + m_sdram[offset & 0x3fffff] = data; +} + + +void wrlshunt_game_state::machine_start() +{ + save_item(NAME(m_sdram)); +} + +void wrlshunt_game_state::machine_reset() +{ + cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); + m_maincpu->set_cs_space(m_memory->get_program()); + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(1); + m_maincpu->set_alt_tile_addressing_hack(1); +} + +READ16_MEMBER(jak_s500_game_state::porta_r) +{ + uint16_t data = m_io[0]->read(); + logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); + + //address_space& mem = m_maincpu->space(AS_PROGRAM); + //if (mem.read_word(0x22b408) == 0x4846) + // mem.write_word(0x22b408, 0x4840); // jak_s500 force service mode + + return data; +} + +READ16_MEMBER(jak_s500_game_state::portb_r) +{ + uint16_t data = m_io[1]->read(); + logerror("%s: Port B Read: %04x\n", machine().describe_context(), data); + return data; +} + + +void jak_s500_game_state::machine_reset() +{ + cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); + m_maincpu->set_cs_space(m_memory->get_program()); + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(0); + m_maincpu->set_alt_tile_addressing_hack(1); +} + + +void generalplus_gpspispi_game_state::machine_start() +{ +} + +void generalplus_gpspispi_game_state::machine_reset() +{ + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(0); + m_maincpu->set_alt_tile_addressing_hack(1); +} + + + +void wrlshunt_game_state::init_wrlshunt() +{ + m_sdram.resize(0x400000); // 0x400000 bytes, 0x800000 words +} + +READ16_MEMBER(generalplus_gpac800_game_state::cs0_r) +{ + return m_sdram2[offset & 0xffff]; +} + +WRITE16_MEMBER(generalplus_gpac800_game_state::cs0_w) +{ + m_sdram2[offset & 0xffff] = data; +} + +READ16_MEMBER(generalplus_gpac800_game_state::cs1_r) +{ + return m_sdram[offset & 0x3fffff]; } +WRITE16_MEMBER(generalplus_gpac800_game_state::cs1_w) +{ + m_sdram[offset & 0x3fffff] = data; +} + +READ8_MEMBER(generalplus_gpac800_game_state::read_nand) +{ + if (!m_has_nand) + return 0x0000; + return m_strippedrom[offset & (m_strippedsize - 1)]; +} + +READ16_MEMBER(gcm394_game_state::read_external_space) +{ + return m_memory->get_program()->read_word(offset); +} + +WRITE16_MEMBER(gcm394_game_state::write_external_space) +{ + m_memory->get_program()->write_word(offset, data); +} READ16_MEMBER(gcm394_game_state::porta_r) { - uint16_t data = m_io_p1->read(); + uint16_t data = m_io[0]->read(); logerror("Port A Read: %04x\n", data); return data; } READ16_MEMBER(gcm394_game_state::portb_r) { - uint16_t data = m_io_p2->read(); + uint16_t data = m_io[1]->read(); logerror("Port B Read: %04x\n", data); return data; } +READ16_MEMBER(gcm394_game_state::portc_r) +{ + uint16_t data = m_io[2]->read(); + logerror("Port C Read: %04x\n", data); + return data; +} + WRITE16_MEMBER(gcm394_game_state::porta_w) { logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); } +// some sources indicate these later SoC types run at 96Mhz, others indicate 48Mhz. +// unSP 2.0 CPUs have a lower average CPI too (2 instead of 6 on unSP 1.0 or 5 on unSP 1.1 / 1.2 / unSP 2.0) so using regular unSP timings might result in things being too slow +// as with the older SunPlus chips this appears to be an fully internally generated frequency, external XTALs again are typically 6MHz or simply not present. void gcm394_game_state::base(machine_config &config) { - GCM394(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &gcm394_game_state::mem_map_4m); + GCM394(config, m_maincpu, 96000000/2, m_screen); m_maincpu->porta_in().set(FUNC(gcm394_game_state::porta_r)); m_maincpu->portb_in().set(FUNC(gcm394_game_state::portb_r)); + m_maincpu->portc_in().set(FUNC(gcm394_game_state::portc_r)); m_maincpu->porta_out().set(FUNC(gcm394_game_state::porta_w)); m_maincpu->space_read_callback().set(FUNC(gcm394_game_state::read_external_space)); m_maincpu->space_write_callback().set(FUNC(gcm394_game_state::write_external_space)); m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->mapping_write_callback().set(FUNC(gcm394_game_state::mapping_w)); m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(1); // boot from external ROM / CS mirror + m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); + + FULL_MEMORY(config, m_memory).set_map(&gcm394_game_state::cs_map_base); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); - m_screen->set_size(320, 262); - m_screen->set_visarea(0, 320-1, 0, 240-1); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); @@ -248,116 +606,206 @@ void gcm394_game_state::base(machine_config &config) SPEAKER(config, "rspeaker").front_right(); } -READ16_MEMBER(wrlshunt_game_state::hunt_porta_r) +void wrlshunt_game_state::wrlshunt(machine_config &config) { - uint16_t data = m_io_p1->read(); - logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); - return data; + gcm394_game_state::base(config); } -WRITE16_MEMBER(wrlshunt_game_state::hunt_porta_w) +void tkmag220_game_state::tkmag220(machine_config &config) { - logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); + gcm394_game_state::base(config); - // skip check (EEPROM?) - if (m_mainram[0x5b354 - 0x30000] == 0xafd0) - m_mainram[0x5b354 - 0x30000] = 0xB403; + m_maincpu->porta_in().set_ioport("IN0"); + m_maincpu->portb_in().set_ioport("IN1"); + m_maincpu->portc_in().set_ioport("IN2"); } -void wrlshunt_game_state::wrlshunt(machine_config &config) +READ16_MEMBER(wrlshunt_game_state::porta_r) { - gcm394_game_state::base(config); - m_maincpu->set_addrmap(AS_PROGRAM, &wrlshunt_game_state::wrlshunt_map); + uint16_t data = m_io[0]->read(); + logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); + return data; +} - m_maincpu->porta_in().set(FUNC(wrlshunt_game_state::hunt_porta_r)); - m_maincpu->porta_out().set(FUNC(wrlshunt_game_state::hunt_porta_w)); +WRITE16_MEMBER(wrlshunt_game_state::porta_w) +{ + logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); - m_screen->set_size(320*2, 262*2); - m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + // HACK + address_space& mem = m_maincpu->space(AS_PROGRAM); + if (mem.read_word(0x5b354) == 0xafd0) // wrlshubt - skip check (EEPROM?) + mem.write_word(0x5b354, 0xB403); } + void generalplus_gpac800_game_state::generalplus_gpac800(machine_config &config) { - gcm394_game_state::base(config); - - GPAC800(config.replace(), m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &generalplus_gpac800_game_state::generalplus_gpac800_map); + GPAC800(config, m_maincpu, 96000000/2, m_screen); m_maincpu->porta_in().set(FUNC(generalplus_gpac800_game_state::porta_r)); m_maincpu->portb_in().set(FUNC(generalplus_gpac800_game_state::portb_r)); + m_maincpu->portc_in().set(FUNC(generalplus_gpac800_game_state::portc_r)); m_maincpu->porta_out().set(FUNC(generalplus_gpac800_game_state::porta_w)); m_maincpu->space_read_callback().set(FUNC(generalplus_gpac800_game_state::read_external_space)); m_maincpu->space_write_callback().set(FUNC(generalplus_gpac800_game_state::write_external_space)); m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->mapping_write_callback().set(FUNC(generalplus_gpac800_game_state::mapping_w)); m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(0); // boot from internal ROM (NAND bootstrap) + m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); + + m_maincpu->nand_read_callback().set(FUNC(generalplus_gpac800_game_state::read_nand)); + + FULL_MEMORY(config, m_memory).set_map(&generalplus_gpac800_game_state::cs_map_base); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); } +DEVICE_IMAGE_LOAD_MEMBER(generalplus_gpac800_vbaby_game_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} -void gcm394_game_state::switch_bank(uint32_t bank) +void generalplus_gpac800_vbaby_game_state::generalplus_gpac800_vbaby(machine_config &config) { - if (!m_bank) - return; + generalplus_gpac800_game_state::generalplus_gpac800(config); - if (bank != m_current_bank) - { - m_current_bank = bank; - m_bank->set_entry(bank); - m_maincpu->invalidate_cache(); - } + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "vbaby_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(generalplus_gpac800_vbaby_game_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("vbaby_cart"); } + void gcm394_game_state::machine_start() { - if (m_bank) - { - int i; - for (i = 0; i < (m_romregion.bytes() / 0x800000); i++) - { - m_bank->configure_entry(i, &m_romregion[i * 0x800000]); - } +} - m_numbanks = i; +void gcm394_game_state::machine_reset() +{ + cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); + m_maincpu->set_cs_space(m_memory->get_program()); - m_bank->set_entry(0); - } - else - { - m_numbanks = 0; - } + m_maincpu->reset(); // reset CPU so vector gets read etc. - save_item(NAME(m_current_bank)); + m_maincpu->set_paldisplaybank_high_hack(1); + m_maincpu->set_alt_tile_addressing_hack(0); } -void gcm394_game_state::machine_reset() + +void gcm394_game_state::cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4) { - m_current_bank = 0; + // wipe existing mappings; + m_memory->get_program()->unmap_readwrite(0, (0x8000000*5)-1); + + int start_address = 0; + int end_address; + + int size; // cs region sizes in kwords + + size = (((cs0 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs0 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs0_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs0_w))); + start_address += size; + + size = (((cs1 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs1 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs1_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs1_w))); + start_address += size; + + size = (((cs2 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs2 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs2_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs2_w))); + start_address += size; + + size = (((cs3 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs3 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs3_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs3_w))); + start_address += size; + + size = (((cs4 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs4 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs4_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs4_w))); + //start_address += size; } -void gcm394_game_state::mem_map_4m(address_map &map) + +void generalplus_gpspispi_game_state::generalplus_gpspispi(machine_config &config) { - map(0x000000, 0x00ffff).rom().region("maincpu", 0); // non-banked area on this SoC? + GP_SPISPI(config, m_maincpu, 96000000/2, m_screen); + m_maincpu->porta_in().set(FUNC(generalplus_gpspispi_game_state::porta_r)); + m_maincpu->portb_in().set(FUNC(generalplus_gpspispi_game_state::portb_r)); + m_maincpu->portc_in().set(FUNC(generalplus_gpspispi_game_state::portc_r)); + m_maincpu->porta_out().set(FUNC(generalplus_gpspispi_game_state::porta_w)); + m_maincpu->space_read_callback().set(FUNC(generalplus_gpspispi_game_state::read_external_space)); + m_maincpu->space_write_callback().set(FUNC(generalplus_gpspispi_game_state::write_external_space)); + m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); + m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(0); // boot from internal ROM (SPI bootstrap) + m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); - // smartfp really expects the ROM at 0 to map here, so maybe this is how the newer SoC works - map(0x020000, 0x3fffff).bankr("cartbank"); + FULL_MEMORY(config, m_memory).set_map(&generalplus_gpspispi_game_state::cs_map_base); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); } -void wrlshunt_game_state::wrlshunt_map(address_map &map) +DEVICE_IMAGE_LOAD_MEMBER(generalplus_gpspispi_bkrankp_game_state::cart_load) { - map(0x000000, 0x00ffff).rom().region("maincpu", 0); // non-banked area on this SoC? - map(0x030000, 0x3fffff).ram().share("mainram"); + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return image_init_result::PASS; } -void generalplus_gpac800_game_state::generalplus_gpac800_map(address_map &map) +void generalplus_gpspispi_bkrankp_game_state::generalplus_gpspispi_bkrankp(machine_config &config) { - map(0x000000, 0x3fffff).ram().share("mainram"); -} + generalplus_gpspispi_game_state::generalplus_gpspispi(config); + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "bkrankp_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(generalplus_gpspispi_bkrankp_game_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("bkrankp_cart"); +} static INPUT_PORTS_START( gcm394 ) - PORT_START("P1") + PORT_START("IN0") + PORT_START("IN1") + PORT_START("IN2") +INPUT_PORTS_END + +static INPUT_PORTS_START( smartfp ) + PORT_START("IN0") // entirely non-standard mat based controller (0-11 are where your feet are placed normally, row of selection places to step above those) // no sensible default mapping unless forced PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_Q) PORT_NAME("0") @@ -373,13 +821,16 @@ static INPUT_PORTS_START( gcm394 ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("10") PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("11") - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Circle / Red") // hold button Circle and Star on startup for test menu (other conditions? doesn't always work?) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Circle / Red") PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_S) PORT_NAME("Square / Orange") PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Triangle / Yellow") PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_F) PORT_NAME("Star / Blue") - PORT_START("P2") - PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) @@ -428,10 +879,479 @@ static INPUT_PORTS_START( gcm394 ) INPUT_PORTS_END static INPUT_PORTS_START( wrlshunt ) - PORT_START("P1") - PORT_START("P2") + PORT_START("IN0") + PORT_START("IN1") + PORT_START("IN2") +INPUT_PORTS_END + +static INPUT_PORTS_START( tkmag220 ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_DIPNAME( 0x0001, 0x0001, "IN1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "Important" ) // gets stuck in inf loop if this is wrong + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_car2 ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) // unused + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_gtg ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END + +static INPUT_PORTS_START( jak_s500 ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +ROM_START(smartfp) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("smartfitpark.bin", 0x000000, 0x800000, CRC(ada84507) SHA1(a3a80bf71fae62ebcbf939166a51d29c24504428)) +ROM_END + +ROM_START( tkmag220 ) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "u1g-2a.u2", 0x0000000, 0x8000000, CRC(0fd769a1) SHA1(df19402bcd20075483d63fb98fb3fa42bd33ccfd) ) +ROM_END + +ROM_START(jak_s500) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("spbwheel.bin", 0x000000, 0x800000, CRC(6ba1d335) SHA1(1bb3e4d02c7b35dd4d336971c6a9f82071cc6ce1) ) +ROM_END + +ROM_START(wrlshunt) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x8000000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("wireless.bin", 0x0000, 0x8000000, CRC(a6ecc20e) SHA1(3645f23ba2bb218e92d4560a8ae29dddbaabf796)) +ROM_END + /* Wireless Hunting Video Game System (info provided with dump) @@ -508,16 +1428,6 @@ which is also found in the Wireless Air 60 ROM. */ -ROM_START(wrlshunt) - ROM_REGION(0x8000000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP("wireless.bin", 0x0000, 0x8000000, CRC(a6ecc20e) SHA1(3645f23ba2bb218e92d4560a8ae29dddbaabf796)) -ROM_END - -ROM_START(smartfp) - ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP("smartfitpark.bin", 0x000000, 0x800000, CRC(ada84507) SHA1(a3a80bf71fae62ebcbf939166a51d29c24504428)) -ROM_END - /* Wireless Air 60 @@ -543,81 +1453,145 @@ https://web.archive.org/web/20180106005235/http://www.lcis.com.tw/paper_store/pa */ ROM_START( wlsair60 ) - ROM_REGION( 0x8400000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION16_BE( 0x8400000, "nandrom", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "wlsair60.nand", 0x0000, 0x8400000, CRC(eec23b97) SHA1(1bb88290cf54579a5bb51c08a02d793cd4d79f7a) ) ROM_END ROM_START( jak_gtg ) - ROM_REGION( 0x4200000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION16_BE( 0x4200000, "nandrom", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "goldentee.bin", 0x0000, 0x4200000, CRC(87d5e815) SHA1(5dc46cd753b791449cc41d5eff4928c0dcaf35c0) ) ROM_END ROM_START( jak_car2 ) - ROM_REGION( 0x4200000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION16_BE( 0x4200000, "nandrom", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "cars2.bin", 0x0000, 0x4200000, CRC(4d610e09) SHA1(bc59f5f7f676a8f2a78dfda7fb62c804bbf850b6) ) ROM_END ROM_START( jak_tsm ) - ROM_REGION( 0x4200000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION16_BE( 0x4200000, "nandrom", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "toystorymania.bin", 0x0000, 0x4200000, CRC(183b20a5) SHA1(eb4fa5ee9dfac58f5244d00d4e833b1e461cc52c) ) ROM_END ROM_START( vbaby ) - ROM_REGION( 0x8400000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION16_BE( 0x8400000, "nandrom", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "vbaby.bin", 0x0000, 0x8400000, CRC(d904441b) SHA1(3742bc4e1e403f061ce2813ecfafc6f30a44d287) ) ROM_END ROM_START( beambox ) - ROM_REGION( 0x4200000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION16_BE( 0x4200000, "nandrom", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "beambox.bin", 0x0000, 0x4200000, CRC(a486f04e) SHA1(73c7d99d8922eba58d94e955e254b9c3baa4443e) ) ROM_END // the JAKKS ones of these seem to be known as 'Generalplus GPAC500' hardware? -CONS(2011, wrlshunt, 0, 0, wrlshunt, wrlshunt, wrlshunt_game_state, empty_init, "Hamy / Kids Station Toys Inc", "Wireless Hunting Video Game System", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(2009, smartfp, 0, 0, base, smartfp, gcm394_game_state, empty_init, "Fisher-Price", "Fun 2 Learn Smart Fit Park (Spain)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +CONS(200?, tkmag220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "TaiKee", "Mini Arcade Games Console (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS(2009, smartfp, 0, 0, base, gcm394, gcm394_game_state, empty_init, "Fisher-Price", "Fun 2 Learn Smart Fit Park (Spain)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // Fun 2 Learn 3-in-1 SMART SPORTS ? +CONS(2009, jak_s500, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "JAKKS Pacific Inc", "SpongeBob SquarePants Bikini Bottom 500 (JAKKS Pacific TV Motion Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +CONS(2011, wrlshunt, 0, 0, wrlshunt, wrlshunt, wrlshunt_game_state, init_wrlshunt, "Hamy / Kids Station Toys Inc", "Wireless Hunting Video Game System", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +void generalplus_gpac800_game_state::machine_start() +{ + save_item(NAME(m_sdram)); +} void generalplus_gpac800_game_state::machine_reset() { + // configure CS defaults address_space& mem = m_maincpu->space(AS_PROGRAM); + mem.write_word(0x007820, 0x0047); + mem.write_word(0x007821, 0xff47); + mem.write_word(0x007822, 0x00c7); + mem.write_word(0x007823, 0x0047); + mem.write_word(0x007824, 0x0047); - /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - 00000000 (50 47 61 6E 64 6E 61 6E 64 6E)-- -- -- -- -- -- PGandnandn------ - 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- ---------------- - bb = where to copy first block + m_maincpu->set_cs_space(m_memory->get_program()); - The header is GPnandnand (byteswapped) then some params - one of the params appears to be for the initial code copy operation done - by the bootstrap - */ + if (m_has_nand) + { + // up to 256 pages (16384kw) for each space - // probably more bytes are used - int dest = m_strippedrom[0x15] << 8; + // (size of cs0 + cs1 + cs2 + cs3 + cs4) <= 81920kwords - // copy a block of code from the NAND to RAM - for (int i = 0; i < 0x7000-dest; i++) - { - uint16_t word = m_strippedrom[(i * 2) + 0] | (m_strippedrom[(i * 2) + 1] << 8); + // simulate bootstrap / internal ROM + + address_space& mem = m_maincpu->space(AS_PROGRAM); + + /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F + 00000000 (50 47 61 6E 64 6E 61 6E 64 6E)-- -- -- -- -- -- PGandnandn------ + 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- ---------------- + + bb = where to copy first block + + The header is GPnandnand (byteswapped) then some params + one of the params appears to be for the initial code copy operation done + by the bootstrap + */ + + // probably more bytes are used + int dest = m_strippedrom[0x15] << 8; + + // copy a block of code from the NAND to RAM + for (int i = 0; i < m_initial_copy_words; i++) + { + uint16_t word = m_strippedrom[(i * 2) + 0] | (m_strippedrom[(i * 2) + 1] << 8); + + mem.write_word(dest + i, word); + } - mem.write_word(dest+i, word); + // these vectors must either directly point to RAM, or at least redirect there after some code + uint16_t* internal = (uint16_t*)memregion("maincpu:internal")->base(); + internal[0x7ff5] = m_vectorbase + 0x0a; + internal[0x7ff6] = m_vectorbase + 0x0c; + internal[0x7ff7] = dest + 0x20; // point boot vector at code in RAM (probably in reality points to internal code that copies the first block) + internal[0x7ff8] = m_vectorbase + 0x10; + internal[0x7ff9] = m_vectorbase + 0x12; + internal[0x7ffa] = m_vectorbase + 0x14; + internal[0x7ffb] = m_vectorbase + 0x16; + internal[0x7ffc] = m_vectorbase + 0x18; + internal[0x7ffd] = m_vectorbase + 0x1a; + internal[0x7ffe] = m_vectorbase + 0x1c; + internal[0x7fff] = m_vectorbase + 0x1e; } - mem.write_word(0xfff7, dest+0x20); // point boot vector at code in RAM m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(0); + m_maincpu->set_alt_tile_addressing_hack(1); } void generalplus_gpac800_game_state::nand_init(int blocksize, int blocksize_stripped) { - uint8_t* rom = memregion("maincpu")->base(); - int size = memregion("maincpu")->bytes(); + m_sdram.resize(0x400000); // 0x400000 bytes, 0x800000 words + m_sdram2.resize(0x10000); - int numblocks = size / blocksize; + uint8_t* rom = memregion("nandrom")->base(); + int size = memregion("nandrom")->bytes(); - m_strippedrom.resize(numblocks * blocksize_stripped); + int numblocks = size / blocksize; + m_strippedsize = numblocks * blocksize_stripped; + m_strippedrom.resize(m_strippedsize); for (int i = 0; i < numblocks; i++) { @@ -631,7 +1605,7 @@ void generalplus_gpac800_game_state::nand_init(int blocksize, int blocksize_stri } // debug to allow for easy use of unidasm.exe - if (1) + if (0) { FILE *fp; char filename[256]; @@ -643,6 +1617,9 @@ void generalplus_gpac800_game_state::nand_init(int blocksize, int blocksize_stri fclose(fp); } } + + m_has_nand = true; + m_vectorbase = 0x6fe0; } void generalplus_gpac800_game_state::nand_init210() @@ -655,11 +1632,108 @@ void generalplus_gpac800_game_state::nand_init840() nand_init(0x840, 0x800); } +void generalplus_gpac800_game_state::nand_wlsair60() +{ + nand_init840(); + m_initial_copy_words = 0x2800; +} + +void generalplus_gpac800_game_state::nand_vbaby() +{ + nand_init840(); + m_initial_copy_words = 0x1000; + m_maincpu->set_romtype(2); +} + +void generalplus_gpac800_game_state::nand_tsm() +{ + + // something odd must be going on with the bootloader? + // structure has the first 0x4000 block repeated 3 times (must appear in RAM on startup?) + // then it has a 0x10000 block repeated 4 times (must get copied to 0x30000 by code) + // then it has the larger, main payload, just the once. + + // the addresses written to the NAND device don't compensate for these data repeats, however dump seems ok as no other data is being repeated? + // reads after startup still need checking + nand_init210(); + m_maincpu->set_romtype(1); +} + +void generalplus_gpac800_game_state::nand_beambox() +{ + nand_init210(); + m_vectorbase = 0x2fe0; +} + + + // NAND dumps w/ internal bootstrap (and u'nSP 2.0 extended opcodes) (have gpnandnand strings) // the JAKKS ones seem to be known as 'Generalplus GPAC800' hardware -CONS(2010, wlsair60, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init840, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_car2, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_tsm , 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, vbaby, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init840, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, beambox, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(2010, wlsair60, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, jak_gtg, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_car2, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_tsm , 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_tsm, "JAKKS Pacific Inc", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, beambox, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_beambox, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +CONS(200?, vbaby, 0, 0, generalplus_gpac800_vbaby, jak_car2, generalplus_gpac800_vbaby_game_state, nand_vbaby, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + + +ROM_START( bkrankp ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION(0x400000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP( "unit_mx25l3206e_c22016.bin", 0x0000, 0x400000, CRC(7efad116) SHA1(427d707e97586ae6ab5fe08f29ca450ddc7ad36e) ) +ROM_END + + +void generalplus_gpspispi_game_state::init_spi() +{ + int vectorbase = 0x2fe0; + uint8_t* spirom = memregion("maincpu")->base(); + + address_space& mem = m_maincpu->space(AS_PROGRAM); + + /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F + + 00000000 50 47 70 73 73 69 69 70 70 73 44 00 44 3F 44 00 PGpssiipps + 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- + ^^ copy dest, just like with nand type + + bb = where to copy first block + + The header is GPspispi (byteswapped) then some params + one of the params appears to be for the initial code copy operation done + by the bootstrap + */ + + // probably more bytes are used + int dest = spirom[0x15] << 8; + + // copy a block of code from the NAND to RAM + for (int i = 0; i < 0x2000; i++) + { + uint16_t word = spirom[(i * 2) + 0] | (spirom[(i * 2) + 1] << 8); + + mem.write_word(dest + i, word); + } + + // these vectors must either directly point to RAM, or at least redirect there after some code + uint16_t* internal = (uint16_t*)memregion("maincpu:internal")->base(); + internal[0x0000] = 0xb00b; + + internal[0x7ff5] = vectorbase + 0x0a; + internal[0x7ff6] = vectorbase + 0x0c; + internal[0x7ff7] = dest + 0x20; // point boot vector at code in RAM (probably in reality points to internal code that copies the first block) + internal[0x7ff8] = vectorbase + 0x10; + internal[0x7ff9] = vectorbase + 0x12; + internal[0x7ffa] = vectorbase + 0x14; + internal[0x7ffb] = vectorbase + 0x16; + internal[0x7ffc] = vectorbase + 0x18; + internal[0x7ffd] = vectorbase + 0x1a; + internal[0x7ffe] = vectorbase + 0x1c; + internal[0x7fff] = vectorbase + 0x1e; +} + + +CONS(200?, bkrankp, 0, 0, generalplus_gpspispi_bkrankp, gcm394, generalplus_gpspispi_bkrankp_game_state , init_spi, "Bandai", "Karaoke Ranking Party (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) diff --git a/src/mame/drivers/superga2.cpp b/src/mame/drivers/superga2.cpp index f0dedfa29ea..a60a1af2390 100644 --- a/src/mame/drivers/superga2.cpp +++ b/src/mame/drivers/superga2.cpp @@ -13,7 +13,6 @@ To do - verify palette, pixel and cpu clocks - - two player mode ************************************************************************/ @@ -200,16 +199,14 @@ void superga2_state::kuzmich_map(address_map &map) static INPUT_PORTS_START( kuzmich ) PORT_START("P1") - // verified PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - // unverified - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) INPUT_PORTS_END void superga2_state::kuzmich(machine_config &config) diff --git a/src/mame/drivers/swtpc.cpp b/src/mame/drivers/swtpc.cpp index fc00330f8c0..1ca113a3f57 100644 --- a/src/mame/drivers/swtpc.cpp +++ b/src/mame/drivers/swtpc.cpp @@ -110,7 +110,6 @@ public: , m_ram(*this, "ram") , m_brg(*this, "brg") , m_maincpu_clock(*this, "MAINCPU_CLOCK") - , m_swtbug_ready_wait(*this, "SWTBUG_READY_WAIT") , m_swtbug_load_at_a100(*this, "SWTBUG_LOAD_AT_A100") { } @@ -129,7 +128,6 @@ private: required_device<ram_device> m_ram; required_device<mc14411_device> m_brg; required_ioport m_maincpu_clock; - required_ioport m_swtbug_ready_wait; required_ioport m_swtbug_load_at_a100; }; @@ -168,17 +166,6 @@ static INPUT_PORTS_START( swtpc ) PORT_CONFSETTING(2000000, "2.0 MHz") PORT_CONFSETTING(4000000, "4.0 MHz") - // Patch the SWTBUG to wait for the motor to start. The SWTBUG - // accesses the FDC control register and then waits a period for the - // motor to start. Unfortunately the DC series of FDCs do not trigger - // the motor when accessing the control register, the drive does not - // have time to become ready before commands are issued and the boot - // fails. This workaround is necessary in practice. - PORT_START("SWTBUG_READY_WAIT") - PORT_CONFNAME(0x1, 1, "SWTBUG ready wait patch") - PORT_CONFSETTING(0, "No") - PORT_CONFSETTING(1, "Yes - apply patch") - // Patch SWTBUG to load the disk boot code at 0xa100 rather than // 0x2400. The disk boot code is typically position dependent and many // disk images expect to have their boot code loaded at 0xa100. TODO @@ -194,7 +181,8 @@ static INPUT_PORTS_START( swtpc ) INPUT_PORTS_END static DEVICE_INPUT_DEFAULTS_START( dc5 ) - DEVICE_INPUT_DEFAULTS("address_mode", 0xf, 0) + DEVICE_INPUT_DEFAULTS("ADDRESS_MODE", 0x1, 0) + DEVICE_INPUT_DEFAULTS("FORCE_READY", 0x1, 1) DEVICE_INPUT_DEFAULTS_END INPUT_CHANGED_MEMBER(swtpc_state::maincpu_clock_change) @@ -210,13 +198,6 @@ void swtpc_state::machine_reset() // TODO make these SWTBUG patches conditional on using SWTBUG! - if (m_swtbug_ready_wait->read()) - { - // Patch SWTBUG to also wait until the drive is ready. - uint8_t* swtbug = memregion("mcm6830")->base(); - swtbug[0x029b] = 0x81; - } - if (m_swtbug_load_at_a100->read()) { // Patch SWTBUG to load the disk boot sector at 0xa100. diff --git a/src/mame/drivers/swtpc09.cpp b/src/mame/drivers/swtpc09.cpp index 32f7a8044ff..ebb5a755ed8 100644 --- a/src/mame/drivers/swtpc09.cpp +++ b/src/mame/drivers/swtpc09.cpp @@ -298,7 +298,8 @@ INPUT_PORTS_END static DEVICE_INPUT_DEFAULTS_START( dc5 ) - DEVICE_INPUT_DEFAULTS("address_mode", 0xf, 1) + DEVICE_INPUT_DEFAULTS("ADDRESS_MODE", 0x1, 1) + DEVICE_INPUT_DEFAULTS("FORCE_READY", 0x1, 0) DEVICE_INPUT_DEFAULTS_END diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp index 58cb939e2e0..262d808b79c 100644 --- a/src/mame/drivers/system1.cpp +++ b/src/mame/drivers/system1.cpp @@ -252,7 +252,7 @@ seem to have access to. each opcode fetch (since the M1 line is low for 2 cycles per byte). */ -static const uint8_t cc_op[0x100] = { +static const u8 cc_op[0x100] = { 4*5+1*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 8*5+2*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,12*5+2*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 7*5+2*2,10*5+3*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 7*5+2*2,11*5+1*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, @@ -271,7 +271,7 @@ static const uint8_t cc_op[0x100] = { 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 6*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 0*5 , 7*5+2*2,11*5+1*2 }; -static const uint8_t cc_cb[0x100] = { +static const u8 cc_cb[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, @@ -290,7 +290,7 @@ static const uint8_t cc_cb[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2 }; -static const uint8_t cc_ed[0x100] = { +static const u8 cc_ed[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, @@ -309,7 +309,7 @@ static const uint8_t cc_ed[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2 }; -static const uint8_t cc_xy[0x100] = { +static const u8 cc_xy[0x100] = { ( 4+4)*5+2*2,(10+4)*5+4*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(11+4)*5+2*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, ( 8+4)*5+3*2,(10+4)*5+4*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,(12+4)*5+3*2,(11+4)*5+2*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, ( 7+4)*5+3*2,(10+4)*5+4*2,(16+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,(16+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, @@ -328,7 +328,7 @@ static const uint8_t cc_xy[0x100] = { ( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 6+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2 }; -static const uint8_t cc_xycb[0x100] = { +static const u8 cc_xycb[0x100] = { 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, @@ -348,7 +348,7 @@ static const uint8_t cc_xycb[0x100] = { }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ -static const uint8_t cc_ex[0x100] = { +static const u8 cc_ex[0x100] = { 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 5*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, /* DJNZ */ 5*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 5*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, /* JR NZ/JR Z */ @@ -370,7 +370,7 @@ static const uint8_t cc_ex[0x100] = { void system1_state::machine_start() { - uint32_t numbanks = (m_maincpu_region->bytes() - 0x10000) / 0x4000; + const u32 numbanks = (m_maincpu_region->bytes() - 0x10000) / 0x4000; if (numbanks > 0) m_bank1->configure_entries(0, numbanks, m_maincpu_region->base() + 0x10000, 0x4000); @@ -411,25 +411,24 @@ void system1_state::machine_reset() } - /************************************* * * ROM banking * *************************************/ -void system1_state::bank44_custom_w(uint8_t data, uint8_t prevdata) +void system1_state::bank44_custom_w(u8 data, u8 prevdata) { /* bank bits are bits 6 and 2 */ m_bank1->set_entry(((data & 0x40) >> 5) | ((data & 0x04) >> 2)); } -void system1_state::bank0c_custom_w(uint8_t data, uint8_t prevdata) +void system1_state::bank0c_custom_w(u8 data, u8 prevdata) { /* bank bits are bits 3 and 2 */ m_bank1->set_entry((data & 0x0c) >> 2); - if(m_bank1d) + if (m_bank1d) m_bank1d->set_entry((data & 0x0c) >> 2); } @@ -449,11 +448,10 @@ WRITE8_MEMBER(system1_state::videomode_w) machine().bookkeeping().coin_counter_w(0, data & 1); /* remaining signals are video-related */ - system1_videomode_w(space, 0, data); + common_videomode_w(space, 0, data); } - /************************************* * * DakkoChan House custom inputs @@ -474,7 +472,7 @@ CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_status_r) } -void system1_state::dakkochn_custom_w(uint8_t data, uint8_t prevdata) +void system1_state::dakkochn_custom_w(u8 data, u8 prevdata) { /* bit 1 toggling on clocks the mux; we store the previous state in the high bit of dakkochn_mux_data */ if ((data & 0x02) && !(prevdata & 0x02)) @@ -485,7 +483,6 @@ void system1_state::dakkochn_custom_w(uint8_t data, uint8_t prevdata) } - /************************************* * * Shooting Master gun input @@ -495,12 +492,11 @@ void system1_state::dakkochn_custom_w(uint8_t data, uint8_t prevdata) READ8_MEMBER(system1_state::shtngmst_gunx_r) { // x is slightly offset, and has a range of 00-fe - uint8_t x = ioport("GUNX")->read() - 0x12; + u8 x = ioport("GUNX")->read() - 0x12; return (x == 0xff) ? 0xfe : x; } - /************************************* * * Sound I/O @@ -518,7 +514,7 @@ WRITE8_MEMBER(system1_state::sound_control_w) m_soundcpu->set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); /* remaining bits are used for video RAM banking */ - system1_videoram_bank_w(space, offset, data); + videoram_bank_w(space, offset, data); } @@ -535,7 +531,7 @@ READ8_MEMBER(system1_state::sound_data_r) /* if we have a Z80 PIO, get the data from the port and toggle the strobe */ else if (m_pio != nullptr) { - uint8_t data = m_pio->port_read(z80pio_device::PORT_A); + u8 data = m_pio->port_read(z80pio_device::PORT_A); m_pio->strobe(z80pio_device::PORT_A, false); m_pio->strobe(z80pio_device::PORT_A, true); return data; @@ -560,7 +556,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(system1_state::soundirq_gen) } - /************************************* * * MCU I/O @@ -644,7 +639,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(system1_state::mcu_t0_callback) } - /************************************* * * nob MCU @@ -710,7 +704,6 @@ READ8_MEMBER(system1_state::nob_mcu_status_r) } - /************************************* * * nob bootleg protection @@ -742,7 +735,6 @@ WRITE8_MEMBER(system1_state::nobb_outport24_w) } - /************************************* * * Main CPU address maps @@ -756,12 +748,12 @@ void system1_state::system1_map(address_map &map) map(0x8000, 0xbfff).bankr("bank1"); map(0xc000, 0xcfff).ram().share("ram"); map(0xd000, 0xd7ff).ram().share("spriteram"); - map(0xd800, 0xdfff).ram().w(FUNC(system1_state::system1_paletteram_w)).share("palette"); - map(0xe000, 0xefff).rw(FUNC(system1_state::system1_videoram_r), FUNC(system1_state::system1_videoram_w)); - map(0xf000, 0xf3ff).rw(FUNC(system1_state::system1_mixer_collision_r), FUNC(system1_state::system1_mixer_collision_w)); - map(0xf400, 0xf7ff).w(FUNC(system1_state::system1_mixer_collision_reset_w)); - map(0xf800, 0xfbff).rw(FUNC(system1_state::system1_sprite_collision_r), FUNC(system1_state::system1_sprite_collision_w)); - map(0xfc00, 0xffff).w(FUNC(system1_state::system1_sprite_collision_reset_w)); + map(0xd800, 0xdfff).ram().w(FUNC(system1_state::paletteram_w)).share("paletteram"); + map(0xe000, 0xefff).rw(FUNC(system1_state::videoram_r), FUNC(system1_state::videoram_w)); + map(0xf000, 0xf3ff).rw(FUNC(system1_state::mixer_collision_r), FUNC(system1_state::mixer_collision_w)); + map(0xf400, 0xf7ff).w(FUNC(system1_state::mixer_collision_reset_w)); + map(0xf800, 0xfbff).rw(FUNC(system1_state::sprite_collision_r), FUNC(system1_state::sprite_collision_w)); + map(0xfc00, 0xffff).w(FUNC(system1_state::sprite_collision_reset_w)); } void system1_state::decrypted_opcodes_map(address_map &map) @@ -770,7 +762,7 @@ void system1_state::decrypted_opcodes_map(address_map &map) map(0x8000, 0xbfff).bankr("bank1"); map(0xc000, 0xcfff).ram().share("ram"); map(0xd000, 0xd7ff).ram().share("spriteram"); - map(0xd800, 0xdfff).ram().w(FUNC(system1_state::system1_paletteram_w)).share("palette"); + map(0xd800, 0xdfff).ram().w(FUNC(system1_state::paletteram_w)).share("paletteram"); } void system1_state::banked_decrypted_opcodes_map(address_map &map) @@ -779,7 +771,7 @@ void system1_state::banked_decrypted_opcodes_map(address_map &map) map(0x8000, 0xbfff).bankr("bank1d"); map(0xc000, 0xcfff).ram().share("ram"); map(0xd000, 0xd7ff).ram().share("spriteram"); - map(0xd800, 0xdfff).ram().w(FUNC(system1_state::system1_paletteram_w)).share("palette"); + map(0xd800, 0xdfff).ram().w(FUNC(system1_state::paletteram_w)).share("paletteram"); } /* same as normal System 1 except address map is shuffled (RAM/collision are swapped) */ @@ -787,13 +779,13 @@ void system1_state::nobo_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("bank1"); - map(0xc000, 0xc3ff).rw(FUNC(system1_state::system1_mixer_collision_r), FUNC(system1_state::system1_mixer_collision_w)); - map(0xc400, 0xc7ff).w(FUNC(system1_state::system1_mixer_collision_reset_w)); - map(0xc800, 0xcbff).rw(FUNC(system1_state::system1_sprite_collision_r), FUNC(system1_state::system1_sprite_collision_w)); - map(0xcc00, 0xcfff).w(FUNC(system1_state::system1_sprite_collision_reset_w)); + map(0xc000, 0xc3ff).rw(FUNC(system1_state::mixer_collision_r), FUNC(system1_state::mixer_collision_w)); + map(0xc400, 0xc7ff).w(FUNC(system1_state::mixer_collision_reset_w)); + map(0xc800, 0xcbff).rw(FUNC(system1_state::sprite_collision_r), FUNC(system1_state::sprite_collision_w)); + map(0xcc00, 0xcfff).w(FUNC(system1_state::sprite_collision_reset_w)); map(0xd000, 0xd7ff).ram().share("spriteram"); - map(0xd800, 0xdfff).ram().w(FUNC(system1_state::system1_paletteram_w)).share("palette"); - map(0xe000, 0xefff).rw(FUNC(system1_state::system1_videoram_r), FUNC(system1_state::system1_videoram_w)); + map(0xd800, 0xdfff).ram().w(FUNC(system1_state::paletteram_w)).share("paletteram"); + map(0xe000, 0xefff).rw(FUNC(system1_state::videoram_r), FUNC(system1_state::videoram_w)); map(0xf000, 0xffff).ram().share("ram"); } @@ -824,7 +816,6 @@ void system1_state::system1_pio_io_map(address_map &map) } - /************************************* * * Sound CPU address maps @@ -841,7 +832,6 @@ void system1_state::sound_map(address_map &map) } - /************************************* * * MCU address maps @@ -854,7 +844,6 @@ void system1_state::mcu_io_map(address_map &map) } - /************************************* * * Generic port definitions @@ -2188,7 +2177,7 @@ void system1_state::sys1ppi(machine_config &config) m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_system1); - PALETTE(config, m_palette).set_format(palette_device::BGR_233, 2048); + PALETTE(config, m_palette, FUNC(system1_state::system1_palette)).set_entries(2048, 256); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -2626,7 +2615,7 @@ ROM_START( starjack ) ROM_LOAD( "epr-5318.86", 0x0000, 0x4000, CRC(6f2e1fd3) SHA1(326d538551245fce67d0fdba85975e27093b7a93) ) ROM_LOAD( "epr-5319.93", 0x4000, 0x4000, CRC(ebee4999) SHA1(bb331be270dc1da63699533d9f02d73ce28f1bc5) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2654,7 +2643,7 @@ ROM_START( starjacks ) ROM_LOAD( "star_jacker_a1_ic86.86", 0x0000, 0x4000, CRC(6f2e1fd3) SHA1(326d538551245fce67d0fdba85975e27093b7a93) ) ROM_LOAD( "epr-5446.93", 0x4000, 0x4000, CRC(07987244) SHA1(8468b95684b1f62c6de6af1b1d405bfb333e4e26) ) /* Also found labeled as STAR JACKER A1 IC93 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2683,7 +2672,7 @@ ROM_START( upndown ) ROM_LOAD( "epr-5514.86", 0x0000, 0x4000, CRC(fcc0a88b) SHA1(ca7db3df10deb6720096e6c50eddd9b74c47f0a0) ) ROM_LOAD( "epr-5515.93", 0x4000, 0x4000, CRC(60908838) SHA1(aedff8ce07ab16942037e5aff212652e51c19e71) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2711,7 +2700,7 @@ ROM_START( upndownu ) ROM_LOAD( "epr-5514.86", 0x0000, 0x4000, CRC(fcc0a88b) SHA1(ca7db3df10deb6720096e6c50eddd9b74c47f0a0) ) ROM_LOAD( "epr-5515.93", 0x4000, 0x4000, CRC(60908838) SHA1(aedff8ce07ab16942037e5aff212652e51c19e71) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2740,7 +2729,7 @@ ROM_START( regulus ) ROM_LOAD( "epr-5638.86", 0x0000, 0x4000, CRC(617363dd) SHA1(c8024f541086a8a940e21219fa4522646aeb365a) ) ROM_LOAD( "epr-5639.93", 0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2768,7 +2757,7 @@ ROM_START( reguluso ) ROM_LOAD( "epr-5638.86", 0x0000, 0x4000, CRC(617363dd) SHA1(c8024f541086a8a940e21219fa4522646aeb365a) ) ROM_LOAD( "epr-5639.93", 0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2796,7 +2785,7 @@ ROM_START( regulusu ) /* Sega game ID# 834-5328-02 REGULUS */ ROM_LOAD( "epr-5638.86", 0x0000, 0x4000, CRC(617363dd) SHA1(c8024f541086a8a940e21219fa4522646aeb365a) ) ROM_LOAD( "epr-5639.93", 0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2825,7 +2814,7 @@ ROM_START( mrviking ) ROM_LOAD( "epr-5749.86", 0x0000, 0x4000, CRC(e24682cd) SHA1(3f626f3e5e2db486ccf727e9869ab488643b4a8c) ) ROM_LOAD( "epr-5750.93", 0x4000, 0x4000, CRC(6564d1ad) SHA1(f246afee7e73bc30054b0e5dcb83fa0edd2d2164) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2853,7 +2842,7 @@ ROM_START( mrvikingj ) ROM_LOAD( "epr-5749.86", 0x0000, 0x4000, CRC(e24682cd) SHA1(3f626f3e5e2db486ccf727e9869ab488643b4a8c) ) ROM_LOAD( "epr-5750.93", 0x4000, 0x4000, CRC(6564d1ad) SHA1(f246afee7e73bc30054b0e5dcb83fa0edd2d2164) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2882,7 +2871,7 @@ ROM_START( swat ) ROM_LOAD( "epr-5805.86", 0x0000, 0x4000, CRC(5a732865) SHA1(55c54e54f052187ddd957131e56400c9c432a6b2) ) ROM_LOAD( "epr-5806.93", 0x4000, 0x4000, CRC(26ac258c) SHA1(e4e9f929ab8ae7da74f885481cf94335d7553a1c) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2907,7 +2896,7 @@ ROM_START( flicky ) ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) ) ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2929,7 +2918,7 @@ ROM_START( flickya ) ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) ) ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2953,7 +2942,7 @@ ROM_START( flickys2 ) ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) ) ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -2979,7 +2968,7 @@ ROM_START( flickys1 ) ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) ) ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3005,7 +2994,7 @@ ROM_START( flickyo ) ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) ) ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3032,7 +3021,7 @@ ROM_START( flickyup ) ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) ) /* 27128-ic86 */ ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) ) /* 27128-ic93 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* location ic106 */ ROM_END @@ -3061,7 +3050,7 @@ ROM_START( wmatch ) ROM_LOAD( "wm.86", 0x0000, 0x4000, CRC(238ae0e5) SHA1(af18cfe7f8103358a0ce2aef9bbd949fdc0bfbfc) ) ROM_LOAD( "wm.93", 0x4000, 0x4000, CRC(a2f19170) SHA1(47dacc380b09c6365c737d320145cedad54ecedb) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3090,7 +3079,7 @@ ROM_START( bullfgt ) ROM_LOAD( "epr-6069.86", 0x0000, 0x4000, CRC(fe691e41) SHA1(90faf26685202e2a25bb3024750456014d0722b3) ) /* epr-6069.86 */ ROM_LOAD( "epr-6070.93", 0x4000, 0x4000, CRC(34f080df) SHA1(0e7d28e3325c8c3f06438fde29ea0ffe57fc325f) ) /* epr-6070.93 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -3115,7 +3104,7 @@ ROM_START( thetogyu ) ROM_LOAD( "epr-6069.117", 0x0000, 0x4000, CRC(fe691e41) SHA1(90faf26685202e2a25bb3024750456014d0722b3) ) ROM_LOAD( "epr-6070.110", 0x4000, 0x4000, CRC(34f080df) SHA1(0e7d28e3325c8c3f06438fde29ea0ffe57fc325f) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3143,7 +3132,7 @@ ROM_START( spatter ) ROM_LOAD( "epr-6307.05", 0x8000, 0x4000, CRC(0a5ad543) SHA1(5acada30c1affc4ffbebc8365a9ba4465f213d47) ) ROM_LOAD( "epr-6309.110", 0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -3170,7 +3159,7 @@ ROM_START( spattera ) ROM_LOAD( "epr-6307.05", 0x8000, 0x4000, CRC(0a5ad543) SHA1(5acada30c1affc4ffbebc8365a9ba4465f213d47) ) ROM_LOAD( "epr-6309.110", 0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -3197,7 +3186,7 @@ ROM_START( ssanchan ) ROM_LOAD( "epr-6307.05", 0x8000, 0x4000, CRC(0a5ad543) SHA1(5acada30c1affc4ffbebc8365a9ba4465f213d47) ) ROM_LOAD( "epr-6309.110", 0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -3223,7 +3212,7 @@ ROM_START( pitfall2 ) ROM_LOAD( "epr-6454a.117", 0x0000, 0x4000, CRC(a5d96780) SHA1(e0571f6fd031bbe2d971c3be7b96a017b0ea4be9) ) ROM_LOAD( "epr-6455.05", 0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3248,7 +3237,7 @@ ROM_START( pitfall2a ) ROM_LOAD( "epr-6454a.117", 0x0000, 0x4000, CRC(a5d96780) SHA1(e0571f6fd031bbe2d971c3be7b96a017b0ea4be9) ) ROM_LOAD( "epr-6455.05", 0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3273,7 +3262,7 @@ ROM_START( pitfall2u ) ROM_LOAD( "epr-6454a.117", 0x0000, 0x4000, CRC(a5d96780) SHA1(e0571f6fd031bbe2d971c3be7b96a017b0ea4be9) ) ROM_LOAD( "epr-6455.05", 0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3301,7 +3290,7 @@ ROM_START( seganinj ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) ROM_LOAD( "epr-6549a.05", 0xc000, 0x4000, CRC(7c51488c) SHA1(adc835d86e8b51ac47b8619655b3cc2c01aa8c7a) ) // note 'a' revision - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3328,7 +3317,7 @@ ROM_START( seganinju ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3355,7 +3344,7 @@ ROM_START( seganinja ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3385,7 +3374,7 @@ ROM_START( nprinces ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) /* epr-6547.4 */ ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) /* epr-6549.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -3412,7 +3401,7 @@ ROM_START( nprinceso ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3442,7 +3431,7 @@ ROM_START( nprincesu ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) /* epr-6547.4 */ ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) /* epr-6549.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3469,7 +3458,7 @@ ROM_START( nprincesb ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) - ROM_REGION( 0x0220, "proms", 0 ) + ROM_REGION( 0x0220, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_LOAD( "nprinces.129", 0x0100, 0x0100, CRC(ae765f62) SHA1(9434b5a23d118a9c62015b479719826b38269cd4) ) /* decryption table (not used) */ ROM_LOAD( "nprinces.123", 0x0200, 0x0020, CRC(ed5146e9) SHA1(7044035c07636e4029f4b746c1a92e15173869e9) ) /* decryption table (not used) */ @@ -3498,7 +3487,7 @@ ROM_START( ninja ) ROM_LOAD( "epr-6547.110", 0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) ROM_LOAD( "epr-6549.05", 0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3524,7 +3513,7 @@ ROM_START( imsorry ) ROM_LOAD( "epr-6645.117", 0x0000, 0x4000, CRC(1ba167ee) SHA1(5a105cc3112f2533e7c5982233405d365402fba2) ) ROM_LOAD( "epr-6646.04", 0x4000, 0x4000, CRC(edda7ad6) SHA1(eef7dcde632787283c4cb522380b138060018204) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3549,7 +3538,7 @@ ROM_START( imsorryj ) ROM_LOAD( "epr-6645.117", 0x0000, 0x4000, CRC(1ba167ee) SHA1(5a105cc3112f2533e7c5982233405d365402fba2) ) ROM_LOAD( "epr-6646.04", 0x4000, 0x4000, CRC(edda7ad6) SHA1(eef7dcde632787283c4cb522380b138060018204) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3577,7 +3566,7 @@ ROM_START( teddybb ) ROM_LOAD( "epr-6736.110", 0x8000, 0x4000, CRC(565c25d0) SHA1(5ae524ef01138c5042b223286d65eb9043c0f0d5) ) ROM_LOAD( "epr-6738.05", 0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3604,7 +3593,7 @@ ROM_START( teddybbo ) ROM_LOAD( "epr-6736.110", 0x8000, 0x4000, CRC(565c25d0) SHA1(5ae524ef01138c5042b223286d65eb9043c0f0d5) ) ROM_LOAD( "epr-6738.05", 0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3629,7 +3618,7 @@ ROM_START( teddybbobl ) // data in romset is an exact match for teddybbo, includ ROM_LOAD( "5.h3", 0x8000, 0x4000, CRC(565c25d0) SHA1(5ae524ef01138c5042b223286d65eb9043c0f0d5) ) ROM_LOAD( "7.m3", 0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_REGION( 0x0100, "promsbl", 0 ) @@ -3660,12 +3649,12 @@ ROM_START( hvymetal ) ROM_LOAD( "epr-6780.4", 0x10000, 0x8000, CRC(55b31df5) SHA1(aa1ce0b1666e17db196bd1e079691fbe433a9226) ) ROM_LOAD( "epr-6779.5", 0x18000, 0x8000, CRC(e03a2b28) SHA1(7e742c09e832d01f74fe4025d194cbc8d2f24b70) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr7036.3", 0x0000, 0x0100, CRC(146f16fb) SHA1(0a2ac871383b115c16491b9ba5973f0d363eac49) ) /* palette red component */ ROM_LOAD( "pr7035.2", 0x0100, 0x0100, CRC(50b201ed) SHA1(14c3a585c083dc387532d64bfd63e34f5220e6de) ) /* palette green component */ ROM_LOAD( "pr7034.1", 0x0200, 0x0100, CRC(dfb5f139) SHA1(56cba261819fd5f2beab56ffd80bb3fd328efe3e) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317p.4", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3693,7 +3682,7 @@ ROM_START( myhero ) ROM_LOAD( "epr-6922.110", 0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) ) ROM_LOAD( "epr-6924.05", 0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3720,7 +3709,7 @@ ROM_START( sscandal ) ROM_LOAD( "epr-6922.110", 0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) ) ROM_LOAD( "epr-6924.05", 0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3745,7 +3734,7 @@ ROM_START( myherobl ) ROM_LOAD( "x.g4", 0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) ) ROM_LOAD( "b7.k4", 0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) ) - ROM_REGION( 0x0100, "proms", 0 ) // wasn't dumped here, but needed for priority + ROM_REGION( 0x0100, "lookup_proms", 0 ) // wasn't dumped here, but needed for priority ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_REGION( 0x0100, "promsbl", 0 ) // this is related to the bootleg reproduction of the encryption scheme @@ -3778,7 +3767,7 @@ ROM_START( myherok ) ROM_LOAD( "epr-6922.110", 0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) ) ROM_LOAD( "epr-6924.05", 0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3806,7 +3795,7 @@ ROM_START( 4dwarrio ) ROM_LOAD( "4d.110", 0x8000, 0x4000, CRC(6ec5990a) SHA1(a26dbd470744c38a26a016e5d4792ac2f2b9bc4b) ) ROM_LOAD( "4d.05", 0xc000, 0x4000, CRC(f31a1e6a) SHA1(f49dbc4b381e7096d5ffe3c16660dd63121dabf7) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -3846,12 +3835,12 @@ ROM_START( shtngmst ) ROM_LOAD( "epr-7107.ic23", 0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) ) /* These proms are located on the main board. */ - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "epr-7113.ic20", 0x00000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */ ROM_LOAD( "epr-7112.ic14", 0x00100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */ ROM_LOAD( "epr-7111.ic8", 0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.ic37", 0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* N82S129AN */ /* These pld's are located on the main board. */ @@ -3916,12 +3905,12 @@ ROM_START( shtngmste ) ROM_LOAD( "epr-7105.ic21", 0x28000, 0x8000, CRC(13111729) SHA1(57ca2b945db36b056d0e40a39456fd8bf9d0a3ec) ) ROM_LOAD( "epr-7107.ic23", 0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "epr-7113.ic20", 0x00000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */ ROM_LOAD( "epr-7112.ic14", 0x00100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */ ROM_LOAD( "epr-7111.ic8", 0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.ic37", 0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* N82S129AN */ ROM_REGION( 0x0400, "plds", 0 ) @@ -3959,12 +3948,12 @@ ROM_START( choplift ) ROM_LOAD( "epr-7123.ic89", 0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) ) ROM_LOAD( "epr-7122.ic88", 0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr7119.ic20", 0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */ ROM_LOAD( "pr7118.ic14", 0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */ ROM_LOAD( "pr7117.ic8", 0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.ic28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_REGION( 0x0618, "plds", 0 ) @@ -4003,12 +3992,12 @@ ROM_START( chopliftu ) ROM_LOAD( "epr-7123.ic89", 0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) ) ROM_LOAD( "epr-7122.ic88", 0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr7119.ic20", 0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */ ROM_LOAD( "pr7118.ic14", 0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */ ROM_LOAD( "pr7117.ic8", 0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.ic28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_REGION( 0x0618, "plds", 0 ) @@ -4084,12 +4073,12 @@ ROM_START( chopliftbl ) ROM_LOAD( "epr-7123.89", 0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) ) ROM_LOAD( "epr-7122.88", 0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr7119.20", 0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */ ROM_LOAD( "pr7118.14", 0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */ ROM_LOAD( "pr7117.8", 0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_REGION( 0x0003, "plds_main", 0 ) @@ -4140,7 +4129,7 @@ ROM_START( raflesia ) ROM_LOAD( "epr-7408.110", 0x8000, 0x4000, CRC(3189f33c) SHA1(8476c2c01920f0492cf643929d4f023f3afe0164) ) /* epr-7408.4 */ ROM_LOAD( "epr-7410.05", 0xc000, 0x4000, CRC(ced74789) SHA1(d0ad845bfe83412ac8d43125e1c50d0581a5b47e) ) /* epr-7410.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -4168,7 +4157,7 @@ ROM_START( wboy ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4197,7 +4186,7 @@ ROM_START( wboyub ) // seems to be the same as 'wboy' but a different rom layout ROM_LOAD( "5.bin", 0x4000, 0x4000, CRC(b75278e7) SHA1(5b7c519f32eac40dc46ca5bba03cec1e893b6fcd) ) ROM_CONTINUE(0xc000,0x4000) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4231,7 +4220,7 @@ ROM_START( wboyo ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4261,7 +4250,7 @@ ROM_START( wboy2 ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */ ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -4291,7 +4280,7 @@ ROM_START( wboy2u ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */ ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -4318,7 +4307,7 @@ ROM_START( wboy3 ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4352,7 +4341,7 @@ ROM_START( wboy4 ) ROM_LOAD( "epr-7578.87", 0x00000, 0x8000, CRC(6ff1637f) SHA1(9a6ddbd7b8d53273b30c3529b028c1f28bf3c63b) ) // epr7577.ic110 ROM_LOAD( "epr-7577.86", 0x08000, 0x8000, CRC(58b3705e) SHA1(1a8ff3f1765a3b21145bd1a6c85441f806f7b17d) ) // epr7576.ic117 - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4379,7 +4368,7 @@ ROM_START( wboy5 ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76",0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4409,7 +4398,7 @@ ROM_START( wboy6 ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */ ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -4436,7 +4425,7 @@ ROM_START( wboyu ) ROM_LOAD( "ic110_86.bin", 0x8000, 0x4000, CRC(26d0fac4) SHA1(2e6a06f6850b2d19e3dd7dcdc6b700d0eda878cb) ) ROM_LOAD( "ic005_88.bin", 0xc000, 0x4000, CRC(2602e519) SHA1(00e94ec7ae37b5063137d4d49af7806fb0357c4b) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4458,12 +4447,12 @@ ROM_START( wboysys2 ) ROM_LOAD( "epr-7578.87", 0x00000, 0x8000, CRC(6ff1637f) SHA1(9a6ddbd7b8d53273b30c3529b028c1f28bf3c63b) ) ROM_LOAD( "epr-7577.86", 0x08000, 0x8000, CRC(58b3705e) SHA1(1a8ff3f1765a3b21145bd1a6c85441f806f7b17d) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr-7345.ic20", 0x0000, 0x0100, CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* palette red component */ ROM_LOAD( "pr-7344.ic14", 0x0100, 0x0100, CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* palette green component */ ROM_LOAD( "pr-7343.ic8", 0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4484,12 +4473,12 @@ ROM_START( wboysys2a ) ROM_LOAD( "epr-7578.87", 0x00000, 0x8000, CRC(6ff1637f) SHA1(9a6ddbd7b8d53273b30c3529b028c1f28bf3c63b) ) ROM_LOAD( "epr-7577.86", 0x08000, 0x8000, CRC(58b3705e) SHA1(1a8ff3f1765a3b21145bd1a6c85441f806f7b17d) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr-7345.20", 0x0000, 0x0100, CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* palette red component */ ROM_LOAD( "pr-7344.14", 0x0100, 0x0100, CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* palette green component */ ROM_LOAD( "pr-7343.8", 0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4519,7 +4508,7 @@ ROM_START( wbdeluxe ) ROM_LOAD( "epr-7486.110", 0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */ ROM_LOAD( "epr-7488.05", 0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.106", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* pr-5317.106 */ ROM_END @@ -4544,12 +4533,12 @@ ROM_START( gardia ) /* Factory conversion, Sega game ID# 834-6119-04 GARDIA (CVT ROM_LOAD( "epr-10236.04", 0x10000, 0x8000, CRC(b35ab227) SHA1(616f6097afddffa9af89fe84d8b6df59c567c1e6) ) ROM_LOAD( "epr-10235.5", 0x18000, 0x8000, CRC(006a3151) SHA1(a575f9d5c026e6b18e990720ec7520b6b5ae94e3) ) - ROM_REGION( 0x0300, "palette", 0 ) /* BPROMs located on a Sega 834-5755 daughter card (N82S129AN or equivalent) */ + ROM_REGION( 0x0300, "color_proms", 0 ) /* BPROMs located on a Sega 834-5755 daughter card (N82S129AN or equivalent) */ ROM_LOAD( "pr-7345.3", 0x0000, 0x0100, CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* palette red component */ ROM_LOAD( "pr-7344.2", 0x0100, 0x0100, CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* palette green component */ ROM_LOAD( "pr-7343.1", 0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) /* BPROM located on a Sega 834-5755 daughter card */ + ROM_REGION( 0x0100, "lookup_proms", 0 ) /* BPROM located on a Sega 834-5755 daughter card */ ROM_LOAD( "pr5317.4", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4573,12 +4562,12 @@ ROM_START( gardiab ) ROM_LOAD( "epr-10236.04", 0x10000, 0x8000, CRC(b35ab227) SHA1(616f6097afddffa9af89fe84d8b6df59c567c1e6) ) ROM_LOAD( "epr-10235.5", 0x18000, 0x8000, CRC(006a3151) SHA1(a575f9d5c026e6b18e990720ec7520b6b5ae94e3) ) - ROM_REGION( 0x0300, "palette", 0 ) /* BPROMs are N82S129AN or equivalent */ + ROM_REGION( 0x0300, "color_proms", 0 ) /* BPROMs are N82S129AN or equivalent */ ROM_LOAD( "pr-7345.3", 0x0000, 0x0100, CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* palette red component */ ROM_LOAD( "pr-7344.2", 0x0100, 0x0100, CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* palette green component */ ROM_LOAD( "pr-7343.1", 0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.4", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4602,12 +4591,12 @@ ROM_START( gardiaj ) /* Sega game ID# 834-6119-02 GARDIA */ ROM_LOAD( "epr-10236.ic89", 0x10000, 0x8000, CRC(b35ab227) SHA1(616f6097afddffa9af89fe84d8b6df59c567c1e6) ) ROM_LOAD( "epr-10235.ic88", 0x18000, 0x8000, CRC(006a3151) SHA1(a575f9d5c026e6b18e990720ec7520b6b5ae94e3) ) - ROM_REGION( 0x0300, "palette", 0 ) /* BPROMs are N82S129AN or equivalent */ + ROM_REGION( 0x0300, "color_proms", 0 ) /* BPROMs are N82S129AN or equivalent */ ROM_LOAD( "pr-7345.ic20", 0x0000, 0x0100, CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* palette red component */ ROM_LOAD( "pr-7344.ic14", 0x0100, 0x0100, CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* palette green component */ ROM_LOAD( "pr-7343.ic8", 0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.ic28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* MB7114E */ ROM_REGION( 0x0400, "plds", 0 ) @@ -4638,12 +4627,12 @@ ROM_START( brain ) ROM_LOAD( "brain.4", 0x10000, 0x8000, CRC(fd2ea53b) SHA1(c7f2d267f19d2c27a550120e003ebfcb10d8af89) ) /* 18000-1ffff empty */ - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "bprom.3", 0x0000, 0x0100, BAD_DUMP CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* palette red component */ ROM_LOAD( "bprom.2", 0x0100, 0x0100, BAD_DUMP CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* palette green component */ ROM_LOAD( "bprom.1", 0x0200, 0x0100, BAD_DUMP CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4671,12 +4660,12 @@ ROM_START( tokisens ) /* Sega game ID# 834-6409 - Sega MC-8123, 317-0040 */ ROM_LOAD( "epr-10960.ic89", 0x10000, 0x8000, CRC(880e0d44) SHA1(2b2dc144807d1d048ffe81bfd33a77ccf618dd3e) ) ROM_LOAD( "epr-10959.ic88", 0x18000, 0x8000, CRC(4deda48f) SHA1(12db2a69286f22cd8243be6faa9a075fafec1dfd) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr10956.ic20", 0x0000, 0x0100, CRC(fd1bba8a) SHA1(4a38239d89f70291df71976b18be49fb24f071ca) ) /* MMI 63S141AN - palette red component */ ROM_LOAD( "pr10955.ic14", 0x0100, 0x0100, CRC(72b35df7) SHA1(ef782fb7012c359ed7ca8f4ab42734c4994e473a) ) /* MMI 63S141AN - palette green component */ ROM_LOAD( "pr10954.ic8", 0x0200, 0x0100, CRC(b7984867) SHA1(8a03cc98c33e4defe880d10a02a5d0108fa0c9da) ) /* MMI 63S141AN - palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.ic28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* BPROM type N82S129AN or compatible */ ROM_END @@ -4700,12 +4689,12 @@ ROM_START( tokisensa ) ROM_LOAD( "epr-10960.ic89", 0x10000, 0x8000, CRC(880e0d44) SHA1(2b2dc144807d1d048ffe81bfd33a77ccf618dd3e) ) ROM_LOAD( "epr-10959.ic88", 0x18000, 0x8000, CRC(4deda48f) SHA1(12db2a69286f22cd8243be6faa9a075fafec1dfd) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "ic20", 0x0000, 0x0100, CRC(8eee0f72) SHA1(b5694c120f604a5f7cc95618a71ab16a1a6151ed) ) /* MMI 63S141AN - palette red component */ ROM_LOAD( "ic14", 0x0100, 0x0100, CRC(3e7babd7) SHA1(d4f8790db4dce75e27156a4c6de2dcef2baf6d76) ) /* MMI 63S141AN - palette green component */ ROM_LOAD( "ic8", 0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* MMI 63S141AN - palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.ic28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4733,12 +4722,12 @@ ROM_START( wbml ) /* Sega game ID# 834-6409 MONSTER LAND */ ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4765,12 +4754,12 @@ ROM_START( wbmljo ) /* Sega game ID# 834-6409 MONSTER LAND */ ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4795,12 +4784,12 @@ ROM_START( wbmld ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4824,12 +4813,12 @@ ROM_START( wbmljod ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4857,12 +4846,12 @@ ROM_START( wbmljb ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4889,12 +4878,12 @@ ROM_START( wbmlb ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4921,12 +4910,12 @@ ROM_START( wbmlbg ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4954,12 +4943,12 @@ ROM_START( wbmlbge ) ROM_LOAD( "7.k1", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "6.k1", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "3.z8", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "2.y8", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "1.x8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -4986,12 +4975,12 @@ ROM_START( wbmlvc ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5015,12 +5004,12 @@ ROM_START( wbmlvcd ) ROM_LOAD( "epr-11030.89", 0x10000, 0x8000, CRC(f05ffc76) SHA1(f3dbb518240f86430840c3d4cda04bac79c20f69) ) ROM_LOAD( "epr-11029.88", 0x18000, 0x8000, CRC(cedc9c61) SHA1(dbe5744f9b6f2a406b52b910dd4e133db7bce6b2) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11026.20", 0x0000, 0x0100, CRC(27057298) SHA1(654be7abb937bb0720263ee6512e31194662effe) ) ROM_LOAD( "pr11025.14", 0x0100, 0x0100, CRC(41e4d86b) SHA1(a86e8bb0a465d01b04410edfbb82eb96f12b909f) ) ROM_LOAD( "pr11024.8", 0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5047,12 +5036,12 @@ ROM_START( dakkochn ) ROM_LOAD( "epr-11223.ic89", 0x10000, 0x8000, CRC(538adc55) SHA1(542af53a56f580e5ab455aa6bed955ee5fd4a252) ) ROM_LOAD( "epr-11222.ic88", 0x18000, 0x8000, CRC(33fab0b2) SHA1(eb3c08009315e46590c2c0df17fc3fa391034c66) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr-11219.ic20", 0x0000, 0x0100, CRC(45e252d9) SHA1(92d8f1d0f1a9e65234521ce02d512f08b5e06d78) ) /* palette red component */ ROM_LOAD( "pr-11218.ic14", 0x0100, 0x0100, CRC(3eda3a1b) SHA1(cc98c792521845259088eb163a150cd5bb603d5d) ) /* palette green component */ ROM_LOAD( "pr-11217.ic8", 0x0200, 0x0100, CRC(49dbde88) SHA1(7057da5617de7e4775adf092cce1709135066129) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr-5317.ic37", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_REGION( 0x00e7, "plds", 0 ) @@ -5083,12 +5072,12 @@ ROM_START( ufosensi ) ROM_LOAD( "epr-11660.89", 0x10000, 0x8000, CRC(e1e2e7c5) SHA1(434039a70049a6e74e2a2f48b60345f720e6b1af) ) ROM_LOAD( "epr-11659.88", 0x18000, 0x8000, CRC(286c7286) SHA1(449a19ea9a9f9df47005e8dac1b8eacaebc515e7) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11656.20", 0x0000, 0x0100, CRC(640740eb) SHA1(9a601a3665f612d00c70019d33c7abd3cca9434b) ) /* palette red component */ ROM_LOAD( "pr11655.14", 0x0100, 0x0100, CRC(a0c3fa77) SHA1(cdffa1de06d30ec421323145dfc3271803fc25d4) ) /* palette green component */ ROM_LOAD( "pr11654.8", 0x0200, 0x0100, CRC(ba624305) SHA1(eb1d0dde60f81ff510ac8c1212e0ed5703febaf3) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5115,12 +5104,12 @@ ROM_START( ufosensib ) ROM_LOAD( "epr-11660.89", 0x10000, 0x8000, CRC(e1e2e7c5) SHA1(434039a70049a6e74e2a2f48b60345f720e6b1af) ) /* label on chip is "k107.ic17.2-3s" */ ROM_LOAD( "epr-11659.88", 0x18000, 0x8000, CRC(286c7286) SHA1(449a19ea9a9f9df47005e8dac1b8eacaebc515e7) ) /* label on chip is "k106.ic16.2s" */ - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "pr11656.20", 0x0000, 0x0100, CRC(640740eb) SHA1(9a601a3665f612d00c70019d33c7abd3cca9434b) ) /* palette red component - label on chip is "74s287.ic134.9f" */ ROM_LOAD( "pr11655.14", 0x0100, 0x0100, CRC(a0c3fa77) SHA1(cdffa1de06d30ec421323145dfc3271803fc25d4) ) /* palette green component - label on chip is "74s287.ic133.9e" */ ROM_LOAD( "pr11654.8", 0x0200, 0x0100, CRC(ba624305) SHA1(eb1d0dde60f81ff510ac8c1212e0ed5703febaf3) ) /* palette blue component - label on chip is "74s287.ic132.9d" */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.28", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* label on chip is "74s287.ic115.8j" */ ROM_REGION( 0x2000, "plds", 0 ) @@ -5162,7 +5151,7 @@ ROM_START( blockgal ) ROM_LOAD( "bg.110", 0x8000, 0x4000, CRC(064c812c) SHA1(673790dc5131fd280333386a0e9915fb94e9f3e1) ) ROM_LOAD( "bg.05", 0xc000, 0x4000, CRC(02e0b040) SHA1(fb626fc31dfe25bf9fac0c8d76d5041609b06e82) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5188,7 +5177,7 @@ ROM_START( blockgalb ) ROM_LOAD( "bg.110", 0x8000, 0x4000, CRC(064c812c) SHA1(673790dc5131fd280333386a0e9915fb94e9f3e1) ) ROM_LOAD( "bg.05", 0xc000, 0x4000, CRC(02e0b040) SHA1(fb626fc31dfe25bf9fac0c8d76d5041609b06e82) ) - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "pr5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5295,13 +5284,13 @@ ROM_START( nob ) ROM_LOAD( "dm05.5h", 0x10000, 0x8000, CRC(7fbba01d) SHA1(ded22806ae0d6642b45cd33c0ceab67390a6e319) ) ROM_LOAD( "dm07.5l", 0x18000, 0x8000, CRC(85e7a29f) SHA1(0ca77c66599650f157450d703682ec114f0453cf) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) /* the first 2 proms were missing from the dump, but are clearly needed... */ ROM_LOAD( "nobo_pr.16d", 0x0000, 0x0100, CRC(95010ac2) SHA1(deaf84b408cd1f3396eb851ef04cc1654d5e9a46) ) /* palette red component */ ROM_LOAD( "nobo_pr.15d", 0x0100, 0x0100, CRC(c55aac0c) SHA1(0f7f2d383a90e9f7f319626b4d5565805f44a1f9) ) /* palette green component */ ROM_LOAD( "dm-12.ic3", 0x0200, 0x0100, CRC(de394cee) SHA1(511c53f22459e5e238b48685f85b10f5e15f2ac1) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "dc-11.6a", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5326,12 +5315,12 @@ ROM_END ROM_LOAD( "nobo-p.bin", 0x10000, 0x8000, CRC(7fbba01d) SHA1(ded22806ae0d6642b45cd33c0ceab67390a6e319) ) ROM_LOAD( "nobo-n.bin", 0x18000, 0x8000, CRC(85e7a29f) SHA1(0ca77c66599650f157450d703682ec114f0453cf) ) - ROM_REGION( 0x0300, "palette", 0 ) + ROM_REGION( 0x0300, "color_proms", 0 ) ROM_LOAD( "nobo_pr.16d", 0x0000, 0x0100, CRC(95010ac2) SHA1(deaf84b408cd1f3396eb851ef04cc1654d5e9a46) ) /* palette red component */ ROM_LOAD( "nobo_pr.15d", 0x0100, 0x0100, CRC(c55aac0c) SHA1(0f7f2d383a90e9f7f319626b4d5565805f44a1f9) ) /* palette green component */ ROM_LOAD( "nobo_pr.14d", 0x0200, 0x0100, CRC(de394cee) SHA1(511c53f22459e5e238b48685f85b10f5e15f2ac1) ) /* palette blue component */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0100, "lookup_proms", 0 ) ROM_LOAD( "nobo_pr.13a", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) ROM_END @@ -5366,7 +5355,7 @@ void system1_state::init_myherok() // probably bootleg? int A; - uint8_t *rom; + u8 *rom; /* additionally to the usual protection, all the program ROMs have data lines */ /* D0 and D1 swapped. */ @@ -5393,7 +5382,7 @@ void system1_state::init_myherok() for (A = 0;A < 0xc000;A++) { int A1; - uint8_t temp; + u8 temp; A1 = (A & 0xffcf) | ((A & 0x0010) << 1) | ((A & 0x0020) >> 1); if (A < A1) @@ -5419,7 +5408,7 @@ void system1_state::init_blockgal() void system1_state::init_wbml() { init_bank0c(); - m_banked_decrypted_opcodes = std::make_unique<uint8_t[]>(m_maincpu_region->bytes()); + m_banked_decrypted_opcodes = std::make_unique<u8[]>(m_maincpu_region->bytes()); downcast<mc8123_device &>(*m_maincpu).decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), m_maincpu_region->bytes()); } @@ -5434,7 +5423,7 @@ void system1_state::init_tokisens() void system1_state::init_dakkochn() { m_videomode_custom = &system1_state::dakkochn_custom_w; - m_banked_decrypted_opcodes = std::make_unique<uint8_t[]>(m_maincpu_region->bytes()); + m_banked_decrypted_opcodes = std::make_unique<u8[]>(m_maincpu_region->bytes()); downcast<mc8123_device &>(*m_maincpu).decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), m_maincpu_region->bytes()); } @@ -5468,7 +5457,7 @@ void system1_state::init_nobb() /* Patch to get PRG ROMS ('T', 'R' and 'S) status as "GOOD" in the "test mode" */ /* not really needed */ -// uint8_t *ROM = m_maincpu_region->base(); +// u8 *ROM = m_maincpu_region->base(); // ROM[0x3296] = 0x18; // 'jr' instead of 'jr z' - 'T' (PRG Main ROM) // ROM[0x32be] = 0x18; // 'jr' instead of 'jr z' - 'R' (Banked ROM 1) @@ -5481,7 +5470,7 @@ void system1_state::init_nobb() /* Patch to get sound in later levels(the program enters into a tight loop)*/ address_space &iospace = m_maincpu->space(AS_IO); - uint8_t *ROM2 = memregion("soundcpu")->base(); + u8 *ROM2 = memregion("soundcpu")->base(); ROM2[0x02f9] = 0x28;//'jr z' instead of 'jr' @@ -5583,7 +5572,7 @@ GAME( 1985, teddybbobl, teddybb, sys1piox_315_5155, teddybb, system1_state, i GAME( 1985, myhero, 0, sys1pio, myhero, system1_state, init_bank00, ROT0, "Coreland / Sega", "My Hero (US, not encrypted)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, sscandal, myhero, sys1piox_315_5132, myhero, system1_state, init_bank00, ROT0, "Coreland / Sega", "Seishun Scandal (315-5132, Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, myherobl, myhero, sys1piox_315_5132, myhero, system1_state, init_bank00, ROT0, "bootleg", "My Hero (bootleg, 315-5132 encryption)", MACHINE_SUPPORTS_SAVE ) // cloned 315-5132 encryption? might be a direct copy of an undumped original set -GAME( 1985, myherok, myhero, sys1piox_315_5132, myhero, system1_state, init_myherok, ROT0, "Coreland / Sega", "My Hero (Korea)", MACHINE_SUPPORTS_SAVE ) // possible bootleg, has extra encryption +GAME( 1985, myherok, myhero, sys1piox_315_5132, myhero, system1_state, init_myherok, ROT0, "Coreland / Sega", "Cheongchun Ilbeonji (Korea)", MACHINE_SUPPORTS_SAVE ) // possible bootleg, has extra encryption GAME( 1985, 4dwarrio, 0, sys1piox_315_5162, 4dwarrio, system1_state, init_bank00, ROT0, "Coreland / Sega", "4-D Warriors (315-5162)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, raflesia, 0, sys1piox_315_5162, raflesia, system1_state, init_bank00, ROT270, "Coreland / Sega", "Rafflesia (315-5162)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, wboy, 0, sys1piox_315_5177, wboy, system1_state, init_bank00, ROT0, "Escape (Sega license)", "Wonder Boy (set 1, 315-5177)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/taitogn.cpp b/src/mame/drivers/taitogn.cpp index daa6287a986..de9db486740 100644 --- a/src/mame/drivers/taitogn.cpp +++ b/src/mame/drivers/taitogn.cpp @@ -330,34 +330,21 @@ Type 3 (PCMCIA Compact Flash Adaptor + Compact Flash card, sealed together with */ #include "emu.h" -#include "audio/taito_zm.h" +#include "includes/zn.h" -#include "cpu/psx/psx.h" -#include "machine/at28c16.h" #include "machine/ataflash.h" -#include "machine/bankdev.h" -#include "machine/cat702.h" #include "machine/intelfsh.h" -#include "machine/mb3773.h" -#include "machine/ram.h" #include "machine/rf5c296.h" -#include "machine/znmcu.h" -#include "sound/spu.h" -#include "video/psx.h" -#include "screen.h" -#include "speaker.h" -#include <algorithm> +// +// Taito GNET specific +// -class taitogn_state : public driver_device +class taitogn_state : public zn_state { public: taitogn_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_sio0(*this, "maincpu:sio0"), - m_cat702(*this, "cat702_%u", 1U), - m_znmcu(*this, "znmcu"), - m_maincpu(*this, "maincpu"), + zn_state(mconfig, type, tag), m_mn10200(*this, "taito_zoom:mn10200"), m_pccard(*this, "pccard"), m_flashbank(*this, "flashbank"), @@ -366,14 +353,13 @@ public: m_pgmflash(*this, "pgmflash"), m_sndflash(*this, "sndflash%u", 0U), m_jp1(*this, "JP1"), - m_has_zoom(true), - m_znmcu_dataout(1) + m_has_zoom(true) { - std::fill(std::begin(m_cat702_dataout), std::end(m_cat702_dataout), 1); } void init_coh3002t_nz(); + void base_config(machine_config &config); void coh3002t_t2_mp(machine_config &config); void coh3002t(machine_config &config); void coh3002t_t1_mp(machine_config &config); @@ -382,9 +368,6 @@ public: void coh3002t_t1(machine_config &config); private: - template<int Chip> DECLARE_WRITE_LINE_MEMBER(cat702_dataout) { m_cat702_dataout[Chip] = state; update_sio0_rxd(); } - DECLARE_WRITE_LINE_MEMBER(znmcu_dataout) { m_znmcu_dataout = state; update_sio0_rxd(); } - void update_sio0_rxd() { m_sio0->write_rxd(m_cat702_dataout[0] && m_cat702_dataout[1] && m_znmcu_dataout); } DECLARE_READ8_MEMBER(control_r); DECLARE_WRITE8_MEMBER(control_w); DECLARE_WRITE16_MEMBER(control2_w); @@ -393,25 +376,18 @@ private: DECLARE_READ16_MEMBER(gn_1fb70000_r); DECLARE_WRITE16_MEMBER(gn_1fb70000_w); DECLARE_READ16_MEMBER(hack1_r); - DECLARE_READ8_MEMBER(znsecsel_r); - DECLARE_WRITE8_MEMBER(znsecsel_w); - DECLARE_READ8_MEMBER(boardconfig_r); DECLARE_WRITE8_MEMBER(coin_w); DECLARE_READ8_MEMBER(coin_r); DECLARE_READ8_MEMBER(gnet_mahjong_panel_r); DECLARE_READ32_MEMBER(zsg2_ext_r); void flashbank_map(address_map &map); - void taitogn_map(address_map &map); - void taitogn_mp_map(address_map &map); + void main_map(address_map &map); + void main_mp_map(address_map &map); virtual void machine_start() override; virtual void machine_reset() override; - required_device<psxsio0_device> m_sio0; - required_device_array<cat702_device, 2> m_cat702; - required_device<znmcu_device> m_znmcu; - required_device<cpu_device> m_maincpu; required_device<cpu_device> m_mn10200; required_device<pccard_slot_device> m_pccard; required_device<address_map_bank_device> m_flashbank; @@ -427,15 +403,9 @@ private: uint8_t m_control3; int m_v; - uint8_t m_n_znsecsel; - uint8_t m_coin_info; - - int m_cat702_dataout[2]; - int m_znmcu_dataout; }; - // Misc. controls READ8_MEMBER(taitogn_state::control_r) @@ -513,7 +483,8 @@ READ16_MEMBER(taitogn_state::hack1_r) switch (offset) { case 0: - m_v = m_v ^ 8; + if (!machine().side_effects_disabled()) + m_v = m_v ^ 8; // Probably something to do with MCU return m_v; @@ -526,30 +497,6 @@ READ16_MEMBER(taitogn_state::hack1_r) -// Lifted from zn.c - -READ8_MEMBER(taitogn_state::znsecsel_r) -{ - return m_n_znsecsel; -} - -WRITE8_MEMBER(taitogn_state::znsecsel_w) -{ - m_cat702[0]->write_select(BIT(data, 2)); - m_cat702[1]->write_select(BIT(data, 3)); - m_znmcu->write_select((data & 0x8c) != 0x8c); - // BIT(data,4); // read analogue controls? - - m_n_znsecsel = data; -} - -READ8_MEMBER(taitogn_state::boardconfig_r) -{ - // see zn.c - return 64|32|8; -} - - WRITE8_MEMBER(taitogn_state::coin_w) { /* 0x01=counter @@ -605,14 +552,12 @@ READ32_MEMBER(taitogn_state::zsg2_ext_r) void taitogn_state::machine_start() { + zn_state::machine_start(); save_item(NAME(m_control)); save_item(NAME(m_control2)); save_item(NAME(m_control3)); save_item(NAME(m_v)); - save_item(NAME(m_n_znsecsel)); save_item(NAME(m_coin_info)); - save_item(NAME(m_cat702_dataout)); - save_item(NAME(m_znmcu_dataout)); } void taitogn_state::machine_reset() @@ -629,22 +574,15 @@ void taitogn_state::init_coh3002t_nz() m_has_zoom = false; } -void taitogn_state::taitogn_map(address_map &map) +void taitogn_state::main_map(address_map &map) { + zn_base_map(map); + map(0x1f000000, 0x1f7fffff).m(m_flashbank, FUNC(address_map_bank_device::amap16)); - map(0x1fa00000, 0x1fa00003).portr("P1"); - map(0x1fa00100, 0x1fa00103).portr("P2"); - map(0x1fa00200, 0x1fa00203).portr("SERVICE"); - map(0x1fa00300, 0x1fa00303).portr("SYSTEM"); - map(0x1fa10000, 0x1fa10003).portr("P3"); - map(0x1fa10100, 0x1fa10103).portr("P4"); - map(0x1fa10200, 0x1fa10200).r(FUNC(taitogn_state::boardconfig_r)); - map(0x1fa10300, 0x1fa10300).rw(FUNC(taitogn_state::znsecsel_r), FUNC(taitogn_state::znsecsel_w)); map(0x1fa20000, 0x1fa20000).rw(FUNC(taitogn_state::coin_r), FUNC(taitogn_state::coin_w)); map(0x1fa30000, 0x1fa30000).rw(FUNC(taitogn_state::control3_r), FUNC(taitogn_state::control3_w)); map(0x1fa51c00, 0x1fa51dff).nopr(); // systematic read at spu_address + 250000, result dropped, maybe other accesses map(0x1fa60000, 0x1fa60003).r(FUNC(taitogn_state::hack1_r)); - map(0x1faf0000, 0x1faf07ff).rw("at28c16", FUNC(at28c16_device::read), FUNC(at28c16_device::write)); /* eeprom */ map(0x1fb00000, 0x1fb0ffff).rw("rf5c296", FUNC(rf5c296_device::io_r), FUNC(rf5c296_device::io_w)); map(0x1fb40000, 0x1fb40000).rw(FUNC(taitogn_state::control_r), FUNC(taitogn_state::control_w)); map(0x1fb60000, 0x1fb60001).w(FUNC(taitogn_state::control2_w)); @@ -674,9 +612,9 @@ void taitogn_state::flashbank_map(address_map &map) map(0x10200000, 0x103fffff).rw("biosflash", FUNC(intelfsh16_device::read), FUNC(intelfsh16_device::write)); } -void taitogn_state::taitogn_mp_map(address_map &map) +void taitogn_state::main_mp_map(address_map &map) { - taitogn_map(map); + main_map(map); map(0x1fa10100, 0x1fa10100).r(FUNC(taitogn_state::gnet_mahjong_panel_r)); } @@ -690,33 +628,12 @@ void slot_ataflash(device_slot_interface &device) void taitogn_state::coh3002t(machine_config &config) { - /* basic machine hardware */ - CXD8661R(config, m_maincpu, XTAL(100'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &taitogn_state::taitogn_map); - - m_maincpu->subdevice<ram_device>("ram")->set_default_size("4M"); - - auto &sio0(*m_maincpu->subdevice<psxsio0_device>("sio0")); - sio0.sck_handler().set(m_cat702[0], FUNC(cat702_device::write_clock)); - sio0.sck_handler().append(m_cat702[1], FUNC(cat702_device::write_clock)); - sio0.sck_handler().append(m_znmcu, FUNC(znmcu_device::write_clock)); - sio0.txd_handler().set(m_cat702[0], FUNC(cat702_device::write_datain)); - sio0.txd_handler().append(m_cat702[1], FUNC(cat702_device::write_datain)); + zn2(config); + gameboard_cat702(config); - CAT702(config, m_cat702[0], 0); - m_cat702[0]->dataout_handler().set(FUNC(taitogn_state::cat702_dataout<0>)); - - CAT702(config, m_cat702[1], 0); - m_cat702[1]->dataout_handler().set(FUNC(taitogn_state::cat702_dataout<1>)); - - ZNMCU(config, m_znmcu, 0); - m_znmcu->dataout_handler().set(FUNC(taitogn_state::znmcu_dataout)); - m_znmcu->dsr_handler().set("maincpu:sio0", FUNC(psxsio0_device::write_dsr)); - m_znmcu->dsw_handler().set_ioport("DSW"); - m_znmcu->analog1_handler().set_ioport("ANALOG1"); - m_znmcu->analog2_handler().set_ioport("ANALOG2"); + /* basic machine hardware */ + m_maincpu->set_addrmap(AS_PROGRAM, &taitogn_state::main_map); - AT28C16(config, "at28c16", 0); RF5C296(config, "rf5c296", 0).set_pccard("pccard"); PCCARD_SLOT(config, m_pccard, slot_ataflash, nullptr); @@ -731,21 +648,9 @@ void taitogn_state::coh3002t(machine_config &config) ADDRESS_MAP_BANK(config, "flashbank").set_map(&taitogn_state::flashbank_map).set_options(ENDIANNESS_LITTLE, 16, 32, 0x8000000); - // 5MHz NEC uPD78081 MCU: - // we don't have a 78K0 emulation core yet.. - - /* video hardware */ - CXD8654Q(config, "gpu", XTAL(53'693'175), 0x200000, subdevice<psxcpu_device>("maincpu")).set_screen("screen"); - - SCREEN(config, "screen", SCREEN_TYPE_RASTER); - - /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - spu_device &spu(SPU(config, "spu", XTAL(67'737'600)/2, subdevice<psxcpu_device>("maincpu"))); - spu.add_route(0, "lspeaker", 0.3); - spu.add_route(1, "rspeaker", 0.3); + subdevice<spu_device>("spu")->reset_routes(); + subdevice<spu_device>("spu")->add_route(0, "lspeaker", 0.3); + subdevice<spu_device>("spu")->add_route(1, "rspeaker", 0.3); TAITO_ZOOM(config, m_zoom); m_zoom->set_use_flash(); @@ -772,7 +677,7 @@ void taitogn_state::coh3002t_t1_mp(machine_config &config) coh3002t_t1(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &taitogn_state::taitogn_mp_map); + m_maincpu->set_addrmap(AS_PROGRAM, &taitogn_state::main_mp_map); } void taitogn_state::coh3002t_t2_mp(machine_config &config) @@ -780,7 +685,7 @@ void taitogn_state::coh3002t_t2_mp(machine_config &config) coh3002t_t2(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &taitogn_state::taitogn_mp_map); + m_maincpu->set_addrmap(AS_PROGRAM, &taitogn_state::main_mp_map); } void taitogn_state::coh3002t_cf(machine_config &config) diff --git a/src/mame/drivers/taitopjc.cpp b/src/mame/drivers/taitopjc.cpp index 95c670c54a3..e7606b904e0 100644 --- a/src/mame/drivers/taitopjc.cpp +++ b/src/mame/drivers/taitopjc.cpp @@ -875,7 +875,7 @@ ROM_START( optiger ) ROM_LOAD( "e63-05_palce16v8h-10-4.ic36", 0x3f4, 0x117, CRC(e27e9734) SHA1(77dadfbedb625b65617640bb73c59c9e5b0c927f) ) ROM_LOAD( "e63-06_palce16v8h-10-4.ic41", 0x50b, 0x117, CRC(75184422) SHA1(d35e98e0278d713139eb1c833f41f57ed0dd3c9f) ) ROM_LOAD( "e63-07_palce16v8h-10-4.ic43", 0x622, 0x117, CRC(eb77b03f) SHA1(567f92a4fd1fa919d5e9047ee15c058bf40855fb) ) - ROM_LOAD( "e63-08_palce16v8h-15-4.ic49", 0x739, 0x117, CRC(c305c56d) SHA1(49592fa43c548ac6b08951d03677a3f23e9c8de8) ) + ROM_LOAD( "e63-08_palce16v8h-15-4.ic49", 0x739, 0x117, CRC(c305c56d) SHA1(49592fa43c548ac6b08951d03677a3f23e9c8de8) ) ROM_END GAME( 1998, optiger, 0, taitopjc, taitopjc, taitopjc_state, init_optiger, ROT0, "Taito", "Operation Tiger (Ver 2.14 O)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/drivers/talkingbb.cpp b/src/mame/drivers/talkingbb.cpp index 7bcbe03a031..f70bf1def1a 100644 --- a/src/mame/drivers/talkingbb.cpp +++ b/src/mame/drivers/talkingbb.cpp @@ -18,7 +18,7 @@ The speech driver is by Forrest S. Mozer's company. The cartridge slots are for extra teams. There are around 8 cartridges, each one included 3 or 4 baseball teams, with exception to the "Hall of Fame" cartridge. -Players enter 3-digit code to select the team. +Players enter a 3-digit code to select the team. TODO: - add cartridge slots diff --git a/src/mame/drivers/teamjocs.cpp b/src/mame/drivers/teamjocs.cpp new file mode 100644 index 00000000000..b9710da9dd1 --- /dev/null +++ b/src/mame/drivers/teamjocs.cpp @@ -0,0 +1,82 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + TEAM JOCS Grupo Presas + Mod. PELU CPU + ____________________________________________________ + | _____________ _CN5_ _CN2_ _______________ | + | |___CN7______| |____| |____| |____CN4_______| | + | | + |__ ULN2003A ULN2003A | + || | | + || | HC245A 74HC273D 74HC273D __ | + ||C| | || + ||N| M28C17 HC245A HC245A | || + ||6| | || + || | HC245A XTAL | || + || | 4.0000MHz | || + ||_| | || + | PIC17C44-16 | || + |__ 74HC2730 | || + || | | || + || | OKI-M6375 |_|| + ||C| | + ||N| 74HC2730 NM27C010Q __ | + ||3| | || + ||_| HC245A CN10->|_|| + | BATT | + | ______________ ___ ___ | + | |_____________|<-CN8 |__|<-CN12 CN9->|__| | + |___________________________________________________| +*/ + +#include "emu.h" +#include "cpu/pic16c5x/pic16c5x.h" +#include "machine/nvram.h" +#include "sound/okim6376.h" +#include "speaker.h" + + +class teamjocs_state : public driver_device +{ +public: + teamjocs_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void teamjocs(machine_config &config); + +private: + + required_device<cpu_device> m_maincpu; +}; + +static INPUT_PORTS_START(teamjocs) +INPUT_PORTS_END + +void teamjocs_state::teamjocs(machine_config &config) +{ + PIC16C55(config, m_maincpu, 4_MHz_XTAL); // actually PIC17C44-16 + + SPEAKER(config, "mono").front_center(); + + OKIM6376(config, "oki", 4_MHz_XTAL); // divided unknown + +} + +ROM_START(diaelite) + ROM_REGION(0x8000, "maincpu", 0) + ROM_LOAD( "elite_3_4_6_pic17c44.ic7", 0x0000, 0x8000, NO_DUMP ) + + ROM_REGION(0x20000, "oki", 0) + ROM_LOAD( "b.ic4", 0x00000, 0x20000, CRC(c8505516) SHA1(cd56e25b57752970f6a0de7e5efdda5527e21019) ) + + ROM_REGION(0x800, "28c17", 0) + ROM_LOAD( "m28c17.ic13", 0x000, 0x800, CRC(4a292b0d) SHA1(1f86e52b52ed53a7a8197e1ee394876dfc51fb91) ) +ROM_END + + +GAME(199?, diaelite, 0, teamjocs, teamjocs, teamjocs_state, empty_init, ROT0, "Recreativos Presas", "Diana Elite", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/testpat.cpp b/src/mame/drivers/testpat.cpp index 78b9e418537..22964d24221 100644 --- a/src/mame/drivers/testpat.cpp +++ b/src/mame/drivers/testpat.cpp @@ -127,8 +127,8 @@ void tp1985_state::tp1985(machine_config &config) SCREEN(config, "screen", SCREEN_TYPE_RASTER); FIXFREQ(config, m_video).set_screen("screen"); m_video->set_monitor_clock(MASTER_CLOCK); - m_video->set_horz_params(H_TOTAL_PONG-64,H_TOTAL_PONG-40,H_TOTAL_PONG-8,H_TOTAL_PONG); - m_video->set_vert_params(V_TOTAL_PONG-19,V_TOTAL_PONG-16,V_TOTAL_PONG-12,V_TOTAL_PONG); + m_video->set_horz_params(H_TOTAL_PONG-80,H_TOTAL_PONG-56,H_TOTAL_PONG-8,H_TOTAL_PONG); + m_video->set_vert_params(V_TOTAL_PONG-19,V_TOTAL_PONG-15,V_TOTAL_PONG-12,V_TOTAL_PONG); m_video->set_fieldcount(1); m_video->set_threshold(1); m_video->set_gain(0.36); diff --git a/src/mame/drivers/ti99_4p.cpp b/src/mame/drivers/ti99_4p.cpp index 215916f68e6..93fd96eac7e 100644 --- a/src/mame/drivers/ti99_4p.cpp +++ b/src/mame/drivers/ti99_4p.cpp @@ -1014,6 +1014,8 @@ void ti99_4p_state::driver_reset() m_cpu->set_ready(ASSERT_LINE); m_cpu->set_hold(CLEAR_LINE); m_int1 = m_int2 = CLEAR_LINE; + m_peribox->reset_in(ASSERT_LINE); + m_peribox->reset_in(CLEAR_LINE); } /* diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 4b1c17dc4ea..a662ceae7ec 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -578,67 +578,6 @@ READ8_MEMBER( ti99_4x_state::psi_input_4a ) return 1; } } -/* switch (offset & 0x03) - { - case tms9901_device::CB_INT7: - // - // Read pins INT3*-INT7* of TI99's 9901. - // bit 1: INT1 status - // bit 2: INT2 status - // bit 3-7: keyboard status bits 0 to 4 - // - // |K|K|K|K|K|I2|I1|C| - // - if (m_keyboard_column >= (m_model==MODEL_4? 5:6)) // joy 1, 2, handset - { - answer = m_joyport->read_port(); - - if ((m_model!=MODEL_4) && (m_alphabug->read()!=0) ) answer |= (m_alpha->read() | m_alpha1->read()); - } - else - { - answer = m_keyboard[m_keyboard_column]->read(); - } - if (m_check_alphalock) // never true for TI-99/4 - { - answer &= ~(m_alpha->read() | m_alpha1->read()); - } - answer = (answer << 3); - if (m_int1 == CLEAR_LINE) answer |= 0x02; - if (m_int2 == CLEAR_LINE) answer |= 0x04; - - break; - - case tms9901_device::INT8_INT15: - // |1|1|1|INT12|0|K|K|K| - if (m_keyboard_column >= (m_model==MODEL_4? 5:6)) answer = 0x07; - else answer = ((m_keyboard[m_keyboard_column]->read())>>5) & 0x07; - answer |= 0xe0; - if (m_model != MODEL_4 || m_int12==CLEAR_LINE) answer |= 0x10; - break; - - case tms9901_device::P0_P7: - // Required for the handset (only on TI-99/4) - if ((m_joyport->read_port() & 0x20)!=0) answer |= 2; - break; - - case tms9901_device::P8_P15: - // Preset to 1 - answer = 4; - - // Interrupt pin of the handset (only on TI-99/4) - // Negative logic (interrupt pulls line down) - if ((m_joyport->read_port() & 0x40)==0) answer = 0; - - // we don't take CS2 into account, as CS2 is a write-only unit - if (m_cassette1->input() > 0) - { - answer |= 8; - } - break; - } - */ - /* Handler for TMS9901 P0 pin (handset data acknowledge); only for 99/4 @@ -885,6 +824,7 @@ WRITE_LINE_MEMBER( ti99_4x_state::console_reset ) LOGMASKED(LOG_RESETLOAD, "Console reset line = %d\n", state); m_cpu->set_input_line(INT_9900_RESET, state); m_video->reset_line(state); + m_ioport->reset_in(state); } } diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index 99aa0804886..44876108c35 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -609,6 +609,9 @@ WRITE_LINE_MEMBER( ti99_8_state::console_reset ) // Setting ready to false so that automatic wait states are enabled m_cpu->ready_line(CLEAR_LINE); m_cpu->reset_line(ASSERT_LINE); + + // Send RESET to the IOPort + m_ioport->reset_in(state); } } diff --git a/src/mame/drivers/timeplt.cpp b/src/mame/drivers/timeplt.cpp index a1f559f6113..b9396469635 100644 --- a/src/mame/drivers/timeplt.cpp +++ b/src/mame/drivers/timeplt.cpp @@ -599,6 +599,28 @@ ROM_START( spaceplt ) ROM_LOAD( "timeplt.e12", 0x0140, 0x0100, CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad) ) /* char lookup table */ ROM_END +ROM_START( spaceplta ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1", 0x0000, 0x2000, CRC(c6672087) SHA1(1efaaf83dd11af18e947b428c3d9e70b075faf30) ) + ROM_LOAD( "2", 0x2000, 0x2000, CRC(5b246c47) SHA1(a5e49eea9ac21b7a498ce5b2c2c30e0a45ce582e) ) + ROM_LOAD( "3", 0x4000, 0x2000, CRC(cc9e745e) SHA1(387c748667399573f20d00467f2f6693e10588d3) ) + + ROM_REGION( 0x10000, "timeplt_audio:tpsound", 0 ) + ROM_LOAD( "4", 0x0000, 0x1000, CRC(d66da813) SHA1(408fca4515e8af84211df3e204c8776b2f8adb23) ) + + ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_LOAD( "5", 0x0000, 0x2000, CRC(76caa8af) SHA1(f81bb73877d415a6587a32bddaad6db8a8fd4941) ) + + ROM_REGION( 0x4000, "gfx2", 0 ) + ROM_LOAD( "6", 0x0000, 0x2000, CRC(86ab1ae7) SHA1(8e3f84aa6b2c21e7e1383ea1811fd99a4d940a23) ) // difference to spaceplt: erased Konami + ROM_LOAD( "7", 0x2000, 0x2000, CRC(e8ca87b9) SHA1(5dd30d3fb9fd8cf9e6a8e37e7ea858c7fd038a7e) ) + + ROM_REGION( 0x0240, "proms", 0 ) + ROM_LOAD( "timeplt.b4", 0x0000, 0x0020, CRC(34c91839) SHA1(f62e279e21fce171231d3139be7adabe1f4b8c2e) ) /* palette */ + ROM_LOAD( "timeplt.b5", 0x0020, 0x0020, CRC(463b2b07) SHA1(9ad275365eba4869f94749f39ff8705d92056a10) ) /* palette */ + ROM_LOAD( "timeplt.e9", 0x0040, 0x0100, CRC(4bbb2150) SHA1(678433b21aae1daa938e32d3293eeed529a42ef9) ) /* sprite lookup table */ + ROM_LOAD( "timeplt.e12", 0x0140, 0x0100, CRC(f7b7663e) SHA1(151bd2dff4e4ef76d6438c1ab2cae71f987b9dad) ) /* char lookup table */ +ROM_END ROM_START( psurge ) ROM_REGION( 0x10000, "maincpu", 0 ) @@ -686,12 +708,13 @@ ROM_END * *************************************/ -GAME( 1982, timeplt, 0, timeplt, timeplt, timeplt_state, empty_init, ROT90, "Konami", "Time Pilot", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, timepltc, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "Konami (Centuri license)", "Time Pilot (Centuri)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, timeplta, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "Konami (Atari license)", "Time Pilot (Atari)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, spaceplt, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "bootleg", "Space Pilot", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, timeplt, 0, timeplt, timeplt, timeplt_state, empty_init, ROT90, "Konami", "Time Pilot", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, timepltc, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "Konami (Centuri license)", "Time Pilot (Centuri)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, timeplta, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "Konami (Atari license)", "Time Pilot (Atari)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, spaceplt, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "bootleg", "Space Pilot (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, spaceplta, timeplt, timeplt, timeplt, timeplt_state, empty_init, ROT90, "bootleg", "Space Pilot (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, psurge, 0, psurge, psurge, timeplt_state, empty_init, ROT270, "Vision Electronics", "Power Surge", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, psurge, 0, psurge, psurge, timeplt_state, empty_init, ROT270, "Vision Electronics", "Power Surge", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, chkun, 0, chkun, chkun, timeplt_state, empty_init, ROT90, "Peni", "Chance Kun (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) -GAME( 1987, bikkuric, 0, bikkuric, bikkuric, timeplt_state, empty_init, ROT90, "Peni", "Bikkuri Card (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, chkun, 0, chkun, chkun, timeplt_state, empty_init, ROT90, "Peni", "Chance Kun (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) +GAME( 1987, bikkuric, 0, bikkuric, bikkuric, timeplt_state, empty_init, ROT90, "Peni", "Bikkuri Card (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/tk2000.cpp b/src/mame/drivers/tk2000.cpp index 43ec5d7dc57..c827d81f864 100644 --- a/src/mame/drivers/tk2000.cpp +++ b/src/mame/drivers/tk2000.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont +// copyright-holders:R. Belmont, M. Capdeville /*************************************************************************** tk2000.cpp - Microdigital TK2000 @@ -14,6 +14,8 @@ $C05A - banks RAM from c100-ffff $C05B - banks ROM from c100-ffff + Added Multitech MPF-II support ( another not so apple2 compatible ) + ************************************************************************/ #include "emu.h" @@ -630,5 +632,11 @@ ROM_START(tk2000) ROM_LOAD( "tk2000.rom", 0x000000, 0x004000, CRC(dfdbacc3) SHA1(bb37844c31616046630868a4399ee3d55d6df277) ) ROM_END +ROM_START(mpf2) + ROM_REGION(0x4000,"maincpu",0) + ROM_LOAD( "mpf_ii.rom", 0x000000, 0x004000, CRC(8780189f) SHA1(92378b0db561632b58a9b36a85f8fb00796198bb) ) +ROM_END + /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ COMP( 1984, tk2000, 0, 0, tk2000, tk2000, tk2000_state, empty_init, "Microdigital", "TK2000 Color Computer", MACHINE_NOT_WORKING ) +COMP( 1982, mpf2, tk2000, 0, tk2000, tk2000, tk2000_state, empty_init, "Multitech", "Microprofessor II", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp index b12c7805def..50b18e77218 100644 --- a/src/mame/drivers/toaplan2.cpp +++ b/src/mame/drivers/toaplan2.cpp @@ -4880,6 +4880,25 @@ ROM_START( snowbro2b2 ) // seems to mostly be the same data, but with copyright ROM_LOAD( "rom09.bin", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) ROM_END +ROM_START( snowbro2ny ) // Nyanko + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "rom1_c8.u61", 0x000000, 0x080000, CRC(9e6eb76b) SHA1(9e8b356dabedeb4ae9e08d60fbf6ed4a09edc0bd) ) + + ROM_REGION( 0x300000, "gp9001_0", 0 ) + ROM_LOAD( "rom2-l_tp-033.u13", 0x000000, 0x100000, CRC(e9d366a9) SHA1(e87e3966fce3395324b90db6c134b3345104c04b) ) + ROM_LOAD( "rom2-h_c10.u26", 0x100000, 0x080000, CRC(9aab7a62) SHA1(611f6a15fdbac5d3063426a365538c1482e996bf) ) + ROM_LOAD( "rom3-l_tp-033.u12", 0x180000, 0x100000, CRC(eb06e332) SHA1(7cd597bfffc153d178530c0f0903bebd751c9dd1) ) + ROM_LOAD( "rom3-h_c9.u27", 0x280000, 0x080000, CRC(6de2b059) SHA1(695e789849c34de5d83e40b0e834b2106fcd78db) ) + + ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom4-tp-033.u33", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) + + ROM_REGION( 0x345, "plds", 0 ) + ROM_LOAD( "13_gal16v8-25lnc.u91", 0x000, 0x117, NO_DUMP ) // Protected + ROM_LOAD( "14_gal16v8-25lnc.u92", 0x117, 0x117, NO_DUMP ) // Protected + ROM_LOAD( "15_gal16v8-25lnc.u93", 0x22e, 0x117, NO_DUMP ) // Protected +ROM_END + /* -------------------------- Raizing games ------------------------- */ @@ -5657,9 +5676,10 @@ GAME( 1993, batsugunsp, batsugun, batsugun, batsugun, toaplan2_state, init_ GAME( 1994, pwrkick, 0, pwrkick, pwrkick, toaplan2_state, empty_init, ROT0, "Sunwise", "Power Kick (Japan)", 0 ) GAME( 1995, othldrby, 0, othldrby, othldrby, toaplan2_state, empty_init, ROT0, "Sunwise", "Othello Derby (Japan)", 0 ) -GAME( 1994, snowbro2, 0, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "Hanafram", "Snow Bros. 2 - With New Elves / Otenki Paradise", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, snowbro2b, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, snowbro2b2, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "bootleg (Q Elec)", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 2)", MACHINE_SUPPORTS_SAVE ) // possibly not a bootleg, has some original parts +GAME( 1994, snowbro2, 0, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "Hanafram", "Snow Bros. 2 - With New Elves / Otenki Paradise (Hanafram)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, snowbro2ny, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "Nyanko", "Snow Bros. 2 - With New Elves / Otenki Paradise (Nyanko)", MACHINE_SUPPORTS_SAVE ) // not a bootleg, has original parts (the "GP9001 L7A0498 TOA PLAN" IC and the three mask ROMs) +GAME( 1998, snowbro2b, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, snowbro2b2, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "bootleg (Q Elec)", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 2)", MACHINE_SUPPORTS_SAVE ) // possibly not a bootleg, has some original parts GAME( 1993, sstriker, 0, mahoudai, sstriker, toaplan2_state, empty_init, ROT270, "Raizing", "Sorcer Striker", MACHINE_SUPPORTS_SAVE ) // verified on two different PCBs GAME( 1993, sstrikerk, sstriker, mahoudai, sstrikerk, toaplan2_state, empty_init, ROT270, "Raizing (Unite Trading license)", "Sorcer Striker (Korea)" , MACHINE_SUPPORTS_SAVE ) // Although the region jumper is functional, it's a Korean board / version diff --git a/src/mame/drivers/toki_ms.cpp b/src/mame/drivers/toki_ms.cpp index a71855a0dda..a242dba8cd6 100644 --- a/src/mame/drivers/toki_ms.cpp +++ b/src/mame/drivers/toki_ms.cpp @@ -1,76 +1,640 @@ // license:BSD-3-Clause -// copyright-holders:David Haywood +// copyright-holders:David Haywood, Angelo Salese /* Toki (Modular System) as with most of the 'Modular System' setups, the hardware is heavily modified from the original and consists of a multi-board stack in a cage, hence different driver. - - TODO: PCB list - + Update: it doesn't seem all that different than tokib, the differences are: + * paletteram; + * video registers; + * sprite chip interface (basically shifting all the ports, why even?); + * switching from YM3812 to a double YM2203 setup; + + TODO: + - Subclass with tokib_state in toki.cpp driver; + - Sound needs improvements: + * meaning of port A/B of the two YMs; + * MSM playback; + * improve comms; + * ROM bank; + * One of the above for the scratchy sounds that happens from time to time; + * Mixing; + - Ranking screen has wrong colors, btanb? + - Slight sprite lag when game scrolls vertically, another btanb? + - "bajo licencia" -> "under license" ... from whoever developed Modular System or TAD itself? NOTES: - PCB lacks raster effect on title screen + PCB lacks raster effect on title screen (like toki bootlegs) + + BOARDS + + Board 5-1 + ___________________________________________________________ + | ________________ ________________ | + | | | | | | + | | TK-512 | | TK-516 | | + | |_______________| |_______________| | + | :::::::: ________________ ________________ | + | | | | | | + | __ | TK-511 | | TK-515 | | + | | | |_______________| |_______________| | + | | | __________ ________________ ________________ | + | | | |_GAL16V8| | | | | | + | | | 5140 | TK-510 | | TK-514 | | + | | | |_______________| |_______________| | + | | | __________ ________________ ________________ | + | | | |_GAL16V8| | | | | | + | | | 5240 | TK-509 | | TK-513 | | + | | | |_______________| |_______________| | + | | | _________ ________________ ________________ | + | | | |74LS138N | | | | | + | | | | EMPTY | | EMPTY | | + | | | |_______________| |_______________| | + | | |________________ ________________ | + | |_|| | | | | + | | TK-504 | | TK-508 | | + | |_______________| |_______________| | + | ________________ ________________ | + | | | | | | + | | TK-503 | | TK-507 | | + | |_______________| |_______________| | + | ________________ ________________ | + | | | | | MODULAR | + | | TK-502 | | TK-506 | SYSTEM 2 | + | |_______________| |_______________| | + | ________________ ________________ | + | | | | | | + | | TK-501 | | TK-505 | | + | |_______________| |_______________| | + | ________________ ________________ | + | | | | | | + | | EMPTY | | EMPTY | | + | |_______________| |_______________| | + | ________________ ________________ | + | | | | | | + | | EMPTY | | EMPTY | | + | |_______________| |_______________| | + |__________________________________________________________| + + Board 8 + __________________________________________________________________________________ + | :::::::: <- Jumpers | + | ________________ ________________ ________________ ________________ | + | _______ | | | | | | | || + | 74LS175N | TK-825 | | TK-826 | | TK-827 | | TK-828 || + | |_______________| |_______________| |_______________| |_______________|| + | _______ ________________ ________________ ________________ ________________ | + | 74LS175N | | | | | | | || + | | EMPTY | | EMPTY | | EMPTY | | EMPTY || + | _______ |_______________| |_______________| |_______________| |_______________|| + | 74LS175N ________________ ________________ ________________ ________________ | + | | | | | | | | || + | _______ | EMPTY | | EMPTY | | EMPTY | | EMPTY || + | 74LS175N |_______________| |_______________| |_______________| |_______________|| + | ________________ ________________ ________________ ________________ | + | _______ | | | | | | | || + | 74LS175N | TK-813 | | TK-814 | | TK-815 | | TK-816 || + | |_______________| |_______________| |_______________| |_______________|| + | ________________ ________________ ________________ ________________ | + | _______ | | | | | | | || + | 74LS175N | TK-809 | | TK-810 | | TK-811 | | TK-812 || + | |_______________| |_______________| |_______________| |_______________|| + | ________________ ________________ ________________ ________________ | + | _______ | | | | | | | || + | 74LS175N | TK-805 | | TK-806 | | TK-807 | | TK-808 || + | |_______________| |_______________| |_______________| |_______________|| + | _______ ________________ ________________ ________________ ________________ | + | 74LS175N | | | | | | | || + | | TK-801 | | TK-803 | | TK-805 | | TK-807 || + | |_______________| |_______________| |_______________| |_______________|| + | _____________________________ _______ _________________________________ | + |__| |____74LS138N_| |__| + |____________________________| |________________________________| + + CPU Board 6/1 Board 21/1 + _____________________________________________ ______________________________________________ + | _______________ __|_ | | + | | | | | | | + | |CXK58256PM-12 | | | | ________ _______ ________ | + | |______________| _______ | | | |_EMPTY_| |_EMPTY_| |_EMPTY_| | + | _______ ________________ 74LS138N | | | | + | 74LS367AN | | | | | | + | | TK-601 | | | | | + | |_______________| | | | ________ _______ ________ | + | ________________ _______ | | | |74S74N_| 74LS393B1 74LS393B1 | + | _______ | | 74LS245B1 | | | | + | 74LS367AN | TK-602 | | | | | + | |_______________| | | | | + | ________________ | | | | + | _______ | | _______ | | | 74LS7273N |82S129_| |82S129_| | + | 74LS138N | TK-603 | 74LS374N | | | 202 201 | + | |_______________| | | | | + | _______________ | | | | + | | | _______ |___| | ________ _______ ________ | + | _______ |CXK58256PM-12 | 74LS245B1 | | 74LS74AN XTAL 74LS367AB1 | + | GAL16V8 |______________| | | 20.000 MHz | + | 604 ________________ | | | + | _______ | | _______ | | ________ _______ ________ | + | 74LS174N | TK-604 | 74LS374N | __|_ 74LS732B1 74LS368AB1 NMC2148HJ-3 | + | |_______________| | | | | + | _______ ________________ | | | | + | PAL16V8 | | | | | ________ _______ ________ | + | 640 | TK-605 | _______ | | | 74LS157N 74S112N AM2148-45DC | + | |_______________| 74LS138N | | | | + | ________________ | | | | + | | | | | | ________ _______ ________ | + | | TK-606 | | | | 74LS148N 74LS368AB1 AM2148-45DC | + | |_______________| _______ | | | | + | ___________________________ 74LS32N | | | | + | | | | | | ________ _______ ________ ________ | + | | TS68000CP12 | _______ | | | 74LS298N 74LS298N 74LS298N 74LS174N | + | |__________________________| 74LS20P | | | | + | | | | | + | _______ ______ _______ _______ | | | ________ _______ ________ ________ | + | |74F74N XTAL 74LS368AB1 74LS132B1 | | | 74LS245B1 74LS245B1 |74LS08N 74LS174N | + | 20.000MHz | |___| | + |____________________________________________| |_____________________________________________| + + Board 51/3 Sound Board 1/3 + _____________________________________________ ______________________________________________ + | | | | + | __________ ________ ________ ________ | | ________ ________ ________ | + | |TO SUB 51| 74LS299N 74LS169N |D2149D_| | | 74LS107AN GD74LS32| |_EMPTY_| | + | |_________| ________ ________ ________ | | | + | 74LS169N 74LS169N |D2149D_| | | ________ __________________ | + | | | 74LS368AB1 | | | + | __________ ________ ________ ________ | | | EMPTY | | + | |TO SUB 51| 74LS158N 74LS169N |82S129AN <- 502 | ________ |_________________| | + | |_________| ________ ________ ________ | | 74LS74AN __________________ | + | 74LS299N 74LS169N 74LS244N | | | Z8400BB1 | | + | | | ________ | Z80 B CPU | ________ | + | __________ ________ ________ ________ | | 74HCT157P |_________________| |LM324M_| | + | |TO SUB 51| 74LS299N 74LS169N 74LS244N | | ________________ | + | |_________| ________ ________ ________ | | ________ | | __ | + | 74LS20B1 |D2149D| 74LS298P | P0110->N82S123N | TK-101 | |D|| + | | | ________ |_______________| |I|| + | __________ ________ ________ ________ | | 74HCT157P ________________ |P|| SOUND SUB + | |TO SUB 51| 74LS299N |D2149D| 74LS298P | | __________ | | _____ _____ |S|| _________________ + | |_________| | | | || SRM2064C-15 |Y3014B Y3014B|-|| | ______ | + | ________ ________ ________ ________ __ | | | SOUND ||_______________| |D|| | LM358N ___ | + | 74LS273P |74LS00N 74LS86B1 74LS244N | || | | SUB | |I|| | .......... | | | + | | || | | | |P|| | |OKI | +_|_ ________ ________ ________ ________ |T|| __|_|_________|__________________ |S|| | .......... |M5205 +| | |74LS08N 74LS158N 74LS74AN 74LS20B1 |O|| | | | YAMAHA | |_|| | ________ |__| | +| | | || | | | YM2203C | | | 74LS377N | +| | ________ ________ ________ ________ |S|| | | |_________________| | |_________________| +IC46->PAL16V8H 74LS393N 74LS368AP 74LS377B1|U|| | | | +| | |B|| | | _______ ________ | +| | ________ ________ ________ ________ | || | | |EMPTY_| 74LS74AN | +| | 74LS138N 74LS283N |D2149D| |_EMPTY_| |5|| | | | +| | |1|| | | | +| | ________ ________ ________ ________ | || | | __________________ _____ | +| | 74LS175B1 74LS283N |D2149D| 74LS273B1 | || | | _______ | YAMAHA | TDA2003 | +| | | || | | |EMPTY| | YM2203C | | +| | ________ ________ ________ ________ |_|| | | |_________________| | +| | 74LS298N 74LS157N 74LS157N 74LS273B1 | | | | +| | | | | | +| | ________ ________ ________ ________ | | | | +| | 74LS158P 74LS169N 74LS169N 74LS245N | | | | +|__| | |___| __________________________ | + |____________________________________________| |__________| |_|_|_|_|_|_|_|_|_|_|_| |________| + PRE-JAMMA + Board 7/4 + __________________________________________________________ + | _________ _________ __________ _________ _________ __|_ + | 74LS163AN| 74LS163AN||_GAL20V8_| |74S174N_| |74S189BN|| | + | 7636 | | + | _________ _________ _________ _________ _________ | | + | |74LS157N| |74LS288B1 |74LS273P| 74LS290B1| |74S189VN|| | + | | | + | _________ _________ _________ _________ _________ | | + | |74LS393N| 74LS283B1 74HCTLS373N 74LS298B1| |74S189BN|| | + | | | + | _________ __________ _____________ _________ | | + | |74LS157N| |_PAL16V8_| |D43256C-12L | |74S174N_| | | + | _________ __7540____ |____________| _________ | | + | |74LS283B1 |74LS245B1| _____________ |74S174N_| | | + | _________ __________ |D43256C-12L | __________ | | + | |74LS08N_| |74LS245B1| |____________| |74LS245B1| | | + | _________ __________ __________ _________ | | + | |74LS20B1| |74LS374B1| |74LS273B1| |74LS74AN| | | + | | | + | _________ __________ __________ _________ |___| + | |74LS04N_| |PALCE16V8| |74LS374B1| |74LS157N| | + | 7340 | + | _________ __________ __________ _________ | + | |74LS00B1| |_GAL10V8_| |74LS273B1| 74LS367AN __|_ + | 7240 | | + | _________ __________ __________ _________ | | + | |74LS08N_| |74LS273B1| |74LS374B1| PALCE16V8| | | + | 7440 | | + | _________ __________ __________ _________ | | + | |74LS74AN| |74LS273B1| 74LS367AN_| 74HCTLS373N | | + | | | + | _________ __________ __________ _________ | | + | |74LS32N_| |74LS374B1| 74LS367AN_| GAL20V8-25LP | | + | 7140 | | + | _________ _________ _________ _________ _________ | | + | 74LS139B1 |_74F74N_| |74LS157N| |74LS20B1| 74HCT373N | | + | _________ _________ _________ _________ _________ | | + | |74LS32N_| |74LS157N| 74HCT597E 74HCT597E 74HCT597E | | + | _________ _________ _________ _________ _________ | | + | |74LS74AN| |74LS86N_| 74HCT597E 74HCT597E 74HCT597E | | + | _________ _________ _________ _________ _________ | | + | |74LS74AN| |74LS86N_| 74HCT597E 74HCT597E 74HCT597E | | + | _________ _________ _________ _________ | | + | 74LS377B1 74HCT597E 74HCT597E 74HCT597E | | + | _________ _________ _________ _________ |___| + | 74LS273B1 74LS169BN 74LS169BN 74LS169BN | + |_________________________________________________________| */ - #include "emu.h" #include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" +#include "video/bufsprite.h" +#include "sound/2203intf.h" +#include "sound/msm5205.h" class toki_ms_state : public driver_device { public: toki_ms_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_palette(*this, "palette"), - m_screen(*this, "screen"), - m_paletteram(*this, "palette"), - m_gfxdecode(*this, "gfxdecode") + driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_palette(*this, "palette") + , m_screen(*this, "screen") + , m_gfxdecode(*this, "gfxdecode") + , m_bk1vram(*this, "bk1vram") + , m_bk2vram(*this, "bk2vram") + , m_vram(*this, "vram") + , m_spriteram(*this, "spriteram") + , m_scrollram(*this, "scrollram") + , m_ym1(*this, "ym1") + , m_ym2(*this, "ym2") + , m_msm(*this, "msm5205") + , m_soundlatch(*this, "soundlatch") { } - void tokim(machine_config &config); + void tokims(machine_config &config); + void init_tokims(); private: required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; required_device<palette_device> m_palette; required_device<screen_device> m_screen; - required_shared_ptr<uint16_t> m_paletteram; required_device<gfxdecode_device> m_gfxdecode; + required_shared_ptr<u16> m_bk1vram; + required_shared_ptr<u16> m_bk2vram; + required_shared_ptr<u16> m_vram; + required_device<buffered_spriteram16_device> m_spriteram; + required_shared_ptr<u16> m_scrollram; + required_device<ym2203_device> m_ym1; + required_device<ym2203_device> m_ym2; + required_device<msm5205_device> m_msm; + required_device<generic_latch_8_device> m_soundlatch; virtual void machine_start() override; + virtual void video_start() override; + + TILE_GET_INFO_MEMBER(get_bk1_info); + TILE_GET_INFO_MEMBER(get_bk2_info); + TILE_GET_INFO_MEMBER(get_tile_info); + void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); + DECLARE_WRITE16_MEMBER(bk1vram_w); + DECLARE_WRITE16_MEMBER(bk2vram_w); + DECLARE_WRITE16_MEMBER(vram_w); + tilemap_t *m_bk1_tilemap; + tilemap_t *m_bk2_tilemap; + tilemap_t *m_tx_tilemap; + + DECLARE_READ8_MEMBER(palette_r); + DECLARE_WRITE8_MEMBER(palette_w); + std::unique_ptr<u8 []> m_paletteram; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void tokim_map(address_map &map); + void tokims_map(address_map &map); + void audio_map(address_map &map); + + DECLARE_READ8_MEMBER(sound_status_r); + DECLARE_WRITE8_MEMBER(sound_command_w); + DECLARE_WRITE8_MEMBER(adpcm_w); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + u8 m_adpcm_data; }; +TILE_GET_INFO_MEMBER(toki_ms_state::get_tile_info) +{ + u16 code = (m_vram[tile_index] & 0xfff) | 0x1000; + u8 color = (m_vram[tile_index] >> 12); + + SET_TILE_INFO_MEMBER(0, code, color, 0); +} -void toki_ms_state::tokim_map(address_map &map) +TILE_GET_INFO_MEMBER(toki_ms_state::get_bk1_info) { - map(0x000000, 0x05ffff).rom(); - map(0x060000, 0x06d7ff).ram(); - map(0x06e000, 0x06e7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + int tile = m_bk1vram[tile_index]; + int color = (tile >> 12) & 0xf; + + tile &= 0xfff; + + SET_TILE_INFO_MEMBER(2, + tile, + color, + 0); } -void toki_ms_state::machine_start() +TILE_GET_INFO_MEMBER(toki_ms_state::get_bk2_info) { + int tile = m_bk2vram[tile_index]; + int color = (tile >> 12) & 0xf; + + tile &= 0xfff; + + SET_TILE_INFO_MEMBER(3, + tile, + color, + 0); } +/* +Copies from original location to an 8-bit RAM, split into two banks like paletteram. +First entry are global flags (unchecked) +Offsets are in 16-bit to make this less confusing +[0x000] tttt tttt tttt tttt ---- ---- ---- ---- tile low offset + ---- ---- ---- ---- yyyy yyyy yyyy yyyy Y offset +[0x002] xxxx xxxx xxxx xxxx ---- ---- ---- ---- X offset + ---- ---- ---- ---- ---- -f-- ---- ---- flip X + ---- ---- ---- ---- ---- --t- ---- ---- tile banking + ---- ---- ---- ---- ---- ---- tttt tttt tile upper offset +[0x200] x--- ---- ---- ---- ---- ---- ---- ---- x wraparound + ---- ---- ---- cccc ---- ---- ---- ---- color offset +[0x202] ---- ---- ---- ---- ---- ---- ---- ---- <unused> +*/ +void toki_ms_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) +{ + int x,y,flipx,color; + u16 tile; + const int bank_size = m_spriteram->bytes() / 4; + + for (int offs = bank_size-2; offs >= 2; offs -= 2) + { + u16 *lobank = &m_spriteram->buffer()[offs]; + u16 *hibank = &m_spriteram->buffer()[offs+bank_size]; + + y = 240 - (lobank[0] & 0xff); + + x = lobank[1] >> 8; + if (!(hibank[0] & 0x8000)) + x -= 256; + + flipx = (lobank[1] & 0x40); + + tile = (lobank[0] >> 8); + tile |= ((lobank[1] & 0x0f) << 8); + if (lobank[1] & 0x20) + tile |= 0x1000; + + color = (hibank[0] & 0x0f00) >> 8; + + m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, + tile, + color, + flipx,0, + x,y,15); + } +} + +void toki_ms_state::video_start() +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(toki_ms_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bk1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(toki_ms_state::get_bk1_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + m_bk2_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(toki_ms_state::get_bk2_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + + m_bk1_tilemap->set_transparent_pen(15); + m_bk2_tilemap->set_transparent_pen(15); + m_tx_tilemap->set_transparent_pen(15); + + m_paletteram = std::make_unique<u8 []>(0x800); + std::fill_n(m_paletteram.get(), 0x800, 0); + save_pointer(NAME(m_paletteram), 0x800); +} uint32_t toki_ms_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + bitmap.fill(m_palette->black_pen()); + m_bk1_tilemap->set_scrollx(0, (0x33-m_scrollram[0]) & 0x1ff ); + m_bk1_tilemap->set_scrolly(0, (511-m_scrollram[1]) & 0x1ff ); + m_bk2_tilemap->set_scrollx(0, (0x31-m_scrollram[2]) & 0x1ff ); + m_bk2_tilemap->set_scrolly(0, (511-m_scrollram[3]) & 0x1ff ); + + if (m_scrollram[4] & 1) + { + m_bk2_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_bk1_tilemap->draw(screen, bitmap, cliprect, 0, 0); + } + else + { + m_bk1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_bk2_tilemap->draw(screen, bitmap, cliprect, 0, 0); + } + draw_sprites(bitmap, cliprect); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +WRITE16_MEMBER(toki_ms_state::bk1vram_w) +{ + COMBINE_DATA(&m_bk1vram[offset]); + m_bk1_tilemap->mark_tile_dirty(offset); +} + +WRITE16_MEMBER(toki_ms_state::bk2vram_w) +{ + COMBINE_DATA(&m_bk2vram[offset]); + m_bk2_tilemap->mark_tile_dirty(offset); +} + +WRITE16_MEMBER(toki_ms_state::vram_w) +{ + COMBINE_DATA(&m_vram[offset]); + m_tx_tilemap->mark_tile_dirty(offset); +} + +READ8_MEMBER(toki_ms_state::palette_r) +{ + return m_paletteram[offset]; +} + +WRITE8_MEMBER(toki_ms_state::palette_w) +{ + m_paletteram[offset] = data; + // xBGR444 over an 8-bit bus + int r,g,b; + u16 pal_entry = offset & 0x3ff; + b = (m_paletteram[pal_entry|0x400] & 0xf); + g = (m_paletteram[pal_entry] & 0xf0) >> 4; + r = m_paletteram[pal_entry] & 0xf; + + m_palette->set_pen_color(pal_entry, pal4bit(r),pal4bit(g),pal4bit(b)); +} + +READ8_MEMBER(toki_ms_state::sound_status_r) +{ + // if non-zero skips new command, either soundlatch readback or audiocpu handshake return 0; } -static INPUT_PORTS_START( tokim ) +// TODO: remove this trampoline after confirming it just writes to the sound latch +// (definitely it isn't tied to irq 0) +WRITE8_MEMBER(toki_ms_state::sound_command_w) +{ + m_soundlatch->write(data & 0xff); +} + +void toki_ms_state::tokims_map(address_map &map) +{ + map(0x000000, 0x05ffff).rom(); + map(0x060000, 0x06dfff).ram(); + map(0x06e800, 0x06efff).ram().w(FUNC(toki_ms_state::bk1vram_w)).share("bk1vram"); + map(0x06f000, 0x06f7ff).ram().w(FUNC(toki_ms_state::bk2vram_w)).share("bk2vram"); + map(0x06f800, 0x06ffff).ram().w(FUNC(toki_ms_state::vram_w)).share("vram"); + map(0x070000, 0x0707ff).rw(FUNC(toki_ms_state::palette_r), FUNC(toki_ms_state::palette_w)).umask16(0xffff); + map(0x071000, 0x0713ff).ram().share("spriteram"); + map(0x072000, 0x072001).nopr(); // irq ack? + map(0x073000, 0x07300f).ram().share("scrollram"); + map(0x0a0000, 0x0a005f).nopw(); // scrollram left-over? + map(0x0c0000, 0x0c0001).portr("DSW"); + map(0x0c0002, 0x0c0003).portr("INPUTS"); + map(0x0c0004, 0x0c0005).portr("SYSTEM"); + map(0x0c000e, 0x0c000f).rw(FUNC(toki_ms_state::sound_status_r), FUNC(toki_ms_state::sound_command_w)).umask16(0x00ff); +} + +WRITE8_MEMBER(toki_ms_state::adpcm_w) +{ +// membank("sound_bank")->set_entry(((data & 0x10) >> 4) ^ 1); + m_msm->reset_w(BIT(data, 4)); + + m_adpcm_data = data & 0xf; + //m_msm->write_data(data & 0xf); +// m_msm->vclk_w(BIT(data, 7)); + //m_msm->vclk_w(1); + //m_msm->vclk_w(0); +} + + +void toki_ms_state::audio_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x8000).w(FUNC(toki_ms_state::adpcm_w)); + map(0x8000, 0xbfff).bankr("sound_bank"); + map(0xc000, 0xc7ff).ram(); + map(0xd000, 0xd7ff).ram(); + // area 0xdff0-5 is never ever readback, applying a RAM mirror causes sound to go significantly worse, + // what they are even for? + map(0xdfff, 0xdfff).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xe000, 0xe001).w(m_ym1, FUNC(ym2203_device::write)); + map(0xe002, 0xe003).w(m_ym2, FUNC(ym2203_device::write)); + map(0xe008, 0xe009).r(m_ym1, FUNC(ym2203_device::read)); + map(0xe00a, 0xe00b).r(m_ym2, FUNC(ym2203_device::read)); +} + +static INPUT_PORTS_START( tokims ) + // TODO: same as tokib, subclass into tokib_io_device + PORT_START("DSW") + PORT_DIPNAME( 0x001f, 0x001f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4,5") + PORT_DIPSETTING( 0x0015, DEF_STR( 6C_1C ) ) + PORT_DIPSETTING( 0x0017, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x0019, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x001b, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0003, DEF_STR( 8C_3C ) ) + PORT_DIPSETTING( 0x001d, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0005, DEF_STR( 5C_3C ) ) + PORT_DIPSETTING( 0x0007, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x001f, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0009, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0013, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0011, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x000f, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x000d, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x000b, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x001e, "A 1/1 B 1/2" ) + PORT_DIPSETTING( 0x0014, "A 2/1 B 1/3" ) + PORT_DIPSETTING( 0x000a, "A 3/1 B 1/5" ) + PORT_DIPSETTING( 0x0000, "A 5/1 B 1/6" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x0020, 0x0000, "Joysticks" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x0020, "1" ) + PORT_DIPSETTING( 0x0000, "2" ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x0200, "2" ) + PORT_DIPSETTING( 0x0300, "3" ) + PORT_DIPSETTING( 0x0100, "5" ) + PORT_DIPSETTING( 0x0000, "Infinite (Cheat)") + PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPSETTING( 0x0800, "50000 150000" ) + PORT_DIPSETTING( 0x0000, "70000 140000 210000" ) + PORT_DIPSETTING( 0x0c00, "70000" ) + PORT_DIPSETTING( 0x0400, "100000 200000" ) + PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x2000, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x3000, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("INPUTS") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("SYSTEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) INPUT_PORTS_END static const gfx_layout tiles16x16x4_layout = @@ -84,35 +648,84 @@ static const gfx_layout tiles16x16x4_layout = 16 * 16 * 4 }; + +static const gfx_layout tokib_tilelayout = +{ + 16,16, /* 16 by 16 */ + 4096, /* 4096 characters */ + 4, /* 4 bits per pixel */ + { 4096*16*16*3,4096*16*16*2,4096*16*16*1,4096*16*16*0 }, /* planes */ + { 0, 1, 2, 3, 4, 5, 6, 7, + 0x8000*8+0, 0x8000*8+1, 0x8000*8+2, 0x8000*8+3, 0x8000*8+4, + 0x8000*8+5, 0x8000*8+6, 0x8000*8+7 }, /* x bit */ + { + 0,8,16,24,32,40,48,56, + 0x10000*8+ 0, 0x10000*8+ 8, 0x10000*8+16, 0x10000*8+24, 0x10000*8+32, + 0x10000*8+40, 0x10000*8+48, 0x10000*8+56 }, /* y bit */ + 8*8 +}; + static GFXDECODE_START( gfx_toki_ms ) - GFXDECODE_ENTRY( "gfx1", 0, tiles16x16x4_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, tiles16x16x4_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, tiles16x16x4_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, tiles16x16x4_layout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_planar, 0x100, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, tiles16x16x4_layout, 0x000, 16 ) + GFXDECODE_ENTRY( "gfx3", 0, tokib_tilelayout, 0x200, 16 ) + GFXDECODE_ENTRY( "gfx4", 0, tokib_tilelayout, 0x300, 16 ) GFXDECODE_END -void toki_ms_state::tokim(machine_config &config) +void toki_ms_state::machine_start() +{ + membank("sound_bank")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x8000, 0x4000); +} + +WRITE_LINE_MEMBER(toki_ms_state::adpcm_int) +{ + m_msm->write_data(m_adpcm_data); + m_audiocpu->set_input_line(0, HOLD_LINE); +} + +void toki_ms_state::tokims(machine_config &config) { /* basic machine hardware */ - M68000(config, m_maincpu, 12_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &toki_ms_state::tokim_map); + M68000(config, m_maincpu, 20_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &toki_ms_state::tokims_map); m_maincpu->set_vblank_int("screen", FUNC(toki_ms_state::irq1_line_hold)); + Z80(config, m_audiocpu, XTAL(4'000'000)); + m_audiocpu->set_addrmap(AS_PROGRAM, &toki_ms_state::audio_map); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); - m_screen->set_size(256, 256); - m_screen->set_visarea(0, 256-1, 0, 256-32-1); + m_screen->set_raw(20_MHz_XTAL / 3, 426, 0, 256, 272, 16, 240); // FIXME: generic, not measured m_screen->set_screen_update(FUNC(toki_ms_state::screen_update)); m_screen->set_palette(m_palette); + m_screen->screen_vblank().set("spriteram", FUNC(buffered_spriteram16_device::vblank_copy_rising)); - PALETTE(config, m_palette).set_format(palette_device::xRGB_444, 0x400); + PALETTE(config, m_palette).set_entries(0x400); GFXDECODE(config, m_gfxdecode, "palette", gfx_toki_ms); + BUFFERED_SPRITERAM16(config, m_spriteram); + + GENERIC_LATCH_8(config, m_soundlatch); + /* sound hardware */ SPEAKER(config, "mono").front_center(); + YM2203(config, m_ym1, XTAL(4'000'000)/4); // unknown clock + m_ym1->add_route(0, "mono", 0.15); + m_ym1->add_route(1, "mono", 0.15); + m_ym1->add_route(2, "mono", 0.15); + m_ym1->add_route(3, "mono", 0.10); + + YM2203(config, m_ym2, XTAL(4'000'000)/4); // unknown clock + m_ym2->add_route(0, "mono", 0.15); + m_ym2->add_route(1, "mono", 0.15); + m_ym2->add_route(2, "mono", 0.15); + m_ym2->add_route(3, "mono", 0.10); + + MSM5205(config, m_msm, XTAL(384'000)); // unknown clock + m_msm->vck_legacy_callback().set(FUNC(toki_ms_state::adpcm_int)); + m_msm->set_prescaler_selector(msm5205_device::S48_4B); // unverified + m_msm->add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -128,7 +741,13 @@ ROM_START( tokims ) ROM_REGION( 0x010000, "audiocpu", 0 ) /* Z80 code */ ROM_LOAD( "1_tk_101.c19", 0x000000, 0x10000, CRC(a447a394) SHA1(ccaa6aca5c2afc7c05035cb551b8368b18188dd6) ) - ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF ) // sprites (same rom subboard type as galpanic_ms.cpp) + ROM_REGION( 0x040000, "gfx1", 0 ) + ROM_LOAD( "8_tk_825.ic9", 0x000000, 0x10000, CRC(6d04def0) SHA1(36f23b0893dfae6cf4c6f4414ff54bb13cfdad41) ) + ROM_LOAD( "8_tk_826.ic16", 0x010000, 0x10000, CRC(d3a2a038) SHA1(a2a020397a427f5fd401aad09048c7d4a21cd728) ) + ROM_LOAD( "8_tk_827.ic24", 0x020000, 0x10000, CRC(d254ae6c) SHA1(cdbdd7d7c6cd4de8b8a0f54e1543caba5f3d11cb) ) + ROM_LOAD( "8_tk_828.ic31", 0x030000, 0x10000, CRC(a6fae34b) SHA1(d9a276d30bdcc25d9cd299c2502cf910273890f6) ) + + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASEFF | ROMREGION_INVERT ) // sprites (same rom subboard type as galpanic_ms.cpp) ROM_LOAD32_BYTE( "5_tk_501.ic3", 0x000003, 0x010000, CRC(c3cd26b6) SHA1(20d5a68eada4150642365dd61c699b7771de5372) ) ROM_LOAD32_BYTE( "5_tk_505.ic12", 0x000002, 0x010000, CRC(ec096351) SHA1(10417266c2280b2d9c301423d8c41ed73d9654c9) ) ROM_LOAD32_BYTE( "5_tk_509.ic18", 0x000001, 0x010000, CRC(a1a4ef7b) SHA1(92aad84f14f8257477920012bd1fe033ec96301b) ) @@ -149,12 +768,6 @@ ROM_START( tokims ) ROM_LOAD32_BYTE( "5_tk_512.ic21", 0x0c0001, 0x010000, CRC(0228110f) SHA1(33a29f9f458ca9d0af3c8da8a5b67bab79cecdec) ) ROM_LOAD32_BYTE( "5_tk_516.ic27", 0x0c0000, 0x010000, CRC(f4e29429) SHA1(706050b51e0afbddf6ec5c8f14d3649bb05c8550) ) - ROM_REGION( 0x040000, "gfx2", 0 ) - ROM_LOAD( "8_tk_825.ic9", 0x000000, 0x10000, CRC(6d04def0) SHA1(36f23b0893dfae6cf4c6f4414ff54bb13cfdad41) ) - ROM_LOAD( "8_tk_826.ic16", 0x010000, 0x10000, CRC(d3a2a038) SHA1(a2a020397a427f5fd401aad09048c7d4a21cd728) ) - ROM_LOAD( "8_tk_827.ic24", 0x020000, 0x10000, CRC(d254ae6c) SHA1(cdbdd7d7c6cd4de8b8a0f54e1543caba5f3d11cb) ) - ROM_LOAD( "8_tk_828.ic31", 0x030000, 0x10000, CRC(a6fae34b) SHA1(d9a276d30bdcc25d9cd299c2502cf910273890f6) ) - ROM_REGION( 0x080000, "gfx3", 0 ) // same ROMs as some of the other Toki bootlegs ROM_LOAD( "8_tk_809.ic13", 0x000000, 0x10000, CRC(feb13d35) SHA1(1b78ce1e48d16e58ad0721b30ab87765ded7d24e) ) ROM_LOAD( "8_tk_813.ic12", 0x010000, 0x10000, CRC(5b365637) SHA1(434775b0614d904beaf40d7e00c1eaf59b704cb1) ) @@ -188,11 +801,47 @@ ROM_START( tokims ) ROM_LOAD( "7_7640_gal20v8-20hb1.ic44", 0, 1, NO_DUMP ) ROM_LOAD( "51_503_palce16v8h-25pc.ic46", 0, 1, NO_DUMP ) - ROM_REGION( 0x100, "proms", ROMREGION_ERASEFF ) - ROM_LOAD( "1_10110_82s123.ic20", 0x0000, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) + ROM_REGION( 0x400, "proms", ROMREGION_ERASE00 ) ROM_LOAD( "51_502_82s129an.ic10", 0x0000, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) // same as every other modular bootleg - ROM_LOAD( "21_201_82s129.ic4", 0x0000, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) - ROM_LOAD( "21_202_82s129.ic12", 0x0000, 0x100, CRC(e434128a) SHA1(ef0f6d8daef8b25211095577a182cdf120a272c1) ) + ROM_LOAD( "21_201_82s129.ic4", 0x0100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) + ROM_LOAD( "21_202_82s129.ic12", 0x0200, 0x100, CRC(e434128a) SHA1(ef0f6d8daef8b25211095577a182cdf120a272c1) ) + ROM_LOAD( "1_10110_82s123.ic20", 0x0300, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) ROM_END -GAME( 1991, tokims, toki, tokim, tokim, toki_ms_state, empty_init, ROT0, "bootleg", "Toki (Modular System)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +void toki_ms_state::init_tokims() +{ + // copied verbatim from toki.cpp + uint8_t temp[0x20000]; + + int len = memregion("gfx3")->bytes(); + uint8_t *rom = memregion("gfx3")->base(); + for (int offs = 0; offs < len; offs += 0x20000) + { + uint8_t *base = &rom[offs]; + memcpy (&temp[0], base, 65536 * 2); + for (int i = 0; i < 16; i++) + { + memcpy(&base[0x00000 + i * 0x800], &temp[0x0000 + i * 0x2000], 0x800); + memcpy(&base[0x10000 + i * 0x800], &temp[0x0800 + i * 0x2000], 0x800); + memcpy(&base[0x08000 + i * 0x800], &temp[0x1000 + i * 0x2000], 0x800); + memcpy(&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800); + } + } + + len = memregion("gfx4")->bytes(); + rom = memregion("gfx4")->base(); + for (int offs = 0; offs < len; offs += 0x20000) + { + uint8_t *base = &rom[offs]; + memcpy (&temp[0], base, 65536 * 2); + for (int i = 0; i < 16; i++) + { + memcpy(&base[0x00000 + i * 0x800], &temp[0x0000 + i * 0x2000], 0x800); + memcpy(&base[0x10000 + i * 0x800], &temp[0x0800 + i * 0x2000], 0x800); + memcpy(&base[0x08000 + i * 0x800], &temp[0x1000 + i * 0x2000], 0x800); + memcpy(&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800); + } + } +} + +GAME( 1991, tokims, toki, tokims, tokims, toki_ms_state, init_tokims, ROT0, "bootleg", "Toki (Modular System)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/trackfld.cpp b/src/mame/drivers/trackfld.cpp index 2899dd62a42..a96c35826f3 100644 --- a/src/mame/drivers/trackfld.cpp +++ b/src/mame/drivers/trackfld.cpp @@ -1717,8 +1717,8 @@ GAME( 1983, hyprolym, trackfld, trackfld, trackfld, trackfld_state, init_trac GAME( 1983, hyprolymb, trackfld, hyprolyb, trackfld, trackfld_state, init_trackfld, ROT0, "bootleg", "Hyper Olympic (bootleg, set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1983, hyprolymba, trackfld, hyprolyb, trackfld, trackfld_state, init_trackfld, ROT0, "bootleg", "Hyper Olympic (bootleg, set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1983, hipoly, trackfld, hyprolyb, trackfld, trackfld_state, init_trackfld, ROT0, "bootleg", "Hipoly (bootleg of Hyper Olympic)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, atlantol, trackfld, atlantol, atlantol, trackfld_state, init_atlantol, ROT0, "bootleg", "Atlant Olimpic", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, trackfldnz, trackfld, trackfld, trackfld, trackfld_state, init_trackfldnz, ROT0, "bootleg? (Goldberg Enterprizes Inc.)", "Track & Field (NZ bootleg?)", MACHINE_SUPPORTS_SAVE) // bootleg of the Centuri version +GAME( 1996, atlantol, trackfld, atlantol, atlantol, trackfld_state, init_atlantol, ROT0, "bootleg", "Atlant Olimpic (Italian bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, trackfldnz, trackfld, trackfld, trackfld, trackfld_state, init_trackfldnz, ROT0, "bootleg? (Goldberg Enterprizes Inc.)", "Track & Field (NZ bootleg?)", MACHINE_SUPPORTS_SAVE ) // bootleg of the Centuri version GAME( 1988, mastkin, 0, mastkin, mastkin, trackfld_state, init_mastkin, ROT0, "Du Tech", "The Masters of Kin", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/triforce.cpp b/src/mame/drivers/triforce.cpp index db62b352c7f..b795ac38cac 100644 --- a/src/mame/drivers/triforce.cpp +++ b/src/mame/drivers/triforce.cpp @@ -1162,7 +1162,7 @@ ROM_END // For instance, the dump of mkartagp skips two blocks in its lookup list, and the 16 'lanes' in the // 0x78020-0x7802f area are 00 except for two values, which are 1. The corresponding two skipped blocks // in the flash area are all zero/unused. -// Likewise, with mkartagp2, there are three 1 value and one 2 values in the table, +// Likewise, with mkartagp2, there are three 1 value and one 2 values in the table, // and mkartagp2 skips 5 blocks in its mapping table. // * 0x79ffc-0x79fff contains what may be a checksum of the 0x78000-0x79ffb area? unclear. diff --git a/src/mame/drivers/trkfldch.cpp b/src/mame/drivers/trkfldch.cpp index 12c88d3a3b0..81bd68b64c7 100644 --- a/src/mame/drivers/trkfldch.cpp +++ b/src/mame/drivers/trkfldch.cpp @@ -20,6 +20,16 @@ The G65816 code on these is VERY ugly and difficult to follow, many redundant st One of the vectors points to 0x6000, there is nothing mapped there, could it be a small internal ROM or some debug trap for development? + +--- + +4 Player System notes: + +Mountain Bike Rally uses scrolling / split (helps confirm the same row skip logic seen in other games when using split) +Turn and Whack (cards) game runs far too quickly (might show us where timer config is) +The Power Game game also appears to run far too quickly +Territory Pursuit uses y-flipped sprites + */ #include "emu.h" @@ -43,7 +53,8 @@ public: m_mainram(*this, "mainram"), m_spriteram(*this, "spriteram"), m_palram(*this, "palram"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_in(*this, "IN%u", 0U) { } void trkfldch(machine_config &config); @@ -63,6 +74,7 @@ private: required_shared_ptr<uint8_t> m_spriteram; required_shared_ptr<uint8_t> m_palram; required_device<palette_device> m_palette; + required_ioport_array<4> m_in; void draw_sprites(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect, int pri); void render_text_tile_layer(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect, uint16_t base); @@ -280,14 +292,26 @@ void trkfldch_state::draw_sprites(screen_device& screen, bitmap_ind16& bitmap, c { int priority = (m_spriteram[i + 4] & 0x20)>>5; - // list is NOT drawn but instead z sorted, see shadows in trkfldch + // list is NOT drawn in order, but instead z sorted, see shadows in trkfldch if (priority != pri) continue; // logerror("entry %02x %02x %02x %02x %02x\n", m_spriteram[i + 0], m_spriteram[i + 1], m_spriteram[i + 2], m_spriteram[i + 3], m_spriteram[i + 4]); int tilegfxbase = (m_modebank[0x05] * 0x800); - // --pp tt-y yyyy yyyy tttt tttt yyyy yyyy --zf -t-x + /* m_spriteram[i + 0] --pp tt-y + m_spriteram[i + 1] yyyy yyyy + m_spriteram[i + 2] tttt tttt + m_spriteram[i + 3] xxxx xxxx + m_spriteram[i + 4] --zfF-t-x + + p = palette bits + t = tile bites + y = y pos bits + x = x pos bits + z = priority + fF = x/y flip + */ int y = m_spriteram[i + 1]; int x = m_spriteram[i + 3]; @@ -300,6 +324,7 @@ void trkfldch_state::draw_sprites(screen_device& screen, bitmap_ind16& bitmap, c int pal = 0; int flipx = m_spriteram[i + 4] & 0x10; + int flipy = m_spriteram[i + 4] & 0x08; if (tilehigh) tile += 0x100; @@ -337,7 +362,7 @@ void trkfldch_state::draw_sprites(screen_device& screen, bitmap_ind16& bitmap, c } - gfx->transpen(bitmap, cliprect, tile + tilegfxbase, pal, flipx, 0, x, y, 0); + gfx->transpen(bitmap, cliprect, tile + tilegfxbase, pal, flipx, flipy, x, y, 0); } } @@ -511,6 +536,18 @@ WRITE8_MEMBER(trkfldch_state::tmap1_scroll_window_w) READ8_MEMBER(trkfldch_state::dmaregs_r) { uint8_t ret = m_dmaregs[offset]; + + switch (offset) + { + case 0x05: // abl4play polls this expecting it to be 0 to continue (probably becomes after DMA is complete, or can show the status in realtime?) + ret = 0x00; + break; + + case 0x06: // abl4play polls this expecting it to be 0 to continue (probably becomes after DMA is complete, or can show the status in realtime?) + ret = 0x00; + break; + } + logerror("%s: dmaregs_r %04x (returning %02x)\n", machine().describe_context(), offset, ret); return ret; } @@ -728,7 +765,7 @@ void trkfldch_state::trkfldch_map(address_map &map) map(0x007870, 0x0078ff).rw(FUNC(trkfldch_state::unkregs_r), FUNC(trkfldch_state::unkregs_w)); - map(0x008000, 0x3fffff).rom().region("maincpu", 0x000000); // good for code mapped at 008000 and 050000 at least + map(0x008000, 0x7fffff).rom().region("maincpu", 0x000000); // good for code mapped at 008000 and 050000 at least } void trkfldch_state::vectors_map(address_map &map) @@ -863,6 +900,9 @@ static INPUT_PORTS_START( trkfldch ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_START("IN3") INPUT_PORTS_END static INPUT_PORTS_START( my1stddr ) @@ -905,6 +945,51 @@ static INPUT_PORTS_START( my1stddr ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_START("IN3") +INPUT_PORTS_END + +static INPUT_PORTS_START( abl4play ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Select") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -1092,17 +1177,19 @@ READ8_MEMBER(trkfldch_state::unkregs_r) { case 0x00: // read in irq (inputs?) - ret = ioport("IN0")->read(); - logerror("%s: unkregs_r %04x (returning %02x)\n", machine().describe_context(), offset, ret); + ret = m_in[0]->read(); + logerror("%s: unkregs_r %04x (returning %02x) (Player 1 inputs)\n", machine().describe_context(), offset, ret); break; case 0x01: - ret = ioport("IN1")->read(); logerror("%s: unkregs_r %04x (returning %02x)\n", machine().describe_context(), offset, ret); break; + // 0x02 + case 0x03: - logerror("%s: unkregs_r %04x (returning %02x)\n", machine().describe_context(), offset, ret); + ret = m_in[1]->read(); + logerror("%s: unkregs_r %04x (returning %02x) (Player 2 inputs)\n", machine().describe_context(), offset, ret); break; case 0x04: @@ -1118,9 +1205,20 @@ READ8_MEMBER(trkfldch_state::unkregs_r) break; case 0x07: - logerror("%s: unkregs_r %04x (returning %02x)\n", machine().describe_context(), offset, ret); + ret = m_in[2]->read(); + logerror("%s: unkregs_r %04x (returning %02x) (Player 3 inputs)\n", machine().describe_context(), offset, ret); break; + // 0x08 + // 0x09 + // 0x0a + + case 0x0b: + ret = m_in[3]->read(); + logerror("%s: unkregs_r %04x (returning %02x) (Player 4 inputs)\n", machine().describe_context(), offset, ret); + break; + + case 0x0f: logerror("%s: unkregs_r %04x (returning %02x)\n", machine().describe_context(), offset, ret); break; @@ -1328,16 +1426,22 @@ void trkfldch_state::trkfldch(machine_config &config) } ROM_START( trkfldch ) - ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "trackandfield.bin", 0x000000, 0x400000, CRC(f4f1959d) SHA1(344dbfe8df1897adf77da6e5ca0435c4d47d6842) ) ROM_END ROM_START( my1stddr ) - ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "myfirstddr.bin", 0x000000, 0x400000, CRC(2ef57bfc) SHA1(9feea5adb9de8fe17e915f3a037e8ddd70e58ae7) ) ROM_END +ROM_START( abl4play ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "abl4play.bin", 0x000000, 0x800000, CRC(5d57fb70) SHA1(34cdf80dc8cb08e5cd98c724268e4c5f483780d7) ) +ROM_END + CONS( 2007, trkfldch, 0, 0, trkfldch, trkfldch,trkfldch_state, empty_init, "Konami", "Track & Field Challenge", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) CONS( 2006, my1stddr, 0, 0, trkfldch, my1stddr,trkfldch_state, empty_init, "Konami", "My First Dance Dance Revolution (US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // Japan version has different songs +CONS( 200?, abl4play, 0, 0, trkfldch, abl4play,trkfldch_state, empty_init, "Advance Bright Ltd", "4 Player System - 10 in 1", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/drivers/tsamurai.cpp b/src/mame/drivers/tsamurai.cpp index 0182fd37168..2e1438a8a70 100644 --- a/src/mame/drivers/tsamurai.cpp +++ b/src/mame/drivers/tsamurai.cpp @@ -1340,56 +1340,56 @@ ROM_END ROM_START( ringfgt ) ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 code - main CPU */ - ROM_LOAD( "rft04-1", 0x0000, 0x2000, CRC(11030866) SHA1(b95b231c241e5bdc002de3f6a732cd627c7dc145) ) - ROM_LOAD( "rft03-1", 0x2000, 0x2000, CRC(357a2085) SHA1(0534f6c1a876dacfcff09a547290354eeddb3126) ) + ROM_LOAD( "rft_04-1.5a", 0x0000, 0x2000, CRC(11030866) SHA1(b95b231c241e5bdc002de3f6a732cd627c7dc145) ) + ROM_LOAD( "rft_03-1.5c", 0x2000, 0x2000, CRC(357a2085) SHA1(0534f6c1a876dacfcff09a547290354eeddb3126) ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code - sound CPU */ - ROM_LOAD( "6.5n", 0x0000, 0x2000, CRC(785b9000) SHA1(9eb32724b0611a93959485a7f9c806eb6d7ab013) ) - ROM_LOAD( "5.5l", 0x2000, 0x2000, CRC(76dbfde9) SHA1(fe6e02f4b5a0a5baa59506636226c8ea7b551ef6) ) + ROM_LOAD( "rft_01.5n", 0x0000, 0x2000, CRC(785b9000) SHA1(9eb32724b0611a93959485a7f9c806eb6d7ab013) ) + ROM_LOAD( "rft_02.5l", 0x2000, 0x2000, CRC(76dbfde9) SHA1(fe6e02f4b5a0a5baa59506636226c8ea7b551ef6) ) ROM_REGION( 0xc000, "gfx1", ROMREGION_ERASEFF ) /* tiles (N/A) */ ROM_REGION( 0x6000, "gfx2", 0 ) /* characters */ - ROM_LOAD( "rft05", 0x0000, 0x1000, CRC(a7b732fd) SHA1(2abe4b422a7cd32cd12c6d6acba1872afe4a2ecc) ) - ROM_LOAD( "rft06", 0x2000, 0x1000, CRC(ff2721f7) SHA1(ae75103a7663a190da36e0bb2d46a333f830eba5) ) - ROM_LOAD( "rft07", 0x4000, 0x1000, CRC(ec1d7ba4) SHA1(047aa3c6c92126ac623fddbe0adc50a450910d6e) ) + ROM_LOAD( "rft_05.6f", 0x0000, 0x1000, CRC(a7b732fd) SHA1(2abe4b422a7cd32cd12c6d6acba1872afe4a2ecc) ) + ROM_LOAD( "rft_06.7f", 0x2000, 0x1000, CRC(ff2721f7) SHA1(ae75103a7663a190da36e0bb2d46a333f830eba5) ) + ROM_LOAD( "rft_07.8f", 0x4000, 0x1000, CRC(ec1d7ba4) SHA1(047aa3c6c92126ac623fddbe0adc50a450910d6e) ) ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ - ROM_LOAD( "rft08", 0x0000, 0x2000, CRC(80d67d28) SHA1(f4016159201abdfe0c0441f78ed6a1a12b7ba34b) ) - ROM_LOAD( "rft09", 0x4000, 0x2000, CRC(ea8f0656) SHA1(c4d2302d046c41bae9946a5ddc0087349a421b35) ) - ROM_LOAD( "rft10", 0x8000, 0x2000, CRC(833ca89f) SHA1(b43416e783e6109d19de81a124fae84f1afb8440) ) + ROM_LOAD( "rft_08.15j", 0x0000, 0x2000, CRC(80d67d28) SHA1(f4016159201abdfe0c0441f78ed6a1a12b7ba34b) ) + ROM_LOAD( "rft_09.15h", 0x4000, 0x2000, CRC(ea8f0656) SHA1(c4d2302d046c41bae9946a5ddc0087349a421b35) ) + ROM_LOAD( "rft_10.15f", 0x8000, 0x2000, CRC(833ca89f) SHA1(b43416e783e6109d19de81a124fae84f1afb8440) ) ROM_REGION( 0x300, "proms", 0 ) - ROM_LOAD( "clr.6s", 0x000, 0x0100, CRC(578bfbea) SHA1(12a97de0f8012ccce75e14abf743bcec6857684c) ) - ROM_LOAD( "clr.6r", 0x100, 0x0100, CRC(3ec00739) SHA1(614d1799fe197df389f6155f86fe113e1b0b018a) ) - ROM_LOAD( "clr.6p", 0x200, 0x0100, CRC(0e4fd17a) SHA1(d4e32bd9dd903177af61f77976a25c5db1467bba) ) + ROM_LOAD( "rft-11.6s", 0x000, 0x0100, CRC(578bfbea) SHA1(12a97de0f8012ccce75e14abf743bcec6857684c) ) + ROM_LOAD( "rft-12.6r", 0x100, 0x0100, CRC(3ec00739) SHA1(614d1799fe197df389f6155f86fe113e1b0b018a) ) + ROM_LOAD( "rft-13.6p", 0x200, 0x0100, CRC(0e4fd17a) SHA1(d4e32bd9dd903177af61f77976a25c5db1467bba) ) ROM_END ROM_START( ringfgt2 ) ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 code - main CPU */ - ROM_LOAD( "rft.04", 0x0000, 0x2000, CRC(6b9b3f3d) SHA1(ea75e77e0e3379a22381b1d0aae7f96b53cd7562) ) - ROM_LOAD( "rft.03", 0x2000, 0x2000, CRC(1821974b) SHA1(1ce52f20bf49c111000f870bbe3416d27673b91d) ) + ROM_LOAD( "rft_04.5a", 0x0000, 0x2000, CRC(6b9b3f3d) SHA1(ea75e77e0e3379a22381b1d0aae7f96b53cd7562) ) + ROM_LOAD( "rft_03.5c", 0x2000, 0x2000, CRC(1821974b) SHA1(1ce52f20bf49c111000f870bbe3416d27673b91d) ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code - sound CPU */ - ROM_LOAD( "6.5n", 0x0000, 0x2000, CRC(785b9000) SHA1(9eb32724b0611a93959485a7f9c806eb6d7ab013) ) - ROM_LOAD( "5.5l", 0x2000, 0x2000, CRC(76dbfde9) SHA1(fe6e02f4b5a0a5baa59506636226c8ea7b551ef6) ) + ROM_LOAD( "rft_01.5n", 0x0000, 0x2000, CRC(785b9000) SHA1(9eb32724b0611a93959485a7f9c806eb6d7ab013) ) + ROM_LOAD( "rft_02.5l", 0x2000, 0x2000, CRC(76dbfde9) SHA1(fe6e02f4b5a0a5baa59506636226c8ea7b551ef6) ) ROM_REGION( 0xc000, "gfx1", ROMREGION_ERASEFF ) /* tiles (N/A) */ ROM_REGION( 0x6000, "gfx2", 0 ) /* characters */ - ROM_LOAD( "rft05", 0x0000, 0x1000, CRC(a7b732fd) SHA1(2abe4b422a7cd32cd12c6d6acba1872afe4a2ecc) ) - ROM_LOAD( "rft06", 0x2000, 0x1000, CRC(ff2721f7) SHA1(ae75103a7663a190da36e0bb2d46a333f830eba5) ) - ROM_LOAD( "rft07", 0x4000, 0x1000, CRC(ec1d7ba4) SHA1(047aa3c6c92126ac623fddbe0adc50a450910d6e) ) + ROM_LOAD( "rft_05.6f", 0x0000, 0x1000, CRC(a7b732fd) SHA1(2abe4b422a7cd32cd12c6d6acba1872afe4a2ecc) ) + ROM_LOAD( "rft_06.7f", 0x2000, 0x1000, CRC(ff2721f7) SHA1(ae75103a7663a190da36e0bb2d46a333f830eba5) ) + ROM_LOAD( "rft_07.8f", 0x4000, 0x1000, CRC(ec1d7ba4) SHA1(047aa3c6c92126ac623fddbe0adc50a450910d6e) ) ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ - ROM_LOAD( "rft08", 0x0000, 0x2000, CRC(80d67d28) SHA1(f4016159201abdfe0c0441f78ed6a1a12b7ba34b) ) - ROM_LOAD( "rft09", 0x4000, 0x2000, CRC(ea8f0656) SHA1(c4d2302d046c41bae9946a5ddc0087349a421b35) ) - ROM_LOAD( "rft10", 0x8000, 0x2000, CRC(833ca89f) SHA1(b43416e783e6109d19de81a124fae84f1afb8440) ) + ROM_LOAD( "rft_08.15j", 0x0000, 0x2000, CRC(80d67d28) SHA1(f4016159201abdfe0c0441f78ed6a1a12b7ba34b) ) + ROM_LOAD( "rft_09.15h", 0x4000, 0x2000, CRC(ea8f0656) SHA1(c4d2302d046c41bae9946a5ddc0087349a421b35) ) + ROM_LOAD( "rft_10.15f", 0x8000, 0x2000, CRC(833ca89f) SHA1(b43416e783e6109d19de81a124fae84f1afb8440) ) ROM_REGION( 0x300, "proms", 0 ) - ROM_LOAD( "clr.6s", 0x000, 0x0100, CRC(578bfbea) SHA1(12a97de0f8012ccce75e14abf743bcec6857684c) ) - ROM_LOAD( "clr.6r", 0x100, 0x0100, CRC(3ec00739) SHA1(614d1799fe197df389f6155f86fe113e1b0b018a) ) - ROM_LOAD( "clr.6p", 0x200, 0x0100, CRC(0e4fd17a) SHA1(d4e32bd9dd903177af61f77976a25c5db1467bba) ) + ROM_LOAD( "rft-11.6s", 0x000, 0x0100, CRC(578bfbea) SHA1(12a97de0f8012ccce75e14abf743bcec6857684c) ) + ROM_LOAD( "rft-12.6r", 0x100, 0x0100, CRC(3ec00739) SHA1(614d1799fe197df389f6155f86fe113e1b0b018a) ) + ROM_LOAD( "rft-13.6p", 0x200, 0x0100, CRC(0e4fd17a) SHA1(d4e32bd9dd903177af61f77976a25c5db1467bba) ) ROM_END void tsamurai_state::init_the26thz() diff --git a/src/mame/drivers/tti.cpp b/src/mame/drivers/tti.cpp index 16b1f5b8815..f1fdd6590f5 100644 --- a/src/mame/drivers/tti.cpp +++ b/src/mame/drivers/tti.cpp @@ -116,11 +116,11 @@ void tti_state::channel_w(u8 data) void tti_state::prg_map(address_map &map) { - map(0x00000, 0x07fff).rom().region("maincpu", 0); + map(0x00000, 0x07fff).rom().region("firmware", 0); map(0x7e000, 0x7ffff).ram(); map(0x80000, 0x80017).rw(m_mfp, FUNC(mc68901_device::read), FUNC(mc68901_device::write)); map(0x80018, 0x8001f).ram(); - map(0x80020, 0x8002b).rw(FUNC(tti_state::asc_r), FUNC(tti_state::asc_w)); + map(0x80020, 0x80029).rw(FUNC(tti_state::asc_r), FUNC(tti_state::asc_w)); map(0x80070, 0x80077).w("bitlatch", FUNC(ls259_device::write_d0)); map(0x80078, 0x8007b).w(FUNC(tti_state::dma_address_w)); map(0x8007c, 0x8007c).r(FUNC(tti_state::io_status_r)); @@ -157,9 +157,9 @@ void tti_state::tti(machine_config &config) m_maincpu->set_addrmap(m68008_device::AS_CPU_SPACE, &tti_state::fc7_map); MC68901(config, m_mfp, 20_MHz_XTAL / 2); // guess - m_mfp->set_timer_clock(20_MHz_XTAL / 2); // guess - m_mfp->set_rx_clock(9600); // for testing (FIXME: actually 16x) - m_mfp->set_tx_clock(9600); // for testing (FIXME: actually 16x) + m_mfp->set_timer_clock(20_MHz_XTAL / 8); // guess + m_mfp->out_tco_cb().set(m_mfp, FUNC(mc68901_device::rc_w)); + m_mfp->out_tco_cb().append(m_mfp, FUNC(mc68901_device::tc_w)); m_mfp->out_so_cb().set("rs232", FUNC(rs232_port_device::write_txd)); m_mfp->out_irq_cb().set_inputline("maincpu", M68K_IRQ_2); // probably @@ -174,7 +174,7 @@ void tti_state::tti(machine_config &config) NSCSI_CONNECTOR(config, "scsibus:7", tti_scsi_devices, "asc", true).set_option_machine_config("asc", [this] (device_t *device) { asc_config(device); }); rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); - rs232.rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); + rs232.rxd_handler().set(m_mfp, FUNC(mc68901_device::si_w)); EEPROM_X24C44_16BIT(config, "novram").do_callback().set("mfp", FUNC(mc68901_device::i0_w)); @@ -185,9 +185,11 @@ void tti_state::tti(machine_config &config) } ROM_START( tti ) - ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD( "tti_10012000_rev2.3.bin", 0x0000, 0x8000, CRC(95a5bce8) SHA1(46d7c99e37ca5598aec2062dfd9759853a237c14) ) - ROM_LOAD( "tti_10012000_rev1.7.bin", 0x0000, 0x8000, CRC(6660c059) SHA1(05d97009b5b8034dda520f655c73c474da97f822) ) + ROM_REGION(0x8000, "firmware", 0) + ROM_SYSTEM_BIOS(0, "v2.3", "Firmware Version 2.3") + ROMX_LOAD("tti_10012000_rev2.3.bin", 0x0000, 0x8000, CRC(95a5bce8) SHA1(46d7c99e37ca5598aec2062dfd9759853a237c14), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v1.7", "Firmware Version 1.7") + ROMX_LOAD("tti_10012000_rev1.7.bin", 0x0000, 0x8000, CRC(6660c059) SHA1(05d97009b5b8034dda520f655c73c474da97f822), ROM_BIOS(1)) ROM_END COMP( 1989, tti, 0, 0, tti, tti, tti_state, empty_init, "Transitional Technology Inc", "unknown TTI SCSI host adapter", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp index 46f0e6127f8..c4e3bb4138e 100644 --- a/src/mame/drivers/tumbleb.cpp +++ b/src/mame/drivers/tumbleb.cpp @@ -2392,6 +2392,16 @@ void tumbleb_state::htchctch(machine_config &config) // OSCs: 15MHz, 4.096MHz m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); } +void tumbleb_state::htchctch_mcu(machine_config &config) // OSCs: 15MHz, 4.096MHz +{ + htchctch(config); + + i87c52_device &prot(I87C52(config, "protection", 15_MHz_XTAL)); // decapped as 87C51FA (chip was marked as P87C52) + prot.port_out_cb<0>().set(FUNC(tumbleb_state::prot_p0_w)); + prot.port_out_cb<1>().set(FUNC(tumbleb_state::prot_p1_w)); + prot.port_out_cb<2>().set(FUNC(tumbleb_state::prot_p2_w)); +} + void tumbleb_state::cookbib(machine_config &config) { htchctch(config); @@ -2401,13 +2411,7 @@ void tumbleb_state::cookbib(machine_config &config) // some Choky! Choky! PCBs have left factory with a 3.57mhz while some have a 4.096 which matches other games, assuming the former are factory errors void tumbleb_state::chokchok(machine_config &config) // OSCs: 15MHz, 4.096MHz { - htchctch(config); - - /* basic machine hardware */ - i87c52_device &prot(I87C52(config, "protection", 15_MHz_XTAL)); - prot.port_out_cb<0>().set(FUNC(tumbleb_state::prot_p0_w)); - prot.port_out_cb<1>().set(FUNC(tumbleb_state::prot_p1_w)); - prot.port_out_cb<2>().set(FUNC(tumbleb_state::prot_p2_w)); + htchctch_mcu(config); m_palette->set_format(palette_device::xBGR_444, 1024); } @@ -3076,12 +3080,8 @@ ROM_START( htchctch ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 Code */ ROM_LOAD( "p02.b5", 0x00000, 0x10000 , CRC(c5a03186) SHA1(42561ab36e6d7a43828d3094e64bd1229ab893ba) ) - ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x2000, NO_DUMP ) /* can't be dumped */ - - ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */ - /* this is not a real rom but instead the data extracted from shared ram, the MCU puts it there */ - ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(5b27adb6) SHA1(a0821093d8c73765ff15767bdfc0afa95aa1371d) ) + ROM_REGION( 0x2000, "protection", 0 ) /* Intel 87C52 MCU Code */ + ROM_LOAD( "87c51fa.bin", 0x00000, 0x2000, CRC(a30312f3) SHA1(e61a89b4ed9555252fc1a64c50d345085f7674c7) ) // decapped ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ ROM_LOAD( "p01.c1", 0x00000, 0x20000, CRC(18c06829) SHA1(46b180319ed33abeaba70d2cc61f17639e59bfdb) ) @@ -3275,13 +3275,8 @@ ROM_START( dquizgo ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 Code */ ROM_LOAD( "ub5", 0x00000, 0x10000, CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) ) - ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */ - ROM_LOAD( "87c52.mcu", 0x00000, 0x2000, NO_DUMP ) /* can't be dumped */ - - ROM_REGION16_BE( 0x400, "user1", ROMREGION_ERASE00 ) /* Data from Shared RAM */ - /* this is not a real rom but instead the data extracted from shared ram, the MCU puts it there */ - /* It seems to put some data at 0x000-0x1ff too, but it looks like garbage, and doesn't appear to be used */ - ROM_LOAD16_WORD( "protdata.bin", 0x200, 0x200 , CRC(6064b9e0) SHA1(546bd8f9201427118940de2d1916b258b60710c6) ) + ROM_REGION( 0x2000, "protection", 0 ) // P87C52EBPN MCU, after decapping the die was 87C51RA+ + ROM_LOAD( "87c51rap.bin", 0x00000, 0x2000, CRC(03bc1f83) SHA1(9ccd49edd8e47a04c5dfe4ac163fbd98ea90aea3) ) // decapped ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ ROM_LOAD( "uc1", 0x00000, 0x40000, CRC(d0f4c4ba) SHA1(669a04a977e98d8a594cc1621cbb9526c9081ec0) ) @@ -3851,6 +3846,8 @@ void tumbleb_state::init_wondl96() void tumbleb_state::init_dquizgo() { tumblepb_gfx_rearrange(1); + + m_protbase = 0x0200; } @@ -3858,46 +3855,46 @@ void tumbleb_state::init_dquizgo() /******************************************************************************/ /* Misc 'bootleg' hardware - close to base Tumble Pop */ -GAME( 1991, tumbleb, tumblep, tumblepb, tumblepb, tumbleb_state, init_tumblepb, ROT0, "bootleg", "Tumble Pop (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1991, tumbleb2, tumblep, tumbleb2, tumblepb, tumbleb_state, init_tumbleb2, ROT0, "bootleg", "Tumble Pop (bootleg with PIC)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // PIC is protected, sound simulation not 100% -GAME( 1991, tumblepba,tumblep, tumblepba, tumblepb, tumbleb_state, init_tumblepba,ROT0, "bootleg (Playmark)", "Tumble Pop (Playmark bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // Playmark stickers on ROMs, offset pf1_alt tilemap, OKI not hooked up +GAME( 1991, tumbleb, tumblep, tumblepb, tumblepb, tumbleb_state, init_tumblepb, ROT0, "bootleg", "Tumble Pop (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1991, tumbleb2, tumblep, tumbleb2, tumblepb, tumbleb_state, init_tumbleb2, ROT0, "bootleg", "Tumble Pop (bootleg with PIC)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // PIC is protected, sound simulation not 100% +GAME( 1991, tumblepba,tumblep, tumblepba, tumblepb, tumbleb_state, init_tumblepba,ROT0, "bootleg (Playmark)", "Tumble Pop (Playmark bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // Playmark stickers on ROMs, offset pf1_alt tilemap, OKI not hooked up -GAME( 1992, funkyjetb,funkyjet,funkyjetb, tumblepb, tumbleb_pic_state, init_tumblepb, ROT0, "bootleg", "Funky Jet (bootleg)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // wrong palette, inputs not working, PIC driving an OKI +GAME( 1992, funkyjetb,funkyjet,funkyjetb, tumblepb, tumbleb_pic_state, init_tumblepb, ROT0, "bootleg", "Funky Jet (bootleg)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // wrong palette, inputs not working, PIC driving an OKI -GAME( 1993, jumpkids, 0, jumpkids, tumblepb, tumbleb_state, init_jumpkids, ROT0, "Comad", "Jump Kids", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, jumpkids, 0, jumpkids, tumblepb, tumbleb_state, init_jumpkids, ROT0, "Comad", "Jump Kids", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, pangpang, 0, pangpang, tumblepb, tumbleb_state, init_tumbleb2, ROT0, "Dong Gue La Mi Ltd.", "Pang Pang", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // PIC is protected, sound simulation not 100% +GAME( 1994, pangpang, 0, pangpang, tumblepb, tumbleb_state, init_tumbleb2, ROT0, "Dong Gue La Mi Ltd.", "Pang Pang", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // PIC is protected, sound simulation not 100% /* Misc 'bootleg' hardware - more changes from base hardware */ -GAME( 1994, suprtrio, 0, suprtrio, suprtrio, tumbleb_state, init_suprtrio, ROT0, "Gameace", "Super Trio", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, suprtrio, 0, suprtrio, suprtrio, tumbleb_state, init_suprtrio, ROT0, "Gameace", "Super Trio", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, fncywld, 0, fncywld, fncywld, tumbleb_state, init_fncywld, ROT0, "Unico", "Fancy World - Earth of Crisis" , MACHINE_SUPPORTS_SAVE ) // game says 1996, testmode 1995? +GAME( 1996, fncywld, 0, fncywld, fncywld, tumbleb_state, init_fncywld, ROT0, "Unico", "Fancy World - Earth of Crisis" , MACHINE_SUPPORTS_SAVE ) // game says 1996, testmode 1995? -GAME( 1996, magipur, 0, magipur, magipur, tumbleb_state, init_magipur, ROT0, "Unico", "Magic Purple" , MACHINE_SUPPORTS_SAVE ) +GAME( 1996, magipur, 0, magipur, magipur, tumbleb_state, init_magipur, ROT0, "Unico", "Magic Purple" , MACHINE_SUPPORTS_SAVE ) /* First Amusement / Mijin / SemiCom hardware (MCU protected) */ -GAME( 1994, metlsavr, 0, metlsavr, metlsavr, tumbleb_state, init_chokchok, ROT0, "First Amusement", "Metal Saver", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, metlsavr, 0, metlsavr, metlsavr, tumbleb_state, init_chokchok, ROT0, "First Amusement", "Metal Saver", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, magicbal, 0, metlsavr, magicbal, tumbleb_state, init_chokchok, ROT0, "SemiCom", "Magicball Fighting (Korea)", MACHINE_SUPPORTS_SAVE ) // also still has the Metal Saver (c)1994 First Amusement tiles in the GFX +GAME( 1994, magicbal, 0, metlsavr, magicbal, tumbleb_state, init_chokchok, ROT0, "SemiCom", "Magicball Fighting (Korea)", MACHINE_SUPPORTS_SAVE ) // also still has the Metal Saver (c)1994 First Amusement tiles in the GFX -GAME( 1995, chokchok, 0, chokchok, chokchok, tumbleb_state, init_chokchok, ROT0, "SemiCom", "Choky! Choky!", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1995, chokchok, 0, chokchok, chokchok, tumbleb_state, init_chokchok, ROT0, "SemiCom", "Choky! Choky!", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, wlstar, 0, cookbib_mcu, wlstar, tumbleb_state, init_wlstar, ROT0, "Mijin", "Wonder League Star - Sok-Magicball Fighting (Korea)", MACHINE_SUPPORTS_SAVE ) // translates to 'Wonder League Star - Return of Magicball Fighting' +GAME( 1995, wlstar, 0, cookbib_mcu, wlstar, tumbleb_state, init_wlstar, ROT0, "Mijin", "Wonder League Star - Sok-Magicball Fighting (Korea)", MACHINE_SUPPORTS_SAVE ) // translates to 'Wonder League Star - Return of Magicball Fighting' -GAME( 1995, htchctch, 0, htchctch, htchctch, tumbleb_state, init_htchctch, ROT0, "SemiCom", "Hatch Catch" , MACHINE_SUPPORTS_SAVE ) // not 100% sure about gfx offsets +GAME( 1995, htchctch, 0, htchctch_mcu, htchctch, tumbleb_state, init_htchctch, ROT0, "SemiCom", "Hatch Catch" , MACHINE_SUPPORTS_SAVE ) // not 100% sure about gfx offsets -GAME( 1995, cookbib, 0, cookbib, cookbib, tumbleb_state, init_htchctch, ROT0, "SemiCom", "Cookie & Bibi (set 1)" , MACHINE_SUPPORTS_SAVE ) // not 100% sure about gfx offsets -GAME( 1995, cookbiba, cookbib, cookbib, cookbib, tumbleb_state, init_htchctch, ROT0, "SemiCom", "Cookie & Bibi (set 2)" , MACHINE_SUPPORTS_SAVE ) +GAME( 1995, cookbib, 0, cookbib, cookbib, tumbleb_state, init_htchctch, ROT0, "SemiCom", "Cookie & Bibi (set 1)" , MACHINE_SUPPORTS_SAVE ) // not 100% sure about gfx offsets +GAME( 1995, cookbiba, cookbib, cookbib, cookbib, tumbleb_state, init_htchctch, ROT0, "SemiCom", "Cookie & Bibi (set 2)" , MACHINE_SUPPORTS_SAVE ) -GAME( 1996, carket, 0, htchctch, carket, tumbleb_state, init_carket, ROT0, "SemiCom", "Carket Ball", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, carket, 0, htchctch, carket, tumbleb_state, init_carket, ROT0, "SemiCom", "Carket Ball", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, wondl96, 0, cookbib_mcu, wondl96, tumbleb_state, init_wondl96, ROT0, "SemiCom", "Wonder League '96 (Korea)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, wondl96, 0, cookbib_mcu, wondl96, tumbleb_state, init_wondl96, ROT0, "SemiCom", "Wonder League '96 (Korea)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, sdfight, 0, sdfight, sdfight, tumbleb_state, init_bcstory, ROT0, "SemiCom / Tirano", "SD Fighters (Korea)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, sdfight, 0, sdfight, sdfight, tumbleb_state, init_bcstory, ROT0, "SemiCom / Tirano", "SD Fighters (Korea)", MACHINE_SUPPORTS_SAVE ) -GAME( 1997, bcstry, 0, bcstory, bcstory, tumbleb_state, init_bcstory, ROT0, "SemiCom / Tirano", "B.C. Story (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // gfx offsets? -GAME( 1997, bcstrya, bcstry, bcstory, bcstory, tumbleb_state, init_bcstory, ROT0, "SemiCom / Tirano", "B.C. Story (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // gfx offsets? +GAME( 1997, bcstry, 0, bcstory, bcstory, tumbleb_state, init_bcstory, ROT0, "SemiCom / Tirano", "B.C. Story (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // gfx offsets? +GAME( 1997, bcstrya, bcstry, bcstory, bcstory, tumbleb_state, init_bcstory, ROT0, "SemiCom / Tirano", "B.C. Story (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // gfx offsets? -GAME( 1997, semibase, 0, semibase, semibase, tumbleb_state, init_bcstory, ROT0, "SemiCom / DMD", "MuHanSeungBu (SemiCom Baseball) (Korea)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )// sprite offsets.. +GAME( 1997, semibase, 0, semibase, semibase, tumbleb_state, init_bcstory, ROT0, "SemiCom / DMD", "MuHanSeungBu (SemiCom Baseball) (Korea)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )// sprite offsets.. -GAME( 1998, dquizgo, 0, cookbib, dquizgo, tumbleb_state, init_dquizgo, ROT0, "SemiCom / AceVer", "Date Quiz Go Go (Korea)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // check layer offsets +GAME( 1998, dquizgo, 0, cookbib_mcu, dquizgo, tumbleb_state, init_dquizgo, ROT0, "SemiCom / AceVer", "Date Quiz Go Go (Korea)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // check layer offsets diff --git a/src/mame/drivers/tutor.cpp b/src/mame/drivers/tutor.cpp index 8226690a247..6f0b572e615 100644 --- a/src/mame/drivers/tutor.cpp +++ b/src/mame/drivers/tutor.cpp @@ -239,7 +239,7 @@ private: void tutor_state::machine_start() { std::string region_tag; - m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG)); m_tape_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tutor_state::tape_interrupt_handler),this)); diff --git a/src/mame/drivers/tv912.cpp b/src/mame/drivers/tv912.cpp index 8370c3152f1..5bdeb30bd79 100644 --- a/src/mame/drivers/tv912.cpp +++ b/src/mame/drivers/tv912.cpp @@ -562,7 +562,7 @@ static INPUT_PORTS_START( tv912b ) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("KEY13") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('h') PORT_CHAR('H') PORT_CODE(KEYCODE_H) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('h') PORT_CHAR('H') PORT_CHAR(0x08) PORT_CODE(KEYCODE_H) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(0x13) PORT_CODE(KEYCODE_S) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) @@ -574,7 +574,7 @@ static INPUT_PORTS_START( tv912b ) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("KEY15") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('k') PORT_CHAR('K') PORT_CODE(KEYCODE_K) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('k') PORT_CHAR('K') PORT_CHAR(0x0b) PORT_CODE(KEYCODE_K) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR(0x06) PORT_CODE(KEYCODE_F) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) @@ -592,7 +592,7 @@ static INPUT_PORTS_START( tv912b ) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("KEY18") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rub Out") PORT_CHAR(0x08) PORT_CODE(KEYCODE_QUOTE) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rub Out") PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CODE(KEYCODE_QUOTE) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR(0x10) PORT_CODE(KEYCODE_P) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) @@ -605,7 +605,7 @@ static INPUT_PORTS_START( tv912b ) PORT_START("KEY20") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) // control character 0x1f (PAGE) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('l') PORT_CHAR('L') PORT_CODE(KEYCODE_L) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('l') PORT_CHAR('L') PORT_CHAR(0x0c) PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) // control character 0xb5 PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) @@ -770,7 +770,7 @@ static INPUT_PORTS_START( tv912c ) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("KEY15") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('k') PORT_CHAR('K') PORT_CODE(KEYCODE_K) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('k') PORT_CHAR('K') PORT_CHAR(0x0b) PORT_CODE(KEYCODE_K) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR(0x06) PORT_CODE(KEYCODE_F) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) @@ -801,7 +801,7 @@ static INPUT_PORTS_START( tv912c ) PORT_START("KEY20") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) // (BLOCK CONV) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('l') PORT_CHAR('L') PORT_CODE(KEYCODE_L) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('l') PORT_CHAR('L') PORT_CHAR(0x0c) PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT(0xdc, IP_ACTIVE_LOW, IPT_UNUSED) diff --git a/src/mame/drivers/tv924.cpp b/src/mame/drivers/tv924.cpp new file mode 100644 index 00000000000..31d51bc3ace --- /dev/null +++ b/src/mame/drivers/tv924.cpp @@ -0,0 +1,98 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for TeleVideo Model 924 terminal. + +****************************************************************************/ + +#include "emu.h" + +//#include "bus/rs232/rs232.h" +#include "cpu/m6502/m6502.h" +#include "cpu/mcs48/mcs48.h" +#include "machine/mc68681.h" +//#include "machine/nvram.h" +#include "video/scn2674.h" +#include "screen.h" + +class tv924_state : public driver_device +{ +public: + tv924_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_pvtc(*this, "pvtc") + { + } + + void tv924(machine_config &config); + +private: + SCN2672_DRAW_CHARACTER_MEMBER(draw_character); + + void mem_map(address_map &map); + void char_map(address_map &map); + + required_device<cpu_device> m_maincpu; + required_device<scn2672_device> m_pvtc; +}; + +SCN2672_DRAW_CHARACTER_MEMBER(tv924_state::draw_character) +{ +} + +void tv924_state::mem_map(address_map &map) +{ + map(0x0000, 0x07ff).ram(); + map(0x2020, 0x202f).rw("duart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)); + map(0x2030, 0x2037).rw(m_pvtc, FUNC(scn2672_device::read), FUNC(scn2672_device::write)); + map(0x8000, 0x9fff).ram(); + map(0xa000, 0xbfff).rom().region("program", 0x0000); + map(0xe000, 0xffff).rom().region("program", 0x2000); +} + +void tv924_state::char_map(address_map &map) +{ + map(0x0000, 0x3fff).ram(); +} + + +static INPUT_PORTS_START(tv924) +INPUT_PORTS_END + +void tv924_state::tv924(machine_config &config) +{ + M6502(config, m_maincpu, 1'723'560); // R6502AP (clock guessed) + m_maincpu->set_addrmap(AS_PROGRAM, &tv924_state::mem_map); + + I8049(config, "kbdc", 5.7143_MHz_XTAL).set_disable(); + + scn2681_device &duart(SCN2681(config, "duart", 3.6864_MHz_XTAL)); // SCN2681A + duart.irq_cb().set_inputline(m_maincpu, m6502_device::IRQ_LINE); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(27'576'960, 848 * 2, 0, 640 * 2, 271, 0, 250); + screen.set_screen_update("pvtc", FUNC(scn2672_device::screen_update)); + + SCN2672(config, m_pvtc, 1'723'560); // SCN2672A (with SCB2673B + AMI gate arrays 130170-00 and 130180-00) + m_pvtc->set_screen("screen"); + m_pvtc->set_character_width(16); // nominally 8, but with half-dot shifting + m_pvtc->set_addrmap(0, &tv924_state::char_map); + m_pvtc->set_display_callback(FUNC(tv924_state::draw_character)); + m_pvtc->intr_callback().set_inputline(m_maincpu, m6502_device::NMI_LINE); +} + +ROM_START(tv924) + ROM_REGION(0x4000, "program", 0) + ROM_LOAD("180001-53e_924_u14_12_18_84_e.bin", 0x0000, 0x2000, CRC(9129e555) SHA1(2977f5a8153b474d1fff4bec17952562277f86a4)) + ROM_LOAD("180001-54e_924_u21_12_18_84_e.bin", 0x2000, 0x2000, CRC(fa2cf28d) SHA1(9cb461b2ba2a7bf44467d5fbc5358c9caaa60024)) + + ROM_REGION(0x1000, "chargen", 0) + ROM_LOAD("350_rn_118_2333-5006_8000142.u10", 0x0000, 0x1000, NO_DUMP) // VTI 24-pin mask ROM + + ROM_REGION(0x800, "kbdc", 0) + ROM_LOAD("d8049hc.bin", 0x000, 0x800, NO_DUMP) +ROM_END + +COMP(1984, tv924, 0, 0, tv924, tv924, tv924_state, empty_init, "TeleVideo Systems", "TeleVideo 924 Video Display Terminal", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/twins.cpp b/src/mame/drivers/twins.cpp index f4c148b2ac4..af05dddcc2b 100644 --- a/src/mame/drivers/twins.cpp +++ b/src/mame/drivers/twins.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:David Haywood +// copyright-holders:David Haywood, Angelo Salese /* Twins @@ -69,10 +69,12 @@ AY3-8910 instead of YM2149 (compatible) video is not banked in this case instead palette data is sent to the ports strange palette format. -todo: -hook up eeprom (doesn't seem to work when hooked up??) -Twins set 1 takes a long time to boot (eeprom?) -Improve blitter / clear logic for Spider. +TODO: +- Proper fix for twins & twinsed2 crash after round 1 (MT #07516): + after clearing 1-5 it pings i2c for a couple times, expect it to be 0 then 1 otherwise + jumps to lalaland; +- Improve blitter / clear logic for Spider. +- Merge with hotblock.cpp; Electronic Devices was printed on rom labels 1994 date string is in ROM @@ -80,18 +82,20 @@ Electronic Devices was printed on rom labels Spider PCB appears almost identical but uses additional 'blitter' features. It is possible the Twins PCB has them too and doesn't use them. +twinsed1 is significantly changed hardware, uses a regular RAMDAC hookup for palette etc. -Twins (Electronic Devices license, set 2) is significantly changed hardware, uses a regular RAMDAC hookup for plaette etc. - - -To access Service Mode in Spider you must boot with P1 Left and P1 Right held down, -this requires the -joystick_contradictory switch on the commandline. +To access Service Mode: +- twins, twinsed2: you must boot with coin 1 and start 1 held down + (there's a test button on the PCB tho?) +- spider, twinsed1: you must boot with P1 Left and P1 Right held down, + this requires the -joystick_contradictory switch on the commandline; */ #include "emu.h" #include "cpu/nec/nec.h" #include "sound/ay8910.h" +#include "machine/bankdev.h" #include "machine/i2cmem.h" #include "video/ramdac.h" #include "emupal.h" @@ -104,87 +108,195 @@ public: twins_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_paletteram(*this, "paletteram") + , m_screen(*this, "screen") , m_palette(*this, "palette") , m_i2cmem(*this, "i2cmem") + , m_overlay(*this, "overlay") , m_spritesinit(0) , m_videorambank(0) { } - void spider(machine_config &config); - void twinsed1(machine_config &config); void twins(machine_config &config); + void init_twins(); + void init_twinsed2(); -private: +protected: required_device<cpu_device> m_maincpu; - optional_shared_ptr<uint16_t> m_paletteram; + required_device<screen_device> m_screen; required_device<palette_device> m_palette; - optional_device<i2cmem_device> m_i2cmem; - uint16_t m_paloff; - DECLARE_READ16_MEMBER(twins_port4_r); - DECLARE_WRITE16_MEMBER(twins_port4_w); - DECLARE_WRITE16_MEMBER(twins_pal_w); - DECLARE_WRITE16_MEMBER(spider_pal_w); - DECLARE_WRITE16_MEMBER(porte_paloff0_w); - DECLARE_WRITE16_MEMBER(spider_paloff0_w); - DECLARE_WRITE16_MEMBER(spider_blitter_w); - DECLARE_READ16_MEMBER(spider_blitter_r); + required_device<i2cmem_device> m_i2cmem; + required_device<address_map_bank_device> m_overlay; - DECLARE_READ16_MEMBER(spider_port_18_r); - DECLARE_READ16_MEMBER(spider_port_1e_r); - DECLARE_WRITE16_MEMBER(spider_port_1a_w); - DECLARE_WRITE16_MEMBER(spider_port_1c_w); + std::unique_ptr<u16 []> m_bgvram; + std::unique_ptr<u16 []> m_fgvram; + std::unique_ptr<u16 []> m_paletteram; + uint16_t m_paloff; int m_spritesinit; int m_spriteswidth; int m_spritesaddr; - - uint16_t m_mainram[0x10000 / 2]; - uint16_t m_videoram[0x10000 / 2]; - uint16_t m_videoram2[0x10000 / 2]; uint16_t m_videorambank; + uint8_t* m_rom8; + void base_config(machine_config &config); + void video_config(machine_config &config); + void sound_config(machine_config &config); + void base_map(address_map &map); + void twins_map(address_map &map); uint32_t screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - virtual void machine_start() override; + DECLARE_READ16_MEMBER(eeprom_r); + DECLARE_WRITE16_MEMBER(eeprom_w); + + void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void video_start() override; - uint16_t* m_rom16; - uint8_t* m_rom8; + + static constexpr u32 ram_size = 0x10000/2; + + inline u16* get_vram_base(); + DECLARE_READ16_MEMBER(vram_r); + DECLARE_WRITE16_MEMBER(vram_w); + DECLARE_WRITE16_MEMBER(vram_rmw_w); + +private: + DECLARE_WRITE16_MEMBER(access_w); + DECLARE_READ16_MEMBER(access_r); + + virtual void machine_start() override; void ramdac_map(address_map &map); - void spider_io(address_map &map); - void twinsed1_io(address_map &map); - void twins_map(address_map &map); void twins_io(address_map &map); }; +class twinsed1_state : public twins_state +{ +public: + twinsed1_state(const machine_config &mconfig, device_type type, const char *tag) + : twins_state(mconfig, type, tag) + {} + + void twinsed1(machine_config &config); + +private: + void twinsed1_io(address_map &map); + DECLARE_WRITE16_MEMBER(porte_paloff0_w); + DECLARE_WRITE16_MEMBER(twins_pal_w); +}; + +class spider_state : public twins_state +{ +public: + spider_state(const machine_config &mconfig, device_type type, const char *tag) + : twins_state(mconfig, type, tag) + {} + + void spider(machine_config &config); + +private: + uint32_t screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void draw_foreground(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void spider_io(address_map &map); + DECLARE_WRITE16_MEMBER(spider_paloff0_w); + DECLARE_READ16_MEMBER(spider_port_18_r); + DECLARE_READ16_MEMBER(spider_port_1e_r); + DECLARE_WRITE16_MEMBER(spider_port_1a_w); + DECLARE_WRITE16_MEMBER(spider_port_1c_w); + DECLARE_WRITE16_MEMBER(spider_pal_w); +}; + +void twins_state::video_start() +{ + m_paloff = 0; + + save_item(NAME(m_paloff)); + save_item(NAME(m_spritesinit)); + save_item(NAME(m_spriteswidth)); + save_item(NAME(m_spritesaddr)); + + m_bgvram = std::make_unique<u16 []>(ram_size); + std::fill_n(m_bgvram.get(), ram_size, 0); + save_pointer(NAME(m_bgvram), ram_size); + + m_fgvram = std::make_unique<u16 []>(ram_size); + std::fill_n(m_fgvram.get(), ram_size, 0); + save_pointer(NAME(m_fgvram), ram_size); + + const u16 palette_size = 0x100; + m_paletteram = std::make_unique<u16 []>(palette_size); + std::fill_n(m_paletteram.get(), palette_size, 0); + save_pointer(NAME(m_paletteram), palette_size); + + save_item(NAME(m_videorambank)); +} + +void twins_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t *videoram = (uint8_t*)m_bgvram.get(); + + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + int count = (y * 320) + cliprect.left(); + for(int x = cliprect.left(); x <= cliprect.right(); x++) + bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count++)]; + } +} + +uint32_t twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_palette->black_pen()); + draw_background(bitmap, cliprect); + return 0; +} + +void spider_state::draw_foreground(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t *videoram = (uint8_t*)m_fgvram.get(); + + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + int count = (y * 320) + cliprect.left(); + for(int x = cliprect.left(); x <= cliprect.right(); x++) + { + u8 pixel = videoram[BYTE_XOR_LE(count++)]; + if (pixel) + bitmap.pix16(y, x) = pixel; + } + } +} + +uint32_t spider_state::screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_palette->black_pen()); + draw_background(bitmap, cliprect); + draw_foreground(bitmap, cliprect); + return 0; +} void twins_state::machine_start() { - m_rom16 = (uint16_t*)memregion("maincpu")->base(); - m_rom8 = memregion("maincpu")->base(); + m_rom8 = memregion("ipl")->base(); } -/* port 4 is eeprom */ -READ16_MEMBER(twins_state::twins_port4_r) +READ16_MEMBER(twins_state::eeprom_r) { -// doesn't work?? -// printf("%08x: twins_port4_r %04x\n", m_maincpu->pc(), mem_mask); +// printf("%08x: eeprom_r %04x\n", m_maincpu->pc(), mem_mask); // return m_i2cmem->read_sda();// | 0xfffe; + // TODO: bit 1, i2c clock readback? - return 0x0001; + return m_i2cmem->read_sda(); } -WRITE16_MEMBER(twins_state::twins_port4_w) +WRITE16_MEMBER(twins_state::eeprom_w) { -// printf("%08x: twins_port4_w %04x %04x\n", m_maincpu->pc(), data, mem_mask); +// printf("%08x: eeprom_w %04x %04x\n", m_maincpu->pc(), data, mem_mask); int i2c_clk = BIT(data, 1); int i2c_mem = BIT(data, 0); m_i2cmem->write_scl(i2c_clk); m_i2cmem->write_sda(i2c_mem); } -WRITE16_MEMBER(twins_state::twins_pal_w) +WRITE16_MEMBER(twinsed1_state::twins_pal_w) { COMBINE_DATA(&m_paletteram[m_paloff]); @@ -202,52 +314,72 @@ WRITE16_MEMBER(twins_state::twins_pal_w) b = bitswap<8>(b,7,6,5,0,1,2,3,4); m_palette->set_pen_color(m_paloff, pal5bit(r),pal5bit(g),pal5bit(b)); - } m_paloff = (m_paloff + 1) & 0xff; } /* ??? weird ..*/ -WRITE16_MEMBER(twins_state::porte_paloff0_w) +WRITE16_MEMBER(twinsed1_state::porte_paloff0_w) { // printf("porte_paloff0_w %04x\n", data); m_paloff = 0; } -READ16_MEMBER(twins_state::spider_blitter_r) +inline u16 *twins_state::get_vram_base() { - uint16_t* vram; - if (m_videorambank & 1) - vram = m_videoram2; - else - vram = m_videoram; + return (m_videorambank & 1) ? m_fgvram.get() : m_bgvram.get(); +} - if (offset < 0x10000 / 2) - { - return m_mainram[offset&0x7fff]; - } - else if (offset < 0x20000 / 2) - { - return vram[offset&0x7fff]; - } - else +READ16_MEMBER(twins_state::vram_r) +{ + u16 *vram = get_vram_base(); + return vram[offset]; +} + +WRITE16_MEMBER(twins_state::vram_w) +{ + u16 *vram = get_vram_base(); + COMBINE_DATA(&vram[offset]); +} + +// TODO: confirm this area being present on twins versions +WRITE16_MEMBER(twins_state::vram_rmw_w) +{ + u16 *vram = get_vram_base(); + +// printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); + + for (int i = 0; i < m_spriteswidth; i++) { - uint16_t *src = m_rom16; - return src[offset]; + uint8_t data; + + data = (m_rom8[(m_spritesaddr * 2) + 1]); + + if (data) + vram[offset] = (vram[offset] & 0x00ff) | data << 8; + + data = m_rom8[(m_spritesaddr*2)]; + + if (data) + vram[offset] = (vram[offset] & 0xff00) | data; + + m_spritesaddr ++; + offset++; + + offset &= 0x7fff; } } +READ16_MEMBER(twins_state::access_r) +{ + return m_overlay->read16(offset, mem_mask); +} -WRITE16_MEMBER(twins_state::spider_blitter_w) +WRITE16_MEMBER(twins_state::access_w) { // this is very strange, we use the offset (address bits) not data bits to set values.. // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? - uint16_t* vram; - if (m_videorambank & 1) - vram = m_videoram2; - else - vram = m_videoram; if (m_spritesinit == 1) { @@ -264,135 +396,135 @@ WRITE16_MEMBER(twins_state::spider_blitter_w) m_spriteswidth = 80; m_spritesinit = 0; + } + else + m_overlay->write16(offset, data, mem_mask); +} +WRITE16_MEMBER(spider_state::spider_pal_w) +{ + // ths first write doesn't appear to be a palette value + if (m_paloff!=0) + { + COMBINE_DATA(&m_paletteram[m_paloff-1]); + int dat,r,g,b; + dat = m_paletteram[m_paloff-1]; + + r = dat & 0x1f; + g = (dat>>5) & 0x1f; + b = (dat>>10) & 0x1f; + m_palette->set_pen_color(m_paloff-1, pal5bit(r),pal5bit(g),pal5bit(b)); } else { - if (offset < 0x10000 / 2) - { - COMBINE_DATA(&m_mainram[offset&0x7fff]); - } - else if (offset < 0x20000 / 2) - { - COMBINE_DATA(&vram[offset&0x7fff]); - } - else if (offset < 0x30000 / 2) - { - uint8_t *src = m_rom8; + // printf("first palette write %04x\n", data); + } - // printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); - offset &= 0x7fff; + m_paloff++; - for (int i = 0; i < m_spriteswidth; i++) - { - uint8_t data; + if (m_paloff == 0x101) + m_paloff = 0; +} - data = (src[(m_spritesaddr * 2) + 1]); - if (data) - vram[offset] = (vram[offset] & 0x00ff) | data << 8; +WRITE16_MEMBER(spider_state::spider_paloff0_w) +{ + // this seems to be video ram banking + COMBINE_DATA(&m_videorambank); +} +WRITE16_MEMBER(spider_state::spider_port_1a_w) +{ + // writes 1 +} - data = src[(m_spritesaddr*2)]; - if (data) - vram[offset] = (vram[offset] & 0xff00) | data; +WRITE16_MEMBER(spider_state::spider_port_1c_w) +{ + // done before the 'sprite' read / writes + // might clear a buffer? + // game is only animating sprites at 30fps, maybe there's some double buffering too? - m_spritesaddr ++; - offset++; +// data written is always 00, only seems to want the upper layer to be cleared +// otherwise you get garbage sprites between rounds and the bg incorrectly wiped - offset &= 0x7fff; - } - } - else - { - printf("spider_blitter_w unhandled RAM access %08x %04x %04x", offset * 2, data, mem_mask); - } - } + for (int i = 0; i < ram_size; i++) + m_fgvram[i] = 0x0000; } -void twins_state::twins_map(address_map &map) +READ16_MEMBER(spider_state::spider_port_18_r) { - map(0x00000, 0xfffff).rw(FUNC(twins_state::spider_blitter_r), FUNC(twins_state::spider_blitter_w)); + // read before each blitter command + // seems to put the bus in a state where the next 2 bus access offsets (anywhere) are the blitter params + m_spritesinit = 1; + + return 0xff; } -void twins_state::twinsed1_io(address_map &map) +READ16_MEMBER(spider_state::spider_port_1e_r) { - map(0x0000, 0x0003).w("aysnd", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); - map(0x0002, 0x0002).r("aysnd", FUNC(ay8910_device::data_r)); - map(0x0004, 0x0005).rw(FUNC(twins_state::twins_port4_r), FUNC(twins_state::twins_port4_w)); - map(0x0006, 0x0007).w(FUNC(twins_state::twins_pal_w)).share("paletteram"); - map(0x000e, 0x000f).w(FUNC(twins_state::porte_paloff0_w)); + // done before each sprite pixel 'write' + // the data read is the data written, but only reads one pixel?? + return 0xff; } -void twins_state::video_start() +void twins_state::twins_map(address_map &map) { - m_paloff = 0; - - save_item(NAME(m_paloff)); - save_item(NAME(m_spritesinit)); - save_item(NAME(m_spriteswidth)); - save_item(NAME(m_spritesaddr)); - save_item(NAME(m_mainram)); - save_item(NAME(m_videoram)); - save_item(NAME(m_videoram2)); - save_item(NAME(m_videorambank)); + map(0x00000, 0xfffff).rw(FUNC(twins_state::access_r), FUNC(twins_state::access_w)); } - -uint32_t twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void twins_state::base_map(address_map &map) { - int y,x,count; - static const int xxx=320,yyy=204; - - bitmap.fill(m_palette->black_pen()); - - count=0; - uint8_t *videoram = (uint8_t*)m_videoram; - for (y=0;y<yyy;y++) - { - for(x=0;x<xxx;x++) - { - bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)]; - count++; - } - } - return 0; + map(0x00000, 0x0ffff).ram(); + map(0x10000, 0x1ffff).rw(FUNC(twins_state::vram_r), FUNC(twins_state::vram_w)); + map(0x20000, 0x2ffff).w(FUNC(twins_state::vram_rmw_w)); + map(0x20000, 0xfffff).rom().region("ipl", 0x20000); } -uint32_t twins_state::screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void twinsed1_state::twinsed1_io(address_map &map) { - int y,x,count; - static const int xxx=320,yyy=204; + map(0x0000, 0x0001).nopr(); + map(0x0000, 0x0003).w("aysnd", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); + map(0x0002, 0x0002).r("aysnd", FUNC(ay8910_device::data_r)); + map(0x0004, 0x0005).rw(FUNC(twinsed1_state::eeprom_r), FUNC(twinsed1_state::eeprom_w)); + map(0x0006, 0x0007).w(FUNC(twinsed1_state::twins_pal_w)); + map(0x000e, 0x000f).w(FUNC(twinsed1_state::porte_paloff0_w)); +} - bitmap.fill(m_palette->black_pen()); +/* The Ecogames set and the Electronic Devices second set has different palette hardware + and a different port map than Electronic Devices first set */ - count=0; - uint8_t *videoram = (uint8_t*)m_videoram; - for (y=0;y<yyy;y++) - { - for(x=0;x<xxx;x++) - { - bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)]; - count++; - } - } +void twins_state::twins_io(address_map &map) +{ + map(0x0000, 0x0001).nopr(); + map(0x0000, 0x0000).w("ramdac", FUNC(ramdac_device::index_w)); + map(0x0002, 0x0002).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x0004, 0x0004).rw("ramdac", FUNC(ramdac_device::pal_r), FUNC(ramdac_device::pal_w)); + map(0x0008, 0x0008).w("aysnd", FUNC(ay8910_device::address_w)); + map(0x0010, 0x0010).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); + map(0x0018, 0x0019).r(FUNC(twins_state::eeprom_r)).w(FUNC(twins_state::eeprom_w)); +} - count = 0; - videoram = (uint8_t*)m_videoram2; - for (y=0;y<yyy;y++) - { - for(x=0;x<xxx;x++) - { - uint8_t pixel = videoram[BYTE_XOR_LE(count)]; - if (pixel) bitmap.pix16(y, x) = pixel; - count++; - } - } +void spider_state::spider_io(address_map &map) +{ + map(0x0000, 0x0001).nopr(); + map(0x0000, 0x0003).w("aysnd", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); + map(0x0002, 0x0002).r("aysnd", FUNC(ay8910_device::data_r)); + map(0x0004, 0x0005).rw(FUNC(spider_state::eeprom_r), FUNC(spider_state::eeprom_w)); + map(0x0008, 0x0009).w(FUNC(spider_state::spider_pal_w)); + map(0x0010, 0x0011).w(FUNC(spider_state::spider_paloff0_w)); + + map(0x0018, 0x0019).r(FUNC(spider_state::spider_port_18_r)); + map(0x001a, 0x001b).w(FUNC(spider_state::spider_port_1a_w)); + map(0x001c, 0x001d).w(FUNC(spider_state::spider_port_1c_w)); + map(0x001e, 0x001f).r(FUNC(spider_state::spider_port_1e_r)); +} - return 0; +void twins_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); } static INPUT_PORTS_START(twins) @@ -417,54 +549,46 @@ static INPUT_PORTS_START(twins) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) INPUT_PORTS_END - -void twins_state::twinsed1(machine_config &config) +void twins_state::base_config(machine_config &config) { - /* basic machine hardware */ - V30(config, m_maincpu, 8000000); - m_maincpu->set_addrmap(AS_PROGRAM, &twins_state::twins_map); - m_maincpu->set_addrmap(AS_IO, &twins_state::twinsed1_io); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(8000000, 512, 0, 320, 312, 0, 200); // 15.625 kHz horizontal??? - screen.set_screen_update(FUNC(twins_state::screen_update_twins)); - screen.set_palette(m_palette); - screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); - I2C_24C02(config, m_i2cmem); - PALETTE(config, m_palette).set_entries(0x100); + ADDRESS_MAP_BANK(config, m_overlay).set_map(&twins_state::base_map).set_options(ENDIANNESS_LITTLE, 16, 24, 0x100000); +} + +void twins_state::video_config(machine_config &config) +{ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(8000000, 512, 0, 320, 312, 0, 204); // Common PAL values, HSync of 15.625 kHz unverified + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); +} - /* sound hardware */ +void twins_state::sound_config(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - ay8910_device &aysnd(AY8910(config, "aysnd", 2000000)); + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(16'000'000)/8)); /* verified on pcb */ aysnd.port_a_read_callback().set_ioport("P1"); aysnd.port_b_read_callback().set_ioport("P2"); aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); } - -/* The Ecogames set and the Electronic Devices second set has different palette hardware - and a different port map than Electronic Devices first set */ - -void twins_state::twins_io(address_map &map) +void twinsed1_state::twinsed1(machine_config &config) { - map(0x0000, 0x0000).w("ramdac", FUNC(ramdac_device::index_w)); - map(0x0002, 0x0002).w("ramdac", FUNC(ramdac_device::mask_w)); - map(0x0004, 0x0004).rw("ramdac", FUNC(ramdac_device::pal_r), FUNC(ramdac_device::pal_w)); - map(0x0008, 0x0008).w("aysnd", FUNC(ay8910_device::address_w)); - map(0x0010, 0x0010).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); - map(0x0018, 0x0019).r(FUNC(twins_state::twins_port4_r)).w(FUNC(twins_state::twins_port4_w)); -} + /* basic machine hardware */ + V30(config, m_maincpu, 8000000); + m_maincpu->set_addrmap(AS_PROGRAM, &twinsed1_state::twins_map); + m_maincpu->set_addrmap(AS_IO, &twinsed1_state::twinsed1_io); + video_config(config); + m_screen->set_screen_update(FUNC(twinsed1_state::screen_update_twins)); -void twins_state::ramdac_map(address_map &map) -{ - map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); -} + base_config(config); + PALETTE(config, m_palette).set_entries(0x100); + sound_config(config); +} void twins_state::twins(machine_config &config) { @@ -473,169 +597,56 @@ void twins_state::twins(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &twins_state::twins_map); m_maincpu->set_addrmap(AS_IO, &twins_state::twins_io); - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(8000000, 512, 0, 320, 312, 0, 200); // 15.625 kHz horizontal??? - screen.set_screen_update(FUNC(twins_state::screen_update_twins)); - screen.set_palette(m_palette); - screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); + video_config(config); + m_screen->set_screen_update(FUNC(twins_state::screen_update_twins)); PALETTE(config, m_palette).set_entries(256); ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, m_palette)); ramdac.set_addrmap(0, &twins_state::ramdac_map); ramdac.set_split_read(0); - I2C_24C02(config, m_i2cmem); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(16'000'000)/8)); /* verified on pcb */ - aysnd.port_a_read_callback().set_ioport("P1"); - aysnd.port_b_read_callback().set_ioport("P2"); - aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); -} - -WRITE16_MEMBER(twins_state::spider_pal_w) -{ - // ths first write doesn't appear to be a palette value - if (m_paloff!=0) - { - COMBINE_DATA(&m_paletteram[m_paloff-1]); - int dat,r,g,b; - dat = m_paletteram[m_paloff-1]; - - r = dat & 0x1f; - g = (dat>>5) & 0x1f; - b = (dat>>10) & 0x1f; - m_palette->set_pen_color(m_paloff-1, pal5bit(r),pal5bit(g),pal5bit(b)); - } - else - { - // printf("first palette write %04x\n", data); - } - - m_paloff++; - - if (m_paloff == 0x101) - m_paloff = 0; -} - - -WRITE16_MEMBER(twins_state::spider_paloff0_w) -{ - // this seems to be video ram banking - COMBINE_DATA(&m_videorambank); -} + base_config(config); -WRITE16_MEMBER(twins_state::spider_port_1a_w) -{ - // writes 1 + sound_config(config); } - -WRITE16_MEMBER(twins_state::spider_port_1c_w) -{ - // done before the 'sprite' read / writes - // might clear a buffer? - - // game is only animating sprites at 30fps, maybe there's some double buffering too? - -// data written is always 00, only seems to want the upper layer to be cleared -// otherwise you get garbage sprites between rounds and the bg incorrectly wiped - - uint16_t* vram; -// if (m_videorambank & 1) - vram = m_videoram2; -// else -// vram = m_videoram; - - for (int i = 0; i < 0x8000; i++) - { - vram[i] = 0x0000; - } - -} - - -READ16_MEMBER(twins_state::spider_port_18_r) -{ - // read before each blitter command - // seems to put the bus in a state where the next 2 bus access offsets (anywhere) are the blitter params - m_spritesinit = 1; - - return 0xff; -} - -READ16_MEMBER(twins_state::spider_port_1e_r) -{ - // done before each sprite pixel 'write' - // the data read is the data written, but only reads one pixel?? - return 0xff; -} - - -void twins_state::spider_io(address_map &map) -{ - map(0x0000, 0x0003).w("aysnd", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); - map(0x0002, 0x0002).r("aysnd", FUNC(ay8910_device::data_r)); - map(0x0004, 0x0005).rw(FUNC(twins_state::twins_port4_r), FUNC(twins_state::twins_port4_w)); - map(0x0008, 0x0009).w(FUNC(twins_state::spider_pal_w)).share("paletteram"); - map(0x0010, 0x0011).w(FUNC(twins_state::spider_paloff0_w)); - - map(0x0018, 0x0019).r(FUNC(twins_state::spider_port_18_r)); - map(0x001a, 0x001b).w(FUNC(twins_state::spider_port_1a_w)); - map(0x001c, 0x001d).w(FUNC(twins_state::spider_port_1c_w)); - map(0x001e, 0x001f).r(FUNC(twins_state::spider_port_1e_r)); - - -} - - -void twins_state::spider(machine_config &config) +void spider_state::spider(machine_config &config) { /* basic machine hardware */ V30(config, m_maincpu, 8000000); - m_maincpu->set_addrmap(AS_PROGRAM, &twins_state::twins_map); - m_maincpu->set_addrmap(AS_IO, &twins_state::spider_io); + m_maincpu->set_addrmap(AS_PROGRAM, &spider_state::twins_map); + m_maincpu->set_addrmap(AS_IO, &spider_state::spider_io); /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(8000000, 512, 0, 320, 312, 0, 200); // 15.625 kHz horizontal??? - screen.set_screen_update(FUNC(twins_state::screen_update_spider)); - screen.set_palette(m_palette); - screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); + video_config(config); + m_screen->set_screen_update(FUNC(spider_state::screen_update_spider)); PALETTE(config, m_palette).set_entries(0x100); - I2C_24C02(config, m_i2cmem); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); + base_config(config); - ay8910_device &aysnd(AY8910(config, "aysnd", 2000000)); - aysnd.port_a_read_callback().set_ioport("P1"); - aysnd.port_b_read_callback().set_ioport("P2"); - aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); + sound_config(config); } /* ECOGAMES Twins */ ROM_START( twins ) - ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_REGION16_LE( 0x100000, "ipl", 0 ) ROM_LOAD16_BYTE( "2.u8", 0x000000, 0x080000, CRC(1ec942b0) SHA1(627deb739c50f93c4cb61b8baf2a07213f1613b3) ) ROM_LOAD16_BYTE( "1.u9", 0x000001, 0x080000, CRC(4417ff34) SHA1(be992128fe48556a0a7c018953702b4ce9076526) ) - /* Unused */ - ROM_REGION( 0x000100, "extra", 0 ) - ROM_LOAD("24c02.u15", 0x000000, 0x000100, CRC(5ba30b14) SHA1(461f701879b76f1784705e067a5b6b31bfda4606) ) + ROM_REGION( 0x100, "i2cmem", 0 ) + ROM_LOAD("24c02.u15", 0x000, 0x100, CRC(2ff05b0e) SHA1(df6854446ba83f4a13ddf68bd2d0bc35be21be79) ) ROM_END /** Electronic Devices Twins */ ROM_START( twinsed1 ) - ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_REGION16_LE( 0x100000, "ipl", 0 ) ROM_LOAD16_BYTE( "1.bin", 0x000000, 0x080000, CRC(d5ef7b0d) SHA1(7261dca5bb0aef755b4f2b85a159b356e7ac8219) ) ROM_LOAD16_BYTE( "2.bin", 0x000001, 0x080000, CRC(8a5392f4) SHA1(e6a2ecdb775138a87d27aa4ad267bdec33c26baa) ) + + ROM_REGION( 0x100, "i2cmem", 0 ) + ROM_LOAD("24c02.u15", 0x000, 0x100, CRC(2ff05b0e) SHA1(df6854446ba83f4a13ddf68bd2d0bc35be21be79) ) ROM_END /* @@ -652,24 +663,55 @@ Electronic Devices 1x jamma edge connector 1x trimmer (volume) -hmm, we're only emulating 1x ay-3-8910, is the other at port 0 on this? +=== + +Author note: we're only emulating 1x ay-3-8910, assume being unused or dumper typo (unaccessed by the game) +twinsed2 is basically the same game as twins except having nudity pics (and inps are interchangeable between the sets) */ ROM_START( twinsed2 ) - ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_REGION16_LE( 0x100000, "ipl", 0 ) ROM_LOAD16_BYTE( "lp.bin", 0x000000, 0x080000, CRC(4f07862e) SHA1(fbda1973f79c6938c7f026a4db706e78781c2df8) ) ROM_LOAD16_BYTE( "hp.bin", 0x000001, 0x080000, CRC(aaf74b83) SHA1(09bd76b9fc5cb7ba6ffe1a2581ffd5633fe440b3) ) + + ROM_REGION( 0x100, "i2cmem", 0 ) + ROM_LOAD("24c02.u15", 0x000, 0x100, CRC(2ff05b0e) SHA1(df6854446ba83f4a13ddf68bd2d0bc35be21be79) ) ROM_END ROM_START( spider ) - ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_REGION16_LE( 0x100000, "ipl", 0 ) ROM_LOAD16_BYTE( "20.bin", 0x000001, 0x080000, CRC(25e15f11) SHA1(b728f35c817f60a294e38d66559da8977b94a1f5) ) ROM_LOAD16_BYTE( "21.bin", 0x000000, 0x080000, CRC(ff224206) SHA1(d8d45850983542e811facc917d016841fc56a97f) ) + + ROM_REGION( 0x100, "i2cmem", 0 ) + ROM_LOAD("24c02", 0x000, 0x100, CRC(6f710d66) SHA1(1cc6d1134c5b81b7d0913f09c07d73675770d817) ) ROM_END -GAME( 1993, twins, 0, twins, twins, twins_state, empty_init, ROT0, "Ecogames", "Twins", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, twinsed1, twins, twinsed1, twins, twins_state, empty_init, ROT0, "Ecogames (Electronic Devices license)", "Twins (Electronic Devices license, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, twinsed2, twins, twins, twins, twins_state, empty_init, ROT0, "Ecogames (Electronic Devices license)", "Twins (Electronic Devices license, set 2)", MACHINE_SUPPORTS_SAVE ) +void twins_state::init_twins() +{ + u8 *rom = (u8 *)memregion("ipl")->base(); + + rom[0x3497d] = 0x90; + rom[0x3497e] = 0x90; + + rom[0x34986] = 0x90; + rom[0x34987] = 0x90; +} + +void twins_state::init_twinsed2() +{ + u8 *rom = (u8 *)memregion("ipl")->base(); + + rom[0x349d3] = 0x90; + rom[0x349d4] = 0x90; + + rom[0x349dc] = 0x90; + rom[0x349dd] = 0x90; +} + +GAME( 1993, twins, 0, twins, twins, twins_state, init_twins, ROT0, "Ecogames", "Twins", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, twinsed1, twins, twinsed1, twins, twinsed1_state, empty_init, ROT0, "Ecogames (Electronic Devices license)", "Twins (Electronic Devices license, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, twinsed2, twins, twins, twins, twins_state, init_twinsed2, ROT0, "Ecogames (Electronic Devices license)", "Twins (Electronic Devices license, set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, spider, 0, spider, twins, twins_state, empty_init, ROT0, "Buena Vision", "Spider", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, spider, 0, spider, twins, spider_state, empty_init, ROT0, "Buena Vision", "Spider", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/unkmandd.cpp b/src/mame/drivers/unkmandd.cpp index 0517e5fa065..3997fcf14cc 100644 --- a/src/mame/drivers/unkmandd.cpp +++ b/src/mame/drivers/unkmandd.cpp @@ -69,4 +69,4 @@ ROM_START( unkmandd ) ROM_LOAD( "8718_en25f32.bin", 0x000000, 0x400000, CRC(cc138db4) SHA1(379af3d94ae840f52c06416d6cf32e25923af5ae) ) ROM_END -CONS( 200?, unkmandd, 0, 0, unkmandd, unkmandd, unkmandd_state, empty_init, "M&D", "Unknown M&D Handheld", MACHINE_IS_SKELETON ) +CONS( 200?, unkmandd, 0, 0, unkmandd, unkmandd, unkmandd_state, empty_init, "M&D", "unknown M&D handheld", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/ut88.cpp b/src/mame/drivers/ut88.cpp index 6fe1196a35c..65fc7f4d060 100644 --- a/src/mame/drivers/ut88.cpp +++ b/src/mame/drivers/ut88.cpp @@ -38,15 +38,15 @@ static GFXDECODE_START( gfx_ut88 ) GFXDECODE_END /* Address maps */ -void ut88_state::ut88mini_mem(address_map &map) +void ut88mini_state::mem_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x03ff).rom(); // System ROM map(0xc000, 0xc3ff).ram(); // RAM - map(0x9000, 0x9fff).w(FUNC(ut88_state::ut88mini_write_led)); // 7seg LED + map(0x9000, 0x9fff).w(FUNC(ut88mini_state::led_w)); // 7seg LED } -void ut88_state::ut88_mem(address_map &map) +void ut88_state::mem_map(address_map &map) { map(0x0000, 0x07ff).bankrw("bank1"); // First bank map(0x0800, 0xdfff).ram(); // RAM @@ -56,16 +56,16 @@ void ut88_state::ut88_mem(address_map &map) map(0xf800, 0xffff).rom(); // System ROM } -void ut88_state::ut88mini_io(address_map &map) +void ut88mini_state::io_map(address_map &map) { - map(0xA0, 0xA0).r(FUNC(ut88_state::ut88mini_keyboard_r)); - map(0xA1, 0xA1).r(FUNC(ut88_state::ut88_tape_r)); + map(0xA0, 0xA0).r(FUNC(ut88mini_state::keyboard_r)); + map(0xA1, 0xA1).r(FUNC(ut88mini_state::tape_r)); } -void ut88_state::ut88_io(address_map &map) +void ut88_state::io_map(address_map &map) { - map(0x04, 0x07).rw(FUNC(ut88_state::ut88_keyboard_r), FUNC(ut88_state::ut88_keyboard_w)); - map(0xA1, 0xA1).rw(FUNC(ut88_state::ut88_tape_r), FUNC(ut88_state::ut88_sound_w)); + map(0x04, 0x07).rw(FUNC(ut88_state::keyboard_r), FUNC(ut88_state::keyboard_w)); + map(0xA1, 0xA1).rw(FUNC(ut88_state::tape_r), FUNC(ut88_state::sound_w)); } /* Input ports */ @@ -191,9 +191,8 @@ void ut88_state::ut88(machine_config &config) { /* basic machine hardware */ I8080(config, m_maincpu, 2000000); - m_maincpu->set_addrmap(AS_PROGRAM, &ut88_state::ut88_mem); - m_maincpu->set_addrmap(AS_IO, &ut88_state::ut88_io); - MCFG_MACHINE_RESET_OVERRIDE(ut88_state, ut88 ) + m_maincpu->set_addrmap(AS_PROGRAM, &ut88_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &ut88_state::io_map); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -201,11 +200,9 @@ void ut88_state::ut88(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(64*8, 28*8); screen.set_visarea(0, 64*8-1, 0, 28*8-1); - screen.set_screen_update(FUNC(ut88_state::screen_update_ut88)); + screen.set_screen_update(FUNC(ut88_state::screen_update)); screen.set_palette(m_palette); - MCFG_VIDEO_START_OVERRIDE(ut88_state,ut88) - PALETTE(config, m_palette, palette_device::MONOCHROME); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ut88); @@ -217,9 +214,9 @@ void ut88_state::ut88(machine_config &config) /* Devices */ I8255A(config, m_ppi); - m_ppi->out_pa_callback().set(FUNC(ut88_state::ut88_8255_porta_w)); - m_ppi->in_pb_callback().set(FUNC(ut88_state::ut88_8255_portb_r)); - m_ppi->in_pc_callback().set(FUNC(ut88_state::ut88_8255_portc_r)); + m_ppi->out_pa_callback().set(FUNC(ut88_state::ppi_porta_w)); + m_ppi->in_pb_callback().set(FUNC(ut88_state::ppi_portb_r)); + m_ppi->in_pc_callback().set(FUNC(ut88_state::ppi_portc_r)); CASSETTE(config, m_cassette); m_cassette->set_formats(rku_cassette_formats); @@ -230,14 +227,12 @@ void ut88_state::ut88(machine_config &config) SOFTWARE_LIST(config, "cass_list").set_original("ut88"); } -void ut88_state::ut88mini(machine_config &config) +void ut88mini_state::ut88mini(machine_config &config) { /* basic machine hardware */ I8080(config, m_maincpu, 2000000); - m_maincpu->set_addrmap(AS_PROGRAM, &ut88_state::ut88mini_mem); - m_maincpu->set_addrmap(AS_IO, &ut88_state::ut88mini_io); - MCFG_MACHINE_START_OVERRIDE(ut88_state,ut88mini) - MCFG_MACHINE_RESET_OVERRIDE(ut88_state, ut88mini ) + m_maincpu->set_addrmap(AS_PROGRAM, &ut88mini_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &ut88mini_state::io_map); /* video hardware */ config.set_default_layout(layout_ut88mini); @@ -272,6 +267,6 @@ ROM_END /* Driver */ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1989, ut88mini, 0, 0, ut88mini, ut88mini, ut88_state, init_ut88mini, "<unknown>", "UT-88 mini", 0) -COMP( 1989, ut88, ut88mini, 0, ut88, ut88, ut88_state, init_ut88, "<unknown>", "UT-88", 0) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1989, ut88mini, 0, 0, ut88mini, ut88mini, ut88mini_state, empty_init, "<unknown>", "UT-88 mini", 0) +COMP( 1989, ut88, ut88mini, 0, ut88, ut88, ut88_state, empty_init, "<unknown>", "UT-88", 0) diff --git a/src/mame/drivers/v0bowl.cpp b/src/mame/drivers/v0bowl.cpp index 5e4dbe86db7..0ef0727ed13 100644 --- a/src/mame/drivers/v0bowl.cpp +++ b/src/mame/drivers/v0bowl.cpp @@ -2,10 +2,10 @@ // copyright-holders:Angelo Salese /*************************************************************************** - "Unknown VRender0+ Bowling Game" (c) 200x A1 Amusement One + "Unknown VRender0+ Bowling Game" (c) 200x A1 Amusement One - TODO: - - checkout the actual SanDisk device + TODO: + - checkout the actual SanDisk device ***************************************************************************/ @@ -21,24 +21,24 @@ class v0bowl_state : public driver_device { public: - v0bowl_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_vr0soc(*this, "vr0soc") + v0bowl_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_vr0soc(*this, "vr0soc") {} - void v0bowl(machine_config &config); + void v0bowl(machine_config &config); protected: - // driver_device overrides - virtual void machine_start() override; - virtual void machine_reset() override; + // driver_device overrides + virtual void machine_start() override; + virtual void machine_reset() override; private: - void v0bowl_map(address_map &map); + void v0bowl_map(address_map &map); - // devices - required_device<cpu_device> m_maincpu; + // devices + required_device<cpu_device> m_maincpu; required_device<vrender0soc_device> m_vr0soc; IRQ_CALLBACK_MEMBER(icallback); @@ -62,64 +62,64 @@ void v0bowl_state::v0bowl_map(address_map &map) map(0x02000000, 0x027fffff).ram().share("workram"); map(0x03000000, 0x04ffffff).m(m_vr0soc, FUNC(vrender0soc_device::audiovideo_map)); -// map(0x05000000, 0x0500000f) SanDisk +// map(0x05000000, 0x0500000f) SanDisk } static INPUT_PORTS_START( v0bowl ) - /* dummy active high structure */ - PORT_START("SYSA") - PORT_DIPNAME( 0x01, 0x00, "SYSA" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - /* dummy active low structure */ - PORT_START("DSWA") - PORT_DIPNAME( 0x01, 0x01, "DSWA" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + /* dummy active high structure */ + PORT_START("SYSA") + PORT_DIPNAME( 0x01, 0x00, "SYSA" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + /* dummy active low structure */ + PORT_START("DSWA") + PORT_DIPNAME( 0x01, 0x01, "DSWA" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END void v0bowl_state::machine_start() @@ -152,11 +152,11 @@ void v0bowl_state::v0bowl(machine_config &config) ROM_START( v0bowl ) ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) - ROM_LOAD( "bootrom.u16", 0x000000, 0x080000, CRC(f8f4cf22) SHA1(881d8eeb6f50b2e7933e7c3c93adcdd0c1e93e77) ) + ROM_LOAD( "bootrom.u16", 0x000000, 0x080000, CRC(f8f4cf22) SHA1(881d8eeb6f50b2e7933e7c3c93adcdd0c1e93e77) ) ROM_REGION32_LE( 0x20000000, "flash", ROMREGION_ERASEFF ) // SanDisk CF // zipped FAT16, filesystem was made with DOS 3.31 but the folders have Windows Thumbs.db files as well. - ROM_LOAD( "bowling.001", 0x000000, 0x1e8be000, BAD_DUMP CRC(aebb2b01) SHA1(cd11f74f6512350ac10f822937b8769f552aabf3) ) + ROM_LOAD( "bowling.001", 0x000000, 0x1e8be000, BAD_DUMP CRC(aebb2b01) SHA1(cd11f74f6512350ac10f822937b8769f552aabf3) ) ROM_END GAME( 200?, v0bowl, 0, v0bowl, v0bowl, v0bowl_state, empty_init, ROT0, "A1 Amusement One", "unknown VRender0+ bowling game", MACHINE_IS_SKELETON ) // Return Bowl? diff --git a/src/mame/drivers/v6809.cpp b/src/mame/drivers/v6809.cpp index 96b80f7414f..304514441f6 100644 --- a/src/mame/drivers/v6809.cpp +++ b/src/mame/drivers/v6809.cpp @@ -86,6 +86,8 @@ public: void v6809(machine_config &config); private: + virtual void machine_reset() override; + DECLARE_WRITE_LINE_MEMBER(speaker_en_w); DECLARE_WRITE_LINE_MEMBER(speaker_w); DECLARE_READ8_MEMBER(pb_r); @@ -94,7 +96,6 @@ private: DECLARE_WRITE8_MEMBER(v6809_address_w); DECLARE_WRITE8_MEMBER(v6809_register_w); void kbd_put(u8 data); - DECLARE_MACHINE_RESET(v6809); MC6845_UPDATE_ROW(crtc_update_row); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr); @@ -139,7 +140,7 @@ void v6809_state::v6809_mem(address_map &map) static INPUT_PORTS_START( v6809 ) INPUT_PORTS_END -MACHINE_RESET_MEMBER( v6809_state, v6809) +void v6809_state::machine_reset() { m_term_data = 0; m_pia0->cb1_w(1); @@ -287,7 +288,6 @@ void v6809_state::v6809(machine_config &config) /* basic machine hardware */ MC6809(config, m_maincpu, 16_MHz_XTAL / 4); // divided by 4 again internally m_maincpu->set_addrmap(AS_PROGRAM, &v6809_state::v6809_mem); - MCFG_MACHINE_RESET_OVERRIDE(v6809_state, v6809) /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp index 61dd7388f0b..0d37129f1f4 100644 --- a/src/mame/drivers/vamphalf.cpp +++ b/src/mame/drivers/vamphalf.cpp @@ -1591,7 +1591,7 @@ ROM_END Jumping Break & Poosho Poosho F2 System, 1999 -sequel to "Die Break" from the Bestri 3 game collection (see crospang.c) +sequel to "Die Break" from the Bestri 3 game collection (see crospang.cpp) F-E1-16-002 +----------------------------------------------+ @@ -1681,7 +1681,7 @@ ROM_END New Cross Pang F2 System, 1999 -sequel to "Cross Pang" (see crospang.c) +sequel to "Cross Pang" (see crospang.cpp) F-E1-16-002 +----------------------------------------------+ diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp deleted file mode 100644 index c7fe56a7790..00000000000 --- a/src/mame/drivers/vii.cpp +++ /dev/null @@ -1,3949 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/****************************************************************************** - - Short Description: - - Systems which run on the SPG243 SoC - - die markings show - "SunPlus QL8041" ( also known as Sunplus SPG240 & PAC300 ) - - All GameKeyReady units - Disney Princess (GKR) - Wheel of Fortune (GKR) - JAKKS WWE (GKR) - Fantastic 4 (GKR) - Justice League (GKR) - Dora the Explorer Nursery Rhyme (GKR) - Dora the Explorer Play Park (GKR) - Spiderman 5-in-1 (GKR) - etc. - - (other non GKR JAKKS games) - X-Men (Wolverine pad) - Avatar: The Last Airbender - Superman in Super Villain Showdown - - (other games) - Mattel Classic Sports - - "SunPlus QL8041C" ( known as Sunplus SPG2??, seems to be compatible with above, so probably just a chip revision ) - - Clickstart ( see clickstart.cpp instead) - Wheel of Fortune 2nd Edition - Spider-man - Villain Roundup - - "SunPlus QU7074-P69A" - - The Batman - Star Wars (non-gamekey, which model? falcon? - check) - Dream Life - - "SunPlus QL8167b" (is the scrambling built into the CPU, or external?) - - Lexibook Zeus IG900 20-in-1 - - "SunPlus QL8139C" - - Radica Cricket - V Smile Baby (Sweden) - see vsmileb.cpp - - --- - - Very likely the same - - "Sunplus QL8167" (these might have ROM scrambling if that is a 8167 feature) - - Disney Princess Magical Adventure - Go Diego Go - Shrek - Over the Hedge (this unit shows a 'GameKey Unlock More Games' on startup, but has no port, not even on the internal PCB) - Marvel Heroes (Spider-man) - Spiderman 3 (Movie - black) - - - --- - - It is unknown if the following are close to this architecture or not (no dumps yet) - - "SunPlus QU7073-P69A" - - Mortal Kombat - - "Sunplus PU7799-P680?" (difficult to read) - - Mission Paintball - - --- - - These are definitely different but still unSP based - - "SunPlus PA7801" ( known as Sunplus SPG110? ) - - see spg110.cpp instead - - "GCM394" (this is clearly newer, has extra opcodes, different internal map etc. also scaling and higher resolutions based on Spongebob) - - see sunplus_gcm394.cpp instead - - Status: - - Mostly working - - To-Do: - - Proper driver_device inheritance to untangle the mess of members - - Detailed list of bugs: - - All systems: - Various inaccuracies in samples/envelopes. - - jak_wall, jak_sdoo: - Game seems unhappy with NVRAM, clears contents on each boot. - jak_pooh: - In the 'Light Tag' minigame (select the rock) the game usually softlocks when you find a friend (with or without DRC) - jak_care: - All but one mini-game waits on RAM address 0x0165 changing from 0x00f9 to 0x00f8 - The bottom left game "Wish Bear's Wishing Tree" appears to fail for more complex reasons. - jak_disf: - Shows corrupt logo on first boot with no valid nvram (possibly hardware does too - verify if possible to invalidate EEPROM on device) - lexizeus: - Some corrupt sound effects and a few corrupt ground tiles a few minutes in. (checksum is good, and a video recorded - from one of these doesn't exhibit these problems, so either emulation issue or alt revision?) - pvmil: - Question order depends on SoC RNG, only reads when it wants a new value, so unless RNG runs on a timer question order ends up the same - - vii: - When loading a cart from file manager, sometimes MAME will crash. - The "MOTOR" option in the diagnostic menu does nothing when selected. - The "SPEECH IC" option in the diagnostic menu does nothing when selected. - On 'vii_vc1' & 'vii_vc2' cart, the left-right keys are transposed with the up-down keys. - - This is not a bug per se, as the games are played with the controller physically rotated 90 degrees. - - Note: - Cricket, Skateboarder, Skannerz and Football 2 list a 32-bit checksum at the start of ROM. - This is the byte sum of the file, excluding the first 16 byte (where the checksum is stored) - - Test Modes: - Justice League : press UP, DOWN, LEFT, BT3 on the JAKKS logo in that order, quickly, to get test menu - WWE : press UP, BT1, BT2 together during startup logos - - Disney Friends, MS Pacman, WallE, Batman (and some other HotGen GameKeys) for test mode, hold UP, - press A, press DOWN during startup - - Capcom test (same access as other Hotgen games) mode looks like this (tested on PAL unit, same ROM as dumped one) - - RAM OK 2800 - 111111 - 5432109876543210 - IOA ............111. (values go from . to 1 when inputs are moved, never 0 as in MAME!, core bug?) - GAMEKEY E0 - IOB0 - IOC XXX.........X... - SPRITES - - Care Bears : Hold analog stck up, rotate stick 360 degress back to up, press 'A' while still holding up - - TODO: - Work out how to access the hidden TEST menus for all games (most JAKKS games should have one at least) - -*******************************************************************************/ - -#include "emu.h" - -#include "cpu/unsp/unsp.h" -#include "machine/i2cmem.h" -#include "machine/eepromser.h" -#include "machine/spg2xx.h" - -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "bus/jakks_gamekey/slot.h" - -#include "screen.h" -#include "softlist.h" -#include "speaker.h" - -#include "pvmil.lh" -#include "sentx6p.lh" - -class spg2xx_game_state : public driver_device -{ -public: - spg2xx_game_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_screen(*this, "screen") - , m_bank(*this, "cartbank") - , m_io_p1(*this, "P1") - , m_io_p2(*this, "P2") - , m_io_p3(*this, "P3") - , m_i2cmem(*this, "i2cmem") - { } - - void spg2xx_base(machine_config &config); - void jakks(machine_config &config); - void jakks_i2c(machine_config &config); - void walle(machine_config &config); - void rad_skat(machine_config &config); - void rad_skatp(machine_config &config); - void rad_sktv(machine_config &config); - void rad_crik(machine_config &config); - void non_spg_base(machine_config &config); - void lexizeus(machine_config &config); - void taikeegr(machine_config &config); - - void init_crc(); - void init_zeus(); - void init_taikeegr(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - void switch_bank(uint32_t bank); - - DECLARE_WRITE8_MEMBER(i2c_w); - DECLARE_READ8_MEMBER(i2c_r); - - DECLARE_READ16_MEMBER(jakks_porta_r); - - DECLARE_READ16_MEMBER(rad_porta_r); - DECLARE_READ16_MEMBER(rad_portb_r); - DECLARE_READ16_MEMBER(rad_portc_r); - - DECLARE_WRITE16_MEMBER(jakks_porta_w); - DECLARE_WRITE16_MEMBER(jakks_portb_w); - - required_device<spg2xx_device> m_maincpu; - required_device<screen_device> m_screen; - optional_memory_bank m_bank; - - DECLARE_READ16_MEMBER(walle_portc_r); - DECLARE_WRITE16_MEMBER(walle_portc_w); - - virtual void mem_map_4m(address_map &map); - virtual void mem_map_2m(address_map &map); - virtual void mem_map_1m(address_map &map); - - uint32_t m_current_bank; - - uint16_t m_walle_portc_data; - - required_ioport m_io_p1; - optional_ioport m_io_p2; - optional_ioport m_io_p3; - optional_device<i2cmem_device> m_i2cmem; -}; - -class wireless60_state : public spg2xx_game_state -{ -public: - wireless60_state(const machine_config& mconfig, device_type type, const char* tag) : - spg2xx_game_state(mconfig, type, tag), - m_bankmask(0x7) - { } - - void wireless60(machine_config& config); - - void init_lx_jg7415(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - uint8_t m_w60_controller_input; - uint16_t m_w60_porta_data; - uint16_t m_w60_p1_ctrl_mask; - uint16_t m_w60_p2_ctrl_mask; - uint8_t m_bankmask; - - DECLARE_WRITE16_MEMBER(wireless60_porta_w); - DECLARE_WRITE16_MEMBER(wireless60_portb_w); - DECLARE_READ16_MEMBER(wireless60_porta_r); - -private: -}; - - -class zone40_state : public wireless60_state -{ -public: - zone40_state(const machine_config& mconfig, device_type type, const char* tag) : - wireless60_state(mconfig, type, tag), - m_romregion(*this, "maincpu") - { } - - void zone40(machine_config &config); - - void init_zone40(); - - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - -private: - virtual void mem_map_z40(address_map &map); - DECLARE_READ16_MEMBER(z40_rom_r); - DECLARE_READ16_MEMBER(zone40_porta_r); - DECLARE_WRITE16_MEMBER(zone40_porta_w); - required_region_ptr<uint16_t> m_romregion; - uint8_t m_z40_rombase; -}; - -class pvmil_state : public spg2xx_game_state -{ -public: - pvmil_state(const machine_config &mconfig, device_type type, const char *tag) - : spg2xx_game_state(mconfig, type, tag) - , m_portcdata(0x0000) - , m_latchcount(0) - , m_latchbit(0) - , m_outdat(0) - , m_p4inputs(*this, "EXTRA") - , m_leds(*this, "led%u", 0U) - { } - - void pvmil(machine_config &config); - - DECLARE_READ_LINE_MEMBER(pvmil_p4buttons_r); - -protected: - virtual void machine_start() override; - - DECLARE_WRITE16_MEMBER(pvmil_porta_w); - DECLARE_WRITE16_MEMBER(pvmil_portb_w); - DECLARE_WRITE16_MEMBER(pvmil_portc_w); - -private: - uint16_t m_portcdata; - int m_latchcount; - int m_latchbit; - uint16_t m_outdat; - required_ioport m_p4inputs; - output_finder<4> m_leds; -}; - - -class sentx6p_state : public spg2xx_game_state -{ -public: - sentx6p_state(const machine_config &mconfig, device_type type, const char *tag) : - spg2xx_game_state(mconfig, type, tag), - m_porta_data(0x0000), - m_suite1(*this, "SUITE_LEFT_BZ%u", 0U), - m_suite2(*this, "SUITE_RIGHT_BZ%u", 0U), - m_number1(*this, "NUMBER_LEFT_BZ%u", 0U), - m_number2(*this, "NUMBER_RIGHT_BZ%u", 0U), - m_select_fold(*this, "SELECT_FOLD_BZ%u", 0U), - m_select_check(*this, "SELECT_CHECK_BZ%u", 0U), - m_select_bet(*this, "SELECT_BET_BZ%u", 0U), - m_select_call(*this, "SELECT_CALL_BZ%u", 0U), - m_select_raise(*this, "SELECT_RAISE_BZ%u", 0U), - m_select_allin(*this, "SELECT_ALLIN_BZ%u", 0U), - m_option_fold(*this, "OPTION_FOLD_BZ%u", 0U), - m_option_check(*this, "OPTION_CHECK_BZ%u", 0U), - m_option_bet(*this, "OPTION_BET_BZ%u", 0U), - m_option_call(*this, "OPTION_CALL_BZ%u", 0U), - m_option_raise(*this, "OPTION_RAISE_BZ%u", 0U), - m_option_allin(*this, "OPTION_ALLIN_BZ%u", 0U), - - m_led(*this, "LED_BZ%u", 0U) - { } - - void sentx6p(machine_config &config); - - void mem_map_2m_texas(address_map &map); - - DECLARE_INPUT_CHANGED_MEMBER(ok_latch) - { - if (newval == 1) - { - m_inputlatches[param] |= 0x02; - logerror("latching OK button for Player %d\n", param+1); - } - } - - DECLARE_INPUT_CHANGED_MEMBER(select_latch) - { - if (newval == 1) - { - m_inputlatches[param] |= 0x01; - logerror("latching Select button for Player %d\n", param+1); - } - } - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - -private: - READ16_MEMBER(sentx_porta_r); - READ16_MEMBER(sentx_portb_r); - READ16_MEMBER(sentx_portc_r); - - DECLARE_WRITE16_MEMBER(sentx_porta_w); - DECLARE_WRITE16_MEMBER(sentx_portb_w); - DECLARE_WRITE16_MEMBER(sentx_portc_w); - - DECLARE_WRITE8_MEMBER(sentx_tx_w); - - uint8_t m_lcd_card1[6]; - uint8_t m_lcd_card2[6]; - uint8_t m_lcd_options[6]; - uint8_t m_lcd_options_select[6]; - uint8_t m_lcd_led[6]; - - void set_card1(uint8_t value, int select_bits); - void set_card2(uint8_t value, int select_bits); - void set_options(uint8_t value, int select_bits); - void set_options_select(uint8_t value, int select_bits); - void set_controller_led(uint8_t value, int select_bits); - - void controller_send_data(int which); - - uint8_t m_inputlatches[6]; - - uint16_t m_porta_data; - - output_finder<6> m_suite1; - output_finder<6> m_suite2; - output_finder<6> m_number1; - output_finder<6> m_number2; - - output_finder<6> m_select_fold; - output_finder<6> m_select_check; - output_finder<6> m_select_bet; - output_finder<6> m_select_call; - output_finder<6> m_select_raise; - output_finder<6> m_select_allin; - - output_finder<6> m_option_fold; - output_finder<6> m_option_check; - output_finder<6> m_option_bet; - output_finder<6> m_option_call; - output_finder<6> m_option_raise; - output_finder<6> m_option_allin; - - output_finder<6> m_led; -}; - -class jakks_gkr_state : public spg2xx_game_state -{ -public: - jakks_gkr_state(const machine_config &mconfig, device_type type, const char *tag) - : spg2xx_game_state(mconfig, type, tag) - , m_porta_key_mode(false) - , m_cart(*this, "cartslot") - , m_cart_region(nullptr) - { } - - void jakks_gkr(machine_config &config); - void jakks_gkr_i2c(machine_config &config); - void jakks_gkr_1m_i2c(machine_config &config); - void jakks_gkr_2m_i2c(machine_config &config); - void jakks_gkr_nk(machine_config &config); - void jakks_gkr_nk_i2c(machine_config &config); - void jakks_gkr_dy(machine_config &config); - void jakks_gkr_dy_i2c(machine_config &config); - void jakks_gkr_dp_i2c(machine_config &config); - void jakks_gkr_sw_i2c(machine_config &config); - void jakks_gkr_nm_i2c(machine_config &config); - void jakks_gkr_cc_i2c(machine_config &config); - void jakks_gkr_wf_i2c(machine_config &config); - void jakks_gkr_mv_i2c(machine_config &config); - void jakks_gkr_wp(machine_config &config); - void jakks_gkr_cb(machine_config &config); - - DECLARE_READ_LINE_MEMBER(i2c_gkr_r); - -private: - virtual void machine_start() override; - - DECLARE_WRITE16_MEMBER(gkr_portc_w); - DECLARE_WRITE16_MEMBER(jakks_porta_key_io_w); - DECLARE_READ16_MEMBER(jakks_porta_key_io_r); - bool m_porta_key_mode; - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_gamekey); - - required_device<jakks_gamekey_slot_device> m_cart; - memory_region *m_cart_region; -}; - -class vii_state : public spg2xx_game_state -{ -public: - vii_state(const machine_config &mconfig, device_type type, const char *tag) - : spg2xx_game_state(mconfig, type, tag) - , m_cart(*this, "cartslot") - , m_io_motionx(*this, "MOTIONX") - , m_io_motiony(*this, "MOTIONY") - , m_io_motionz(*this, "MOTIONZ") - , m_cart_region(nullptr) - , m_ctrl_poll_timer(nullptr) - { } - - void vii(machine_config &config); - -private: - virtual void machine_start() override; - virtual void machine_reset() override; - - static const device_timer_id TIMER_CTRL_POLL = 0; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - - DECLARE_WRITE16_MEMBER(vii_portb_w); - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_vii); - - virtual void poll_controls(); - - required_device<generic_slot_device> m_cart; - required_ioport m_io_motionx; - required_ioport m_io_motiony; - required_ioport m_io_motionz; - memory_region *m_cart_region; - - emu_timer *m_ctrl_poll_timer; - uint8_t m_controller_input[8]; -}; - -class icanguit_state : public spg2xx_game_state -{ -public: - icanguit_state(const machine_config &mconfig, device_type type, const char *tag) - : spg2xx_game_state(mconfig, type, tag) - , m_cart(*this, "cartslot") - , m_cart_region(nullptr) - , m_porta_in(*this, "P1_%u", 0U) - , m_portc_in(*this, "P3_%u", 0U) - { } - - void icanguit(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_icanguit); - - DECLARE_READ16_MEMBER(porta_r); - virtual DECLARE_WRITE16_MEMBER(porta_w); - - virtual DECLARE_READ16_MEMBER(portb_r); - virtual DECLARE_WRITE16_MEMBER(portb_w); - - DECLARE_READ16_MEMBER(portc_r); - DECLARE_WRITE16_MEMBER(portc_w); - - required_device<generic_slot_device> m_cart; - memory_region *m_cart_region; - - uint16_t m_inlatch_a; - uint16_t m_inlatch_c; - optional_ioport_array<6> m_porta_in; - optional_ioport_array<6> m_portc_in; - -}; - -class icanpian_state : public icanguit_state -{ -public: - icanpian_state(const machine_config &mconfig, device_type type, const char *tag) - : icanguit_state(mconfig, type, tag) - // , m_eeprom(*this, "eeprom") - { } - - void icanpian(machine_config &config); - -protected: - virtual DECLARE_WRITE16_MEMBER(porta_w) override; - - virtual DECLARE_READ16_MEMBER(portb_r) override; - virtual DECLARE_WRITE16_MEMBER(portb_w) override; - - //optional_device<eeprom_serial_93cxx_device> m_eeprom; -}; - -class tvgogo_state : public spg2xx_game_state -{ -public: - tvgogo_state(const machine_config &mconfig, device_type type, const char *tag) - : spg2xx_game_state(mconfig, type, tag) - , m_cart(*this, "cartslot") - , m_cart_region(nullptr) - { } - - void tvgogo(machine_config &config); - -private: - uint8_t m_i2cunk; - - virtual void machine_start() override; - virtual void machine_reset() override; - - DECLARE_WRITE8_MEMBER(tvg_i2c_w); - DECLARE_READ8_MEMBER(tvg_i2c_r); - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load_tvgogo); - - required_device<generic_slot_device> m_cart; - memory_region *m_cart_region; -}; - - -class dreamlif_state : public spg2xx_game_state -{ -public: - dreamlif_state(const machine_config &mconfig, device_type type, const char *tag) - : spg2xx_game_state(mconfig, type, tag) - , m_eeprom(*this, "eeprom") - { } - - void dreamlif(machine_config &config); - -private: - DECLARE_READ16_MEMBER(portb_r); - DECLARE_WRITE16_MEMBER(portb_w); - - required_device<eeprom_serial_93cxx_device> m_eeprom; -}; - -class shredmjr_game_state : public spg2xx_game_state -{ -public: - shredmjr_game_state(const machine_config &mconfig, device_type type, const char *tag) : - spg2xx_game_state(mconfig, type, tag), - m_porta_data(0x0000), - m_shiftamount(0) - { } - - void shredmjr(machine_config &config); - -protected: - DECLARE_READ16_MEMBER(porta_r); - DECLARE_WRITE16_MEMBER(porta_w); - -private: - uint16_t m_porta_data; - int m_shiftamount; - -}; - - -/************************* -* Machine Hardware * -*************************/ - -void spg2xx_game_state::switch_bank(uint32_t bank) -{ - if (m_bank) - { - if (bank != m_current_bank) - { - m_current_bank = bank; - m_bank->set_entry(bank); - m_maincpu->invalidate_cache(); - } - } -} - -WRITE8_MEMBER(spg2xx_game_state::i2c_w) -{ - logerror("%s: i2c_w %05x %04x\n", machine().describe_context(), offset, data); -} - -READ8_MEMBER(spg2xx_game_state::i2c_r) -{ - logerror("%s: i2c_r %04x\n", machine().describe_context(), offset); - return 0x0000; -} - -WRITE16_MEMBER(wireless60_state::wireless60_porta_w) -{ - m_w60_porta_data = (data & 0x300) | m_w60_p1_ctrl_mask | m_w60_p2_ctrl_mask; - switch (m_w60_porta_data & 0x300) - { - case 0x300: - m_w60_controller_input = -1; - break; - - case 0x200: - m_w60_controller_input++; - break; - - default: - uint16_t temp1 = m_io_p1->read(); - uint16_t temp2 = m_io_p2->read(); - uint16_t temp3 = 1 << m_w60_controller_input; - if (temp1 & temp3) m_w60_porta_data ^= m_w60_p1_ctrl_mask; - if (temp2 & temp3) m_w60_porta_data ^= m_w60_p2_ctrl_mask; - break; - } -} - -WRITE16_MEMBER(zone40_state::zone40_porta_w) -{ - wireless60_porta_w(space, offset, data); - - if ((data & 0x00ff) != m_z40_rombase) - { - m_z40_rombase = data & 0x00ff; - m_maincpu->invalidate_cache(); - } -} - -READ16_MEMBER(wireless60_state::wireless60_porta_r) -{ - return m_w60_porta_data; -} - -READ16_MEMBER(zone40_state::zone40_porta_r) -{ - uint16_t ret = wireless60_porta_r(space, offset) & (0x0300 | m_w60_p1_ctrl_mask | m_w60_p2_ctrl_mask); - ret = (ret & 0xff00) | m_z40_rombase; - return ret; -} - -WRITE16_MEMBER(wireless60_state::wireless60_portb_w) -{ - logerror("%s: wireless60_portb_w (bankswitch) %04x\n", machine().describe_context(), data); - switch_bank(data & m_bankmask); -} - -void vii_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - switch (id) - { - case TIMER_CTRL_POLL: - poll_controls(); - break; - default: - logerror("Unknown timer ID: %d\n", id); - break; - } -} - -WRITE16_MEMBER(vii_state::vii_portb_w) -{ - switch_bank(((data & 0x80) >> 7) | ((data & 0x20) >> 4)); -} - - -READ_LINE_MEMBER(jakks_gkr_state::i2c_gkr_r) -{ - if (m_cart && m_cart->exists()) - { - return m_cart->read_cart_seeprom(); - } - else - { - return m_i2cmem->read_sda(); - } -} - -WRITE16_MEMBER(spg2xx_game_state::walle_portc_w) -{ - m_walle_portc_data = data & mem_mask; - if (BIT(mem_mask, 1)) - m_i2cmem->write_scl(BIT(data, 1)); - if (BIT(mem_mask, 0)) - m_i2cmem->write_sda(BIT(data, 0)); -} - -WRITE16_MEMBER(jakks_gkr_state::gkr_portc_w) -{ - m_walle_portc_data = data & mem_mask; - - if (m_cart && m_cart->exists()) - { - m_cart->write_cart_seeprom(space,offset,data,mem_mask); - } - else - { - if (m_i2cmem) - { - if (BIT(mem_mask, 1)) - m_i2cmem->write_scl(BIT(data, 1)); - if (BIT(mem_mask, 0)) - m_i2cmem->write_sda(BIT(data, 0)); - } - } -} - -READ16_MEMBER(spg2xx_game_state::jakks_porta_r) -{ - //logerror("%s: jakks_porta_r\n", machine().describe_context()); - return m_io_p1->read(); -} - -WRITE16_MEMBER(spg2xx_game_state::jakks_porta_w) -{ - //logerror("%s: jakks_porta_w %04x\n", machine().describe_context(), data); -} - -WRITE16_MEMBER(spg2xx_game_state::jakks_portb_w) -{ - //logerror("%s: jakks_portb_w %04x\n", machine().describe_context(), data); -} - -READ16_MEMBER(jakks_gkr_state::jakks_porta_key_io_r) -{ - //logerror("%s: jakks_porta_key_io_r\n", machine().describe_context()); - if (m_porta_key_mode == false) - { - return m_io_p1->read(); - } - else - { - /* masks with 0xf, inverts, and combines it with a previous read (when data written to jakks_porta_key_io_w was 0x0000) and expects result to be 0x0000 - could just expect data written to be returned, but that would be a strange check. - all systems seem to respond to the same result, so how is the per-system lock implemented? */ - return (m_io_p1->read() & 0xfff0) | 0x000f; - } -} - -WRITE16_MEMBER(jakks_gkr_state::jakks_porta_key_io_w) -{ - logerror("%s: jakks_porta_key_io_w %04x\n", machine().describe_context(), data); - // only seen 0xffff and 0x0000 written here.. writes 0xffff before the 2nd part of the port a gamekey check read. - if (data == 0xffff) - { - m_porta_key_mode = true; - } - else - { - m_porta_key_mode = false; - } -} - -READ16_MEMBER(spg2xx_game_state::rad_porta_r) -{ - uint16_t data = m_io_p1->read(); - logerror("Port A Read: %04x\n", data); - return data; -} - -READ16_MEMBER(spg2xx_game_state::rad_portb_r) -{ - uint16_t data = m_io_p2->read(); - logerror("Port B Read: %04x\n", data); - return data; -} - -READ16_MEMBER(spg2xx_game_state::rad_portc_r) -{ - uint16_t data = m_io_p3->read(); - logerror("Port C Read: %04x\n", data); - return data; -} - -void pvmil_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - m_leds.resolve(); - save_item(NAME(m_portcdata)); - save_item(NAME(m_latchcount)); - save_item(NAME(m_latchbit)); - save_item(NAME(m_outdat)); -} - - -WRITE16_MEMBER(pvmil_state::pvmil_porta_w) -{ - logerror("%s: pvmil_porta_w %04x\n", machine().describe_context(), data); -} - -WRITE16_MEMBER(pvmil_state::pvmil_portb_w) -{ - logerror("%s: pvmil_portb_w %04x\n", machine().describe_context(), data); -} - - -READ_LINE_MEMBER(pvmil_state::pvmil_p4buttons_r) -{ - return m_latchbit; -} - - -WRITE16_MEMBER(pvmil_state::pvmil_portc_w) -{ - // ---- -432 1--- r-?c - // 4,3,2,1 = player controller LEDs - // r = reset input multiplexer - // ? = unknown - // m = input multiplexer clock - - // p4 input reading - // the code to read them is interesting tho, it even includes loops that poll port a 16 times before/after, why? - logerror("%s: pvmil_portc_w %04x\n", machine().describe_context(), data); - - uint16_t bit; - - // for logging bits changed on the port - if (0) - { - for (int i = 0; i < 16; i++) - { - bit = 1 << i; - if ((m_portcdata & bit) != (data & bit)) - { - if (data & bit) - { - logerror("port c %04x low to high\n", bit); - } - else - { - logerror("port c %04x high to low\n", bit); - } - } - - if ((m_portcdata & 0x0400) != (data & 0x0400)) - { - logerror("-------------------------------------------------\n"); - } - } - } - - // happens on startup, before it starts reading inputs for the first time, assume 'reset counter' - bit = 0x0008; - if ((m_portcdata & bit) != (data & bit)) - { - if (data & bit) - { - logerror("reset read counter\n"); - m_latchcount = 0; - } - } - - bit = 0x0001; - if ((m_portcdata & bit) != (data & bit)) - { - if (!(data & bit)) - { - //logerror("latch with count of %d (outbit is %d)\n", m_latchcount, (m_portcdata & 0x0002)>>1 ); - // what is bit 0x0002? it gets flipped in the same code as the inputs are read. - // it doesn't follow any obvious pattern - m_outdat &= ~(1 << m_latchcount); - m_outdat |= ((data & 0x0002) >> 1) << m_latchcount; - if (0) - popmessage("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", - (m_outdat & 0x8000) ? 1 : 0, (m_outdat & 0x4000) ? 1 : 0, (m_outdat & 0x2000) ? 1 : 0, (m_outdat & 0x1000) ? 1 : 0, - (m_outdat & 0x0800) ? 1 : 0, (m_outdat & 0x0400) ? 1 : 0, (m_outdat & 0x0200) ? 1 : 0, (m_outdat & 0x0100) ? 1 : 0, - (m_outdat & 0x0080) ? 1 : 0, (m_outdat & 0x0040) ? 1 : 0, (m_outdat & 0x0020) ? 1 : 0, (m_outdat & 0x0010) ? 1 : 0, - (m_outdat & 0x0008) ? 1 : 0, (m_outdat & 0x0004) ? 1 : 0, (m_outdat & 0x0002) ? 1 : 0, (m_outdat & 0x0001) ? 1 : 0); - - - m_latchbit = (((m_p4inputs->read()) << m_latchcount) & 0x8000) ? 1 : 0; - - m_latchcount++; - if (m_latchcount == 16) - m_latchcount = 0; - } - } - - m_portcdata = data; - - if (0) - popmessage("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", - (m_portcdata & 0x8000) ? 1 : 0, (m_portcdata & 0x4000) ? 1 : 0, (m_portcdata & 0x2000) ? 1 : 0, (m_portcdata & 0x1000) ? 1 : 0, - (m_portcdata & 0x0800) ? 1 : 0, (m_portcdata & 0x0400) ? 1 : 0, (m_portcdata & 0x0200) ? 1 : 0, (m_portcdata & 0x0100) ? 1 : 0, - (m_portcdata & 0x0080) ? 1 : 0, (m_portcdata & 0x0040) ? 1 : 0, (m_portcdata & 0x0020) ? 1 : 0, (m_portcdata & 0x0010) ? 1 : 0, - (m_portcdata & 0x0008) ? 1 : 0, (m_portcdata & 0x0004) ? 1 : 0, (m_portcdata & 0x0002) ? 1 : 0, (m_portcdata & 0x0001) ? 1 : 0); - - m_leds[0] = (m_portcdata & 0x0080) ? 0 : 1; - m_leds[1] = (m_portcdata & 0x0100) ? 0 : 1; - m_leds[2] = (m_portcdata & 0x0200) ? 0 : 1; - m_leds[3] = (m_portcdata & 0x0400) ? 0 : 1; -} - - -void spg2xx_game_state::mem_map_4m(address_map &map) -{ - map(0x000000, 0x3fffff).bankr("cartbank"); -} - -void spg2xx_game_state::mem_map_2m(address_map &map) -{ - map(0x000000, 0x1fffff).mirror(0x200000).bankr("cartbank"); -} - -void sentx6p_state::mem_map_2m_texas(address_map &map) -{ - map(0x000000, 0x1fffff).bankr("cartbank"); - map(0x3f0000, 0x3f7fff).ram(); -} - -READ16_MEMBER(zone40_state::z40_rom_r) -{ - // due to granularity of rom bank this manual method is safer - return m_romregion[(offset + (m_z40_rombase * 0x20000)) & 0x1ffffff]; -} - -void zone40_state::mem_map_z40(address_map &map) -{ - map(0x000000, 0x3fffff).r(FUNC(zone40_state::z40_rom_r)); -} - - -void spg2xx_game_state::mem_map_1m(address_map &map) -{ - map(0x000000, 0x0fffff).mirror(0x300000).bankr("cartbank"); -} - -static INPUT_PORTS_START( vii ) - PORT_START("P1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Button A") - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Button B") - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Button C") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Button D") - - PORT_START("MOTIONX") - PORT_BIT( 0x3ff, 0x200, IPT_PADDLE ) PORT_MINMAX(0x000, 0x3ff) PORT_SENSITIVITY(50) PORT_KEYDELTA(50) PORT_NAME("Motion Control X") - - PORT_START("MOTIONY") - PORT_BIT( 0x3ff, 0x200, IPT_PADDLE ) PORT_MINMAX(0x000, 0x3ff) PORT_SENSITIVITY(50) PORT_KEYDELTA(50) PORT_NAME("Motion Control Y") PORT_PLAYER(2) - - PORT_START("MOTIONZ") - PORT_BIT( 0x3ff, 0x200, IPT_PADDLE ) PORT_MINMAX(0x000, 0x3ff) PORT_SENSITIVITY(50) PORT_KEYDELTA(50) PORT_NAME("Motion Control Z") PORT_PLAYER(3) -INPUT_PORTS_END - -static INPUT_PORTS_START( batman ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("A Button") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Menu") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("B Button") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("X Button") -INPUT_PORTS_END - -static INPUT_PORTS_START( walle ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("A Button") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button") - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda) - PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_sith_i2c ) - PORT_START("P1") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON2 ) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) - PORT_BIT( 0xf3df, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) - PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("JOYX") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) - - PORT_START("JOYY") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_pooh ) - PORT_START("P1") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Menu / Pause") - PORT_BIT( 0xf7df, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0xfff7, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) - - PORT_START("JOYX") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) - - PORT_START("JOYY") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_care ) - PORT_START("P1") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Menu / Pause") - PORT_BIT( 0xf7df, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0xfff7, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) - - PORT_START("JOYX") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) - - PORT_START("JOYY") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_nm_i2c ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON2 ) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Menu") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC - PORT_BIT( 0xfff0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - - PORT_START("DIALX") // for Pole Position, joystick can be twisted like a dial/wheel (limited?) (check range) - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_cc_i2c ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("A") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("C") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("D") - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC - PORT_BIT( 0xfff0, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_wf_i2c ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("A") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x01c0, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Menu") - PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) - PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC - - /* on real unit you can spin the wheel (and must make sure it completes a full circle, or you lose your turn) instead of pressing 'B' for a random spin but where does it map? (it can be tested in secret test mode) - PORT_START("DIALX") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) - - PORT_START("DIALY") - PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) - */ -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_gkr ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Menu / Pause") - PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (not verified for all games, state can be seen in secret test menu of many tho) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) // this causes WWE to think the unit is a '2nd Controller' and tells you to plug the 1st one in. - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_sdoo_i2c ) // GameKeyReady units had 2 main buttons, later releases reduced that to 1 button (as the internal games don't require 2 and no GameKeys were released) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) // debug input, skips levels! - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) // must be low or other inputs don't work? - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Menu / Pause") - PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) // is this correct? doesn't seem to work - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( jak_gkr_i2c ) - PORT_INCLUDE(jak_gkr) - - PORT_MODIFY("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_dpr_i2c ) - PORT_START("P1") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON2 ) - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Start / Menu / Pause") - PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here) - PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - - - -static INPUT_PORTS_START( wirels60 ) - PORT_START("P1") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad Up") - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad Down") - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad Left") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad Right") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("A Button") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Menu") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Start") - - PORT_START("P2") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("Joypad Up") - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_NAME("Joypad Down") - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("Joypad Left") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("Joypad Right") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("A Button") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("B Button") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Menu") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Start") -INPUT_PORTS_END - - -static INPUT_PORTS_START( rad_skat ) - PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Full Left") - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Full Right") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("Slight Left") // you have to use this for the menus (eg trick lists) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("Slight Right") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Front") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Back") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) - // there only seem to be 3 buttons on the pad part, so presumably all the above are the skateboard, and below are the pad? - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("M Button") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("X Button") - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("O Button") - PORT_BIT( 0xf800, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) // read but unused? - - PORT_START("P3") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag -INPUT_PORTS_END - -static INPUT_PORTS_START( rad_skatp ) - PORT_INCLUDE(rad_skat) - - PORT_MODIFY("P3") - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag -INPUT_PORTS_END - -static INPUT_PORTS_START( rad_sktv ) - /* how does the Scanner connect? probably some serial port with comms protocol, not IO ports? - internal test mode shows 'uart' ports (which currently fail) - - To access internal test hold DOWN and BUTTON1 together on startup until a coloured screen appears. - To cycle through the tests again hold DOWN and press BUTTON1 */ - - PORT_START("P1") - PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("P2") - PORT_DIPNAME( 0x0001, 0x0001, "IN1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("P3") - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - -static INPUT_PORTS_START( mattelcs ) // there is a 'secret test mode' that previously got activated before inputs were mapped, might need unused inputs to active? - PORT_START("P1") - PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) // must be IP_ACTIVE_LOW or you can't switch to Football properly? - PORT_DIPNAME( 0x0018, 0x0000, "Game Select Slider" ) // technically not a dipswitch, a 3 position slider, but how best map it? - PORT_DIPSETTING( 0x0008, "Baseball (Left)" ) - PORT_DIPSETTING( 0x0010, "Basketball (Middle)" ) - PORT_DIPSETTING( 0x0000, "Football (Right)" ) - // no 4th position possible - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_BIT( 0xffa0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Joypad Up") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Joypad Down") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Joypad Left") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Joypad Right") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Sound") // toggles between sound+music, sound only, and no sound - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Hike / Pitch") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Shoot / Run") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Kick / Hit") - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - -/* hold 'Console Down' while powering up to get the test menu, including input tests - the ball (Wired) and bat (IR) are read some other way as they don't seem to appear in the ports. */ -static INPUT_PORTS_START( rad_crik ) - PORT_START("P1") - PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Console Enter") // these are the controls on the base unit - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Console Down") - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("Console Left") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("Console Right") - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Console Up") - PORT_BIT( 0xf800, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P3") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) -INPUT_PORTS_END - -static INPUT_PORTS_START( dreamlif ) - PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("B") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("C") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Yes") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("No") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be low or the Tiger logo gets skipped, also must be low for service mode (hold pause while booting) to work - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Pause") - PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - - -// there is a speaker volume for the 'guitar' mode, but it's presumably an analog feature, not read by the game. -static INPUT_PORTS_START( icanguit ) - PORT_START("P1") - // uses multiplexed ports instead, see below - - PORT_START("P1_0") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Fret 1, Row 1") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("Fret 2, Row 1") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_NAME("Fret 3, Row 1") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_NAME("Fret 4, Row 1") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("Fret 5, Row 1") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("Fret 6, Row 1") // Frets 6-12 only have 2 rows (1 and 6) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_NAME("Fret 9, Row 1") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_NAME("Fret 10, Row 1") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Fret 11, Row 1") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("Fret 12, Row 1") - PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_NAME("Fret 1, Row 2") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Fret 2, Row 2") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Fret 3, Row 2") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_NAME("Fret 4, Row 2") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_NAME("Fret 5, Row 2") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_NAME("Fret 7, Row 1") - PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Fret 1, Row 3") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("Fret 2, Row 3") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("Fret 3, Row 3") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("Fret 4, Row 3") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("Fret 5, Row 3") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Fret 8, Row 1") - PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("Fret 1, Row 4") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_NAME("Fret 2, Row 4") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("Fret 3, Row 4") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME("Fret 4, Row 4") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("Fret 5, Row 4") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_NAME("Fret 8, Row 6") - PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_4") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Fret 1, Row 5") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("Fret 2, Row 5") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_NAME("Fret 3, Row 5") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Fret 4, Row 5") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_NAME("Fret 5, Row 5") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("Fret 7, Row 6") - PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_5") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Fret 1, Row 6") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("Fret 2, Row 6") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("Fret 3, Row 6") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Fret 4, Row 6") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_NAME("Fret 5, Row 6") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Fret 6, Row 6") // Frets 6-12 only have 2 rows (1 and 6) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_NAME("Fret 9, Row 6") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Fret 10, Row 6") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Fret 11, Row 6") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Fret 12, Row 6") - PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // might be some kind of seeprom in here? - - PORT_START("P3") - // uses multiplexed ports instead, see below - - PORT_START("P3_0") - PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("String 1") // these seem to respond on release, but are definitely active high based on visual indicators - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("String 2") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("String 3") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("String 4") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("String 5") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("String 6") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_DIPNAME( 0x0400, 0x0000, "TV or Guitar Mode" ) - PORT_DIPSETTING( 0x0000, "TV Mode" ) - PORT_DIPSETTING( 0x0400, "Guitar Mode" ) - PORT_BIT( 0xf800, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P3_1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0xfffc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P3_2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Home") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Enter") - PORT_BIT( 0xfffc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P3_3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Pause") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) - PORT_BIT( 0xfffc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P3_4") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // doesn't highlight during menus, but changes sound in 'Guitar Mode' and switches between levels after selecting song - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // doesn't highlight during menus, but changes sound in 'Guitar Mode' and switches between levels after selecting song - PORT_BIT( 0xfff8, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P3_5") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("Whammy Up") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("Whammy Down") - PORT_BIT( 0xfff8, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - -// this has an entire piano keyboard + extras -// there is a volume dial for the internal speakers when used in non-TV mode, but presumably it is not CPU visible -// there should be a metronome key, but nothing seems to have that effect, maybe due to incomplete sound emulation? -static INPUT_PORTS_START( icanpian ) - PORT_START("P1") - // uses multiplexed ports instead, see below - - PORT_START("P1_0") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2)PORT_NAME("Octave 0 F (Green)") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("Octave 0 F# (Purple)") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Octave 0 G (Yellow)") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Octave 0 G# (Dark Blue)") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("Octave 0 A (Flesh)") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("Octave 0 A# (Dark Green)") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("Octave 0 B (Pink)") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_NAME("Octave 0 C (White)") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("Octave 0 C# (Black)") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("Octave 0 D (Blue)") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("Octave 0 D# (Red)") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("Octave 0 E (Orange)") - PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_NAME("Octave 1 F (Green)") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_NAME("Octave 1 F# (Purple)") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Octave 1 G (Yellow)") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("Octave 1 G# (Dark Blue)") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_NAME("Octave 1 A (Flesh)") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("Octave 1 A# (Dark Green)") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Octave 1 B (Pink)") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_NAME("Octave 1 C (White)") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Octave 1 C# (Black)") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Octave 1 D (Blue)") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("Octave 1 D# (Red)") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("Octave 1 E (Orange)") - PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P1_2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Octave 2 F (Green)") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Octave 2 F# (Purple)") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Octave 2 G (Yellow)") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Octave 2 G# (Dark Blue)") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_NAME("Octave 2 A (Flesh)") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Octave 2 A# (Dark Green)") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_NAME("Octave 2 B (Pink)") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("Octave 2 C (White)") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_NAME("Octave 2 C# (Black)") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME("Octave 2 D (Blue)") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Octave 2 D# (Red)") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Octave 2 E (Orange)") - PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // might be some kind of seeprom in here? (or not? only I Can Play Guitar seems to offer a 'resume', something does get accessed on startup tho? and the machine tells you 'high scores') - - PORT_START("P3") - // uses multiplexed ports instead, see below - - PORT_START("P3_0") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Change Instrument") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Cycle Hands") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Display Mode 1") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Display Mode 2") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Display Mode 3") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Display Mode 4") - PORT_BIT( 0x07c0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // unused? - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // presumably power / low battery, kils the game - PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P3_1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("Tempo Up") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Tempo Default") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("Tempo Down") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Pause") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Metronome") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) // will skip intro scenes etc. like other buttons but no more physical buttons on KB to map here - PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("P3_2") // the system ALWAYS requires a cartridge, but has 2 modes of operation depending on a switch. The only way to use it as a normal keyboard is by flipping this switch. - PORT_DIPNAME( 0x0001, 0x0000, "System Mode" ) // or implement this as a toggle key? (it's a slider switch) - PORT_DIPSETTING( 0x0001, "Keyboard Mode (no TV output)" ) - PORT_DIPSETTING( 0x0000, "TV Mode" ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Scroll Up") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Scroll Down") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Enter") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Home") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) // will skip intro scenes etc. like other buttons but no more physical buttons on KB to map here - PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( rad_fb2 ) // controls must be multiplexed somehow, as there's no room for P2 controls otherwise (unless P2 controls were never finished and it was only sold in a single mat version, Radica left useless P2 menu options in the mini Genesis consoles) - PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) // 'left' - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // 'up' - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) // 'right' - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // acts a 'motion ball' in menu (this is an analog input from the ball tho? at least in rad_fb in xavix.cpp so this might just be a debug input here) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // 'p2 right' - // none of the remaining inputs seem to do anything - PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P3") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_CUSTOM ) // NTSC (1) / PAL (0) flag -INPUT_PORTS_END - - -static INPUT_PORTS_START( lexizeus ) // how many buttons does this have? I accidentally entered a secret test mode before that seemed to indicate 6, but can't get there again - PORT_START("P1") - PORT_DIPNAME( 0x0001, 0x0001, "P1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Button 1") // shoot in Tiger Rescue & Deep - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pause") - - PORT_START("P2") - PORT_DIPNAME( 0x0001, 0x0001, "P2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Button 1 Rapid") // same function as button 1 but with rapid toggle on/off - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Button 2 Rapid") // same function as button 2 but with rapid toggle on/off - PORT_DIPNAME( 0x0004, 0x0004, "P3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Button 2") // toggles ball / number view in pool - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( tvgogo ) - PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Back") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Select") - PORT_DIPNAME( 0x0004, 0x0004, "P1" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("P2") - PORT_DIPNAME( 0x0001, 0x0001, "P2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("P3") - PORT_DIPNAME( 0x0001, 0x0001, "P3" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( pvmil ) // hold "console start" + "console select" on boot for test mode - PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Player 1 A") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Player 1 B") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Player 1 C") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Player 1 D") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Player 2 A") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Player 2 B") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Player 2 C") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Player 2 D") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("Player 3 A") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("Player 3 B") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("Player 3 C") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(3) PORT_NAME("Player 3 D") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("Player 1 Lifeline") - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Start") - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P3") - PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pvmil_state, pvmil_p4buttons_r) // Player 4 buttons read through here - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("Player 2 Lifeline") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(3) PORT_NAME("Player 3 Lifeline") - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(4) PORT_NAME("Player 4 Lifeline") - PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("EXTRA") - PORT_BIT( 0x0fff, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("Player 4 A") - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("Player 4 B") - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("Player 4 C") - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_NAME("Player 4 D") -INPUT_PORTS_END - -static INPUT_PORTS_START( taikeegr ) - PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("Strum Bar Down") - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Strum Bar Up") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Whamming Bar") - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Yellow") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Green") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Red") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Blue") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pink") - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P2") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("P3") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( sentx6p ) - PORT_START("P1") - PORT_DIPNAME( 0x0001, 0x0001, "Port 1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - // is this really just the battery sensor, or does it have some other meaning, like data ready? - PORT_DIPNAME( 0x8000, 0x0000, "Low Battery" ) - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) - - PORT_START("P2") - // these must be sense lines - PORT_DIPNAME( 0x0001, 0x0001, "Player 1 Connected" ) - PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0001, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x0002, 0x0002, "Player 2 Connected" ) - PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x0004, 0x0004, "Player 3 Connected" ) - PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x0008, 0x0008, "Player 4 Connected" ) - PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x0010, 0x0010, "Player 5 Connected" ) - PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x0020, 0x0020, "Player 6 Connected" ) - PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) - - PORT_DIPNAME( 0x0040, 0x0040, "Port 2" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("P3") - PORT_DIPNAME( 0x0001, 0x0001, "Port 3" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") // the Console buttons also work for Player 1 - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Ok") - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - // these are presuambly read through the UART as the LCD screens are driven by it, currently not hooked up - // using PORT_CHANGED_MEMBER because we assume the controller latches them for sending as inputs are only read every few frames - PORT_START("CTRL1") - PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 0) - PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 0) - - PORT_START("CTRL2") - PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 1) - PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 1) - - PORT_START("CTRL3") - PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 2) - PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 2) - - PORT_START("CTRL4") - PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 3) - PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 3) - - PORT_START("CTRL5") - PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(5) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 4) - PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(5) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 4) - - PORT_START("CTRL6") - PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(6) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 5) - PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(6) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 5) - -INPUT_PORTS_END - - -READ16_MEMBER(dreamlif_state::portb_r) -{ - uint16_t ret = 0x0000; - logerror("%s: portb_r\n", machine().describe_context()); - ret |= m_eeprom->do_read() << 3; - return ret; -} - -WRITE16_MEMBER(dreamlif_state::portb_w) -{ - logerror("%s: portb_w (%04x)\n", machine().describe_context(), data); - m_eeprom->di_write(BIT(data, 2)); - m_eeprom->cs_write(BIT(data, 0) ? ASSERT_LINE : CLEAR_LINE); - m_eeprom->clk_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); -} - - - -READ16_MEMBER(icanguit_state::porta_r) -{ - logerror("%s: porta_r\n", machine().describe_context()); - return m_inlatch_a; -} - - -READ16_MEMBER(icanguit_state::portc_r) -{ - logerror("%s: portc_r\n", machine().describe_context()); - return m_inlatch_c; -} - - -WRITE16_MEMBER(icanguit_state::portc_w) -{ - logerror("%s: portc_w (%04x)\n", machine().describe_context(), data); -} - - -READ16_MEMBER(icanguit_state::portb_r) -{ - logerror("%s: portb_r\n", machine().describe_context()); - return m_io_p2->read(); -} - -WRITE16_MEMBER(icanguit_state::portb_w) -{ - logerror("%s: portb_w (%04x)\n", machine().describe_context(), data); -} - -WRITE16_MEMBER(icanguit_state::porta_w) -{ - //logerror("%s: porta_w (%04x)\n", machine().describe_context(), data); - - if (data == 0x0000) - { - m_inlatch_a = m_inlatch_c = 0x0000; - } - else if (data == 0x0400) - { - m_inlatch_a = m_porta_in[5]->read(); - m_inlatch_c = m_portc_in[5]->read(); - } - else if (data == 0x0800) - { - m_inlatch_a = m_porta_in[4]->read(); - m_inlatch_c = m_portc_in[4]->read(); - } - else if (data == 0x1000) - { - m_inlatch_a = m_porta_in[3]->read(); - m_inlatch_c = m_portc_in[3]->read(); - } - else if (data == 0x2000) - { - m_inlatch_a = m_porta_in[2]->read(); - m_inlatch_c = m_portc_in[2]->read(); - } - else if (data == 0x4000) - { - m_inlatch_a = m_porta_in[1]->read(); - m_inlatch_c = m_portc_in[1]->read(); - } - else if (data == 0x8000) - { - m_inlatch_a = m_porta_in[0]->read(); - m_inlatch_c = m_portc_in[0]->read(); - } - else - { - logerror("%s: unknown porta_w (%04x)\n", machine().describe_context(), data); - } -} - -// icanpian differences - -WRITE16_MEMBER(icanpian_state::porta_w) -{ - if (data == 0x0000) - { - m_inlatch_a = m_inlatch_c = 0x0000; - } - else if (data == 0x1000) - { - m_inlatch_a = m_porta_in[2]->read(); - m_inlatch_c = m_portc_in[2]->read(); - } - else if (data == 0x2000) - { - m_inlatch_a = m_porta_in[1]->read(); - m_inlatch_c = m_portc_in[1]->read(); - } - else if (data == 0x4000) - { - m_inlatch_a = m_porta_in[0]->read(); - m_inlatch_c = m_portc_in[0]->read(); - } - else - { - logerror("%s: unknown porta_w (%04x)\n", machine().describe_context(), data); - } -} - -// accesses are made for what appears to be a serial eeprom on port B, very similar to dreamlif, but beyond blanking it at the start it doesn't -// seem to ever be used, maybe it was never added to hardware, or just never used? -READ16_MEMBER(icanpian_state::portb_r) -{ -/* - uint16_t ret = 0x0000; - logerror("%s: portbxx_r\n", machine().describe_context()); - ret |= m_eeprom->do_read() ? 0xffff : 0x0000; - return ret; -*/ - return 0x0000; -} - -WRITE16_MEMBER(icanpian_state::portb_w) -{ -/* - logerror("%s: portbxx_w (%04x)\n", machine().describe_context(), data); - m_eeprom->di_write(BIT(data, 2)); - m_eeprom->cs_write(BIT(data, 0) ? ASSERT_LINE : CLEAR_LINE); - m_eeprom->clk_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); -*/ -} - -void icanguit_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - // if there's a cart, override the standard banking - if (m_cart && m_cart->exists()) - { - std::string region_tag; - m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); - m_bank->set_entry(0); - } -} - -void icanguit_state::machine_reset() -{ - spg2xx_game_state::machine_reset(); - m_inlatch_a = 0x0000; - m_inlatch_c = 0x0000; -} - - -DEVICE_IMAGE_LOAD_MEMBER(icanguit_state::cart_load_icanguit) -{ - uint32_t size = m_cart->common_get_size("rom"); - - if (size < 0x800000) - { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); - return image_init_result::FAIL; - } - - m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return image_init_result::PASS; -} - -void tvgogo_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - // if there's a cart, override the standard banking - if (m_cart && m_cart->exists()) - { - std::string region_tag; - m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); - m_bank->set_entry(0); - } -} - -void tvgogo_state::machine_reset() -{ - spg2xx_game_state::machine_reset(); -} - - -DEVICE_IMAGE_LOAD_MEMBER(tvgogo_state::cart_load_tvgogo) -{ - uint32_t size = m_cart->common_get_size("rom"); - - if (size > 0x800000) - { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); - return image_init_result::FAIL; - } - - m_cart->rom_alloc(0x800000, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return image_init_result::PASS; -} - - - -void vii_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - // if there's a cart, override the standard banking - if (m_cart && m_cart->exists()) - { - std::string region_tag; - m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); - m_bank->set_entry(0); - } - - m_ctrl_poll_timer = timer_alloc(TIMER_CTRL_POLL); - m_ctrl_poll_timer->adjust(attotime::never); - - save_item(NAME(m_controller_input)); -} - -void vii_state::machine_reset() -{ - spg2xx_game_state::machine_reset(); - - m_controller_input[0] = 0; - m_controller_input[4] = 0; - m_controller_input[6] = 0xff; - m_controller_input[7] = 0; - - m_ctrl_poll_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); -} - -void spg2xx_game_state::machine_start() -{ - if (m_bank) - { - m_bank->configure_entries(0, (memregion("maincpu")->bytes() + 0x7fffff) / 0x800000, memregion("maincpu")->base(), 0x800000); - m_bank->set_entry(0); - } - - save_item(NAME(m_current_bank)); - save_item(NAME(m_walle_portc_data)); -} - -void spg2xx_game_state::machine_reset() -{ - m_current_bank = -1; - switch_bank(0); - m_maincpu->reset(); -} - - - -void wireless60_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - save_item(NAME(m_w60_controller_input)); - save_item(NAME(m_w60_porta_data)); - - m_w60_p1_ctrl_mask = 0x0400; - m_w60_p2_ctrl_mask = 0x0800; -} - -void zone40_state::machine_start() -{ - wireless60_state::machine_start(); - - save_item(NAME(m_z40_rombase)); - - m_z40_rombase = 0xe0; - m_w60_p1_ctrl_mask = 0x0400; - m_w60_p2_ctrl_mask = 0x1000; -} - -void wireless60_state::machine_reset() -{ - spg2xx_game_state::machine_reset(); - m_w60_controller_input = -1; - m_w60_porta_data = 0; -} - -void zone40_state::machine_reset() -{ - wireless60_state::machine_reset(); - m_z40_rombase = 0xe0; - m_maincpu->invalidate_cache(); - m_maincpu->reset(); -} - - -void vii_state::poll_controls() -{ - int32_t x = m_io_motionx ? ((int32_t)m_io_motionx->read() - 0x200) : 0; - int32_t y = m_io_motiony ? ((int32_t)m_io_motiony->read() - 0x200) : 0; - int32_t z = m_io_motionz ? ((int32_t)m_io_motionz->read() - 0x200) : 0; - - uint8_t old_input[8]; - memcpy(old_input, m_controller_input, 8); - - m_controller_input[0] = m_io_p1->read(); - m_controller_input[1] = (uint8_t)x; - m_controller_input[2] = (uint8_t)y; - m_controller_input[3] = (uint8_t)z; - m_controller_input[4] = 0; - x = (x >> 8) & 3; - y = (y >> 8) & 3; - z = (z >> 8) & 3; - m_controller_input[5] = (z << 4) | (y << 2) | x; - m_controller_input[6] = 0xff; - m_controller_input[7] = 0; - - if (memcmp(old_input, m_controller_input, 8)) - { - for(int i = 0; i < 8; i++) - m_maincpu->uart_rx(m_controller_input[i]); - } -} - -DEVICE_IMAGE_LOAD_MEMBER(vii_state::cart_load_vii) -{ - uint32_t size = m_cart->common_get_size("rom"); - - if (size < 0x800000) - { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); - return image_init_result::FAIL; - } - - m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return image_init_result::PASS; -} - -void spg2xx_game_state::spg2xx_base(machine_config &config) -{ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_size(320, 262); - m_screen->set_visarea(0, 320-1, 0, 240-1); - m_screen->set_screen_update("maincpu", FUNC(spg2xx_device::screen_update)); - m_screen->screen_vblank().set(m_maincpu, FUNC(spg2xx_device::vblank)); - - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); - m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); -} - -void spg2xx_game_state::non_spg_base(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - - spg2xx_base(config); -} - -void vii_state::vii(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &vii_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->portb_out().set(FUNC(vii_state::vii_portb_w)); - m_maincpu->i2c_w().set(FUNC(vii_state::i2c_w)); - m_maincpu->i2c_r().set(FUNC(vii_state::i2c_r)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "vii_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(vii_state::cart_load_vii)); - - SOFTWARE_LIST(config, "vii_cart").set_original("vii"); -} - -void icanguit_state::icanguit(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &icanguit_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set(FUNC(icanguit_state::porta_r)); - m_maincpu->porta_out().set(FUNC(icanguit_state::porta_w)); - m_maincpu->portb_in().set(FUNC(icanguit_state::portb_r)); - m_maincpu->portb_out().set(FUNC(icanguit_state::portb_w)); - m_maincpu->portc_in().set(FUNC(icanguit_state::portc_r)); - m_maincpu->portc_out().set(FUNC(icanguit_state::portc_w)); - - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "icanguit_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(icanguit_state::cart_load_icanguit)); - m_cart->set_must_be_loaded(true); - - SOFTWARE_LIST(config, "icanguit_cart").set_original("icanguit"); -} - -void icanpian_state::icanpian(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &icanpian_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set(FUNC(icanpian_state::porta_r)); - m_maincpu->porta_out().set(FUNC(icanpian_state::porta_w)); - m_maincpu->portb_in().set(FUNC(icanpian_state::portb_r)); - m_maincpu->portb_out().set(FUNC(icanpian_state::portb_w)); - m_maincpu->portc_in().set(FUNC(icanpian_state::portc_r)); - m_maincpu->portc_out().set(FUNC(icanpian_state::portc_w)); - -// EEPROM_93C66_16BIT(config, m_eeprom); // unknown part -// m_eeprom->erase_time(attotime::from_usec(1)); -// m_eeprom->write_time(attotime::from_usec(1)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "icanpian_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(icanpian_state::cart_load_icanguit)); - m_cart->set_must_be_loaded(true); - - SOFTWARE_LIST(config, "icanpian_cart").set_original("icanpian"); -} - -WRITE8_MEMBER(tvgogo_state::tvg_i2c_w) -{ - // unsure what is mapped here (Camera?) but it expects to be able to read back the same byte it writes before it boots. - m_i2cunk = data; - logerror("%s: tvg_i2c_w %04x %02x\n", machine().describe_context(), offset, data); -} - -READ8_MEMBER(tvgogo_state::tvg_i2c_r) -{ - uint8_t ret = m_i2cunk; - logerror("%s: tvg_i2c_r %04x %02x\n", machine().describe_context(), offset, ret); - return ret; -} - - -void tvgogo_state::tvgogo(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &tvgogo_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set_ioport("P1"); - m_maincpu->portb_in().set_ioport("P2"); - m_maincpu->portc_in().set_ioport("P3"); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "tvgogo_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(tvgogo_state::cart_load_tvgogo)); - m_cart->set_must_be_loaded(true); - - m_maincpu->i2c_w().set(FUNC(tvgogo_state::tvg_i2c_w)); - m_maincpu->i2c_r().set(FUNC(tvgogo_state::tvg_i2c_r)); - - SOFTWARE_LIST(config, "tvgogo_cart").set_original("tvgogo"); -} - - -void wireless60_state::wireless60(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &wireless60_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_out().set(FUNC(wireless60_state::wireless60_porta_w)); - m_maincpu->portb_out().set(FUNC(wireless60_state::wireless60_portb_w)); - m_maincpu->porta_in().set(FUNC(wireless60_state::wireless60_porta_r)); -} - -void zone40_state::zone40(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &zone40_state::mem_map_z40); - - spg2xx_base(config); - - m_maincpu->porta_out().set(FUNC(zone40_state::zone40_porta_w)); - m_maincpu->porta_in().set(FUNC(zone40_state::zone40_porta_r)); -} - - -void spg2xx_game_state::jakks(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set(FUNC(spg2xx_game_state::jakks_porta_r)); - m_maincpu->porta_out().set(FUNC(spg2xx_game_state::jakks_porta_w)); - m_maincpu->portb_out().set(FUNC(spg2xx_game_state::jakks_portb_w)); -} - -void spg2xx_game_state::jakks_i2c(machine_config &config) -{ - jakks(config); - I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); -} - -void jakks_gkr_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - // if there's a cart, override the standard banking - if (m_cart && m_cart->exists()) - { - std::string region_tag; - m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(JAKKSSLOT_ROM_REGION_TAG).c_str()); - m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000); - m_bank->set_entry(0); - } -} - -DEVICE_IMAGE_LOAD_MEMBER(jakks_gkr_state::cart_load_gamekey) -{ - return m_cart->call_load(); -} - -void jakks_gkr_state::jakks_gkr(machine_config &config) -{ - jakks(config); - - m_maincpu->porta_in().set(FUNC(jakks_gkr_state::jakks_porta_key_io_r)); - m_maincpu->porta_out().set(FUNC(jakks_gkr_state::jakks_porta_key_io_w)); - m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->portc_out().set(FUNC(jakks_gkr_state::gkr_portc_w)); - - m_maincpu->set_rowscroll_offset(0); - - JAKKS_GAMEKEY_SLOT(config, m_cart, 0, jakks_gamekey, nullptr); -} - -void jakks_gkr_state::jakks_gkr_i2c(machine_config &config) -{ - jakks_gkr(config); - I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); -} - - -void jakks_gkr_state::jakks_gkr_1m_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); -} - -void jakks_gkr_state::jakks_gkr_2m_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_2m); -} - -void jakks_gkr_state::jakks_gkr_nk(machine_config &config) -{ - jakks_gkr(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - SOFTWARE_LIST(config, "jakks_gamekey_nk").set_original("jakks_gamekey_nk"); -} - -void jakks_gkr_state::jakks_gkr_nk_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - SOFTWARE_LIST(config, "jakks_gamekey_nk").set_original("jakks_gamekey_nk"); -} - -void jakks_gkr_state::jakks_gkr_dy(machine_config &config) -{ - jakks_gkr(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - SOFTWARE_LIST(config, "jakks_gamekey_dy").set_original("jakks_gamekey_dy"); -} - -void jakks_gkr_state::jakks_gkr_dy_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - SOFTWARE_LIST(config, "jakks_gamekey_dy").set_original("jakks_gamekey_dy"); -} - -void jakks_gkr_state::jakks_gkr_mv_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - SOFTWARE_LIST(config, "jakks_gamekey_mv").set_original("jakks_gamekey_mv"); -} - - -void jakks_gkr_state::jakks_gkr_dp_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - SOFTWARE_LIST(config, "jakks_gamekey_dp").set_original("jakks_gamekey_dp"); -} - -void jakks_gkr_state::jakks_gkr_sw_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - m_maincpu->adc_in<0>().set_ioport("JOYX"); - m_maincpu->adc_in<1>().set_ioport("JOYY"); - SOFTWARE_LIST(config, "jakks_gamekey_sw").set_original("jakks_gamekey_sw"); -} - -void jakks_gkr_state::jakks_gkr_wp(machine_config &config) -{ - jakks_gkr(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - m_maincpu->adc_in<0>().set_ioport("JOYX"); - m_maincpu->adc_in<1>().set_ioport("JOYY"); - //SOFTWARE_LIST(config, "jakks_gamekey_wp").set_original("jakks_gamekey_wp"); // NO KEYS RELEASED -} - -void jakks_gkr_state::jakks_gkr_cb(machine_config &config) -{ - jakks_gkr(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - m_maincpu->adc_in<0>().set_ioport("JOYX"); - m_maincpu->adc_in<1>().set_ioport("JOYY"); - //SOFTWARE_LIST(config, "jakks_gamekey_cb").set_original("jakks_gamekey_cb"); // NO KEYS RELEASED -} - -void jakks_gkr_state::jakks_gkr_nm_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - m_maincpu->adc_in<0>().set_ioport("DIALX"); - SOFTWARE_LIST(config, "jakks_gamekey_nm").set_original("jakks_gamekey_nm"); -} - -void jakks_gkr_state::jakks_gkr_cc_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - // shows 'E0' in gamekey test menu on real HW (maybe related to value key needs to return if one existed) - //SOFTWARE_LIST(config, "jakks_gamekey_cc").set_original("jakks_gamekey_cc"); // no game keys were released -} - -void jakks_gkr_state::jakks_gkr_wf_i2c(machine_config &config) -{ - jakks_gkr_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); - //m_maincpu->adc_in<0>().set_ioport("DIALX"); // wheel does not seem to map here - //m_maincpu->adc_in<1>().set_ioport("DIALY"); - //SOFTWARE_LIST(config, "jakks_gamekey_wf").set_original("jakks_gamekey_wf"); // no game keys were released -} - - -void spg2xx_game_state::lexizeus(machine_config &config) -{ - non_spg_base(config); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - m_maincpu->porta_in().set_ioport("P1"); - m_maincpu->portb_in().set_ioport("P2"); - m_maincpu->portc_in().set_ioport("P3"); -} - -void spg2xx_game_state::walle(machine_config &config) -{ - jakks_i2c(config); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_2m); - m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->portc_out().set(FUNC(spg2xx_game_state::walle_portc_w)); -} - -void spg2xx_game_state::rad_skat(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set_ioport("P1"); - m_maincpu->portb_in().set_ioport("P2"); - m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); - m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); -} - -void dreamlif_state::dreamlif(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &dreamlif_state::mem_map_4m); - - spg2xx_base(config); - - EEPROM_93C66_16BIT(config, m_eeprom); // HT93LC66A - - m_maincpu->porta_in().set_ioport("P1"); - m_maincpu->portb_in().set(FUNC(dreamlif_state::portb_r)); - m_maincpu->portb_out().set(FUNC(dreamlif_state::portb_w)); - -} - -void spg2xx_game_state::rad_skatp(machine_config &config) -{ - rad_skat(config); - m_maincpu->set_pal(true); - m_screen->set_refresh_hz(50); -// m_screen->set_size(320, 312); -} - -void spg2xx_game_state::rad_sktv(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set(FUNC(spg2xx_game_state::rad_porta_r)); - m_maincpu->portb_in().set(FUNC(spg2xx_game_state::rad_portb_r)); - m_maincpu->portc_in().set(FUNC(spg2xx_game_state::rad_portc_r)); - m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); - m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); -} - -void spg2xx_game_state::rad_crik(machine_config &config) -{ - SPG28X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set_ioport("P1"); - m_maincpu->portb_in().set_ioport("P2"); - m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); - m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); -} - -void pvmil_state::pvmil(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &pvmil_state::mem_map_4m); - m_maincpu->set_pal(true); - - spg2xx_base(config); - - m_screen->set_refresh_hz(50); - //m_screen->set_size(320, 312); - - m_maincpu->porta_in().set_ioport("P1"); - m_maincpu->portb_in().set_ioport("P2"); - m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->porta_out().set(FUNC(pvmil_state::pvmil_porta_w)); - m_maincpu->portb_out().set(FUNC(pvmil_state::pvmil_portb_w)); - m_maincpu->portc_out().set(FUNC(pvmil_state::pvmil_portc_w)); - - config.set_default_layout(layout_pvmil); -} - -void spg2xx_game_state::taikeegr(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m); - m_maincpu->set_pal(true); - - spg2xx_base(config); - - m_screen->set_refresh_hz(50); -// m_screen->set_size(320, 312); - - m_maincpu->porta_in().set_ioport("P1"); -// m_maincpu->portb_in().set_ioport("P2"); -// m_maincpu->portc_in().set_ioport("P3"); -} - -// Shredmaster Jr uses the same input order as the regular Taikee Guitar, but reads all inputs through a single multplexed bit -WRITE16_MEMBER(shredmjr_game_state::porta_w) -{ - if (data != m_porta_data) - { - if ((data & 0x0800) != (m_porta_data & 0x0800)) - { - if (data & 0x0800) - { - //logerror("0x0800 low -> high\n"); - } - else - { - //logerror("0x0800 high -> low\n"); - } - } - - if ((data & 0x0200) != (m_porta_data & 0x0200)) - { - if (data & 0x0200) - { - //logerror("0x0200 low -> high\n"); - m_shiftamount++; - } - else - { - //logerror("0x0200 high -> low\n"); - } - } - - if ((data & 0x0100) != (m_porta_data & 0x0100)) - { - if (data & 0x0100) - { - //logerror("0x0100 low -> high\n"); - m_shiftamount = 0; - } - else - { - //logerror("0x0100 high -> low\n"); - } - } - } - - m_porta_data = data; -} - -READ16_MEMBER(shredmjr_game_state::porta_r) -{ - //logerror("porta_r with shift amount %d \n", m_shiftamount); - uint16_t ret = 0x0000; - - uint16_t portdata = m_io_p1->read(); - - portdata = (portdata >> m_shiftamount) & 0x1; - - if (portdata) - ret |= 0x0400; - - return ret; -} - -void shredmjr_game_state::shredmjr(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &shredmjr_game_state::mem_map_4m); - - spg2xx_base(config); - - m_maincpu->porta_in().set(FUNC(shredmjr_game_state::porta_r)); - m_maincpu->porta_out().set(FUNC(shredmjr_game_state::porta_w)); -} - - -void sentx6p_state::machine_start() -{ - spg2xx_game_state::machine_start(); - - m_suite1.resolve(); - m_suite2.resolve(); - m_number1.resolve(); - m_number2.resolve(); - - m_select_fold.resolve(); - m_select_check.resolve(); - m_select_bet.resolve(); - m_select_call.resolve(); - m_select_raise.resolve(); - m_select_allin.resolve(); - - m_option_fold.resolve(); - m_option_check.resolve(); - m_option_bet.resolve(); - m_option_call.resolve(); - m_option_raise.resolve(); - m_option_allin.resolve(); - - m_led.resolve(); -} - -void sentx6p_state::machine_reset() -{ - spg2xx_game_state::machine_reset(); - - for (int i = 0; i < 6; i++) - { - m_lcd_card1[i] = 0x00; - m_lcd_card2[i] = 0x00; - m_lcd_options[i] = 0x00; - m_lcd_options_select[i] = 0x00; - m_lcd_led[i] = 0x00; - - m_inputlatches[i] = 0x00; - } - - /* HACK: this address needs to contain '1' so that it thinks the first controller - is present, otherwise it hangs on boot. How does this get set? - following addresses are for the other controllers, and get set based on Port B - status flags */ - address_space &mem = m_maincpu->space(AS_PROGRAM); - mem.write_word(0x1e08,0x0001); -} - -void sentx6p_state::controller_send_data(int which) -{ - // 0x78 have to be set, this is probably because there is an unused space in the commands - // going the other way at 0x78 - 0x7f - // bit 3 (0x04) can also be set, doesn't care - - uint8_t send = m_inputlatches[which] | 0x78; - - m_maincpu->uart_rx( send ); - - if (m_inputlatches[which] & 0x03) - { - m_inputlatches[which] = 0x00; - logerror("clearing input latches for player %d\n", which + 1); - } -} - -READ16_MEMBER(sentx6p_state::sentx_porta_r) -{ - int select_bits = (m_porta_data >> 8) & 0x3f; - logerror("%s: sentx_porta_r (with controller select bits %02x)\n", machine().describe_context(), select_bits); - - /* 0000 = no controller? (system buttons only?) - 0100 = controller 1? - 0200 = controller 2? - 0400 = controller 3? - 0800 = controller 4? - 1000 = controller 5? - 2000 = controller 6? - - this is an assumption based on startup, where the port is polled after writing those values - */ - - // the code around 029811 uses a ram value shifted left 8 times as the select bits (select_bits) on write - // then does a mask with them on the reads from this port, without shifting, comparing with 0 - - // the 'select bits' must also be active when the controller wants to send data, the UART read function - // won't proceed if they're zero, but the port is written with 0 before that - - //logerror("%08x\n", m_maincpu->pc()); - - // regular logic for writing to the LCDs - uint16_t ret = (m_io_p1->read() & 0xffc0) | select_bits; - - // hacks needed for reading from the UART to work - - // the select bit must be high here to read from the controller? - if (m_maincpu->pc() == 0x2981e) - { - ret ^= 0x3f; - } - - // but must be low again here after writing the select bits in order to not - // get stuck in a timeout loop - if (m_maincpu->pc() == 0x29834) - { - ret &= ~0x3f; - - // presumably the inputs can only be sent once the controller is actually selected, otherwise - // there would be competing UART sources? - for (int i = 0; i < 6; i++) - { - if (select_bits & (1 << i)) - { - controller_send_data(i); - } - } - } - - return ret; -} - -READ16_MEMBER(sentx6p_state::sentx_portb_r) -{ - return m_io_p2->read(); -} - -READ16_MEMBER(sentx6p_state::sentx_portc_r) -{ - return m_io_p3->read(); -} - -WRITE16_MEMBER(sentx6p_state::sentx_porta_w) -{ - logerror("%s: sentx_porta_w %04x\n", machine().describe_context(), data); - - COMBINE_DATA(&m_porta_data); -} - -WRITE16_MEMBER(sentx6p_state::sentx_portb_w) -{ - logerror("%s: sentx_portb_w %04x\n", machine().describe_context(), data); -} - -WRITE16_MEMBER(sentx6p_state::sentx_portc_w) -{ - logerror("%s: sentx_portc_w %04x\n", machine().describe_context(), data); -} - -/* - Card Table - (the controller must contain an MCU under the glob to receive thes commands - and convert them to actual LCD segments) - - off 00 - | A diamonds 01 | A hearts 0e | A spades 1b | A clubs 28 | - | 2 diamonds 02 | 2 hearts 0f | 2 spades 1c | 2 clubs 29 | - | 3 diamonds 03 | 3 hearts 10 | 3 spades 1d | 3 clubs 2a | - | 4 diamonds 04 | 4 hearts 11 | 4 spades 1e | 4 clubs 2b | - | 5 diamonds 05 | 5 hearts 12 | 5 spades 1f | 5 clubs 2c | - | 6 diamonds 06 | 6 hearts 13 | 6 spades 20 | 6 clubs 2d | - | 7 diamonds 07 | 7 hearts 14 | 7 spades 21 | 7 clubs 2e | - | 8 diamonds 08 | 8 hearts 15 | 8 spades 22 | 8 clubs 2f | - | 9 diamonds 09 | 9 hearts 16 | 9 spades 23 | 9 clubs 30 | - | 10 diamonds 0a | 10 hearts 17 | 10 spades 24 | 10 clubs 31 | - | J diamonds 0b | J hearts 18 | J spades 25 | J clubs 32 | - | Q diamonds 0c | Q hearts 19 | Q spades 26 | Q clubs 33 | - | K diamonds 0d | K hearts 1a | K spades 27 | K clubs 34 | - -*/ - -void sentx6p_state::set_card1(uint8_t value, int select_bits) -{ - for (int i = 0; i < 6; i++) - { - if (select_bits & (1 << i)) - { - m_lcd_card1[i] = value; - - int val = m_lcd_card1[i]; - if (val == 0) - { - m_suite1[i] = 0; - m_number1[i] = 0; - } - else - { - int suite = (val-1) / 13; - int number = (val-1) % 13; - - m_suite1[i] = suite+1; - m_number1[i] = number+1; - } - } - } -} - -void sentx6p_state::set_card2(uint8_t value, int select_bits) -{ - for (int i = 0; i < 6; i++) - { - if (select_bits & (1 << i)) - { - m_lcd_card2[i] = value; - - int val = m_lcd_card2[i]; - if (val == 0) - { - m_suite2[i] = 0; - m_number2[i] = 0; - } - else - { - int suite = (val-1) / 13; - int number = (val-1) % 13; - - m_suite2[i] = suite+1; - m_number2[i] = number+1; - } - } - } -} - -void sentx6p_state::set_options(uint8_t value, int select_bits) -{ - for (int i = 0; i < 6; i++) - { - if (select_bits & (1 << i)) - { - m_lcd_options[i] = value; - - // assume same mapping as selector bit below - m_option_fold[i] = (value & 0x01) ? 1 : 0; - m_option_check[i] = (value & 0x02) ? 1 : 0; - m_option_bet[i] = (value & 0x04) ? 1 : 0; - m_option_call[i] = (value & 0x08) ? 1 : 0; - m_option_raise[i] = (value & 0x10) ? 1 : 0; - m_option_allin[i] = (value & 0x20) ? 1 : 0; - } - } -} - -/* - c0 = no selection highlight (00) - c1 = fold selected (01) - c2 = check selected (02) - c4 = bet selected (04) - c8 = call selected (08) - d0 = raise selected (10) - e0 = all in selected (20) -*/ - -void sentx6p_state::set_options_select(uint8_t value, int select_bits) -{ - for (int i = 0; i < 6; i++) - { - if (select_bits & (1 << i)) - { - m_lcd_options_select[i] = value; - - m_select_fold[i] = (value & 0x01) ? 1 : 0; - m_select_check[i] = (value & 0x02) ? 1 : 0; - m_select_bet[i] = (value & 0x04) ? 1 : 0; - m_select_call[i] = (value & 0x08) ? 1 : 0; - m_select_raise[i] = (value & 0x10) ? 1 : 0; - m_select_allin[i] = (value & 0x20) ? 1 : 0; - } - } -} - - - -void sentx6p_state::set_controller_led(uint8_t value, int select_bits) -{ - for (int i = 0; i < 6; i++) - { - if (select_bits & (1 << i)) - { - m_lcd_led[i] = value; - - m_led[i] = value ^ 1; - } - } -} - -WRITE8_MEMBER(sentx6p_state::sentx_tx_w) -{ - int select_bits = (m_porta_data >> 8) & 0x3f; - - // TX function is at 0x029773 - // starts by writing controller select, then checking if controller is selected, then transmits data - - // RX function is at 0x029811 - // similar logic to write controller ID, check if selected, then recieve data - - switch (data) - { - case 0x00: // card 1 off - case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: // card 1 show Diamonds A,2,3,4,5,6,7,8,10,J,Q,K - case 0x0e: case 0x0f: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: // card 1 show Hearts A,2,3,4,5,6,7,8,10,J,Q,K - case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: // card 1 show Spades A,2,3,4,5,6,7,8,10,J,Q,K - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // card 1 show Clubs A,2,3,4,5,6,7,8,10,J,Q,K - set_card1(data & 0x3f, select_bits); - break; - - case 0x40: // card 2 off - case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: // card 1 show Diamonds A,2,3,4,5,6,7,8,10,J,Q,K - case 0x4e: case 0x4f: case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: // card 1 show Hearts A,2,3,4,5,6,7,8,10,J,Q,K - case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: // card 1 show Spades A,2,3,4,5,6,7,8,10,J,Q,K - case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: // card 1 show Clubs A,2,3,4,5,6,7,8,10,J,Q,K - set_card2(data & 0x3f, select_bits); - break; - - // cases 0x78 - 0x7f are transmissions in the other direction (from controller to main unit, used for sending buttons) - - case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: // show selection options - case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: - case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - set_options(data & 0x3f, select_bits); - break; - - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: // show selection cursor - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef: - case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: - set_options_select(data & 0x3f, select_bits); - break; - - case 0x38: - case 0x39: - set_controller_led(data & 0x01, select_bits); - break; - - case 0x3a: - // reset controller? (the input code also seems to check for 3a in one place coming in the other direction) - break; - - default: - logerror("unknown LCD command %02x with controller select %02x\n", data, select_bits); - break; - } - -} - - - - -void sentx6p_state::sentx6p(machine_config &config) -{ - SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); - m_maincpu->set_addrmap(AS_PROGRAM, &sentx6p_state::mem_map_2m_texas); - m_maincpu->set_pal(true); - - spg2xx_base(config); - - m_screen->set_refresh_hz(50); - - m_maincpu->porta_in().set(FUNC(sentx6p_state::sentx_porta_r)); - m_maincpu->portb_in().set(FUNC(sentx6p_state::sentx_portb_r)); - m_maincpu->portc_in().set(FUNC(sentx6p_state::sentx_portc_r)); - - m_maincpu->porta_out().set(FUNC(sentx6p_state::sentx_porta_w)); - m_maincpu->portb_out().set(FUNC(sentx6p_state::sentx_portb_w)); - m_maincpu->portc_out().set(FUNC(sentx6p_state::sentx_portc_w)); - - m_maincpu->uart_tx().set(FUNC(sentx6p_state::sentx_tx_w)); - - config.set_default_layout(layout_sentx6p); -} - - -ROM_START( vii ) - ROM_REGION( 0x2000000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "vii.bin", 0x0000, 0x2000000, CRC(04627639) SHA1(f883a92d31b53c9a5b0cdb112d07cd793c95fc43)) -ROM_END - -ROM_START( jak_batm ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "batman.bin", 0x000000, 0x400000, CRC(46f848e5) SHA1(5875d57bb3fe0cac5d20e626e4f82a0e5f9bb94c) ) -ROM_END - -ROM_START( jak_wall ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "walle.bin", 0x000000, 0x400000, BAD_DUMP CRC(bd554cba) SHA1(6cd06a036ab12e7b0e1fd8003db873b0bb783868) ) - // both of these dumps are bad, but in slightly different ways, note the random green pixels around the text (bad data is reported in secret test mode) - //ROM_LOAD16_WORD_SWAP( "walle.bin", 0x000000, 0x400000, BAD_DUMP CRC(6bc90b16) SHA1(184d72de059057aae7800da510fcf05ed1da9ec9)) -ROM_END - -ROM_START( jak_wwe ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakkswwegkr.bin", 0x000000, 0x200000, CRC(b078a812) SHA1(7d97c0e2171b3fd91b280480c9ffd5651828195a) ) -ROM_END - -ROM_START( jak_fan4 ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksffgkr.bin", 0x000000, 0x200000, CRC(8755a1f7) SHA1(7214da15fe61881da27b81575fbdb54cc0f1d6aa) ) -ROM_END - -ROM_START( jak_just ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksjlagkr.bin", 0x000000, 0x200000, CRC(182989f0) SHA1(799229c537d6fe629ba9e1e4051d1bb9ca445d44) ) -ROM_END - -ROM_START( jak_dora ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksdoragkr.bin", 0x000000, 0x200000, CRC(bcaa132d) SHA1(3894b980fbc4144731b2a7a94acebb29e30de67c) ) -ROM_END - -ROM_START( jak_nick ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksnicktoonsgkr.bin", 0x000000, 0x200000, CRC(4dec1656) SHA1(b3002ab15e75068102f4955a3f0c52fb6d5cda56) ) -ROM_END - -ROM_START( jak_sbfc ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksspongebobgkr.bin", 0x000000, 0x200000, CRC(9871303c) SHA1(78bc2687e1514094db8bb875e1117df3fcb3d201) ) -ROM_END - -ROM_START( jak_dorr ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksdora2gkr.bin", 0x000000, 0x200000, CRC(6c09bcd9) SHA1(4bcad79658832f319d16b4f63257e127f6862d79) ) -ROM_END - - -ROM_START( jak_spdm ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksspidermangkr.bin", 0x000000, 0x200000, CRC(1b2ee700) SHA1(30ea69c489e1238b004f473f972b682e35573138) ) -ROM_END - -ROM_START( jak_pooh ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakkspoohgkr.bin", 0x000000, 0x200000, CRC(0d97df55) SHA1(f108621a83c7b2263dd1531d82311627c3a02002) ) -ROM_END - -ROM_START( jak_care ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "carebeargkr.bin", 0x000000, 0x200000, CRC(e6096eb7) SHA1(92ee1a6df374f8b355ba2280dc43d764f6f69dfe) ) -ROM_END - -ROM_START( jak_wof ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakkswheeloffortunegkr.bin", 0x000000, 0x200000, CRC(6a879620) SHA1(95478764a61741569041c2299528f6464651d593) ) -ROM_END - -ROM_START( jak_disn ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "disneygkr.bin", 0x000000, 0x100000, CRC(7a5ebcd7) SHA1(9add8c2a6e3f0409c8957a2ba2d054fd2c4c39c1) ) -ROM_END - -ROM_START( jak_disf ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "disneyfriendsgkr.bin", 0x000000, 0x200000, CRC(77bca50b) SHA1(6e0f4fd229ee11eac721b5dbe79cf9002d3dbd64) ) -ROM_END - -ROM_START( jak_dpr ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksdisneyprincessgkr.bin", 0x000000, 0x200000, CRC(e26003ce) SHA1(ee15243281df6f09b96185c34582d7091604c954) ) -ROM_END - -ROM_START( jak_dprs ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "disneyprincess2gkr.bin", 0x000000, 0x200000, CRC(b670bdde) SHA1(c33ce7ada72a0c44bc881b5792cd33a9f2f0fb08) ) -ROM_END - -ROM_START( jak_mpac ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksmspacmangkr.bin", 0x000000, 0x100000, CRC(cab40f77) SHA1(30731acc461150d96aafa7a0451cfb1a25264678) ) -ROM_END - -ROM_START( jak_sdoo ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksscoobydoogkr.bin", 0x000000, 0x400000, CRC(61062ce5) SHA1(9d21767fd855385ef83e4209c429ecd4bf7e5384) ) -ROM_END - -ROM_START( jak_dbz ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksdragonballzgkr.bin", 0x000000, 0x200000, CRC(d52c3b20) SHA1(fd5ce41c143cad9bca3372054f4ff98b52c33874) ) -ROM_END - -ROM_START( jak_sith ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "jakksstarwarsgkr.bin", 0x000000, 0x200000, CRC(932cde19) SHA1(b88b748c235e9eeeda574e4d5b4077ae9da6fbd0) ) -ROM_END - -ROM_START( jak_capc ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "capcomgkr.bin", 0x000000, 0x200000, CRC(6d47cce4) SHA1(263926a991d55459aa3cee90049d2202c1e3a70e) ) -ROM_END - -ROM_START( lexizeus ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "lexibook1g900us.bin", 0x0000, 0x800000, CRC(c2370806) SHA1(cbb599c29c09b62b6a9951c724cd9fc496309cf9)) -ROM_END - -ROM_START( zone40 ) - ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "zone40.bin", 0x0000, 0x4000000, CRC(4ba1444f) SHA1(de83046ab93421486668a247972ad6d3cda19440) ) -ROM_END - -ROM_START( zone60 ) - ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "zone60.bin", 0x0000, 0x4000000, CRC(4cb637d1) SHA1(1f97cbdb4299ac0fbafc2a3aa592066cb0727066)) -ROM_END - -ROM_START( wirels60 ) - ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "wirels60.bin", 0x0000, 0x4000000, CRC(b4df8b28) SHA1(00e3da542e4bc14baf4724ad436f66d4c0f65c84)) -ROM_END - -// PCB marked 'Zone 100 110728 V2.1' -ROM_START( lx_jg7415 ) - ROM_REGION( 0x10000000, "maincpu", ROMREGION_ERASE00 ) - // reads of some unused areas were not 100% consistent, but this seems intentional, the game has a ROM twice the size it needs and is wired up in such a way that those bad areas are unused by the game - // if adding a clone make sure to check if there are actual differences in the used areas - ROM_LOAD16_WORD_SWAP( "rom.bin", 0x0000, 0x10000000, CRC(59442e00) SHA1(7e91cf6b19c37f9b4fa4dc21e241c6634d6a6f95) ) -ROM_END - - - - -ROM_START( rad_skat ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "skateboarder.bin", 0x000000, 0x400000, CRC(08b9ab91) SHA1(6665edc4740804956136c68065890925a144626b) ) -ROM_END - -ROM_START( rad_skatp ) // rom was dumped from the NTSC version, but region comes from an io port, so ROM is probably the same - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "skateboarder.bin", 0x000000, 0x400000, CRC(08b9ab91) SHA1(6665edc4740804956136c68065890925a144626b) ) -ROM_END - -ROM_START( rad_sktv ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "skannerztv.bin", 0x000000, 0x200000, CRC(e92278e3) SHA1(eb6bee5e661128d83784960dfff50379c36bfaeb) ) - - /* The external scanner MCU is a Winbond from 2000: SA5641 - the scanner plays sound effects when scanning, without being connected to the main unit, so a way to dump / emulate - this MCU is also needed for complete emulation - - TODO: find details on MCU so that we know capacity etc. */ -ROM_END - -ROM_START( rad_fb2 ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "football2.bin", 0x000000, 0x400000, CRC(96b4f0d2) SHA1(e91f2ac679fb0c026ffe216eb4ab58802f361a17) ) -ROM_END - -ROM_START( rad_crik ) // only released in EU? - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "cricket.bin", 0x000000, 0x200000, CRC(6fa0aaa9) SHA1(210d2d4f542181f59127ce2f516d0408dc6de7a8) ) -ROM_END - - -ROM_START( mattelcs ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "mattelclassicsports.bin", 0x000000, 0x100000, CRC(e633e7ad) SHA1(bf3e325a930cf645a7e32195939f3c79c6d35dac) ) -ROM_END - -ROM_START( dreamlif ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "dreamlife.bin", 0x000000, 0x800000, CRC(632e0237) SHA1(a8586e8a626d75cf7782f13cfd9f1b938af23d56) ) -ROM_END - - - - -ROM_START( icanguit ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - // no internal ROM, requires a cartridge -ROM_END - -ROM_START( icanpian ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - // no internal ROM, requires a cartridge -ROM_END - - -ROM_START( tvgogo ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - // no internal ROM? (Camera might have an MCU tho) -ROM_END - -ROM_START( pvmil ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) // Fujistu 29Z0002TN, read as ST M29W320FB - ROM_LOAD16_WORD_SWAP( "millionare4.bin", 0x000000, 0x400000, CRC(9c43d0f2) SHA1(fb4ba0115000b10b7c0e0d44b9fa3234c900e694) ) -ROM_END - -ROM_START( taikeegr ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "taikee_guitar.bin", 0x000000, 0x800000, CRC(8cbe2feb) SHA1(d72e816f259ba6a6260d6bbaf20c5e9b2cf7140b) ) -ROM_END - -ROM_START( shredmjr ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "shredmasterjr.bin", 0x000000, 0x800000, CRC(95a6dcf1) SHA1(44893cd6ebe6b7f33a73817b72ae7be70c3126dc) ) -ROM_END - - -ROM_START( sentx6p ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 ) - // chksum:05B58350 is @ 0x3000. - // This is the correct sum of 0x3010 - 0x1fffff (the first half of the ROM area after the checksum string) - // The 2nd half is not summed (and not used by the game?) but definitely exists in ROM (same data on 2 units) - ROM_LOAD16_WORD_SWAP( "senario texas holdem.bin", 0x000000, 0x400000, CRC(7c7d2d33) SHA1(71631074ba66e3b0cdeb86ebca3931599f3a911c) ) -ROM_END - -void spg2xx_game_state::init_crc() -{ - // several games have a byte sum checksum listed at the start of ROM, this little helper function logs what it should match. - const int length = memregion("maincpu")->bytes(); - const uint8_t* rom = memregion("maincpu")->base(); - - uint32_t checksum = 0x00000000; - // the first 0x10 bytes are where the "chksum:xxxxxxxx " string is listed, so skip over them - for (int i = 0x10; i < length; i++) - { - checksum += rom[i]; - } - - logerror("Calculated Byte Sum of bytes from 0x10 to 0x%08x is %08x)\n", length - 1, checksum); -} - -void spg2xx_game_state::init_zeus() -{ - uint16_t *ROM = (uint16_t*)memregion("maincpu")->base(); - int size = memregion("maincpu")->bytes(); - - for (int i = 0x8000 / 2; i < size / 2; i++) - { - // global 16-bit xor - ROM[i] = ROM[i] ^ 0x8a1d; - - // 4 single bit conditional xors - if (ROM[i] & 0x0020) - ROM[i] ^= 0x0100; - - if (ROM[i] & 0x0040) - ROM[i] ^= 0x1000; - - if (ROM[i] & 0x4000) - ROM[i] ^= 0x0001; - - if (ROM[i] & 0x0080) - ROM[i] ^= 0x0004; - - // global 16-bit bitswap - ROM[i] = bitswap<16>(ROM[i], 7, 12, 9, 14, 4, 6, 0, 10, 15, 1, 3, 2, 5, 13, 8, 11); - } -} - - -void spg2xx_game_state::init_taikeegr() -{ - u16 *src = (u16*)memregion("maincpu")->base(); - - for (int i = 0x00000; i < 0x800000/2; i++) - { - u16 dat = src[i]; - dat = bitswap<16>(dat, 15,14,13,12, 11,10,9,8, 7,6,5,4, 0,1,2,3 ); - src[i] = dat; - } - - std::vector<u16> buffer(0x800000/2); - - for (int i = 0; i < 0x800000/2; i++) - { - int j = 0; - - switch (i & 0x00e00) - { - case 0x00000: j = (i & 0xfff1ff) | 0x000; break; - case 0x00200: j = (i & 0xfff1ff) | 0x800; break; - case 0x00400: j = (i & 0xfff1ff) | 0x400; break; - case 0x00600: j = (i & 0xfff1ff) | 0xc00; break; - case 0x00800: j = (i & 0xfff1ff) | 0x200; break; - case 0x00a00: j = (i & 0xfff1ff) | 0xa00; break; - case 0x00c00: j = (i & 0xfff1ff) | 0x600; break; - case 0x00e00: j = (i & 0xfff1ff) | 0xe00; break; - } - - buffer[j] = src[i]; - } - - std::copy(buffer.begin(), buffer.end(), &src[0]); -} - -void zone40_state::init_zone40() -{ - uint16_t *ROM = (uint16_t*)memregion("maincpu")->base(); - int size = memregion("maincpu")->bytes(); - - for (int i = 0; i < size/2; i++) - { - ROM[i] = ROM[i] ^ 0xbb88; - - ROM[i] = bitswap<16>(ROM[i], 11, 10, 3, 2, 4, 12, 5, 13, - 9, 1, 8, 0, 6, 7, 14, 15); - } -} - -void wireless60_state::init_lx_jg7415() -{ - uint8_t blocks[32] = { - // these parts of the ROM contain the code that gets selected - 0x00, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0e, 0x0f, 0x10, 0x11, 0x16, 0x17, 0x18, 0x19, 0x1e, 0x1f, - // these parts of the ROM contain code / data but go unused, this seems intentional, some of these areas don't read consistently so likely this double size ROM was used knowing that some areas were bad and could be avoided - 0x02, 0x03, 0x04, 0x05, 0x0a, 0x0b, 0x0c, 0x0d, 0x12, 0x13, 0x14, 0x15, 0x1a, 0x1b, 0x1c, 0x1d - }; - - uint8_t *src = memregion("maincpu")->base(); - std::vector<u8> buffer(0x10000000); - - for (int addr = 0; addr < 0x10000000; addr++) - { - int bank = (addr & 0xf800000) >> 23; - int newbank = blocks[bank]; - int newaddr = (addr & 0x07fffff) | (newbank << 23); - buffer[addr] = src[newaddr]; - } - - std::copy(buffer.begin(), buffer.end(), &src[0]); - - m_bankmask = 0xf; -} - - -// year, name, parent, compat, machine, input, class, init, company, fullname, flags - -// Jungle Soft TV games -CONS( 2007, vii, 0, 0, vii, vii, vii_state, empty_init, "Jungle Soft / KenSingTon / Siatronics", "Vii", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // motion controls are awkward, but playable for the most part -// these don't have real motion controls -CONS( 2009, zone40, 0, 0, zone40, wirels60, zone40_state, init_zone40, "Jungle Soft / Ultimate Products (HK) Ltd", "Zone 40", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2010, zone60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Jungle's Soft / Ultimate Products (HK) Ltd", "Zone 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2010, wirels60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Jungle Soft / Kids Station Toys Inc", "Wireless 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2011, lx_jg7415,0, 0, wireless60, wirels60, wireless60_state, init_lx_jg7415, "Lexibook", "Lexibook JG7415 120-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) - -// JAKKS Pacific Inc TV games -CONS( 2004, jak_batm, 0, 0, jakks, batman, spg2xx_game_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "The Batman (JAKKS Pacific TV Game)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2008, jak_wall, 0, 0, walle, walle, spg2xx_game_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Wall-E (JAKKS Pacific TV Game)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) - -// 'Game-Key Ready' JAKKS games (these can also take per-game specific expansion cartridges, although not all games had them released) -// Some of these were available in versions without Game-Key ports, it is unconfirmed if code was the same unless otherwise stated -// For units released AFTER the GameKey promotion was cancelled it appears the code is the same as the PCB inside is the same, just the external port closed off, earlier units might be different hardware in some cases. -// units released BEFORE the GameKey support were sometimes different hardware, eg. the Spider-Man and Disney units were SPG110 based -CONS( 2005, jak_wwe, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "WWE (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WW (no game-keys released) -CONS( 2005, jak_fan4, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) -CONS( 2005, jak_just, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Taniko", "Justice League (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DC (no game-keys released) -CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Nursery Rhyme Adventure (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3 released) - The upper part of this one is pink/purple. -CONS( 2005, jak_dorr, 0, 0, jakks_gkr_nk_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Race to Play Park (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3 released) - The upper part of this one is blue -CONS( 2004, jak_nick, 0, 0, jakks_gkr_nk_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Nicktoons (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys -CONS( 2005, jak_sbfc, 0, 0, jakks_gkr_nk_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "SpongeBob SquarePants - The Fry Cook Games (JAKKS Pacific TV Game, Game-Key Ready) (AUG 18 2005 21:31:56)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys -CONS( 2005, jak_sdoo, 0, 0, jakks_gkr_2m_i2c, jak_sdoo_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Jolliford Management", "Scooby-Doo! and the Mystery of the Castle (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // SD (no game-keys released) (was dumped from a later unit with GameKey port missing, but internal PCB still supported it, code likely the same) -CONS( 2005, jak_disn, 0, 0, jakks_gkr_dy, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney (JAKKS Pacific TV Game, Game-Key Ready) (08 FEB 2005 A)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) -CONS( 2005, jak_disf, 0, 0, jakks_gkr_dy_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney Friends (JAKKS Pacific TV Game, Game-Key Ready) (17 MAY 2005 A)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) -CONS( 2005, jak_dpr, 0, 0, jakks_gkr_dp_i2c, jak_dpr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / 5000ft, Inc", "Disney Princess (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DP keys (1 key released) -CONS( 2005, jak_dprs, 0, 0, jakks_gkr_dp_i2c, jak_dpr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / 5000ft, Inc", "Disney Princesses (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DP keys (1 key released) (unit looks identical to above, including just having 'Disney Princess' logo, but this one has the 'board game' as a frontend and a slightly different on-screen title) -CONS( 2005, jak_sith, 0, 0, jakks_gkr_sw_i2c, jak_sith_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Griptonite Games", "Star Wars - Revenge of the Sith (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses SW keys (1 released) -CONS( 2005, jak_dbz, 0, 0, jakks_gkr_1m_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dragon Ball Z (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DB (no game-keys released, 1 in development but cancelled) -CONS( 2005, jak_mpac, 0, 0, jakks_gkr_nm_i2c, jak_nm_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Namco / HotGen Ltd", "Ms. Pac-Man 5-in-1 (Ms. Pac-Man, Pole Position, Galaga, Xevious, Mappy) (JAKKS Pacific TV Game, Game-Key Ready) (07 FEB 2005 A SKU F)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NM (3 keys available [Dig Dug, New Rally-X], [Rally-X, Pac-Man, Bosconian], [Pac-Man, Bosconian]) -CONS( 2005, jak_capc, 0, 0, jakks_gkr_cc_i2c, jak_cc_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Capcom / HotGen Ltd", "Capcom 3-in-1 (1942, Commando, Ghosts'n Goblins) (JAKKS Pacific TV Game, Game-Key Ready) (29 MAR 2005 B)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses CC keys (no game-keys released) -CONS( 2005, jak_wof, 0, 0, jakks_gkr_wf_i2c, jak_wf_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Wheel of Fortune (JAKKS Pacific TV Game, Game-Key Ready) (Jul 11 2005 ORIG)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses WF keys (no game-keys released) analog wheel not emulated -// There is a 'Second Edition' version of Wheel of Fortune with a Gold case, GameKey port removed, and a '2' over the usual Game Key Ready logo, internals are different too, not Game-Key Ready -CONS( 2004, jak_spdm, 0, 0, jakks_gkr_mv_i2c, jak_gkr_i2c, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Spider-Man (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // MV (1 key available) -CONS( 2005, jak_pooh, 0, 0, jakks_gkr_wp, jak_pooh, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Backbone Entertainment", "Winnie the Pooh - Piglet's Special Day (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WP (no game-keys released) -CONS( 2005, jak_care, 0, 0, jakks_gkr_cb, jak_care, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Backbone Entertainment", "Care Bears TV Games (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // CB (no game-keys released) - -// Some versions of the Shrek - Over the Hedge unit show the GameKey logo on startup (others don't) there is no evidence to suggest it was ever released with a GameKey port tho, and the internal PCB has no place for one on the versions we've seen (which show the logo) - -// Radica TV games -CONS( 2006, rad_skat, 0, 0, rad_skat, rad_skat, spg2xx_game_state, init_crc, "Radica", "Play TV Skateboarder (NTSC)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2006, rad_skatp, rad_skat, 0, rad_skatp,rad_skatp, spg2xx_game_state, init_crc, "Radica", "Connectv Skateboarder (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2006, rad_crik, 0, 0, rad_crik, rad_crik, spg2xx_game_state, init_crc, "Radica", "Connectv Cricket (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // Version 3.00 20/03/06 is listed in INTERNAL TEST -CONS( 2007, rad_sktv, 0, 0, rad_sktv, rad_sktv, spg2xx_game_state, init_crc, "Radica", "Skannerz TV", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -CONS( 2007, rad_fb2, 0, 0, rad_skat, rad_fb2, spg2xx_game_state, init_crc, "Radica", "Play TV Football 2", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // offers a 2 player option in menus, but seems to have only been programmed for, and released as, a single player unit, P2 controls appear unfinished. - -// Mattel games -CONS( 2005, mattelcs, 0, 0, rad_skat, mattelcs, spg2xx_game_state, empty_init, "Mattel", "Mattel Classic Sports", MACHINE_IMPERFECT_SOUND ) - -// Hasbro games -CONS( 2005, dreamlif, 0, 0, dreamlif, dreamlif, dreamlif_state, empty_init, "Hasbro", "Dream Life (Version 1.0, Feb 07 2005)", MACHINE_IMPERFECT_SOUND ) - -// Fisher-Price games -CONS( 2007, icanguit, 0, 0, icanguit, icanguit, icanguit_state, empty_init, "Fisher-Price", "I Can Play Guitar", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // how is data saved? -CONS( 2006, icanpian, 0, 0, icanpian, icanpian, icanpian_state, empty_init, "Fisher-Price", "I Can Play Piano", MACHINE_IMPERFECT_SOUND ) // 2006 date from Manual - -// Toyquest games -CONS( 2005, tvgogo, 0, 0, tvgogo, tvgogo, tvgogo_state, empty_init, "Toyquest", "GoGo TV Video Vision", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // or TV Go Go - the game addons call it the 'Video Vision console' - -// Similar, SPG260?, scrambled -CONS( 200?, lexizeus, 0, 0, lexizeus, lexizeus, spg2xx_game_state, init_zeus, "Lexibook", "Zeus IG900 20-in-1 (US?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad sound and some corrupt bg tilemap entries in Tiger Rescue, verify ROM data (same game runs in Zone 60 without issue) - -// there are other regions of this, including a Finnish version "Haluatko miljonääriksi?" (see https://millionaire.fandom.com/wiki/Haluatko_miljon%C3%A4%C3%A4riksi%3F_(Play_Vision_game) ) -CONS( 2006, pvmil, 0, 0, pvmil, pvmil, pvmil_state, empty_init, "Play Vision", "Who Wants to Be a Millionaire? (Play Vision, Plug and Play, UK)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) - -// there are multiple versions of this with different songs, was also sold by dreamGEAR as 'Shredmaster Jr.' (different title screen) -// for the UK version the title screen always shows "Guitar Rock", however there are multiple boxes with different titles and song selections. -// ROM is glued on the underside and soldered to the PCB, very difficult to remove without damaging. -CONS( 2007, taikeegr, 0, 0, taikeegr, taikeegr, spg2xx_game_state, init_taikeegr, "TaiKee", "Rockstar Guitar / Guitar Rock (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad music timings (too slow) -CONS( 2007, shredmjr, taikeegr, 0, shredmjr, taikeegr, shredmjr_game_state, init_taikeegr, "dreamGEAR", "Shredmaster Jr (NTSC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad music timings (too slow) - -// "go 02d1d0" "do r1 = ff" to get past initial screen (currently bypassed by setting controller sense in RAM earlier, see hack in machine_reset) -// a 'deluxe' version of this also exists with extra game modes -CONS( 2004, sentx6p, 0, 0, sentx6p, sentx6p, sentx6p_state, empty_init, "Senario / Play Vision", "Vs Maxx Texas Hold'em TV Poker - 6 Player Edition (UK)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // from a UK Play Vision branded box, values in GBP - - diff --git a/src/mame/drivers/vsmile.cpp b/src/mame/drivers/vsmile.cpp index 7ef3532fb80..62de4a483b6 100644 --- a/src/mame/drivers/vsmile.cpp +++ b/src/mame/drivers/vsmile.cpp @@ -282,21 +282,18 @@ void vsmilem_state::vsmilem(machine_config &config) * ************************************/ -// TODO: decide on a dump endian, these likely differ in endianess due to different dumping technqiues -ROM_START( vsmile ) - ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) - ROM_LOAD( "vsmilebios.bin", 0x000000, 0x200000, CRC(11f1b416) SHA1(11f77c4973d29c962567390e41879c86a759c93b) ) -ROM_END +// NOTE: many games contain additional spare copies of the BIOS in their own cartridge ROM, reason unknown -ROM_START( vsmileg ) +ROM_START( vsmile ) ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) - ROM_LOAD16_WORD_SWAP( "sysrom german.bin", 0x000000, 0x200000, CRC(205c5296) SHA1(7fbcf761b5885c8b1524607aabaf364b4559c8cc) ) + ROM_SYSTEM_BIOS( 0, "v103", "v103" ) + ROMX_LOAD( "vsmile_v103.bin", 0x000000, 0x200000, CRC(387fbc24) SHA1(5f2fd211b6ff3a6f5121b14adc6bbf4f49e89f33), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(0) ) // this is the earliest version used on the V.Smile Pocket, but it isn't system specific + ROM_SYSTEM_BIOS( 1, "v102", "v102" ) + ROMX_LOAD( "vsmile_v102.bin", 0x000000, 0x200000, CRC(0cd0bdf5) SHA1(5c8d1eada1b6b545555b8d2b09325d7127681af8), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1) ) // found in all 'fat' model systems + ROM_SYSTEM_BIOS( 2, "v100", "v100" ) + ROMX_LOAD( "vsmile_v100.bin", 0x000000, 0x200000, CRC(205c5296) SHA1(7fbcf761b5885c8b1524607aabaf364b4559c8cc), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(2) ) ROM_END -ROM_START( vsmilef ) - ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) - ROM_LOAD16_WORD_SWAP( "sysrom_france", 0x000000, 0x200000, CRC(0cd0bdf5) SHA1(5c8d1eada1b6b545555b8d2b09325d7127681af8) ) -ROM_END ROM_START( vsmilem ) ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) @@ -304,7 +301,5 @@ ROM_START( vsmilem ) ROM_END // year, name, parent, compat, machine, input, class, init, company, fullname, flags -CONS( 2005, vsmile, 0, 0, vsmile, vsmile, vsmile_state, empty_init, "VTech", "V.Smile (US)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2005, vsmileg, vsmile, 0, vsmilep, vsmile, vsmile_state, empty_init, "VTech", "V.Smile (Germany)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2005, vsmilef, vsmile, 0, vsmilep, vsmile, vsmile_state, empty_init, "VTech", "V.Smile (France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2005, vsmile, 0, 0, vsmile, vsmile, vsmile_state, empty_init, "VTech", "V.Smile", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2008, vsmilem, vsmile, 0, vsmilem, vsmile, vsmilem_state, empty_init, "VTech", "V.Smile Motion (US)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/vsmileb.cpp b/src/mame/drivers/vsmileb.cpp index bc8bac516d8..7bfa1285a3e 100644 --- a/src/mame/drivers/vsmileb.cpp +++ b/src/mame/drivers/vsmileb.cpp @@ -4,6 +4,8 @@ V-Tech V.Smile Baby console emulation + - mounting of cartridges doesn't appear to work? + *******************************************************************************/ #include "emu.h" @@ -150,10 +152,14 @@ void vsmileb_state::vsmilebp(machine_config &config) * ************************************/ -// TODO: decide on a dump endian, these likely differ in endianess due to different dumping technqiues ROM_START( vsmileb ) ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) - ROM_LOAD( "vsmilebabybios.bin", 0x000000, 0x800000, CRC(ddc7f845) SHA1(2c17d0f54200070176d03d44a40c7923636e596a) ) + ROM_LOAD16_WORD_SWAP( "vsmilebabybios.bin", 0x000000, 0x800000, CRC(58d4caa0) SHA1(0b636ff80fd7fc429d753a8beab2957f1e59cbde) ) +ROM_END + +ROM_START( vsmilebs ) + ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) + ROM_LOAD16_WORD_SWAP( "vsmilebabybios_spain_pooh.bin", 0x000000, 0x800000, CRC(a1926654) SHA1(a8ccbe29235bb44faef77b1e7d73a20221b005c2) ) ROM_END ROM_START( vsmilebsw ) @@ -164,3 +170,5 @@ ROM_END // year, name, parent, compat, machine, input, class, init, company, fullname, flags CONS( 2005, vsmileb, 0, 0, vsmileb, vsmileb, vsmileb_state, empty_init, "VTech", "V.Smile Baby (US)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2005, vsmilebsw ,vsmileb, 0, vsmilebp,vsmileb, vsmileb_state, empty_init, "VTech", "V.Smile Baby (Sweden)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// has the Winnie the Pooh game in the BIOS ROM. This was supplied as a 'Romless cart' with the device, so probably triggers a switch, currently always banked in. +CONS( 2005, vsmilebs, vsmileb, 0, vsmileb, vsmileb, vsmileb_state, empty_init, "VTech", "V.Smile Baby (Spain, with Aventuras en el Bosque de los Cien Acres)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/vt100.cpp b/src/mame/drivers/vt100.cpp index a56fed96416..dac026b92a3 100644 --- a/src/mame/drivers/vt100.cpp +++ b/src/mame/drivers/vt100.cpp @@ -119,9 +119,8 @@ void vt100_state::vt100_mem(address_map &map) { map.unmap_value_high(); map(0x0000, 0x1fff).rom(); // ROM ( 4 * 2K) - map(0x2000, 0x2bff).ram().share("p_ram"); // Screen and scratch RAM - map(0x2c00, 0x2fff).ram(); // AVO Screen RAM - map(0x3000, 0x3fff).ram(); // AVO Attribute RAM (4 bits wide) + map(0x2000, 0x3fff).ram().share("p_ram"); // Screen and scratch RAM + //map(0x3000, 0x3fff).ram(); // AVO Attribute RAM (4 bits wide) // 0x4000, 0x7fff is unassigned map(0x8000, 0x9fff).rom(); // Program memory expansion ROM (4 * 2K) map(0xa000, 0xbfff).rom(); // Program memory expansion ROM (1 * 8K) diff --git a/src/mame/drivers/vt1682.cpp b/src/mame/drivers/vt1682.cpp index a93766589e0..b40e8a5d6b5 100644 --- a/src/mame/drivers/vt1682.cpp +++ b/src/mame/drivers/vt1682.cpp @@ -34,26 +34,35 @@ Proper IO support (enables / disables) UART, I2C etc. 'Capture' mode Gain (zoom) for Tilemaps - Refactor into a device + Verify that internal ROMs are blank (it isn't used for any set we have) + more + ----------- + Intec InterAct: Is there meant to be a 2nd player? (many games prompt a 2nd player to start, but inputs don't appear to be read?) - Verify that internal ROM is blank (it isn't used) - Zone 40: + ----------- + + Excite Sports 48-in-1: + + Why are the rasters broken on MX Motorstorm when the game game works in other collections? does the alt input reading throw the timing off enough that the current hookup fails + or is there a different PAL/NTSC detection method that we're failing? + + Why is the priority incorrect in Ping Pong, again it was fine in the other collections - Decrypt, verify it's a good dump, verify that it's 6502 code, see how close the architecture is to 1682 (many games are the same) - If it has an internal ROM dump it (I don't see any obvious encrypted boot vectors in current dump) + No sound in Archery? */ #include "emu.h" #include "machine/m6502_vt1682.h" +#include "machine/m6502_vh2009.h" #include "machine/vt1682_io.h" +#include "machine/vt1682_uio.h" #include "machine/vt1682_alu.h" #include "machine/vt1682_timer.h" #include "machine/bankdev.h" @@ -96,18 +105,19 @@ public: vt_vt1682_state(const machine_config& mconfig, device_type type, const char* tag) : driver_device(mconfig, type, tag), m_io(*this, "io"), + m_uio(*this, "uio"), m_leftdac(*this, "leftdac"), m_rightdac(*this, "rightdac"), m_maincpu(*this, "maincpu"), m_fullrom(*this, "fullrom"), m_bank(*this, "cartbank"), + m_screen(*this, "screen"), m_soundcpu(*this, "soundcpu"), m_maincpu_alu(*this, "mainalu"), m_soundcpu_alu(*this, "soundalu"), m_soundcpu_timer_a_dev(*this, "snd_timera_dev"), m_soundcpu_timer_b_dev(*this, "snd_timerb_dev"), m_system_timer_dev(*this, "sys_timer_dev"), - m_screen(*this, "screen"), m_spriteram(*this, "spriteram"), m_vram(*this, "vram"), m_sound_share(*this, "sound_share"), @@ -125,6 +135,7 @@ protected: virtual void video_start() override; required_device<vrt_vt1682_io_device> m_io; + required_device<vrt_vt1682_uio_device> m_uio; required_device<dac_12bit_r2r_device> m_leftdac; required_device<dac_12bit_r2r_device> m_rightdac; required_device<cpu_device> m_maincpu; @@ -133,6 +144,8 @@ protected: required_device<address_map_bank_device> m_fullrom; required_memory_bank m_bank; + required_device<screen_device> m_screen; + private: required_device<cpu_device> m_soundcpu; required_device<vrt_vt1682_alu_device> m_maincpu_alu; @@ -142,7 +155,6 @@ private: required_device<vrt_vt1682_timer_device> m_soundcpu_timer_b_dev; required_device<vrt_vt1682_timer_device> m_system_timer_dev; - required_device<screen_device> m_screen; required_device<address_map_bank_device> m_spriteram; required_device<address_map_bank_device> m_vram; required_shared_ptr<uint8_t> m_sound_share; @@ -464,10 +476,16 @@ private: DECLARE_READ8_MEMBER(vt1682_212c_prng_r); DECLARE_WRITE8_MEMBER(vt1682_212c_prng_seed_w); + virtual void clock_joy2(); + + READ8_MEMBER(inteact_212a_send_joy_clock2_r); + /* Hacky */ DECLARE_READ8_MEMBER(soundcpu_irq_vector_hack_r); DECLARE_READ8_MEMBER(maincpu_irq_vector_hack_r); + DECLARE_WRITE8_MEMBER(vt1682_sound_reset_hack_w); + bool m_scpu_is_in_reset; /* System Helpers */ @@ -618,18 +636,18 @@ public: DECLARE_WRITE8_MEMBER(portc_w) { LOGMASKED(LOG_OTHER, "%s: portc_w writing: %1x\n", machine().describe_context(), data & 0xf); }; DECLARE_WRITE8_MEMBER(portd_w) { LOGMASKED(LOG_OTHER, "%s: portd_w writing: %1x\n", machine().describe_context(), data & 0xf); }; + DECLARE_WRITE8_MEMBER(ext_rombank_w); + protected: virtual void machine_start() override; virtual void machine_reset() override; - void vt_vt1682_map_bank(address_map& map); - private: - DECLARE_WRITE8_MEMBER(inteact_2129_bank_w); uint8_t m_previous_port_b; int m_input_sense; int m_input_pos; + int m_current_bank; required_ioport m_io_p1; required_ioport m_io_p2; @@ -637,6 +655,49 @@ private: required_ioport m_io_p4; }; +class vt1682_exsport_state : public vt_vt1682_state +{ +public: + vt1682_exsport_state(const machine_config& mconfig, device_type type, const char* tag) : + vt_vt1682_state(mconfig, type, tag), + m_io_p1(*this, "P1"), + m_io_p2(*this, "P2") + { } + + void vt1682_exsport(machine_config& config); + void vt1682_exsportp(machine_config& config); + + virtual DECLARE_READ8_MEMBER(uiob_r); + DECLARE_WRITE8_MEMBER(uiob_w); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + int m_old_portb; + int m_portb_shiftpos = 0; + int m_p1_latch; + int m_p2_latch; + virtual void clock_joy2() override; + + required_ioport m_io_p1; + required_ioport m_io_p2; +}; + +class vt1682_wow_state : public vt1682_exsport_state +{ +public: + vt1682_wow_state(const machine_config& mconfig, device_type type, const char* tag) : + vt1682_exsport_state(mconfig, type, tag) + { } + + void vt1682_wow(machine_config& config); + +protected: + +private: +}; + void vt_vt1682_state::video_start() { @@ -857,6 +918,7 @@ void vt_vt1682_state::machine_reset() m_bank->set_entry(0); m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_scpu_is_in_reset = true; } /* @@ -2544,17 +2606,19 @@ READ8_MEMBER(vt_vt1682_state::vt1682_2106_enable_regs_r) WRITE8_MEMBER(vt_vt1682_state::vt1682_2106_enable_regs_w) { // COMR6 is used for banking - LOGMASKED(LOG_OTHER, "%s: vt1682_2106_enable_regs_w writing: %02x (scpurn:%1x scpuon:%1x spion:%1x uarton:%1x tvon:%1x lcdon:%1x)\n", machine().describe_context(), data, + LOGMASKED(LOG_OTHER, "%s: vt1682_2106_enable_regs_w writing: %02x (scpurn:%1x scpuon:%1x spion:%1x uarton:%1x tvon:%1x lcdon:%1x)\n", machine().describe_context().c_str(), data, (data & 0x20) >> 5, (data & 0x10) >> 4, (data & 0x08) >> 3, (data & 0x04) >> 2, (data & 0x02) >> 1, (data & 0x01)); m_2106_enable_reg = data; if (data & 0x20) { m_soundcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); + m_scpu_is_in_reset = false; } else { m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_scpu_is_in_reset = true; } } @@ -3084,7 +3148,8 @@ WRITE8_MEMBER(vt_vt1682_state::vt1682_211c_regs_ext2421_w) if (data & 0x10) { - printf("Sound CPU IRQ Request\n"); + // not seen used + logerror("Sound CPU IRQ Request\n"); } } @@ -3579,6 +3644,17 @@ WRITE8_MEMBER(vt_vt1682_state::vt1682_2128_dma_sr_bank_addr_24_23_w) 0x01 - UIOA DIRECTION */ +void vt_vt1682_state::clock_joy2() +{ +} + +READ8_MEMBER(vt_vt1682_state::inteact_212a_send_joy_clock2_r) +{ + uint8_t ret = m_uio->inteact_212a_uio_a_direction_r(space,offset); + clock_joy2(); + return ret; +} + /* Address 0x212b r/w (MAIN CPU) @@ -3974,7 +4050,14 @@ WRITE8_MEMBER(vt_vt1682_state::vt1682_soundcpu_211c_reg_irqctrl_w) if (data & 0x10) { - printf("Main CPU IRQ Request from Sound CPU\n"); + // not seen used + logerror("Main CPU IRQ Request from Sound CPU\n"); + } + + if (data & 0x08) + { + // documentation indicates that Sleep mode is buggy, so this probably never gets used + popmessage("SCU Sleep\n"); } } @@ -4798,7 +4881,11 @@ void vt_vt1682_state::draw_layer(int which, int opaque, const rectangle& cliprec if (high_color) { - + popmessage("high colour line mode\n"); + } + else + { + popmessage("line mode\n"); } } } @@ -5009,6 +5096,7 @@ void vt_vt1682_state::vt_vt1682_map(address_map &map) { map(0x0000, 0x0fff).ram(); map(0x1000, 0x1fff).ram().share("sound_share"); + map(0x1ff4, 0x1fff).w(FUNC(vt_vt1682_state::vt1682_sound_reset_hack_w)); /* Video */ map(0x2000, 0x2000).rw(FUNC(vt_vt1682_state::vt1682_2000_r), FUNC(vt_vt1682_state::vt1682_2000_w)); @@ -5108,9 +5196,10 @@ void vt_vt1682_state::vt_vt1682_map(address_map &map) map(0x2126, 0x2126).rw(FUNC(vt_vt1682_state::vt1682_2126_dma_sr_bank_addr_22_15_r), FUNC(vt_vt1682_state::vt1682_2126_dma_sr_bank_addr_22_15_w)); map(0x2127, 0x2127).rw(FUNC(vt_vt1682_state::vt1682_2127_dma_status_r), FUNC(vt_vt1682_state::vt1682_2127_dma_size_trigger_w)); map(0x2128, 0x2128).rw(FUNC(vt_vt1682_state::vt1682_2128_dma_sr_bank_addr_24_23_r), FUNC(vt_vt1682_state::vt1682_2128_dma_sr_bank_addr_24_23_w)); - // 2129 UIO - // 212a UIO - // 212b UIO + map(0x2129, 0x2129).rw(m_uio, FUNC(vrt_vt1682_uio_device::inteact_2129_uio_a_data_r), FUNC(vrt_vt1682_uio_device::inteact_2129_uio_a_data_w)); + map(0x212a, 0x212a).w(m_uio, FUNC(vrt_vt1682_uio_device::inteact_212a_uio_a_direction_w)); + map(0x212a, 0x212a).r(FUNC(vt_vt1682_state::inteact_212a_send_joy_clock2_r)); + map(0x212b, 0x212b).rw(m_uio, FUNC(vrt_vt1682_uio_device::inteact_212b_uio_a_attribute_r), FUNC(vrt_vt1682_uio_device::inteact_212b_uio_a_attribute_w)); map(0x212c, 0x212c).rw(FUNC(vt_vt1682_state::vt1682_212c_prng_r), FUNC(vt_vt1682_state::vt1682_212c_prng_seed_w)); // 212d PLL // 212e unused @@ -5124,6 +5213,11 @@ void vt_vt1682_state::vt_vt1682_map(address_map &map) map(0x2136, 0x2136).w(m_maincpu_alu, FUNC(vrt_vt1682_alu_device::alu_oprand_5_div_w)); map(0x2137, 0x2137).w(m_maincpu_alu, FUNC(vrt_vt1682_alu_device::alu_oprand_6_div_w)); + map(0x2149, 0x2149).rw(m_uio, FUNC(vrt_vt1682_uio_device::inteact_2149_uio_b_data_r), FUNC(vrt_vt1682_uio_device::inteact_2149_uio_b_data_w)); + map(0x214a, 0x214a).rw(m_uio, FUNC(vrt_vt1682_uio_device::inteact_214a_uio_b_direction_r), FUNC(vrt_vt1682_uio_device::inteact_214a_uio_b_direction_w)); + map(0x214b, 0x214b).rw(m_uio, FUNC(vrt_vt1682_uio_device::inteact_214b_uio_b_attribute_r), FUNC(vrt_vt1682_uio_device::inteact_214b_uio_b_attribute_w)); + + // 3000-3fff internal ROM if enabled map(0x4000, 0x7fff).r(FUNC(vt_vt1682_state::rom_4000_to_7fff_r)); map(0x8000, 0xffff).r(FUNC(vt_vt1682_state::rom_8000_to_ffff_r)); @@ -5131,17 +5225,6 @@ void vt_vt1682_state::vt_vt1682_map(address_map &map) map(0xfffe, 0xffff).r(FUNC(vt_vt1682_state::maincpu_irq_vector_hack_r)); // probably need custom IRQ support in the core instead... } -void intec_interact_state::vt_vt1682_map_bank(address_map& map) -{ - vt_vt1682_map(map); - map(0x2129, 0x2129).w(FUNC(intec_interact_state::inteact_2129_bank_w)); // 2129 UIO -} - -WRITE8_MEMBER(intec_interact_state::inteact_2129_bank_w) -{ - m_bank->set_entry(data & 0x01); -} - /* Vectors / IRQ Levels @@ -5180,10 +5263,17 @@ READ8_MEMBER(vt_vt1682_state::maincpu_irq_vector_hack_r) return rom_8000_to_ffff_r(space, (0xfff8 - 0x8000)+offset); } +// intg5410 writes a new program without resetting the CPU when selecting from the 'arcade' game main menu, this is problematic +// it does appear to rewrite the vectors first, so maybe there is some hardware side-effect of this putting the CPU in reset state?? +WRITE8_MEMBER(vt_vt1682_state::vt1682_sound_reset_hack_w) +{ + m_sound_share[0x0ff4 + offset] = data; + m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); +} WRITE_LINE_MEMBER(vt_vt1682_state::soundcpu_timera_irq) { - if (state) + if (state && !m_scpu_is_in_reset) m_soundcpu->set_input_line(0, ASSERT_LINE); else m_soundcpu->set_input_line(0, CLEAR_LINE); @@ -5242,7 +5332,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(vt_vt1682_state::scanline) if (m_2000 & 0x01) { m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); - m_soundcpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); // same enable? (NMI_EN on sub is 'wakeup NMI') + if (!m_scpu_is_in_reset) + m_soundcpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); // same enable? (NMI_EN on sub is 'wakeup NMI') } } } @@ -5348,6 +5439,7 @@ void vt_vt1682_state::vt_vt1682(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_test); VT_VT1682_IO(config, m_io, 0); + VT_VT1682_UIO(config, m_uio, 0); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -5378,6 +5470,7 @@ void intec_interact_state::machine_start() save_item(NAME(m_previous_port_b)); save_item(NAME(m_input_sense)); save_item(NAME(m_input_pos)); + save_item(NAME(m_current_bank)); } void intec_interact_state::machine_reset() @@ -5386,8 +5479,50 @@ void intec_interact_state::machine_reset() m_previous_port_b = 0x0; m_input_sense = 0; m_input_pos = 0; + m_current_bank = 0; + if (m_bank) + m_bank->set_entry(m_current_bank & 0x03); } + +void vt1682_exsport_state::machine_start() +{ + vt_vt1682_state::machine_start(); + + save_item(NAME(m_old_portb)); + save_item(NAME(m_portb_shiftpos)); + save_item(NAME(m_p1_latch)); + save_item(NAME(m_p2_latch)); +} + +void vt1682_exsport_state::machine_reset() +{ + vt_vt1682_state::machine_reset(); + + m_old_portb = 0; + m_portb_shiftpos = 0; + m_p1_latch = 0; + m_p2_latch = 0; +} + +WRITE8_MEMBER(intec_interact_state::ext_rombank_w) +{ + LOGMASKED(LOG_OTHER, "%s: ext_rombank_w writing: %1x\n", machine().describe_context(), data); + + // Seems no way to unset a bank once set? program will write 0 here, and even taking into account direction + // registers that would result in the bank bits being cleared, when running from a higher bank, which + // crashes the program. The game offers no 'back' option, so maybe this really is the correct logic. + + if (data & 0x01) + m_current_bank |= 1; + + if (data & 0x02) + m_current_bank |= 2; + + m_bank->set_entry(m_current_bank & 0x03); +}; + + WRITE8_MEMBER(intec_interact_state::porta_w) { if (data != 0xf) @@ -5405,7 +5540,7 @@ static INPUT_PORTS_START( intec ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) // Selects games + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) // Selects games PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Select") // used on first screen to choose which set of games PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // Fires in Tank @@ -5446,6 +5581,28 @@ static INPUT_PORTS_START( miwi2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // Pink Drum in Drum Master INPUT_PORTS_END +static INPUT_PORTS_START( exsprt48 ) + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + + PORT_START("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) +INPUT_PORTS_END + // this controller code is just designed to feed the games with data they're happy with, it probably has no grounds in reality // as I don't know how they really work. presumably wireless with timeouts, sending signals for brief periods that need to be @@ -5540,7 +5697,35 @@ WRITE8_MEMBER(intec_interact_state::portb_w) m_previous_port_b = data; }; +void vt1682_exsport_state::clock_joy2() +{ + m_portb_shiftpos++; +} + +READ8_MEMBER(vt1682_exsport_state::uiob_r) +{ + int p1bit = (m_p1_latch >> m_portb_shiftpos) & 1; + int p2bit = (m_p2_latch >> m_portb_shiftpos) & 1; + + return (p1bit << 1) | (p2bit << 3); +}; +WRITE8_MEMBER(vt1682_exsport_state::uiob_w) +{ + if ((m_old_portb & 0x01) != (data & 0x01)) + { + if (!(data & 0x01)) + { + m_portb_shiftpos = 0; + + //logerror("%s: reset shift\n", machine().describe_context()); + + m_p1_latch = m_io_p1->read(); + m_p2_latch = m_io_p2->read(); + } + } + m_old_portb = data; +} void intec_interact_state::intech_interact(machine_config& config) @@ -5574,19 +5759,49 @@ void intec_interact_state::intech_interact_bank(machine_config& config) { intech_interact(config); - m_maincpu->set_addrmap(AS_PROGRAM, &intec_interact_state::vt_vt1682_map_bank); + m_uio->porta_out().set(FUNC(intec_interact_state::ext_rombank_w)); +} + +void vt1682_exsport_state::vt1682_exsport(machine_config& config) +{ + vt_vt1682_state::vt_vt1682(config); + + m_uio->portb_in().set(FUNC(vt1682_exsport_state::uiob_r)); + m_uio->portb_out().set(FUNC(vt1682_exsport_state::uiob_w)); } +void vt1682_exsport_state::vt1682_exsportp(machine_config& config) +{ + vt_vt1682_state::vt_vt1682(config); + // TODO, different clocks, timings etc.! + m_screen->set_refresh_hz(50); +} + + + +void vt1682_wow_state::vt1682_wow(machine_config& config) +{ + vt1682_exsport_state::vt1682_exsport(config); + + M6502_VH2009(config.replace(), m_maincpu, MAIN_CPU_CLOCK_NTSC); // doesn't use the same bitswap as the other VT1682 games... + m_maincpu->set_addrmap(AS_PROGRAM, &vt1682_wow_state::vt_vt1682_map); +} + + void vt_vt1682_state::regular_init() { m_bank->configure_entry(0, memregion("mainrom")->base() + 0x0000000); } + void intec_interact_state::banked_init() { - m_bank->configure_entry(0, memregion("mainrom")->base() + 0x0000000); - m_bank->configure_entry(1, memregion("mainrom")->base() + 0x2000000); + int size = memregion("mainrom")->bytes(); + for (int i = 0; i < 4; i++) + { + m_bank->configure_entry(i, memregion("mainrom")->base() + ((i*0x2000000) & (size-1))); + } } @@ -5605,16 +5820,49 @@ ROM_START( ii32in1 ) ROM_LOAD( "ii32in1.bin", 0x00000, 0x2000000, CRC(ddee4eac) SHA1(828c0c18a66bb4872299f9a43d5e3647482c5925) ) ROM_END +ROM_START( zone7in1 ) + ROM_REGION( 0x2000000, "mainrom", 0 ) + ROM_LOAD( "zone.bin", 0x000000, 0x1000000, CRC(50726ae8) SHA1(bcedcd61728dce7b430784585be14109af542cc2) ) +ROM_END + ROM_START( miwi2_16 ) ROM_REGION( 0x2000000, "mainrom", ROMREGION_ERASE00 ) ROM_LOAD( "miwi 2 16 arcade games and drum master vt168.bin", 0x00000, 0x1000000, CRC(00c115c5) SHA1(fa5fdb448dd9b963351d71fe94e2072f5c872a18) ) ROM_END +ROM_START( miwi2_7 ) + ROM_REGION( 0x2000000, "mainrom", ROMREGION_ERASE00 ) + ROM_LOAD( "miwi 2 sports 7 in 1 vt168.bin", 0x00000, 0x1000000, CRC(fcefb956) SHA1(fea8f041d42bcbae3716ce8b942a01e64504061e) ) +ROM_END + ROM_START( intact89 ) ROM_REGION( 0x4000000, "mainrom", 0 ) ROM_LOAD( "89n1.bin", 0x00000, 0x4000000, CRC(bbcba068) SHA1(0ec1ecc55e9a7050ca20b1349b9712319fd21629) ) ROM_END +ROM_START( intg5410 ) + ROM_REGION( 0x8000000, "mainrom", 0 ) + ROM_LOAD( "interact_intg5410_111games_plus_42songs.bin", 0x00000, 0x8000000, CRC(d32dc914) SHA1(269fa262bb036ad5246dee9f83ee33dbb1543210) ) +ROM_END + +ROM_START( exsprt48 ) + ROM_REGION( 0x2000000, "mainrom", ROMREGION_ERASE00 ) + ROM_LOAD( "excitesportgames_48.bin", 0x00000, 0x2000000, CRC(1bf239a0) SHA1(d69c16bac5fb15c62abb5a0c0920405647205539) ) // original dump had upper 2 address lines swapped, unmarked chip, so lines were guessed when dumping +ROM_END + +// differs by 2 bytes from above, the rasters glitch in MotorStorm in a different way, so it's likely an NTSC/PAL difference? +ROM_START( exsprt48a ) + ROM_REGION( 0x2000000, "mainrom", ROMREGION_ERASE00 ) + ROM_LOAD( "48in1sports.bin", 0x00000, 0x2000000, CRC(8e490541) SHA1(aeb01b3d7229fc888b36aaa924fe6b10597a7783) ) +ROM_END + +ROM_START( wowwg ) + ROM_REGION( 0x2000000, "mainrom", 0 ) + ROM_LOAD( "msp55lv128.bin", 0x00000, 0x1000000, CRC(f607c40c) SHA1(66d3960c3b8fbab06a88cf039419c79a6c8633f0) ) + ROM_RELOAD(0x1000000,0x1000000) +ROM_END + + // TODO: this is a cartridge based system (actually, verify this, it seems some versions simply had built in games) move these to SL if verified as from cartridge config // actually it appears that for the cart based systems these are 'fake systems' anyway, where the base unit is just a Famiclone but as soon as you plug in a cart none of @@ -5624,13 +5872,52 @@ CONS( 200?, ii8in1, 0, 0, intech_interact, intec, intec_interact_state, CONS( 200?, ii32in1, 0, 0, intech_interact, intec, intec_interact_state, regular_init, "Intec", "InterAct 32-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // a 40-in-1 also exists which combines the above -CONS( 200?, miwi2_16, 0, 0, intech_interact, miwi2, intec_interact_state, regular_init, "<unknown>", "MiWi2 16-in-1 + Drum Master", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -// miwi2 7-in-1 Sports +CONS( 200?, zone7in1, 0, 0, intech_interact, miwi2, intec_interact_state, regular_init, "<unknown>", "Zone 7-in-1 Sports (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +// UK version of Zone 7-in-1 has different games (Boxing / Tennis / Golf / Fishing / Table Tennis / Bowling / Football) with Fishing replacing Baseball + +CONS( 200?, miwi2_16, 0, 0, intech_interact, miwi2, intec_interact_state, regular_init, "<unknown>", "MiWi2 16-in-1 + Drum Master", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // clearly older code, Highway has uncensored title screen, selection screen has 'Arcase' instead of 'Arcade' +CONS( 200?, miwi2_7, 0, 0, intech_interact, miwi2, intec_interact_state, regular_init, "<unknown>", "MiWi2 7-in-1 Sports", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +// ViMax seems to be identical software to MiWi2 + +CONS( 200?, intact89, 0, 0, intech_interact_bank, miwi2, intec_interact_state, banked_init, "Intec", "InterAct Complete Video Game - 89-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -CONS( 200?, intact89, 0, 0, intech_interact_bank, miwi2, intec_interact_state, banked_init, "Intec", "InterAct Complete Video Game 89-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +/* +Box shows + +InterAct +Complete Video Game System +Sistema Completo De Video Juegos +111 Games & 42 Songs + +96 Arcade Games: +8 of them are Sports Games, +& 3 of the are Drum Master Games. +Plus 15 Shooting Games +Unit has 'InfraZone' text on it, but this isn't used anywhere in product description. + +*/ +CONS( 200?, intg5410, 0, 0, intech_interact_bank, miwi2, intec_interact_state, banked_init, "Intec", "InterAct Complete Video Game - 111 Games & 42 Songs (G5410)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // need to hook up gun controls etc. and verify others, also sometimes crashes on game change (due to crashing sound CPU?) -// Intec Interact Infrazone 15 Shooting Games, 42 Mi kara, 96 Arcade Games + more should run here too // Other standalone Mi Kara units should fit here as well -// ViMax seems to be identical software to MiWi2 -// some older versions of these show 'Arcase' instead of 'Arcade' on the menu. + + +// the timing code for MotorStorm differs between these sets (although fails wiht our emulation in both cases, even if the game runs fine in other collections) +CONS( 200?, exsprt48, 0, 0, vt1682_exsport, exsprt48, vt1682_exsport_state, regular_init, "Excite", "Excite Sports Wireless Interactive TV Game - 48-in-1 (set 1, NTSC)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // "32 Arcade, 8 Sports, 8 Stadium" +CONS( 200?, exsprt48a, exsprt48, 0, vt1682_exsportp, exsprt48, vt1682_exsport_state, regular_init, "Excite", "Excite Sports Wireless Interactive TV Game - 48-in-1 (set 2, PAL)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // ^ + +/* +There is at least one alt US version of this also on VT1682 + +Still advertised as 48-in-1, 8 Interactive Sports Games, 8 Olympic games, 32 Arcade Games +see https://www.youtube.com/watch?v=tHMX71daHAk +Changes: +Dancing as extra under Music +Doesn't have Poker under Brain +Ball Shoot instead of 'Noshery' under Arcade + +This might be a regional / store thing if some places didn't want to sell a unit with a Poker game in it? +*/ + +CONS( 200?, wowwg, 0, 0, vt1682_wow, exsprt48, vt1682_wow_state, regular_init, "Wow", "Wow Wireless Gaming", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND) // needs high colour line mode for main menu +// NJ Pocket 60-in-1 (NJ-250) is meant to have similar games, so might fit here diff --git a/src/mame/drivers/vt52.cpp b/src/mame/drivers/vt52.cpp new file mode 100644 index 00000000000..369de8b2afa --- /dev/null +++ b/src/mame/drivers/vt52.cpp @@ -0,0 +1,438 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + DEC VT50 terminal family + + The VT50 "DECscope" was DEC's first video terminal to contain a CPU of + sorts, with TTL logic spanning two boards executing custom microcode. + It displayed 12 lines of 80-column text, using a standard character + generator that only contained uppercase letters and symbols. + + The VT52 used the same case and most of the same circuitry as the VT50, + but quickly displaced it by supporting 24 lines of text and a full ASCII + character generator (on a board of its own). VT50 and VT52 each had + minor variants differing in keyboard function and printer availability. + + The VT55 DECgraphic Scope was a graphical terminal based on the same + main boards as the VT50 and VT52. + +****************************************************************************/ + +#include "emu.h" +#include "bus/rs232/rs232.h" +#include "cpu/vt50/vt50.h" +#include "machine/ay31015.h" +#include "sound/spkrdev.h" +#include "screen.h" +#include "speaker.h" + +class vt52_state : public driver_device +{ +public: + vt52_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_uart(*this, "uart") + , m_eia(*this, "eia") + , m_keys(*this, "KEY%d", 0U) + , m_break_key(*this, "BREAK") + , m_baud_sw(*this, "BAUD") + , m_data_sw(*this, "DATABITS") + , m_chargen(*this, "chargen") + , m_serial_out(true) + , m_rec_data(true) + , m_110_baud_counter(0) + { + } + + void vt52(machine_config &config); + + DECLARE_WRITE_LINE_MEMBER(break_w); + DECLARE_INPUT_CHANGED_MEMBER(data_sw_changed); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + void update_serial_settings(); + + u8 key_r(offs_t offset); + DECLARE_WRITE_LINE_MEMBER(baud_9600_w); + void vert_count_w(u8 data); + void uart_xd_w(u8 data); + void gated_serial_output(bool state); + DECLARE_WRITE_LINE_MEMBER(serial_out_w); + DECLARE_WRITE_LINE_MEMBER(rec_data_w); + DECLARE_READ_LINE_MEMBER(xrdy_eoc_r); + u8 chargen_r(offs_t offset); + + void rom_1k(address_map &map); + void ram_2k(address_map &map); + + required_device<vt5x_cpu_device> m_maincpu; + required_device<ay31015_device> m_uart; + required_device<rs232_port_device> m_eia; + required_ioport_array<8> m_keys; + required_ioport m_break_key; + required_ioport m_baud_sw; + required_ioport m_data_sw; + required_region_ptr<u8> m_chargen; + + bool m_serial_out; + bool m_rec_data; + u8 m_110_baud_counter; +}; + +void vt52_state::machine_start() +{ + save_item(NAME(m_serial_out)); + save_item(NAME(m_rec_data)); + save_item(NAME(m_110_baud_counter)); +} + +void vt52_state::machine_reset() +{ + m_110_baud_counter = 0; + + update_serial_settings(); + m_uart->write_swe(0); + + m_eia->write_dtr(0); + m_eia->write_rts(0); +} + +void vt52_state::update_serial_settings() +{ + u8 db = m_data_sw->read(); + m_uart->write_nb1(BIT(db, 0)); + m_uart->write_np(BIT(db, 0)); + m_uart->write_eps(BIT(db, 1)); + m_uart->write_nb2(1); + m_uart->write_tsb(!BIT(m_baud_sw->read(), 10)); + m_uart->write_cs(1); + + gated_serial_output(m_serial_out && m_break_key->read()); + if (!BIT(m_baud_sw->read(), 9)) + m_uart->write_si(1); +} + +INPUT_CHANGED_MEMBER(vt52_state::data_sw_changed) +{ + update_serial_settings(); +} + +u8 vt52_state::key_r(offs_t offset) +{ + // double negative logic courtesy of 7430 NOR gates and 74150 multiplexer + return !BIT(~m_keys[offset & 7]->read() & 0x3ff, (offset & 0170) >> 3); +} + +WRITE_LINE_MEMBER(vt52_state::baud_9600_w) +{ + u16 baud = m_baud_sw->read(); + if (!BIT(baud, 13)) + { + m_uart->write_rcp(state); + if ((baud & 0x0380) != 0x0380) + m_uart->write_tcp(state); + } +} + +void vt52_state::vert_count_w(u8 data) +{ + u16 baud = m_baud_sw->read(); + + // 110 baud clock is 1200 baud clock divided by 11 by yet another 74161 + if ((data & 7) == 4) + { + if (m_110_baud_counter == 15) + { + if (!BIT(baud, 10)) + { + m_uart->write_rcp(0); + if ((baud & 0x0380) != 0x0380) + m_uart->write_tcp(0); + } + m_110_baud_counter = 5; + } + else + { + m_110_baud_counter++; + if (m_110_baud_counter == 8 && !BIT(baud, 10)) + { + m_uart->write_rcp(1); + if ((baud & 0x0380) != 0x0380) + m_uart->write_tcp(1); + } + } + } + + if ((baud & 0x2400) == 0x2400) + { + if ((baud & 0x1b80) != 0x1b80) + { + bool clk = (~(baud | data) & 0x7f) == 0; + m_uart->write_rcp(clk); + m_uart->write_tcp(clk); + } + else + { + m_uart->write_rcp((~(baud | data) & 0x0e) == 0); + m_uart->write_tcp((~(baud | data) & 0x71) == 0); + } + } + else if ((baud & 0x0380) == 0x0380) + m_uart->write_tcp((~(baud | data) & 0x71) == 0); +} + +void vt52_state::uart_xd_w(u8 data) +{ + if (BIT(m_data_sw->read(), 2)) + m_uart->set_transmit_data(data | 0x80); + else + m_uart->set_transmit_data(data & 0x7f); +} + +void vt52_state::gated_serial_output(bool state) +{ + ioport_value baud = m_baud_sw->read(); + if (BIT(baud, 9)) + m_eia->write_txd(state); + if (!BIT(baud, 9) || (m_rec_data && (~baud & 0x0880) != 0)) + m_uart->write_si(state); +} + +WRITE_LINE_MEMBER(vt52_state::serial_out_w) +{ + if (m_serial_out != state) + { + m_serial_out = state; + if (m_break_key->read()) + gated_serial_output(state); + } +} + +WRITE_LINE_MEMBER(vt52_state::break_w) +{ + if (m_serial_out) + gated_serial_output(state); +} + +WRITE_LINE_MEMBER(vt52_state::rec_data_w) +{ + m_rec_data = state; + + ioport_value baud = m_baud_sw->read(); + if (BIT(baud, 9) && ((~baud & 0x0880) == 0 || (m_serial_out && m_break_key->read()))) + m_uart->write_si(state); +} + +READ_LINE_MEMBER(vt52_state::xrdy_eoc_r) +{ + return m_uart->tbmt_r() && m_uart->eoc_r(); +} + +u8 vt52_state::chargen_r(offs_t offset) +{ + // ROM is on its own board, shared only with 7404 inverters + return ~m_chargen[offset]; +} + +void vt52_state::rom_1k(address_map &map) +{ + map(00000, 01777).rom().region("program", 0); +} + +void vt52_state::ram_2k(address_map &map) +{ + map(00000, 03777).ram(); +} + +static INPUT_PORTS_START(vt52) + PORT_START("KEY0") + PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) // must always be low + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_CODE(KEYCODE_2_PAD) // S78 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('2') PORT_CHAR('@') PORT_CODE(KEYCODE_2) // S3 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR(027) PORT_CODE(KEYCODE_W) // S19 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(023) PORT_CODE(KEYCODE_S) // S35 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR(003) PORT_CODE(KEYCODE_C) // S52 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(030) PORT_CODE(KEYCODE_X) // S51 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR(032) PORT_CODE(KEYCODE_Z) // S50 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CODE(KEYCODE_RIGHT) // S76 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CODE(KEYCODE_0_PAD) // S81 + + PORT_START("KEY1") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_CODE(KEYCODE_7_PAD) // S69 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('l') PORT_CHAR('L') PORT_CHAR(014) PORT_CODE(KEYCODE_L) // S42 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(';') PORT_CHAR(':') PORT_CODE(KEYCODE_COLON) // S43 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR(017) PORT_CODE(KEYCODE_O) // S26 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('9') PORT_CHAR('(') PORT_CODE(KEYCODE_9) // S10 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR(020) PORT_CODE(KEYCODE_P) // S27 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(012) PORT_CODE(KEYCODE_INSERT) // S30 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('0') PORT_CHAR(')') PORT_CODE(KEYCODE_0) // S11 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_CODE(KEYCODE_9_PAD) // S71 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) PORT_CODE(KEYCODE_ENTER_PAD) // S83 + + PORT_START("KEY2") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CODE(KEYCODE_DEL) // S31 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('5') PORT_CHAR('%') PORT_CODE(KEYCODE_5) // S6 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(024) PORT_CODE(KEYCODE_T) // S22 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('4') PORT_CHAR('$') PORT_CODE(KEYCODE_4) // S5 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('h') PORT_CHAR('H') PORT_CODE(KEYCODE_H) // S39 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR(022) PORT_CODE(KEYCODE_R) // S21 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('|') PORT_CHAR(034) PORT_CODE(KEYCODE_BACKSLASH) // S29 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G Bell") PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR(007) PORT_CODE(KEYCODE_G) // S38 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CODE(KEYCODE_DOWN) // S72 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_CODE(KEYCODE_8_PAD) // S70 + + PORT_START("KEY3") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Back Space") PORT_CHAR(010) PORT_CODE(KEYCODE_BACKSPACE) // S15 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('3') PORT_CHAR('#') PORT_CODE(KEYCODE_3) // S4 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR(006) PORT_CODE(KEYCODE_F) // S37 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('v') PORT_CHAR('V') PORT_CHAR(026) PORT_CODE(KEYCODE_V) // S53 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('b') PORT_CHAR('B') PORT_CHAR(002) PORT_CODE(KEYCODE_B) // S54 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('d') PORT_CHAR('D') PORT_CHAR(004) PORT_CODE(KEYCODE_D) // S36 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('=') PORT_CHAR('+') PORT_CHAR(035) PORT_CODE(KEYCODE_EQUALS) // S13 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('e') PORT_CHAR('E') PORT_CHAR(005) PORT_CODE(KEYCODE_E) // S20 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad Blank (right)") PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CODE(KEYCODE_ASTERISK) // S67 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad Blank (left)") PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CODE(KEYCODE_NUMLOCK) // S65 + + PORT_START("KEY4") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad Blank (center)") PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CODE(KEYCODE_SLASH_PAD) // S66 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('8') PORT_CHAR('*') PORT_CODE(KEYCODE_8) // S9 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('i') PORT_CHAR('I') PORT_CODE(KEYCODE_I) // S25 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR(025) PORT_CODE(KEYCODE_U) // S24 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('7') PORT_CHAR('&') PORT_CODE(KEYCODE_7) // S8 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('6') PORT_CHAR('^') PORT_CODE(KEYCODE_6) // S7 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('`') PORT_CHAR('~') PORT_CODE(KEYCODE_TILDE) // S14 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('k') PORT_CHAR('K') PORT_CHAR(013) PORT_CODE(KEYCODE_K) // S41 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CODE(KEYCODE_UP) // S68 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE // S33 + + PORT_START("KEY5") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CODE(KEYCODE_1_PAD) // S77 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space Bar") PORT_CHAR(040) PORT_CODE(KEYCODE_SPACE) // S63 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('n') PORT_CHAR('N') PORT_CHAR(016) PORT_CODE(KEYCODE_N) // S55 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('m') PORT_CHAR('M') PORT_CODE(KEYCODE_M) // S56 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('j') PORT_CHAR('J') PORT_CODE(KEYCODE_J) // S40 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('y') PORT_CHAR('Y') PORT_CHAR(031) PORT_CODE(KEYCODE_Y) // S23 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('.') PORT_CHAR('>') PORT_CODE(KEYCODE_STOP) // S58 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(',') PORT_CHAR('<') PORT_CODE(KEYCODE_COMMA) // S57 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) PORT_CODE(KEYCODE_3_PAD) // S79 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Repeat") PORT_CODE(KEYCODE_RALT) // S61 + + PORT_START("KEY6") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_CODE(KEYCODE_4_PAD) // S73 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Scroll") PORT_CODE(KEYCODE_LALT) // S48 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(011) PORT_CODE(KEYCODE_TAB) // S17 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc (Sel)") PORT_CHAR(033) PORT_CODE(KEYCODE_ESC) // S1 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR(001) PORT_CODE(KEYCODE_A) // S34 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('q') PORT_CHAR('Q') PORT_CHAR(021) PORT_CODE(KEYCODE_Q) // S18 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CHAR(015) PORT_CODE(KEYCODE_ENTER) // S64/S47/S46 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('1') PORT_CHAR('!') PORT_CODE(KEYCODE_1) // S2 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_CODE(KEYCODE_6_PAD) // S75 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_SHIFT_2) PORT_CODE(KEYCODE_LCONTROL) // S32 + + PORT_START("KEY7") + PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_CODE(KEYCODE_5_PAD) // S74 + PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_CODE(KEYCODE_DEL_PAD) // S82 + PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('{') PORT_CHAR('}') PORT_CODE(KEYCODE_CLOSEBRACE) // S45 + PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('/') PORT_CHAR('?') PORT_CODE(KEYCODE_SLASH) // S59 + PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\'') PORT_CHAR('"') PORT_CODE(KEYCODE_QUOTE) // S44 + PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('-') PORT_CHAR('_') PORT_CODE(KEYCODE_MINUS) // S12 + PORT_BIT(0x040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Copy") PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) PORT_CODE(KEYCODE_RCONTROL) // S62 + PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR(']') PORT_CODE(KEYCODE_OPENBRACE) // S28 + PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CODE(KEYCODE_LEFT) // S80 + PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CHAR(UCHAR_SHIFT_1) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) // S49(L)/S60(R) + + PORT_START("BREAK") // on keyboard but divorced from matrix (position taken over by Caps Lock) and not readable by CPU + PORT_BIT(1, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_PAUSE) PORT_WRITE_LINE_MEMBER(vt52_state, break_w) // S16 + + PORT_START("BAUD") // 7-position rotary switches under keyboard, set in combination (positions on SW2 are actually labeled A through G) + PORT_DIPNAME(0x03f1, 0x01f1, "Transmitting Speed") PORT_DIPLOCATION("S1:7,4,5,6,2,3,1") PORT_CHANGED_MEMBER(DEVICE_SELF, vt52_state, data_sw_changed, 0) + PORT_DIPSETTING(0x01f1, "Off-Line (XCLK = RCLK)") // S1:1 + PORT_DIPSETTING(0x02f1, "Full Duplex (XCLK = RCLK)") // S1:3 + PORT_DIPSETTING(0x0371, "Full Duplex, Local Copy (XCLK = RCLK)") // S1:2 + PORT_DIPSETTING(0x03b1, "75 Baud") // S1:6 + PORT_DIPSETTING(0x03d1, "150 Baud") // S1:5 + PORT_DIPSETTING(0x03e1, "300 Baud") // S1:4 + PORT_DIPSETTING(0x03f0, "4800 Baud") // S1:7 + PORT_DIPNAME(0x3c0e, 0x1c0e, "Receiving Speed") PORT_DIPLOCATION("S2:6,5,4,2,1,3,7") PORT_CHANGED_MEMBER(DEVICE_SELF, vt52_state, data_sw_changed, 0) + PORT_DIPSETTING(0x2c0e, "Match (Bell 103) (RCLK = XCLK)") // S2:C + PORT_DIPSETTING(0x340e, "Match (Bell 103), Local Copy (RCLK = XCLK)") // S2:A + PORT_DIPSETTING(0x380e, "110 Baud with 2 Stop Bits") // S2:B + PORT_DIPSETTING(0x3c06, "600 Baud") // S2:D + PORT_DIPSETTING(0x3c0a, "1200 Baud") // S2:E + PORT_DIPSETTING(0x3c0c, "2400 Baud") // S2:F + PORT_DIPSETTING(0x1c0e, "9600 Baud") // S2:G + // Any combination of XCLK = RCLK with RCLK = XCLK is illegal (both lines are pulled up, halting the UART) + + PORT_START("DATABITS") + PORT_DIPNAME(0x1, 0x1, "Data Bits") PORT_DIPLOCATION("S3:1") PORT_CHANGED_MEMBER(DEVICE_SELF, vt52_state, data_sw_changed, 0) + PORT_DIPSETTING(0x0, "7 (with parity)") + PORT_DIPSETTING(0x1, "8 (no parity)") + PORT_DIPNAME(0x2, 0x2, "Parity") PORT_DIPLOCATION("W6:1") PORT_CHANGED_MEMBER(DEVICE_SELF, vt52_state, data_sw_changed, 0) + PORT_DIPSETTING(0x2, "Even") + PORT_DIPSETTING(0x0, "Odd") + PORT_DIPNAME(0x4, 0x0, "Data Bit 7") PORT_DIPLOCATION("W5:1") PORT_CHANGED_MEMBER(DEVICE_SELF, vt52_state, data_sw_changed, 0) + PORT_DIPSETTING(0x0, "Spacing") + PORT_DIPSETTING(0x4, "Marking") // actually the hardware default, but not as good for modern use + + PORT_START("KEYCLICK") + PORT_DIPNAME(1, 1, DEF_STR(Unused)) PORT_DIPLOCATION("S4:1") // not tested by VT52, and possibly not even populated + PORT_DIPSETTING(0, DEF_STR(Off)) + PORT_DIPSETTING(1, DEF_STR(On)) + + PORT_START("60HJ") + PORT_DIPNAME(1, 1, "Unit Frequency") PORT_DIPLOCATION("W7:1") + PORT_DIPSETTING(0, "50 Hz") + PORT_DIPSETTING(1, "60 Hz") +INPUT_PORTS_END + +void vt52_state::vt52(machine_config &config) +{ + VT52_CPU(config, m_maincpu, 13.824_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &vt52_state::rom_1k); + m_maincpu->set_addrmap(AS_DATA, &vt52_state::ram_2k); + m_maincpu->set_screen("screen"); + m_maincpu->baud_9600_callback().set(FUNC(vt52_state::baud_9600_w)); + m_maincpu->vert_count_callback().set(FUNC(vt52_state::vert_count_w)); + m_maincpu->uart_rd_callback().set(m_uart, FUNC(ay51013_device::receive)); + m_maincpu->uart_xd_callback().set(FUNC(vt52_state::uart_xd_w)); + m_maincpu->ur_flag_callback().set(m_uart, FUNC(ay51013_device::dav_r)); + m_maincpu->ut_flag_callback().set(FUNC(vt52_state::xrdy_eoc_r)); + m_maincpu->ruf_callback().set(m_uart, FUNC(ay51013_device::write_rdav)); + m_maincpu->key_up_callback().set(FUNC(vt52_state::key_r)); + m_maincpu->kclk_callback().set_ioport("KEYCLICK"); + m_maincpu->frq_callback().set_ioport("60HJ"); + m_maincpu->bell_callback().set("bell", FUNC(speaker_sound_device::level_w)); + m_maincpu->char_data_callback().set(FUNC(vt52_state::chargen_r)); + + AY51013(config, m_uart); // TR1402 or equivalent + m_uart->write_so_callback().set(FUNC(vt52_state::serial_out_w)); + + SCREEN(config, "screen", SCREEN_TYPE_RASTER); + + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, "bell").add_route(ALL_OUTPUTS, "mono", 1.0); // FIXME: uses a flyback diode circuit + + RS232_PORT(config, m_eia, default_rs232_devices, nullptr); + m_eia->rxd_handler().set(FUNC(vt52_state::rec_data_w)); +} + +ROM_START(vt52) + ROM_REGION(0x400, "program", 0) // bipolar PROMs + ROM_LOAD_NIB_LOW( "23-124a9.e29", 0x000, 0x200, CRC(3f5f3b92) SHA1(244c3100f277da3fce5513a92529a2c3e26a80b4)) + ROM_LOAD_NIB_HIGH("23-125a9.e26", 0x000, 0x200, CRC(b2a670c9) SHA1(fa8dd031dcafe4facff41e79603bdb388a6df928)) + ROM_LOAD_NIB_LOW( "23-126a9.e37", 0x200, 0x200, CRC(4883a600) SHA1(c5d9b0c21493065c75b4a7d52d5bd47f9851dfe7)) + ROM_LOAD_NIB_HIGH("23-127a9.e21", 0x200, 0x200, CRC(56c1c0d6) SHA1(ab0eb6e7bbafcc3d28481b62de3d3490f01c0174)) + // K1 or L1 version uses PROMs 23-119A9 through 23-122A9 + + ROM_REGION(0x400, "chargen", 0) // 2608 (non-JEDEC) character generator + ROM_LOAD("23-002b4.e1", 0x000, 0x400, CRC(b486500c) SHA1(029f07424d6c23ee083db42d9f9c252ac728ccd0)) + // K1 or L1 version may use either 23-001B4 or 23-002B4 +ROM_END + +COMP(1975, vt52, 0, 0, vt52, vt52, vt52_state, empty_init, "Digital Equipment Corporation", "VT52 Video Display Terminal (M4)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_PRINTER) diff --git a/src/mame/drivers/vt62.cpp b/src/mame/drivers/vt62.cpp new file mode 100644 index 00000000000..ec37e99515d --- /dev/null +++ b/src/mame/drivers/vt62.cpp @@ -0,0 +1,121 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for DEC VT61 and VT62 terminals. + +****************************************************************************/ + +#include "emu.h" +//#include "bus/rs232/rs232.h" +#include "cpu/vt61/vt61.h" +#include "machine/ay31015.h" +//#include "sound/spkrdev.h" +#include "screen.h" +//#include "speaker.h" + +class vt62_state : public driver_device +{ +public: + vt62_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_uart(*this, "uart") + { + } + + void vt62(machine_config &mconfig); + +protected: + virtual void machine_reset() override; + +private: + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void micro_map(address_map &map); + void memory_map(address_map &map); + void decode_map(address_map &map); + + required_device<vt61_cpu_device> m_maincpu; + required_device<ay31015_device> m_uart; + //required_ioport_array<8> m_keys; + //required_ioport m_baud_sw; +}; + +void vt62_state::machine_reset() +{ +} + +u32 vt62_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void vt62_state::micro_map(address_map &map) +{ + map(00000, 01777).rom().region("crom", 0); +} + +void vt62_state::memory_map(address_map &map) +{ + map(0000000, 0000377).mirror(0047400).ram(); // static RAM A + map(0010000, 0013777).mirror(0040000).ram(); // dynamic RAM B + map(0020000, 0023777).mirror(0040000).ram(); // dynamic RAM C + map(0100000, 0117777).mirror(0060000).rom().region("mrom", 0); +} + +void vt62_state::decode_map(address_map &map) +{ + map(000, 077).rom().region("idr", 0); +} + +static INPUT_PORTS_START(vt62) +INPUT_PORTS_END + +void vt62_state::vt62(machine_config &mconfig) +{ + VT61_CPU(mconfig, m_maincpu, 15.36_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &vt62_state::micro_map); + m_maincpu->set_addrmap(AS_DATA, &vt62_state::memory_map); + m_maincpu->set_addrmap(vt61_cpu_device::AS_IDR, &vt62_state::decode_map); + + AY51013(mconfig, m_uart); + + screen_device &screen(SCREEN(mconfig, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(15.36_MHz_XTAL, 1000, 0, 800, 256, 0, 240); + screen.set_screen_update(FUNC(vt62_state::screen_update)); +} + +ROM_START(vt62) + ROM_REGION16_LE(0x800, "crom", 0) // control ROM (microprogram) + ROMX_LOAD("23-187f1_82s137.e93", 0x001, 0x400, CRC(73796e58) SHA1(38f8c984e7fb99d79fc13acc3a3b1e92aa136ad2), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1)) + ROMX_LOAD("23-188f1_82s137.e94", 0x001, 0x400, CRC(198831a9) SHA1(574552dbae185b6c2168313d4e8a1d87e88c1883), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1)) + ROMX_LOAD("23-186f1_82s137.e90", 0x000, 0x400, CRC(b5691aa1) SHA1(d84cdbcf90dc687c56ac4e7f5d4372451d1afd7b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1)) + ROMX_LOAD("23-189f1_82s137.e95", 0x000, 0x400, CRC(05a9437b) SHA1(160c57658070ee7569fc12414f6250261e2f5e8a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1)) + + ROM_REGION(0x2000, "mrom", 0) // macroprogram/user ROM (on memory board) + ROM_LOAD("e3", 0x0000, 0x0800, NO_DUMP) // UPROMs may be substituted at E24, E23, E28, E27 + ROM_LOAD("e8", 0x0800, 0x0800, NO_DUMP) // UPROMs may be substituted at E32, E31, E36, E35 + ROM_LOAD("e13", 0x1000, 0x0800, NO_DUMP) // UPROMs may be substituted at E41, E40, E46, E45 + ROM_LOAD("e20", 0x1800, 0x0800, NO_DUMP) // UPROMs may be substituted at E51, E50, E55, E54 + + ROM_REGION(0x40, "idr", 0) // macro instruction decode + ROM_LOAD("23-195a1_82s23.e13", 0x00, 0x20, CRC(cd8d8020) SHA1(cd10097d7fc62676b62387495615f1e06a689cd3)) + ROM_LOAD("23-194a1_82s23.e12", 0x20, 0x20, CRC(b05df6b5) SHA1(e13b7b0f75dbbc0d262606280bd5cf8be3561849)) + + ROM_REGION(0x20, "alu", 0) // ALU function decode (same as VT61) + ROM_LOAD("23-114a1.e41", 0x00, 0x20, NO_DUMP) + + ROM_REGION(0x400, "cgrom", 0) // character generators (same as VT61) + ROM_LOAD_NIB_HIGH("23-053a9_82s131.e24", 0x000, 0x100, CRC(9a242be8) SHA1(4c619b6c0cfdda4af097b5702e45fad78ed6d601)) + ROM_CONTINUE( 0x300, 0x100) + ROM_LOAD_NIB_LOW( "23-052a9_82s131.e23", 0x000, 0x100, CRC(6c09ac7b) SHA1(e50060489500b1ca1b89530209c59e610c605c3d)) + ROM_CONTINUE( 0x300, 0x100) + ROM_LOAD_NIB_HIGH("23-051a9_82s131.e17", 0x200, 0x100, CRC(089ea972) SHA1(210bf4e5d32e49e1d7183f13d3b81ce446f49551)) + ROM_CONTINUE( 0x100, 0x100) + ROM_LOAD_NIB_LOW( "23-050a9_82s131.e16", 0x200, 0x100, CRC(758125a1) SHA1(b1de4448ea90da07f2aacb665542545bbcd17371)) + ROM_CONTINUE( 0x100, 0x100) +ROM_END + +//COMP(1977, vt61t, 0, 0, vt61t, vt61t, vt61_state, empty_init, "Digital Equipment Corporation", "VT61/t", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +COMP(1978, vt62, 0, 0, vt62, vt62, vt62_state, empty_init, "Digital Equipment Corporation", "VT62 DECscope", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) diff --git a/src/mame/drivers/white_mod.cpp b/src/mame/drivers/white_mod.cpp index d62eb26764e..c528cfa2f09 100644 --- a/src/mame/drivers/white_mod.cpp +++ b/src/mame/drivers/white_mod.cpp @@ -2301,6 +2301,29 @@ ROM_START(lotr401) ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) ROM_END +ROM_START(lotr3) + ROM_REGION(0x80000, "user1", 0) + ROM_LOAD("lotrcpu.300", 0x0000, 0x20000, CRC(fdc5351d) SHA1(92d58bcdd21026d278b5534d1a6ab299f6fffc60)) + ROM_RELOAD(0x20000, 0x20000) + ROM_RELOAD(0x40000, 0x20000) + ROM_RELOAD(0x60000, 0x20000) + ROM_REGION(0x10000, "maincpu", 0) + ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) + ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) + ROM_REGION(0x80000, "gfx3", 0) + ROM_LOAD( "lotrdspa.300", 0x0000, 0x80000, CRC(522e3e33) SHA1(11987872604e2a3e2c9567f8f9313c36e6c08cc7)) + ROM_REGION32_LE(0x600000, "cpu2", 0) + ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) + ROM_RELOAD(0x0,0x200000) + ROM_REGION(0x10000, "sound1", 0) + ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) + ROM_REGION(0x400000, "sound2", 0) + ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) + ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) + ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) + ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) +ROM_END + ROM_START(lotr_sp) ROM_REGION(0x80000, "user1", 0) ROM_LOAD("lotrcpul.a00", 0x00000, 0x20000, CRC(c62aba47) SHA1(2fef599313e5cd9bded3ab00b933631586e2a1e7)) @@ -3693,6 +3716,7 @@ GAME(2003, lotr501, lotr, whitestar_mod, whitestar_mod, whitestar_mo GAME(2003, lotr5, lotr, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (5.00)", MACHINE_IS_SKELETON_MECHANICAL) GAME(2003, lotr410, lotr, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (4.10)", MACHINE_IS_SKELETON_MECHANICAL) GAME(2003, lotr401, lotr, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (4.01)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(2003, lotr3, lotr, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (3.00)", MACHINE_IS_SKELETON_MECHANICAL) GAME(2003, lotr_sp, 0, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (10.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) GAME(2003, lotr_sp9, lotr_sp, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (9.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) GAME(2003, lotr_sp8, lotr_sp, whitestar_mod, whitestar_mod, whitestar_mod_state, init_whitestar_mod, ROT0, "Stern", "The Lord Of The Rings (8.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp index dbe1342bf1f..d4949eaf9c3 100644 --- a/src/mame/drivers/williams.cpp +++ b/src/mame/drivers/williams.cpp @@ -521,28 +521,39 @@ Reference video: https://www.youtube.com/watch?v=R5OeC6Wc_yI * *************************************/ -void williams_state::defender_map(address_map &map) +void defender_state::main_map(address_map &map) { map(0x0000, 0xbfff).ram().share("videoram"); map(0xc000, 0xcfff).m(m_bankc000, FUNC(address_map_bank_device::amap8)); - map(0xd000, 0xdfff).w(FUNC(williams_state::defender_bank_select_w)); + map(0xd000, 0xdfff).w(FUNC(defender_state::bank_select_w)); map(0xd000, 0xffff).rom(); } - -void williams_state::defender_bankc000_map(address_map &map) +void defender_state::bankc000_map(address_map &map) { map(0x0000, 0x000f).mirror(0x03e0).writeonly().share("paletteram"); - map(0x03ff, 0x03ff).w(FUNC(williams_state::williams_watchdog_reset_w)); - map(0x0010, 0x001f).mirror(0x03e0).w(FUNC(williams_state::defender_video_control_w)); - map(0x0400, 0x04ff).mirror(0x0300).ram().w(FUNC(williams_state::williams_cmos_w)).share("nvram"); - map(0x0800, 0x0bff).r(FUNC(williams_state::williams_video_counter_r)); + map(0x03ff, 0x03ff).w(FUNC(defender_state::watchdog_reset_w)); + map(0x0010, 0x001f).mirror(0x03e0).w(FUNC(defender_state::video_control_w)); + map(0x0400, 0x04ff).mirror(0x0300).ram().w(FUNC(defender_state::cmos_w)).share("nvram"); + map(0x0800, 0x0bff).r(FUNC(defender_state::video_counter_r)); map(0x0c00, 0x0c03).mirror(0x03e0).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x0c04, 0x0c07).mirror(0x03e0).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x1000, 0x9fff).rom().region("maincpu", 0x10000); map(0xa000, 0xffff).noprw(); } +/************************************* + * + * Mayday memory handlers + * + *************************************/ + +void mayday_state::main_map(address_map &map) +{ + defender_state::main_map(map); + /* install a handler to catch protection checks */ + map(0xa190, 0xa191).r(FUNC(mayday_state::protection_r)); +} /************************************* @@ -551,18 +562,18 @@ void williams_state::defender_bankc000_map(address_map &map) * *************************************/ -void williams_state::williams_map(address_map &map) +void williams_state::base_map(address_map &map) { map(0x0000, 0x8fff).bankr("mainbank").writeonly().share("videoram"); map(0x9000, 0xbfff).ram(); map(0xc000, 0xc00f).mirror(0x03f0).writeonly().share("paletteram"); map(0xc804, 0xc807).mirror(0x00f0).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc80c, 0xc80f).mirror(0x00f0).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xc900, 0xc9ff).w(FUNC(williams_state::williams_vram_select_w)); - map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(williams_state::williams_blitter_w)); - map(0xcb00, 0xcbff).r(FUNC(williams_state::williams_video_counter_r)); - map(0xcbff, 0xcbff).w(FUNC(williams_state::williams_watchdog_reset_w)); - map(0xcc00, 0xcfff).ram().w(FUNC(williams_state::williams_cmos_w)).share("nvram"); + map(0xc900, 0xc9ff).w(FUNC(williams_state::vram_select_w)); + map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(williams_state::blitter_w)); + map(0xcb00, 0xcbff).r(FUNC(williams_state::video_counter_r)); + map(0xcbff, 0xcbff).w(FUNC(williams_state::watchdog_reset_w)); + map(0xcc00, 0xcfff).ram().w(FUNC(williams_state::cmos_w)).share("nvram"); map(0xd000, 0xffff).rom(); } @@ -574,23 +585,27 @@ void williams_state::williams_map(address_map &map) * *************************************/ -void williams_state::sinistar_map(address_map &map) +void sinistar_state::main_map(address_map &map) { - map(0x0000, 0x8fff).bankr("mainbank").writeonly().share("videoram"); - map(0x9000, 0xbfff).ram(); - map(0xc000, 0xc00f).mirror(0x03f0).writeonly().share("paletteram"); - map(0xc804, 0xc807).mirror(0x00f0).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xc80c, 0xc80f).mirror(0x00f0).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xc900, 0xc9ff).w(FUNC(williams_state::sinistar_vram_select_w)); - map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(williams_state::williams_blitter_w)); - map(0xcb00, 0xcbff).r(FUNC(williams_state::williams_video_counter_r)); - map(0xcbff, 0xcbff).w(FUNC(williams_state::williams_watchdog_reset_w)); - map(0xcc00, 0xcfff).ram().w(FUNC(williams_state::williams_cmos_w)).share("nvram"); + base_map(map); + map(0xc900, 0xc9ff).w(FUNC(sinistar_state::vram_select_w)); map(0xd000, 0xdfff).ram(); map(0xe000, 0xffff).rom(); } +/************************************* + * + * Bubbles memory handlers + * + *************************************/ + +void bubbles_state::main_map(address_map &map) +{ + base_map(map); + /* bubbles has a full 8-bit-wide CMOS */ + map(0xcc00, 0xcfff).w(FUNC(bubbles_state::cmos_w)).share("nvram"); +} /************************************* * @@ -598,9 +613,9 @@ void williams_state::sinistar_map(address_map &map) * *************************************/ -void spdball_state::spdball_map(address_map &map) +void spdball_state::main_map(address_map &map) { - williams_map(map); + base_map(map); /* install extra input handlers */ map(0xc800, 0xc800).portr("AN0"); map(0xc801, 0xc801).portr("AN1"); @@ -618,7 +633,7 @@ void spdball_state::spdball_map(address_map &map) * *************************************/ -void blaster_state::blaster_map(address_map &map) +void blaster_state::main_map(address_map &map) { map(0x0000, 0x3fff).bankr("mainbank").writeonly().share("videoram"); map(0x4000, 0x8fff).bankr("blaster_bankb").writeonly(); @@ -629,14 +644,14 @@ void blaster_state::blaster_map(address_map &map) map(0xc000, 0xc00f).mirror(0x03f0).writeonly().share("paletteram"); map(0xc804, 0xc807).mirror(0x00f0).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc80c, 0xc80f).mirror(0x00f0).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xc900, 0xc93f).w(FUNC(blaster_state::blaster_vram_select_w)); - map(0xc940, 0xc97f).w(FUNC(blaster_state::blaster_remap_select_w)); - map(0xc980, 0xc9bf).w(FUNC(blaster_state::blaster_bank_select_w)); - map(0xc9c0, 0xc9ff).w(FUNC(blaster_state::blaster_video_control_w)); - map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(blaster_state::williams_blitter_w)); - map(0xcb00, 0xcbff).r(FUNC(blaster_state::williams_video_counter_r)); - map(0xcbff, 0xcbff).w(FUNC(blaster_state::williams_watchdog_reset_w)); - map(0xcc00, 0xcfff).ram().w(FUNC(blaster_state::williams_cmos_w)).share("nvram"); + map(0xc900, 0xc93f).w(FUNC(blaster_state::vram_select_w)); + map(0xc940, 0xc97f).w(FUNC(blaster_state::remap_select_w)); + map(0xc980, 0xc9bf).w(FUNC(blaster_state::bank_select_w)); + map(0xc9c0, 0xc9ff).w(FUNC(blaster_state::video_control_w)); + map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(blaster_state::blitter_w)); + map(0xcb00, 0xcbff).r(FUNC(blaster_state::video_counter_r)); + map(0xcbff, 0xcbff).w(FUNC(blaster_state::watchdog_reset_w)); + map(0xcc00, 0xcfff).ram().w(FUNC(blaster_state::cmos_w)).share("nvram"); map(0xd000, 0xffff).rom(); } @@ -648,48 +663,48 @@ void blaster_state::blaster_map(address_map &map) * *************************************/ -void williams2_state::williams2_common_map(address_map &map) +void williams2_state::common_map(address_map &map) { map(0x0000, 0xbfff).ram().share("videoram"); map(0x0000, 0x7fff).bankr("mainbank"); map(0x8000, 0x87ff).m(m_bank8000, FUNC(address_map_bank_device::amap8)); - map(0xc000, 0xc7ff).ram().w(FUNC(williams2_state::williams2_tileram_w)).share("williams2_tile"); - map(0xc800, 0xc87f).w(FUNC(williams2_state::williams2_bank_select_w)); - map(0xc880, 0xc887).mirror(0x0078).w(FUNC(williams2_state::williams_blitter_w)); - map(0xc900, 0xc97f).w(FUNC(williams2_state::williams2_watchdog_reset_w)); + map(0xc000, 0xc7ff).ram().w(FUNC(williams2_state::tileram_w)).share("williams2_tile"); + map(0xc800, 0xc87f).w(FUNC(williams2_state::bank_select_w)); + map(0xc880, 0xc887).mirror(0x0078).w(FUNC(williams2_state::blitter_w)); + map(0xc900, 0xc97f).w(FUNC(williams2_state::watchdog_reset_w)); map(0xc980, 0xc983).mirror(0x0070).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc984, 0xc987).mirror(0x0070).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xc98c, 0xc98f).mirror(0x0070).w(FUNC(williams2_state::williams2_7segment_w)); - map(0xcb00, 0xcb1f).w(FUNC(williams2_state::williams2_fg_select_w)); - map(0xcb20, 0xcb3f).w(FUNC(williams2_state::williams2_bg_select_w)); - map(0xcb40, 0xcb5f).w(FUNC(williams2_state::williams2_xscroll_low_w)); - map(0xcb60, 0xcb7f).w(FUNC(williams2_state::williams2_xscroll_high_w)); - map(0xcb80, 0xcb9f).w(FUNC(williams2_state::defender_video_control_w)); - map(0xcba0, 0xcbbf).w(FUNC(williams2_state::williams2_blit_window_enable_w)); - map(0xcbe0, 0xcbef).r(FUNC(williams2_state::williams_video_counter_r)); - map(0xcc00, 0xcfff).ram().w(FUNC(williams2_state::williams_cmos_w)).share("nvram"); + map(0xc98c, 0xc98f).mirror(0x0070).w(FUNC(williams2_state::segments_w)); + map(0xcb00, 0xcb1f).w(FUNC(williams2_state::fg_select_w)); + map(0xcb20, 0xcb3f).w(FUNC(williams2_state::bg_select_w)); + map(0xcb40, 0xcb5f).w(FUNC(williams2_state::xscroll_low_w)); + map(0xcb60, 0xcb7f).w(FUNC(williams2_state::xscroll_high_w)); + map(0xcb80, 0xcb9f).w(FUNC(williams2_state::video_control_w)); + map(0xcba0, 0xcbbf).w(FUNC(williams2_state::blit_window_enable_w)); + map(0xcbe0, 0xcbef).r(FUNC(williams2_state::video_counter_r)); + map(0xcc00, 0xcfff).ram().w(FUNC(williams2_state::cmos_w)).share("nvram"); } -void williams2_state::williams2_bank8000_map(address_map &map) +void williams2_state::bank8000_map(address_map &map) { map(0x0000, 0x07ff).bankrw("vram8000"); - map(0x0800, 0x0fff).ram().w(FUNC(williams2_state::williams2_paletteram_w)).share("paletteram"); + map(0x0800, 0x0fff).ram().w(FUNC(williams2_state::paletteram_w)).share("paletteram"); } /* mysticm and inferno: D000-DFFF is RAM */ -void williams2_state::williams2_d000_ram_map(address_map &map) +void williams_d000_ram_state::d000_map(address_map &map) { - williams2_common_map(map); + common_map(map); map(0xd000, 0xdfff).ram(); map(0xe000, 0xffff).rom(); } /* tshoot and joust2: D000-DFFF is ROM */ -void williams2_state::williams2_d000_rom_map(address_map &map) +void williams_d000_rom_state::d000_map(address_map &map) { - williams2_common_map(map); + common_map(map); map(0xd000, 0xffff).rom(); } @@ -701,7 +716,7 @@ void williams2_state::williams2_d000_rom_map(address_map &map) * *************************************/ -void williams_state::defender_sound_map(address_map &map) +void defender_state::sound_map(address_map &map) { map(0x0000, 0x007f).ram(); /* internal RAM */ map(0x0400, 0x0403).mirror(0x8000).rw(m_pia[2], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); @@ -718,7 +733,7 @@ void williams_state::sound_map(address_map &map) } /* Same as above, but for second sound board */ -void blaster_state::sound_map_b(address_map &map) +void blaster_state::sound2_map(address_map &map) { map(0x0000, 0x007f).ram(); /* internal RAM */ map(0x0080, 0x00ff).ram(); /* MC6810 RAM */ @@ -734,7 +749,7 @@ void blaster_state::sound_map_b(address_map &map) * *************************************/ -void williams2_state::williams2_sound_map(address_map &map) +void williams2_state::sound_map(address_map &map) { map(0x0000, 0x007f).ram(); /* internal RAM */ map(0x0080, 0x00ff).ram(); /* MC6810 RAM */ @@ -1090,10 +1105,10 @@ static INPUT_PORTS_START( sinistar ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_START("49WAYX") /* converted by williams_49way_port_0_r() */ + PORT_START("49WAYX") /* converted by port_0_49way_r() */ PORT_BIT( 0xff, 0x38, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0x6f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) - PORT_START("49WAYY") /* converted by williams_49way_port_0_r() */ + PORT_START("49WAYY") /* converted by port_0_49way_r() */ PORT_BIT( 0xff, 0x38, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0x6f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE INPUT_PORTS_END @@ -1152,10 +1167,10 @@ static INPUT_PORTS_START( blaster ) PORT_START("INP2") PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_START("49WAYX") /* converted by williams_49way_port_0_r() */ + PORT_START("49WAYX") /* converted by port_0_49way_r() */ PORT_BIT( 0xff, 0x38, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0x6f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) - PORT_START("49WAYY") /* converted by williams_49way_port_0_r() */ + PORT_START("49WAYY") /* converted by port_0_49way_r() */ PORT_BIT( 0xff, 0x38, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0x6f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE INPUT_PORTS_END @@ -1178,10 +1193,10 @@ static INPUT_PORTS_START( blastkit ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_START("49WAYX") /* converted by williams_49way_port_0_r() */ + PORT_START("49WAYX") /* converted by port_0_49way_r() */ PORT_BIT( 0xff, 0x38, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0x6f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) - PORT_START("49WAYY") /* converted by williams_49way_port_0_r() */ + PORT_START("49WAYY") /* converted by port_0_49way_r() */ PORT_BIT( 0xff, 0x38, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0x6f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_START("IN3") @@ -1489,23 +1504,22 @@ GFXDECODE_END * *************************************/ -void williams_state::williams(machine_config &config) +void williams_state::williams_base(machine_config &config) { /* basic machine hardware */ MC6809E(config, m_maincpu, MASTER_CLOCK/3/4); - m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::williams_map); + m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::base_map); M6808(config, m_soundcpu, SOUND_CLOCK); // internal clock divider of 4, effective frequency is 894.886kHz m_soundcpu->set_addrmap(AS_PROGRAM, &williams_state::sound_map); - MCFG_MACHINE_START_OVERRIDE(williams_state,williams) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 5101 (Defender), 5114 or 6514 (later games) + battery // set a timer to go off every 32 scanlines, to toggle the VA11 line and update the screen - TIMER(config, "scan_timer").configure_scanline(FUNC(williams_state::williams_va11_callback), "screen", 0, 32); + TIMER(config, "scan_timer").configure_scanline(FUNC(williams_state::va11_callback), "screen", 0, 32); // also set a timer to go off on scanline 240 - TIMER(config, "240_timer").configure_scanline(FUNC(williams_state::williams_count240_callback), "screen", 0, 240); + TIMER(config, "240_timer").configure_scanline(FUNC(williams_state::count240_callback), "screen", 0, 240); WATCHDOG_TIMER(config, m_watchdog); @@ -1513,11 +1527,9 @@ void williams_state::williams(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE); m_screen->set_raw(MASTER_CLOCK*2/3, 512, 6, 298, 260, 7, 247); - m_screen->set_screen_update(FUNC(williams_state::screen_update_williams)); - - MCFG_VIDEO_START_OVERRIDE(williams_state,williams) + m_screen->set_screen_update(FUNC(williams_state::screen_update)); - PALETTE(config, m_palette, FUNC(williams_state::williams_palette), 256); + PALETTE(config, m_palette, FUNC(williams_state::palette_init), 256); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -1537,7 +1549,7 @@ void williams_state::williams(machine_config &config) PIA6821(config, m_pia[1], 0); m_pia[1]->readpa_handler().set_ioport("IN2"); - m_pia[1]->writepb_handler().set(FUNC(williams_state::williams_snd_cmd_w)); + m_pia[1]->writepb_handler().set(FUNC(williams_state::snd_cmd_w)); m_pia[1]->irqa_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<0>)); m_pia[1]->irqb_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<1>)); @@ -1548,26 +1560,22 @@ void williams_state::williams(machine_config &config) } -void williams_state::defender(machine_config &config) +void defender_state::defender(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::defender_map); - - m_soundcpu->set_addrmap(AS_PROGRAM, &williams_state::defender_sound_map); - - ADDRESS_MAP_BANK(config, "bankc000").set_map(&williams_state::defender_bankc000_map).set_options(ENDIANNESS_BIG, 8, 16, 0x1000); + m_maincpu->set_addrmap(AS_PROGRAM, &defender_state::main_map); + m_soundcpu->set_addrmap(AS_PROGRAM, &defender_state::sound_map); - MCFG_MACHINE_START_OVERRIDE(williams_state,defender) - MCFG_MACHINE_RESET_OVERRIDE(williams_state,defender) + ADDRESS_MAP_BANK(config, m_bankc000).set_map(&defender_state::bankc000_map).set_options(ENDIANNESS_BIG, 8, 16, 0x1000); m_screen->set_visarea(12, 304-1, 7, 247-1); } -void williams_state::jin(machine_config &config) // needs a different screen size or the credit text is clipped +void defender_state::jin(machine_config &config) // needs a different screen size or the credit text is clipped { defender(config); /* basic machine hardware */ @@ -1575,9 +1583,9 @@ void williams_state::jin(machine_config &config) // needs a different screen si } -void williams_state::williams_muxed(machine_config &config) +void williams_muxed_state::williams_muxed(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ @@ -1602,10 +1610,10 @@ void williams_state::williams_muxed(machine_config &config) void spdball_state::spdball(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &spdball_state::spdball_map); + m_maincpu->set_addrmap(AS_PROGRAM, &spdball_state::main_map); /* pia */ PIA6821(config, m_pia[3], 0); @@ -1616,7 +1624,7 @@ void spdball_state::spdball(machine_config &config) void williams_state::lottofun(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ @@ -1628,27 +1636,36 @@ void williams_state::lottofun(machine_config &config) } -void williams_state::sinistar(machine_config &config) +void sinistar_state::sinistar(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::sinistar_map); + m_maincpu->set_addrmap(AS_PROGRAM, &sinistar_state::main_map); /* sound hardware */ HC55516(config, "cvsd", 0).add_route(ALL_OUTPUTS, "speaker", 0.8); /* pia */ - m_pia[0]->readpa_handler().set(FUNC(williams_state::williams_49way_port_0_r)); + m_pia[0]->readpa_handler().set(FUNC(williams_state::port_0_49way_r)); m_pia[2]->ca2_handler().set("cvsd", FUNC(hc55516_device::digit_w)); m_pia[2]->cb2_handler().set("cvsd", FUNC(hc55516_device::clock_w)); } -void williams_state::playball(machine_config &config) +void bubbles_state::bubbles(machine_config &config) // has a full 8-bit NVRAM equipped +{ + williams_base(config); + + /* basic machine hardware */ + m_maincpu->set_addrmap(AS_PROGRAM, &bubbles_state::main_map); +} + + +void playball_state::playball(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ @@ -1659,7 +1676,7 @@ void williams_state::playball(machine_config &config) HC55516(config, "cvsd", 0).add_route(ALL_OUTPUTS, "speaker", 0.8); /* pia */ - m_pia[1]->writepb_handler().set(FUNC(williams_state::playball_snd_cmd_w)); + m_pia[1]->writepb_handler().set(FUNC(playball_state::snd_cmd_w)); m_pia[2]->ca2_handler().set("cvsd", FUNC(hc55516_device::digit_w)); m_pia[2]->cb2_handler().set("cvsd", FUNC(hc55516_device::clock_w)); @@ -1668,16 +1685,13 @@ void williams_state::playball(machine_config &config) void blaster_state::blastkit(machine_config &config) { - williams(config); + williams_base(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &blaster_state::blaster_map); - - MCFG_MACHINE_START_OVERRIDE(blaster_state,blaster) + m_maincpu->set_addrmap(AS_PROGRAM, &blaster_state::main_map); /* video hardware */ - MCFG_VIDEO_START_OVERRIDE(blaster_state,blaster) - m_screen->set_screen_update(FUNC(blaster_state::screen_update_blaster)); + m_screen->set_screen_update(FUNC(blaster_state::screen_update)); /* pia */ m_pia[0]->readpa_handler().set("mux_a", FUNC(ls157_x2_device::output_r)); @@ -1687,7 +1701,7 @@ void blaster_state::blastkit(machine_config &config) LS157_X2(config, m_muxa, 0); m_muxa->a_in_callback().set_ioport("IN3"); - m_muxa->b_in_callback().set(FUNC(williams_state::williams_49way_port_0_r)); + m_muxa->b_in_callback().set(FUNC(williams_state::port_0_49way_r)); } @@ -1697,7 +1711,7 @@ void blaster_state::blaster(machine_config &config) /* basic machine hardware */ M6808(config, m_soundcpu_b, SOUND_CLOCK); // internal clock divider of 4, effective frequency is 894.886kHz - m_soundcpu_b->set_addrmap(AS_PROGRAM, &blaster_state::sound_map_b); + m_soundcpu_b->set_addrmap(AS_PROGRAM, &blaster_state::sound2_map); /* pia */ m_pia[0]->readpb_handler().set("mux_b", FUNC(ls157_device::output_r)).mask(0x0f); @@ -1706,7 +1720,7 @@ void blaster_state::blaster(machine_config &config) m_pia[0]->cb2_handler().append("mux_b", FUNC(ls157_device::select_w)); // IC7 (for PA0-PA3) + IC5 (for PA4-PA7) - m_muxa->a_in_callback().set(FUNC(williams_state::williams_49way_port_0_r)); + m_muxa->a_in_callback().set(FUNC(williams_state::port_0_49way_r)); m_muxa->b_in_callback().set_ioport("IN3"); LS157(config, m_muxb, 0); // IC3 @@ -1715,7 +1729,7 @@ void blaster_state::blaster(machine_config &config) INPUT_MERGER_ANY_HIGH(config, "soundirq_b").output_handler().set_inputline(m_soundcpu_b, M6808_IRQ_LINE); - m_pia[1]->writepb_handler().set(FUNC(blaster_state::blaster_snd_cmd_w)); + m_pia[1]->writepb_handler().set(FUNC(blaster_state::snd_cmd_w)); m_pia[2]->writepa_handler().set("ldac", FUNC(dac_byte_interface::data_w)); @@ -1739,26 +1753,23 @@ void blaster_state::blaster(machine_config &config) } -void williams2_state::williams2(machine_config &config) +void williams2_state::williams2_base(machine_config &config) { /* basic machine hardware */ MC6809E(config, m_maincpu, MASTER_CLOCK/3/4); - m_maincpu->set_addrmap(AS_PROGRAM, &williams2_state::williams2_d000_ram_map); M6808(config, m_soundcpu, MASTER_CLOCK/3); /* yes, this is different from the older games */ - m_soundcpu->set_addrmap(AS_PROGRAM, &williams2_state::williams2_sound_map); + m_soundcpu->set_addrmap(AS_PROGRAM, &williams2_state::sound_map); - ADDRESS_MAP_BANK(config, "bank8000").set_map(&williams2_state::williams2_bank8000_map).set_options(ENDIANNESS_BIG, 8, 12, 0x800); + ADDRESS_MAP_BANK(config, "bank8000").set_map(&williams2_state::bank8000_map).set_options(ENDIANNESS_BIG, 8, 12, 0x800); - MCFG_MACHINE_START_OVERRIDE(williams2_state,williams2) - MCFG_MACHINE_RESET_OVERRIDE(williams2_state,williams2) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 5114 + battery // set a timer to go off every 32 scanlines, to toggle the VA11 line and update the screen - TIMER(config, "scan_timer").configure_scanline(FUNC(williams2_state::williams2_va11_callback), "screen", 0, 32); + TIMER(config, "scan_timer").configure_scanline(FUNC(williams2_state::va11_callback), "screen", 0, 32); // also set a timer to go off on scanline 254 - TIMER(config, "254_timer").configure_scanline(FUNC(williams2_state::williams2_endscreen_callback), "screen", 8, 246); + TIMER(config, "254_timer").configure_scanline(FUNC(williams2_state::endscreen_callback), "screen", 8, 246); WATCHDOG_TIMER(config, m_watchdog); @@ -1769,9 +1780,7 @@ void williams2_state::williams2(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE); m_screen->set_raw(MASTER_CLOCK*2/3, 512, 8, 284, 260, 8, 248); - m_screen->set_screen_update(FUNC(williams2_state::screen_update_williams2)); - - MCFG_VIDEO_START_OVERRIDE(williams2_state,williams2) + m_screen->set_screen_update(FUNC(williams2_state::screen_update)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -1780,18 +1789,17 @@ void williams2_state::williams2(machine_config &config) vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); - /* pia */ INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); - INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_soundcpu, M6808_IRQ_LINE); + /* pia */ PIA6821(config, m_pia[0], 0); m_pia[0]->readpa_handler().set_ioport("IN0"); m_pia[0]->readpb_handler().set_ioport("IN1"); PIA6821(config, m_pia[1], 0); m_pia[1]->readpa_handler().set_ioport("IN2"); - m_pia[1]->writepb_handler().set(FUNC(williams2_state::williams2_snd_cmd_w)); + m_pia[1]->writepb_handler().set(FUNC(williams2_state::snd_cmd_w)); m_pia[1]->cb2_handler().set(m_pia[2], FUNC(pia6821_device::ca1_w)); m_pia[1]->irqa_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<0>)); m_pia[1]->irqb_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<1>)); @@ -1805,9 +1813,12 @@ void williams2_state::williams2(machine_config &config) } -void williams2_state::inferno(machine_config &config) +void inferno_state::inferno(machine_config &config) { - williams2(config); + williams2_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &inferno_state::d000_map); + + /* pia */ m_pia[0]->readpa_handler().set("mux", FUNC(ls157_x2_device::output_r)); m_pia[0]->ca2_handler().set("mux", FUNC(ls157_x2_device::select_w)); @@ -1816,12 +1827,10 @@ void williams2_state::inferno(machine_config &config) m_mux->b_in_callback().set_ioport("INP2"); } - -void williams2_state::mysticm(machine_config &config) +void mysticm_state::mysticm(machine_config &config) { - williams2(config); - - /* basic machine hardware */ + williams2_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &mysticm_state::d000_map); /* pia */ m_pia[0]->irqa_handler().set_inputline("maincpu", M6809_FIRQ_LINE); @@ -1834,12 +1843,10 @@ void williams2_state::mysticm(machine_config &config) void tshoot_state::tshoot(machine_config &config) { - williams2(config); + williams2_base(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &tshoot_state::williams2_d000_rom_map); - - MCFG_MACHINE_START_OVERRIDE(tshoot_state,tshoot) + m_maincpu->set_addrmap(AS_PROGRAM, &tshoot_state::d000_map); /* pia */ m_pia[0]->readpa_handler().set("mux", FUNC(ls157_x2_device::output_r)); @@ -1861,24 +1868,21 @@ void tshoot_state::tshoot(machine_config &config) void joust2_state::joust2(machine_config &config) { - williams2(config); + williams2_base(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &joust2_state::williams2_d000_rom_map); + m_maincpu->set_addrmap(AS_PROGRAM, &joust2_state::d000_map); WILLIAMS_CVSD_SOUND(config, m_cvsd_sound).add_route(ALL_OUTPUTS, "speaker", 1.0); - MCFG_MACHINE_START_OVERRIDE(joust2_state,joust2) - MCFG_MACHINE_RESET_OVERRIDE(joust2_state,joust2) - /* pia */ m_pia[0]->readpa_handler().set_ioport("IN0").mask(0xf0); m_pia[0]->readpa_handler().append("mux", FUNC(ls157_device::output_r)).mask(0x0f); m_pia[0]->ca2_handler().set("mux", FUNC(ls157_device::select_w)); m_pia[1]->readpa_handler().set_ioport("IN2"); - m_pia[1]->writepb_handler().set(FUNC(joust2_state::joust2_snd_cmd_w)); - m_pia[1]->ca2_handler().set(FUNC(joust2_state::joust2_pia_3_cb1_w)); + m_pia[1]->writepb_handler().set(FUNC(joust2_state::snd_cmd_w)); + m_pia[1]->ca2_handler().set(FUNC(joust2_state::pia_3_cb1_w)); m_pia[1]->cb2_handler().set(m_pia[2], FUNC(pia6821_device::ca1_w)); m_pia[1]->irqa_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<0>)); m_pia[1]->irqb_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<1>)); @@ -3151,35 +3155,22 @@ ROM_END /************************************* * - * Configuration macros - * - *************************************/ - -#define CONFIGURE_BLITTER(x,c) \ - m_blitter_config = x; \ - m_blitter_clip_address = c - -#define CONFIGURE_TILEMAP(x) \ - m_williams2_tilemap_config = x - - - -/************************************* - * * Defender hardware driver init * *************************************/ -void williams_state::init_defender() +void defender_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); + m_blitter_config = WILLIAMS_BLITTER_NONE; + m_blitter_clip_address = 0x0000; } -void williams_state::init_defndjeu() +void defndjeu_state::driver_init() { uint8_t *rom = memregion("maincpu")->base(); - CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); + m_blitter_config = WILLIAMS_BLITTER_NONE; + m_blitter_clip_address = 0x0000; /* apply simple decryption by swapping bits 0 and 7 */ for (int i = 0xd000; i < 0x19000; i++) @@ -3187,13 +3178,11 @@ void williams_state::init_defndjeu() } -void williams_state::init_mayday() +void mayday_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); - - /* install a handler to catch protection checks */ - m_maincpu->space(AS_PROGRAM).install_read_handler(0xa190, 0xa191, read8sm_delegate(*this, FUNC(williams_state::mayday_protection_r))); - m_mayday_protection = m_videoram + 0xa190; + m_blitter_config = WILLIAMS_BLITTER_NONE; + m_blitter_clip_address = 0x0000; + m_protection = m_videoram + 0xa190; } @@ -3206,78 +3195,87 @@ void williams_state::init_mayday() void williams_state::init_stargate() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); + m_blitter_config = WILLIAMS_BLITTER_NONE; + m_blitter_clip_address = 0x0000; } void williams_state::init_robotron() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; } -void williams_state::init_joust() +void williams_muxed_state::init_joust() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; } -void williams_state::init_bubbles() +void bubbles_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); - - /* bubbles has a full 8-bit-wide CMOS */ - m_maincpu->space(AS_PROGRAM).install_write_handler(0xcc00, 0xcfff, write8sm_delegate(*this, FUNC(williams_state::bubbles_cmos_w))); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; } -void williams_state::init_splat() +void williams_muxed_state::init_splat() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC2, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC2; + m_blitter_clip_address = 0xc000; } -void williams_state::init_sinistar() +void sinistar_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0x7400); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0x7400; } -void williams_state::init_playball() +void playball_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; } -void blaster_state::init_blaster() +void blaster_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC2, 0x9700); + m_blitter_config = WILLIAMS_BLITTER_SC2; + m_blitter_clip_address = 0x9700; } void spdball_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; } -void williams_state::init_alienar() +void williams_muxed_state::init_alienar() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; m_maincpu->space(AS_PROGRAM).nop_write(0xcbff, 0xcbff); } -void williams_state::init_alienaru() +void williams_muxed_state::init_alienaru() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; m_maincpu->space(AS_PROGRAM).nop_write(0xcbff, 0xcbff); } void williams_state::init_lottofun() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC1, 0xc000); + m_blitter_config = WILLIAMS_BLITTER_SC1; + m_blitter_clip_address = 0xc000; } @@ -3288,31 +3286,31 @@ void williams_state::init_lottofun() * *************************************/ -void williams2_state::init_mysticm() +void mysticm_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC2, 0x9000); - CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_MYSTICM); + m_blitter_config = WILLIAMS_BLITTER_SC2; + m_blitter_clip_address = 0x9000; } -void williams2_state::init_tshoot() +void tshoot_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC2, 0x9000); - CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT); + m_blitter_config = WILLIAMS_BLITTER_SC2; + m_blitter_clip_address = 0x9000; } -void williams2_state::init_inferno() +void inferno_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC2, 0x9000); - CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT); + m_blitter_config = WILLIAMS_BLITTER_SC2; + m_blitter_clip_address = 0x9000; } -void joust2_state::init_joust2() +void joust2_state::driver_init() { - CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC2, 0x9000); - CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_JOUST2); + m_blitter_config = WILLIAMS_BLITTER_SC2; + m_blitter_clip_address = 0x9000; } @@ -3324,80 +3322,80 @@ void joust2_state::init_joust2() *************************************/ /* Defender hardware games */ -GAME( 1980, defender, 0, defender, defender, williams_state, init_defender, ROT0, "Williams", "Defender (Red label)", MACHINE_SUPPORTS_SAVE ) // developers left Williams in 1981 and formed Vid Kidz -GAME( 1980, defenderg, defender, defender, defender, williams_state, init_defender, ROT0, "Williams", "Defender (Green label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, defenderb, defender, defender, defender, williams_state, init_defender, ROT0, "Williams", "Defender (Blue label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, defenderw, defender, defender, defender, williams_state, init_defender, ROT0, "Williams", "Defender (White label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, defenderj, defender, defender, defender, williams_state, init_defender, ROT0, "Williams (Taito Corporation license)", "T.T Defender", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, defndjeu, defender, defender, defender, williams_state, init_defndjeu, ROT0, "bootleg (Jeutel)", "Defender (bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1980, tornado1, defender, defender, defender, williams_state, init_defndjeu, ROT0, "bootleg (Jeutel)", "Tornado (set 1, Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, tornado2, defender, defender, defender, williams_state, init_defndjeu, ROT0, "bootleg (Jeutel)", "Tornado (set 2, Defender bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump? -GAME( 1980, zero, defender, defender, defender, williams_state, init_defndjeu, ROT0, "bootleg (Jeutel)", "Zero (set 1, Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, zero2, defender, defender, defender, williams_state, init_defndjeu, ROT0, "bootleg (Amtec)", "Zero (set 2, Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, defcmnd, defender, defender, defender, williams_state, init_defender, ROT0, "bootleg", "Defense Command (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, defence, defender, defender, defender, williams_state, init_defender, ROT0, "bootleg (Outer Limits)", "Defence Command (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, startrkd, defender, defender, defender, williams_state, init_defender, ROT0, "bootleg", "Star Trek (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, attackf, defender, defender, defender, williams_state, init_defender, ROT0, "bootleg (FAMARE S.A.)", "Attack (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, galwars2, defender, defender, defender, williams_state, init_defender, ROT0, "bootleg (Sonic)", "Galaxy Wars II (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) // Sega Sonic - Sega S.A., only displays Sonic on title screen - -GAME( 1980, mayday, 0, defender, mayday, williams_state, init_mayday, ROT0, "Hoei", "Mayday (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // \ original by Hoei, which one of these 3 sets is bootleg/licensed/original is unknown -GAME( 1980, maydaya, mayday, defender, mayday, williams_state, init_mayday, ROT0, "Hoei", "Mayday (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // > these games have an unemulated protection chip of some sort which is hacked around in /machine/williams.cpp "mayday_protection_r" function -GAME( 1980, maydayb, mayday, defender, mayday, williams_state, init_mayday, ROT0, "Hoei", "Mayday (set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // / -GAME( 1980, batlzone, mayday, defender, mayday, williams_state, init_mayday, ROT0, "bootleg (Video Game)", "Battle Zone (bootleg of Mayday)", MACHINE_SUPPORTS_SAVE )// the bootleg may or may not use the same protection chip, or some hack around it. - -GAME( 1981, colony7, 0, defender, colony7, williams_state, init_defender, ROT270, "Taito", "Colony 7 (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, colony7a, colony7, defender, colony7, williams_state, init_defender, ROT270, "Taito", "Colony 7 (set 2)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1982, jin, 0, jin, jin, williams_state, init_defender, ROT90, "Falcon", "Jin", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, defender, 0, defender, defender, defender_state, empty_init, ROT0, "Williams", "Defender (Red label)", MACHINE_SUPPORTS_SAVE ) // developers left Williams in 1981 and formed Vid Kidz +GAME( 1980, defenderg, defender, defender, defender, defender_state, empty_init, ROT0, "Williams", "Defender (Green label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, defenderb, defender, defender, defender, defender_state, empty_init, ROT0, "Williams", "Defender (Blue label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, defenderw, defender, defender, defender, defender_state, empty_init, ROT0, "Williams", "Defender (White label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, defenderj, defender, defender, defender, defender_state, empty_init, ROT0, "Williams (Taito Corporation license)", "T.T Defender", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, defndjeu, defender, defender, defender, defndjeu_state, empty_init, ROT0, "bootleg (Jeutel)", "Defender (bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, tornado1, defender, defender, defender, defndjeu_state, empty_init, ROT0, "bootleg (Jeutel)", "Tornado (set 1, Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, tornado2, defender, defender, defender, defndjeu_state, empty_init, ROT0, "bootleg (Jeutel)", "Tornado (set 2, Defender bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump? +GAME( 1980, zero, defender, defender, defender, defndjeu_state, empty_init, ROT0, "bootleg (Jeutel)", "Zero (set 1, Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, zero2, defender, defender, defender, defndjeu_state, empty_init, ROT0, "bootleg (Amtec)", "Zero (set 2, Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, defcmnd, defender, defender, defender, defender_state, empty_init, ROT0, "bootleg", "Defense Command (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, defence, defender, defender, defender, defender_state, empty_init, ROT0, "bootleg (Outer Limits)", "Defence Command (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, startrkd, defender, defender, defender, defender_state, empty_init, ROT0, "bootleg", "Star Trek (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, attackf, defender, defender, defender, defender_state, empty_init, ROT0, "bootleg (FAMARE S.A.)", "Attack (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, galwars2, defender, defender, defender, defender_state, empty_init, ROT0, "bootleg (Sonic)", "Galaxy Wars II (Defender bootleg)", MACHINE_SUPPORTS_SAVE ) // Sega Sonic - Sega S.A., only displays Sonic on title screen + +GAME( 1980, mayday, 0, defender, mayday, mayday_state, empty_init, ROT0, "Hoei", "Mayday (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // \ original by Hoei, which one of these 3 sets is bootleg/licensed/original is unknown +GAME( 1980, maydaya, mayday, defender, mayday, mayday_state, empty_init, ROT0, "Hoei", "Mayday (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // > these games have an unemulated protection chip of some sort which is hacked around in /machine/williams.cpp "protection_r" function +GAME( 1980, maydayb, mayday, defender, mayday, mayday_state, empty_init, ROT0, "Hoei", "Mayday (set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // / +GAME( 1980, batlzone, mayday, defender, mayday, mayday_state, empty_init, ROT0, "bootleg (Video Game)", "Battle Zone (bootleg of Mayday)", MACHINE_SUPPORTS_SAVE )// the bootleg may or may not use the same protection chip, or some hack around it. + +GAME( 1981, colony7, 0, defender, colony7, defender_state, empty_init, ROT270, "Taito", "Colony 7 (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, colony7a, colony7, defender, colony7, defender_state, empty_init, ROT270, "Taito", "Colony 7 (set 2)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1982, jin, 0, jin, jin, defender_state, empty_init, ROT90, "Falcon", "Jin", MACHINE_SUPPORTS_SAVE ) /* Standard Williams hardware */ -GAME( 1981, stargate, 0, williams, stargate, williams_state, init_stargate, ROT0, "Williams / Vid Kidz", "Stargate", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, stargate, 0, williams_base, stargate, williams_state, init_stargate, ROT0, "Williams / Vid Kidz", "Stargate", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, robotron, 0, williams, robotron, williams_state, init_robotron, ROT0, "Williams / Vid Kidz", "Robotron: 2084 (Solid Blue label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, robotronyo, robotron, williams, robotron, williams_state, init_robotron, ROT0, "Williams / Vid Kidz", "Robotron: 2084 (Yellow/Orange label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, robotron, 0, williams_base, robotron, williams_state, init_robotron, ROT0, "Williams / Vid Kidz", "Robotron: 2084 (Solid Blue label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, robotronyo, robotron, williams_base, robotron, williams_state, init_robotron, ROT0, "Williams / Vid Kidz", "Robotron: 2084 (Yellow/Orange label)", MACHINE_SUPPORTS_SAVE ) // the 3 below are all noteworthy hacks of the Solid BLue set -GAME( 1987, robotron87, robotron, williams, robotron, williams_state, init_robotron, ROT0, "hack", "Robotron: 2084 (1987 'shot-in-the-corner' bugfix)", MACHINE_SUPPORTS_SAVE ) // fixes a reset bug. -GAME( 2012, robotron12, robotron, williams, robotron, williams_state, init_robotron, ROT0, "hack", "Robotron: 2084 (2012 'wave 201 start' hack)", MACHINE_SUPPORTS_SAVE ) // includes sitc bug fix, used for competitive play. -GAME( 2015, robotrontd, robotron, williams, robotron, williams_state, init_robotron, ROT0, "hack", "Robotron: 2084 (2015 'tie-die V2' hack)", MACHINE_SUPPORTS_SAVE ) // inc. sitc fix, mods by some of the original developers, see backstory here http://www.robotron2084guidebook.com/gameplay/raceto100million/robo2k14_tie-die-romset/ (I guess there's a tie-die V1 before it was released to the public?) +GAME( 1987, robotron87, robotron, williams_base, robotron, williams_state, init_robotron, ROT0, "hack", "Robotron: 2084 (1987 'shot-in-the-corner' bugfix)", MACHINE_SUPPORTS_SAVE ) // fixes a reset bug. +GAME( 2012, robotron12, robotron, williams_base, robotron, williams_state, init_robotron, ROT0, "hack", "Robotron: 2084 (2012 'wave 201 start' hack)", MACHINE_SUPPORTS_SAVE ) // includes sitc bug fix, used for competitive play. +GAME( 2015, robotrontd, robotron, williams_base, robotron, williams_state, init_robotron, ROT0, "hack", "Robotron: 2084 (2015 'tie-die V2' hack)", MACHINE_SUPPORTS_SAVE ) // inc. sitc fix, mods by some of the original developers, see backstory here http://www.robotron2084guidebook.com/gameplay/raceto100million/robo2k14_tie-die-romset/ (I guess there's a tie-die V1 before it was released to the public?) -GAME( 1982, joust, 0, williams_muxed, joust, williams_state, init_joust, ROT0, "Williams", "Joust (White/Green label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, joustr, joust, williams_muxed, joust, williams_state, init_joust, ROT0, "Williams", "Joust (Solid Red label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, joustwr, joust, williams_muxed, joust, williams_state, init_joust, ROT0, "Williams", "Joust (White/Red label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, joust, 0, williams_muxed, joust, williams_muxed_state, init_joust, ROT0, "Williams", "Joust (White/Green label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, joustr, joust, williams_muxed, joust, williams_muxed_state, init_joust, ROT0, "Williams", "Joust (Solid Red label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, joustwr, joust, williams_muxed, joust, williams_muxed_state, init_joust, ROT0, "Williams", "Joust (White/Red label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, bubbles, 0, williams, bubbles, williams_state, init_bubbles, ROT0, "Williams", "Bubbles", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, bubblesr, bubbles, williams, bubbles, williams_state, init_bubbles, ROT0, "Williams", "Bubbles (Solid Red label)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, bubblesp, bubbles, williams, bubbles, williams_state, init_bubbles, ROT0, "Williams", "Bubbles (prototype version)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, bubbles, 0, bubbles, bubbles, bubbles_state, empty_init, ROT0, "Williams", "Bubbles", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, bubblesr, bubbles, bubbles, bubbles, bubbles_state, empty_init, ROT0, "Williams", "Bubbles (Solid Red label)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, bubblesp, bubbles, bubbles, bubbles, bubbles_state, empty_init, ROT0, "Williams", "Bubbles (prototype version)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, splat, 0, williams_muxed, splat, williams_state, init_splat, ROT0, "Williams", "Splat!", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, splat, 0, williams_muxed, splat, williams_muxed_state, init_splat, ROT0, "Williams", "Splat!", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, sinistar, 0, sinistar, sinistar, williams_state, init_sinistar, ROT270, "Williams", "Sinistar (revision 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, sinistar1, sinistar, sinistar, sinistar, williams_state, init_sinistar, ROT270, "Williams", "Sinistar (prototype version)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, sinistar2, sinistar, sinistar, sinistar, williams_state, init_sinistar, ROT270, "Williams", "Sinistar (revision 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, sinistar, 0, sinistar, sinistar, sinistar_state, empty_init, ROT270, "Williams", "Sinistar (revision 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, sinistar1, sinistar, sinistar, sinistar, sinistar_state, empty_init, ROT270, "Williams", "Sinistar (prototype version)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, sinistar2, sinistar, sinistar, sinistar, sinistar_state, empty_init, ROT270, "Williams", "Sinistar (revision 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, playball, 0, playball, playball, williams_state, init_playball, ROT270, "Williams", "PlayBall! (prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, playball, 0, playball, playball, playball_state, empty_init, ROT270, "Williams", "PlayBall! (prototype)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, blaster, 0, blaster, blaster, blaster_state, init_blaster, ROT0, "Williams / Vid Kidz", "Blaster", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, blastero, blaster, blaster, blaster, blaster_state, init_blaster, ROT0, "Williams / Vid Kidz", "Blaster (location test)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, blasterkit, blaster, blastkit, blastkit, blaster_state, init_blaster, ROT0, "Williams / Vid Kidz", "Blaster (conversion kit)", MACHINE_SUPPORTS_SAVE ) // mono sound +GAME( 1983, blaster, 0, blaster, blaster, blaster_state, empty_init, ROT0, "Williams / Vid Kidz", "Blaster", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, blastero, blaster, blaster, blaster, blaster_state, empty_init, ROT0, "Williams / Vid Kidz", "Blaster (location test)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, blasterkit, blaster, blastkit, blastkit, blaster_state, empty_init, ROT0, "Williams / Vid Kidz", "Blaster (conversion kit)", MACHINE_SUPPORTS_SAVE ) // mono sound -GAME( 1985, spdball, 0, spdball, spdball, spdball_state, driver_init, ROT0, "Williams", "Speed Ball - Contest at Neonworld (prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, spdball, 0, spdball, spdball, spdball_state, empty_init, ROT0, "Williams", "Speed Ball - Contest at Neonworld (prototype)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, alienar, 0, williams_muxed, alienar, williams_state, init_alienar, ROT0, "Duncan Brown", "Alien Arena", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, alienaru, alienar, williams_muxed, alienar, williams_state, init_alienaru, ROT0, "Duncan Brown", "Alien Arena (Stargate upgrade)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, alienar, 0, williams_muxed, alienar, williams_muxed_state, init_alienar, ROT0, "Duncan Brown", "Alien Arena", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, alienaru, alienar, williams_muxed, alienar, williams_muxed_state, init_alienaru, ROT0, "Duncan Brown", "Alien Arena (Stargate upgrade)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, lottofun, 0, lottofun, lottofun, williams_state, init_lottofun, ROT0, "H.A.R. Management", "Lotto Fun", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, lottofun, 0, lottofun, lottofun, williams_state, init_lottofun, ROT0, "H.A.R. Management", "Lotto Fun", MACHINE_SUPPORTS_SAVE ) /* 2nd Generation Williams hardware with tilemaps */ -GAME( 1983, mysticm, 0, mysticm, mysticm, williams2_state, init_mysticm, ROT0, "Williams", "Mystic Marathon", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE) -GAME( 1983, mysticmp, mysticm, mysticm, mysticm, williams2_state, init_mysticm, ROT0, "Williams", "Mystic Marathon (prototype)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // newest roms are 'proto 6' ? +GAME( 1983, mysticm, 0, mysticm, mysticm, mysticm_state, empty_init, ROT0, "Williams", "Mystic Marathon", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE) +GAME( 1983, mysticmp, mysticm, mysticm, mysticm, mysticm_state, empty_init, ROT0, "Williams", "Mystic Marathon (prototype)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // newest roms are 'proto 6' ? -GAME( 1984, tshoot, 0, tshoot, tshoot, tshoot_state, init_tshoot, ROT0, "Williams", "Turkey Shoot (prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, tshoot, 0, tshoot, tshoot, tshoot_state, empty_init, ROT0, "Williams", "Turkey Shoot (prototype)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, inferno, 0, inferno, inferno, williams2_state, init_inferno, ROT0, "Williams", "Inferno (Williams)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, inferno, 0, inferno, inferno, inferno_state, empty_init, ROT0, "Williams", "Inferno (Williams)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, joust2, 0, joust2, joust2, joust2_state, init_joust2, ROT270, "Williams", "Joust 2 - Survival of the Fittest (revision 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, joust2r1, joust2, joust2, joust2, joust2_state, init_joust2, ROT270, "Williams", "Joust 2 - Survival of the Fittest (revision 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, joust2, 0, joust2, joust2, joust2_state, empty_init, ROT270, "Williams", "Joust 2 - Survival of the Fittest (revision 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, joust2r1, joust2, joust2, joust2, joust2_state, empty_init, ROT270, "Williams", "Joust 2 - Survival of the Fittest (revision 1)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/wmg.cpp b/src/mame/drivers/wmg.cpp index bc5ea81ecab..f11d84933b9 100644 --- a/src/mame/drivers/wmg.cpp +++ b/src/mame/drivers/wmg.cpp @@ -82,11 +82,11 @@ of save-state is also needed. #define MASTER_CLOCK (XTAL(12'000'000)) #define SOUND_CLOCK (XTAL(3'579'545)) -class wmg_state : public williams_state +class wmg_state : public defender_state { public: wmg_state(const machine_config &mconfig, device_type type, const char *tag) - : williams_state(mconfig, type, tag) + : defender_state(mconfig, type, tag) , m_p_ram(*this, "nvram") , m_keyboard(*this, "X%d", 0) , m_codebank(*this, "codebank") @@ -95,17 +95,16 @@ public: void wmg(machine_config &config); - void init_wmg(); - template <int N> DECLARE_CUSTOM_INPUT_MEMBER(wmg_mux_r); private: + virtual void driver_init() override; + u8 wmg_nvram_r(offs_t offset); void wmg_nvram_w(offs_t offset, u8 data); u8 wmg_pia_0_r(offs_t offset); void wmg_c400_w(u8 data); void wmg_d000_w(u8 data); - DECLARE_WRITE8_MEMBER(wmg_blitter_w); DECLARE_WRITE_LINE_MEMBER(wmg_port_select_w); void wmg_sound_reset_w(u8 data); void wmg_vram_select_w(u8 data); @@ -154,15 +153,15 @@ void wmg_state::wmg_cpu2(address_map &map) void wmg_state::wmg_banked_map(address_map &map) { map(0x0000, 0x000f).mirror(0x03e0).writeonly().share("paletteram"); - map(0x0010, 0x001f).mirror(0x03e0).w(FUNC(williams_state::defender_video_control_w)); + map(0x0010, 0x001f).mirror(0x03e0).w(FUNC(wmg_state::video_control_w)); map(0x0400, 0x0400).w(FUNC(wmg_state::wmg_c400_w)); map(0x0401, 0x0401).w(FUNC(wmg_state::wmg_sound_reset_w)); map(0x0804, 0x0807).r(FUNC(wmg_state::wmg_pia_0_r)).w(m_pia[0], FUNC(pia6821_device::write)); map(0x080c, 0x080f).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x0900, 0x09ff).w(FUNC(wmg_state::wmg_vram_select_w)); - map(0x0a00, 0x0a07).w(FUNC(wmg_state::wmg_blitter_w)); - map(0x0b00, 0x0bff).r(FUNC(williams_state::williams_video_counter_r)); - map(0x0bff, 0x0bff).w(FUNC(williams_state::williams_watchdog_reset_w)); + map(0x0a00, 0x0a07).w(FUNC(wmg_state::blitter_w)); + map(0x0b00, 0x0bff).r(FUNC(wmg_state::video_counter_r)); + map(0x0bff, 0x0bff).w(FUNC(wmg_state::watchdog_reset_w)); map(0x0c00, 0x0fff).rw(FUNC(wmg_state::wmg_nvram_r), FUNC(wmg_state::wmg_nvram_w)); map(0x1000, 0x4fff).rom().region("maincpu", 0x68000); // Defender roms /* These next one is actually banked in CPU 1, but its not something Mame can handle very well. Placed here instead. */ @@ -337,17 +336,6 @@ void wmg_state::wmg_nvram_w(offs_t offset, u8 data) /************************************* * - * Blitter - * - *************************************/ - -WRITE8_MEMBER( wmg_state::wmg_blitter_w ) -{ - williams_blitter_w(m_maincpu->space(AS_PROGRAM), offset, data, mem_mask); -} - -/************************************* - * * Bankswitching * *************************************/ @@ -502,7 +490,7 @@ u8 wmg_state::wmg_pia_0_r(offs_t offset) * Driver Initialisation * *************************************/ -void wmg_state::init_wmg() +void wmg_state::driver_init() { m_blitter_config = WILLIAMS_BLITTER_SC1; m_blitter_clip_address = 0xc000; @@ -527,10 +515,10 @@ void wmg_state::wmg(machine_config &config) ADDRESS_MAP_BANK(config, "bankc000").set_map(&wmg_state::wmg_banked_map).set_options(ENDIANNESS_BIG, 8, 16, 0x1000); // set a timer to go off every 32 scanlines, to toggle the VA11 line and update the screen - TIMER(config, "scan_timer").configure_scanline(FUNC(williams_state::williams_va11_callback), "screen", 0, 32); + TIMER(config, "scan_timer").configure_scanline(FUNC(wmg_state::va11_callback), "screen", 0, 32); // also set a timer to go off on scanline 240 - TIMER(config, "240_timer").configure_scanline(FUNC(williams_state::williams_count240_callback), "screen", 0, 240); + TIMER(config, "240_timer").configure_scanline(FUNC(wmg_state::count240_callback), "screen", 0, 240); WATCHDOG_TIMER(config, "watchdog"); @@ -538,11 +526,9 @@ void wmg_state::wmg(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE); m_screen->set_raw(MASTER_CLOCK*2/3, 512, 6, 298, 260, 7, 247); - m_screen->set_screen_update(FUNC(williams_state::screen_update_williams)); - - MCFG_VIDEO_START_OVERRIDE(williams_state,williams) + m_screen->set_screen_update(FUNC(wmg_state::screen_update)); - PALETTE(config, m_palette, FUNC(williams_state::williams_palette), 256); + PALETTE(config, m_palette, FUNC(wmg_state::palette_init), 256); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -564,7 +550,7 @@ void wmg_state::wmg(machine_config &config) pia6821_device &pia1(PIA6821(config, "pia_1", 0)); pia1.readpa_handler().set_ioport("IN2"); - pia1.writepb_handler().set(FUNC(williams_state::williams_snd_cmd_w)); + pia1.writepb_handler().set(FUNC(wmg_state::snd_cmd_w)); pia1.irqa_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<0>)); pia1.irqb_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<1>)); @@ -610,4 +596,4 @@ ROM_END * *******************************************************/ -GAME( 2001, wmg, 0, wmg, wmg, wmg_state, init_wmg, ROT0, "hack (Clay Cowgill)", "Williams Multigame", 0 ) +GAME( 2001, wmg, 0, wmg, wmg, wmg_state, empty_init, ROT0, "hack (Clay Cowgill)", "Williams Multigame", 0 ) diff --git a/src/mame/drivers/wpc_flip2.cpp b/src/mame/drivers/wpc_flip2.cpp index 2cfa5ddc8dd..cccd8039b38 100644 --- a/src/mame/drivers/wpc_flip2.cpp +++ b/src/mame/drivers/wpc_flip2.cpp @@ -686,8 +686,11 @@ ROM_START(tz_p3) ROM_REGION(0x80000, "code", 0) ROM_LOAD("tz_p3.bin", 0x00000, 0x80000, CRC(f3b1fd9f) SHA1(aa551fc6638e79edf10fbe89127c55372cc3cb58)) ROM_REGION(0x180000, "sound1", 0) - ROM_LOAD("u14-sp1.040", 0x000000, 0x80000, CRC(ad7cb98b) SHA1(a84bf157cb535acaf811e93ad22a505e1dd08dad)) - ROM_LOAD("u15-sp1.040", 0x080000, 0x80000, CRC(0f17c9e9) SHA1(fcaa6f87ebd03222e3a40be08eb5aa6a5e002a8b)) + ROM_LOAD("tzu14_l2.rom", 0x000000, 0x20000, CRC(5a67bd56) SHA1(98669fbfdc5793bcf09fe72c231e2b4fa2524cc5)) + ROM_RELOAD( 0x000000 + 0x20000, 0x20000) + ROM_RELOAD( 0x000000 + 0x40000, 0x20000) + ROM_RELOAD( 0x000000 + 0x60000, 0x20000) + ROM_LOAD("tzu15_l2.rom", 0x080000, 0x80000, CRC(389d2442) SHA1(58a4bc7cc7a28b47c75d5c9bbf14abf34bd7a9e3)) ROM_LOAD("tzu18_p3.rom", 0x100000, 0x80000, CRC(1f750672) SHA1(033c6e261201a17667110069b7570fe90490286b)) ROM_END @@ -696,8 +699,11 @@ ROM_START(tz_p4) ROM_REGION(0x80000, "code", 0) ROM_LOAD("tz_p4.rom", 0x00000, 0x80000, CRC(5a662df5) SHA1(0f609ff59549225d56b913c3bf928b58f7bf1ca5)) ROM_REGION(0x180000, "sound1", 0) - ROM_LOAD("u14-sp1.040", 0x000000, 0x80000, CRC(ad7cb98b) SHA1(a84bf157cb535acaf811e93ad22a505e1dd08dad)) - ROM_LOAD("u15-sp1.040", 0x080000, 0x80000, CRC(0f17c9e9) SHA1(fcaa6f87ebd03222e3a40be08eb5aa6a5e002a8b)) + ROM_LOAD("tzu14_l2.rom", 0x000000, 0x20000, CRC(5a67bd56) SHA1(98669fbfdc5793bcf09fe72c231e2b4fa2524cc5)) + ROM_RELOAD( 0x000000 + 0x20000, 0x20000) + ROM_RELOAD( 0x000000 + 0x40000, 0x20000) + ROM_RELOAD( 0x000000 + 0x60000, 0x20000) + ROM_LOAD("tzu15_l2.rom", 0x080000, 0x80000, CRC(389d2442) SHA1(58a4bc7cc7a28b47c75d5c9bbf14abf34bd7a9e3)) ROM_LOAD("tzu18_p3.rom", 0x100000, 0x80000, CRC(1f750672) SHA1(033c6e261201a17667110069b7570fe90490286b)) ROM_END diff --git a/src/mame/drivers/wrlshunt.cpp b/src/mame/drivers/wrlshunt.cpp deleted file mode 100644 index e2c129169c6..00000000000 --- a/src/mame/drivers/wrlshunt.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/****************************************************************************** - - Wireless Hunting Video Game System skeleton driver - - System: Wireless Hunting Video Game System - Publisher: Hamy / Kids Station Toys Inc - Year: 2011 - ROM: FDI MSP55LV100G - RAM: Micron Technology 48LC8M16A2 - - Games: - Secret Mission - Predator - Delta Force - Toy Land - Dream Forest - Trophy Season - Freedom Force - Be Careful - Net Power - Open Training - Super Archer - Ultimate Frisbee - UFO Shooting - Happy Darts - Balloon Shoot - Avatair - Angry Pirate - Penguin War - Ghost Shooter - Duck Hunt - - - ROM Board: - Package: SO44 - Spacing: 1.27 mm - Width: 16.14 mm - Length: 27.78 mm - Voltage: 3V - Pinout: - - A25 A24 - | | - +--------------------------+ - A21 --|== # # `.__.' ==|-- A20 - A18 --|== ==|-- A19 - A17 --|== ==|-- A8 - A7 --|== ==|-- A9 - A6 --|== o ==|-- A10 - A5 --|== +----------------+ ==|-- A11 - A4 --|== | | ==|-- A12 - A3 --|== | MSP55LV100G | ==|-- A13 - A2 --|== | 0834 M02H | ==|-- A14 - A1 --|== | JAPAN | ==|-- A15 - A0 --|== | | ==|-- A16 - #CE --|== | | ==|-- A23 - GND --|== | | ==|-- A22 - #OE --|== | | ==|-- Q15 - Q0 --|== | | ==|-- Q7 - Q8 --|== | | ==|-- Q14 - Q1 --|== +----------------+ ==|-- Q6 - Q9 --|== ==|-- Q13 - Q2 --|== M55L100G ==|-- Q5 - Q10 --|== ==|-- Q12 - Q3 --|== ==|-- Q4 - Q11 --|== ==|-- VCC - +--------------------------+ - - The only interesting string in this ROM is SPF2ALP, - which is also found in the Wireless Air 60 ROM. - -*******************************************************************************/ - -#include "emu.h" - -#include "cpu/unsp/unsp.h" -#include "machine/spg2xx.h" - -#include "screen.h" -#include "speaker.h" - -class wrlshunt_state : public driver_device -{ -public: - wrlshunt_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_screen(*this, "screen") - , m_spg(*this, "spg") - { } - - void wrlshunt(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - void mem_map(address_map &map); - - required_device<unsp12_device> m_maincpu; - required_device<screen_device> m_screen; - required_device<spg2xx_device> m_spg; -}; - - -/************************************ - * - * Machine Hardware - * - ************************************/ - -void wrlshunt_state::machine_start() -{ -} - -void wrlshunt_state::machine_reset() -{ -} - -void wrlshunt_state::mem_map(address_map &map) -{ - map(0x008000, 0x00ffff).rom().region("maincpu", 0x10000); - map(0x000000, 0x007fff).m(m_spg, FUNC(spg_wh_device::map)); - map(0x040000, 0x07ffff).rom().region("maincpu", 0x106f000); -} - - -/************************************ - * - * Inputs - * - ************************************/ - -static INPUT_PORTS_START( wrlshunt ) -INPUT_PORTS_END - - -/************************************ - * - * Machine Configs - * - ************************************/ - -void wrlshunt_state::wrlshunt(machine_config &config) -{ - UNSP12(config, m_maincpu, XTAL(27'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &wrlshunt_state::mem_map); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_size(320, 262); - m_screen->set_visarea(0, 320-1, 0, 240-1); - m_screen->set_screen_update("spg", FUNC(spg_wh_device::screen_update)); - m_screen->screen_vblank().set(m_spg, FUNC(spg_wh_device::vblank)); - - SPG_WH(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen); - - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - m_spg->add_route(ALL_OUTPUTS, "lspeaker", 0.5); - m_spg->add_route(ALL_OUTPUTS, "rspeaker", 0.5); -} - - -/************************************ - * - * ROM Loading - * - ************************************/ - -ROM_START( wrlshunt ) - ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "wireless.bin", 0x0000, 0x8000000, CRC(a6ecc20e) SHA1(3645f23ba2bb218e92d4560a8ae29dddbaabf796) ) -ROM_END - -// valid looking code, but extended periperhal area (twice the size?) -CONS( 2011, wrlshunt, 0, 0, wrlshunt, wrlshunt, wrlshunt_state, empty_init, "Hamy / Kids Station Toys Inc", "Wireless Hunting Video Game System", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp index 3d190dc1d5a..4737c7fc512 100644 --- a/src/mame/drivers/x68k.cpp +++ b/src/mame/drivers/x68k.cpp @@ -1630,14 +1630,13 @@ void x68k_state::x68000_base(machine_config &config) /* device hardware */ MC68901(config, m_mfpdev, 16_MHz_XTAL / 4); m_mfpdev->set_timer_clock(16_MHz_XTAL / 4); - m_mfpdev->set_rx_clock(0); - m_mfpdev->set_tx_clock(0); m_mfpdev->out_irq_cb().set(FUNC(x68k_state::mfp_irq_callback)); - m_mfpdev->out_tbo_cb().set(m_mfpdev, FUNC(mc68901_device::clock_w)); + m_mfpdev->out_tbo_cb().set(m_mfpdev, FUNC(mc68901_device::tc_w)); + m_mfpdev->out_tbo_cb().append(m_mfpdev, FUNC(mc68901_device::rc_w)); m_mfpdev->out_so_cb().set("keyboard", FUNC(rs232_port_device::write_txd)); rs232_port_device &keyboard(RS232_PORT(config, "keyboard", keyboard_devices, "x68k")); - keyboard.rxd_handler().set(m_mfpdev, FUNC(mc68901_device::write_rx)); + keyboard.rxd_handler().set(m_mfpdev, FUNC(mc68901_device::si_w)); I8255A(config, m_ppi, 0); m_ppi->in_pa_callback().set(FUNC(x68k_state::ppi_port_a_r)); diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index 7fdde0116f9..6e3eb53624a 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -38,7 +38,7 @@ 2007 Tokyo Friend park? perfect! mezase! grand slam!/EPOCH/Japan - - - - - - - 2006 1 Let's TV Play series "Kamen Rider Kabuto" /EPOCH/Japan - - - - - - - 2 Let's TV Play series "Bo-kenger" /EPOCH/Japan - - - - - - - - 3 Challenge Ai-chan! Exciting Ping-pong /TAKARATOMY/Japan - - - - - - - + 3 Challenge Ai-chan! Exciting Ping-pong /TAKARATOMY/Japan - - - - - - dumped 4 Sasuke & Sportsman Tournament /BANDAI/Japan - - - - - - - 5 Hyper resque, I am a resque team /BANDAI/Japan - - - - - - - 6 Let's TV Play series "Ultraman" /BANDAI/Japan - - - - - - - @@ -69,7 +69,7 @@ 17 Toinohgi Onmyo-daisenki /BANDAI/Japan - - - - - - - 2004 1 Accessory cartridge for Super TV computer "Double mouse party"/EPOCH/Japan - - - - - - - 2 Printer for TV computer /EPOCH/Japan - - - - - - - - 3 Virtual punching battle of "One Piece" /BANDAI/Japan - - - - - - - + 3 Virtual punching battle of "One Piece" /BANDAI/Japan - - - - - - dumped 4 Accessory cartridge for Super TV computer "Doraemon"/EPOCH/Japan - - - - - - - 5 Accessory cartridge for Super TV computer "Hamutaro"/EPOCH/Japan - - - - - - - 6 Super TV computer /EPOCH/Japan - - - - - - - @@ -88,7 +88,7 @@ 19 Play TV Madden Football /RADICA/USA 74021 x8 48 4M none SSD 98 PL7351-181 dumped 20 Play TV SSX Snowboarder (and Snowboarder white?) /RADICA/USA 74023 none dumped 21 Disney Princess "Kira-Kira magical lesson" /TOMY/Japan - - - - - - - - 22 Mermaid Melody "pichi-pichi Pitch" e-pitch microcomputer pure starter set /TAKARA/Japan - - - - - - - + 22 Mermaid Melody "pichi-pichi Pitch" e-pitch microcomputer pure starter set /TAKARA/Japan - - - - - - dumped (same as e-kara Japan) 23 Hello Kitty TV computer /EPOCH/Japan - - - - - - - 24 Gan-Gan Revoultion /TAKARA/Japan - - - - - - - 2003 1 Tokyo Friend Park II /EPOCH/Japan - - - - - - - @@ -100,54 +100,54 @@ 7 Croquette! Win a medal! /EPOCH/Japan - - - - - - - 8 Taiko Popira /TAKARA/Japan - - - - - - dumped 9 Together Minimoni, Dancing' Stage! plus /EPOCH/Japan - - - - - - - - 10 Evio /TOMY/Japan - - - - - - - + 10 Evio /TOMY/Japan - - - - - - dumped (some carts not dumped tho) 11 Together Minimoni,Jumping Party! /EPOCH/Japan - - - - - - - 12 Hamutaro TV computer /EPOCH/Japan - - - - - - - - 13 Jara-Ja Land /TAKARA/Japan - - - - - - - (is this the home release of Jala Jaland /atlus/Japan above?) - 14 Tomika, Draiving by Car navigation system /TOMY/Japan - - - - - - - + 13 Jara-Ja Land /TAKARA/Japan - - - - - - dumped (is this the home release of Jala Jaland /atlus/Japan above?) + 14 Tomika, Draiving by Car navigation system /TOMY/Japan - - - - - - dumped 15 PLAY TV Rescue Heroes /RADICA/USA 73036 x8 48 2M none SSD 98 PL7351-181 dumped 16 PLAY TV Huntin' 2 /RADICA/USA 73030 x8 none none SSD 98 PL7351-181 dumped 17 Let's play Ping-pong. Exciting pingpong2 /EPOCH/Japan - - - - - - - - 18 Cartridge for Slot machine TV "King of wild animal" /TAKARA/Japan - - - - - - - + 18 Cartridge for Slot machine TV "King of wild animal" /TAKARA/Japan - - - - - - *** maybe dumped? ** Is this one dumped, or the Jr version below** 19 ChyoroQ "Burning up Racer /TAKARA/Japan - - - - - - - 20 Super shot! Exciting golf /EPOCH/Japan - - - - - - - - 21 PichiPichi Pitchi /TAKARA/Japan - - - - - - - + 21 PichiPichi Pitchi /TAKARA/Japan - - - - - - dumped (same as e-kara Japan) 22 Dual Station /TAKARA/Japan - - - - - - - - 23 Gei-Geki GoGo! Shooting /TAKARA/Japan - - - - - - - + 23 Gei-Geki GoGo! Shooting /TAKARA/Japan - - - - - - dumped 24 Let's fish a big one. Exciting fishing! /EPOCH/Japan - - - - - - - 25 Champion Pinball /TOMY/Japan - - - - - - - 26 Excite Fishing DX EF2J x8 48 4M 24C08 SSD 98 PL7351-181 dumped - 2002 1 Accessory cartridge for Slot machine "Gin-gin maru TV" /TAKARA/Japan - - - - - - - + 2002 1 Accessory cartridge for Slot machine "Gin-gin maru TV" /TAKARA/Japan - - - - - - dumped 2 Wildest computer robot "Daigander" (Korean version) /TAKARA/Korea - - - - - - - 3 Hamutaro's circus /EPOCH/Japan - - - - - - - 4 Doraemon Wakuwaku Kuukihou /EPOCH/Japan - x8 - - - - dumped - 5 Strike! Exciting bowling /EPOCH/Japan - - - - - - - - 6 e-kara /Hasbro/Spain - - - - - - - + 5 Strike! Exciting bowling /EPOCH/Japan - - - - - - dumped + 6 e-kara /Hasbro/Spain - - - - - - dumped (has 3 Spanish songs) 7 Starter set for e-kara H.S," Morning sisters" /TAKARA/Japan - - - - - - - 8 e-kara H.S.(headphones set) /TAKARA/Japan - - - - - - - - 9 Accessory cartridge for Slot machine TV," Aladdin TV" /TAKARA/Japan - - - - - - - - 10 Accessory cartridge for Slot machine TV "Businessman Kintaro/TAKARA/Japan - - - - - - - + 9 Accessory cartridge for Slot machine TV," Aladdin TV" /TAKARA/Japan - - - - - - dumped (cart) + 10 Accessory cartridge for Slot machine TV "Businessman Kintaro/TAKARA/Japan - - - - - - dumped (cart) 11 Poko-poko Hammers /TAKARA/Japan - - - - - - - 12 e-kara N Angel blue special set /TAKARA/Japan - - - - - - - 13 Together Minimoni,Dancing Stage! /EPOCH/Japan - - - - - - - 14 King of shooting /TOMY/Japan - - - - - - - - 15 Knock them out! Exciting boxing /EPOCH/Japan - - - - - - - - 16 Popira2 /TAKARA/Japan - - - - - - - + 15 Knock them out! Exciting boxing /EPOCH/Japan - - - - - - dumped + 16 Popira2 /TAKARA/Japan - - - - - - dumped 17 Zuba-Zuba Blade /TAKARA/Japan - - - - - - - 18 Starter set for e-kara N "Morning sisters" /TAKARA/Japan - - - - - - - 19 e-kara /Hasbro/England - - - - - - dumped? (if same as one of the 'US' sets?) 20 e-kara /Takara USA/USA - - - - - - dumped? (or #10 below, this might be ekaraa set with improved text) - 21 PLAY TV Soccer /RADICA/USA 76088500 x8 none none SSD 98 PA7351-107 have + 21 PLAY TV Soccer /RADICA/USA 76088500 x8 none none SSD 98 PA7351-107 dumped 22 PLAY TV Jr. Construction /RADICA/USA - - - - - - - 23 PLAY TV Boxing /RADICA/Japan 72039 x8 48 2M none SSD 98 PA7351-107 dumped 24 PLAY TV Baseball 2 /RADICA/USA 72042 x8 48 2M none SSD 98 PL7351-181 dumped 25 Barbie Dance Party /RADICA/USA,EU - x8 none - - - dumped - 26 Compete! Exciting stadium DX /EPOCH/Japan - - - - - - - + 26 Compete! Exciting stadium DX /EPOCH/Japan - - - - - - dumped 27 e-kara N /EPOCH/Japan - - - - - - - 28 Who's the ace? Excite Tennis /EPOCH/Japan - - - - - - - 29 Wildest computer robot, "Daigander" /TAKARA/Japan - - - - - - - - 30 Cartridge for Slot machine TV "King of wild animal Jr." /TAKARA/Japan - - - - - - - - 31 Gachinko Contest! Slot machine TV /DCT/Japan - - - - - - - + 30 Cartridge for Slot machine TV "King of wild animal Jr." /TAKARA/Japan - - - - - - *** maybe dumped? ** Is this one dumped, or the non-Jr version above** + 31 Gachinko Contest! Slot machine TV /DCT/Japan - - - - - - dumped 32 Beyblade Ultimate shooter /TAKARA/Japan - - - - - - - 2001 1 Ping-pong(Chinese version) /Tenpon/China - - - - - - - 2 TV hockey /TOMY/Japan - - - - - - - @@ -169,7 +169,7 @@ 18 Let's construct the town! /TAKARA/Japan - - - - - - - 19 Let's fish black bass! Exciting Fishing /EPOCH/Japan - - - - - - - 20 Baseball Korean version /SONOKONG/Korea - - - - - - - - 21 Ping-pong Korean version /SONOKONG/Korea - - - - - - - + 21 Ping-pong Korean version /SONOKONG/Korea - - - - - - dumped ('Reeal Ping Pong') 22 e-kara Hello Kitty /TAKARA/Japan - - - - - - - 23 Special box "Morning sisters" /TAKARA/Japan - - - - - - - 24 Gan-Gan Adventure /TAKARA/Japan - - - - - - - @@ -546,6 +546,22 @@ static INPUT_PORTS_START( xavix_i2c ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda) INPUT_PORTS_END +static INPUT_PORTS_START( epo_bowl ) + PORT_INCLUDE(xavix) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + + PORT_MODIFY("IN1") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda) +INPUT_PORTS_END + + static INPUT_PORTS_START( ttv_lotr ) PORT_INCLUDE(xavix) @@ -1174,6 +1190,105 @@ static INPUT_PORTS_START( evio ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off. INPUT_PORTS_END +static INPUT_PORTS_START( gcslottv ) // TODO: proper button names + PORT_INCLUDE(xavix) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLOT_STOP1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SLOT_STOP2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP3 ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Make Selection / Pause Menu") + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Next Option / Spin / Replay") + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Bet from credits") // not sure, decreases your credits if you have any + + PORT_MODIFY("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) // insert medal / coin (there is a physical coin slot on toy for the medals) auto bets if bet possible, otherwise adds to credits + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off. + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jarajal ) + PORT_INCLUDE(xavix) + + PORT_MODIFY("IN0") + PORT_DIPNAME( 0x01, 0x00, "IN0" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + + PORT_MODIFY("IN1") + PORT_DIPNAME( 0x01, 0x00, "IN1" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + +INPUT_PORTS_END + + /* correct, 4bpp gfxs */ static const gfx_layout charlayout = { @@ -1266,7 +1381,6 @@ void xavix_state::xavix(machine_config &config) m_screen->set_screen_update(FUNC(xavix_state::screen_update)); m_screen->set_size(32*8, 32*8); m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - m_screen->set_palette(m_palette); //m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE); GFXDECODE(config, m_gfxdecode, m_palette, gfx_xavix); @@ -1494,7 +1608,7 @@ void xavix_cart_state::xavix_cart_evio(machine_config &config) SOFTWARE_LIST(config, "cart_list_evio").set_original("evio"); } -void xavix_cart_state::xavix_cart_gcslottv(machine_config &config) +void xavix_cart_gcslottv_state::xavix_cart_gcslottv(machine_config &config) { xavix_cart(config); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); @@ -1748,11 +1862,26 @@ ROM_START( epo_efdx ) ROM_LOAD("excitefishing.bin", 0x000000, 0x400000, CRC(9c85b261) SHA1(6a363faed2ec89c5176e46554a98ca1e20132579) ) ROM_END +ROM_START( epo_bowl ) + ROM_REGION(0x200000, "bios", ROMREGION_ERASE00) + ROM_LOAD("bowling.bin", 0x000000, 0x200000, CRC(d34f8d9e) SHA1(ebe3792172dc43904b9226beb27f1da89d2388cc) ) +ROM_END + +ROM_START( epo_esdx ) + ROM_REGION(0x400000, "bios", ROMREGION_ERASE00) + ROM_LOAD("baseballdx.bin", 0x000000, 0x400000, CRC(fe2e832e) SHA1(e6343f5e5f52316538d918d0d67c15764aa40f65) ) +ROM_END + ROM_START( epo_epp ) ROM_REGION(0x100000, "bios", ROMREGION_ERASE00) ROM_LOAD("excitepingpong.bin", 0x000000, 0x100000, CRC(1fdb9cbd) SHA1(8ed0c1f6d2708ab6e79f0b9553e587c6446e8338) ) ROM_END +ROM_START( epo_eppk ) + ROM_REGION(0x100000, "bios", ROMREGION_ERASE00) + ROM_LOAD("sonokongpingpong.bin", 0x000000, 0x100000, CRC(ea81ced6) SHA1(ef8961d3670148501a478c17cd09f5088e32ad41) ) +ROM_END + ROM_START( epo_epp3 ) ROM_REGION(0x200000, "bios", ROMREGION_ERASE00) ROM_LOAD("excitepingpong3.bin", 0x000000, 0x200000, CRC(a2ee8bff) SHA1(6e16dbaac9680e1f311c08e3f573d0cf8708b446)) @@ -1795,6 +1924,16 @@ ROM_START( tak_geig ) ROM_LOAD("geigeki.bin", 0x000000, 0x400000, CRC(bd0c3576) SHA1(06f614dbec0225ce4ed866b98450912986d72faf) ) ROM_END +ROM_START( jarajal ) + ROM_REGION(0x200000, "bios", ROMREGION_ERASE00) + ROM_LOAD("takaraslots.bin", 0x000000, 0x200000, CRC(afae0b72) SHA1(b1c5d80a8dc8466982efd79d54cd82a58f0ff997) ) +ROM_END + +ROM_START( tcarnavi ) + ROM_REGION(0x400000, "bios", ROMREGION_ERASE00) + ROM_LOAD("navi.bin", 0x000000, 0x400000, CRC(f4e693fb) SHA1(be37b35f1e1e661e10187253c2c3aa9858a90812) ) +ROM_END + /* The e-kara cartridges require the BIOS rom to map into 2nd external bus space as they fetch palette data from it etc. @@ -1830,6 +1969,12 @@ ROM_START( ekarag ) ROM_RELOAD(0x000000, 0x200000) ROM_END +ROM_START( ekaras ) + ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) + ROM_LOAD( "ekaraspanish.bin", 0x600000, 0x200000, CRC(77925ab0) SHA1(402053e22e371c5f5e8069a4bf3b33841e742375) ) + ROM_RELOAD(0x000000, 0x200000) +ROM_END + ROM_START( epitch ) ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) @@ -1886,7 +2031,7 @@ ROM_END ROM_START( gcslottv ) ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) - ROM_LOAD( "gcslottv.bin", 0x000000, 0x800000, NO_DUMP ) // base game not dumped + ROM_LOAD( "sammyslotunit.bin", 0x000000, 0x200000, CRC(2ba6f3ab) SHA1(1c7fc0c85d817db1550d40c0258f424770e0bd81) ) ROM_END @@ -1959,7 +2104,11 @@ CONS( 2002, rad_bdp, 0, 0, xavix, rad_bdp, xavix_state, CONS( 2002, rad_socr, 0, 0, xavix, epo_epp, xavix_state, init_xavix, "Radica / Epoch / SSD Company LTD", "Play TV Soccer", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) +CONS( 2002, epo_esdx, 0, 0, xavix, epo_epp, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Excite Stadium DX (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) + CONS( 2000, epo_epp, 0, 0, xavix, epo_epp, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Excite Ping Pong (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) +CONS( 2000, epo_eppk, epo_epp, 0, xavix, epo_epp, xavix_state, init_xavix, "Epoch / SSD Company LTD / Sonokong", "Real Ping Pong (Korea)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) + // Excite Ping Pong 2 is from 2003, and there's a 3rd game from 2006 also CONS( 2006, epo_epp3, 0, 0, xavix, epo_epp, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Challenge Ai-chan! Excite Ping Pong (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) @@ -1974,6 +2123,12 @@ CONS( 200?, has_wamg, 0, 0, xavix, has_wamg, xavix_state, CONS( 2002, tak_geig, 0, 0, xavix_nv, tak_geig, xavix_state, init_xavix, "Takara / SSD Company LTD", "Geigeki Go Go Shooting (Japan)", MACHINE_IMPERFECT_SOUND ) +// was also distributed by Atlus as an arcade cabinet in 2005, ROM almost certainly different (this one will auto-power off after inactivity, an arcade wouldn't do that) +CONS( 2003, jarajal, 0, 0, xavix_nv, jarajal, xavix_state, init_xavix, "Takara / SSD Company LTD", "Jara-Ja Land (Japan, home version)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) + +CONS( 2003, tcarnavi, 0, 0, xavix_nv, jarajal, xavix_state, init_xavix, "Tomy / SSD Company LTD", "Tomica Carnavi Drive (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) + + /* Music titles: Emulation note: SEEPROM write appears to work (save NVRAM file looks valid) but game fails to read it back properly, fails backup data checksum, and blanks it again. Timers might not be 100%, PAL stuff uses different ways to do timing. @@ -1981,8 +2136,9 @@ CONS( 2002, tak_geig, 0, 0, xavix_nv, tak_geig, xavix_state, CONS( 2000, ekara, 0, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD / Hasbro", "e-kara (US?, NTSC, set 1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) // shows "Please insert a cartridge before turn it on" without cart CONS( 2000, ekaraa, ekara, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD / Hasbro", "e-kara (US?, NTSC, set 2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) // shows "Please insert a cartridge before turning on e-kara" without cart CONS( 2000, ekaraj, ekara, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD", "e-kara (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) // shows Japanese message without cart -CONS( 2002, ekarag, ekara, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD", "e-kara (Germany?, includes 3 songs)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) // found in Germany, could just be a Europe-wide model tho?, NOT a headset model, but still has 3 songs. -// the 'e-kara pro headset' has 3 songs built in for the US release. The Japanese release of this appears to be called 'e-kara H.S.' and it is unclear if it also has built in songs. The Canadian box says 'cartridge contains' instead of 'songs included' but is likely a printing error. +CONS( 2002, ekarag, ekara, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD", "e-kara (Europe, includes 3 songs)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) // found in Germany and UK, could just be a Europe-wide model, NOT a headset model, but still has 3 songs. +CONS( 2002, ekaras, ekara, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD / newgent", "e-kara (Spain, includes 3 songs)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) + // the 'e-kara pro headset' has 3 songs built in for the US release. The Japanese release of this appears to be called 'e-kara H.S.' and it is unclear if it also has built in songs. The Canadian box says 'cartridge contains' instead of 'songs included' but is likely a printing error. CONS( 2002, ekaraphs, ekara, 0, xavix_cart_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / SSD Company LTD", "e-kara Pro Headset (US, includes 3 songs)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*| MACHINE_IS_BIOS_ROOT*/ ) // epitch (at least the pichi pichi pitch mermaid starter pack) uses the same internal rom as the Japanese ekara, but has less buttons, so some features aren't available (some games also seem to expect to read it with a different layout eg 'a7' cart, but 'a5' cart doesn't, so must be a way to enable that mode, or bug in code?) @@ -2004,7 +2160,7 @@ CONS( 2004, jpopira, 0, 0, xavix_i2c_jpopira,jpopira, xavix_i2c_car CONS( 2003, evio, 0, 0, xavix_cart_evio, evio, xavix_cart_state, init_xavix, "Tomy / SSD Company LTD", "Evio (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) // inputs? it's a violin controller -CONS( 2002, gcslottv, 0, 0, xavix_cart_gcslottv, evio, xavix_cart_state, init_xavix, "Takara / Sammy / DCT / SSD Company LTD", "Gachinko Contest! Slot machine TV (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) // bios not dumped yet +CONS( 2002, gcslottv, 0, 0, xavix_cart_gcslottv, gcslottv, xavix_cart_gcslottv_state, init_xavix, "Takara / Sammy / DCT / SSD Company LTD", "Gachinko Contest! Slot machine TV (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND /*|MACHINE_IS_BIOS_ROOT*/ ) @@ -2059,6 +2215,9 @@ ROM_START( ban_onep ) ROM_END CONS( 2002, epo_ebox, 0, 0, xavix2000_nv, epo_epp, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Excite Boxing (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // doesn't use XaviX2000 extra opcodes, but had that type of CPU + // die not confirmed, but uses extra opcodes. (hangs on title screen due to combination of freq_timer_done nested interrupts tripping, and waiting on bits in input ports to change +CONS( 2002, epo_bowl, 0, 0, xavix2000_i2c_24c02, epo_bowl, xavix_i2c_state, init_xavix, "Epoch / SSD Company LTD", "Excite Bowling (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) + CONS( 2004, epo_sdb, 0, 0, xavix2000_nv_sdb, epo_sdb, xavix_2000_nv_sdb_state, init_xavix, "Epoch / SSD Company LTD", "Super Dash Ball (Japan)", MACHINE_IMPERFECT_SOUND ) CONS( 2005, ttv_sw, 0, 0, xavix2000_i2c_24c02, ttv_lotr, xavix_i2c_lotr_state, init_xavix, "Tiger / SSD Company LTD", "Star Wars Saga Edition - Lightsaber Battle Game", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/z80ne.cpp b/src/mame/drivers/z80ne.cpp index 9321758c89a..e1da99443f1 100644 --- a/src/mame/drivers/z80ne.cpp +++ b/src/mame/drivers/z80ne.cpp @@ -113,7 +113,7 @@ /* LX.382 CPU Board RAM */ /* LX.382 CPU Board EPROM */ -void z80ne_state::z80ne_mem(address_map &map) +void z80ne_state::main_mem(address_map &map) { map(0x0000, 0x03ff).bankrw("bank1"); map(0x0400, 0x7fff).ram(); @@ -121,7 +121,7 @@ void z80ne_state::z80ne_mem(address_map &map) map(0x8400, 0xffff).nopr().nopw(); } -void z80ne_state::z80net_mem(address_map &map) +void z80net_state::main_mem(address_map &map) { map(0x0000, 0x03ff).bankrw("bank1"); map(0x0400, 0x7fff).ram(); @@ -131,7 +131,7 @@ void z80ne_state::z80net_mem(address_map &map) map(0xee00, 0xffff).ram(); } -void z80ne_state::z80netb_mem(address_map &map) +void z80netb_state::main_mem(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0xebff).ram(); @@ -139,7 +139,7 @@ void z80ne_state::z80netb_mem(address_map &map) map(0xee00, 0xffff).ram(); } -void z80ne_state::z80ne_io(address_map &map) +void z80ne_state::main_io(address_map &map) { map.global_mask(0xff); map(0xee, 0xee).rw(m_uart, FUNC(ay31015_device::receive), FUNC(ay31015_device::transmit)); @@ -147,17 +147,17 @@ void z80ne_state::z80ne_io(address_map &map) map(0xf0, 0xff).rw(FUNC(z80ne_state::lx383_r), FUNC(z80ne_state::lx383_w)); } -void z80ne_state::z80net_io(address_map &map) +void z80net_state::main_io(address_map &map) { map.global_mask(0xff); - map(0xea, 0xea).r(FUNC(z80ne_state::lx387_data_r)); - map(0xeb, 0xeb).r(FUNC(z80ne_state::lx388_read_field_sync)); + map(0xea, 0xea).r(FUNC(z80net_state::lx387_data_r)); + map(0xeb, 0xeb).r(FUNC(z80net_state::lx388_read_field_sync)); map(0xee, 0xee).rw(m_uart, FUNC(ay31015_device::receive), FUNC(ay31015_device::transmit)); - map(0xef, 0xef).rw(FUNC(z80ne_state::lx385_ctrl_r), FUNC(z80ne_state::lx385_ctrl_w)); - map(0xf0, 0xff).rw(FUNC(z80ne_state::lx383_r), FUNC(z80ne_state::lx383_w)); + map(0xef, 0xef).rw(FUNC(z80net_state::lx385_ctrl_r), FUNC(z80net_state::lx385_ctrl_w)); + map(0xf0, 0xff).rw(FUNC(z80net_state::lx383_r), FUNC(z80net_state::lx383_w)); } -void z80netf_state::z80netf_mem(address_map &map) +void z80netf_state::main_mem(address_map &map) { map(0x0000, 0x03ff).bankrw("bank1"); map(0x0400, 0x3fff).bankrw("bank2"); @@ -171,7 +171,7 @@ void z80netf_state::z80netf_mem(address_map &map) map(0xf400, 0xffff).nopr().nopw(); } -void z80netf_state::z80netf_io(address_map &map) +void z80netf_state::main_io(address_map &map) { map.global_mask(0xff); map(0xd0, 0xd7).rw(FUNC(z80netf_state::lx390_fdc_r), FUNC(z80netf_state::lx390_fdc_w)); @@ -190,172 +190,172 @@ void z80netf_state::z80netf_io(address_map &map) static INPUT_PORTS_START( z80ne ) -/* LX.384 Hex Keyboard and Display */ -/* - * In natural mode the CTRL key is mapped on shift - */ -PORT_START("ROW0") /* IN0 keys row 0 */ -PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 0") PORT_CODE(KEYCODE_0) //PORT_CHAR('0') PORT_CHAR('=') -PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 1") PORT_CODE(KEYCODE_1) //PORT_CHAR('1') PORT_CHAR('!') -PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 2") PORT_CODE(KEYCODE_2) //PORT_CHAR('2') PORT_CHAR('"') -PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 3") PORT_CODE(KEYCODE_3) //PORT_CHAR('3') PORT_CHAR(0x00a3) // ?? -PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 4") PORT_CODE(KEYCODE_4) //PORT_CHAR('4') PORT_CHAR('$') -PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 5") PORT_CODE(KEYCODE_5) //PORT_CHAR('5') PORT_CHAR('%') -PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 6") PORT_CODE(KEYCODE_6) //PORT_CHAR('6') PORT_CHAR('&') -PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 7") PORT_CODE(KEYCODE_7) //PORT_CHAR('7') PORT_CHAR('/') - -PORT_START("ROW1") /* IN1 keys row 1 */ -PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 8") PORT_CODE(KEYCODE_8) //PORT_CHAR('8') PORT_CHAR('(') -PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 9") PORT_CODE(KEYCODE_9) //PORT_CHAR('9') PORT_CHAR(')') -PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 A") PORT_CODE(KEYCODE_A) //PORT_CHAR('a') PORT_CHAR('A') -PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 B") PORT_CODE(KEYCODE_B) //PORT_CHAR('b') PORT_CHAR('B') -PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 C") PORT_CODE(KEYCODE_C) //PORT_CHAR('c') PORT_CHAR('C') -PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 D") PORT_CODE(KEYCODE_D) //PORT_CHAR('d') PORT_CHAR('D') -PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 E") PORT_CODE(KEYCODE_E) //PORT_CHAR('e') PORT_CHAR('E') -PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 F") PORT_CODE(KEYCODE_F) //PORT_CHAR('f') PORT_CHAR('F') - -PORT_START("CTRL") /* CONTROL key */ -PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) //PORT_CHAR(UCHAR_SHIFT_1) -PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - -PORT_START("RST") /* RESET key */ -PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 Reset") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, z80ne_state, z80ne_reset, 0) - -/* Settings */ -PORT_START("LX.385") -PORT_CONFNAME(0x07, 0x04, "LX.385 Cassette: P1,P3 Data Rate") -PORT_CONFSETTING( 0x01, "A-B: 300 bps") -PORT_CONFSETTING( 0x02, "A-C: 600 bps") -PORT_CONFSETTING( 0x04, "A-D: 1200 bps") -PORT_CONFNAME( 0x08, 0x00, "LX.385: P4 Parity Check") -PORT_CONFSETTING( 0x00, "Parity Check Enabled") -PORT_CONFSETTING( 0x08, "Parity Check Disabled") + /* LX.384 Hex Keyboard and Display */ + /* + * In natural mode the CTRL key is mapped on shift + */ + PORT_START("ROW0") /* IN0 keys row 0 */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 0") PORT_CODE(KEYCODE_0) //PORT_CHAR('0') PORT_CHAR('=') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 1") PORT_CODE(KEYCODE_1) //PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 2") PORT_CODE(KEYCODE_2) //PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 3") PORT_CODE(KEYCODE_3) //PORT_CHAR('3') PORT_CHAR(0x00a3) // ?? + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 4") PORT_CODE(KEYCODE_4) //PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 5") PORT_CODE(KEYCODE_5) //PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 6") PORT_CODE(KEYCODE_6) //PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 7") PORT_CODE(KEYCODE_7) //PORT_CHAR('7') PORT_CHAR('/') + + PORT_START("ROW1") /* IN1 keys row 1 */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 8") PORT_CODE(KEYCODE_8) //PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 9") PORT_CODE(KEYCODE_9) //PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 A") PORT_CODE(KEYCODE_A) //PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 B") PORT_CODE(KEYCODE_B) //PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 C") PORT_CODE(KEYCODE_C) //PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 D") PORT_CODE(KEYCODE_D) //PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 E") PORT_CODE(KEYCODE_E) //PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 F") PORT_CODE(KEYCODE_F) //PORT_CHAR('f') PORT_CHAR('F') + + PORT_START("CTRL") /* CONTROL key */ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) //PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("RST") /* RESET key */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 Reset") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, z80ne_state, z80ne_reset, 0) + + /* Settings */ + PORT_START("LX.385") + PORT_CONFNAME(0x07, 0x04, "LX.385 Cassette: P1,P3 Data Rate") + PORT_CONFSETTING( 0x01, "A-B: 300 bps") + PORT_CONFSETTING( 0x02, "A-C: 600 bps") + PORT_CONFSETTING( 0x04, "A-D: 1200 bps") + PORT_CONFNAME( 0x08, 0x00, "LX.385: P4 Parity Check") + PORT_CONFSETTING( 0x00, "Parity Check Enabled") + PORT_CONFSETTING( 0x08, "Parity Check Disabled") INPUT_PORTS_END static INPUT_PORTS_START( z80net ) -PORT_INCLUDE( z80ne ) - -/* LX.387 Keyboard BREAK key */ -PORT_START("LX387_BRK") -PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CHANGED_MEMBER(DEVICE_SELF, z80ne_state, z80ne_nmi, 0) - -/* LX.387 Keyboard (Encoded by KR2376) */ - -PORT_START("X0") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) - -PORT_START("X1") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) - -PORT_START("X2") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_') - -PORT_START("X3") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('`') PORT_CHAR('@') -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_NAME("Del") -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_NAME("CR") -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10) PORT_NAME("LF") -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) - -PORT_START("X4") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') - -PORT_START("X5") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('c') PORT_CHAR('G') -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) - -PORT_START("X6") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') - -PORT_START("X7") -PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') -PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') -PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') -PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') -PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') -PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') -PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') -PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') -PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') -PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~') -PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') - -PORT_START("MODIFIERS") -PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) -PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) -PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE + PORT_INCLUDE( z80ne ) + + /* LX.387 Keyboard BREAK key */ + PORT_START("LX387_BRK") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CHANGED_MEMBER(DEVICE_SELF, z80net_state, z80net_nmi, 0) + + /* LX.387 Keyboard (Encoded by KR2376) */ + + PORT_START("X0") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("X1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("X2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_') + + PORT_START("X3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('`') PORT_CHAR('@') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_NAME("Del") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_NAME("CR") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10) PORT_NAME("LF") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("X4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + + PORT_START("X5") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('c') PORT_CHAR('G') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + + PORT_START("X6") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + + PORT_START("X7") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') + + PORT_START("MODIFIERS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE INPUT_PORTS_END @@ -364,15 +364,15 @@ static INPUT_PORTS_START( z80netf ) PORT_INCLUDE( z80net ) -/* Settings */ -PORT_START("CONFIG") -PORT_CONFNAME(0x07, 0x01, "Boot EPROM") -PORT_CONFSETTING( 0x01, "EP382 Hex Monitor") -PORT_CONFSETTING( 0x02, "EP548 16k BASIC") -PORT_CONFSETTING( 0x03, "EP390 Boot Loader for 5.5k floppy BASIC") -PORT_CONFSETTING( 0x04, "EP1390 Boot Loader for NE DOS 1.0/1.5") -PORT_CONFSETTING( 0x05, "EP2390 Boot Loader for NE DOS G.1") -PORT_BIT(0xf8, 0xf8, IPT_UNUSED) + /* Settings */ + PORT_START("CONFIG") + PORT_CONFNAME(0x07, 0x01, "Boot EPROM") + PORT_CONFSETTING( 0x01, "EP382 Hex Monitor") + PORT_CONFSETTING( 0x02, "EP548 16k BASIC") + PORT_CONFSETTING( 0x03, "EP390 Boot Loader for 5.5k floppy BASIC") + PORT_CONFSETTING( 0x04, "EP1390 Boot Loader for NE DOS 1.0/1.5") + PORT_CONFSETTING( 0x05, "EP2390 Boot Loader for NE DOS G.1") + PORT_BIT(0xf8, 0xf8, IPT_UNUSED) INPUT_PORTS_END @@ -419,11 +419,8 @@ void z80ne_state::z80ne(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, Z80NE_CPU_SPEED_HZ); - m_maincpu->set_addrmap(AS_PROGRAM, &z80ne_state::z80ne_mem); - m_maincpu->set_addrmap(AS_IO, &z80ne_state::z80ne_io); - - MCFG_MACHINE_START_OVERRIDE(z80ne_state,z80ne) - MCFG_MACHINE_RESET_OVERRIDE(z80ne_state,z80ne) + m_maincpu->set_addrmap(AS_PROGRAM, &z80ne_state::main_mem); + m_maincpu->set_addrmap(AS_IO, &z80ne_state::main_io); AY31015(config, m_uart); @@ -452,7 +449,7 @@ void z80ne_state::z80ne(machine_config &config) //SOFTWARE_LIST(config, "cass_list").set_original("z80ne_cass"); } -void z80ne_state::lx387(machine_config &config) +void z80net_state::lx387(machine_config &config) { KR2376_ST(config, m_lx387_kr2376, 50000); m_lx387_kr2376->x<0>().set_ioport("X0"); @@ -463,19 +460,16 @@ void z80ne_state::lx387(machine_config &config) m_lx387_kr2376->x<5>().set_ioport("X5"); m_lx387_kr2376->x<6>().set_ioport("X6"); m_lx387_kr2376->x<7>().set_ioport("X7"); - m_lx387_kr2376->shift().set(FUNC(z80ne_state::lx387_shift_r)); - m_lx387_kr2376->control().set(FUNC(z80ne_state::lx387_control_r)); + m_lx387_kr2376->shift().set(FUNC(z80net_state::lx387_shift_r)); + m_lx387_kr2376->control().set(FUNC(z80net_state::lx387_control_r)); } -void z80ne_state::z80net(machine_config &config) +void z80net_state::z80net(machine_config &config) { z80ne(config); - m_maincpu->set_addrmap(AS_PROGRAM, &z80ne_state::z80net_mem); - m_maincpu->set_addrmap(AS_IO, &z80ne_state::z80net_io); - - MCFG_MACHINE_START_OVERRIDE(z80ne_state, z80net ) - MCFG_MACHINE_RESET_OVERRIDE(z80ne_state, z80net ) + m_maincpu->set_addrmap(AS_PROGRAM, &z80net_state::main_mem); + m_maincpu->set_addrmap(AS_IO, &z80net_state::main_io); lx387(config); @@ -484,7 +478,7 @@ void z80ne_state::z80net(machine_config &config) MC6847_PAL(config, m_vdg, 4.433619_MHz_XTAL); m_vdg->set_screen("lx388"); - m_vdg->input_callback().set(FUNC(z80ne_state::lx388_mc6847_videoram_r)); + m_vdg->input_callback().set(FUNC(z80net_state::lx388_mc6847_videoram_r)); // AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND // other lines not connected @@ -496,20 +490,17 @@ void z80ne_state::z80net(machine_config &config) SOFTWARE_LIST(config, "cass_list").set_original("z80ne_cass"); } -void z80ne_state::z80netb(machine_config &config) +void z80netb_state::z80netb(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, Z80NE_CPU_SPEED_HZ); - m_maincpu->set_addrmap(AS_PROGRAM, &z80ne_state::z80netb_mem); - m_maincpu->set_addrmap(AS_IO, &z80ne_state::z80net_io); - - MCFG_MACHINE_START_OVERRIDE(z80ne_state,z80netb) - MCFG_MACHINE_RESET_OVERRIDE(z80ne_state,z80netb) + m_maincpu->set_addrmap(AS_PROGRAM, &z80netb_state::main_mem); + m_maincpu->set_addrmap(AS_IO, &z80netb_state::main_io); AY31015(config, m_uart); CLOCK(config, m_uart_clock, 4800); - m_uart_clock->signal_handler().set(FUNC(z80ne_state::lx385_uart_tx_clock_w)); + m_uart_clock->signal_handler().set(FUNC(z80netb_state::lx385_uart_tx_clock_w)); m_uart_clock->signal_handler().append(m_uart, FUNC(ay31015_device::write_rcp)); SPEAKER(config, "mono").front_center(); @@ -531,7 +522,7 @@ void z80ne_state::z80netb(machine_config &config) MC6847_PAL(config, m_vdg, 4.433619_MHz_XTAL); m_vdg->set_screen("lx388"); - m_vdg->input_callback().set(FUNC(z80ne_state::lx388_mc6847_videoram_r)); + m_vdg->input_callback().set(FUNC(z80netb_state::lx388_mc6847_videoram_r)); // AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND // other lines not connected @@ -547,11 +538,8 @@ void z80netf_state::z80netf(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, Z80NE_CPU_SPEED_HZ); - m_maincpu->set_addrmap(AS_PROGRAM, &z80netf_state::z80netf_mem); - m_maincpu->set_addrmap(AS_IO, &z80netf_state::z80netf_io); - - MCFG_MACHINE_START_OVERRIDE(z80netf_state,z80netf) - MCFG_MACHINE_RESET_OVERRIDE(z80netf_state,z80netf) + m_maincpu->set_addrmap(AS_PROGRAM, &z80netf_state::main_mem); + m_maincpu->set_addrmap(AS_IO, &z80netf_state::main_io); AY31015(config, m_uart); @@ -578,7 +566,7 @@ void z80netf_state::z80netf(machine_config &config) MC6847_PAL(config, m_vdg, 4.433619_MHz_XTAL); m_vdg->set_screen("lx388"); - m_vdg->input_callback().set(FUNC(z80ne_state::lx388_mc6847_videoram_r)); + m_vdg->input_callback().set(FUNC(z80netf_state::lx388_mc6847_videoram_r)); // AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND // other lines not connected @@ -650,8 +638,8 @@ ROM_START( z80netf ) ROM_LOAD( "ep2390.ic6", 0x14C00, 0x0400, CRC(28d28eee) SHA1(b80f75c1ac4905ae369ecbc9b9ce120cc85502ed) ) ROM_END -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1980, z80ne, 0, 0, z80ne, z80ne, z80ne_state, init_z80ne, "Nuova Elettronica", "Z80NE", MACHINE_NO_SOUND_HW) -COMP( 1980, z80net, z80ne, 0, z80net, z80net, z80ne_state, init_z80net, "Nuova Elettronica", "Z80NE + LX.388", MACHINE_NO_SOUND_HW) -COMP( 1980, z80netb, z80ne, 0, z80netb, z80net, z80ne_state, init_z80netb, "Nuova Elettronica", "Z80NE + LX.388 + Basic 16k", MACHINE_NO_SOUND_HW) -COMP( 1980, z80netf, z80ne, 0, z80netf, z80netf, z80netf_state, init_z80netf, "Nuova Elettronica", "Z80NE + LX.388 + LX.390", MACHINE_NO_SOUND_HW) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1980, z80ne, 0, 0, z80ne, z80ne, z80ne_state, empty_init, "Nuova Elettronica", "Z80NE", MACHINE_NO_SOUND_HW) +COMP( 1980, z80net, z80ne, 0, z80net, z80net, z80net_state, empty_init, "Nuova Elettronica", "Z80NE + LX.388", MACHINE_NO_SOUND_HW) +COMP( 1980, z80netb, z80ne, 0, z80netb, z80net, z80netb_state, empty_init, "Nuova Elettronica", "Z80NE + LX.388 + Basic 16k", MACHINE_NO_SOUND_HW) +COMP( 1980, z80netf, z80ne, 0, z80netf, z80netf, z80netf_state, empty_init, "Nuova Elettronica", "Z80NE + LX.388 + LX.390", MACHINE_NO_SOUND_HW) diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp index 81fba2ada5e..86576287f2e 100644 --- a/src/mame/drivers/zn.cpp +++ b/src/mame/drivers/zn.cpp @@ -11,235 +11,10 @@ ***************************************************************************/ #include "emu.h" -#include "audio/rax.h" -#include "audio/taito_zm.h" -#include "audio/taitosnd.h" - -#include "bus/ata/atadev.h" -#include "bus/ata/ataintf.h" -#include "cpu/m68000/m68000.h" -#include "cpu/mcs51/mcs51.h" -#include "cpu/psx/psx.h" -#include "cpu/z80/z80.h" -#include "machine/7200fifo.h" -#include "machine/at28c16.h" -#include "machine/bankdev.h" -#include "machine/cat702.h" -#include "machine/gen_latch.h" -#include "machine/mb3773.h" -#include "machine/nvram.h" -#include "machine/ram.h" -#include "machine/vt83c461.h" -#include "machine/watchdog.h" -#include "machine/znmcu.h" -#include "sound/2610intf.h" -#include "sound/okim6295.h" -#include "sound/qsound.h" -#include "sound/spu.h" -#include "sound/ymf271.h" -#include "sound/ymz280b.h" -#include "video/psx.h" - -#include "screen.h" -#include "speaker.h" - -#include <algorithm> +#include "includes/zn.h" #define VERBOSE_LEVEL ( 0 ) -class zn_state : public driver_device -{ -public: - zn_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_gpu(*this, "gpu"), - m_gpu_screen(*this, "screen"), - m_sio0(*this, "maincpu:sio0"), - m_cat702(*this, "cat702_%u", 1), - m_znmcu(*this, "znmcu"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_ram(*this, "maincpu:ram"), - m_cbaj_fifo(*this, "cbaj_fifo%u", 1), - m_mb3773(*this, "mb3773"), - m_zoom(*this, "taito_zoom"), - m_rax(*this, "rax"), - m_vt83c461(*this, "ide"), - m_soundlatch(*this, "soundlatch"), - m_soundlatch16(*this, "soundlatch16"), - m_nbajamex_bankmap(*this, "nbajamex_bankmap"), - m_bankedroms(*this, "bankedroms"), - m_rombank(*this, "rombank%u", 1), - m_soundbank(*this, "soundbank"), - m_okibank(*this, "okibank"), - m_znmcu_dataout(1) - { - std::fill(std::begin(m_cat702_dataout), std::end(m_cat702_dataout), 1); - } - - void zn1_1mb_vram(machine_config &config); - void zn1_2mb_vram(machine_config &config); - void zn2(machine_config &config); - void gameboard_cat702(machine_config &config); - void jdredd(machine_config &config); - void coh1002msnd(machine_config &config); - void coh1002tb(machine_config &config); - void coh1000a(machine_config &config); - void coh1000tb(machine_config &config); - void coh1002m(machine_config &config); - void coh1002ml(machine_config &config); - void coh1001l(machine_config &config); - void bam2(machine_config &config); - void beastrzrb(machine_config &config); - void glpracr(machine_config &config); - void coh1000ta(machine_config &config); - void coh1002v(machine_config &config); - void nbajamex(machine_config &config); - void coh1000c(machine_config &config); - void coh1000w(machine_config &config); - void coh1002e(machine_config &config); - void coh3002c(machine_config &config); - void coh1002c(machine_config &config); - - void init_coh1000tb(); - void init_nbajamex(); - void init_bam2(); - void init_jdredd(); - void init_coh1000w(); - void init_primrag2(); - - DECLARE_READ_LINE_MEMBER(jdredd_gun_mux_r); - -private: - template<int Chip> DECLARE_WRITE_LINE_MEMBER(cat702_dataout) { m_cat702_dataout[Chip] = state; update_sio0_rxd(); } - DECLARE_WRITE_LINE_MEMBER(znmcu_dataout) { m_znmcu_dataout = state; update_sio0_rxd(); } - void update_sio0_rxd() { m_sio0->write_rxd(m_cat702_dataout[0] && m_cat702_dataout[1] && m_znmcu_dataout); } - DECLARE_READ8_MEMBER(znsecsel_r); - DECLARE_WRITE8_MEMBER(znsecsel_w); - DECLARE_READ8_MEMBER(boardconfig_r); - DECLARE_READ16_MEMBER(unknown_r); - DECLARE_WRITE8_MEMBER(coin_w); - DECLARE_READ16_MEMBER(capcom_kickharness_r); - DECLARE_WRITE8_MEMBER(bank_coh1000c_w); - DECLARE_WRITE8_MEMBER(qsound_bankswitch_w); - DECLARE_WRITE8_MEMBER(bank_coh1000t_w); - DECLARE_WRITE8_MEMBER(fx1a_sound_bankswitch_w); - DECLARE_WRITE8_MEMBER(fx1b_fram_w); - DECLARE_READ8_MEMBER(fx1b_fram_r); - DECLARE_WRITE8_MEMBER(coh1002e_bank_w); - DECLARE_WRITE8_MEMBER(coh1002e_sound_irq_w); - DECLARE_WRITE16_MEMBER(bam2_mcu_w); - DECLARE_READ16_MEMBER(bam2_mcu_r); - DECLARE_READ16_MEMBER(bam2_unk_r); - DECLARE_WRITE16_MEMBER(acpsx_00_w); - DECLARE_WRITE16_MEMBER(acpsx_10_w); - DECLARE_WRITE16_MEMBER(nbajamex_bank_w); - DECLARE_WRITE16_MEMBER(nbajamex_80_w); - DECLARE_WRITE8_MEMBER(nbajamex_backup_w); - DECLARE_READ16_MEMBER(nbajamex_08_r); - DECLARE_READ16_MEMBER(nbajamex_80_r); - DECLARE_WRITE8_MEMBER(coh1001l_bank_w); - DECLARE_WRITE16_MEMBER(coh1001l_sound_unk_w); - DECLARE_WRITE8_MEMBER(coh1002v_bank_w); - DECLARE_WRITE8_MEMBER(coh1002m_bank_w); - DECLARE_READ8_MEMBER(cbaj_sound_main_status_r); - DECLARE_READ8_MEMBER(cbaj_sound_z80_status_r); - DECLARE_READ16_MEMBER(vt83c461_16_r); - DECLARE_WRITE16_MEMBER(vt83c461_16_w); - DECLARE_READ16_MEMBER(vt83c461_32_r); - DECLARE_WRITE16_MEMBER(vt83c461_32_w); - - DECLARE_MACHINE_START(coh1000c); - DECLARE_MACHINE_START(coh1000ta); - DECLARE_MACHINE_START(coh1002e); - DECLARE_MACHINE_START(bam2); - DECLARE_MACHINE_START(nbajamex); - DECLARE_MACHINE_START(coh1001l); - DECLARE_MACHINE_START(coh1002v); - DECLARE_MACHINE_START(coh1002m); - DECLARE_MACHINE_RESET(coh1000c); - DECLARE_MACHINE_RESET(glpracr); - DECLARE_MACHINE_RESET(coh1000ta); - DECLARE_MACHINE_RESET(coh1002e); - DECLARE_MACHINE_RESET(bam2); - DECLARE_MACHINE_RESET(nbajamex); - DECLARE_MACHINE_RESET(coh1001l); - DECLARE_MACHINE_RESET(coh1002v); - DECLARE_MACHINE_RESET(coh1002m); - INTERRUPT_GEN_MEMBER(qsound_interrupt); - void atpsx_dma_read(uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); - void atpsx_dma_write(uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); - DECLARE_WRITE_LINE_MEMBER(jdredd_vblank); - - void atlus_snd_map(address_map &map); - void bam2_map(address_map &map); - void beastrzrb_snd_map(address_map &map); - void cbaj_z80_map(address_map &map); - void cbaj_z80_port_map(address_map &map); - void coh1000a_map(address_map &map); - void coh1000c_map(address_map &map); - void coh1000ta_map(address_map &map); - void coh1000tb_map(address_map &map); - void coh1000w_map(address_map &map); - void coh1001l_map(address_map &map); - void coh1002e_map(address_map &map); - void coh1002m_map(address_map &map); - void coh1002ml_link_map(address_map &map); - void coh1002ml_link_port_map(address_map &map); - void coh1002msnd_map(address_map &map); - void coh1002v_map(address_map &map); - void fx1a_sound_map(address_map &map); - void jdredd_map(address_map &map); - void nbajamex_map(address_map &map); - void nbajamex_bank_map(address_map &map); - void oki_map(address_map &map); - void psarc_snd_map(address_map &map); - void qsound_map(address_map &map); - void qsound_portmap(address_map &map); - void zn_map(address_map &map); - - virtual void machine_start() override; - - inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); - inline void psxwriteword( uint32_t *p_n_psxram, uint32_t n_address, uint16_t n_data ); - - uint8_t m_n_znsecsel; - - uint16_t m_bam2_mcu_command; - int m_jdredd_gun_mux; - - std::unique_ptr<uint8_t[]> m_fx1b_fram; - std::unique_ptr<uint8_t[]> m_nbajamex_sram; - - uint32_t m_nbajamex_rombank[2]; - - uint16_t m_vt83c461_latch; - - required_device<psxgpu_device> m_gpu; - required_device<screen_device> m_gpu_screen; - required_device<psxsio0_device> m_sio0; - optional_device_array<cat702_device, 2> m_cat702; - required_device<znmcu_device> m_znmcu; - required_device<cpu_device> m_maincpu; - optional_device<cpu_device> m_audiocpu; - required_device<ram_device> m_ram; - optional_device_array<fifo7200_device, 2> m_cbaj_fifo; - optional_device<mb3773_device> m_mb3773; - optional_device<taito_zoom_device> m_zoom; - optional_device<acclaim_rax_device> m_rax; - optional_device<vt83c461_device> m_vt83c461; - optional_device<generic_latch_8_device> m_soundlatch; - optional_device<generic_latch_16_device> m_soundlatch16; - optional_device<address_map_bank_device> m_nbajamex_bankmap; - optional_memory_region m_bankedroms; - optional_memory_bank_array<2> m_rombank; - optional_memory_bank m_soundbank; - optional_memory_bank m_okibank; - - int m_cat702_dataout[2]; - int m_znmcu_dataout; -}; - inline void ATTR_PRINTF(3,4) zn_state::verboselog( int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) @@ -357,7 +132,7 @@ WRITE8_MEMBER(zn_state::coin_w) } } -void zn_state::zn_map(address_map &map) +void zn_state::zn_base_map(address_map &map) { map(0x1fa00000, 0x1fa00003).portr("P1"); map(0x1fa00100, 0x1fa00103).portr("P2"); @@ -367,19 +142,24 @@ void zn_state::zn_map(address_map &map) map(0x1fa10100, 0x1fa10103).portr("P4"); map(0x1fa10200, 0x1fa10200).r(FUNC(zn_state::boardconfig_r)); map(0x1fa10300, 0x1fa10300).rw(FUNC(zn_state::znsecsel_r), FUNC(zn_state::znsecsel_w)); - map(0x1fa20000, 0x1fa20000).w(FUNC(zn_state::coin_w)); - map(0x1fa30000, 0x1fa30003).noprw(); /* ?? */ map(0x1fa40000, 0x1fa40003).nopr(); /* ?? */ - map(0x1fa60000, 0x1fa60003).nopr(); /* ?? */ map(0x1faf0000, 0x1faf07ff).rw("at28c16", FUNC(at28c16_device::read), FUNC(at28c16_device::write)); /* EEPROM */ map(0x1fb20000, 0x1fb20007).r(FUNC(zn_state::unknown_r)); } -void zn_state::zn1_1mb_vram(machine_config &config) +void zn_state::zn_rom_base_map(address_map &map) +{ + zn_base_map(map); + map(0x1fa20000, 0x1fa20000).w(FUNC(zn_state::coin_w)); + map(0x1fa30000, 0x1fa30003).noprw(); /* ?? */ + map(0x1fa60000, 0x1fa60003).nopr(); /* ?? */ +} + +void zn_state::zn_1mb_vram(machine_config &config) { /* basic machine hardware */ CXD8530CQ(config, m_maincpu, XTAL(67'737'600)); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::zn_map); + m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::zn_rom_base_map); m_maincpu->subdevice<ram_device>("ram")->set_default_size("4M"); @@ -407,8 +187,6 @@ void zn_state::zn1_1mb_vram(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - GENERIC_LATCH_8(config, m_soundlatch); - spu_device &spu(SPU(config, "spu", XTAL(67'737'600)/2, subdevice<psxcpu_device>("maincpu"))); spu.add_route(0, "lspeaker", 0.35); spu.add_route(1, "rspeaker", 0.35); @@ -416,17 +194,18 @@ void zn_state::zn1_1mb_vram(machine_config &config) AT28C16(config, "at28c16", 0); } -void zn_state::zn1_2mb_vram(machine_config &config) +void zn_state::zn_2mb_vram(machine_config &config) { - zn1_1mb_vram(config); + zn_1mb_vram(config); CXD8561Q(config.replace(), "gpu", XTAL(53'693'175), 0x200000, subdevice<psxcpu_device>("maincpu")).set_screen("screen"); } +// used in Capcom ZN2, Taito GNET void zn_state::zn2(machine_config &config) { /* basic machine hardware */ CXD8661R(config, m_maincpu, XTAL(100'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::zn_map); + m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::zn_rom_base_map); m_maincpu->subdevice<ram_device>("ram")->set_default_size("4M"); auto &sio0(*m_maincpu->subdevice<psxsio0_device>("sio0")); @@ -453,8 +232,6 @@ void zn_state::zn2(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - GENERIC_LATCH_8(config, m_soundlatch); - spu_device &spu(SPU(config, "spu", XTAL(67'737'600)/2, subdevice<psxcpu_device>("maincpu"))); spu.add_route(0, "lspeaker", 0.35); spu.add_route(1, "rspeaker", 0.35); @@ -586,89 +363,87 @@ Notes: Unpopulated sockets - 1.3B, 2.2E, 3.3E, 8.2K, 9.3K, 10.4K, 11.5K, 12.6K & 13.7K */ -READ16_MEMBER(zn_state::capcom_kickharness_r) +READ16_MEMBER(capcom_zn_state::kickharness_r) { /* required for buttons 4,5&6 */ verboselog(2, "capcom_kickharness_r( %08x, %08x )\n", offset, mem_mask ); return 0xffff; } -WRITE8_MEMBER(zn_state::bank_coh1000c_w) +WRITE8_MEMBER(capcom_zn_state::bank_w) { - m_rombank[0]->set_entry( data & 0x0f); + m_rombank->set_entry( data & 0x0f); } -WRITE8_MEMBER(zn_state::qsound_bankswitch_w) +WRITE8_MEMBER(capcom_zn_state::qsound_bankswitch_w) { m_soundbank->set_entry( data & 0x0f ); } -INTERRUPT_GEN_MEMBER(zn_state::qsound_interrupt) +INTERRUPT_GEN_MEMBER(capcom_zn_state::qsound_interrupt) { device.execute().set_input_line(0, HOLD_LINE); } -void zn_state::coh1000c_map(address_map &map) +void capcom_zn_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); map(0x1f000000, 0x1f3fffff).rom().region("bankedroms", 0); - map(0x1f400000, 0x1f7fffff).bankr("rombank1"); - map(0x1fb00000, 0x1fb00000).w(FUNC(zn_state::bank_coh1000c_w)); - map(0x1fb40010, 0x1fb40011).r(FUNC(zn_state::capcom_kickharness_r)); - map(0x1fb40020, 0x1fb40021).r(FUNC(zn_state::capcom_kickharness_r)); + map(0x1f400000, 0x1f7fffff).bankr("rombank"); + map(0x1fb00000, 0x1fb00000).w(FUNC(capcom_zn_state::bank_w)); + map(0x1fb40010, 0x1fb40011).r(FUNC(capcom_zn_state::kickharness_r)); + map(0x1fb40020, 0x1fb40021).r(FUNC(capcom_zn_state::kickharness_r)); map(0x1fb80000, 0x1fbfffff).rom().region("countryrom", 0); map(0x1fb60000, 0x1fb60000).w(m_soundlatch, FUNC(generic_latch_8_device::write)); } -MACHINE_START_MEMBER(zn_state,coh1000c) +void capcom_zn_state::machine_start() { - m_rombank[0]->configure_entries( 0, 16, m_bankedroms->base() + 0x400000, 0x400000 ); /* banked game ROM */ + m_rombank->configure_entries( 0, 16, m_bankedroms->base() + 0x400000, 0x400000 ); /* banked game ROM */ m_soundbank->configure_entries( 0, 16, memregion("audiocpu")->base() + 0x8000, 0x4000 ); /* banked audio ROM */ } -MACHINE_RESET_MEMBER(zn_state,coh1000c) +void capcom_zn_state::machine_reset() { - m_rombank[0]->set_entry( 0 ); + m_rombank->set_entry( 0 ); m_soundbank->set_entry( 0 ); } -MACHINE_RESET_MEMBER(zn_state,glpracr) +void glpracr_state::machine_reset() { + capcom_zn_state::machine_reset(); m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // glpracr QSound ROM sockets are empty - MACHINE_RESET_CALL_MEMBER(coh1000c); } -void zn_state::qsound_map(address_map &map) +void capcom_zn_state::qsound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("soundbank"); /* banked (contains music data) */ map(0xd000, 0xd002).w("qsound", FUNC(qsound_device::qsound_w)); - map(0xd003, 0xd003).w(FUNC(zn_state::qsound_bankswitch_w)); + map(0xd003, 0xd003).w(FUNC(capcom_zn_state::qsound_bankswitch_w)); map(0xd007, 0xd007).r("qsound", FUNC(qsound_device::qsound_r)); map(0xf000, 0xffff).ram(); } -void zn_state::qsound_portmap(address_map &map) +void capcom_zn_state::qsound_portmap(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).r(m_soundlatch, FUNC(generic_latch_8_device::read)); } -void zn_state::coh1000c(machine_config &config) +void capcom_zn_state::zn_base(machine_config &config) { - zn1_1mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000c_map); + m_maincpu->set_addrmap(AS_PROGRAM, &capcom_zn_state::main_map); Z80(config, m_audiocpu, XTAL(8'000'000)); - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::qsound_map); - m_audiocpu->set_addrmap(AS_IO, &zn_state::qsound_portmap); - m_audiocpu->set_periodic_int(FUNC(zn_state::qsound_interrupt), attotime::from_hz(250)); // measured (cps2.cpp) + m_audiocpu->set_addrmap(AS_PROGRAM, &capcom_zn_state::qsound_map); + m_audiocpu->set_addrmap(AS_IO, &capcom_zn_state::qsound_portmap); + m_audiocpu->set_periodic_int(FUNC(capcom_zn_state::qsound_interrupt), attotime::from_hz(250)); // measured (cps2.cpp) - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1000c) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1000c) + GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); @@ -677,32 +452,16 @@ void zn_state::coh1000c(machine_config &config) qsound.add_route(1, "rspeaker", 1.0); } -void zn_state::glpracr(machine_config &config) +void zn1_state::coh1000c(machine_config &config) { - coh1000c(config); - MCFG_MACHINE_RESET_OVERRIDE(zn_state, glpracr) + zn_1mb_vram(config); + zn_base(config); } -void zn_state::coh1002c(machine_config &config) +void zn1_state::coh1002c(machine_config &config) { - zn1_2mb_vram(config); - gameboard_cat702(config); - - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000c_map); - - Z80(config, m_audiocpu, XTAL(8'000'000)); - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::qsound_map); - m_audiocpu->set_addrmap(AS_IO, &zn_state::qsound_portmap); - m_audiocpu->set_periodic_int(FUNC(zn_state::qsound_interrupt), attotime::from_hz(250)); // measured (cps2.cpp) - - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1000c) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1000c) - - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - - qsound_device &qsound(QSOUND(config, "qsound")); - qsound.add_route(0, "lspeaker", 1.0); - qsound.add_route(1, "rspeaker", 1.0); + zn_2mb_vram(config); + zn_base(config); } /* @@ -846,26 +605,10 @@ Notes: Unpopulated sockets on Rival Schools - None */ -void zn_state::coh3002c(machine_config &config) +void zn2_state::coh3002c(machine_config &config) { zn2(config); - gameboard_cat702(config); - - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000c_map); - - Z80(config, m_audiocpu, XTAL(8'000'000)); - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::qsound_map); - m_audiocpu->set_addrmap(AS_IO, &zn_state::qsound_portmap); - m_audiocpu->set_periodic_int(FUNC(zn_state::qsound_interrupt), attotime::from_hz(250)); // measured (cps2.cpp) - - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1000c) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1000c) - - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - - qsound_device &qsound(QSOUND(config, "qsound")); - qsound.add_route(0, "lspeaker", 1.0); - qsound.add_route(1, "rspeaker", 1.0); + zn_base(config); } /* @@ -1088,48 +831,56 @@ Notes: FM1208S - RAMTRON 4096bit Nonvolatile Ferroelectric RAM (512w x 8b) */ -WRITE8_MEMBER(zn_state::bank_coh1000t_w) +WRITE8_MEMBER(taito_fx_state::bank_w) { - verboselog(1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); + verboselog(1, "bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); m_mb3773->write_line_ck((data & 0x20) >> 5); - m_rombank[0]->set_entry( data & 3 ); + m_rombank->set_entry( data & 3 ); } -WRITE8_MEMBER(zn_state::fx1a_sound_bankswitch_w) +WRITE8_MEMBER(taito_fx1a_state::sound_bankswitch_w) { m_soundbank->set_entry( data & 0x07 ); } -void zn_state::coh1000ta_map(address_map &map) +void taito_fx1a_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); - map(0x1f000000, 0x1f7fffff).bankr("rombank1"); - map(0x1fb40000, 0x1fb40000).w(FUNC(zn_state::bank_coh1000t_w)); + map(0x1f000000, 0x1f7fffff).bankr("rombank"); + map(0x1fb40000, 0x1fb40000).w(FUNC(taito_fx1a_state::bank_w)); map(0x1fb80000, 0x1fb80000).w("tc0140syt", FUNC(tc0140syt_device::master_port_w)); map(0x1fb80002, 0x1fb80002).rw("tc0140syt", FUNC(tc0140syt_device::master_comm_r), FUNC(tc0140syt_device::master_comm_w)); } -MACHINE_START_MEMBER(zn_state,coh1000ta) +void taito_fx_state::machine_start() { - m_rombank[0]->configure_entries( 0, 4, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ - if (m_soundbank.found()) - { - m_soundbank->configure_entry( 0, memregion( "audiocpu" )->base() + 0x20000 ); /* TODO : Bank 0 is addressing First 16 KB of ROM? */ - m_soundbank->configure_entries( 1, 7, memregion( "audiocpu" )->base() + 0x4000, 0x4000 ); - } + zn_state::machine_start(); + + m_rombank->configure_entries( 0, 4, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ } -MACHINE_RESET_MEMBER(zn_state,coh1000ta) +void taito_fx_state::machine_reset() { - m_rombank[0]->set_entry( 0 ); - if (m_soundbank.found()) - m_soundbank->set_entry( 1 ); + m_rombank->set_entry( 0 ); +} + +void taito_fx1a_state::machine_start() +{ + taito_fx_state::machine_start(); + m_soundbank->configure_entry( 0, memregion( "audiocpu" )->base() + 0x20000 ); /* TODO : Bank 0 is addressing First 16 KB of ROM? */ + m_soundbank->configure_entries( 1, 7, memregion( "audiocpu" )->base() + 0x4000, 0x4000 ); } -void zn_state::fx1a_sound_map(address_map &map) +void taito_fx1a_state::machine_reset() +{ + taito_fx_state::machine_reset(); + m_soundbank->set_entry( 1 ); +} + +void taito_fx1a_state::sound_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x7fff).bankr("soundbank"); @@ -1140,22 +891,19 @@ void zn_state::fx1a_sound_map(address_map &map) map(0xe400, 0xe403).nopw(); /* pan */ map(0xee00, 0xee00).noprw(); /* ? */ map(0xf000, 0xf000).nopw(); /* ? */ - map(0xf200, 0xf200).w(FUNC(zn_state::fx1a_sound_bankswitch_w)); + map(0xf200, 0xf200).w(FUNC(taito_fx1a_state::sound_bankswitch_w)); } -void zn_state::coh1000ta(machine_config &config) +void taito_fx1a_state::coh1000ta(machine_config &config) { - zn1_1mb_vram(config); + zn_1mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000ta_map); + m_maincpu->set_addrmap(AS_PROGRAM, &taito_fx1a_state::main_map); Z80(config, m_audiocpu, XTAL(16'000'000) / 4); /* 4 MHz */ - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::fx1a_sound_map); - - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1000ta) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1000ta) + m_audiocpu->set_addrmap(AS_PROGRAM, &taito_fx1a_state::sound_map); ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 16_MHz_XTAL/2)); ymsnd.irq_handler().set_inputline(m_audiocpu, 0); @@ -1164,29 +912,29 @@ void zn_state::coh1000ta(machine_config &config) ymsnd.add_route(1, "lspeaker", 1.0); ymsnd.add_route(2, "rspeaker", 1.0); - MB3773(config, "mb3773"); + MB3773(config, m_mb3773); tc0140syt_device &tc0140syt(TC0140SYT(config, "tc0140syt", 0)); tc0140syt.set_master_tag(m_maincpu); tc0140syt.set_slave_tag(m_audiocpu); } -WRITE8_MEMBER(zn_state::fx1b_fram_w) +WRITE8_MEMBER(taito_fx1b_state::fram_w) { - m_fx1b_fram[offset] = data; + m_fram[offset] = data; } -READ8_MEMBER(zn_state::fx1b_fram_r) +READ8_MEMBER(taito_fx1b_state::fram_r) { - return m_fx1b_fram[offset]; + return m_fram[offset]; } -void zn_state::coh1000tb_map(address_map &map) +void taito_fx1b_state::main_map(address_map &map) { - zn_map(map); - map(0x1f000000, 0x1f7fffff).bankr("rombank1"); - map(0x1fb00000, 0x1fb003ff).rw(FUNC(zn_state::fx1b_fram_r), FUNC(zn_state::fx1b_fram_w)).umask32(0x00ff00ff); - map(0x1fb40000, 0x1fb40000).w(FUNC(zn_state::bank_coh1000t_w)); + zn_rom_base_map(map); + map(0x1f000000, 0x1f7fffff).bankr("rombank"); + map(0x1fb00000, 0x1fb003ff).rw(FUNC(taito_fx1b_state::fram_r), FUNC(taito_fx1b_state::fram_w)).umask32(0x00ff00ff); + map(0x1fb40000, 0x1fb40000).w(FUNC(taito_fx1b_state::bank_w)); map(0x1fb80000, 0x1fb80001).w(m_zoom, FUNC(taito_zoom_device::reg_data_w)); map(0x1fb80002, 0x1fb80003).w(m_zoom, FUNC(taito_zoom_device::reg_address_w)); map(0x1fba0000, 0x1fba0001).w(m_zoom, FUNC(taito_zoom_device::sound_irq_w)); @@ -1194,27 +942,26 @@ void zn_state::coh1000tb_map(address_map &map) map(0x1fbe0000, 0x1fbe01ff).rw(m_zoom, FUNC(taito_zoom_device::shared_ram_r), FUNC(taito_zoom_device::shared_ram_w)).umask32(0x00ff00ff); // M66220FP for comm with the MN10200 } -void zn_state::init_coh1000tb() +void taito_fx1b_state::machine_start() { - m_fx1b_fram = std::make_unique<uint8_t[]>(0x200); - subdevice<nvram_device>("fm1208s")->set_base(m_fx1b_fram.get(), 0x200); + taito_fx_state::machine_start(); + + m_fram = std::make_unique<uint8_t[]>(0x200); + m_fm1208s->set_base(m_fram.get(), 0x200); - save_pointer(NAME(m_fx1b_fram), 0x200); + save_pointer(NAME(m_fram), 0x200); } -void zn_state::coh1000tb(machine_config &config) +void taito_fx1b_state::base_config(machine_config &config) { - zn1_1mb_vram(config); gameboard_cat702(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000tb_map); + m_maincpu->set_addrmap(AS_PROGRAM, &taito_fx1b_state::main_map); - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1000ta) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1000ta) - NVRAM(config, "fm1208s", nvram_device::DEFAULT_ALL_1); + NVRAM(config, m_fm1208s, nvram_device::DEFAULT_ALL_1); - MB3773(config, "mb3773"); + MB3773(config, m_mb3773); /* sound hardware */ subdevice<spu_device>("spu")->reset_routes(); @@ -1226,28 +973,16 @@ void zn_state::coh1000tb(machine_config &config) m_zoom->add_route(1, "rspeaker", 1.0); } -void zn_state::coh1002tb(machine_config &config) +void taito_fx1b_state::coh1000tb(machine_config &config) { - zn1_2mb_vram(config); - gameboard_cat702(config); - - /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000tb_map); - - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1000ta) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1000ta) - NVRAM(config, "fm1208s", nvram_device::DEFAULT_ALL_1); - - MB3773(config, "mb3773"); - - /* sound hardware */ - subdevice<spu_device>("spu")->reset_routes(); - subdevice<spu_device>("spu")->add_route(0, "lspeaker", 0.3); - subdevice<spu_device>("spu")->add_route(1, "rspeaker", 0.3); + zn_1mb_vram(config); + base_config(config); +} - TAITO_ZOOM(config, m_zoom); - m_zoom->add_route(0, "lspeaker", 1.0); - m_zoom->add_route(1, "rspeaker", 1.0); +void gdarius_state::coh1002tb(machine_config &config) +{ + zn_2mb_vram(config); + base_config(config); } /* @@ -1367,7 +1102,7 @@ Notes: *2 - Unpopulated DIP28 socket */ -void zn_state::atpsx_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) +void primrag2_state::dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { // logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address); @@ -1387,12 +1122,12 @@ void zn_state::atpsx_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t } } -void zn_state::atpsx_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) +void primrag2_state::dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { logerror("DMA write from %08x for %d bytes\n", n_address, n_size<<2); } -READ16_MEMBER(zn_state::vt83c461_16_r) +READ16_MEMBER(primrag2_state::vt83c461_16_r) { int shift = (16 * (offset & 1)); @@ -1415,7 +1150,7 @@ READ16_MEMBER(zn_state::vt83c461_16_r) } } -WRITE16_MEMBER(zn_state::vt83c461_16_w) +WRITE16_MEMBER(primrag2_state::vt83c461_16_w) { int shift = (16 * (offset & 1)); @@ -1437,7 +1172,7 @@ WRITE16_MEMBER(zn_state::vt83c461_16_w) } } -READ16_MEMBER(zn_state::vt83c461_32_r) +READ16_MEMBER(primrag2_state::vt83c461_32_r) { if( offset == 0x1f0/2 ) { @@ -1456,34 +1191,35 @@ READ16_MEMBER(zn_state::vt83c461_32_r) } } -WRITE16_MEMBER(zn_state::vt83c461_32_w) +WRITE16_MEMBER(primrag2_state::vt83c461_32_w) { logerror( "unhandled 32 bit write %04x %04x %04x\n", offset, data, mem_mask ); } -void zn_state::init_primrag2() +void primrag2_state::machine_start() { + zn_state::machine_start(); save_item(NAME(m_vt83c461_latch)); } -void zn_state::coh1000w_map(address_map &map) +void primrag2_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); map(0x1f000000, 0x1f1fffff).rom().region("roms", 0); map(0x1f000000, 0x1f000003).w("watchdog", FUNC(watchdog_timer_device::reset16_w)).umask16(0xffff); // ds1232s map(0x1f7e8000, 0x1f7e8003).noprw(); - map(0x1f7e4000, 0x1f7e4fff).rw(FUNC(zn_state::vt83c461_16_r), FUNC(zn_state::vt83c461_16_w)); - map(0x1f7f4000, 0x1f7f4fff).rw(FUNC(zn_state::vt83c461_32_r), FUNC(zn_state::vt83c461_32_w)); + map(0x1f7e4000, 0x1f7e4fff).rw(FUNC(primrag2_state::vt83c461_16_r), FUNC(primrag2_state::vt83c461_16_w)); + map(0x1f7f4000, 0x1f7f4fff).rw(FUNC(primrag2_state::vt83c461_32_r), FUNC(primrag2_state::vt83c461_32_w)); } -void zn_state::coh1000w(machine_config &config) +void primrag2_state::coh1000w(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000w_map); + m_maincpu->set_addrmap(AS_PROGRAM, &primrag2_state::main_map); m_maincpu->subdevice<ram_device>("ram")->set_default_size("8M"); - m_maincpu->subdevice<psxdma_device>("dma")->install_read_handler(5, psxdma_device::read_delegate(&zn_state::atpsx_dma_read, this)); - m_maincpu->subdevice<psxdma_device>("dma")->install_write_handler(5, psxdma_device::write_delegate(&zn_state::atpsx_dma_write, this)); + m_maincpu->subdevice<psxdma_device>("dma")->install_read_handler(5, psxdma_device::read_delegate(&primrag2_state::dma_read, this)); + m_maincpu->subdevice<psxdma_device>("dma")->install_write_handler(5, psxdma_device::write_delegate(&primrag2_state::dma_write, this)); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_msec(600)); /* 600ms Ds1232 TD floating */ @@ -1639,43 +1375,52 @@ Notes: */ -WRITE8_MEMBER(zn_state::coh1002e_bank_w) +WRITE8_MEMBER(raizing_zn_state::bank_w) { znsecsel_w( space, offset, data, mem_mask ); - m_rombank[0]->set_entry( data & 3 ); + m_rombank->set_entry( data & 3 ); } -WRITE8_MEMBER(zn_state::coh1002e_sound_irq_w) +WRITE8_MEMBER(raizing_zn_state::sound_irq_w) { m_audiocpu->set_input_line(2, HOLD_LINE); // irq 2 on the 68k } -void zn_state::coh1002e_map(address_map &map) +void raizing_zn_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); - map(0x1f000000, 0x1f7fffff).bankr("rombank1"); - map(0x1fa10300, 0x1fa10300).w(FUNC(zn_state::coh1002e_bank_w)); + map(0x1f000000, 0x1f7fffff).bankr("rombank"); + map(0x1fa10300, 0x1fa10300).w(FUNC(raizing_zn_state::bank_w)); map(0x1fb00000, 0x1fb00000).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x1fb00004, 0x1fb00004).w(FUNC(zn_state::coh1002e_sound_irq_w)); + map(0x1fb00004, 0x1fb00004).w(FUNC(raizing_zn_state::sound_irq_w)); } -MACHINE_START_MEMBER(zn_state,coh1002e) +void raizing_zn_state::machine_start() { - m_rombank[0]->configure_entries( 0, 4, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ - if (m_okibank.found()) - m_okibank->configure_entries( 0, memregion( "oki" )->bytes()/0x10000, memregion( "oki" )->base(), 0x10000 ); /* not verified */ + zn_state::machine_start(); + m_rombank->configure_entries( 0, 4, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ } -MACHINE_RESET_MEMBER(zn_state,coh1002e) +void raizing_zn_state::machine_reset() { - m_rombank[0]->set_entry( 0 ); - if (m_okibank.found()) - m_okibank->set_entry( 0 ); + m_rombank->set_entry( 0 ); +} + +void beastrzrb_state::machine_start() +{ + raizing_zn_state::machine_start(); + m_okibank->configure_entries( 0, memregion( "oki" )->bytes()/0x10000, memregion( "oki" )->base(), 0x10000 ); /* not verified */ +} + +void beastrzrb_state::machine_reset() +{ + raizing_zn_state::machine_reset(); + m_okibank->set_entry( 0 ); } -void zn_state::psarc_snd_map(address_map &map) +void raizing_zn_state::psarc_sound_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x080000, 0x0fffff).ram(); @@ -1685,52 +1430,50 @@ void zn_state::psarc_snd_map(address_map &map) map(0x100020, 0xffffff).nopw(); } -void zn_state::beastrzrb_snd_map(address_map &map) +void beastrzrb_state::sound_map(address_map &map) { // Internal ROM Not dumped // map(0x0000, 0x0fff).rom(); } -void zn_state::oki_map(address_map &map) +void beastrzrb_state::oki_map(address_map &map) { map(0x00000, 0x2ffff).rom(); map(0x30000, 0x3ffff).bankr("okibank"); } -void zn_state::coh1002e(machine_config &config) +void raizing_zn_state::coh1002e(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1002e_map); + m_maincpu->set_addrmap(AS_PROGRAM, &raizing_zn_state::main_map); M68000(config, m_audiocpu, XTAL(12'000'000)); - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::psarc_snd_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &raizing_zn_state::psarc_sound_map); - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1002e) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1002e) + GENERIC_LATCH_8(config, m_soundlatch); ymf271_device &ymf(YMF271(config, "ymf", XTAL(16'934'400))); ymf.add_route(0, "lspeaker", 1.0); ymf.add_route(1, "rspeaker", 1.0); } -void zn_state::beastrzrb(machine_config &config) +void beastrzrb_state::beastrzrb(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); // TODO: hook up bootleg protection - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1002e_map); + m_maincpu->set_addrmap(AS_PROGRAM, &beastrzrb_state::main_map); AT89C4051(config, m_audiocpu, XTAL(12'000'000)); // clock unverified - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::beastrzrb_snd_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &beastrzrb_state::sound_map); - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1002e) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1002e) + GENERIC_LATCH_8(config, m_soundlatch); okim6295_device &oki(OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_LOW)); // clock frequency & pin 7 not verified oki.add_route(ALL_OUTPUTS, "lspeaker", 1.0); oki.add_route(ALL_OUTPUTS, "rspeaker", 1.0); - oki.set_addrmap(0, &zn_state::oki_map); + oki.set_addrmap(0, &beastrzrb_state::oki_map); } @@ -1787,33 +1530,33 @@ MTR-BAM* - DIP42 32MBit maskROMs */ -WRITE16_MEMBER(zn_state::bam2_mcu_w) +WRITE16_MEMBER(bam2_state::mcu_w) { switch( offset ) { case 0: - m_rombank[0]->set_entry( data & 0xf ); + m_rombank->set_entry( data & 0xf ); break; case 1: - m_bam2_mcu_command = data; - logerror("MCU command: %04x (PC %08x)\n", m_bam2_mcu_command, m_maincpu->pc()); + m_mcu_command = data; + logerror("BAM2 MCU command: %04x (PC %08x)\n", m_mcu_command, m_maincpu->pc()); break; } } -READ16_MEMBER(zn_state::bam2_mcu_r) +READ16_MEMBER(bam2_state::mcu_r) { switch (offset) { case 0: - logerror("MCU port 0 read @ PC %08x mask %08x\n", m_maincpu->pc(), mem_mask); + logerror("BAM2 MCU port 0 read @ PC %08x mask %08x\n", m_maincpu->pc(), mem_mask); break; case 2: - logerror("MCU status read @ PC %08x mask %08x\n", m_maincpu->pc(), mem_mask); + logerror("BAM2 MCU status read @ PC %08x mask %08x\n", m_maincpu->pc(), mem_mask); - switch (m_bam2_mcu_command) + switch (m_mcu_command) { case 0x7f: // first drive check case 0x1c: // second drive check (causes HDD detected) @@ -1826,45 +1569,40 @@ READ16_MEMBER(zn_state::bam2_mcu_r) return 0; } -READ16_MEMBER(zn_state::bam2_unk_r) +READ16_MEMBER(bam2_state::unk_r) { return 0; } -void zn_state::bam2_map(address_map &map) +void bam2_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); map(0x1f000000, 0x1f3fffff).rom().region("bankedroms", 0); - map(0x1f400000, 0x1f7fffff).bankr("rombank1"); - map(0x1fa20000, 0x1fa20001).r(FUNC(zn_state::bam2_unk_r)); - map(0x1fb00000, 0x1fb00007).rw(FUNC(zn_state::bam2_mcu_r), FUNC(zn_state::bam2_mcu_w)); + map(0x1f400000, 0x1f7fffff).bankr("rombank"); + map(0x1fa20000, 0x1fa20001).r(FUNC(bam2_state::unk_r)); + map(0x1fb00000, 0x1fb00007).rw(FUNC(bam2_state::mcu_r), FUNC(bam2_state::mcu_w)); } -void zn_state::init_bam2() +void bam2_state::machine_start() { - save_item(NAME(m_bam2_mcu_command)); -} + zn_state::machine_start(); + save_item(NAME(m_mcu_command)); -MACHINE_START_MEMBER(zn_state,bam2) -{ - m_rombank[0]->configure_entries( 0, 16, m_bankedroms->base(), 0x400000 ); /* banked game ROM */ + m_rombank->configure_entries( 0, 16, m_bankedroms->base(), 0x400000 ); /* banked game ROM */ } -MACHINE_RESET_MEMBER(zn_state,bam2) +void bam2_state::machine_reset() { - m_rombank[0]->set_entry( 1 ); + m_rombank->set_entry( 1 ); } -void zn_state::bam2(machine_config &config) +void bam2_state::bam2(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::bam2_map); - - MCFG_MACHINE_START_OVERRIDE(zn_state, bam2) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, bam2) + m_maincpu->set_addrmap(AS_PROGRAM, &bam2_state::main_map); } /* @@ -2038,29 +1776,28 @@ Notes: * - Unpopulated DIP42 socket */ -READ_LINE_MEMBER(zn_state::jdredd_gun_mux_r) +READ_LINE_MEMBER(jdredd_state::gun_mux_r) { - return m_jdredd_gun_mux; + return m_gun_mux; } -WRITE_LINE_MEMBER(zn_state::jdredd_vblank) +WRITE_LINE_MEMBER(jdredd_state::vblank) { - int x; - int y; - if (state) { - m_jdredd_gun_mux = !m_jdredd_gun_mux; + m_gun_mux = !m_gun_mux; - if( m_jdredd_gun_mux == 0 ) + int x; + int y; + if (!m_gun_mux) { - x = ioport("GUN1X")->read(); - y = ioport("GUN1Y")->read(); + x = m_gun_x[0]->read(); + y = m_gun_y[0]->read(); } else { - x = ioport("GUN2X")->read(); - y = ioport("GUN2Y")->read(); + x = m_gun_x[1]->read(); + y = m_gun_y[1]->read(); } if( x > 0x393 && x < 0xcb2 && @@ -2071,135 +1808,137 @@ WRITE_LINE_MEMBER(zn_state::jdredd_vblank) } } -WRITE16_MEMBER(zn_state::acpsx_00_w) +WRITE16_MEMBER(acclaim_zn_state::acpsx_00_w) { verboselog(0, "acpsx_00_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); } -WRITE16_MEMBER(zn_state::nbajamex_bank_w) +WRITE16_MEMBER(nbajamex_state::bank_w) { - verboselog(0, "nbajamex_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); + verboselog(0, "bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); if (offset > 1) { logerror("Unknown banking offset %x!\n", offset); } - m_nbajamex_rombank[offset] = data; + m_curr_rombank[offset] = data; - uint32_t bankbase0 = ((m_nbajamex_rombank[0] & 0x10) ? 1 : 0) | ((m_nbajamex_rombank[0] & 7) << 1); - uint32_t bankbase1 = ((m_nbajamex_rombank[1] & 0x10) ? 0 : 1) | ((m_nbajamex_rombank[1] & 7) << 1); + uint32_t bankbase0 = ((m_curr_rombank[0] & 0x10) ? 1 : 0) | ((m_curr_rombank[0] & 7) << 1); + uint32_t bankbase1 = ((m_curr_rombank[1] & 0x10) ? 0 : 1) | ((m_curr_rombank[1] & 7) << 1); if (offset == 0) { - if (m_nbajamex_rombank[0] == 0) + if (m_curr_rombank[0] == 0) { - m_nbajamex_bankmap->set_bank(0); + m_bankmap->set_bank(0); } else { - m_nbajamex_bankmap->set_bank(1); + m_bankmap->set_bank(1); m_rombank[1]->set_entry(bankbase1); } m_rombank[0]->set_entry(bankbase0); } else if (offset == 1) { - if (m_nbajamex_rombank[0] != 0) + if (m_curr_rombank[0] != 0) { - m_nbajamex_bankmap->set_bank(1); + m_bankmap->set_bank(1); m_rombank[1]->set_entry(bankbase1); } } } -WRITE16_MEMBER(zn_state::acpsx_10_w) +WRITE16_MEMBER(acclaim_zn_state::acpsx_10_w) { verboselog(0, "acpsx_10_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); } // all 16 bits goes to the external soundboard's latch (see sound test menu) -WRITE16_MEMBER(zn_state::nbajamex_80_w) +WRITE16_MEMBER(nbajamex_state::sound_80_w) { m_rax->data_w(space, 0, data, 0xffff); } -READ16_MEMBER(zn_state::nbajamex_08_r) +READ16_MEMBER(nbajamex_state::sound_08_r) { // Sound related verboselog(0, "nbajamex_08_r( %08x, %08x, %08x )\n", offset, 0, mem_mask ); return 0x400; } -READ16_MEMBER(zn_state::nbajamex_80_r) +READ16_MEMBER(nbajamex_state::sound_80_r) { verboselog(0, "nbajamex_80_r( %08x, %08x, %08x )\n", offset, 0, mem_mask ); return 0xffff; } -WRITE8_MEMBER(zn_state::nbajamex_backup_w) +WRITE8_MEMBER(nbajamex_state::backup_w) { - m_nbajamex_sram[offset] = data; + m_sram[offset] = data; } -void zn_state::coh1000a_map(address_map &map) +void acclaim_zn_state::coh1000a_map(address_map &map) { - zn_map(map); - map(0x1fbfff00, 0x1fbfff03).w(FUNC(zn_state::acpsx_00_w)); - map(0x1fbfff12, 0x1fbfff13).w(FUNC(zn_state::acpsx_10_w)); + zn_rom_base_map(map); + map(0x1fbfff00, 0x1fbfff03).w(FUNC(acclaim_zn_state::acpsx_00_w)); + map(0x1fbfff12, 0x1fbfff13).w(FUNC(acclaim_zn_state::acpsx_10_w)); } -void zn_state::nbajamex_map(address_map &map) +void nbajamex_state::main_map(address_map &map) { coh1000a_map(map); - map(0x1f000000, 0x1f7fffff).m(m_nbajamex_bankmap, FUNC(address_map_bank_device::amap32)); - map(0x1fbfff00, 0x1fbfff07).w(FUNC(zn_state::nbajamex_bank_w)); - map(0x1fbfff08, 0x1fbfff09).r(FUNC(zn_state::nbajamex_08_r)); - map(0x1fbfff80, 0x1fbfff81).rw(FUNC(zn_state::nbajamex_80_r), FUNC(zn_state::nbajamex_80_w)); + map(0x1f000000, 0x1f7fffff).m(m_bankmap, FUNC(address_map_bank_device::amap32)); + map(0x1fbfff00, 0x1fbfff07).w(FUNC(nbajamex_state::bank_w)); + map(0x1fbfff08, 0x1fbfff09).r(FUNC(nbajamex_state::sound_08_r)); + map(0x1fbfff80, 0x1fbfff81).rw(FUNC(nbajamex_state::sound_80_r), FUNC(nbajamex_state::sound_80_w)); } -void zn_state::nbajamex_bank_map(address_map &map) +void nbajamex_state::bank_map(address_map &map) { map(0x000000, 0x1fffff).mirror(0x800000).bankr("rombank1"); - map(0x200000, 0x207fff).mirror(0x800000).w(FUNC(zn_state::nbajamex_backup_w)); + map(0x200000, 0x207fff).mirror(0x800000).w(FUNC(nbajamex_state::backup_w)); map(0x200000, 0x207fff).bankr("sram"); map(0xa00000, 0xffffff).bankr("rombank2"); } -void zn_state::init_nbajamex() +void nbajamex_state::driver_init() { - m_nbajamex_sram = std::make_unique<uint8_t[]>(0x8000); - subdevice<nvram_device>("71256")->set_base(m_nbajamex_sram.get(), 0x8000); + m_sram = std::make_unique<uint8_t[]>(0x8000); + subdevice<nvram_device>("71256")->set_base(m_sram.get(), 0x8000); - save_pointer(NAME(m_nbajamex_sram), 0x8000); + save_pointer(NAME(m_sram), 0x8000); - save_item(NAME(m_nbajamex_rombank)); + save_item(NAME(m_curr_rombank)); } -MACHINE_START_MEMBER(zn_state,nbajamex) +void nbajamex_state::machine_start() { + zn_state::machine_start(); for (int bank = 0; bank < 2; bank++) m_rombank[bank]->configure_entries( 0, 16, m_bankedroms->base(), 0x200000 ); - membank( "sram" )->set_base( m_nbajamex_sram.get() ); + membank( "sram" )->set_base( m_sram.get() ); } -MACHINE_RESET_MEMBER(zn_state,nbajamex) +void nbajamex_state::machine_reset() { - m_nbajamex_bankmap->set_bank( 0 ); + m_bankmap->set_bank( 0 ); m_rombank[0]->set_entry( 0 ); m_rombank[1]->set_entry( 0 ); } -void zn_state::init_jdredd() +void jdredd_state::machine_start() { - save_item(NAME(m_jdredd_gun_mux)); + zn_state::machine_start(); + save_item(NAME(m_gun_mux)); } -void zn_state::jdredd_map(address_map &map) +void jdredd_state::main_map(address_map &map) { coh1000a_map(map); @@ -2208,37 +1947,34 @@ void zn_state::jdredd_map(address_map &map) map(0x1fbfff90, 0x1fbfff9f).rw("ata", FUNC(ata_interface_device::cs0_r), FUNC(ata_interface_device::cs0_w)); } -void zn_state::coh1000a(machine_config &config) +void acclaim_zn_state::coh1000a(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1000a_map); + m_maincpu->set_addrmap(AS_PROGRAM, &acclaim_zn_state::coh1000a_map); } -void zn_state::nbajamex(machine_config &config) +void nbajamex_state::nbajamex(machine_config &config) { coh1000a(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::nbajamex_map); + m_maincpu->set_addrmap(AS_PROGRAM, &nbajamex_state::main_map); NVRAM(config, "71256", nvram_device::DEFAULT_ALL_1); - MCFG_MACHINE_START_OVERRIDE(zn_state, nbajamex) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, nbajamex) - - ADDRESS_MAP_BANK(config, "nbajamex_bankmap").set_map(&zn_state::nbajamex_bank_map).set_options(ENDIANNESS_LITTLE, 32, 24, 0x800000); + ADDRESS_MAP_BANK(config, "nbajamex_bankmap").set_map(&nbajamex_state::bank_map).set_options(ENDIANNESS_LITTLE, 32, 24, 0x800000); - ACCLAIM_RAX(config, "rax", 0); + ACCLAIM_RAX(config, m_rax, 0); } -void zn_state::jdredd(machine_config &config) +void jdredd_state::jdredd(machine_config &config) { coh1000a(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::jdredd_map); + m_maincpu->set_addrmap(AS_PROGRAM, &jdredd_state::main_map); - m_gpu_screen->screen_vblank().set(FUNC(zn_state::jdredd_vblank)); + m_gpu_screen->screen_vblank().set(FUNC(jdredd_state::vblank)); ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, true)); ata.irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10)); @@ -2361,57 +2097,54 @@ Notes: VSync - 60Hz */ -WRITE16_MEMBER(zn_state::coh1001l_sound_unk_w) +WRITE16_MEMBER(atlus_zn_state::sound_unk_w) { // irq ack maybe? logerror("coh1001l_sound_unk_w: %04x %04x\n", data, mem_mask); } -WRITE8_MEMBER(zn_state::coh1001l_bank_w) +WRITE8_MEMBER(atlus_zn_state::bank_w) { - m_rombank[0]->set_entry( data & 3 ); + m_rombank->set_entry( data & 3 ); } -void zn_state::coh1001l_map(address_map &map) +void atlus_zn_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); - map(0x1f000000, 0x1f7fffff).bankr("rombank1"); + map(0x1f000000, 0x1f7fffff).bankr("rombank"); map(0x1fb00000, 0x1fb00001).w(m_soundlatch16, FUNC(generic_latch_16_device::write)); - map(0x1fb00002, 0x1fb00002).w(FUNC(zn_state::coh1001l_bank_w)); + map(0x1fb00002, 0x1fb00002).w(FUNC(atlus_zn_state::bank_w)); } -MACHINE_START_MEMBER(zn_state,coh1001l) +void atlus_zn_state::machine_start() { - m_rombank[0]->configure_entries( 0, 4, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ + zn_state::machine_start(); + m_rombank->configure_entries( 0, 4, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ } -MACHINE_RESET_MEMBER(zn_state,coh1001l) +void atlus_zn_state::machine_reset() { - m_rombank[0]->set_entry( 0 ); + m_rombank->set_entry( 0 ); } -void zn_state::atlus_snd_map(address_map &map) +void atlus_zn_state::sound_map(address_map &map) { map(0x000000, 0x03ffff).rom(); - map(0x100000, 0x100001).r(m_soundlatch16, FUNC(generic_latch_16_device::read)).w(FUNC(zn_state::coh1001l_sound_unk_w)); + map(0x100000, 0x100001).r(m_soundlatch16, FUNC(generic_latch_16_device::read)).w(FUNC(atlus_zn_state::sound_unk_w)); map(0x200000, 0x200003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); map(0x700000, 0x70ffff).ram(); } - -void zn_state::coh1001l(machine_config &config) +void atlus_zn_state::coh1001l(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1001l_map); + m_maincpu->set_addrmap(AS_PROGRAM, &atlus_zn_state::main_map); M68000(config, m_audiocpu, XTAL(10'000'000)); - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::atlus_snd_map); - - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1001l) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1001l) + m_audiocpu->set_addrmap(AS_PROGRAM, &atlus_zn_state::sound_map); GENERIC_LATCH_16(config, m_soundlatch16); m_soundlatch16->data_pending_callback().set_inputline(m_audiocpu, 3); @@ -2435,38 +2168,36 @@ Key: Mother KN01 */ -WRITE8_MEMBER(zn_state::coh1002v_bank_w) +WRITE8_MEMBER(visco_zn_state::bank_w) { - m_rombank[0]->set_entry( data ); + m_rombank->set_entry( data ); } -void zn_state::coh1002v_map(address_map &map) +void visco_zn_state::main_map(address_map &map) { - zn_map(map); + zn_rom_base_map(map); map(0x1f000000, 0x1f27ffff).rom().region("fixedroms", 0); - map(0x1fb00000, 0x1fbfffff).bankr("rombank1"); - map(0x1fb00000, 0x1fb00000).w(FUNC(zn_state::coh1002v_bank_w)); + map(0x1fb00000, 0x1fbfffff).bankr("rombank"); + map(0x1fb00000, 0x1fb00000).w(FUNC(visco_zn_state::bank_w)); } -MACHINE_START_MEMBER(zn_state,coh1002v) +void visco_zn_state::machine_start() { - m_rombank[0]->configure_entries( 0, 24, m_bankedroms->base(), 0x100000 ); /* banked game ROM */ + zn_state::machine_start(); + m_rombank->configure_entries( 0, 24, m_bankedroms->base(), 0x100000 ); /* banked game ROM */ } -MACHINE_RESET_MEMBER(zn_state,coh1002v) +void visco_zn_state::machine_reset() { - m_rombank[0]->set_entry( 0 ); + m_rombank->set_entry( 0 ); } -void zn_state::coh1002v(machine_config &config) +void visco_zn_state::coh1002v(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1002v_map); - - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1002v) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1002v) + m_maincpu->set_addrmap(AS_PROGRAM, &visco_zn_state::main_map); } /* @@ -2627,99 +2358,105 @@ Notes: for 11 more 32MBit smt SOP44 mask ROMs. */ -WRITE8_MEMBER(zn_state::coh1002m_bank_w) +WRITE8_MEMBER(tecmo_zn_state::bank_w) { - verboselog(1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); - m_rombank[0]->set_entry( data ); + verboselog(1, "bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); + m_rombank->set_entry( data ); } -void zn_state::coh1002m_map(address_map &map) +void tecmo_zn_state::base_map(address_map &map) { - zn_map(map); - map(0x1f000000, 0x1f7fffff).bankr("rombank1"); - map(0x1fb00006, 0x1fb00006).w(FUNC(zn_state::coh1002m_bank_w)); + zn_rom_base_map(map); + map(0x1f000000, 0x1f7fffff).bankr("rombank"); + map(0x1fb00006, 0x1fb00006).w(FUNC(tecmo_zn_state::bank_w)); } -MACHINE_START_MEMBER(zn_state,coh1002m) +void tecmo_zn_state::machine_start() { - m_rombank[0]->configure_entries( 0, 8, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ + zn_state::machine_start(); + m_rombank->configure_entries( 0, 8, m_bankedroms->base(), 0x800000 ); /* banked game ROM */ } -MACHINE_RESET_MEMBER(zn_state,coh1002m) +void tecmo_zn_state::machine_reset() { - m_rombank[0]->set_entry( 0 ); + m_rombank->set_entry( 0 ); } -void zn_state::coh1002m(machine_config &config) +void tecmo_zn_state::coh1002m(machine_config &config) { - zn1_2mb_vram(config); + zn_2mb_vram(config); gameboard_cat702(config); - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1002m_map); + m_maincpu->set_addrmap(AS_PROGRAM, &tecmo_zn_state::base_map); +} - MCFG_MACHINE_START_OVERRIDE(zn_state, coh1002m) - MCFG_MACHINE_RESET_OVERRIDE(zn_state, coh1002m) +void tecmo_zn_state::link_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xffff).ram(); } -READ8_MEMBER(zn_state::cbaj_sound_main_status_r) +void tecmo_zn_state::link_port_map(address_map &map) { - // d1: fifo empty flag, other bits: unused(?) - return m_cbaj_fifo[1]->ef_r() << 1; + map.global_mask(0xff); } -void zn_state::coh1002msnd_map(address_map &map) +void tecmo_zn_state::coh1002ml(machine_config &config) { - coh1002m_map(map); - map(0x1fb00000, 0x1fb00000).r("cbaj_fifo2", FUNC(fifo7200_device::data_byte_r)); - map(0x1fb00000, 0x1fb00000).w("cbaj_fifo1", FUNC(fifo7200_device::data_byte_w)); - map(0x1fb00003, 0x1fb00003).r(FUNC(zn_state::cbaj_sound_main_status_r)); + coh1002m(config); + z80_device &link(Z80(config, "link", 4000000)); // ? + link.set_addrmap(AS_PROGRAM, &tecmo_zn_state::link_map); + link.set_addrmap(AS_IO, &tecmo_zn_state::link_port_map); } -READ8_MEMBER(zn_state::cbaj_sound_z80_status_r) +READ8_MEMBER(cbaj_state::sound_main_status_r) { - // d1: fifo empty flag, other bits: unused - return m_cbaj_fifo[0]->ef_r() << 1; + // d1: fifo empty flag, other bits: unused(?) + return m_fifo[1]->ef_r() << 1; } -void zn_state::cbaj_z80_map(address_map &map) +void cbaj_state::main_map(address_map &map) { - map(0x0000, 0x7fff).rom(); - map(0x8000, 0xffff).ram(); + base_map(map); + map(0x1fb00000, 0x1fb00000).r(m_fifo[1], FUNC(fifo7200_device::data_byte_r)); + map(0x1fb00000, 0x1fb00000).w(m_fifo[0], FUNC(fifo7200_device::data_byte_w)); + map(0x1fb00003, 0x1fb00003).r(FUNC(cbaj_state::sound_main_status_r)); } -void zn_state::cbaj_z80_port_map(address_map &map) +READ8_MEMBER(cbaj_state::sound_z80_status_r) { - map.global_mask(0xff); - map(0x84, 0x85).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)); - map(0x90, 0x90).r("cbaj_fifo1", FUNC(fifo7200_device::data_byte_r)); - map(0x90, 0x90).w("cbaj_fifo2", FUNC(fifo7200_device::data_byte_w)); - map(0x91, 0x91).r(FUNC(zn_state::cbaj_sound_z80_status_r)); + // d1: fifo empty flag, other bits: unused + return m_fifo[0]->ef_r() << 1; } -void zn_state::coh1002ml_link_map(address_map &map) +void cbaj_state::z80_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xffff).ram(); } -void zn_state::coh1002ml_link_port_map(address_map &map) +void cbaj_state::z80_port_map(address_map &map) { map.global_mask(0xff); + map(0x84, 0x85).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)); + map(0x90, 0x90).r(m_fifo[0], FUNC(fifo7200_device::data_byte_r)); + map(0x90, 0x90).w(m_fifo[1], FUNC(fifo7200_device::data_byte_w)); + map(0x91, 0x91).r(FUNC(cbaj_state::sound_z80_status_r)); } -void zn_state::coh1002msnd(machine_config &config) +void cbaj_state::cbaj(machine_config &config) { coh1002m(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &zn_state::coh1002msnd_map); + m_maincpu->set_addrmap(AS_PROGRAM, &cbaj_state::main_map); Z80(config, m_audiocpu, XTAL(32'000'000)/8); - m_audiocpu->set_addrmap(AS_PROGRAM, &zn_state::cbaj_z80_map); - m_audiocpu->set_addrmap(AS_IO, &zn_state::cbaj_z80_port_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &cbaj_state::z80_map); + m_audiocpu->set_addrmap(AS_IO, &cbaj_state::z80_port_map); - IDT7202(config, m_cbaj_fifo[0]); // LH540202 - IDT7202(config, m_cbaj_fifo[1]); // " + IDT7202(config, m_fifo[0]); // LH540202 + IDT7202(config, m_fifo[1]); // " config.set_maximum_quantum(attotime::from_hz(6000)); @@ -2729,14 +2466,6 @@ void zn_state::coh1002msnd(machine_config &config) ymz.add_route(1, "rspeaker", 0.35); } -void zn_state::coh1002ml(machine_config &config) -{ - coh1002m(config); - z80_device &link(Z80(config, "link", 4000000)); // ? - link.set_addrmap(AS_PROGRAM, &zn_state::coh1002ml_link_map); - link.set_addrmap(AS_IO, &zn_state::coh1002ml_link_port_map); -} - /* @@ -2893,7 +2622,7 @@ static INPUT_PORTS_START( jdredd ) PORT_BIT( 0x6f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("SERVICE") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zn_state, jdredd_gun_mux_r) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jdredd_state, gun_mux_r) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) @@ -5465,135 +5194,135 @@ ROM_START( hvnsgate ) ROM_END /* Capcom ZN1 */ -GAME( 1995, coh1000c, 0, coh1000c, zn, zn_state, empty_init, ROT0, "Capcom", "ZN1", MACHINE_IS_BIOS_ROOT ) -GAME( 1995, ts2, coh1000c, coh1000c, zn6b, zn_state, empty_init, ROT0, "Capcom / Takara", "Battle Arena Toshinden 2 (USA 951124)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, ts2a, ts2, coh1000c, zn6b, zn_state, empty_init, ROT0, "Capcom / Takara", "Battle Arena Toshinden 2 (USA 951124) Older", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, ts2j, ts2, coh1000c, zn6b, zn_state, empty_init, ROT0, "Capcom / Takara", "Battle Arena Toshinden 2 (Japan 951124)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, starglad, coh1000c, coh1000c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Star Gladiator Episode I: Final Crusade (USA 960627)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, stargladj, starglad, coh1000c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Star Gladiator Episode I: Final Crusade (Japan 960627)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, glpracr, coh1000c, glpracr, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer (English Ver 10.17.K)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, glpracrj, glpracr, glpracr, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer (Japanese Ver 9.01.12)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, sfex, coh1000c, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (Euro 961219)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, sfexu, sfex, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (USA 961219)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, sfexa, sfex, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (Asia 961219)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, sfexj, sfex, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (Japan 961130)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, sfexp, coh1000c, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (USA 970407)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, sfexpu1, sfexp, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (USA 970311)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, sfexpj, sfexp, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (Japan 970407)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, sfexpj1, sfexp, coh1002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (Japan 970311)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, coh1000c, 0, coh1000c, zn, zn1_state, empty_init, ROT0, "Capcom", "ZN1", MACHINE_IS_BIOS_ROOT ) +GAME( 1995, ts2, coh1000c, coh1000c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Takara", "Battle Arena Toshinden 2 (USA 951124)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, ts2a, ts2, coh1000c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Takara", "Battle Arena Toshinden 2 (USA 951124) Older", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, ts2j, ts2, coh1000c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Takara", "Battle Arena Toshinden 2 (Japan 951124)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, starglad, coh1000c, coh1000c, zn6b, zn1_state, empty_init, ROT0, "Capcom", "Star Gladiator Episode I: Final Crusade (USA 960627)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, stargladj, starglad, coh1000c, zn6b, zn1_state, empty_init, ROT0, "Capcom", "Star Gladiator Episode I: Final Crusade (Japan 960627)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, glpracr, coh1000c, coh1000c, zn, glpracr_state, empty_init, ROT0, "Tecmo", "Gallop Racer (English Ver 10.17.K)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, glpracrj, glpracr, coh1000c, zn, glpracr_state, empty_init, ROT0, "Tecmo", "Gallop Racer (Japanese Ver 9.01.12)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, sfex, coh1000c, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (Euro 961219)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, sfexu, sfex, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (USA 961219)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, sfexa, sfex, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (Asia 961219)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, sfexj, sfex, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX (Japan 961130)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, sfexp, coh1000c, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (USA 970407)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, sfexpu1, sfexp, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (USA 970311)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, sfexpj, sfexp, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (Japan 970407)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, sfexpj1, sfexp, coh1002c, zn6b, zn1_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX Plus (Japan 970311)", MACHINE_IMPERFECT_SOUND ) /* Capcom ZN2 */ -GAME( 1997, coh3002c, 0, coh3002c, zn, zn_state, empty_init, ROT0, "Capcom", "ZN2", MACHINE_IS_BIOS_ROOT ) -GAME( 1997, rvschool, coh3002c, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Rival Schools: United By Fate (Euro 971117)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, rvschoolu, rvschool, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Rival Schools: United By Fate (USA 971117)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, rvschoola, rvschool, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Rival Schools: United By Fate (Asia 971117)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, jgakuen, rvschool, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Shiritsu Justice Gakuen: Legion of Heroes (Japan 971216)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, jgakuen1, rvschool, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Shiritsu Justice Gakuen: Legion of Heroes (Japan 971117)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, sfex2, coh3002c, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Euro 980312)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, sfex2u, sfex2, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (USA 980526)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, sfex2u1, sfex2, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (USA 980312)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, sfex2a, sfex2, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Asia 980312)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, sfex2h, sfex2, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Hispanic 980312)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, sfex2j, sfex2, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Japan 980312)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, plsmaswd, coh3002c, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Plasma Sword: Nightmare of Bilstein (USA 980316)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, plsmaswda, plsmaswd, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Plasma Sword: Nightmare of Bilstein (Asia 980316)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, stargld2, plsmaswd, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Star Gladiator 2: Nightmare of Bilstein (Japan 980316)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, tgmj, coh3002c, coh3002c, zn4w, zn_state, empty_init, ROT0, "Arika / Capcom", "Tetris The Grand Master (Japan 980710)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, techromn, coh3002c, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Tech Romancer (Euro 980914)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, techromnu, techromn, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Tech Romancer (USA 980914)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, kikaioh, techromn, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom", "Choukou Senki Kikaioh (Japan 980914)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, sfex2p, coh3002c, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Euro 990611)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, sfex2pu, sfex2p, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (USA 990611)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, sfex2pa, sfex2p, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Asia 990611)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, sfex2ph, sfex2p, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Hispanic 990611)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, sfex2pj, sfex2p, coh3002c, zn6b, zn_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Japan 990611)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, strider2, coh3002c, coh3002c, zn, zn_state, empty_init, ROT0, "Capcom", "Strider 2 (Euro 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // random hangs / crashes -GAME( 1999, strider2u, strider2, coh3002c, zn, zn_state, empty_init, ROT0, "Capcom", "Strider 2 (USA 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, strider2a, strider2, coh3002c, zn, zn_state, empty_init, ROT0, "Capcom", "Strider 2 (Asia 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, shiryu2, strider2, coh3002c, zn, zn_state, empty_init, ROT0, "Capcom", "Strider Hiryu 2 (Japan 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1997, coh3002c, 0, coh3002c, zn, zn2_state, empty_init, ROT0, "Capcom", "ZN2", MACHINE_IS_BIOS_ROOT ) +GAME( 1997, rvschool, coh3002c, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Rival Schools: United By Fate (Euro 971117)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, rvschoolu, rvschool, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Rival Schools: United By Fate (USA 971117)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, rvschoola, rvschool, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Rival Schools: United By Fate (Asia 971117)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, jgakuen, rvschool, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Shiritsu Justice Gakuen: Legion of Heroes (Japan 971216)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, jgakuen1, rvschool, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Shiritsu Justice Gakuen: Legion of Heroes (Japan 971117)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, sfex2, coh3002c, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Euro 980312)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, sfex2u, sfex2, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (USA 980526)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, sfex2u1, sfex2, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (USA 980312)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, sfex2a, sfex2, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Asia 980312)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, sfex2h, sfex2, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Hispanic 980312)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, sfex2j, sfex2, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 (Japan 980312)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, plsmaswd, coh3002c, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Plasma Sword: Nightmare of Bilstein (USA 980316)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, plsmaswda, plsmaswd, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Plasma Sword: Nightmare of Bilstein (Asia 980316)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, stargld2, plsmaswd, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Star Gladiator 2: Nightmare of Bilstein (Japan 980316)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, tgmj, coh3002c, coh3002c, zn4w, zn2_state, empty_init, ROT0, "Arika / Capcom", "Tetris The Grand Master (Japan 980710)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, techromn, coh3002c, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Tech Romancer (Euro 980914)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, techromnu, techromn, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Tech Romancer (USA 980914)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, kikaioh, techromn, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom", "Choukou Senki Kikaioh (Japan 980914)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, sfex2p, coh3002c, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Euro 990611)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, sfex2pu, sfex2p, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (USA 990611)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, sfex2pa, sfex2p, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Asia 990611)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, sfex2ph, sfex2p, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Hispanic 990611)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, sfex2pj, sfex2p, coh3002c, zn6b, zn2_state, empty_init, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Japan 990611)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, strider2, coh3002c, coh3002c, zn, zn2_state, empty_init, ROT0, "Capcom", "Strider 2 (Euro 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // random hangs / crashes +GAME( 1999, strider2u, strider2, coh3002c, zn, zn2_state, empty_init, ROT0, "Capcom", "Strider 2 (USA 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, strider2a, strider2, coh3002c, zn, zn2_state, empty_init, ROT0, "Capcom", "Strider 2 (Asia 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, shiryu2, strider2, coh3002c, zn, zn2_state, empty_init, ROT0, "Capcom", "Strider Hiryu 2 (Japan 991213)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* Atari */ -GAME( 1996, coh1000w, 0, coh1000w, zn, zn_state, empty_init, ROT0, "Atari", "Atari PSX", MACHINE_IS_BIOS_ROOT ) -GAME( 1996, primrag2, coh1000w, coh1000w, primrag2, zn_state, init_primrag2, ROT0, "Atari", "Primal Rage 2 (Ver 0.36a)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // watchdog reset at startup +GAME( 1996, coh1000w, 0, coh1000w, zn, primrag2_state, empty_init, ROT0, "Atari", "Atari PSX", MACHINE_IS_BIOS_ROOT ) +GAME( 1996, primrag2, coh1000w, coh1000w, primrag2, primrag2_state, empty_init, ROT0, "Atari", "Primal Rage 2 (Ver 0.36a)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // watchdog reset at startup /* Acclaim */ -GAME( 1995, coh1000a, 0, coh1000a, zn, zn_state, empty_init, ROT0, "Acclaim", "Acclaim PSX", MACHINE_IS_BIOS_ROOT ) -GAME( 1996, nbajamex, coh1000a, nbajamex, nbajamex, zn_state, init_nbajamex, ROT0, "Acclaim", "NBA Jam Extreme (ver. 1.10I)", 0 ) -GAME( 1996, nbajamexa, nbajamex, nbajamex, nbajamex, zn_state, init_nbajamex, ROT0, "Acclaim", "NBA Jam Extreme (ver. 1.04)", 0 ) -GAME( 1996, jdredd, coh1000a, jdredd, jdredd, zn_state, init_jdredd, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, jdreddb, jdredd, jdredd, jdredd, zn_state, init_jdredd, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, coh1000a, 0, coh1000a, zn, acclaim_zn_state, empty_init, ROT0, "Acclaim", "Acclaim PSX", MACHINE_IS_BIOS_ROOT ) +GAME( 1996, nbajamex, coh1000a, nbajamex, nbajamex, nbajamex_state, empty_init, ROT0, "Acclaim", "NBA Jam Extreme (ver. 1.10I)", 0 ) +GAME( 1996, nbajamexa, nbajamex, nbajamex, nbajamex, nbajamex_state, empty_init, ROT0, "Acclaim", "NBA Jam Extreme (ver. 1.04)", 0 ) +GAME( 1996, jdredd, coh1000a, jdredd, jdredd, jdredd_state, empty_init, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, jdreddb, jdredd, jdredd, jdredd, jdredd_state, empty_init, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", MACHINE_IMPERFECT_SOUND ) /* Tecmo */ -GAME( 1997, coh1002m, 0, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "TPS", MACHINE_IS_BIOS_ROOT ) -GAME( 1997, glpracr2, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 2 (Export)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, glpracr2j, glpracr2, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 2 (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, glpracr2l, glpracr2, coh1002ml, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 2 Link HW (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, doapp, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Dead Or Alive ++ (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, cbaj, coh1002m, coh1002msnd, zn, zn_state, empty_init, ROT0, "UEP Systems", "Cool Boarders Arcade Jam", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, shngmtkb, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Sunsoft / Activision", "Shanghai Matekibuyuu", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, tondemo, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Tondemo Crisis (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, glpracr3, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 3 (Export)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, glpracr3j, glpracr3, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 3 (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, flamegun, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Gaps Inc.", "Flame Gunner", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, flamegunj, flamegun, coh1002m, zn, zn_state, empty_init, ROT0, "Gaps Inc.", "Flame Gunner (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1999, lpadv, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Amuse World", "Logic Pro Adventure (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, tblkkuzu, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tamsoft / D3 Publisher", "The Block Kuzushi (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, 1on1gov, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "1 on 1 Government (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, twcupmil, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Tecmo World Cup Millennium (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 2001, mfjump, coh1002m, coh1002m, zn, zn_state, empty_init, ROT0, "Tecmo", "Monster Farm Jump (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, coh1002m, 0, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "TPS", MACHINE_IS_BIOS_ROOT ) +GAME( 1997, glpracr2, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 2 (Export)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, glpracr2j, glpracr2, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 2 (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, glpracr2l, glpracr2, coh1002ml, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 2 Link HW (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, doapp, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Dead Or Alive ++ (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, cbaj, coh1002m, cbaj, zn, cbaj_state, empty_init, ROT0, "UEP Systems", "Cool Boarders Arcade Jam", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, shngmtkb, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Sunsoft / Activision", "Shanghai Matekibuyuu", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, tondemo, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Tondemo Crisis (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, glpracr3, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 3 (Export)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, glpracr3j, glpracr3, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 3 (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, flamegun, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Gaps Inc.", "Flame Gunner", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, flamegunj, flamegun, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Gaps Inc.", "Flame Gunner (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1999, lpadv, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Amuse World", "Logic Pro Adventure (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, tblkkuzu, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tamsoft / D3 Publisher", "The Block Kuzushi (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, 1on1gov, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "1 on 1 Government (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, twcupmil, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Tecmo World Cup Millennium (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 2001, mfjump, coh1002m, coh1002m, zn, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Monster Farm Jump (Japan)", MACHINE_IMPERFECT_SOUND ) /* Video System */ -GAME( 1996, coh1002v, 0, coh1002v, zn, zn_state, empty_init, ROT0, "Video System Co.", "Video System PSX", MACHINE_IS_BIOS_ROOT ) -GAME( 1996, aerofgts, coh1002v, coh1002v, aerofgts, zn_state, empty_init, ROT270, "Video System Co.", "Aero Fighters Special (Taiwan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, sncwgltd, aerofgts, coh1002v, aerofgts, zn_state, empty_init, ROT270, "Video System Co.", "Sonic Wings Limited (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, coh1002v, 0, coh1002v, zn, visco_zn_state, empty_init, ROT0, "Video System Co.", "Video System PSX", MACHINE_IS_BIOS_ROOT ) +GAME( 1996, aerofgts, coh1002v, coh1002v, aerofgts, visco_zn_state, empty_init, ROT270, "Video System Co.", "Aero Fighters Special (Taiwan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, sncwgltd, aerofgts, coh1002v, aerofgts, visco_zn_state, empty_init, ROT270, "Video System Co.", "Sonic Wings Limited (Japan)", MACHINE_IMPERFECT_SOUND ) /* Taito FX-1A */ -GAME( 1995, coh1000t, 0, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Taito FX1", MACHINE_IS_BIOS_ROOT ) -GAME( 1995, sfchamp, coh1000t, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.5O)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, sfchampo, sfchamp, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4O)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, sfchampu, sfchamp, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4A)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, sfchampj, sfchamp, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, psyforce, coh1000t, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force (Ver 2.4O)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, psyforcej, psyforce, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force (Ver 2.4J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1995, psyforcex, psyforce, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force EX (Ver 2.0J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, mgcldate, mgcldtex, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Magical Date / Magical Date - dokidoki kokuhaku daisakusen (Ver 2.02J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, mgcldtex, coh1000t, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Magical Date EX / Magical Date - sotsugyou kokuhaku daisakusen (Ver 2.01J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, coh1000t, 0, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Taito FX1", MACHINE_IS_BIOS_ROOT ) +GAME( 1995, sfchamp, coh1000t, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.5O)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, sfchampo, sfchamp, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4O)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, sfchampu, sfchamp, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4A)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, sfchampj, sfchamp, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, psyforce, coh1000t, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Psychic Force (Ver 2.4O)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, psyforcej, psyforce, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Psychic Force (Ver 2.4J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1995, psyforcex, psyforce, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Psychic Force EX (Ver 2.0J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, mgcldate, mgcldtex, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Magical Date / Magical Date - dokidoki kokuhaku daisakusen (Ver 2.02J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, mgcldtex, coh1000t, coh1000ta, znt, taito_fx1a_state, empty_init, ROT0, "Taito", "Magical Date EX / Magical Date - sotsugyou kokuhaku daisakusen (Ver 2.01J)", MACHINE_IMPERFECT_SOUND ) /* Taito FX-1B */ -GAME( 1996, raystorm, coh1000t, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.06A)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, raystormo, raystorm, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.05O)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, raystormu, raystorm, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.05A)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, raystormj, raystorm, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.05J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, ftimpact, ftimpcta, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02O)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, ftimpactu, ftimpcta, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02A)", MACHINE_IMPERFECT_SOUND ) -GAME( 1996, ftimpactj, ftimpcta, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, ftimpcta, coh1000t, coh1000tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "Fighters' Impact A (Ver 2.00J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, gdarius, gdarius2, coh1002tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.01J)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, gdariusb, gdarius2, coh1002tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.02A)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, gdarius2, coh1000t, coh1002tb, znt, zn_state, init_coh1000tb, ROT0, "Taito", "G-Darius Ver.2 (Ver 2.03J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, raystorm, coh1000t, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Ray Storm (Ver 2.06A)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, raystormo, raystorm, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Ray Storm (Ver 2.05O)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, raystormu, raystorm, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Ray Storm (Ver 2.05A)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, raystormj, raystorm, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Ray Storm (Ver 2.05J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, ftimpact, ftimpcta, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Fighters' Impact (Ver 2.02O)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, ftimpactu, ftimpcta, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Fighters' Impact (Ver 2.02A)", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, ftimpactj, ftimpcta, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Fighters' Impact (Ver 2.02J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, ftimpcta, coh1000t, coh1000tb, znt, taito_fx1b_state, empty_init, ROT0, "Taito", "Fighters' Impact A (Ver 2.00J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, gdarius, gdarius2, coh1002tb, znt, gdarius_state, empty_init, ROT0, "Taito", "G-Darius (Ver 2.01J)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, gdariusb, gdarius2, coh1002tb, znt, gdarius_state, empty_init, ROT0, "Taito", "G-Darius (Ver 2.02A)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, gdarius2, coh1000t, coh1002tb, znt, gdarius_state, empty_init, ROT0, "Taito", "G-Darius Ver.2 (Ver 2.03J)", MACHINE_IMPERFECT_SOUND ) /* Eighting / Raizing */ -GAME( 1997, coh1002e, 0, coh1002e, znt, zn_state, empty_init, ROT0, "Eighting / Raizing", "PS Arcade 95", MACHINE_IS_BIOS_ROOT ) -GAME( 1997, beastrzr, coh1002e, coh1002e, znt, zn_state, empty_init, ROT0, "Eighting / Raizing", "Beastorizer (USA, Sep 22 1997)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, beastrzra, beastrzr, coh1002e, znt, zn_state, empty_init, ROT0, "Eighting / Raizing", "Beastorizer (USA, Jun 21 1997)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, bldyroar, beastrzr, coh1002e, znt, zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar (Japan, Jun 21 1997)", MACHINE_IMPERFECT_SOUND ) -GAME( 1997, beastrzrb, beastrzr, beastrzrb, znt, zn_state, empty_init, ROT0, "bootleg", "Beastorizer (USA bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1997, coh1002e, 0, coh1002e, znt, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "PS Arcade 95", MACHINE_IS_BIOS_ROOT ) +GAME( 1997, beastrzr, coh1002e, coh1002e, znt, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Beastorizer (USA, Sep 22 1997)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, beastrzra, beastrzr, coh1002e, znt, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Beastorizer (USA, Jun 21 1997)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, bldyroar, beastrzr, coh1002e, znt, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar (Japan, Jun 21 1997)", MACHINE_IMPERFECT_SOUND ) +GAME( 1997, beastrzrb, beastrzr, beastrzrb, znt, beastrzrb_state, empty_init, ROT0, "bootleg", "Beastorizer (USA bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* The region on these is determined from the NVRAM, it can't be changed from the test menu, it's pre-programmed */ -GAME( 1998, bldyror2, coh1002e, coh1002e, bldyror2, zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (World)", MACHINE_IMPERFECT_SOUND ) // locks up if you coin up during the fmw with interlace enabled -GAME( 1998, bldyror2u, bldyror2, coh1002e, bldyror2, zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (USA)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, bldyror2a, bldyror2, coh1002e, bldyror2, zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (Asia)", MACHINE_IMPERFECT_SOUND ) -GAME( 1998, bldyror2j, bldyror2, coh1002e, bldyror2, zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, bldyror2, coh1002e, coh1002e, bldyror2, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (World)", MACHINE_IMPERFECT_SOUND ) // locks up if you coin up during the fmw with interlace enabled +GAME( 1998, bldyror2u, bldyror2, coh1002e, bldyror2, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (USA)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, bldyror2a, bldyror2, coh1002e, bldyror2, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (Asia)", MACHINE_IMPERFECT_SOUND ) +GAME( 1998, bldyror2j, bldyror2, coh1002e, bldyror2, raizing_zn_state, empty_init, ROT0, "Eighting / Raizing", "Bloody Roar 2 (Japan)", MACHINE_IMPERFECT_SOUND ) /* The region on these is determined from the NVRAM, it can't be changed from the test menu, it's pre-programmed */ -GAME( 2000, brvblade, coh1002m, coh1002e, znt, zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (World)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, brvbladeu, brvblade, coh1002e, znt, zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (USA)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, brvbladea, brvblade, coh1002e, znt, zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (Asia)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, brvbladej, brvblade, coh1002e, znt, zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (Japan)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, brvblade, coh1002m, coh1002e, znt, raizing_zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (World)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, brvbladeu, brvblade, coh1002e, znt, raizing_zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (USA)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, brvbladea, brvblade, coh1002e, znt, raizing_zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (Asia)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, brvbladej, brvblade, coh1002e, znt, raizing_zn_state, empty_init, ROT270, "Eighting / Raizing", "Brave Blade (Japan)", MACHINE_IMPERFECT_SOUND ) /* Bust a Move 2 uses the PSARC95 bios and ET series security but the top board is completely different */ -GAME( 1999, bam2, coh1002e, bam2, zn, zn_state, init_bam2, ROT0, "Metro / Enix / Namco", "Bust a Move 2 - Dance Tengoku Mix (Japanese ROM ver. 1999/07/17 10:00:00)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, bam2, coh1002e, bam2, zn, bam2_state, empty_init, ROT0, "Metro / Enix / Namco", "Bust a Move 2 - Dance Tengoku Mix (Japanese ROM ver. 1999/07/17 10:00:00)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* Atlus */ -GAME( 1996, coh1001l, 0, coh1001l, zn, zn_state, empty_init, ROT0, "Atlus", "Atlus PSX", MACHINE_IS_BIOS_ROOT ) -GAME( 1996, hvnsgate, coh1001l, coh1001l, zn, zn_state, empty_init, ROT0, "Racdym / Atlus", "Heaven's Gate", MACHINE_IMPERFECT_SOUND ) +GAME( 1996, coh1001l, 0, coh1001l, zn, atlus_zn_state, empty_init, ROT0, "Atlus", "Atlus PSX", MACHINE_IS_BIOS_ROOT ) +GAME( 1996, hvnsgate, coh1001l, coh1001l, zn, atlus_zn_state, empty_init, ROT0, "Racdym / Atlus", "Heaven's Gate", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/etc/fd1094dp.cpp b/src/mame/etc/fd1094dp.cpp index ffaf2e187e9..04c499390f1 100644 --- a/src/mame/etc/fd1094dp.cpp +++ b/src/mame/etc/fd1094dp.cpp @@ -11,9 +11,9 @@ fd1094.c to decrypt the ROM data. *****************************************************************************/ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> int state2; diff --git a/src/mame/etc/jrcrypt.cpp b/src/mame/etc/jrcrypt.cpp index 3c30605af18..0a40a84e6fc 100644 --- a/src/mame/etc/jrcrypt.cpp +++ b/src/mame/etc/jrcrypt.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ #include "emu.h" -#include <ctype.h> +#include <cctype> static int irq_mask; @@ -455,7 +455,7 @@ the top of this file. It is included here for completeness. // // Comments, questions to: david@indigita.com -#include <stdio.h> +#include <cstdio> typedef uint8_t byte; diff --git a/src/mame/etc/template_driver.cpp b/src/mame/etc/template_driver.cpp index ca62f2a11d2..cb7dc988d5a 100644 --- a/src/mame/etc/template_driver.cpp +++ b/src/mame/etc/template_driver.cpp @@ -165,7 +165,7 @@ void xxx_state::xxx(machine_config &config) screen.set_palette(m_palette); GFXDECODE(config, "gfxdecode", m_palette, gfx_xxx); - + PALETTE(config, m_palette, FUNC(xxx_state::xxx_palette), 8); /* sound hardware */ diff --git a/src/mame/includes/aerofgt.h b/src/mame/includes/aerofgt.h index 19c6ac112d9..334f23ced1d 100644 --- a/src/mame/includes/aerofgt.h +++ b/src/mame/includes/aerofgt.h @@ -170,6 +170,7 @@ public: void pspikesc_map(address_map &map); void sound_map(address_map &map); void spikes91_map(address_map &map); + void spikes91_sound_map(address_map &map); void spinlbrk_map(address_map &map); void spinlbrk_sound_portmap(address_map &map); void turbofrc_map(address_map &map); diff --git a/src/mame/includes/armedf.h b/src/mame/includes/armedf.h index 143acd6a944..f75ba45cbac 100644 --- a/src/mame/includes/armedf.h +++ b/src/mame/includes/armedf.h @@ -15,8 +15,8 @@ class armedf_state : public driver_device { public: - armedf_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag) + armedf_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_extra(*this, "extra") , m_nb1414m4(*this, "nb1414m4") @@ -25,6 +25,7 @@ public: , m_palette(*this, "palette") , m_spriteram(*this, "spriteram") , m_soundlatch(*this, "soundlatch") + , m_text_videoram(*this, "text_videoram", 0) , m_spr_pal_clut(*this, "spr_pal_clut") , m_fg_videoram(*this, "fg_videoram") , m_bg_videoram(*this, "bg_videoram") @@ -33,11 +34,9 @@ public: void init_cclimbr2(); void init_armedf(); void init_legion(); - void init_terrafu(); + void init_terraf(); void init_legionjb(); void init_kozure(); - void init_terraf(); - void init_terrafjb(); void terraf(machine_config &config); void terrafb(machine_config &config); @@ -50,9 +49,6 @@ public: void armedf(machine_config &config); void kozure(machine_config &config); - uint32_t screen_update_armedf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_VIDEO_START(armedf); - protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -70,65 +66,72 @@ protected: required_device<generic_latch_8_device> m_soundlatch; // memory pointers - std::unique_ptr<uint8_t[]> m_text_videoram; - required_shared_ptr<uint16_t> m_spr_pal_clut; - required_shared_ptr<uint16_t> m_fg_videoram; - required_shared_ptr<uint16_t> m_bg_videoram; - uint16_t m_legion_cmd[4]; // legionjb only! + required_shared_ptr<u8> m_text_videoram; + required_shared_ptr<u16> m_spr_pal_clut; + required_shared_ptr<u16> m_fg_videoram; + required_shared_ptr<u16> m_bg_videoram; + u16 m_legion_cmd[4]; // legionjb only! // video-related tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_tx_tilemap; - uint16_t m_scroll_msb; - uint16_t m_vreg; - uint16_t m_fg_scrollx; - uint16_t m_fg_scrolly; - uint16_t m_bg_scrollx; - uint16_t m_bg_scrolly; - int m_scroll_type; - int m_sprite_offy; - int m_old_mcu_mode; - int m_waiting_msb; - - DECLARE_WRITE16_MEMBER(terraf_io_w); - DECLARE_WRITE16_MEMBER(terrafjb_io_w); - DECLARE_WRITE16_MEMBER(bootleg_io_w); - DECLARE_WRITE16_MEMBER(sound_command_w); - DECLARE_READ8_MEMBER(soundlatch_clear_r); - DECLARE_WRITE16_MEMBER(irq_lv1_ack_w); - DECLARE_WRITE16_MEMBER(irq_lv2_ack_w); - DECLARE_WRITE8_MEMBER(legionjb_fg_scroll_w); - DECLARE_READ8_MEMBER(blitter_txram_r); - DECLARE_WRITE8_MEMBER(blitter_txram_w); - DECLARE_WRITE8_MEMBER(fg_scrollx_w); - DECLARE_WRITE8_MEMBER(fg_scrolly_w); - DECLARE_WRITE8_MEMBER(fg_scroll_msb_w); - DECLARE_READ8_MEMBER(nb1414m4_text_videoram_r); - DECLARE_WRITE8_MEMBER(nb1414m4_text_videoram_w); - DECLARE_READ8_MEMBER(armedf_text_videoram_r); - DECLARE_WRITE8_MEMBER(armedf_text_videoram_w); - DECLARE_WRITE16_MEMBER(armedf_fg_videoram_w); - DECLARE_WRITE16_MEMBER(armedf_bg_videoram_w); - DECLARE_WRITE16_MEMBER(terraf_fg_scrolly_w); - DECLARE_WRITE16_MEMBER(terraf_fg_scrollx_w); - DECLARE_WRITE16_MEMBER(terraf_fg_scroll_msb_arm_w); - DECLARE_WRITE16_MEMBER(armedf_fg_scrollx_w); - DECLARE_WRITE16_MEMBER(armedf_fg_scrolly_w); - DECLARE_WRITE16_MEMBER(armedf_bg_scrollx_w); - DECLARE_WRITE16_MEMBER(armedf_bg_scrolly_w); + u16 m_scroll_msb; + u16 m_vreg; + u16 m_fg_scrollx; + u16 m_fg_scrolly; + u16 m_bg_scrollx; + u16 m_bg_scrolly; + int m_scroll_type; + int m_sprite_offy; + int m_old_mcu_mode; + int m_waiting_msb; + + // read/write handlers + void terraf_io_w(offs_t offset, u16 data, u16 mem_mask); + void terrafjb_io_w(offs_t offset, u16 data, u16 mem_mask); + void armedf_io_w(offs_t offset, u16 data, u16 mem_mask); + void sound_command_w(u8 data); + u8 soundlatch_clear_r(); + void irq_lv1_ack_w(u16 data); + void irq_lv2_ack_w(u16 data); + + // video handlers + void legionjb_fg_scroll_w(offs_t offset, u8 data); + void blitter_txram_w(offs_t offset, u8 data); + void terrafjb_fg_scrollx_w(u8 data); + void terrafjb_fg_scrolly_w(u8 data); + void terrafjb_fg_scroll_msb_w(u8 data); + u8 text_videoram_r(offs_t offset); + void text_videoram_w(offs_t offset, u8 data); + void fg_videoram_w(offs_t offset, u16 data, u16 mem_mask); + void bg_videoram_w(offs_t offset, u16 data, u16 mem_mask); + void terrafb_fg_scrolly_w(u8 data); + void terrafb_fg_scrollx_w(u8 data); + void terrafb_fg_scroll_msb_arm_w(u8 data); + void fg_scrollx_w(offs_t offset, u16 data, u16 mem_mask); + void fg_scrolly_w(offs_t offset, u16 data, u16 mem_mask); + void bg_scrollx_w(offs_t offset, u16 data, u16 mem_mask); + void bg_scrolly_w(offs_t offset, u16 data, u16 mem_mask); + TILEMAP_MAPPER_MEMBER(armedf_scan_type1); TILEMAP_MAPPER_MEMBER(armedf_scan_type2); TILEMAP_MAPPER_MEMBER(armedf_scan_type3); + TILE_GET_INFO_MEMBER(get_nb1414m4_tx_tile_info); TILE_GET_INFO_MEMBER(get_armedf_tx_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); + DECLARE_VIDEO_START(terraf); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); - void armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx, - uint32_t code,uint32_t color, uint32_t clut,int flipx,int flipy,int offsx,int offsy, - int transparent_color); + DECLARE_VIDEO_START(armedf); + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &primap); + void armedf_drawgfx(bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, + u32 code, u32 color, u32 clut, int flipx, int flipy, int offsx, int offsy, + bitmap_ind8 &primap, u32 pmask, int transparent_color); void common_map(address_map &map); void armedf_map(address_map &map); void cclimbr2_map(address_map &map); @@ -141,7 +144,10 @@ protected: void sound_3526_portmap(address_map &map); void sound_map(address_map &map); void sound_portmap(address_map &map); + void terraf_common_map(address_map &map); void terraf_map(address_map &map); + void terrafb_map(address_map &map); + void terrafjb_map(address_map &map); void terrafjb_extraz80_map(address_map &map); void terrafjb_extraz80_portmap(address_map &map); }; @@ -149,22 +155,24 @@ protected: class bigfghtr_state : public armedf_state { public: - bigfghtr_state(const machine_config &mconfig, device_type type, const char *tag) : - armedf_state(mconfig, type, tag), - m_mcu(*this, "mcu"), - m_sharedram(*this, "sharedram") + bigfghtr_state(const machine_config &mconfig, device_type type, const char *tag) + : armedf_state(mconfig, type, tag) + , m_mcu(*this, "mcu") + , m_sharedram(*this, "sharedram") { } void bigfghtr(machine_config &config); private: required_device<cpu_device> m_mcu; - required_shared_ptr<uint8_t> m_sharedram; + required_shared_ptr<u8> m_sharedram; + + // mcu interfaces + u16 latch_r(); + void main_sharedram_w(offs_t offset, u8 data); + u8 main_sharedram_r(offs_t offset); + void mcu_spritelist_w(offs_t offset, u8 data); - DECLARE_READ16_MEMBER(latch_r); - DECLARE_WRITE8_MEMBER(main_sharedram_w); - DECLARE_READ8_MEMBER(main_sharedram_r); - DECLARE_WRITE8_MEMBER(mcu_spritelist_w); void bigfghtr_map(address_map &map); void bigfghtr_mcu_io_map(address_map &map); void bigfghtr_mcu_map(address_map &map); diff --git a/src/mame/includes/atarist.h b/src/mame/includes/atarist.h index 2c4d97fac46..cc369d40452 100644 --- a/src/mame/includes/atarist.h +++ b/src/mame/includes/atarist.h @@ -238,9 +238,6 @@ public: DECLARE_WRITE_LINE_MEMBER( ikbd_tx_w ); - DECLARE_READ8_MEMBER( mfp_gpio_r ); - DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w ); - DECLARE_WRITE_LINE_MEMBER( write_acia_clock ); void toggle_dma_fifo(); diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h index bbd62b5cf24..7dcd0d514e7 100644 --- a/src/mame/includes/atarisy1.h +++ b/src/mame/includes/atarisy1.h @@ -106,7 +106,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_reset_yscroll_callback); TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3off_callback); TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3_callback); - void update_timers(int scanline); + virtual void update_timers(int scanline); void decode_gfx(uint16_t *pflookup, uint16_t *molookup); int get_bank(uint8_t prom1, uint8_t prom2, int bpp); DECLARE_READ16_MEMBER( atarisy1_int3state_r ); @@ -129,4 +129,12 @@ public: void sound_map(address_map &map); }; +class atarisy1r_state : public atarisy1_state +{ +public: + using atarisy1_state::atarisy1_state; + + virtual void update_timers(int scanline) override; +}; + #endif // MAME_INCLUDES_ATARISY1_H diff --git a/src/mame/includes/bbc.h b/src/mame/includes/bbc.h index 3573d4ba89b..ee94d248bf1 100644 --- a/src/mame/includes/bbc.h +++ b/src/mame/includes/bbc.h @@ -42,6 +42,7 @@ #include "bus/bbc/fdc/fdc.h" #include "bus/bbc/analogue/analogue.h" #include "bus/bbc/1mhzbus/1mhzbus.h" +#include "bus/bbc/modem/modem.h" #include "bus/bbc/internal/internal.h" #include "bus/bbc/tube/tube.h" #include "bus/bbc/userport/userport.h" @@ -74,7 +75,7 @@ public: , m_acia(*this, "acia6850") , m_acia_clock(*this, "acia_clock") , m_latch(*this, "latch") - , m_rs232(*this, "rs232") + , m_rs232(*this, "rs423") , m_via6522_0(*this, "via6522_0") , m_via6522_1(*this, "via6522_1") , m_upd7002(*this, "upd7002") @@ -84,6 +85,7 @@ public: , m_intube(*this, "intube") , m_extube(*this, "extube") , m_1mhzbus(*this, "1mhzbus") + , m_modem(*this, "modem") , m_userport(*this, "userport") , m_internal(*this, "internal") , m_exp(*this, "exp") @@ -243,6 +245,7 @@ protected: optional_device<bbc_tube_slot_device> m_intube; optional_device<bbc_tube_slot_device> m_extube; optional_device<bbc_1mhzbus_slot_device> m_1mhzbus; + optional_device<bbc_modem_slot_device> m_modem; optional_device<bbc_userport_slot_device> m_userport; optional_device<bbc_internal_slot_device> m_internal; optional_device<bbc_exp_slot_device> m_exp; @@ -396,8 +399,7 @@ public: static constexpr feature_type imperfect_features() { return feature::KEYBOARD; } void torchf(machine_config &config); - void torchh21(machine_config &config); - void torchh10(machine_config &config); + void torchh(machine_config &config); }; diff --git a/src/mame/includes/bebox.h b/src/mame/includes/bebox.h index 85a1eb3abdd..7b787a212f1 100644 --- a/src/mame/includes/bebox.h +++ b/src/mame/includes/bebox.h @@ -23,6 +23,7 @@ #include "machine/ram.h" #include "machine/upd765.h" #include "machine/intelfsh.h" +#include "video/pc_vga.h" #include "bus/lpci/pci.h" @@ -46,6 +47,7 @@ public: , m_smc37c78(*this, "smc37c78") , m_flash(*this, "flash") , m_pcibus(*this, "pcibus") + , m_vga(*this, "vga") { } @@ -58,6 +60,7 @@ public: required_device<smc37c78_device> m_smc37c78; required_device<fujitsu_29f016a_device> m_flash; required_device<pci_bus_device> m_pcibus; + required_device<vga_device> m_vga; uint32_t m_cpu_imask[2]; uint32_t m_interrupts; uint32_t m_crossproc_interrupts; @@ -118,7 +121,8 @@ public: void bebox_set_irq_bit(unsigned int interrupt_bit, int val); void bebox_update_interrupts(); - static void mpc105_config(device_t *device); + void mpc105_config(device_t *device); + void cirrus_config(device_t *device); pci_connector_device & add_pci_slot(machine_config &config, const char *tag, size_t index, const char *default_tag); void bebox_peripherals(machine_config &config); diff --git a/src/mame/includes/cdi.h b/src/mame/includes/cdi.h index 9c53defb399..a6f0d03713e 100644 --- a/src/mame/includes/cdi.h +++ b/src/mame/includes/cdi.h @@ -22,8 +22,6 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_planea(*this, "mcd212:planea") - , m_input1(*this, "INPUT1") - , m_input2(*this, "INPUT2") , m_slave_hle(*this, "slave_hle") , m_servo(*this, "servo") , m_slave(*this, "slave") @@ -34,6 +32,21 @@ public: , m_dmadac(*this, "dac%u", 1U) { } + void cdimono1_base(machine_config &config); + void cdimono1(machine_config &config); + void cdimono2(machine_config &config); + void cdi910(machine_config &config); + +protected: + virtual void machine_reset() override; + + void cdimono1_mem(address_map &map); + + required_device<scc68070_device> m_maincpu; + +private: + virtual void video_start() override; + enum servo_portc_bit_t { INV_JUC_OUT = (1 << 2), @@ -41,10 +54,17 @@ public: INV_CADDYSWITCH_IN = (1 << 7) }; - required_device<scc68070_device> m_maincpu; + void draw_lcd(int y); + uint32_t screen_update_cdimono1_lcd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void cdi910_mem(address_map &map); + void cdimono2_mem(address_map &map); + void cdi070_cpuspace(address_map &map); + + DECLARE_READ16_MEMBER(dvc_r); + DECLARE_WRITE16_MEMBER(dvc_w); + required_shared_ptr<uint16_t> m_planea; - optional_ioport m_input1; - optional_ioport m_input2; optional_device<cdislave_device> m_slave_hle; optional_device<m68hc05c8_device> m_servo; optional_device<m68hc05c8_device> m_slave; @@ -55,52 +75,39 @@ public: required_device_array<dmadac_sound_device, 2> m_dmadac; - INTERRUPT_GEN_MEMBER( mcu_frame ); - - uint8_t m_timer_set; - emu_timer *m_test_timer; - bitmap_rgb32 m_lcdbitmap; +}; - DECLARE_INPUT_CHANGED_MEMBER(mcu_input); +class quizard_state : public cdi_state +{ +public: + quizard_state(const machine_config &mconfig, device_type type, const char *tag) + : cdi_state(mconfig, type, tag) + , m_input1(*this, "INPUT1") + , m_input2(*this, "INPUT2") + { } - virtual void machine_start() override { } - virtual void video_start() override; + void quizard(machine_config &config); - DECLARE_MACHINE_RESET(cdimono1); - DECLARE_MACHINE_RESET(cdimono2); - DECLARE_MACHINE_RESET(quizard1); - DECLARE_MACHINE_RESET(quizard2); - DECLARE_MACHINE_RESET(quizard3); - DECLARE_MACHINE_RESET(quizard4); + DECLARE_INPUT_CHANGED_MEMBER(mcu_input); - DECLARE_READ8_MEMBER(quizard_mcu_p1_r); +protected: + void set_mcu_value(uint16_t value); + void set_mcu_ack(uint8_t ack); - void draw_lcd(int y); - uint32_t screen_update_cdimono1_lcd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); +private: + virtual void machine_start() override; + virtual void machine_reset() override; - void cdimono1(machine_config &config); - void cdimono2(machine_config &config); - void quizard4(machine_config &config); - void cdimono1_base(machine_config &config); - void cdi910(machine_config &config); - void quizard2(machine_config &config); - void quizard3(machine_config &config); - void quizard1(machine_config &config); - void quizard(machine_config &config); + DECLARE_READ8_MEMBER(mcu_p1_r); - void cdi910_mem(address_map &map); - void cdimono1_mem(address_map &map); - void cdimono2_mem(address_map &map); - void cdi070_cpuspace(address_map &map); + void mcu_tx(uint8_t data); + void mcu_calculate_state(); + void mcu_set_seeds(uint8_t *rx); + void mcu_rx(uint8_t data); - // Quizard Protection HLE - void set_quizard_mcu_value(uint16_t value); - void set_quizard_mcu_ack(uint8_t ack); - void quizard_rx(uint8_t data); - void quizard_calculate_state(); - void quizard_set_seeds(uint8_t *rx); - void quizard_handle_byte_tx(uint8_t data); + required_ioport m_input1; + required_ioport m_input2; uint16_t m_seeds[10]; uint8_t m_state[8]; @@ -109,4 +116,51 @@ public: uint8_t m_mcu_ack; }; +class quizard1_state : public quizard_state +{ +public: + quizard1_state(const machine_config &mconfig, device_type type, const char *tag) + : quizard_state(mconfig, type, tag) + { + set_mcu_value(0x021f); + set_mcu_ack(0x5a); + } +}; + +class quizard2_state : public quizard_state +{ +public: + quizard2_state(const machine_config &mconfig, device_type type, const char *tag) + : quizard_state(mconfig, type, tag) + { + // 0x2b1: Italian + // 0x001: French + // 0x188: German + set_mcu_value(0x0188); + set_mcu_ack(0x59); + } +}; + +class quizard3_state : public quizard_state +{ +public: + quizard3_state(const machine_config &mconfig, device_type type, const char *tag) + : quizard_state(mconfig, type, tag) + { + set_mcu_value(0x00ae); + set_mcu_ack(0x58); + } +}; + +class quizard4_state : public quizard_state +{ +public: + quizard4_state(const machine_config &mconfig, device_type type, const char *tag) + : quizard_state(mconfig, type, tag) + { + set_mcu_value(0x011f); + set_mcu_ack(0x57); + } +}; + #endif // MAME_INCLUDES_CDI_H diff --git a/src/mame/includes/dc.h b/src/mame/includes/dc.h index 1dade3c1212..e7f85f620f3 100644 --- a/src/mame/includes/dc.h +++ b/src/mame/includes/dc.h @@ -53,7 +53,7 @@ class dc_state : public driver_device uint8_t indirect; uint8_t start; uint8_t sel; - }m_g2_dma[4]; + } m_g2_dma[4]; virtual void machine_start() override; virtual void machine_reset() override; @@ -84,6 +84,7 @@ class dc_state : public driver_device DECLARE_WRITE16_MEMBER( soundram_w ); DECLARE_WRITE_LINE_MEMBER(aica_irq); DECLARE_WRITE_LINE_MEMBER(sh4_aica_irq); + DECLARE_WRITE_LINE_MEMBER(external_irq); required_device<sh4_base_device> m_maincpu; diff --git a/src/mame/includes/dccons.h b/src/mame/includes/dccons.h index 6e37e85cd25..8ed88874c64 100644 --- a/src/mame/includes/dccons.h +++ b/src/mame/includes/dccons.h @@ -18,12 +18,12 @@ public: dc_cons_state(const machine_config &mconfig, device_type type, const char *tag) : dc_state(mconfig, type, tag) , m_ata(*this, "ata") + , m_dcflash(*this, "dcflash") , atapi_xfercomplete(0) -// , m_dcflash(*this, "dcflash") { } required_device<ata_interface_device> m_ata; -// required_device<macronix_29lv160tmc_device> m_dcflash; + required_device<fujitsu_29lv002tc_device> m_dcflash; void init_dc(); void init_dcus(); @@ -46,8 +46,8 @@ public: void dreamcast_atapi_init(); DECLARE_READ32_MEMBER( dc_mess_g1_ctrl_r ); DECLARE_WRITE32_MEMBER( dc_mess_g1_ctrl_w ); -// DECLARE_READ8_MEMBER( dc_flash_r ); -// DECLARE_WRITE8_MEMBER( dc_flash_w ); + DECLARE_READ8_MEMBER( dc_flash_r ); + DECLARE_WRITE8_MEMBER( dc_flash_w ); static void gdrom_config(device_t *device); void dc_base(machine_config &config); diff --git a/src/mame/includes/electron.h b/src/mame/includes/electron.h index 9dd9bb30eca..1bf29e0440c 100644 --- a/src/mame/includes/electron.h +++ b/src/mame/includes/electron.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol +// copyright-holders:Wilbert Pol, Nigel Barnes /***************************************************************************** * * includes/electron.h @@ -15,11 +15,16 @@ #pragma once #include "machine/ram.h" +#include "machine/6522via.h" +#include "machine/input_merger.h" #include "imagedev/cassette.h" #include "sound/beep.h" #include "emupal.h" #include "bus/electron/exp.h" +#include "bus/bbc/userport/userport.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" /* Interrupts */ #define INT_HIGH_TONE 0x40 @@ -36,6 +41,7 @@ public: electron_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_irqs(*this, "irqs") , m_screen(*this, "screen") , m_cassette(*this, "cassette") , m_beeper(*this, "beeper") @@ -54,7 +60,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); -private: +protected: enum { TIMER_TAPE_HANDLER, @@ -69,12 +75,12 @@ private: DECLARE_READ8_MEMBER(electron64_fetch_r); DECLARE_READ8_MEMBER(electron_mem_r); DECLARE_WRITE8_MEMBER(electron_mem_w); - DECLARE_READ8_MEMBER(electron_paged_r); - DECLARE_WRITE8_MEMBER(electron_paged_w); + virtual DECLARE_READ8_MEMBER(electron_paged_r); + virtual DECLARE_WRITE8_MEMBER(electron_paged_w); DECLARE_READ8_MEMBER(electron_mos_r); DECLARE_WRITE8_MEMBER(electron_mos_w); - DECLARE_READ8_MEMBER(electron_fred_r); - DECLARE_WRITE8_MEMBER(electron_fred_w); + virtual DECLARE_READ8_MEMBER(electron_fred_r); + virtual DECLARE_WRITE8_MEMBER(electron_fred_w); DECLARE_READ8_MEMBER(electron_jim_r); DECLARE_WRITE8_MEMBER(electron_jim_w); DECLARE_READ8_MEMBER(electron_sheila_r); @@ -101,6 +107,7 @@ private: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device<cpu_device> m_maincpu; + required_device<input_merger_device> m_irqs; required_device<screen_device> m_screen; required_device<cassette_image_device> m_cassette; required_device<beep_device> m_beeper; @@ -147,4 +154,43 @@ private: bool m_vdu_drivers; }; + +class electronsp_state : public electron_state +{ +public: + electronsp_state(const machine_config &mconfig, device_type type, const char *tag) + : electron_state(mconfig, type, tag) + , m_region_sp64(*this, "sp64") + , m_via(*this, "via6522") + , m_userport(*this, "userport") + , m_romi(*this, "romi%u", 1) + , m_rompages(*this, "ROMPAGES") + { } + + void electronsp(machine_config &config); + +protected: + virtual DECLARE_READ8_MEMBER(electron_paged_r) override; + virtual DECLARE_WRITE8_MEMBER(electron_paged_w) override; + virtual DECLARE_READ8_MEMBER(electron_fred_r) override; + virtual DECLARE_WRITE8_MEMBER(electron_fred_w) override; + + virtual void machine_start() override; + +private: + required_memory_region m_region_sp64; + required_device<via6522_device> m_via; + required_device<bbc_userport_slot_device> m_userport; + required_device_array<generic_slot_device, 2> m_romi; + required_ioport m_rompages; + + uint8_t m_sp64_bank; + std::unique_ptr<uint8_t[]> m_sp64_ram; + + image_init_result load_rom(device_image_interface &image, generic_slot_device *slot); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_romi[0]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_romi[1]); } +}; + + #endif // MAME_INCLUDES_ELECTRON_H diff --git a/src/mame/includes/esd16.h b/src/mame/includes/esd16.h index 3257b464c79..60638cee7f3 100644 --- a/src/mame/includes/esd16.h +++ b/src/mame/includes/esd16.h @@ -44,6 +44,7 @@ public: void hedpanio(machine_config &config); void hedpanic(machine_config &config); void fantstry(machine_config &config); + void fantstrya(machine_config &config); protected: virtual void machine_start() override; @@ -87,6 +88,7 @@ private: template<unsigned Layer> TILE_GET_INFO_MEMBER(get_tile_info_16x16); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECOSPR_PRIORITY_CB_MEMBER(pri_callback); + void fantstrya_map(address_map &map); void hedpanic_map(address_map &map); void jumppop_map(address_map &map); void mchampdx_map(address_map &map); diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h index d8a0a9bf26e..f730f1803e3 100644 --- a/src/mame/includes/galaxian.h +++ b/src/mame/includes/galaxian.h @@ -16,7 +16,7 @@ #include "sound/ay8910.h" #include "sound/dac.h" #include "sound/digitalk.h" -#include "sound/discrete.h" +#include "machine/netlist.h" #include "emupal.h" #include "screen.h" #include "tilemap.h" @@ -74,7 +74,8 @@ public: , m_screen(*this, "screen") , m_palette(*this, "palette") , m_soundlatch(*this, "soundlatch") - , m_discrete(*this, "konami") + , m_netlist(*this, "konami") + , m_filter_ctl(*this, "konami:ctl%u", 0) , m_fake_select(*this, "FAKE_SELECT") , m_tenspot_game_dsw(*this, {"IN2_GAME0", "IN2_GAME1", "IN2_GAME2", "IN2_GAME3", "IN2_GAME4", "IN2_GAME5", "IN2_GAME6", "IN2_GAME7", "IN2_GAME8", "IN2_GAME9"}) , m_spriteram(*this, "spriteram") @@ -209,6 +210,7 @@ public: void init_explorer(); void init_amigo2(); void init_mandinga(); + void init_mandingaeg(); void init_sfx(); void init_atlantis(); void init_scobra(); @@ -423,8 +425,8 @@ protected: required_device<screen_device> m_screen; required_device<palette_device> m_palette; optional_device<generic_latch_8_device> m_soundlatch; - optional_device<discrete_sound_device> m_discrete; - + optional_device<netlist_mame_sound_device> m_netlist; + optional_device_array<netlist_mame_logic_input_device, 12> m_filter_ctl; optional_ioport m_fake_select; optional_ioport_array<10> m_tenspot_game_dsw; diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index 7c0c9039956..8ac8ad05269 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -65,6 +65,7 @@ public: DECLARE_VIDEO_START(cherrym); void cmast91_palette(palette_device &palette) const; void lucky8_palette(palette_device &palette) const; + void nfm_palette(palette_device &palette) const; uint32_t screen_update_goldstar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_cmast91(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -169,10 +170,14 @@ public: void init_skill98(); void init_po33(); void init_match133(); - void init_nfb96_dk(); + void init_nfb96_a(); + void init_nfb96_b(); + void init_nfb96_c1(); + void init_nfb96_c1_2(); void init_nfb96_c2(); void init_nfb96_d(); - void init_nfb96_c1(); + void init_nfb96_dk(); + void init_nfb96_g(); void init_nfb96sea(); void init_fb2010(); void init_rp35(); @@ -182,10 +187,12 @@ public: void init_tcl(); void init_super7(); void init_chthree(); + void init_wcat3a(); uint32_t screen_update_amcoe1a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void cm(machine_config &config); + void cm97(machine_config &config); void cmasterc(machine_config &config); void amcoe1a(machine_config &config); void nfm(machine_config &config); @@ -195,6 +202,7 @@ public: void amcoe1_portmap(address_map &map); void amcoe2_portmap(address_map &map); void cm_portmap(address_map &map); + void cm97_portmap(address_map &map); void chryangl_decrypted_opcodes_map(address_map &map); protected: @@ -242,6 +250,7 @@ public: void lucky8(machine_config &config); void lucky8f(machine_config &config); void lucky8k(machine_config &config); + void luckylad(machine_config &config); void super972(machine_config &config); void wcat3(machine_config &config); void magodds(machine_config &config); @@ -284,7 +293,7 @@ public: void cb3c(machine_config &config); void cb3e(machine_config &config); void ncb3(machine_config &config); - void cm97(machine_config &config); + void eldoradd(machine_config &config); void ncb3_map(address_map &map); void chryangla_map(address_map &map); void chryangla_decrypted_opcodes_map(address_map &map); diff --git a/src/mame/includes/jazz.h b/src/mame/includes/jazz.h index e4f1d75f847..7b8135899e5 100644 --- a/src/mame/includes/jazz.h +++ b/src/mame/includes/jazz.h @@ -14,7 +14,7 @@ #include "machine/28fxxx.h" // various hardware -#include "machine/jazz_mct_adr.h" +#include "machine/mct_adr.h" #include "machine/dp83932c.h" #include "machine/mc146818.h" #include "machine/ins8250.h" @@ -66,6 +66,7 @@ public: , m_lpt(*this, "lpt") , m_isp(*this, "isp") , m_buzzer(*this, "buzzer") + , m_led(*this, "led0") { } @@ -75,11 +76,14 @@ protected: virtual void machine_reset() override; // address maps - void jazz_common_map(address_map &map); + void cpu_map(address_map &map); + void mct_map(address_map &map); // machine config void jazz(machine_config &config); + void led_w(u8 data); + public: void mmr4000be(machine_config &config); void mmr4000le(machine_config &config); @@ -93,7 +97,7 @@ protected: required_device<r4000_device> m_cpu; required_device<ram_device> m_ram; required_device<ram_device> m_vram; - required_device<jazz_mct_adr_device> m_mct_adr; + required_device<mct_adr_device> m_mct_adr; required_device<nscsi_bus_device> m_scsibus; required_device<ncr53c94_device> m_scsi; required_device<n82077aa_device> m_fdc; @@ -109,9 +113,7 @@ protected: required_device<i82357_device> m_isp; required_device<speaker_sound_device> m_buzzer; -private: - // machine state - u8 m_led; + output_finder<> m_led; }; #endif // MAME_INCLUDES_JAZZ_H diff --git a/src/mame/includes/klax.h b/src/mame/includes/klax.h index f3be41db77c..d756d029b31 100644 --- a/src/mame/includes/klax.h +++ b/src/mame/includes/klax.h @@ -25,7 +25,7 @@ public: { } void klax(machine_config &config); - void klax2bl(machine_config &config); + void klax5bl(machine_config &config); private: virtual void machine_reset() override; @@ -35,13 +35,13 @@ private: virtual void update_interrupts() override; void interrupt_ack_w(u16 data = 0); - void klax_latch_w(u16 data); + void latch_w(u16 data); TILE_GET_INFO_MEMBER(get_playfield_tile_info); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void bootleg_sound_map(address_map &map); - void klax2bl_map(address_map &map); + void klax5bl_map(address_map &map); void klax_map(address_map &map); required_device<tilemap_device> m_playfield_tilemap; diff --git a/src/mame/includes/mc1502.h b/src/mame/includes/mc1502.h index 25eda38b881..eafd294bc7a 100644 --- a/src/mame/includes/mc1502.h +++ b/src/mame/includes/mc1502.h @@ -22,6 +22,7 @@ #include "bus/centronics/ctronics.h" #include "bus/isa/isa.h" #include "bus/isa/xsu_cards.h" +#include "bus/isa/mc1502_fdc.h" class mc1502_state : public driver_device @@ -47,6 +48,8 @@ public: void init_mc1502(); + void fdc_config(device_t *device); + private: required_device<cpu_device> m_maincpu; required_device<i8251_device> m_upd8251; diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h index 79bef161a25..0f0e43ce166 100644 --- a/src/mame/includes/megadriv.h +++ b/src/mame/includes/megadriv.h @@ -139,7 +139,9 @@ public: void megadriv_timers(machine_config &config); void md_ntsc(machine_config &config); + void md2_ntsc(machine_config &config); void md_pal(machine_config &config); + void md2_pal(machine_config &config); void md_bootleg(machine_config &config); void dcat16_megadriv_base(machine_config &config); void dcat16_megadriv_map(address_map &map); @@ -201,11 +203,15 @@ public: void md_32x_scd(machine_config &config); void mdj_32x(machine_config &config); void ms_megadriv(machine_config &config); + void ms_megadriv2(machine_config &config); void mdj_scd(machine_config &config); + void md2j_scd(machine_config &config); void md_32x(machine_config &config); void genesis_32x(machine_config &config); void md_scd(machine_config &config); + void md2_scd(machine_config &config); void genesis_scd(machine_config &config); + void genesis2_scd(machine_config &config); void genesis_tmss(machine_config &config); }; diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h index ea9acbb8b0e..a18ca212966 100644 --- a/src/mame/includes/model1.h +++ b/src/mame/includes/model1.h @@ -356,25 +356,6 @@ private: DECLARE_WRITE8_MEMBER(wingwar360_outputs_w); DECLARE_WRITE8_MEMBER(netmerc_outputs_w); DECLARE_WRITE8_MEMBER(drive_board_w); - - struct racc { - u32 adr; - u32 val; - bool write; - }; - - std::function<void ()> check_hle; - int count; - int m_check_fipos, m_check_rampos; - std::vector<u32> m_check_fi; - std::vector<u32> m_check_fo; - std::vector<int> m_check_pfi; - std::vector<std::pair<u32, bool>> m_check_pfo; - std::vector<racc> m_check_ram; - std::vector<racc> m_check_pram; - void check(); - u32 hle_ram_r(u32 address); - void hle_ram_w(u32 address, u32 data); }; #endif // MAME_INCLUDES_MODEL1_H diff --git a/src/mame/includes/naomi.h b/src/mame/includes/naomi.h index 11160f45f98..9c6a3173851 100644 --- a/src/mame/includes/naomi.h +++ b/src/mame/includes/naomi.h @@ -79,6 +79,7 @@ protected: optional_ioport_array<5> m_mp; DECLARE_MACHINE_RESET(naomi); + DECLARE_WRITE_LINE_MEMBER(external_reset); DECLARE_READ16_MEMBER( naomi_g2bus_r ); DECLARE_READ64_MEMBER( eeprom_93c46a_r ); diff --git a/src/mame/includes/nes.h b/src/mame/includes/nes.h index ee722e92b36..b0717a6ad19 100644 --- a/src/mame/includes/nes.h +++ b/src/mame/includes/nes.h @@ -52,8 +52,8 @@ class nes_base_state : public driver_device { public: - nes_base_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + nes_base_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_ctrl1(*this, "ctrl1"), m_ctrl2(*this, "ctrl2") @@ -71,8 +71,8 @@ public: class nes_state : public nes_base_state { public: - nes_state(const machine_config &mconfig, device_type type, const char *tag) - : nes_base_state(mconfig, type, tag), + nes_state(const machine_config &mconfig, device_type type, const char *tag) : + nes_base_state(mconfig, type, tag), m_ppu(*this, "ppu"), m_screen(*this, "screen"), m_exp(*this, "exp"), diff --git a/src/mame/includes/nforcepc.h b/src/mame/includes/nforcepc.h index aced8ad9b7c..573d7c2fed0 100644 --- a/src/mame/includes/nforcepc.h +++ b/src/mame/includes/nforcepc.h @@ -261,17 +261,17 @@ private: } mode; enum LogicalDevice { - FDC = 0, // Floppy disk controller - Parallel, // Parallel port - Serial1, // Serial port 1 - Serial2, // Serial port 2 - Keyboard = 5, // Keyboard controller - ConsumerIR, // Consumer IR - Gpio1, // Game port, MIDI, GPIO set 1 - Gpio2, // GPIO set 2 - Gpio34, // GPIO set 3 and 4 - ACPI, // ACPI - Gpio567 = 12 // GPIO set 5, 6 and 7 + FDC = 0, // Floppy disk controller + Parallel, // Parallel port + Serial1, // Serial port 1 + Serial2, // Serial port 2 + Keyboard = 5, // Keyboard controller + ConsumerIR, // Consumer IR + Gpio1, // Game port, MIDI, GPIO set 1 + Gpio2, // GPIO set 2 + Gpio34, // GPIO set 3 and 4 + ACPI, // ACPI + Gpio567 = 12 // GPIO set 5, 6 and 7 }; int config_key_step; int config_index; diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h index d7f08beb67f..9440177fcc1 100644 --- a/src/mame/includes/pgm.h +++ b/src/mame/includes/pgm.h @@ -42,6 +42,7 @@ public: , m_soundlatch(*this, "soundlatch") , m_soundlatch3(*this, "soundlatch3") , m_ics(*this, "ics") + , m_adata(*this, "sprcol") , m_bdata(*this, "sprmask") { m_irq4_disabled = 0; @@ -80,8 +81,6 @@ private: u16 * m_bg_videoram; u16 * m_tx_videoram; u16 * m_rowscrollram; - std::unique_ptr<u8[]> m_sprite_a_region; - size_t m_sprite_a_region_size; std::unique_ptr<u16[]> m_spritebufferram; // buffered spriteram /* video-related */ @@ -97,9 +96,11 @@ private: required_device<ics2115_device> m_ics; /* used by rendering */ - required_region_ptr<u8> m_bdata; - int m_aoffset; - int m_boffset; + required_region_ptr<u16> m_adata; + required_region_ptr<u16> m_bdata; + u32 m_aoffset; + u8 m_abit; + u32 m_boffset; u16 videoram_r(offs_t offset); void videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); @@ -122,12 +123,12 @@ private: inline void pgm_draw_pix(int xdrawpos, int pri, u16* dest, u8* destpri, const rectangle &cliprect, u16 srcdat); inline void pgm_draw_pix_nopri(int xdrawpos, u16* dest, u8* destpri, const rectangle &cliprect, u16 srcdat); inline void pgm_draw_pix_pri(int xdrawpos, u16* dest, u8* destpri, const rectangle &cliprect, u16 srcdat); + inline u8 get_sprite_pix(); void draw_sprite_line(int wide, u16* dest, u8* destpri, const rectangle &cliprect, int xzoom, bool xgrow, int flip, int xpos, int pri, int realxsize, int palt, bool draw); void draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, int palt, int flip, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u32 xzoom, bool xgrow, u32 yzoom, bool ygrow, int pri); void draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const rectangle &cliprect, int flip, int xpos, int pri, int realxsize, int palt, bool draw); void draw_sprite_new_basic(int wide, int high, int xpos, int ypos, int palt, int flip, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri); void draw_sprites(bitmap_ind16& spritebitmap, const rectangle &cliprect, u16 *sprite_source, bitmap_ind8& priority_bitmap); - void expand_colourdata(); void pgm_basic_mem(address_map &map); void pgm_z80_io(address_map &map); void pgm_z80_mem(address_map &map); diff --git a/src/mame/includes/psion5.h b/src/mame/includes/psion5.h new file mode 100644 index 00000000000..45e7fd2e7cc --- /dev/null +++ b/src/mame/includes/psion5.h @@ -0,0 +1,219 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, Ash Wolf +/*************************************************************************** + + Psion 5mx (EPOC R5) series and peripherals + + Skeleton driver by Ryan Holtz, ported from work by Ash Wolf + +****************************************************************************/ + +#ifndef MAME_INCLUDES_PSION5_H +#define MAME_INCLUDES_PSION5_H + +#pragma once + +#include "emu.h" +#include "cpu/arm7/arm7.h" +#include "cpu/arm7/arm7core.h" +#include "machine/etna.h" +#include "sound/spkrdev.h" + +#include "screen.h" +#include "emupal.h" +#include "speaker.h" + +class psion5mx_state : public driver_device +{ +public: + psion5mx_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_etna(*this, "etna") + , m_lcd_ram(*this, "lcd_ram") + , m_palette(*this, "palette") + , m_speaker(*this, "speaker") + , m_touchx(*this, "TOUCHX") + , m_touchy(*this, "TOUCHY") + , m_touch(*this, "TOUCH") + , m_kbd_cols(*this, "COL%u", 0U) + { + } + + void psion5mx(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(touch_down); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: + void palette_init(palette_device &palette); + + DECLARE_READ32_MEMBER(periphs_r); + DECLARE_WRITE32_MEMBER(periphs_w); + + void update_timer(int timer); + void set_timer_ctrl(int timer, uint32_t value); + void check_interrupts(); + + static constexpr device_timer_id TID_TIMER1 = 0; + static constexpr device_timer_id TID_TIMER2 = 1; + static constexpr device_timer_id TID_PERIODIC = 2; + static constexpr device_timer_id TID_RTC_TICKER = 3; + + enum + { + REG_MEMCFG1 = 0x0000, + REG_MEMCFG2 = 0x0004, + + REG_DRAMCFG = 0x0100, + + REG_LCDCTL = 0x0200, + REG_LCDST = 0x0204, + REG_LCD_DBAR1 = 0x0210, + REG_LCDT0 = 0x0220, + REG_LCDT1 = 0x0224, + REG_LCDT2 = 0x0228, + + REG_PWRSR = 0x0400, + REG_PWRCNT = 0x0404, + REG_HALT = 0x0408, + REG_STBY = 0x040c, + REG_BLEOI = 0x0410, + REG_MCEOI = 0x0414, + REG_TEOI = 0x0418, + REG_STFCLR = 0x041c, + REG_E2EOI = 0x0420, + + REG_INTSR = 0x0500, + REG_INTRSR = 0x0504, + REG_INTENS = 0x0508, + REG_INTENC = 0x050c, + REG_INTTEST1 = 0x0514, + REG_INTTEST2 = 0x0518, + + REG_PUMPCON = 0x0900, + + REG_CODR = 0x0a00, + REG_CONFG = 0x0a04, + REG_COLFG = 0x0a08, + REG_COEOI = 0x0a0c, + REG_COTEST = 0x0a10, + + REG_SSCR0 = 0x0b00, + REG_SSCR1 = 0x0b04, + REG_SSDR = 0x0b0c, + REG_SSSR = 0x0b14, + + REG_TC1LOAD = 0x0c00, + REG_TC1VAL = 0x0c04, + REG_TC1CTRL = 0x0c08, + REG_TC1EOI = 0x0c0c, + REG_TC2LOAD = 0x0c20, + REG_TC2VAL = 0x0c24, + REG_TC2CTRL = 0x0c28, + REG_TC2EOI = 0x0c2c, + + REG_BZCONT = 0x0c40, + + REG_RTCDRL = 0x0d00, + REG_RTCDRU = 0x0d04, + REG_RTCMRL = 0x0d08, + REG_RTCMRU = 0x0d0c, + REG_RTCEOI = 0x0d10, + + REG_PADR = 0x0e00, + REG_PBDR = 0x0e04, + REG_PCDR = 0x0e08, + REG_PDDR = 0x0e0c, + REG_PADDR = 0x0e10, + REG_PBDDR = 0x0e14, + REG_PCDDR = 0x0e18, + REG_PDDDR = 0x0e1c, + REG_PEDR = 0x0e20, + REG_PEDDR = 0x0e24, + + REG_KSCAN = 0x0e28, + REG_LCDMUX = 0x0e2c + }; + + enum + { + IRQ_EXTFIQ = 0, // FiqExternal + IRQ_BLINT = 1, // FiqBatLow + IRQ_WEINT = 2, // FiqWatchDog + IRQ_MCINT = 3, // FiqMediaChg + IRQ_CSINT = 4, // IrqCodec + IRQ_EINT1 = 5, // IrqExt1 + IRQ_EINT2 = 6, // IrqExt2 + IRQ_EINT3 = 7, // IrqExt3 + IRQ_TC1OI = 8, // IrqTimer1 + IRQ_TC2OI = 9, // IrqTimer2 + IRQ_RTCMI = 10, // IrqRtcMatch + IRQ_TINT = 11, // IrqTick + IRQ_UART1 = 12, // IrqUart1 + IRQ_UART2 = 13, // IrqUart2 + IRQ_LCDINT = 14, // IrqLcd + IRQ_SSEOTI = 15, // IrqSpi + IRQ_FIQ_MASK = 0x000f, + IRQ_IRQ_MASK = 0xfff0 + }; + + enum + { + PORTA, + PORTB, + PORTC, + PORTD, + PORTE + }; + + void main_map(address_map &map); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + uint8_t read_keyboard(); + + required_device<arm710t_cpu_device> m_maincpu; + required_device<etna_device> m_etna; + required_shared_ptr<uint32_t> m_lcd_ram; + required_device<palette_device> m_palette; + required_device<speaker_sound_device> m_speaker; + required_ioport m_touchx; + required_ioport m_touchy; + required_ioport m_touch; + required_ioport_array<8> m_kbd_cols; + + emu_timer *m_timers[2]; + + uint32_t m_memcfg[2]; + uint16_t m_dramcfg; + + uint16_t m_timer_reload[2]; + uint16_t m_timer_ctrl[2]; + uint16_t m_timer_value[2]; + + uint32_t m_pending_ints; + uint32_t m_int_mask; + + uint32_t m_lcd_display_base_addr; + + uint32_t m_rtc; + uint32_t m_pwrsr; + uint32_t m_last_ssi_request; + uint32_t m_ssi_read_counter; + uint8_t m_buzzer_ctrl; + + uint8_t m_kbd_scan; + + uint8_t m_ports[5]; + + emu_timer *m_periodic; + emu_timer *m_rtc_ticker; +}; + +#endif // MAME_INCLUDES_PSION5_H diff --git a/src/mame/includes/route16.h b/src/mame/includes/route16.h index 42bda56869a..558b4b7426b 100644 --- a/src/mame/includes/route16.h +++ b/src/mame/includes/route16.h @@ -20,6 +20,7 @@ public: , m_sharedram(*this, "sharedram") , m_videoram1(*this, "videoram1") , m_videoram2(*this, "videoram2") + , m_decrypted_opcodes(*this, "decrypted_opcodes") , m_palette(*this, "palette") , m_screen(*this, "screen") , m_protection_data(0) @@ -31,10 +32,12 @@ public: void speakres(machine_config &config); void stratvox(machine_config &config); void route16(machine_config &config); + void vscompmj(machine_config &config); void init_route16(); void init_route16a(); void init_route16c(); + void init_vscompmj(); private: DECLARE_WRITE8_MEMBER(out0_w); @@ -62,6 +65,8 @@ private: void stratvox_cpu1_map(address_map &map); void stratvox_cpu2_map(address_map &map); void jongpute_cpu1_map(address_map &map); + void vscompmj_cpu1_map(address_map &map); + void vscompmj_decrypted_opcodes(address_map &map); required_device<cpu_device> m_cpu1; required_device<cpu_device> m_cpu2; @@ -70,6 +75,7 @@ private: required_shared_ptr<uint8_t> m_sharedram; required_shared_ptr<uint8_t> m_videoram1; required_shared_ptr<uint8_t> m_videoram2; + optional_shared_ptr<uint8_t> m_decrypted_opcodes; required_device<palette_device> m_palette; required_device<screen_device> m_screen; uint8_t m_protection_data; diff --git a/src/mame/includes/rpunch.h b/src/mame/includes/rpunch.h index 973b59e47b7..dd293225fba 100644 --- a/src/mame/includes/rpunch.h +++ b/src/mame/includes/rpunch.h @@ -47,7 +47,7 @@ private: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<generic_latch_8_device> m_soundlatch; - required_device<upd7759_device> m_upd7759; + optional_device<upd7759_device> m_upd7759; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; @@ -87,6 +87,8 @@ private: void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void main_map(address_map &map); void sound_map(address_map &map); + void svolleybl_main_map(address_map &map); + void svolleybl_sound_map(address_map &map); }; #endif // MAME_INCLUDES_RPUNCH_H diff --git a/src/mame/includes/spg2xx.h b/src/mame/includes/spg2xx.h new file mode 100644 index 00000000000..8ec57d6fabb --- /dev/null +++ b/src/mame/includes/spg2xx.h @@ -0,0 +1,86 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, David Haywood +#pragma once + +#ifndef MAME_INCLUDES_SPG2XX_H +#define MAME_INCLUDES_SPG2XX_H + +#include "emu.h" + +#include "cpu/unsp/unsp.h" +#include "machine/i2cmem.h" +#include "machine/spg2xx.h" + + +#include "screen.h" +#include "softlist.h" +#include "speaker.h" + + + +class spg2xx_game_state : public driver_device +{ +public: + spg2xx_game_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_screen(*this, "screen"), + m_bank(*this, "cartbank"), + m_io_p1(*this, "P1"), + m_io_p2(*this, "P2"), + m_io_p3(*this, "P3"), + m_i2cmem(*this, "i2cmem") + { } + + void spg2xx_base(machine_config &config); + void rad_skat(machine_config &config); + void rad_skatp(machine_config &config); + void rad_sktv(machine_config &config); + void rad_crik(machine_config &config); + void non_spg_base(machine_config &config); + void abltenni(machine_config &config); + void tvsprt10(machine_config &config); + + void init_crc(); + void init_wiwi18(); + void init_tvsprt10(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void switch_bank(uint32_t bank); + + DECLARE_WRITE8_MEMBER(i2c_w); + DECLARE_READ8_MEMBER(i2c_r); + + virtual DECLARE_WRITE16_MEMBER(porta_w); + virtual DECLARE_WRITE16_MEMBER(portb_w); + virtual DECLARE_WRITE16_MEMBER(portc_w); + + DECLARE_READ16_MEMBER(rad_porta_r); + DECLARE_READ16_MEMBER(rad_portb_r); + DECLARE_READ16_MEMBER(rad_portc_r); + + + required_device<spg2xx_device> m_maincpu; + required_device<screen_device> m_screen; + optional_memory_bank m_bank; + + + virtual void mem_map_4m(address_map &map); + virtual void mem_map_2m(address_map &map); + virtual void mem_map_1m(address_map &map); + + uint32_t m_current_bank; + + required_ioport m_io_p1; + optional_ioport m_io_p2; + optional_ioport m_io_p3; + optional_device<i2cmem_device> m_i2cmem; +}; + + + + +#endif // MAME_INCLUDES_SPG2XX_H diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h index 060603b2cc2..0b3b3c70211 100644 --- a/src/mame/includes/system1.h +++ b/src/mame/includes/system1.h @@ -21,11 +21,7 @@ class system1_state : public driver_device public: system1_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_ppi8255(*this, "ppi8255"), - m_pio(*this, "pio"), - m_ram(*this, "ram"), - m_spriteram(*this, "spriteram"), - m_paletteram(*this, "palette"), + m_videoram(nullptr), m_videomode_custom(nullptr), m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), @@ -34,9 +30,16 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), + m_ppi8255(*this, "ppi8255"), + m_pio(*this, "pio"), + m_ram(*this, "ram"), + m_spriteram(*this, "spriteram"), + m_paletteram(*this, "paletteram"), m_decrypted_opcodes(*this, "decrypted_opcodes"), m_maincpu_region(*this, "maincpu"), - m_color_prom(*this, "palette"), + m_spriterom(*this, "sprites"), + m_lookup_prom(*this, "lookup_proms"), + m_color_prom(*this, "color_proms"), m_bank1(*this, "bank1"), m_bank0d(*this, "bank0d"), m_bank1d(*this, "bank1d"), @@ -109,36 +112,55 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(dakkochn_mux_data_r); DECLARE_CUSTOM_INPUT_MEMBER(dakkochn_mux_status_r); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + private: - optional_device<i8255_device> m_ppi8255; - optional_device<z80pio_device> m_pio; - required_shared_ptr<uint8_t> m_ram; - required_shared_ptr<uint8_t> m_spriteram; - required_shared_ptr<uint8_t> m_paletteram; - - std::unique_ptr<uint8_t[]> m_videoram; - void (system1_state::*m_videomode_custom)(uint8_t data, uint8_t prevdata); - uint8_t m_mute_xor; - uint8_t m_dakkochn_mux_data; - uint8_t m_videomode_prev; - uint8_t m_mcu_control; - uint8_t m_nob_maincpu_latch; - uint8_t m_nob_mcu_latch; - uint8_t m_nob_mcu_status; - int m_nobb_inport23_step; - std::unique_ptr<uint8_t[]> m_mix_collide; - uint8_t m_mix_collide_summary; - std::unique_ptr<uint8_t[]> m_sprite_collide; - uint8_t m_sprite_collide_summary; + // video related + std::unique_ptr<u8[]> m_videoram; + void (system1_state::*m_videomode_custom)(u8 data, u8 prevdata); + u8 m_videomode_prev; + std::unique_ptr<u8[]> m_mix_collide; + u8 m_mix_collide_summary; + std::unique_ptr<u8[]> m_sprite_collide; + u8 m_sprite_collide_summary; bitmap_ind16 m_sprite_bitmap; - uint8_t m_video_mode; - uint8_t m_videoram_bank; + u8 m_video_mode; + u8 m_videoram_bank; tilemap_t *m_tilemap_page[8]; - uint8_t m_tilemap_pages; + u8 m_tilemap_pages; + + // protection, miscs + u8 m_mute_xor; + u8 m_dakkochn_mux_data; + u8 m_mcu_control; + u8 m_nob_maincpu_latch; + u8 m_nob_mcu_latch; + u8 m_nob_mcu_status; + int m_nobb_inport23_step; + // video handlers + DECLARE_WRITE8_MEMBER(common_videomode_w); DECLARE_WRITE8_MEMBER(videomode_w); + DECLARE_WRITE8_MEMBER(videoram_bank_w); + DECLARE_READ8_MEMBER(mixer_collision_r); + DECLARE_WRITE8_MEMBER(mixer_collision_w); + DECLARE_WRITE8_MEMBER(mixer_collision_reset_w); + DECLARE_READ8_MEMBER(sprite_collision_r); + DECLARE_WRITE8_MEMBER(sprite_collision_w); + DECLARE_WRITE8_MEMBER(sprite_collision_reset_w); + DECLARE_READ8_MEMBER(videoram_r); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_WRITE8_MEMBER(paletteram_w); + + // sound handlers DECLARE_READ8_MEMBER(sound_data_r); DECLARE_WRITE8_MEMBER(soundport_w); + DECLARE_WRITE8_MEMBER(sound_control_w); + + // misc handlers DECLARE_WRITE8_MEMBER(mcu_control_w); DECLARE_READ8_MEMBER(mcu_io_r); DECLARE_WRITE8_MEMBER(mcu_io_w); @@ -155,42 +177,29 @@ private: DECLARE_WRITE8_MEMBER(nobb_outport24_w); DECLARE_READ8_MEMBER(nob_start_r); DECLARE_READ8_MEMBER(shtngmst_gunx_r); - DECLARE_WRITE8_MEMBER(system1_videomode_w); - DECLARE_READ8_MEMBER(system1_mixer_collision_r); - DECLARE_WRITE8_MEMBER(system1_mixer_collision_w); - DECLARE_WRITE8_MEMBER(system1_mixer_collision_reset_w); - DECLARE_READ8_MEMBER(system1_sprite_collision_r); - DECLARE_WRITE8_MEMBER(system1_sprite_collision_w); - DECLARE_WRITE8_MEMBER(system1_sprite_collision_reset_w); - DECLARE_READ8_MEMBER(system1_videoram_r); - DECLARE_WRITE8_MEMBER(system1_videoram_w); - DECLARE_WRITE8_MEMBER(system1_paletteram_w); - DECLARE_WRITE8_MEMBER(sound_control_w); - - void encrypted_sys1ppi_maps(machine_config &config); - void encrypted_sys1pio_maps(machine_config &config); - void encrypted_sys2_mc8123_maps(machine_config &config); + // video functions TILE_GET_INFO_MEMBER(tile_get_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; + void system1_palette(palette_device &palette) const; DECLARE_MACHINE_START(system2); DECLARE_VIDEO_START(system2); DECLARE_MACHINE_START(myherok); - uint32_t screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen); - TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback); - DECLARE_WRITE8_MEMBER(system1_videoram_bank_w); + u32 screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void video_start_common(int pagecount); inline void videoram_wait_states(cpu_device *cpu); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset); void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs); - void bank44_custom_w(uint8_t data, uint8_t prevdata); - void bank0c_custom_w(uint8_t data, uint8_t prevdata); - void dakkochn_custom_w(uint8_t data, uint8_t prevdata); + + // misc functions + TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen); + TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback); + void bank44_custom_w(u8 data, u8 prevdata); + void bank0c_custom_w(u8 data, u8 prevdata); + void dakkochn_custom_w(u8 data, u8 prevdata); + + // devices required_device<z80_device> m_maincpu; required_device<cpu_device> m_soundcpu; optional_device<i8751_device> m_mcu; @@ -198,17 +207,33 @@ private: required_device<screen_device> m_screen; required_device<palette_device> m_palette; required_device<generic_latch_8_device> m_soundlatch; - optional_shared_ptr<uint8_t> m_decrypted_opcodes; + optional_device<i8255_device> m_ppi8255; + optional_device<z80pio_device> m_pio; + + // shared pointers + required_shared_ptr<u8> m_ram; + required_shared_ptr<u8> m_spriteram; + required_shared_ptr<u8> m_paletteram; + optional_shared_ptr<u8> m_decrypted_opcodes; + + // memory regions required_memory_region m_maincpu_region; - optional_region_ptr<uint8_t> m_color_prom; + required_region_ptr<u8> m_spriterom; + required_region_ptr<u8> m_lookup_prom; + optional_region_ptr<u8> m_color_prom; + + // banks required_memory_bank m_bank1; optional_memory_bank m_bank0d; optional_memory_bank m_bank1d; + std::unique_ptr<u8[]> m_banked_decrypted_opcodes; - std::unique_ptr<uint8_t[]> m_banked_decrypted_opcodes; - + // address maps void banked_decrypted_opcodes_map(address_map &map); void decrypted_opcodes_map(address_map &map); + void encrypted_sys1ppi_maps(machine_config &config); + void encrypted_sys1pio_maps(machine_config &config); + void encrypted_sys2_mc8123_maps(machine_config &config); void mcu_io_map(address_map &map); void nobo_map(address_map &map); void sound_map(address_map &map); diff --git a/src/mame/includes/tumbleb.h b/src/mame/includes/tumbleb.h index f01bdd54471..5a71044dd55 100644 --- a/src/mame/includes/tumbleb.h +++ b/src/mame/includes/tumbleb.h @@ -44,6 +44,7 @@ public: void magipur(machine_config &config); void suprtrio(machine_config &config); void htchctch(machine_config &config); + void htchctch_mcu(machine_config &config); void sdfight(machine_config &config); void chokchok(machine_config &config); void cookbib_mcu(machine_config &config); diff --git a/src/mame/includes/ut88.h b/src/mame/includes/ut88.h index eb29fc92666..3a19639d0cb 100644 --- a/src/mame/includes/ut88.h +++ b/src/mame/includes/ut88.h @@ -16,90 +16,123 @@ #include "imagedev/cassette.h" #include "emupal.h" - -class ut88_state : public driver_device +class ut88_base_state : public driver_device { public: - ut88_state(const machine_config &mconfig, device_type type, const char *tag) + ut88_base_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_cassette(*this, "cassette") - , m_ppi(*this, "ppi8255") - , m_dac(*this, "dac") - , m_p_videoram(*this, "videoram") , m_region_maincpu(*this, "maincpu") - , m_region_proms(*this, "proms") - , m_bank1(*this, "bank1") , m_io_line0(*this, "LINE0") , m_io_line1(*this, "LINE1") , m_io_line2(*this, "LINE2") + , m_maincpu(*this, "maincpu") + { + } + +protected: + DECLARE_READ8_MEMBER(tape_r); + + required_device<cassette_image_device> m_cassette; + required_memory_region m_region_maincpu; + required_ioport m_io_line0; + required_ioport m_io_line1; + required_ioport m_io_line2; + required_device<cpu_device> m_maincpu; +}; + +class ut88_state : public ut88_base_state +{ +public: + ut88_state(const machine_config &mconfig, device_type type, const char *tag) + : ut88_base_state(mconfig, type, tag) + , m_ppi(*this, "ppi8255") + , m_dac(*this, "dac") + , m_p_videoram(*this, "videoram") + , m_bank1(*this, "bank1") , m_io_line3(*this, "LINE3") , m_io_line4(*this, "LINE4") , m_io_line5(*this, "LINE5") , m_io_line6(*this, "LINE6") , m_io_line7(*this, "LINE7") , m_io_line8(*this, "LINE8") - , m_maincpu(*this, "maincpu") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") - , m_digits(*this, "digit%u", 0U) { } void ut88(machine_config &config); - void ut88mini(machine_config &config); - - void init_ut88(); - void init_ut88mini(); private: + virtual void driver_init() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + enum { TIMER_RESET, TIMER_UPDATE_DISPLAY }; - DECLARE_READ8_MEMBER(ut88_keyboard_r); - DECLARE_WRITE8_MEMBER(ut88_keyboard_w); - DECLARE_WRITE8_MEMBER(ut88_sound_w); - DECLARE_READ8_MEMBER(ut88_tape_r); - DECLARE_READ8_MEMBER(ut88mini_keyboard_r); - DECLARE_WRITE8_MEMBER(ut88mini_write_led); - DECLARE_READ8_MEMBER(ut88_8255_portb_r); - DECLARE_READ8_MEMBER(ut88_8255_portc_r); - DECLARE_WRITE8_MEMBER(ut88_8255_porta_w); - DECLARE_MACHINE_RESET(ut88); - DECLARE_VIDEO_START(ut88); - DECLARE_MACHINE_START(ut88mini); - DECLARE_MACHINE_RESET(ut88mini); - uint32_t screen_update_ut88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void ut88_io(address_map &map); - void ut88_mem(address_map &map); - void ut88mini_io(address_map &map); - void ut88mini_mem(address_map &map); + DECLARE_READ8_MEMBER(keyboard_r); + DECLARE_WRITE8_MEMBER(keyboard_w); + DECLARE_WRITE8_MEMBER(sound_w); + DECLARE_READ8_MEMBER(ppi_portb_r); + DECLARE_READ8_MEMBER(ppi_portc_r); + DECLARE_WRITE8_MEMBER(ppi_porta_w); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void io_map(address_map &map); + void mem_map(address_map &map); - required_device<cassette_image_device> m_cassette; - optional_device<i8255_device> m_ppi; - optional_device<dac_bit_interface> m_dac; - optional_shared_ptr<uint8_t> m_p_videoram; int m_keyboard_mask; + + required_device<i8255_device> m_ppi; + required_device<dac_bit_interface> m_dac; + required_shared_ptr<uint8_t> m_p_videoram; + required_memory_bank m_bank1; + required_ioport m_io_line3; + required_ioport m_io_line4; + required_ioport m_io_line5; + required_ioport m_io_line6; + required_ioport m_io_line7; + required_ioport m_io_line8; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; +}; + +class ut88mini_state : public ut88_base_state +{ +public: + ut88mini_state(const machine_config &mconfig, device_type type, const char *tag) + : ut88_base_state(mconfig, type, tag) + , m_region_proms(*this, "proms") + , m_digits(*this, "digit%u", 0U) + { } + + void ut88mini(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + void io_map(address_map &map); + void mem_map(address_map &map); + + enum + { + TIMER_RESET, + TIMER_UPDATE_DISPLAY + }; + + DECLARE_READ8_MEMBER(keyboard_r); + DECLARE_WRITE8_MEMBER(led_w); + + required_memory_region m_region_proms; + int m_lcd_digit[6]; - required_memory_region m_region_maincpu; - optional_memory_region m_region_proms; - optional_memory_bank m_bank1; - required_ioport m_io_line0; - required_ioport m_io_line1; - required_ioport m_io_line2; - optional_ioport m_io_line3; - optional_ioport m_io_line4; - optional_ioport m_io_line5; - optional_ioport m_io_line6; - optional_ioport m_io_line7; - optional_ioport m_io_line8; - required_device<cpu_device> m_maincpu; - optional_device<gfxdecode_device> m_gfxdecode; - optional_device<palette_device> m_palette; output_finder<6> m_digits; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; /*----------- defined in video/ut88.c -----------*/ diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h index 1a8d2c7d9f2..ab57d8c125d 100644 --- a/src/mame/includes/williams.h +++ b/src/mame/includes/williams.h @@ -34,12 +34,6 @@ public: m_mainbank(*this, "mainbank"), m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), - m_mux(*this, "mux"), - m_mux0(*this, "mux_0"), - m_mux1(*this, "mux_1"), - m_muxa(*this, "mux_a"), - m_muxb(*this, "mux_b"), - m_bankc000(*this, "bankc000"), m_watchdog(*this, "watchdog"), m_screen(*this, "screen"), m_palette(*this, "palette"), @@ -47,42 +41,28 @@ public: m_pia(*this, "pia_%u", 0U) { } - void playball(machine_config &config); - void defender(machine_config &config); - void sinistar(machine_config &config); void lottofun(machine_config &config); - void williams(machine_config &config); - void williams_muxed(machine_config &config); - void jin(machine_config &config); + void williams_base(machine_config &config); - void init_sinistar(); void init_stargate(); void init_playball(); - void init_defender(); - void init_mayday(); void init_lottofun(); - void init_alienaru(); - void init_defndjeu(); - void init_splat(); - void init_joust(); - void init_alienar(); void init_robotron(); - void init_bubbles(); - u8 williams_49way_port_0_r(); - void williams_snd_cmd_w(u8 data); - void defender_video_control_w(u8 data); - u8 williams_video_counter_r(); - DECLARE_WRITE8_MEMBER(williams_watchdog_reset_w); + u8 port_0_49way_r(); + u8 video_counter_r(); + virtual DECLARE_WRITE8_MEMBER(watchdog_reset_w); - TIMER_DEVICE_CALLBACK_MEMBER(williams_va11_callback); - TIMER_DEVICE_CALLBACK_MEMBER(williams_count240_callback); + virtual TIMER_DEVICE_CALLBACK_MEMBER(va11_callback); + TIMER_DEVICE_CALLBACK_MEMBER(count240_callback); - uint32_t screen_update_williams(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - DECLARE_VIDEO_START(williams); - void williams_palette(palette_device &palette) const; + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void palette_init(palette_device &palette) const; protected: + virtual void machine_start() override; + virtual void video_start() override; + enum { //controlbyte (0xCA00) bit definitions @@ -99,7 +79,6 @@ protected: required_shared_ptr<uint8_t> m_nvram; required_shared_ptr<uint8_t> m_videoram; optional_memory_bank m_mainbank; - uint8_t *m_mayday_protection; uint8_t m_blitter_config; uint16_t m_blitter_clip_address; uint8_t m_blitter_window_enable; @@ -110,22 +89,14 @@ protected: uint8_t m_blitter_remap_index; const uint8_t *m_blitter_remap; std::unique_ptr<uint8_t[]> m_blitter_remap_lookup; - void williams_vram_select_w(u8 data); - void williams_cmos_w(offs_t offset, u8 data); - void bubbles_cmos_w(offs_t offset, u8 data); - void defender_bank_select_w(u8 data); - u8 mayday_protection_r(offs_t offset); + virtual void vram_select_w(u8 data); + virtual void cmos_w(offs_t offset, u8 data); void sinistar_vram_select_w(u8 data); - DECLARE_WRITE8_MEMBER(williams_blitter_w); + DECLARE_WRITE8_MEMBER(blitter_w); - DECLARE_MACHINE_START(defender); - DECLARE_MACHINE_RESET(defender); - DECLARE_MACHINE_START(williams); - DECLARE_MACHINE_START(williams_common); + TIMER_CALLBACK_MEMBER(deferred_snd_cmd_w); - TIMER_CALLBACK_MEMBER(williams_deferred_snd_cmd_w); - - void playball_snd_cmd_w(u8 data); + void snd_cmd_w(u8 data); DECLARE_WRITE_LINE_MEMBER(lottofun_coin_lock_w); @@ -136,24 +107,141 @@ protected: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; - optional_device<ls157_device> m_mux; - optional_device<ls157_device> m_mux0; - optional_device<ls157_device> m_mux1; - optional_device<ls157_x2_device> m_muxa; - optional_device<ls157_device> m_muxb; - optional_device<address_map_bank_device> m_bankc000; required_device<watchdog_timer_device> m_watchdog; required_device<screen_device> m_screen; optional_device<palette_device> m_palette; optional_shared_ptr<uint8_t> m_paletteram; optional_device_array<pia6821_device, 4> m_pia; - void defender_bankc000_map(address_map &map); - void defender_map(address_map &map); - void defender_sound_map(address_map &map); - void sinistar_map(address_map &map); - void sound_map(address_map &map); - void williams_map(address_map &map); + virtual void sound_map(address_map &map); + void base_map(address_map &map); +}; + +class defender_state : public williams_state +{ +public: + defender_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_state(mconfig, type, tag), + m_bankc000(*this, "bankc000") + { } + + void defender(machine_config &config); + void jin(machine_config &config); + +protected: + virtual void driver_init() override; + + virtual void main_map(address_map &map); + + void video_control_w(u8 data); + + required_device<address_map_bank_device> m_bankc000; + +private: + virtual void machine_start() override { } + virtual void machine_reset() override; + + void bankc000_map(address_map &map); + virtual void sound_map(address_map &map) override; + + void bank_select_w(u8 data); +}; + +class defndjeu_state : public defender_state +{ +public: + defndjeu_state(const machine_config &mconfig, device_type type, const char *tag) : + defender_state(mconfig, type, tag) + { } + +private: + virtual void driver_init() override; +}; + +class mayday_state : public defender_state +{ +public: + mayday_state(const machine_config &mconfig, device_type type, const char *tag) : + defender_state(mconfig, type, tag) + { } + +private: + virtual void driver_init() override; + + virtual void main_map(address_map &map) override; + + uint8_t *m_protection; + u8 protection_r(offs_t offset); +}; + +class sinistar_state : public williams_state +{ +public: + sinistar_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_state(mconfig, type, tag) + { } + + void sinistar(machine_config &config); + +private: + virtual void driver_init() override; + + virtual void vram_select_w(u8 data) override; + + void main_map(address_map &map); +}; + +class bubbles_state : public williams_state +{ +public: + bubbles_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_state(mconfig, type, tag) + { } + + void bubbles(machine_config &config); + +private: + virtual void driver_init() override; + + void main_map(address_map &map); + + virtual void cmos_w(offs_t offset, u8 data) override; +}; + +class playball_state : public williams_state +{ +public: + playball_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_state(mconfig, type, tag) + { } + + void playball(machine_config &config); + +private: + virtual void driver_init() override; + + void snd_cmd_w(u8 data); +}; + +class williams_muxed_state : public williams_state +{ +public: + williams_muxed_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_state(mconfig, type, tag), + m_mux0(*this, "mux_0"), + m_mux1(*this, "mux_1") + { } + + void williams_muxed(machine_config &config); + + void init_splat(); + void init_joust(); + void init_alienar(); + void init_alienaru(); + +private: + required_device<ls157_device> m_mux0; + required_device<ls157_device> m_mux1; }; class spdball_state : public williams_state @@ -165,10 +253,10 @@ public: void spdball(machine_config &config); - void driver_init() override; - private: - void spdball_map(address_map &map); + virtual void driver_init() override; + + void main_map(address_map &map); }; class blaster_state : public williams_state @@ -177,45 +265,48 @@ public: blaster_state(const machine_config &mconfig, device_type type, const char *tag) : williams_state(mconfig, type, tag), m_soundcpu_b(*this, "soundcpu_b"), - m_blaster_palette_0(*this, "blaster_pal0"), - m_blaster_scanline_control(*this, "blaster_scan"), - m_blaster_bankb(*this, "blaster_bankb") + m_palette_0(*this, "blaster_pal0"), + m_scanline_control(*this, "blaster_scan"), + m_bankb(*this, "blaster_bankb"), + m_muxa(*this, "mux_a"), + m_muxb(*this, "mux_b") { } void blastkit(machine_config &config); void blaster(machine_config &config); - void init_blaster(); - private: + virtual void machine_start() override; + virtual void video_start() override; + virtual void driver_init() override; + optional_device<cpu_device> m_soundcpu_b; - required_shared_ptr<uint8_t> m_blaster_palette_0; - required_shared_ptr<uint8_t> m_blaster_scanline_control; - optional_memory_bank m_blaster_bankb; + required_shared_ptr<uint8_t> m_palette_0; + required_shared_ptr<uint8_t> m_scanline_control; + optional_memory_bank m_bankb; + required_device<ls157_x2_device> m_muxa; + optional_device<ls157_device> m_muxb; - rgb_t m_blaster_color0; - uint8_t m_blaster_video_control; + rgb_t m_color0; + uint8_t m_video_control; uint8_t m_vram_bank; uint8_t m_rom_bank; - void blaster_vram_select_w(u8 data); - void blaster_bank_select_w(u8 data); - void blaster_remap_select_w(u8 data); - void blaster_video_control_w(u8 data); - TIMER_CALLBACK_MEMBER(blaster_deferred_snd_cmd_w); - void blaster_snd_cmd_w(u8 data); + virtual void vram_select_w(u8 data) override; + void bank_select_w(u8 data); + void remap_select_w(u8 data); + void video_control_w(u8 data); + TIMER_CALLBACK_MEMBER(deferred_snd_cmd_w); + void snd_cmd_w(u8 data); - DECLARE_MACHINE_START(blaster); - DECLARE_VIDEO_START(blaster); - uint32_t screen_update_blaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; inline void update_blaster_banking(); - void blaster_map(address_map &map); - void sound_map_b(address_map &map); + void main_map(address_map &map); + void sound2_map(address_map &map); }; - class williams2_state : public williams_state { public: @@ -223,61 +314,109 @@ public: williams_state(mconfig, type, tag), m_bank8000(*this, "bank8000"), m_gfxdecode(*this, "gfxdecode"), - m_williams2_tileram(*this, "williams2_tile") + m_tileram(*this, "williams2_tile") { } - void williams2(machine_config &config); - void mysticm(machine_config &config); - void inferno(machine_config &config); - - void init_mysticm(); - void init_tshoot(); - void init_inferno(); + void williams2_base(machine_config &config); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + required_device<address_map_bank_device> m_bank8000; required_device<gfxdecode_device> m_gfxdecode; - required_shared_ptr<uint8_t> m_williams2_tileram; + required_shared_ptr<uint8_t> m_tileram; tilemap_t *m_bg_tilemap; uint16_t m_tilemap_xscroll; - uint8_t m_williams2_fg_color; - uint8_t m_williams2_tilemap_config; - - TILE_GET_INFO_MEMBER(get_tile_info); - void williams2_bank_select_w(u8 data); - DECLARE_WRITE8_MEMBER(williams2_watchdog_reset_w); - void williams2_7segment_w(u8 data); - void williams2_paletteram_w(offs_t offset, u8 data); - void williams2_fg_select_w(u8 data); - void williams2_bg_select_w(u8 data); - void williams2_tileram_w(offs_t offset, u8 data); - void williams2_xscroll_low_w(u8 data); - void williams2_xscroll_high_w(u8 data); - void williams2_blit_window_enable_w(u8 data); - TIMER_DEVICE_CALLBACK_MEMBER(williams2_va11_callback); - TIMER_DEVICE_CALLBACK_MEMBER(williams2_endscreen_callback); - TIMER_CALLBACK_MEMBER(williams2_deferred_snd_cmd_w); - void williams2_snd_cmd_w(u8 data); - - DECLARE_MACHINE_START(williams2); - DECLARE_MACHINE_RESET(williams2); - DECLARE_VIDEO_START(williams2); - uint32_t screen_update_williams2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - - void williams2_bank8000_map(address_map &map); - void williams2_common_map(address_map &map); - void williams2_d000_ram_map(address_map &map); - void williams2_d000_rom_map(address_map &map); - void williams2_sound_map(address_map &map); + uint8_t m_fg_color; + + virtual TILE_GET_INFO_MEMBER(get_tile_info); + void bank_select_w(u8 data); + virtual DECLARE_WRITE8_MEMBER(watchdog_reset_w) override; + void segments_w(u8 data); + void paletteram_w(offs_t offset, u8 data); + void fg_select_w(u8 data); + virtual void bg_select_w(u8 data); + void tileram_w(offs_t offset, u8 data); + void xscroll_low_w(u8 data); + void xscroll_high_w(u8 data); + void blit_window_enable_w(u8 data); + virtual TIMER_DEVICE_CALLBACK_MEMBER(va11_callback) override; + TIMER_DEVICE_CALLBACK_MEMBER(endscreen_callback); + TIMER_CALLBACK_MEMBER(deferred_snd_cmd_w); + void snd_cmd_w(u8 data); + + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + + void bank8000_map(address_map &map); + void common_map(address_map &map); + virtual void sound_map(address_map &map) override; + + void video_control_w(u8 data); }; +class williams_d000_rom_state : public williams2_state +{ +public: + williams_d000_rom_state(const machine_config &mconfig, device_type type, const char *tag) : + williams2_state(mconfig, type, tag) + { } -class tshoot_state : public williams2_state +protected: + void d000_map(address_map &map); +}; + +class williams_d000_ram_state : public williams2_state +{ +public: + williams_d000_ram_state(const machine_config &mconfig, device_type type, const char *tag) : + williams2_state(mconfig, type, tag) + { } + +protected: + void d000_map(address_map &map); +}; + +class inferno_state : public williams_d000_ram_state +{ +public: + inferno_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_d000_ram_state(mconfig, type, tag), + m_mux(*this, "mux") + { } + + void inferno(machine_config &config); + +private: + virtual void driver_init() override; + + required_device<ls157_device> m_mux; +}; + +class mysticm_state : public williams_d000_ram_state +{ +public: + mysticm_state(const machine_config &mconfig, device_type type, const char *tag) : + williams_d000_ram_state(mconfig, type, tag) + { } + + void mysticm(machine_config &config); + +private: + virtual void driver_init() override; + + virtual TILE_GET_INFO_MEMBER(get_tile_info) override; + virtual void bg_select_w(u8 data) override; +}; + +class tshoot_state : public williams_d000_rom_state { public: tshoot_state(const machine_config &mconfig, device_type type, const char *tag) : - williams2_state(mconfig, type, tag), + williams_d000_rom_state(mconfig, type, tag), + m_mux(*this, "mux"), m_gun(*this, {"GUNX", "GUNY"}), m_grenade_lamp(*this, "Grenade_lamp"), m_gun_lamp(*this, "Gun_lamp"), @@ -290,11 +429,13 @@ public: template <int P> DECLARE_CUSTOM_INPUT_MEMBER(gun_r); private: + virtual void machine_start() override; + virtual void driver_init() override; + DECLARE_WRITE_LINE_MEMBER(maxvol_w); void lamp_w(u8 data); - DECLARE_MACHINE_START(tshoot); - + required_device<ls157_device> m_mux; required_ioport_array<2> m_gun; output_finder<> m_grenade_lamp; output_finder<> m_gun_lamp; @@ -302,27 +443,31 @@ private: output_finder<> m_feather_blower; }; -class joust2_state : public williams2_state +class joust2_state : public williams_d000_rom_state { public: joust2_state(const machine_config &mconfig, device_type type, const char *tag) : - williams2_state(mconfig, type, tag), + williams_d000_rom_state(mconfig, type, tag), + m_mux(*this, "mux"), m_cvsd_sound(*this, "cvsd") { } void joust2(machine_config &config); - void init_joust2(); - private: + virtual void machine_start() override; + virtual void driver_init() override; + + required_device<ls157_device> m_mux; required_device<williams_cvsd_sound_device> m_cvsd_sound; - uint16_t m_joust2_current_sound_data; + uint16_t m_current_sound_data; + + virtual TILE_GET_INFO_MEMBER(get_tile_info) override; + virtual void bg_select_w(u8 data) override; - DECLARE_MACHINE_START(joust2); - DECLARE_MACHINE_RESET(joust2); - TIMER_CALLBACK_MEMBER(joust2_deferred_snd_cmd_w); - DECLARE_WRITE8_MEMBER(joust2_snd_cmd_w); - DECLARE_WRITE_LINE_MEMBER(joust2_pia_3_cb1_w); + TIMER_CALLBACK_MEMBER(deferred_snd_cmd_w); + void snd_cmd_w(u8 data); + DECLARE_WRITE_LINE_MEMBER(pia_3_cb1_w); }; /*----------- defined in video/williams.cpp -----------*/ diff --git a/src/mame/includes/xavix.h b/src/mame/includes/xavix.h index e56d50f1fbc..cc7559c5ea2 100644 --- a/src/mame/includes/xavix.h +++ b/src/mame/includes/xavix.h @@ -199,7 +199,7 @@ protected: private: // screen updates - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void xavix_map(address_map &map); @@ -534,11 +534,11 @@ private: required_device<gfxdecode_device> m_gfxdecode; void update_pen(int pen, uint8_t shval, uint8_t lval); - void draw_tile_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int zval, int line); - void draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which); - void draw_tilemap_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int line); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int line); + void draw_tile_line(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int zval, int line); + void draw_tilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int which); + void draw_tilemap_line(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int which, int line); + void draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void draw_sprites_line(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int line); void decode_inline_header(int &flipx, int &flipy, int &test, int& pal, int debug_packets); bitmap_ind16 m_zbuffer; @@ -752,17 +752,18 @@ protected: class xavix_cart_state : public xavix_state { public: - xavix_cart_state(const machine_config &mconfig, device_type type, const char *tag) - : xavix_state(mconfig, type, tag), + xavix_cart_state(const machine_config &mconfig, device_type type, const char *tag) : + xavix_state(mconfig, type, tag), m_cartslot(*this, "cartslot") - { } + { + m_cartlimit = 0x400000; + } void xavix_cart(machine_config &config); void xavix_cart_ekara(machine_config &config); void xavix_cart_popira(machine_config &config); void xavix_cart_ddrfammt(machine_config &config); void xavix_cart_evio(machine_config &config); - void xavix_cart_gcslottv(machine_config &config); protected: @@ -772,7 +773,7 @@ protected: { if (offset & 0x8000) { - if (offset & 0x400000) + if ((offset & 0x7fffff) >= m_cartlimit) { return m_rgn[(offset) & (m_rgnlen - 1)]; } @@ -796,7 +797,7 @@ protected: virtual uint8_t opcodes_800000_r(offs_t offset) override { - if (offset & 0x400000) + if ((offset & 0x7fffff) >= m_cartlimit) { return m_rgn[(offset) & (m_rgnlen - 1)]; } @@ -839,7 +840,7 @@ protected: } else { - if (offset & 0x400000) + if ((offset & 0x7fffff) >= m_cartlimit) { return m_rgn[(offset) & (m_rgnlen - 1)]; } @@ -882,7 +883,7 @@ protected: if (databank >= 0x80) { - if (offset & 0x400000) + if ((offset & 0x7fffff) >= m_cartlimit) { return m_rgn[(offset) & (m_rgnlen - 1)]; } @@ -902,7 +903,7 @@ protected: { if ((offset & 0xffff) >= 0x8000) { - if (offset & 0x400000) + if ((offset & 0x7fffff) >= m_cartlimit) { return m_rgn[(offset) & (m_rgnlen - 1)]; } @@ -925,9 +926,25 @@ protected: } } + int m_cartlimit; required_device<ekara_cart_slot_device> m_cartslot; }; + +class xavix_cart_gcslottv_state : public xavix_cart_state +{ +public: + xavix_cart_gcslottv_state(const machine_config &mconfig, device_type type, const char *tag) : + xavix_cart_state(mconfig, type, tag) + { + m_cartlimit = 0x800000; + } + + void xavix_cart_gcslottv(machine_config &config); + +protected: +}; + class xavix_i2c_cart_state : public xavix_cart_state { public: diff --git a/src/mame/includes/z80ne.h b/src/mame/includes/z80ne.h index 2a640832a3d..addb7e0a690 100644 --- a/src/mame/includes/z80ne.h +++ b/src/mame/includes/z80ne.h @@ -67,11 +67,8 @@ class z80ne_state : public driver_device public: z80ne_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_vdg(*this, "mc6847"), - m_videoram(*this, "videoram"), m_uart(*this, "uart"), m_uart_clock(*this, "uart_clock"), - m_lx387_kr2376(*this, "lx387_kr2376"), m_maincpu(*this, "z80ne"), m_cassette1(*this, "cassette"), m_cassette2(*this, "cassette2"), @@ -86,34 +83,25 @@ public: m_io_ctrl(*this, "CTRL"), m_io_rst(*this, "RST"), m_io_lx_385(*this, "LX.385"), - m_io_lx387_brk(*this, "LX387_BRK"), - m_io_modifiers(*this, "MODIFIERS"), m_lx383_digits(*this, "digit%u", 0U) { } - void lx387(machine_config &config); - void z80net(machine_config &config); void z80ne(machine_config &config); - void z80netb(machine_config &config); - - void init_z80net(); - void init_z80netb(); - void init_z80ne(); DECLARE_INPUT_CHANGED_MEMBER(z80ne_reset); - DECLARE_INPUT_CHANGED_MEMBER(z80ne_nmi); - - DECLARE_READ8_MEMBER(lx388_mc6847_videoram_r); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void driver_init() override; + + void base_reset(); + DECLARE_FLOPPY_FORMATS(floppy_formats); - optional_device<mc6847_base_device> m_vdg; - optional_shared_ptr<uint8_t> m_videoram; required_device<ay31015_device> m_uart; required_device<clock_device> m_uart_clock; - optional_device<kr2376_device> m_lx387_kr2376; uint8_t m_lx383_scan_counter; uint8_t m_lx383_key[LX383_KEYS]; int m_lx383_downsampler; @@ -121,32 +109,16 @@ protected: emu_timer *m_cassette_timer; emu_timer *m_kbd_timer; z80ne_cass_data_t m_cass_data; + DECLARE_READ8_MEMBER(lx383_r); DECLARE_WRITE8_MEMBER(lx383_w); DECLARE_READ8_MEMBER(lx385_ctrl_r); DECLARE_WRITE8_MEMBER(lx385_ctrl_w); DECLARE_WRITE_LINE_MEMBER(lx385_uart_tx_clock_w); - DECLARE_READ_LINE_MEMBER(lx387_shift_r); - DECLARE_READ_LINE_MEMBER(lx387_control_r); - DECLARE_READ8_MEMBER(lx387_data_r); - DECLARE_READ8_MEMBER(lx388_read_field_sync); - DECLARE_MACHINE_START(z80ne); - DECLARE_MACHINE_RESET(z80ne); - DECLARE_MACHINE_START(z80netb); - DECLARE_MACHINE_RESET(z80netb); - DECLARE_MACHINE_START(z80net); - DECLARE_MACHINE_RESET(z80net); - DECLARE_MACHINE_RESET(z80ne_base); TIMER_CALLBACK_MEMBER(z80ne_cassette_tc); TIMER_CALLBACK_MEMBER(z80ne_kbd_scan); - void z80ne_io(address_map &map); - void z80ne_mem(address_map &map); - void z80net_io(address_map &map); - void z80net_mem(address_map &map); - void z80netb_mem(address_map &map); - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device<cpu_device> m_maincpu; @@ -163,23 +135,84 @@ protected: required_ioport m_io_ctrl; required_ioport m_io_rst; required_ioport m_io_lx_385; - optional_ioport m_io_lx387_brk; - optional_ioport m_io_modifiers; output_finder<8> m_lx383_digits; emu_timer *m_timer_nmi; emu_timer *m_timer_reset; cassette_image_device *cassette_device_image(); - void reset_lx387(); void reset_lx382_banking(); + +private: + void main_mem(address_map &map); + void main_io(address_map &map); }; -class z80netf_state : public z80ne_state +class z80net_state : public z80ne_state { public: - z80netf_state(const machine_config &mconfig, device_type type, const char *tag) + z80net_state(const machine_config &mconfig, device_type type, const char *tag) : z80ne_state(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_vdg(*this, "mc6847"), + m_lx387_kr2376(*this, "lx387_kr2376"), + m_io_lx387_brk(*this, "LX387_BRK"), + m_io_modifiers(*this, "MODIFIERS") + { + } + + void lx387(machine_config &config); + void z80net(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(z80net_nmi); + +protected: + virtual void machine_reset() override; + virtual void driver_init() override; + + DECLARE_READ_LINE_MEMBER(lx387_shift_r); + DECLARE_READ_LINE_MEMBER(lx387_control_r); + DECLARE_READ8_MEMBER(lx387_data_r); + DECLARE_READ8_MEMBER(lx388_mc6847_videoram_r); + DECLARE_READ8_MEMBER(lx388_read_field_sync); + + required_shared_ptr<uint8_t> m_videoram; + required_device<mc6847_base_device> m_vdg; + required_device<kr2376_device> m_lx387_kr2376; + required_ioport m_io_lx387_brk; + required_ioport m_io_modifiers; + + void reset_lx387(); + + void main_io(address_map &map); + +private: + void main_mem(address_map &map); +}; + +class z80netb_state : public z80net_state +{ +public: + z80netb_state(const machine_config &mconfig, device_type type, const char *tag) + : z80net_state(mconfig, type, tag) + { + } + + void z80netb(machine_config &config); + +protected: + virtual void machine_reset() override; + virtual void driver_init() override { } + +private: + void main_mem(address_map &map); +}; + +class z80netf_state : public z80netb_state +{ +public: + z80netf_state(const machine_config &mconfig, device_type type, const char *tag) + : z80netb_state(mconfig, type, tag), m_io_config(*this, "CONFIG"), m_floppy(*this, "wd1771:%u", 0U), m_wd1771(*this, "wd1771"), @@ -189,9 +222,11 @@ public: void z80netf(machine_config &config); - void init_z80netf(); - private: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void driver_init() override; + struct wd17xx_state_t { int drq; @@ -200,11 +235,8 @@ private: uint8_t head; /* current head */ }; - void z80netf_io(address_map &map); - void z80netf_mem(address_map &map); - - DECLARE_MACHINE_START(z80netf); - DECLARE_MACHINE_RESET(z80netf); + void main_mem(address_map &map); + void main_io(address_map &map); DECLARE_WRITE8_MEMBER(lx390_motor_w); DECLARE_READ8_MEMBER(lx390_reset_bank); diff --git a/src/mame/includes/zn.h b/src/mame/includes/zn.h new file mode 100644 index 00000000000..d312b108b33 --- /dev/null +++ b/src/mame/includes/zn.h @@ -0,0 +1,582 @@ +// license:BSD-3-Clause +// copyright-holders:smf, R. Belmont + +#ifndef MAME_INCLUDES_ZN_H +#define MAME_INCLUDES_ZN_H + +#pragma once + +#include "audio/rax.h" +#include "audio/taito_zm.h" +#include "audio/taitosnd.h" + +#include "bus/ata/atadev.h" +#include "bus/ata/ataintf.h" +#include "cpu/m68000/m68000.h" +#include "cpu/mcs51/mcs51.h" +#include "cpu/psx/psx.h" +#include "cpu/z80/z80.h" +#include "machine/7200fifo.h" +#include "machine/at28c16.h" +#include "machine/bankdev.h" +#include "machine/cat702.h" +#include "machine/gen_latch.h" +#include "machine/mb3773.h" +#include "machine/nvram.h" +#include "machine/ram.h" +#include "machine/vt83c461.h" +#include "machine/watchdog.h" +#include "machine/znmcu.h" +#include "sound/2610intf.h" +#include "sound/okim6295.h" +#include "sound/qsound.h" +#include "sound/spu.h" +#include "sound/ymf271.h" +#include "sound/ymz280b.h" +#include "video/psx.h" + +#include "screen.h" +#include "speaker.h" + +#include <algorithm> + +class zn_state : public driver_device +{ +public: + zn_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_gpu(*this, "gpu"), + m_gpu_screen(*this, "screen"), + m_sio0(*this, "maincpu:sio0"), + m_cat702(*this, "cat702_%u", 1), + m_znmcu(*this, "znmcu"), + m_maincpu(*this, "maincpu"), + m_ram(*this, "maincpu:ram"), + m_znmcu_dataout(1) + { + std::fill(std::begin(m_cat702_dataout), std::end(m_cat702_dataout), 1); + } + + void zn_1mb_vram(machine_config &config); + void zn_2mb_vram(machine_config &config); + void zn2(machine_config &config); + void gameboard_cat702(machine_config &config); + +protected: + template<int Chip> DECLARE_WRITE_LINE_MEMBER(cat702_dataout) { m_cat702_dataout[Chip] = state; update_sio0_rxd(); } + DECLARE_WRITE_LINE_MEMBER(znmcu_dataout) { m_znmcu_dataout = state; update_sio0_rxd(); } + void update_sio0_rxd() { m_sio0->write_rxd(m_cat702_dataout[0] && m_cat702_dataout[1] && m_znmcu_dataout); } + DECLARE_READ8_MEMBER(znsecsel_r); + DECLARE_WRITE8_MEMBER(znsecsel_w); + DECLARE_READ8_MEMBER(boardconfig_r); + DECLARE_READ16_MEMBER(unknown_r); + DECLARE_WRITE8_MEMBER(coin_w); + + void zn_base_map(address_map &map); + void zn_rom_base_map(address_map &map); + + virtual void machine_start() override; + + inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); + inline void psxwriteword( uint32_t *p_n_psxram, uint32_t n_address, uint16_t n_data ); + + uint8_t m_n_znsecsel; + + required_device<psxgpu_device> m_gpu; + required_device<screen_device> m_gpu_screen; + required_device<psxsio0_device> m_sio0; + required_device_array<cat702_device, 2> m_cat702; + required_device<znmcu_device> m_znmcu; + required_device<cpu_device> m_maincpu; + required_device<ram_device> m_ram; + + int m_cat702_dataout[2]; + int m_znmcu_dataout; +}; + +// +// Capcom ZN1/2 hardware +// + +class capcom_zn_state : public zn_state +{ +public: + capcom_zn_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank"), + m_audiocpu(*this, "audiocpu"), + m_soundlatch(*this, "soundlatch"), + m_soundbank(*this, "soundbank") + { + } + + void zn_base(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; + required_device<cpu_device> m_audiocpu; + required_device<generic_latch_8_device> m_soundlatch; + required_memory_bank m_soundbank; + +private: + void main_map(address_map &map); + void qsound_map(address_map &map); + void qsound_portmap(address_map &map); + + DECLARE_READ16_MEMBER(kickharness_r); + DECLARE_WRITE8_MEMBER(bank_w); + DECLARE_WRITE8_MEMBER(qsound_bankswitch_w); + INTERRUPT_GEN_MEMBER(qsound_interrupt); +}; + +class zn1_state : public capcom_zn_state +{ +public: + zn1_state(const machine_config &mconfig, device_type type, const char *tag) : + capcom_zn_state(mconfig, type, tag) + { + } + + void coh1000c(machine_config &config); + void coh1002c(machine_config &config); +}; + +class glpracr_state : public zn1_state +{ +public: + glpracr_state(const machine_config &mconfig, device_type type, const char *tag) : + zn1_state(mconfig, type, tag) + { + } + +private: + virtual void machine_reset() override; +}; + +class zn2_state : public capcom_zn_state +{ +public: + zn2_state(const machine_config &mconfig, device_type type, const char *tag) : + capcom_zn_state(mconfig, type, tag) + { + } + + void coh3002c(machine_config &config); +}; + +// +// Acclaim ZN-derived hardware +// + +class acclaim_zn_state : public zn_state +{ +public: + acclaim_zn_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag) + { + } + + void coh1000a(machine_config &config); + +protected: + void coh1000a_map(address_map &map); + +private: + DECLARE_WRITE16_MEMBER(acpsx_00_w); + DECLARE_WRITE16_MEMBER(acpsx_10_w); +}; + +class nbajamex_state : public acclaim_zn_state +{ +public: + nbajamex_state(const machine_config &mconfig, device_type type, const char *tag) : + acclaim_zn_state(mconfig, type, tag), + m_rax(*this, "rax"), + m_bankmap(*this, "nbajamex_bankmap"), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank%u", 1) + { + } + + void nbajamex(machine_config &config); + +private: + virtual void driver_init() override; + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_WRITE16_MEMBER(bank_w); + DECLARE_WRITE16_MEMBER(sound_80_w); + DECLARE_WRITE8_MEMBER(backup_w); + DECLARE_READ16_MEMBER(sound_08_r); + DECLARE_READ16_MEMBER(sound_80_r); + + void main_map(address_map &map); + void bank_map(address_map &map); + + std::unique_ptr<uint8_t[]> m_sram; + uint32_t m_curr_rombank[2]; + + required_device<acclaim_rax_device> m_rax; + required_device<address_map_bank_device> m_bankmap; + required_memory_region m_bankedroms; + required_memory_bank_array<2> m_rombank; +}; + +class jdredd_state : public acclaim_zn_state +{ +public: + jdredd_state(const machine_config &mconfig, device_type type, const char *tag) : + acclaim_zn_state(mconfig, type, tag), + m_gun_x(*this, "GUN%uX", 1U), + m_gun_y(*this, "GUN%uY", 1U) + { + } + + void jdredd(machine_config &config); + + DECLARE_READ_LINE_MEMBER(gun_mux_r); + +private: + virtual void machine_start() override; + + void main_map(address_map &map); + + DECLARE_WRITE_LINE_MEMBER(vblank); + + required_ioport_array<2> m_gun_x; + required_ioport_array<2> m_gun_y; + bool m_gun_mux; +}; + +// +// Atlus ZN-derived hardware +// + +class atlus_zn_state : public zn_state +{ +public: + atlus_zn_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank"), + m_audiocpu(*this, "audiocpu"), + m_soundlatch16(*this, "soundlatch16") + { + } + + void coh1001l(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_WRITE8_MEMBER(bank_w); + DECLARE_WRITE16_MEMBER(sound_unk_w); + + void main_map(address_map &map); + void sound_map(address_map &map); + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; + required_device<cpu_device> m_audiocpu; + required_device<generic_latch_16_device> m_soundlatch16; +}; + +// +// Video System Co. ZN-derived hardware +// + +class visco_zn_state : public zn_state +{ +public: + visco_zn_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank") + { + } + + void coh1002v(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_WRITE8_MEMBER(bank_w); + + void main_map(address_map &map); + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; +}; + +// +// Eighting / Raizing ZN-derived hardware +// + +class raizing_zn_state : public zn_state +{ +public: + raizing_zn_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank"), + m_audiocpu(*this, "audiocpu"), + m_soundlatch(*this, "soundlatch") + { + } + + void coh1002e(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void main_map(address_map &map); + void psarc_sound_map(address_map &map); + + DECLARE_WRITE8_MEMBER(bank_w); + DECLARE_WRITE8_MEMBER(sound_irq_w); + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; + required_device<cpu_device> m_audiocpu; + required_device<generic_latch_8_device> m_soundlatch; +}; + +class beastrzrb_state : public raizing_zn_state +{ +public: + beastrzrb_state(const machine_config &mconfig, device_type type, const char *tag) : + raizing_zn_state(mconfig, type, tag), + m_okibank(*this, "okibank") + { + } + + void beastrzrb(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + void sound_map(address_map &map); + void oki_map(address_map &map); + + required_memory_bank m_okibank; +}; + +class bam2_state : public zn_state +{ +public: + bam2_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank") + { + } + + void bam2(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + void main_map(address_map &map); + + uint16_t m_mcu_command; + + DECLARE_WRITE16_MEMBER(mcu_w); + DECLARE_READ16_MEMBER(mcu_r); + DECLARE_READ16_MEMBER(unk_r); + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; +}; + +// +// Taito FX1a/FX1b +// + +class taito_fx_state : public zn_state +{ +public: + taito_fx_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank"), + m_mb3773(*this, "mb3773") + { + } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_WRITE8_MEMBER(bank_w); + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; + required_device<mb3773_device> m_mb3773; +}; + +class taito_fx1a_state : public taito_fx_state +{ +public: + taito_fx1a_state(const machine_config &mconfig, device_type type, const char *tag) : + taito_fx_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu"), + m_soundbank(*this, "soundbank") + { + } + + void coh1000ta(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + void main_map(address_map &map); + void sound_map(address_map &map); + + DECLARE_WRITE8_MEMBER(sound_bankswitch_w); + + required_device<cpu_device> m_audiocpu; + required_memory_bank m_soundbank; +}; + +class taito_fx1b_state : public taito_fx_state +{ +public: + taito_fx1b_state(const machine_config &mconfig, device_type type, const char *tag) : + taito_fx_state(mconfig, type, tag), + m_zoom(*this, "taito_zoom"), + m_fm1208s(*this, "fm1208s") + { + } + + void base_config(machine_config &config); + void coh1000tb(machine_config &config); + +private: + virtual void machine_start() override; + + void main_map(address_map &map); + + DECLARE_WRITE8_MEMBER(fram_w); + DECLARE_READ8_MEMBER(fram_r); + + required_device<taito_zoom_device> m_zoom; + required_device<nvram_device> m_fm1208s; + + std::unique_ptr<uint8_t[]> m_fram; +}; + +class gdarius_state : public taito_fx1b_state +{ +public: + gdarius_state(const machine_config &mconfig, device_type type, const char *tag) : + taito_fx1b_state(mconfig, type, tag) + { + } + + void coh1002tb(machine_config &config); +}; + +// +// Atari ZN-derived hardware (Primal Rage 2) +// + +class primrag2_state : public zn_state +{ +public: + primrag2_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_vt83c461(*this, "ide") + { + } + + void coh1000w(machine_config &config); + +private: + virtual void machine_start() override; + + void main_map(address_map &map); + + void dma_read(uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size); + void dma_write(uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size); + + DECLARE_READ16_MEMBER(vt83c461_16_r); + DECLARE_WRITE16_MEMBER(vt83c461_16_w); + DECLARE_READ16_MEMBER(vt83c461_32_r); + DECLARE_WRITE16_MEMBER(vt83c461_32_w); + + required_device<vt83c461_device> m_vt83c461; + + uint16_t m_vt83c461_latch; +}; + +// +// Tecmo ZN-derived hardware +// + +class tecmo_zn_state : public zn_state +{ +public: + tecmo_zn_state(const machine_config &mconfig, device_type type, const char *tag) : + zn_state(mconfig, type, tag), + m_bankedroms(*this, "bankedroms"), + m_rombank(*this, "rombank") + { + } + + void coh1002m(machine_config &config); + void coh1002ml(machine_config &config); + +protected: + void base_map(address_map &map); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + void link_map(address_map &map); + void link_port_map(address_map &map); + + DECLARE_WRITE8_MEMBER(bank_w); + + required_memory_region m_bankedroms; + required_memory_bank m_rombank; +}; + +class cbaj_state : public tecmo_zn_state +{ +public: + cbaj_state(const machine_config &mconfig, device_type type, const char *tag) : + tecmo_zn_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu"), + m_fifo(*this, "cbaj_fifo%u", 1) + { + } + + void cbaj(machine_config &config); + +private: + void main_map(address_map &map); + + void z80_map(address_map &map); + void z80_port_map(address_map &map); + + DECLARE_READ8_MEMBER(sound_main_status_r); + DECLARE_READ8_MEMBER(sound_z80_status_r); + + required_device<cpu_device> m_audiocpu; + required_device_array<fifo7200_device, 2> m_fifo; +}; + +#endif // MAME_INCLUDES_ZN_H diff --git a/src/mame/layout/30test.lay b/src/mame/layout/30test.lay index 2e629cf8bd2..958f7806462 100644 --- a/src/mame/layout/30test.lay +++ b/src/mame/layout/30test.lay @@ -28,6 +28,11 @@ <color red="0.8" green="0.1" blue="0.0" /> </disk> </element> + <element name="disk_yellow"> + <disk> + <color red="0.95" green="0.8" blue="0.1" /> + </disk> + </element> <element name="static_black"> <rect> @@ -175,39 +180,43 @@ <!-- info box --> <bezel element="static_red"> - <bounds x="18" y="5" width="210" height="69" /> + <bounds x="22" y="5" width="202" height="69" /> </bezel> - - <bezel element="static_blue"> - <bounds x="18" y="5" width="4" height="4" /> + <bezel element="static_red"> + <bounds x="18" y="9" width="210" height="61" /> </bezel> + <bezel element="disk_red"> <bounds x="18" y="5" width="8" height="8" /> </bezel> - - <bezel element="static_blue"> - <bounds x="18" y="70" width="4" height="4" /> - </bezel> <bezel element="disk_red"> <bounds x="18" y="66" width="8" height="8" /> </bezel> - - <bezel element="static_blue"> - <bounds x="224" y="5" width="4" height="4" /> - </bezel> <bezel element="disk_red"> <bounds x="220" y="5" width="8" height="8" /> </bezel> - - <bezel element="static_blue"> - <bounds x="224" y="70" width="4" height="4" /> - </bezel> <bezel element="disk_red"> <bounds x="220" y="66" width="8" height="8" /> </bezel> <bezel element="static_yellow"> - <bounds x="20" y="7" width="206" height="65" /> + <bounds x="22" y="7" width="202" height="65" /> + </bezel> + <bezel element="static_yellow"> + <bounds x="20" y="9" width="206" height="61" /> + </bezel> + + <bezel element="disk_yellow"> + <bounds x="20" y="7" width="4" height="4" /> + </bezel> + <bezel element="disk_yellow"> + <bounds x="222" y="7" width="4" height="4" /> + </bezel> + <bezel element="disk_yellow"> + <bounds x="20" y="68" width="4" height="4" /> + </bezel> + <bezel element="disk_yellow"> + <bounds x="222" y="68" width="4" height="4" /> </bezel> diff --git a/src/mame/layout/breakout.lay b/src/mame/layout/breakout.lay index 1d656beb018..891854ce5b3 100644 --- a/src/mame/layout/breakout.lay +++ b/src/mame/layout/breakout.lay @@ -2,35 +2,35 @@ <mamelayout version="2"> <element name="overlay"> <rect> - <bounds left="0" top="0" right="192" bottom="47" /> + <bounds left="0" top="0" right="192" bottom="44" /> <color red="1" green="1" blue="1" /> </rect> <rect> - <bounds left="0" top="47" right="192" bottom="57" /> + <bounds left="0" top="44" right="192" bottom="54" /> <color red="1" green="0.125" blue="0.125" /> </rect> <rect> - <bounds left="0" top="57" right="192" bottom="67" /> + <bounds left="0" top="54" right="192" bottom="64" /> <color red="1" green="0.5" blue="0.0625" /> </rect> <rect> - <bounds left="0" top="67" right="192" bottom="77" /> + <bounds left="0" top="64" right="192" bottom="74" /> <color red="0.25" green="1" blue="0.25" /> </rect> <rect> - <bounds left="0" top="77" right="192" bottom="88" /> + <bounds left="0" top="74" right="192" bottom="84" /> <color red="1" green="1" blue="0.25" /> </rect> <rect> - <bounds left="0" top="88" right="192" bottom="231" /> + <bounds left="0" top="84" right="192" bottom="231" /> <color red="1" green="1" blue="1" /> </rect> <rect> - <bounds left="0" top="231" right="192" bottom="238" /> + <bounds left="0" top="221" right="192" bottom="228" /> <color red="0.125" green="0.125" blue="1" /> </rect> <rect> - <bounds left="0" top="238" right="192" bottom="244" /> + <bounds left="0" top="228" right="192" bottom="244" /> <color red="1" green="1" blue="1" /> </rect> </element> diff --git a/src/mame/layout/cgang.lay b/src/mame/layout/cgang.lay index cd13a2ea9d4..8ac1daba607 100644 --- a/src/mame/layout/cgang.lay +++ b/src/mame/layout/cgang.lay @@ -136,11 +136,11 @@ </element> <element name="spotr" defstate="0"> - <rect state="0"><color red="0.2" green="0.0" blue="0.0" /></rect> - <rect state="1"><color red="0.3" green="0.0" blue="0.0" /></rect> - <rect state="2"><color red="0.4" green="0.0" blue="0.0" /></rect> - <rect state="3"><color red="0.5" green="0.0" blue="0.0" /></rect> - <rect state="4"><color red="0.6" green="0.0" blue="0.0" /></rect> + <rect state="0"><color red="0.22" green="0.0" blue="0.0" /></rect> + <rect state="1"><color red="0.29" green="0.0" blue="0.0" /></rect> + <rect state="2"><color red="0.36" green="0.0" blue="0.0" /></rect> + <rect state="3"><color red="0.43" green="0.0" blue="0.0" /></rect> + <rect state="4"><color red="0.5" green="0.0" blue="0.0" /></rect> </element> <element name="leda" defstate="0"> @@ -485,6 +485,14 @@ <element name="spot_lamp0" ref="spotr"><bounds x="31.0" y="82.5" width="8.5" height="3" /></element> <element name="spot_lamp1" ref="spotr"><bounds x="28.166" y="82.5" width="5.666" height="3" /></element> + <element name="spot_lamp2" ref="spotr"><bounds x="25.9" y="82.5" width="3.4" height="3" /></element> + <element name="spot_lamp1" ref="spotr" blend="add"><bounds x="25.9" y="82.5" width="3.4" height="3" /></element> + <element ref="black"><bounds x="25.9" y="82.5" width="3.4" height="3" /><color alpha="0.5" /></element> + + <element name="spot_lamp1" ref="spotr"><bounds x="32.7" y="82.5" width="3.4" height="3" /></element> + <element name="spot_lamp0" ref="spotr" blend="add"><bounds x="32.7" y="82.5" width="3.4" height="3" /></element> + <element ref="black"><bounds x="32.7" y="82.5" width="3.4" height="3" /><color alpha="0.5" /></element> + <repeat count="8"> <param name="x" start="23.5" increment="2" /> <param name="i" start="0" increment="1" /> diff --git a/src/mame/layout/jazz.lay b/src/mame/layout/jazz.lay new file mode 100644 index 00000000000..7e6aaf4988e --- /dev/null +++ b/src/mame/layout/jazz.lay @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<!-- +license:CC0 +copyright-holders:Patrick Mackinlay +Jazz graphics display with 7-segment diagnostic LED. + +TODO + - network/disk/floppy activity? + - keyboard indicators? +--> +<mamelayout version="2"> + <element name="led" defstate="0"> + <led7seg> + <color red="0.0" green="1.0" blue="0.0" /> + </led7seg> + </element> + <view name="Graphics"> + <screen index="0"> + <bounds x="0" y="0" width="1280" height="1024" /> + </screen> + <bezel name="led0" element="led"> + <bounds x="1240" y="1024" width="40" height="50" /> + </bezel> + </view> +</mamelayout> diff --git a/src/mame/layout/kungfur.lay b/src/mame/layout/kungfur.lay index a0d6a220645..dbe99e87734 100644 --- a/src/mame/layout/kungfur.lay +++ b/src/mame/layout/kungfur.lay @@ -19,7 +19,7 @@ <element name="digit" defstate="0"> <led7seg> - <color red="1.0" green="0.1" blue="0.1" /> + <color red="1.0" green="0.1" blue="0.15" /> </led7seg> </element> @@ -27,11 +27,17 @@ <!-- define level lamps --> <element name="level1" defstate="0"> + <disk> + <color red="0" green="0" blue="0" /> + <bounds x="-0.075" y="-0.075" width="1.15" height="1.15" /> + </disk> <disk state="1"> - <color red="1.0" green="0.3" blue="0.3" /> + <color red="1.0" green="0.1" blue="0.15" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <disk state="0"> - <color red="0.2" green="0.0" blue="0.0" /> + <color red="0.2" green="0.02" blue="0.03" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <text string="1"> <color red="0.0" green="0.0" blue="0.0" /> @@ -39,11 +45,17 @@ </text> </element> <element name="level2" defstate="0"> + <disk> + <color red="0" green="0" blue="0" /> + <bounds x="-0.075" y="-0.075" width="1.15" height="1.15" /> + </disk> <disk state="1"> - <color red="1.0" green="0.3" blue="0.3" /> + <color red="1.0" green="0.1" blue="0.15" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <disk state="0"> - <color red="0.2" green="0.0" blue="0.0" /> + <color red="0.2" green="0.02" blue="0.03" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <text string="2"> <color red="0.0" green="0.0" blue="0.0" /> @@ -51,11 +63,17 @@ </text> </element> <element name="level3" defstate="0"> + <disk> + <color red="0" green="0" blue="0" /> + <bounds x="-0.075" y="-0.075" width="1.15" height="1.15" /> + </disk> <disk state="1"> - <color red="1.0" green="0.3" blue="0.3" /> + <color red="1.0" green="0.1" blue="0.15" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <disk state="0"> - <color red="0.2" green="0.0" blue="0.0" /> + <color red="0.2" green="0.02" blue="0.03" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <text string="3"> <color red="0.0" green="0.0" blue="0.0" /> @@ -63,11 +81,17 @@ </text> </element> <element name="level4" defstate="0"> + <disk> + <color red="0" green="0" blue="0" /> + <bounds x="-0.075" y="-0.075" width="1.15" height="1.15" /> + </disk> <disk state="1"> - <color red="1.0" green="0.3" blue="0.3" /> + <color red="1.0" green="0.1" blue="0.15" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <disk state="0"> - <color red="0.2" green="0.0" blue="0.0" /> + <color red="0.2" green="0.02" blue="0.03" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <text string="4"> <color red="0.0" green="0.0" blue="0.0" /> @@ -75,11 +99,17 @@ </text> </element> <element name="level5" defstate="0"> + <disk> + <color red="0" green="0" blue="0" /> + <bounds x="-0.075" y="-0.075" width="1.15" height="1.15" /> + </disk> <disk state="1"> - <color red="1.0" green="0.3" blue="0.3" /> + <color red="1.0" green="0.1" blue="0.15" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <disk state="0"> - <color red="0.2" green="0.0" blue="0.0" /> + <color red="0.2" green="0.02" blue="0.03" /> + <bounds x="0" y="0" width="1" height="1" /> </disk> <text string="5"> <color red="0.0" green="0.0" blue="0.0" /> @@ -95,7 +125,7 @@ <color red="0.0" green="0.22" blue="0.22" /> </rect> <text string="SCORE"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> <bounds x="0.03" y="0" width="0.94" height="1" /> </text> </element> @@ -105,7 +135,7 @@ <color red="0.0" green="0.22" blue="0.22" /> </rect> <text string="LEVEL"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> <bounds x="0.03" y="0" width="0.94" height="1" /> </text> </element> @@ -115,7 +145,7 @@ <color red="0.0" green="0.22" blue="0.22" /> </rect> <text string="REACTION TIME"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> <bounds x="0.02" y="0" width="0.96" height="1" /> </text> </element> @@ -125,7 +155,7 @@ <color red="0.0" green="0.22" blue="0.22" /> </rect> <text string="AVERAGE"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> <bounds x="0.03" y="0" width="0.94" height="1" /> </text> </element> @@ -136,32 +166,35 @@ </rect> <text string="TODAY'S BEST"> <bounds x="0.025" y="0" width="0.95" height="1" /> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> </text> </element> <element name="text_1"> <text string="1ST" align="2"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> </text> </element> <element name="text_2"> <text string="2ND" align="2"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> </text> </element> <element name="text_3"> <text string="3RD" align="2"> - <color red="1.0" green="1.0" blue="1.0" /> + <color red="0.85" green="0.85" blue="0.85" /> </text> </element> <element name="text_gameover" defstate="0"> + <rect> + <color red="0.0" green="0.22" blue="0.22" /> + </rect> <text string="GAME OVER" state="1"> - <color red="1.0" green="0.3" blue="0.3" /> + <color red="1.0" green="0.1" blue="0.15" /> </text> <text string="GAME OVER" state="0"> - <color red="0.2" green="0.0" blue="0.0" /> + <color red="0.2" green="0.02" blue="0.03" /> </text> </element> @@ -342,7 +375,7 @@ </bezel> <bezel name="lamp5" element="text_gameover"> - <bounds x="97" y="86" width="45" height="5" /> + <bounds x="99" y="86" width="41" height="5" /> </bezel> diff --git a/src/mame/layout/mephisto_alm16.lay b/src/mame/layout/mephisto_alm16.lay index 71c9627fc29..dc335c3aa8f 100644 --- a/src/mame/layout/mephisto_alm16.lay +++ b/src/mame/layout/mephisto_alm16.lay @@ -1,6 +1,8 @@ <?xml version="1.0"?> <mamelayout version="2"> + <!-- define elements --> + <element name="led" defstate="0"> <disk state="0"> <color red="0.20" green="0.0" blue="0.0" /> @@ -10,25 +12,26 @@ </disk> </element> - <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - + <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> <element name="piece" defstate="0"> + <text string=" "><bounds x="0" y="0" width="1" height="1" /></text> + <image file="chess/wp.png" state="1"/> <image file="chess/wn.png" state="2"/> <image file="chess/wb.png" state="3"/> @@ -43,20 +46,44 @@ <image file="chess/bq.png" state="11"/> <image file="chess/bk.png" state="12"/> + <image file="chess/wp.png" state="13"/> + <text string="J" state="13"> + <color red="0" green="0" blue="0" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + + <image file="chess/bp.png" state="14"/> + <text string="J" state="14"> + <color red="1" green="1" blue="1" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + <!-- selected pieces --> - <image file="chess/wp.png" state="13"><color alpha="0.5" /></image> - <image file="chess/wn.png" state="14"><color alpha="0.5" /></image> - <image file="chess/wb.png" state="15"><color alpha="0.5" /></image> - <image file="chess/wr.png" state="16"><color alpha="0.5" /></image> - <image file="chess/wq.png" state="17"><color alpha="0.5" /></image> - <image file="chess/wk.png" state="18"><color alpha="0.5" /></image> - - <image file="chess/bp.png" state="19"><color alpha="0.5" /></image> - <image file="chess/bn.png" state="20"><color alpha="0.5" /></image> - <image file="chess/bb.png" state="21"><color alpha="0.5" /></image> - <image file="chess/br.png" state="22"><color alpha="0.5" /></image> - <image file="chess/bq.png" state="23"><color alpha="0.5" /></image> - <image file="chess/bk.png" state="24"><color alpha="0.5" /></image> + <image file="chess/wp.png" state="15"><color alpha="0.5" /></image> + <image file="chess/wn.png" state="16"><color alpha="0.5" /></image> + <image file="chess/wb.png" state="17"><color alpha="0.5" /></image> + <image file="chess/wr.png" state="18"><color alpha="0.5" /></image> + <image file="chess/wq.png" state="19"><color alpha="0.5" /></image> + <image file="chess/wk.png" state="20"><color alpha="0.5" /></image> + + <image file="chess/bp.png" state="21"><color alpha="0.5" /></image> + <image file="chess/bn.png" state="22"><color alpha="0.5" /></image> + <image file="chess/bb.png" state="23"><color alpha="0.5" /></image> + <image file="chess/br.png" state="24"><color alpha="0.5" /></image> + <image file="chess/bq.png" state="25"><color alpha="0.5" /></image> + <image file="chess/bk.png" state="26"><color alpha="0.5" /></image> + + <image file="chess/wp.png" state="27"><color alpha="0.5" /></image> + <text string="J" state="27"> + <color red="0.3" green="0.3" blue="0.2" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + + <image file="chess/bp.png" state="28"><color alpha="0.5" /></image> + <text string="J" state="28"> + <color red="0.7" green="0.7" blue="0.6" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> </element> @@ -199,11 +226,21 @@ <!-- sb ui --> + <element name="wmask1" defstate="1"> + <rect state="0"><color red="0.84" green="0.75" blue="0.50" /></rect> + </element> + <element name="wmask2"> + <rect><color red="1" green="1" blue="1" /></rect> + </element> + <element name="hlub" defstate="0"> <rect state="1"><color red="0" green="0" blue="0" /></rect> </element> - <element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uit1" defstate="0"> + <text string="SB.MAGNETS" state="0"><color red="0.81" green="0.8" blue="0.79" /></text> + <text string="SB.BAVARIA" state="1"><color red="0.81" green="0.8" blue="0.79" /></text> + </element> <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib2"> @@ -250,11 +287,15 @@ </element> <group name="sb_ui"> - <bounds x="0" y="0" width="10" height="80" /> + <bounds x="0" y="0" width="10" height="81" /> + + <!-- can click here to change board type --> + <bezel element="hlub" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="1.5" width="10" height="5" /></bezel> + <bezel element="cblack"><bounds x="0" y="0" width="10" height="1" /></bezel> <bezel element="cblack"><bounds x="0" y="7" width="10" height="1" /></bezel> - <bezel element="cblack"><bounds x="0" y="79" width="10" height="1" /></bezel> - <bezel element="text_uit1"><bounds x="0" y="2" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="0" y="80" width="10" height="1" /></bezel> + <bezel element="text_uit1" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="2" width="10" height="2" /></bezel> <bezel element="text_uit2"><bounds x="0" y="4" width="10" height="2" /></bezel> <!-- board --> @@ -269,64 +310,73 @@ <bezel element="hlub" inputtag="board:board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></bezel> <!-- spawn --> - <bezel element="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></bezel> - <bezel element="cwhite"><bounds x="1" y="23" width="8" height="12" /></bezel> - <bezel element="cwhite"><bounds x="1" y="36" width="8" height="12" /></bezel> - - <bezel name="piece_ui1" element="piece"><bounds x="1" y="23" width="4" height="4" /></bezel> - <bezel name="piece_ui2" element="piece"><bounds x="1" y="27" width="4" height="4" /></bezel> - <bezel name="piece_ui3" element="piece"><bounds x="1" y="31" width="4" height="4" /></bezel> - <bezel name="piece_ui4" element="piece"><bounds x="5" y="23" width="4" height="4" /></bezel> - <bezel name="piece_ui5" element="piece"><bounds x="5" y="27" width="4" height="4" /></bezel> - <bezel name="piece_ui6" element="piece"><bounds x="5" y="31" width="4" height="4" /></bezel> - <bezel name="piece_ui7" element="piece"><bounds x="1" y="36" width="4" height="4" /></bezel> - <bezel name="piece_ui8" element="piece"><bounds x="1" y="40" width="4" height="4" /></bezel> - <bezel name="piece_ui9" element="piece"><bounds x="1" y="44" width="4" height="4" /></bezel> - <bezel name="piece_ui10" element="piece"><bounds x="5" y="36" width="4" height="4" /></bezel> - <bezel name="piece_ui11" element="piece"><bounds x="5" y="40" width="4" height="4" /></bezel> - <bezel name="piece_ui12" element="piece"><bounds x="5" y="44" width="4" height="4" /></bezel> - - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="text_uis1"><bounds x="0" y="19.5" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="22" width="8" height="12" /></bezel> + <bezel element="cwhite"><bounds x="1" y="35" width="8" height="12" /></bezel> + + <bezel name="piece_ui1" element="piece"><bounds x="1" y="22" width="4" height="4" /></bezel> + <bezel name="piece_ui2" element="piece"><bounds x="1" y="26" width="4" height="4" /></bezel> + <bezel name="piece_ui3" element="piece"><bounds x="1" y="30" width="4" height="4" /></bezel> + <bezel name="piece_ui4" element="piece"><bounds x="5" y="22" width="4" height="4" /></bezel> + <bezel name="piece_ui5" element="piece"><bounds x="5" y="26" width="4" height="4" /></bezel> + <bezel name="piece_ui6" element="piece"><bounds x="5" y="30" width="4" height="4" /></bezel> + <bezel name="piece_ui7" element="piece"><bounds x="1" y="35" width="4" height="4" /></bezel> + <bezel name="piece_ui8" element="piece"><bounds x="1" y="39" width="4" height="4" /></bezel> + <bezel name="piece_ui9" element="piece"><bounds x="1" y="43" width="4" height="4" /></bezel> + <bezel name="piece_ui10" element="piece"><bounds x="5" y="35" width="4" height="4" /></bezel> + <bezel name="piece_ui11" element="piece"><bounds x="5" y="39" width="4" height="4" /></bezel> + <bezel name="piece_ui12" element="piece"><bounds x="5" y="43" width="4" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="22" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="26" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="30" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="22" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="26" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="30" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="35" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="39" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="43" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="35" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="39" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="43" width="4" height="4" /><color alpha="0.25" /></bezel> + + <element ref="cwhite"><bounds x="1" y="48" width="8" height="4" /></element> + <element name="piece_ui13" ref="piece"><bounds x="1" y="48" width="4" height="4" /></element> + <element name="piece_ui14" ref="piece"><bounds x="5" y="48" width="4" height="4" /></element> + <element ref="hlub" inputtag="board:board:SPAWN" inputmask="0x1000"><bounds x="1" y="48" width="4" height="4" /><color alpha="0.25" /></element> + <element ref="hlub" inputtag="board:board:SPAWN" inputmask="0x2000"><bounds x="5" y="48" width="4" height="4" /><color alpha="0.25" /></element> + <element ref="wmask1" inputtag="FAKE" inputmask="1" inputraw="1"><bounds x="1" y="48" width="4" height="4" /></element> + <element ref="wmask1" inputtag="FAKE" inputmask="1" inputraw="1"><bounds x="5" y="48" width="4" height="4" /></element> + <element ref="wmask2" blend="multiply"><bounds x="1" y="48" width="8" height="4" /></element> <!-- hand --> - <bezel element="text_uih1"><bounds x="0" y="51" width="10" height="2" /></bezel> - <bezel element="cblack"><bounds x="1" y="53.5" width="8" height="6" /></bezel> - <bezel name="piece_ui0" element="piece"><bounds x="2" y="53.5" width="6" height="6" /></bezel> + <bezel element="text_uih1"><bounds x="0" y="54" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="1" y="56.5" width="8" height="6" /></bezel> + <bezel name="piece_ui0" element="piece"><bounds x="2" y="56.5" width="6" height="6" /></bezel> - <bezel element="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></bezel> - <bezel element="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> + <bezel element="cwhite"><bounds x="1" y="63.5" width="8" height="2.5" /></bezel> + <bezel element="text_uih2"><bounds x="1.5" y="63.75" width="7" height="2" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="63.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> <!-- undo --> - <bezel element="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></bezel> - <bezel element="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></bezel> - - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - - <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></bezel> - <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></bezel> - <bezel element="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></bezel> + <bezel element="text_uiu1"><bounds x="0" y="68" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="3.1" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="5.2" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="7.3" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="text_uiu2a"><bounds x="1" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2b"><bounds x="3.1" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2c"><bounds x="5.2" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2d"><bounds x="7.3" y="71.5" width="1.7" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + + <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="77" width="4" height="2" /></bezel> + <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="77" width="4" height="2" /></bezel> + <bezel element="text_uiu3b"><bounds x="4" y="77" width="2" height="2" /></bezel> </group> @@ -399,8 +449,8 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="103" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="103" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <bezel element="text_lcd"><bounds x="47.5" y="89" width="24.5" height="2" /></bezel> @@ -408,18 +458,18 @@ <group ref="buttons"><bounds x="77.5" y="88.5" width="13" height="13" /></group> <group ref="sb_board"><bounds x="17.5" y="2.5" width="80" height="80" /></group> - <group ref="sb_ui"><bounds x="1.5" y="3" width="10" height="80" /></group> + <group ref="sb_ui"><bounds x="1.5" y="2" width="10" height="81" /></group> <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_alm32.lay b/src/mame/layout/mephisto_alm32.lay index 4db337f2038..01c2b467290 100644 --- a/src/mame/layout/mephisto_alm32.lay +++ b/src/mame/layout/mephisto_alm32.lay @@ -1,6 +1,8 @@ <?xml version="1.0"?> <mamelayout version="2"> + <!-- define elements --> + <element name="led" defstate="0"> <disk state="0"> <color red="0.20" green="0.0" blue="0.0" /> @@ -10,25 +12,26 @@ </disk> </element> - <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - + <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> <element name="piece" defstate="0"> + <text string=" "><bounds x="0" y="0" width="1" height="1" /></text> + <image file="chess/wp.png" state="1"/> <image file="chess/wn.png" state="2"/> <image file="chess/wb.png" state="3"/> @@ -43,20 +46,44 @@ <image file="chess/bq.png" state="11"/> <image file="chess/bk.png" state="12"/> + <image file="chess/wp.png" state="13"/> + <text string="J" state="13"> + <color red="0" green="0" blue="0" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + + <image file="chess/bp.png" state="14"/> + <text string="J" state="14"> + <color red="1" green="1" blue="1" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + <!-- selected pieces --> - <image file="chess/wp.png" state="13"><color alpha="0.5" /></image> - <image file="chess/wn.png" state="14"><color alpha="0.5" /></image> - <image file="chess/wb.png" state="15"><color alpha="0.5" /></image> - <image file="chess/wr.png" state="16"><color alpha="0.5" /></image> - <image file="chess/wq.png" state="17"><color alpha="0.5" /></image> - <image file="chess/wk.png" state="18"><color alpha="0.5" /></image> - - <image file="chess/bp.png" state="19"><color alpha="0.5" /></image> - <image file="chess/bn.png" state="20"><color alpha="0.5" /></image> - <image file="chess/bb.png" state="21"><color alpha="0.5" /></image> - <image file="chess/br.png" state="22"><color alpha="0.5" /></image> - <image file="chess/bq.png" state="23"><color alpha="0.5" /></image> - <image file="chess/bk.png" state="24"><color alpha="0.5" /></image> + <image file="chess/wp.png" state="15"><color alpha="0.5" /></image> + <image file="chess/wn.png" state="16"><color alpha="0.5" /></image> + <image file="chess/wb.png" state="17"><color alpha="0.5" /></image> + <image file="chess/wr.png" state="18"><color alpha="0.5" /></image> + <image file="chess/wq.png" state="19"><color alpha="0.5" /></image> + <image file="chess/wk.png" state="20"><color alpha="0.5" /></image> + + <image file="chess/bp.png" state="21"><color alpha="0.5" /></image> + <image file="chess/bn.png" state="22"><color alpha="0.5" /></image> + <image file="chess/bb.png" state="23"><color alpha="0.5" /></image> + <image file="chess/br.png" state="24"><color alpha="0.5" /></image> + <image file="chess/bq.png" state="25"><color alpha="0.5" /></image> + <image file="chess/bk.png" state="26"><color alpha="0.5" /></image> + + <image file="chess/wp.png" state="27"><color alpha="0.5" /></image> + <text string="J" state="27"> + <color red="0.3" green="0.3" blue="0.2" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + + <image file="chess/bp.png" state="28"><color alpha="0.5" /></image> + <text string="J" state="28"> + <color red="0.7" green="0.7" blue="0.6" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> </element> @@ -199,11 +226,21 @@ <!-- sb ui --> + <element name="wmask1" defstate="1"> + <rect state="0"><color red="0.84" green="0.75" blue="0.50" /></rect> + </element> + <element name="wmask2"> + <rect><color red="1" green="1" blue="1" /></rect> + </element> + <element name="hlub" defstate="0"> <rect state="1"><color red="0" green="0" blue="0" /></rect> </element> - <element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uit1" defstate="0"> + <text string="SB.MAGNETS" state="0"><color red="0.81" green="0.8" blue="0.79" /></text> + <text string="SB.BAVARIA" state="1"><color red="0.81" green="0.8" blue="0.79" /></text> + </element> <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib2"> @@ -250,11 +287,15 @@ </element> <group name="sb_ui"> - <bounds x="0" y="0" width="10" height="80" /> + <bounds x="0" y="0" width="10" height="81" /> + + <!-- can click here to change board type --> + <bezel element="hlub" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="1.5" width="10" height="5" /></bezel> + <bezel element="cblack"><bounds x="0" y="0" width="10" height="1" /></bezel> <bezel element="cblack"><bounds x="0" y="7" width="10" height="1" /></bezel> - <bezel element="cblack"><bounds x="0" y="79" width="10" height="1" /></bezel> - <bezel element="text_uit1"><bounds x="0" y="2" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="0" y="80" width="10" height="1" /></bezel> + <bezel element="text_uit1" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="2" width="10" height="2" /></bezel> <bezel element="text_uit2"><bounds x="0" y="4" width="10" height="2" /></bezel> <!-- board --> @@ -269,64 +310,73 @@ <bezel element="hlub" inputtag="board:board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></bezel> <!-- spawn --> - <bezel element="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></bezel> - <bezel element="cwhite"><bounds x="1" y="23" width="8" height="12" /></bezel> - <bezel element="cwhite"><bounds x="1" y="36" width="8" height="12" /></bezel> - - <bezel name="piece_ui1" element="piece"><bounds x="1" y="23" width="4" height="4" /></bezel> - <bezel name="piece_ui2" element="piece"><bounds x="1" y="27" width="4" height="4" /></bezel> - <bezel name="piece_ui3" element="piece"><bounds x="1" y="31" width="4" height="4" /></bezel> - <bezel name="piece_ui4" element="piece"><bounds x="5" y="23" width="4" height="4" /></bezel> - <bezel name="piece_ui5" element="piece"><bounds x="5" y="27" width="4" height="4" /></bezel> - <bezel name="piece_ui6" element="piece"><bounds x="5" y="31" width="4" height="4" /></bezel> - <bezel name="piece_ui7" element="piece"><bounds x="1" y="36" width="4" height="4" /></bezel> - <bezel name="piece_ui8" element="piece"><bounds x="1" y="40" width="4" height="4" /></bezel> - <bezel name="piece_ui9" element="piece"><bounds x="1" y="44" width="4" height="4" /></bezel> - <bezel name="piece_ui10" element="piece"><bounds x="5" y="36" width="4" height="4" /></bezel> - <bezel name="piece_ui11" element="piece"><bounds x="5" y="40" width="4" height="4" /></bezel> - <bezel name="piece_ui12" element="piece"><bounds x="5" y="44" width="4" height="4" /></bezel> - - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="text_uis1"><bounds x="0" y="19.5" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="22" width="8" height="12" /></bezel> + <bezel element="cwhite"><bounds x="1" y="35" width="8" height="12" /></bezel> + + <bezel name="piece_ui1" element="piece"><bounds x="1" y="22" width="4" height="4" /></bezel> + <bezel name="piece_ui2" element="piece"><bounds x="1" y="26" width="4" height="4" /></bezel> + <bezel name="piece_ui3" element="piece"><bounds x="1" y="30" width="4" height="4" /></bezel> + <bezel name="piece_ui4" element="piece"><bounds x="5" y="22" width="4" height="4" /></bezel> + <bezel name="piece_ui5" element="piece"><bounds x="5" y="26" width="4" height="4" /></bezel> + <bezel name="piece_ui6" element="piece"><bounds x="5" y="30" width="4" height="4" /></bezel> + <bezel name="piece_ui7" element="piece"><bounds x="1" y="35" width="4" height="4" /></bezel> + <bezel name="piece_ui8" element="piece"><bounds x="1" y="39" width="4" height="4" /></bezel> + <bezel name="piece_ui9" element="piece"><bounds x="1" y="43" width="4" height="4" /></bezel> + <bezel name="piece_ui10" element="piece"><bounds x="5" y="35" width="4" height="4" /></bezel> + <bezel name="piece_ui11" element="piece"><bounds x="5" y="39" width="4" height="4" /></bezel> + <bezel name="piece_ui12" element="piece"><bounds x="5" y="43" width="4" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="22" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="26" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="30" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="22" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="26" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="30" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="35" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="39" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="43" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="35" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="39" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="43" width="4" height="4" /><color alpha="0.25" /></bezel> + + <element ref="cwhite"><bounds x="1" y="48" width="8" height="4" /></element> + <element name="piece_ui13" ref="piece"><bounds x="1" y="48" width="4" height="4" /></element> + <element name="piece_ui14" ref="piece"><bounds x="5" y="48" width="4" height="4" /></element> + <element ref="hlub" inputtag="board:board:SPAWN" inputmask="0x1000"><bounds x="1" y="48" width="4" height="4" /><color alpha="0.25" /></element> + <element ref="hlub" inputtag="board:board:SPAWN" inputmask="0x2000"><bounds x="5" y="48" width="4" height="4" /><color alpha="0.25" /></element> + <element ref="wmask1" inputtag="FAKE" inputmask="1" inputraw="1"><bounds x="1" y="48" width="4" height="4" /></element> + <element ref="wmask1" inputtag="FAKE" inputmask="1" inputraw="1"><bounds x="5" y="48" width="4" height="4" /></element> + <element ref="wmask2" blend="multiply"><bounds x="1" y="48" width="8" height="4" /></element> <!-- hand --> - <bezel element="text_uih1"><bounds x="0" y="51" width="10" height="2" /></bezel> - <bezel element="cblack"><bounds x="1" y="53.5" width="8" height="6" /></bezel> - <bezel name="piece_ui0" element="piece"><bounds x="2" y="53.5" width="6" height="6" /></bezel> + <bezel element="text_uih1"><bounds x="0" y="54" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="1" y="56.5" width="8" height="6" /></bezel> + <bezel name="piece_ui0" element="piece"><bounds x="2" y="56.5" width="6" height="6" /></bezel> - <bezel element="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></bezel> - <bezel element="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> + <bezel element="cwhite"><bounds x="1" y="63.5" width="8" height="2.5" /></bezel> + <bezel element="text_uih2"><bounds x="1.5" y="63.75" width="7" height="2" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="63.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> <!-- undo --> - <bezel element="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></bezel> - <bezel element="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></bezel> - - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - - <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></bezel> - <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></bezel> - <bezel element="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></bezel> + <bezel element="text_uiu1"><bounds x="0" y="68" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="3.1" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="5.2" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="7.3" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="text_uiu2a"><bounds x="1" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2b"><bounds x="3.1" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2c"><bounds x="5.2" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2d"><bounds x="7.3" y="71.5" width="1.7" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + + <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="77" width="4" height="2" /></bezel> + <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="77" width="4" height="2" /></bezel> + <bezel element="text_uiu3b"><bounds x="4" y="77" width="2" height="2" /></bezel> </group> @@ -399,8 +449,8 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="103" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="103" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <bezel element="text_lcd"><bounds x="47.5" y="89" width="24.5" height="2" /></bezel> @@ -408,18 +458,18 @@ <group ref="buttons"><bounds x="77.5" y="88.5" width="13" height="13" /></group> <group ref="sb_board"><bounds x="17.5" y="2.5" width="80" height="80" /></group> - <group ref="sb_ui"><bounds x="1.5" y="3" width="10" height="80" /></group> + <group ref="sb_ui"><bounds x="1.5" y="2" width="10" height="81" /></group> <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_amsterdam.lay b/src/mame/layout/mephisto_amsterdam.lay index 49bd610dbda..dbd440e6d38 100644 --- a/src/mame/layout/mephisto_amsterdam.lay +++ b/src/mame/layout/mephisto_amsterdam.lay @@ -524,8 +524,8 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="104" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="104" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <group ref="panel"><bounds x="37.5" y="91" width="20" height="8" /></group> @@ -537,14 +537,14 @@ <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_bup.lay b/src/mame/layout/mephisto_bup.lay index 2f96565a566..690303db9b5 100644 --- a/src/mame/layout/mephisto_bup.lay +++ b/src/mame/layout/mephisto_bup.lay @@ -538,8 +538,8 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="106.5" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="106.5" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <group ref="panel1"><bounds x="37.5" y="91" width="20" height="8" /></group> @@ -551,14 +551,14 @@ <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_gen32.lay b/src/mame/layout/mephisto_gen32.lay index c547c3e293d..5690e4b4f65 100644 --- a/src/mame/layout/mephisto_gen32.lay +++ b/src/mame/layout/mephisto_gen32.lay @@ -1,6 +1,8 @@ <?xml version="1.0"?> <mamelayout version="2"> + <!-- define elements --> + <element name="led" defstate="0"> <disk state="0"> <color red="0.20" green="0.0" blue="0.0" /> @@ -10,25 +12,26 @@ </disk> </element> - <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> - + <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> <element name="piece" defstate="0"> + <text string=" "><bounds x="0" y="0" width="1" height="1" /></text> + <image file="chess/wp.png" state="1"/> <image file="chess/wn.png" state="2"/> <image file="chess/wb.png" state="3"/> @@ -43,20 +46,44 @@ <image file="chess/bq.png" state="11"/> <image file="chess/bk.png" state="12"/> + <image file="chess/wp.png" state="13"/> + <text string="J" state="13"> + <color red="0" green="0" blue="0" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + + <image file="chess/bp.png" state="14"/> + <text string="J" state="14"> + <color red="1" green="1" blue="1" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + <!-- selected pieces --> - <image file="chess/wp.png" state="13"><color alpha="0.5" /></image> - <image file="chess/wn.png" state="14"><color alpha="0.5" /></image> - <image file="chess/wb.png" state="15"><color alpha="0.5" /></image> - <image file="chess/wr.png" state="16"><color alpha="0.5" /></image> - <image file="chess/wq.png" state="17"><color alpha="0.5" /></image> - <image file="chess/wk.png" state="18"><color alpha="0.5" /></image> - - <image file="chess/bp.png" state="19"><color alpha="0.5" /></image> - <image file="chess/bn.png" state="20"><color alpha="0.5" /></image> - <image file="chess/bb.png" state="21"><color alpha="0.5" /></image> - <image file="chess/br.png" state="22"><color alpha="0.5" /></image> - <image file="chess/bq.png" state="23"><color alpha="0.5" /></image> - <image file="chess/bk.png" state="24"><color alpha="0.5" /></image> + <image file="chess/wp.png" state="15"><color alpha="0.5" /></image> + <image file="chess/wn.png" state="16"><color alpha="0.5" /></image> + <image file="chess/wb.png" state="17"><color alpha="0.5" /></image> + <image file="chess/wr.png" state="18"><color alpha="0.5" /></image> + <image file="chess/wq.png" state="19"><color alpha="0.5" /></image> + <image file="chess/wk.png" state="20"><color alpha="0.5" /></image> + + <image file="chess/bp.png" state="21"><color alpha="0.5" /></image> + <image file="chess/bn.png" state="22"><color alpha="0.5" /></image> + <image file="chess/bb.png" state="23"><color alpha="0.5" /></image> + <image file="chess/br.png" state="24"><color alpha="0.5" /></image> + <image file="chess/bq.png" state="25"><color alpha="0.5" /></image> + <image file="chess/bk.png" state="26"><color alpha="0.5" /></image> + + <image file="chess/wp.png" state="27"><color alpha="0.5" /></image> + <text string="J" state="27"> + <color red="0.3" green="0.3" blue="0.2" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> + + <image file="chess/bp.png" state="28"><color alpha="0.5" /></image> + <text string="J" state="28"> + <color red="0.7" green="0.7" blue="0.6" /> + <bounds x="0" y="0.55" width="1" height="0.3" /> + </text> </element> @@ -199,11 +226,21 @@ <!-- sb ui --> + <element name="wmask1" defstate="1"> + <rect state="0"><color red="0.84" green="0.75" blue="0.50" /></rect> + </element> + <element name="wmask2"> + <rect><color red="1" green="1" blue="1" /></rect> + </element> + <element name="hlub" defstate="0"> <rect state="1"><color red="0" green="0" blue="0" /></rect> </element> - <element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uit1" defstate="0"> + <text string="SB.MAGNETS" state="0"><color red="0.81" green="0.8" blue="0.79" /></text> + <text string="SB.BAVARIA" state="1"><color red="0.81" green="0.8" blue="0.79" /></text> + </element> <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib2"> @@ -250,11 +287,15 @@ </element> <group name="sb_ui"> - <bounds x="0" y="0" width="10" height="80" /> + <bounds x="0" y="0" width="10" height="81" /> + + <!-- can click here to change board type --> + <bezel element="hlub" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="1.5" width="10" height="5" /></bezel> + <bezel element="cblack"><bounds x="0" y="0" width="10" height="1" /></bezel> <bezel element="cblack"><bounds x="0" y="7" width="10" height="1" /></bezel> - <bezel element="cblack"><bounds x="0" y="79" width="10" height="1" /></bezel> - <bezel element="text_uit1"><bounds x="0" y="2" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="0" y="80" width="10" height="1" /></bezel> + <bezel element="text_uit1" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="2" width="10" height="2" /></bezel> <bezel element="text_uit2"><bounds x="0" y="4" width="10" height="2" /></bezel> <!-- board --> @@ -269,64 +310,73 @@ <bezel element="hlub" inputtag="board:board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></bezel> <!-- spawn --> - <bezel element="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></bezel> - <bezel element="cwhite"><bounds x="1" y="23" width="8" height="12" /></bezel> - <bezel element="cwhite"><bounds x="1" y="36" width="8" height="12" /></bezel> - - <bezel name="piece_ui1" element="piece"><bounds x="1" y="23" width="4" height="4" /></bezel> - <bezel name="piece_ui2" element="piece"><bounds x="1" y="27" width="4" height="4" /></bezel> - <bezel name="piece_ui3" element="piece"><bounds x="1" y="31" width="4" height="4" /></bezel> - <bezel name="piece_ui4" element="piece"><bounds x="5" y="23" width="4" height="4" /></bezel> - <bezel name="piece_ui5" element="piece"><bounds x="5" y="27" width="4" height="4" /></bezel> - <bezel name="piece_ui6" element="piece"><bounds x="5" y="31" width="4" height="4" /></bezel> - <bezel name="piece_ui7" element="piece"><bounds x="1" y="36" width="4" height="4" /></bezel> - <bezel name="piece_ui8" element="piece"><bounds x="1" y="40" width="4" height="4" /></bezel> - <bezel name="piece_ui9" element="piece"><bounds x="1" y="44" width="4" height="4" /></bezel> - <bezel name="piece_ui10" element="piece"><bounds x="5" y="36" width="4" height="4" /></bezel> - <bezel name="piece_ui11" element="piece"><bounds x="5" y="40" width="4" height="4" /></bezel> - <bezel name="piece_ui12" element="piece"><bounds x="5" y="44" width="4" height="4" /></bezel> - - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="text_uis1"><bounds x="0" y="19.5" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="22" width="8" height="12" /></bezel> + <bezel element="cwhite"><bounds x="1" y="35" width="8" height="12" /></bezel> + + <bezel name="piece_ui1" element="piece"><bounds x="1" y="22" width="4" height="4" /></bezel> + <bezel name="piece_ui2" element="piece"><bounds x="1" y="26" width="4" height="4" /></bezel> + <bezel name="piece_ui3" element="piece"><bounds x="1" y="30" width="4" height="4" /></bezel> + <bezel name="piece_ui4" element="piece"><bounds x="5" y="22" width="4" height="4" /></bezel> + <bezel name="piece_ui5" element="piece"><bounds x="5" y="26" width="4" height="4" /></bezel> + <bezel name="piece_ui6" element="piece"><bounds x="5" y="30" width="4" height="4" /></bezel> + <bezel name="piece_ui7" element="piece"><bounds x="1" y="35" width="4" height="4" /></bezel> + <bezel name="piece_ui8" element="piece"><bounds x="1" y="39" width="4" height="4" /></bezel> + <bezel name="piece_ui9" element="piece"><bounds x="1" y="43" width="4" height="4" /></bezel> + <bezel name="piece_ui10" element="piece"><bounds x="5" y="35" width="4" height="4" /></bezel> + <bezel name="piece_ui11" element="piece"><bounds x="5" y="39" width="4" height="4" /></bezel> + <bezel name="piece_ui12" element="piece"><bounds x="5" y="43" width="4" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="22" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="26" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="30" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="22" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="26" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="30" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="35" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="39" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="43" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="35" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="39" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="43" width="4" height="4" /><color alpha="0.25" /></bezel> + + <element ref="cwhite"><bounds x="1" y="48" width="8" height="4" /></element> + <element name="piece_ui13" ref="piece"><bounds x="1" y="48" width="4" height="4" /></element> + <element name="piece_ui14" ref="piece"><bounds x="5" y="48" width="4" height="4" /></element> + <element ref="hlub" inputtag="board:board:SPAWN" inputmask="0x1000"><bounds x="1" y="48" width="4" height="4" /><color alpha="0.25" /></element> + <element ref="hlub" inputtag="board:board:SPAWN" inputmask="0x2000"><bounds x="5" y="48" width="4" height="4" /><color alpha="0.25" /></element> + <element ref="wmask1" inputtag="FAKE" inputmask="1" inputraw="1"><bounds x="1" y="48" width="4" height="4" /></element> + <element ref="wmask1" inputtag="FAKE" inputmask="1" inputraw="1"><bounds x="5" y="48" width="4" height="4" /></element> + <element ref="wmask2" blend="multiply"><bounds x="1" y="48" width="8" height="4" /></element> <!-- hand --> - <bezel element="text_uih1"><bounds x="0" y="51" width="10" height="2" /></bezel> - <bezel element="cblack"><bounds x="1" y="53.5" width="8" height="6" /></bezel> - <bezel name="piece_ui0" element="piece"><bounds x="2" y="53.5" width="6" height="6" /></bezel> + <bezel element="text_uih1"><bounds x="0" y="54" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="1" y="56.5" width="8" height="6" /></bezel> + <bezel name="piece_ui0" element="piece"><bounds x="2" y="56.5" width="6" height="6" /></bezel> - <bezel element="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></bezel> - <bezel element="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> + <bezel element="cwhite"><bounds x="1" y="63.5" width="8" height="2.5" /></bezel> + <bezel element="text_uih2"><bounds x="1.5" y="63.75" width="7" height="2" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="63.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> <!-- undo --> - <bezel element="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></bezel> - <bezel element="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></bezel> - <bezel element="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></bezel> - <bezel element="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></bezel> - - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> - - <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></bezel> - <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></bezel> - <bezel element="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></bezel> + <bezel element="text_uiu1"><bounds x="0" y="68" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="3.1" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="5.2" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="7.3" y="70.5" width="1.7" height="6" /></bezel> + <bezel element="text_uiu2a"><bounds x="1" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2b"><bounds x="3.1" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2c"><bounds x="5.2" y="71.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2d"><bounds x="7.3" y="71.5" width="1.7" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="70.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + + <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="77" width="4" height="2" /></bezel> + <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="77" width="4" height="2" /></bezel> + <bezel element="text_uiu3b"><bounds x="4" y="77" width="2" height="2" /></bezel> </group> @@ -399,8 +449,8 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="103" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="103" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <bezel element="text_lcd"><bounds x="47.5" y="89" width="24.5" height="2" /></bezel> @@ -408,18 +458,18 @@ <group ref="buttons"><bounds x="77.5" y="88.5" width="13" height="13" /></group> <group ref="sb_board"><bounds x="17.5" y="2.5" width="80" height="80" /></group> - <group ref="sb_ui"><bounds x="1.5" y="3" width="10" height="80" /></group> + <group ref="sb_ui"><bounds x="1.5" y="2" width="10" height="81" /></group> <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_glasgow.lay b/src/mame/layout/mephisto_glasgow.lay index 0e389c5d42d..8843ff13f0b 100644 --- a/src/mame/layout/mephisto_glasgow.lay +++ b/src/mame/layout/mephisto_glasgow.lay @@ -522,20 +522,20 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="104" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="104" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_mirage.lay b/src/mame/layout/mephisto_mirage.lay index 6ac133edfcb..486ba804401 100644 --- a/src/mame/layout/mephisto_mirage.lay +++ b/src/mame/layout/mephisto_mirage.lay @@ -217,7 +217,10 @@ <rect state="1"><color red="0" green="0" blue="0" /></rect> </element> - <element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uit1" defstate="0"> + <text string="SB.MOBIL" state="0"><color red="0.81" green="0.8" blue="0.79" /></text> + <text string="SB.MODULAR" state="1"><color red="0.81" green="0.8" blue="0.79" /></text> + </element> <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib2"> @@ -265,10 +268,14 @@ <group name="sb_ui"> <bounds x="0" y="0" width="10" height="80" /> + + <!-- can click here to change board type --> + <bezel element="hlub" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="1.5" width="10" height="5" /></bezel> + <bezel element="cblack"><bounds x="0" y="0" width="10" height="1" /></bezel> <bezel element="cblack"><bounds x="0" y="7" width="10" height="1" /></bezel> <bezel element="cblack"><bounds x="0" y="79" width="10" height="1" /></bezel> - <bezel element="text_uit1"><bounds x="0" y="2" width="10" height="2" /></bezel> + <bezel element="text_uit1" inputtag="FAKE" inputmask="0x01" inputraw="1"><bounds x="0" y="2" width="10" height="2" /></bezel> <bezel element="text_uit2"><bounds x="0" y="4" width="10" height="2" /></bezel> <!-- board --> diff --git a/src/mame/layout/mephisto_mm1.lay b/src/mame/layout/mephisto_mm1.lay index 485c6fa077f..a0bac019e37 100644 --- a/src/mame/layout/mephisto_mm1.lay +++ b/src/mame/layout/mephisto_mm1.lay @@ -535,12 +535,12 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="-13" right="88" top="-1.5" bottom="104.5" /> + <bounds left="-14" right="88" top="-1.5" bottom="104.5" /> <bezel element="cblack"><bounds x="-1" y="-1.5" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="3" y="2.5" width="81" height="81" /></bezel> <group ref="sb_board"><bounds x="3.5" y="3" width="80" height="80" /></group> - <group ref="sb_ui"><bounds x="-12" y="3" width="10" height="80" /></group> + <group ref="sb_ui"><bounds x="-12.5" y="3" width="10" height="80" /></group> <bezel element="lcd_bg"><bounds x="23.5" y="92" width="20" height="8" /></bezel> <group ref="display"><bounds x="24" y="92.8" width="19" height="6.4" /></group> diff --git a/src/mame/layout/mephisto_mm2.lay b/src/mame/layout/mephisto_mm2.lay index 910f3de6a71..d874a8fb189 100644 --- a/src/mame/layout/mephisto_mm2.lay +++ b/src/mame/layout/mephisto_mm2.lay @@ -547,8 +547,8 @@ <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="106.5" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="106.5" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <group ref="panel1"><bounds x="37.5" y="91" width="20" height="8" /></group> @@ -560,14 +560,14 @@ <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/mephisto_modular_tm.lay b/src/mame/layout/mephisto_modular_tm.lay new file mode 100644 index 00000000000..fe0e54f2439 --- /dev/null +++ b/src/mame/layout/mephisto_modular_tm.lay @@ -0,0 +1,435 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + +<!-- define elements --> + + <element name="led" defstate="0"> + <disk state="0"> + <color red="0.20" green="0.0" blue="0.0" /> + </disk> + <disk state="1"> + <color red="0.95" green="0.0" blue="0.0" /> + </disk> + </element> + + <element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + <element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"><color red="0.87" green="0.87" blue="0.84" /></text> </element> + + <element name="piece" defstate="0"> + <image file="chess/wp.png" state="1"/> + <image file="chess/wn.png" state="2"/> + <image file="chess/wb.png" state="3"/> + <image file="chess/wr.png" state="4"/> + <image file="chess/wq.png" state="5"/> + <image file="chess/wk.png" state="6"/> + + <image file="chess/bp.png" state="7"/> + <image file="chess/bn.png" state="8"/> + <image file="chess/bb.png" state="9"/> + <image file="chess/br.png" state="10"/> + <image file="chess/bq.png" state="11"/> + <image file="chess/bk.png" state="12"/> + + <!-- selected pieces --> + <image file="chess/wp.png" state="13"><color alpha="0.5" /></image> + <image file="chess/wn.png" state="14"><color alpha="0.5" /></image> + <image file="chess/wb.png" state="15"><color alpha="0.5" /></image> + <image file="chess/wr.png" state="16"><color alpha="0.5" /></image> + <image file="chess/wq.png" state="17"><color alpha="0.5" /></image> + <image file="chess/wk.png" state="18"><color alpha="0.5" /></image> + + <image file="chess/bp.png" state="19"><color alpha="0.5" /></image> + <image file="chess/bn.png" state="20"><color alpha="0.5" /></image> + <image file="chess/bb.png" state="21"><color alpha="0.5" /></image> + <image file="chess/br.png" state="22"><color alpha="0.5" /></image> + <image file="chess/bq.png" state="23"><color alpha="0.5" /></image> + <image file="chess/bk.png" state="24"><color alpha="0.5" /></image> + </element> + + +<!-- sb board --> + + <element name="cblack"><rect><color red="0.56" green="0.33" blue="0.12" /></rect></element> + <element name="cwhite"><rect><color red="0.84" green="0.75" blue="0.50" /></rect></element> + + <element name="hlbb" defstate="0"> + <text string=" "><bounds x="0" y="0" width="1" height="1" /></text> + <disk state="1"> + <bounds x="0.12" y="0.12" width="0.76" height="0.76" /> + <color red="0" green="0" blue="0" /> + </disk> + </element> + + <group name="sb_board"> + <bounds x="0" y="0" width="80" height="80" /> + + <!-- squares (avoid seams) --> + <bezel element="cwhite"><bounds x="0" y="0" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="10" y="0" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="20" y="0" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="30" y="0" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="40" y="0" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="50" y="0" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="60" y="0" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="70" y="0" width="10" height="11" /></bezel> + + <bezel element="cblack"><bounds x="0" y="10" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="10" y="10" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="20" y="10" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="30" y="10" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="40" y="10" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="50" y="10" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="60" y="10" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="70" y="10" width="10" height="11" /></bezel> + + <bezel element="cwhite"><bounds x="0" y="20" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="10" y="20" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="20" y="20" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="30" y="20" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="40" y="20" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="50" y="20" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="60" y="20" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="70" y="20" width="10" height="11" /></bezel> + + <bezel element="cblack"><bounds x="0" y="30" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="10" y="30" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="20" y="30" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="30" y="30" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="40" y="30" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="50" y="30" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="60" y="30" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="70" y="30" width="10" height="11" /></bezel> + + <bezel element="cwhite"><bounds x="0" y="40" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="10" y="40" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="20" y="40" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="30" y="40" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="40" y="40" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="50" y="40" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="60" y="40" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="70" y="40" width="10" height="11" /></bezel> + + <bezel element="cblack"><bounds x="0" y="50" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="10" y="50" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="20" y="50" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="30" y="50" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="40" y="50" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="50" y="50" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="60" y="50" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="70" y="50" width="10" height="11" /></bezel> + + <bezel element="cwhite"><bounds x="0" y="60" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="10" y="60" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="20" y="60" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="30" y="60" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="40" y="60" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="50" y="60" width="11" height="11" /></bezel> + <bezel element="cwhite"><bounds x="60" y="60" width="11" height="11" /></bezel> + <bezel element="cblack"><bounds x="70" y="60" width="10" height="11" /></bezel> + + <bezel element="cblack"><bounds x="0" y="70" width="11" height="10" /></bezel> + <bezel element="cwhite"><bounds x="10" y="70" width="11" height="10" /></bezel> + <bezel element="cblack"><bounds x="20" y="70" width="11" height="10" /></bezel> + <bezel element="cwhite"><bounds x="30" y="70" width="11" height="10" /></bezel> + <bezel element="cblack"><bounds x="40" y="70" width="11" height="10" /></bezel> + <bezel element="cwhite"><bounds x="50" y="70" width="11" height="10" /></bezel> + <bezel element="cblack"><bounds x="60" y="70" width="11" height="10" /></bezel> + <bezel element="cwhite"><bounds x="70" y="70" width="10" height="10" /></bezel> + + <!-- chessboard leds --> + <repeat count="8"> + <param name="x" start="8.2" increment="10" /> + <param name="la" start="0" increment="1" /> + <param name="lb" start="8" increment="1" /> + <param name="lc" start="16" increment="1" /> + <param name="ld" start="24" increment="1" /> + <param name="le" start="32" increment="1" /> + <param name="lf" start="40" increment="1" /> + <param name="lg" start="48" increment="1" /> + <param name="lh" start="56" increment="1" /> + + <bezel name="led~la~" element="led"><bounds x="~x~" y="78.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~lb~" element="led"><bounds x="~x~" y="68.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~lc~" element="led"><bounds x="~x~" y="58.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~ld~" element="led"><bounds x="~x~" y="48.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~le~" element="led"><bounds x="~x~" y="38.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~lf~" element="led"><bounds x="~x~" y="28.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~lg~" element="led"><bounds x="~x~" y="18.3" width="1.5" height="1.5" /></bezel> + <bezel name="led~lh~" element="led"><bounds x="~x~" y="8.3" width="1.5" height="1.5" /></bezel> + </repeat> + + <!-- sensors, pieces --> + <repeat count="8"> + <param name="y" start="0" increment="10" /> + <param name="i" start="8" increment="-1" /> + + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x01"><bounds x="0" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x02"><bounds x="10" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x04"><bounds x="20" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x08"><bounds x="30" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x10"><bounds x="40" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x20"><bounds x="50" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x40"><bounds x="60" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + <bezel element="hlbb" inputtag="board:board:RANK.~i~" inputmask="0x80"><bounds x="70" y="~y~" width="10" height="10" /><color alpha="0.04" /></bezel> + + <bezel name="piece_a~i~" element="piece"><bounds x="0" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_b~i~" element="piece"><bounds x="10" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_c~i~" element="piece"><bounds x="20" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_d~i~" element="piece"><bounds x="30" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_e~i~" element="piece"><bounds x="40" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_f~i~" element="piece"><bounds x="50" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_g~i~" element="piece"><bounds x="60" y="~y~" width="10" height="10" /></bezel> + <bezel name="piece_h~i~" element="piece"><bounds x="70" y="~y~" width="10" height="10" /></bezel> + </repeat> + </group> + + +<!-- sb ui --> + + <element name="hlub" defstate="0"> + <rect state="1"><color red="0" green="0" blue="0" /></rect> + </element> + + <element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uib2"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string="RESET"><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uib3"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string="CLEAR"><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uis1"><text string="SPAWN:"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uih1"><text string="HAND:"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uih2"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string="REMOVE"><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uiu1"><text string="UNDO:"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uiu2a"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string=" <<"><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uiu2b"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string=" < "><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uiu2c"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string=" >"><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uiu2d"> + <rect><color red="0.84" green="0.75" blue="0.50" /></rect> + <text string=" >>"><color red="0.01" green="0.01" blue="0.01" /></text> + </element> + <element name="text_uiu3a" defstate="0"> + <simplecounter maxstate="999" digits="1" align="2"> + <color red="0.81" green="0.8" blue="0.79" /> + </simplecounter> + </element> + <element name="text_uiu3b"><text string="/"><color red="0.81" green="0.8" blue="0.79" /></text></element> + <element name="text_uiu3c" defstate="0"> + <simplecounter maxstate="999" digits="1" align="1"> + <color red="0.81" green="0.8" blue="0.79" /> + </simplecounter> + </element> + + <group name="sb_ui"> + <bounds x="0" y="0" width="10" height="80" /> + <bezel element="cblack"><bounds x="0" y="0" width="10" height="1" /></bezel> + <bezel element="cblack"><bounds x="0" y="7" width="10" height="1" /></bezel> + <bezel element="cblack"><bounds x="0" y="79" width="10" height="1" /></bezel> + <bezel element="text_uit1"><bounds x="0" y="2" width="10" height="2" /></bezel> + <bezel element="text_uit2"><bounds x="0" y="4" width="10" height="2" /></bezel> + + <!-- board --> + <bezel element="text_uib1"><bounds x="0" y="9" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="11.5" width="8" height="2.5" /></bezel> + <bezel element="cwhite"><bounds x="1" y="15" width="8" height="2.5" /></bezel> + + <bezel element="text_uib2"><bounds x="1.5" y="11.75" width="7" height="2" /></bezel> + <bezel element="text_uib3"><bounds x="1.5" y="15.25" width="7" height="2" /></bezel> + + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x200"><bounds x="1" y="11.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></bezel> + + <!-- spawn --> + <bezel element="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="23" width="8" height="12" /></bezel> + <bezel element="cwhite"><bounds x="1" y="36" width="8" height="12" /></bezel> + + <bezel name="piece_ui1" element="piece"><bounds x="1" y="23" width="4" height="4" /></bezel> + <bezel name="piece_ui2" element="piece"><bounds x="1" y="27" width="4" height="4" /></bezel> + <bezel name="piece_ui3" element="piece"><bounds x="1" y="31" width="4" height="4" /></bezel> + <bezel name="piece_ui4" element="piece"><bounds x="5" y="23" width="4" height="4" /></bezel> + <bezel name="piece_ui5" element="piece"><bounds x="5" y="27" width="4" height="4" /></bezel> + <bezel name="piece_ui6" element="piece"><bounds x="5" y="31" width="4" height="4" /></bezel> + <bezel name="piece_ui7" element="piece"><bounds x="1" y="36" width="4" height="4" /></bezel> + <bezel name="piece_ui8" element="piece"><bounds x="1" y="40" width="4" height="4" /></bezel> + <bezel name="piece_ui9" element="piece"><bounds x="1" y="44" width="4" height="4" /></bezel> + <bezel name="piece_ui10" element="piece"><bounds x="5" y="36" width="4" height="4" /></bezel> + <bezel name="piece_ui11" element="piece"><bounds x="5" y="40" width="4" height="4" /></bezel> + <bezel name="piece_ui12" element="piece"><bounds x="5" y="44" width="4" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></bezel> + + <!-- hand --> + <bezel element="text_uih1"><bounds x="0" y="51" width="10" height="2" /></bezel> + <bezel element="cblack"><bounds x="1" y="53.5" width="8" height="6" /></bezel> + <bezel name="piece_ui0" element="piece"><bounds x="2" y="53.5" width="6" height="6" /></bezel> + + <bezel element="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></bezel> + <bezel element="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></bezel> + + <!-- undo --> + <bezel element="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></bezel> + <bezel element="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></bezel> + <bezel element="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></bezel> + <bezel element="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></bezel> + <bezel element="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></bezel> + + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + <bezel element="hlub" inputtag="board:board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></bezel> + + <bezel name="count_ui0" element="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></bezel> + <bezel name="count_ui1" element="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></bezel> + <bezel element="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></bezel> + </group> + + +<!-- LCD panel --> + + <element name="text_lcd"><text string="GRAPHIC DISPLAY MODUL"><color red="0.64" green="0.59" blue="0.30" /></text></element> + <element name="static_lcd"><rect><color red="0.5412" green="0.57255" blue="0.5804" /></rect></element> + + <group name="panel"> + <element ref="static_lcd"><bounds x="0" y="0" width="24.5" height="6.5" /></element> + <screen index="0" blend="alpha"><bounds x="0.25" y="1" width="24" height="4.5" /></screen> + </group> + + +<!-- Buttons --> + + <element name="gray"> <rect><color red="0.25" green="0.25" blue="0.25" /></rect></element> + <element name="green"><rect><color red="0" green="0.5" blue="0.25" /></rect></element> + <element name="red"> <rect><color red="0.75" green="0.15" blue="0.15" /></rect></element> + + <element name="text_ent"><rect><color red="0" green="0.5" blue="0.25" /></rect> <text string="ENT"> <color red="1" green="1" blue="1" /></text> </element> + <element name="text_cl"> <rect><color red="0.75" green="0.15" blue="0.15" /></rect><text string="CL"> <color red="1" green="1" blue="1" /></text> </element> + <element name="text_left"> <rect><color red="0.25" green="0.25" blue="0.25" /></rect><text string="←"> <color red="1" green="1" blue="1" /></text> </element> + <element name="text_up"> <rect><color red="0.25" green="0.25" blue="0.25" /></rect><text string="↑"> <color red="1" green="1" blue="1" /></text> </element> + <element name="text_right"><rect><color red="0.25" green="0.25" blue="0.25" /></rect><text string="→"> <color red="1" green="1" blue="1" /></text> </element> + <element name="text_down"> <rect><color red="0.25" green="0.25" blue="0.25" /></rect><text string="↓"> <color red="1" green="1" blue="1" /></text> </element> + + <element name="keys" defstate="0"> + <rect state="1"><color red="0.0" green="0.0" blue="0.0" /></rect> + </element> + + <group name="buttons"> + <bounds x="76" y="89.5" width="17" height="17" /> + + <bezel element="green"><bounds x="76" y="89.5" width="5" height="5" /></bezel> + <bezel element="gray"> <bounds x="82" y="89.5" width="5" height="5" /></bezel> + <bezel element="red"> <bounds x="88" y="89.5" width="5" height="5" /></bezel> + <bezel element="gray"> <bounds x="76" y="95.5" width="5" height="5" /></bezel> + <bezel element="gray"> <bounds x="88" y="95.5" width="5" height="5" /></bezel> + <bezel element="gray"> <bounds x="82" y="101.5" width="5" height="5" /></bezel> + + <bezel element="text_ent"> <bounds x="76" y="90.7" width="5" height="2.6" /></bezel> + <bezel element="text_up"> <bounds x="82.5" y="90" width="4" height="4" /></bezel> + <bezel element="text_cl"> <bounds x="88" y="90.7" width="5" height="2.6" /></bezel> + <bezel element="text_left"> <bounds x="76.5" y="96" width="4" height="4" /></bezel> + <bezel element="text_right"><bounds x="88.5" y="96" width="4" height="4" /></bezel> + <bezel element="text_down"> <bounds x="82.5" y="102" width="4" height="4" /></bezel> + + <bezel element="keys" inputtag="KEY1" inputmask="0x02000000"> <!-- ENT --> + <bounds x="76" y="89.5" width="5" height="5" /><color alpha="0.25" /> + </bezel> + <bezel element="keys" inputtag="KEY2" inputmask="0x02000000"> <!-- Up --> + <bounds x="82" y="89.5" width="5" height="5" /><color alpha="0.25" /> + </bezel> + <bezel element="keys" inputtag="KEY3" inputmask="0x02000000"> <!-- CL --> + <bounds x="88" y="89.5" width="5" height="5" /><color alpha="0.25" /> + </bezel> + <bezel element="keys" inputtag="KEY1" inputmask="0x01000000"> <!-- Left --> + <bounds x="76" y="95.5" width="5" height="5" /><color alpha="0.25" /> + </bezel> + <bezel element="keys" inputtag="KEY2" inputmask="0x01000000"> <!-- Right --> + <bounds x="88" y="95.5" width="5" height="5" /><color alpha="0.25" /> + </bezel> + <bezel element="keys" inputtag="KEY3" inputmask="0x01000000"> <!-- Down --> + <bounds x="82" y="101.5" width="5" height="5" /><color alpha="0.25" /> + </bezel> + </group> + + +<!-- build screen --> + + <view name="Internal Layout"> + <bounds left="0" right="102" top="-2" bottom="103" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> + <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> + + <bezel element="text_lcd"><bounds x="47.5" y="89" width="24.5" height="2" /></bezel> + <group ref="panel"><bounds x="47.5" y="91.8" width="24.5" height="6.5" /></group> + <group ref="buttons"><bounds x="77.5" y="88.5" width="13" height="13" /></group> + + <group ref="sb_board"><bounds x="17.5" y="2.5" width="80" height="80" /></group> + <group ref="sb_ui"><bounds x="1.5" y="3" width="10" height="80" /></group> + + <!-- chessboard coords --> + + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> + + <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_c"><bounds x="41.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_d"><bounds x="51.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_e"><bounds x="61.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_f"><bounds x="71.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_g"><bounds x="81.5" y="84" width="2" height="2" /></bezel> + <bezel element="text_h"><bounds x="91.5" y="84" width="2" height="2" /></bezel> + </view> + +</mamelayout> diff --git a/src/mame/layout/mephisto_polgar.lay b/src/mame/layout/mephisto_polgar.lay index 6189c183f00..d13d93fd826 100644 --- a/src/mame/layout/mephisto_polgar.lay +++ b/src/mame/layout/mephisto_polgar.lay @@ -399,20 +399,20 @@ </group> <view name="Internal Layout"> - <bounds left="0" right="101" top="0" bottom="101.5" /> - <bezel element="cblack"><bounds x="14" y="0" width="87" height="87" /></bezel> + <bounds left="0" right="102" top="-2" bottom="101.5" /> + <bezel element="cblack"><bounds x="13" y="-2" width="89" height="89" /></bezel> <bezel element="cwhite"><bounds x="17" y="2" width="81" height="81" /></bezel> <!-- chessboard coords --> - <bezel element="text_8"><bounds x="14.7" y="6.5" width="2" height="2" /></bezel> - <bezel element="text_7"><bounds x="14.7" y="16.5" width="2" height="2" /></bezel> - <bezel element="text_6"><bounds x="14.7" y="26.5" width="2" height="2" /></bezel> - <bezel element="text_5"><bounds x="14.7" y="36.5" width="2" height="2" /></bezel> - <bezel element="text_4"><bounds x="14.7" y="46.5" width="2" height="2" /></bezel> - <bezel element="text_3"><bounds x="14.7" y="56.5" width="2" height="2" /></bezel> - <bezel element="text_2"><bounds x="14.7" y="66.5" width="2" height="2" /></bezel> - <bezel element="text_1"><bounds x="14.7" y="76.5" width="2" height="2" /></bezel> + <bezel element="text_8"><bounds x="14.2" y="6.5" width="2" height="2" /></bezel> + <bezel element="text_7"><bounds x="14.2" y="16.5" width="2" height="2" /></bezel> + <bezel element="text_6"><bounds x="14.2" y="26.5" width="2" height="2" /></bezel> + <bezel element="text_5"><bounds x="14.2" y="36.5" width="2" height="2" /></bezel> + <bezel element="text_4"><bounds x="14.2" y="46.5" width="2" height="2" /></bezel> + <bezel element="text_3"><bounds x="14.2" y="56.5" width="2" height="2" /></bezel> + <bezel element="text_2"><bounds x="14.2" y="66.5" width="2" height="2" /></bezel> + <bezel element="text_1"><bounds x="14.2" y="76.5" width="2" height="2" /></bezel> <bezel element="text_a"><bounds x="21.5" y="84" width="2" height="2" /></bezel> <bezel element="text_b"><bounds x="31.5" y="84" width="2" height="2" /></bezel> diff --git a/src/mame/layout/model1io2.lay b/src/mame/layout/model1io2.lay index 9d7e21d2877..107f0c86ebd 100644 --- a/src/mame/layout/model1io2.lay +++ b/src/mame/layout/model1io2.lay @@ -18,7 +18,7 @@ </element> <view name="Default"> - <!-- workaround for MAME selecting a 3-screen view by default --> + <!-- workaround for MAME selecting a 2-screen view by default --> <screen tag="ioboard:screen"><bounds left="0" top="0" right="1" bottom="1" /></screen> <screen tag="screen"> diff --git a/src/mame/layout/saitek_risc2500.lay b/src/mame/layout/saitek_risc2500.lay index 1a211c97698..4e2737c70dc 100644 --- a/src/mame/layout/saitek_risc2500.lay +++ b/src/mame/layout/saitek_risc2500.lay @@ -111,6 +111,8 @@ <element name="lcd_bg"><rect><color red="0.5412" green="0.57255" blue="0.5804" /></rect></element> <element name="background"><rect><color red="0.63" green="0.63" blue="0.63" /></rect></element> <element name="blackb"><rect><color red="0.1" green="0.1" blue="0.1" /></rect></element> + <element name="whitew"><rect><color red="1" green="1" blue="1" /></rect></element> + <element name="bmask"><rect><color red="0.17" green="0.15" blue="0.15" /></rect></element> <element name="piece" defstate="0"> <image file="chess/wp.png" state="1"/> @@ -146,7 +148,7 @@ <!-- sb board --> - <element name="cwhite"><rect><color red="1.00" green="1.00" blue="1.00" /></rect></element> + <element name="cwhite"><rect><color red="0.93" green="0.93" blue="0.93" /></rect></element> <element name="cblack"><rect><color red="0.40" green="0.40" blue="0.40" /></rect></element> <element name="hlbb" defstate="0"> @@ -269,34 +271,34 @@ <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uib2"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string="RESET"><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uib3"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string="CLEAR"><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uis1"><text string="SPAWN:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uih1"><text string="HAND:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uih2"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string="REMOVE"><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uiu1"><text string="UNDO:"><color red="0.81" green="0.8" blue="0.79" /></text></element> <element name="text_uiu2a"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string=" <<"><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uiu2b"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string=" < "><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uiu2c"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string=" >"><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uiu2d"> - <rect><color red="1.00" green="1.00" blue="1.00" /></rect> + <rect><color red="0.93" green="0.93" blue="0.93" /></rect> <text string=" >>"><color red="0.01" green="0.01" blue="0.01" /></text> </element> <element name="text_uiu3a" defstate="0"> @@ -396,7 +398,7 @@ <group name="lcd"> <bounds x="0" y="0" width="30" height="11.2" /> <element ref="lcd_bg"><bounds x="0" y="0" width="30.0" height="11.2" /></element> - <screen index="0" blend="alpha"><bounds x="0" y="0.3" width="30" height="3.5" /></screen> + <screen index="0" blend="alpha"><bounds x="0" y="0.35" width="30" height="3.6986" /></screen> <bezel name="sym12" element="sym_colon" ><bounds x="12.0" y="4.5" width="1.5" height="3" /></bezel> <bezel name="sym13" element="sym_colon" ><bounds x="24.2" y="4.5" width="1.5" height="3" /></bezel> @@ -426,11 +428,10 @@ </group> <!-- build screen --> - <view name="Internal Layout"> + <view name="Internal Layout (Full)"> <bounds x="0" y="0" width="167" height="90" /> <element ref="background"><bounds x="13" y="0" width="154" height="90" /></element> - <element ref="blackb"><bounds x="107.8" y="4.3" width="30.4" height="11.6" /></element> <bezel element="text_8" ><bounds x="18" y="6" width="2" height="2" /></bezel> <bezel element="text_7" ><bounds x="18" y="16" width="2" height="2" /></bezel> @@ -481,12 +482,15 @@ <bezel element="text_down" ><bounds x="145" y="51" width="7" height="3" /></bezel> <bezel element="text_enter" ><bounds x="154" y="52" width="7" height="2" /></bezel> - <bezel element="text_p1" ><bounds x="110.5" y="65.5" width="4" height="4" /><color alpha="0.85" /></bezel> - <bezel element="text_p2" ><bounds x="119.5" y="65.5" width="4" height="4" /><color alpha="0.85" /></bezel> - <bezel element="text_p3" ><bounds x="128.5" y="65.5" width="4" height="4" /><color alpha="0.85" /></bezel> - <bezel element="text_p4" ><bounds x="137.5" y="65.5" width="4" height="4" /><color alpha="0.85" /></bezel> - <bezel element="text_p5" ><bounds x="146.5" y="65.5" width="4" height="4" /><color alpha="0.85" /></bezel> - <bezel element="text_p6" ><bounds x="155.5" y="65.5" width="4" height="4" /><color alpha="0.85" /></bezel> + <element ref="whitew"><bounds x="110.5" y="65.5" width="50" height="4" /></element> + <element ref="text_p1"><bounds x="110.5" y="65.5" width="4" height="4" /></element> + <element ref="text_p2"><bounds x="119.5" y="65.5" width="4" height="4" /></element> + <element ref="text_p3"><bounds x="128.5" y="65.5" width="4" height="4" /></element> + <element ref="text_p4"><bounds x="137.5" y="65.5" width="4" height="4" /></element> + <element ref="text_p5"><bounds x="146.5" y="65.5" width="4" height="4" /></element> + <element ref="text_p6"><bounds x="155.5" y="65.5" width="4" height="4" /></element> + <element ref="bmask" blend="add"><bounds x="110.5" y="65.5" width="50" height="4" /></element> + <element ref="background" blend="multiply"><bounds x="110.5" y="65.5" width="50" height="4" /></element> <bezel element="hlb" inputtag="RESET" inputmask="0x00000001"><bounds x="109" y="40" width="8" height="2" /></bezel> <bezel element="hlb" inputtag="P7" inputmask="0x80000000"><bounds x="120" y="40" width="8" height="2" /></bezel> @@ -508,12 +512,14 @@ <bezel element="hlb" inputtag="P1" inputmask="0x40000000"><bounds x="145" y="70" width="7" height="2" /></bezel> <bezel element="hlb" inputtag="P0" inputmask="0x40000000"><bounds x="154" y="70" width="7" height="2" /></bezel> - <group ref="lcd"><bounds x="108" y="4.5" width="30" height="11.2" /></group> + <element ref="blackb"><bounds x="107.8" y="10.4" width="30.4" height="11.6" /></element> + <group ref="lcd"><bounds x="108" y="10.6" width="30" height="11.2" /></group> + <group ref="sb_board"><bounds x="21" y="2" width="80" height="80" /></group> - <group ref="sb_ui"><bounds x="1.5" y="5" width="10" height="80" /></group> + <group ref="sb_ui"><bounds x="1.5" y="2" width="10" height="80" /></group> </view> - <view name="LCD"> + <view name="Internal Layout (LCD)"> <group ref="lcd"><bounds x="0" y="0" width="30" height="11.2" /></group> </view> </mamelayout> diff --git a/src/mame/machine/315-6154.cpp b/src/mame/machine/315-6154.cpp new file mode 100644 index 00000000000..940c1b8c144 --- /dev/null +++ b/src/mame/machine/315-6154.cpp @@ -0,0 +1,138 @@ +// license:BSD-3-Clause +// copyright-holders:Samuele Zannoli + +#include "emu.h" +#include "machine/315-6154.h" + +DEFINE_DEVICE_TYPE(SEGA315_6154, sega_315_6154_device, "sega315_6154", "Sega 315-6154 Northbridge") + +sega_315_6154_device::sega_315_6154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, SEGA315_6154, tag, owner, clock), + device_memory_interface(mconfig, *this), + m_memory_config("memory", ENDIANNESS_LITTLE, 32, 32), + m_configuration_config("configuration", ENDIANNESS_LITTLE, 32, 32) +{ + memset(m_registers, 0, sizeof(m_registers)); + memset(m_bases, 0, sizeof(m_bases)); + m_useconfig_14x = false; + m_useconfig_18x = false; +} + +void sega_315_6154_device::device_start() +{ + m_memory = &space(AS_PCI_MEMORY); + m_configuration = &space(AS_PCI_CONFIGURATION); + + save_item(NAME(m_registers)); + save_item(NAME(m_bases)); + save_item(NAME(m_useconfig_14x)); + save_item(NAME(m_useconfig_18x)); +} + +void sega_315_6154_device::device_reset() +{ + memset(m_registers, 0, sizeof(m_registers)); +} + +device_memory_interface::space_config_vector sega_315_6154_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(AS_PCI_MEMORY, &m_memory_config), + std::make_pair(AS_PCI_CONFIGURATION, &m_configuration_config) + }; +} + +READ32_MEMBER(sega_315_6154_device::registers_r) +{ + return m_registers[offset]; +} + +static inline void parse_address_register(u32 reg, u32 *base) +{ + base[0] = (reg & 0xff) << 24; + reg = reg >> 8; + base[1] = (reg & 0xff) << 24; + reg = reg >> 8; + base[2] = (reg & 0xff) << 24; + reg = reg >> 8; + base[3] = reg << 24; +} + +WRITE32_MEMBER(sega_315_6154_device::registers_w) +{ + COMBINE_DATA(m_registers + offset); + + if (offset == 0x10 / 4) + parse_address_register(m_registers[0x10 / 4], m_bases); + else if (offset == 0x14 / 4) + parse_address_register(m_registers[0x14 / 4], m_bases + 4); + else if (offset == 0x18 / 4) + parse_address_register(m_registers[0x18 / 4], m_bases + 8); + else if (offset == 0x1c / 4) + { + m_useconfig_14x = (m_registers[0x1c / 4] & 1) != 0; + m_useconfig_18x = (m_registers[0x1c / 4] & 2) != 0; + } + else if (offset == 0x38 / 4) + { + if (m_registers[0x38 / 4] & 0x01000000) + { + uint32_t s, d, l; + + s = m_registers[0x30 / 4]; + d = m_registers[0x34 / 4]; + l = m_registers[0x38 / 4] & 0xffffff; + logerror("got dma transfer request from 0x%08x to 0x%08x size 0x%08x bytes\n", s, d, l << 2); + while (l != 0) + { + m_memory->write_dword(d, m_memory->read_dword(s)); + s += 4; + d += 4; + l--; + } + } + m_registers[0x38 / 4] &= ~0x01000000; + } +} + +template<int Aperture> +u32 sega_315_6154_device::aperture_r(address_space &space, offs_t offset, u32 mem_mask) +{ + const u32 destination_offset = offset & 0x3fffff; + const int destination = (offset >> 22) & 3; + const int index = Aperture * 4 + destination; + + if ((Aperture == 0) && (destination == 0) && (m_useconfig_14x == true)) + return m_configuration->read_dword(destination_offset << 2, mem_mask); + if ((Aperture == 1) && (destination == 0) && (m_useconfig_18x == true)) + return m_configuration->read_dword(destination_offset << 2, mem_mask); + return m_memory->read_dword(m_bases[index] + (destination_offset << 2), mem_mask); +} + +template u32 sega_315_6154_device::aperture_r<0>(address_space &space, offs_t offset, u32 mem_mask); +template u32 sega_315_6154_device::aperture_r<1>(address_space &space, offs_t offset, u32 mem_mask); +template u32 sega_315_6154_device::aperture_r<2>(address_space &space, offs_t offset, u32 mem_mask); + +template<int Aperture> +void sega_315_6154_device::aperture_w(address_space &space, offs_t offset, u32 data, u32 mem_mask) +{ + const u32 destination_offset = offset & 0x3fffff; + const int destination = (offset >> 22) & 3; + const int index = Aperture * 4 + destination; + + if ((Aperture == 0) && (destination == 0) && (m_useconfig_14x == true)) + { + m_configuration->write_dword(destination_offset << 2, data, mem_mask); + return; + } + if ((Aperture == 1) && (destination == 0) && (m_useconfig_18x == true)) + { + m_configuration->write_dword(destination_offset << 2, data, mem_mask); + return; + } + m_memory->write_dword(m_bases[index] + (destination_offset << 2), data, mem_mask); +} + +template void sega_315_6154_device::aperture_w<0>(address_space &space, offs_t offset, u32 data, u32 mem_mask); +template void sega_315_6154_device::aperture_w<1>(address_space &space, offs_t offset, u32 data, u32 mem_mask); +template void sega_315_6154_device::aperture_w<2>(address_space &space, offs_t offset, u32 data, u32 mem_mask); diff --git a/src/mame/machine/315-6154.h b/src/mame/machine/315-6154.h new file mode 100644 index 00000000000..815fb767b72 --- /dev/null +++ b/src/mame/machine/315-6154.h @@ -0,0 +1,49 @@ +// license:BSD-3-Clause +// copyright-holders:Samuele Zannoli +#ifndef MAME_MACHINE_315_6154_H +#define MAME_MACHINE_315_6154_H + +#pragma once + +DECLARE_DEVICE_TYPE(SEGA315_6154, sega_315_6154_device) + +class sega_315_6154_device : public device_t, public device_memory_interface +{ +public: + // construction/destruction + sega_315_6154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + address_space *memory() { return m_memory; } + + DECLARE_READ32_MEMBER(registers_r); + DECLARE_WRITE32_MEMBER(registers_w); + template<int Aperture> + u32 aperture_r(address_space &space, offs_t offset, u32 mem_mask = 0xffffffff); + template<int Aperture> + void aperture_w(address_space &space, offs_t offset, u32 data, u32 mem_mask = 0xffffffff); + + enum { + AS_PCI_MEMORY = 0, + AS_PCI_CONFIGURATION = 1 + }; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + +private: + address_space_config m_memory_config; + address_space_config m_configuration_config; + address_space *m_memory; + address_space *m_configuration; + + u32 m_registers[0x100 / 4]; + u32 m_bases[4 * 3]; + bool m_useconfig_14x; + bool m_useconfig_18x; + +}; + +#endif // MAME_MACHINE_315_6154_H diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp index b984da8b1ab..01dc23c1e1c 100644 --- a/src/mame/machine/3dom2.cpp +++ b/src/mame/machine/3dom2.cpp @@ -1514,9 +1514,9 @@ void m2_cde_device::device_start() { // Find our friend the BDA m_bda = downcast<m2_bda_device *>(machine().device("bda")); - assert(m_bda != NULL); + assert(m_bda != nullptr); - if (m_bda == NULL) + if (m_bda == nullptr) throw device_missing_dependencies(); // Resolve callbacks diff --git a/src/mame/machine/acs8600_ics.cpp b/src/mame/machine/acs8600_ics.cpp index 09a21cc6d39..edc5a4a5eea 100644 --- a/src/mame/machine/acs8600_ics.cpp +++ b/src/mame/machine/acs8600_ics.cpp @@ -87,11 +87,11 @@ void acs8600_ics_device::ics_io(address_map &map) static const z80_daisy_config ics_daisy_chain[] = { - "sio1", - "sio2", - "sio3", - "sio4", - nullptr + { "sio1" }, + { "sio2" }, + { "sio3" }, + { "sio4" }, + { nullptr } }; void acs8600_ics_device::device_add_mconfig(machine_config &config) diff --git a/src/mame/machine/atarifdc.cpp b/src/mame/machine/atarifdc.cpp index ce6a5eb3e3b..b7f21c9ee58 100644 --- a/src/mame/machine/atarifdc.cpp +++ b/src/mame/machine/atarifdc.cpp @@ -15,7 +15,7 @@ #include "formats/atari_dsk.h" -#include <ctype.h> +#include <cctype> #define VERBOSE_SERIAL 0 @@ -301,7 +301,6 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image, bool is_cr (m_drv[id].heads == 1) ? "SS" : "DS", (m_drv[id].density == 0) ? "SD" : (m_drv[id].density == 1) ? "MD" : "DD", m_drv[id].seclen); - return; } diff --git a/src/mame/machine/atarixga.cpp b/src/mame/machine/atarixga.cpp index 968abee4048..119d8c42acd 100644 --- a/src/mame/machine/atarixga.cpp +++ b/src/mame/machine/atarixga.cpp @@ -396,7 +396,6 @@ WRITE32_MEMBER(atari_136095_0072_device::polylsb_write) { m_update.addr = offset; m_update.data[offset] = data; - return; } READ32_MEMBER(atari_136095_0072_device::polylsb_read) @@ -470,8 +469,6 @@ WRITE32_MEMBER(atari_136095_0072_device::write) default: break; } - - return; } READ32_MEMBER(atari_136095_0072_device::read) diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp index 00a0e3051e1..d022ae919e1 100644 --- a/src/mame/machine/bbc.cpp +++ b/src/mame/machine/bbc.cpp @@ -10,7 +10,7 @@ ******************************************************************************/ -#include <ctype.h> +#include <cctype> #include "emu.h" #include "cpu/m6502/m6502.h" #include "sound/tms5220.h" diff --git a/src/mame/machine/cuda.cpp b/src/mame/machine/cuda.cpp index cd7de260827..2cc123d5a8a 100644 --- a/src/mame/machine/cuda.cpp +++ b/src/mame/machine/cuda.cpp @@ -421,7 +421,7 @@ void cuda_device::device_start() save_item(NAME(pram)); save_item(NAME(disk_pram)); - uint8_t *rom = device().machine().root_device().memregion(device().subtag(CUDA_CPU_TAG).c_str())->base(); + uint8_t *rom = device().machine().root_device().memregion(device().subtag(CUDA_CPU_TAG))->base(); if (rom) { diff --git a/src/mame/machine/cx4fn.hxx b/src/mame/machine/cx4fn.hxx index 5021590740c..a9461567efa 100644 --- a/src/mame/machine/cx4fn.hxx +++ b/src/mame/machine/cx4fn.hxx @@ -10,7 +10,7 @@ ***************************************************************************/ -#include <math.h> +#include <cmath> #define CX4_Tan(a) (CX4_CosTable[a] ? ((((int32_t)CX4_SinTable[a]) << 16) / CX4_CosTable[a]) : 0x80000000) #define CX4_sar(b, n) ((b) >> (n)) #ifdef PI diff --git a/src/mame/machine/dc.cpp b/src/mame/machine/dc.cpp index 3fb65d363b4..c81382b5661 100644 --- a/src/mame/machine/dc.cpp +++ b/src/mame/machine/dc.cpp @@ -748,6 +748,16 @@ WRITE_LINE_MEMBER(dc_state::sh4_aica_irq) dc_update_interrupt_status(); } +WRITE_LINE_MEMBER(dc_state::external_irq) +{ + if (state) + dc_sysctrl_regs[SB_ISTEXT] |= IST_EXT_EXTERNAL; + else + dc_sysctrl_regs[SB_ISTEXT] &= ~IST_EXT_EXTERNAL; + + dc_update_interrupt_status(); +} + MACHINE_RESET_MEMBER(dc_state,dc_console) { dc_state::machine_reset(); diff --git a/src/mame/machine/dc305.cpp b/src/mame/machine/dc305.cpp new file mode 100644 index 00000000000..d98480fb7ea --- /dev/null +++ b/src/mame/machine/dc305.cpp @@ -0,0 +1,101 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC DC305 Printer Controller + + This device normally operates at 2 MHz with one wait state. It + generates two vectored interrupts. + +***************************************************************************/ + +#include "emu.h" +#include "dc305.h" + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE(DC305, dc305_device, "dc305", "DC305 Printer Controller") + + +//************************************************************************** +// DEVICE IMPLEMENTATION +//************************************************************************** + +//------------------------------------------------- +// dc305_device - constructor +//------------------------------------------------- + +dc305_device::dc305_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, DC305, tag, owner, clock) + , m_int_callback(*this) + , m_rxc_callback(*this) + , m_txc_callback(*this) +{ +} + + +//------------------------------------------------- +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time +//------------------------------------------------- + +void dc305_device::device_resolve_objects() +{ + m_int_callback.resolve_safe(); + m_rxc_callback.resolve_safe(); + m_txc_callback.resolve_safe(); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void dc305_device::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void dc305_device::device_reset() +{ +} + + +//------------------------------------------------- +// read - read from internal register +//------------------------------------------------- + +u8 dc305_device::read(offs_t offset) +{ + // TODO + return 0; +} + + +//------------------------------------------------- +// write - write to internal register +//------------------------------------------------- + +void dc305_device::write(offs_t offset, u8 data) +{ + // TODO +} + + +//------------------------------------------------- +// inta - acknowledge and vector interrupt +//------------------------------------------------- + +u8 dc305_device::inta() +{ + // TODO: generate RST 5, RST 3 or RST 1 if both requested + return 0xff; +} diff --git a/src/mame/machine/dc305.h b/src/mame/machine/dc305.h new file mode 100644 index 00000000000..c2dbd0672d8 --- /dev/null +++ b/src/mame/machine/dc305.h @@ -0,0 +1,75 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC DC305 Printer Controller + +**************************************************************************** + _____ _____ + VSS 1 |* \_/ | 40 A0 + INT 2 | | 39 A1 + RESET 3 | | 38 WR + CLK 4 | | 37 RD + VCC 5 | | 36 INTA + CH1 6 | | 35 CS + CH2 7 | | 34 D0 + MINUS 8 | | 33 D1 + PLUS 9 | | 32 D2 + BELL 10 | | 31 D3 + RUN 11 | DC305 | 30 D4 + LF2 12 | | 29 D5 + LF1 13 | | 28 D6 + RXC 14 | | 27 D7 + TXC 15 | | 26 S2 + S11 16 | | 25 S4 + S9 17 | | 24 S6 + S7 18 | | 23 S8 + S5 19 | | 22 S10 + S3 20 |_____________| 21 S1 + +***************************************************************************/ + +#ifndef MAME_MACHINE_DC305_H +#define MAME_MACHINE_DC305_H + +#pragma once + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> dc305_device + +class dc305_device : public device_t +{ +public: + // construction/destruction + dc305_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // configuration + auto int_callback() { return m_int_callback.bind(); } + auto rxc_callback() { return m_rxc_callback.bind(); } + auto txc_callback() { return m_txc_callback.bind(); } + + // CPU read/write handlers + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + u8 inta(); + +protected: + // device-specific overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + // callback objects + devcb_write_line m_int_callback; + devcb_write_line m_rxc_callback; + devcb_write_line m_txc_callback; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(DC305, dc305_device) + +#endif // MAME_MACHINE_DC305_H diff --git a/src/mame/machine/dgn_beta.cpp b/src/mame/machine/dgn_beta.cpp index b3179af551d..b71b4ec121f 100644 --- a/src/mame/machine/dgn_beta.cpp +++ b/src/mame/machine/dgn_beta.cpp @@ -59,7 +59,7 @@ #include <functional> -#include <math.h> +#include <cmath> #include "emu.h" #include "debug/debugcon.h" #include "cpu/m6809/m6809.h" diff --git a/src/mame/machine/egret.cpp b/src/mame/machine/egret.cpp index 0959485bfad..f909f8f5e1c 100644 --- a/src/mame/machine/egret.cpp +++ b/src/mame/machine/egret.cpp @@ -370,7 +370,7 @@ void egret_device::device_start() save_item(NAME(pram)); save_item(NAME(disk_pram)); - uint8_t *rom = device().machine().root_device().memregion(device().subtag(EGRET_CPU_TAG).c_str())->base(); + uint8_t *rom = device().machine().root_device().memregion(device().subtag(EGRET_CPU_TAG))->base(); if (rom) { diff --git a/src/mame/machine/elan_eu3a05commonsys.cpp b/src/mame/machine/elan_eu3a05commonsys.cpp index b4695f5e5b8..bb85fba04b7 100644 --- a/src/mame/machine/elan_eu3a05commonsys.cpp +++ b/src/mame/machine/elan_eu3a05commonsys.cpp @@ -174,7 +174,8 @@ elan_eu3a05commonsys_device::elan_eu3a05commonsys_device(const machine_config &m m_cpu(*this, finder_base::DUMMY_TAG), m_bank(*this, finder_base::DUMMY_TAG), m_is_pal(false), - m_allow_timer_irq(true) + m_allow_timer_irq(true), + m_whichtimer(0) { } @@ -236,7 +237,7 @@ void elan_eu3a05commonsys_device::device_timer(emu_timer &timer, device_timer_id // rad_bb3 unmasks the interrupt, but the jumps use pointers in RAM, which haven't been set up at the time // of unmasking, so we need to find some kind of global enable / disable, or timer enable. if (m_allow_timer_irq) - generate_custom_interrupt(0); + generate_custom_interrupt(m_whichtimer); break; } } diff --git a/src/mame/machine/elan_eu3a05commonsys.h b/src/mame/machine/elan_eu3a05commonsys.h index 5980701d0a0..2a622d9972b 100644 --- a/src/mame/machine/elan_eu3a05commonsys.h +++ b/src/mame/machine/elan_eu3a05commonsys.h @@ -25,6 +25,8 @@ public: DECLARE_READ8_MEMBER(nmi_vector_r); DECLARE_READ8_MEMBER(irq_vector_r); + void set_alt_timer() { m_whichtimer = 1; } + protected: // device-level overrides virtual void device_start() override; @@ -62,7 +64,7 @@ private: emu_timer *m_unk_timer; static const device_timer_id TIMER_UNK = 0; - + int m_whichtimer; }; diff --git a/src/mame/machine/elan_eu3a05gpio.cpp b/src/mame/machine/elan_eu3a05gpio.cpp index fe24d423dcb..5a1ede0e960 100644 --- a/src/mame/machine/elan_eu3a05gpio.cpp +++ b/src/mame/machine/elan_eu3a05gpio.cpp @@ -6,19 +6,25 @@ DEFINE_DEVICE_TYPE(ELAN_EU3A05_GPIO, elan_eu3a05gpio_device, "elan_eu3a05gpio", "Elan EU3A05 GPIO") -elan_eu3a05gpio_device::elan_eu3a05gpio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, ELAN_EU3A05_GPIO, tag, owner, clock) - , m_space_read0_cb(*this) - , m_space_read1_cb(*this) - , m_space_read2_cb(*this) +elan_eu3a05gpio_device::elan_eu3a05gpio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, ELAN_EU3A05_GPIO, tag, owner, clock), + m_write_0_callback(*this), + m_write_1_callback(*this), + m_write_2_callback(*this), + m_read_0_callback(*this), + m_read_1_callback(*this), + m_read_2_callback(*this) { } void elan_eu3a05gpio_device::device_start() { - m_space_read0_cb.resolve_safe(0xff); - m_space_read1_cb.resolve_safe(0xff); - m_space_read2_cb.resolve_safe(0xff); + m_write_0_callback.resolve_safe(); + m_write_1_callback.resolve_safe(); + m_write_2_callback.resolve_safe(); + m_read_0_callback.resolve_safe(0xff); + m_read_1_callback.resolve_safe(0xff); + m_read_2_callback.resolve_safe(0xff); } void elan_eu3a05gpio_device::device_reset() @@ -35,9 +41,9 @@ uint8_t elan_eu3a05gpio_device::read_port_data(int which) //todo, actually use the direction registers switch (which) { - case 0: return m_space_read0_cb(); - case 1: return m_space_read1_cb(); - case 2: return m_space_read2_cb(); + case 0: return m_read_0_callback(); + case 1: return m_read_1_callback(); + case 2: return m_read_2_callback(); } return 0xff; @@ -60,6 +66,13 @@ void elan_eu3a05gpio_device::write_port_data(int which, uint8_t data) { //todo, actually use the direction registers logerror("%s: write_port_data (port %d) %02x (direction register %02x)\n", machine().describe_context(), which, data, m_ddr[which]); + + switch (which) + { + case 0: return m_write_0_callback(data); break; + case 1: return m_write_1_callback(data); break; + case 2: return m_write_2_callback(data); break; + } } void elan_eu3a05gpio_device::write_direction(int which, uint8_t data) @@ -70,7 +83,6 @@ void elan_eu3a05gpio_device::write_direction(int which, uint8_t data) WRITE8_MEMBER(elan_eu3a05gpio_device::gpio_w) { - int port = offset/2; if (!(offset&1)) return write_direction(port, data); else return write_port_data(port, data); diff --git a/src/mame/machine/elan_eu3a05gpio.h b/src/mame/machine/elan_eu3a05gpio.h index f06d2eb14b0..c476a303641 100644 --- a/src/mame/machine/elan_eu3a05gpio.h +++ b/src/mame/machine/elan_eu3a05gpio.h @@ -10,10 +10,13 @@ class elan_eu3a05gpio_device : public device_t public: elan_eu3a05gpio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - auto read_0_callback() { return m_space_read0_cb.bind(); } - auto read_1_callback() { return m_space_read1_cb.bind(); } - auto read_2_callback() { return m_space_read2_cb.bind(); } - + auto write_0_callback() { return m_write_0_callback.bind(); } + auto write_1_callback() { return m_write_1_callback.bind(); } + auto write_2_callback() { return m_write_2_callback.bind(); } + auto read_0_callback() { return m_read_0_callback.bind(); } + auto read_1_callback() { return m_read_1_callback.bind(); } + auto read_2_callback() { return m_read_2_callback.bind(); } + DECLARE_READ8_MEMBER(gpio_r); DECLARE_WRITE8_MEMBER(gpio_w); @@ -25,9 +28,12 @@ protected: virtual void device_reset() override; private: - devcb_read8 m_space_read0_cb; - devcb_read8 m_space_read1_cb; - devcb_read8 m_space_read2_cb; + devcb_write8 m_write_0_callback; + devcb_write8 m_write_1_callback; + devcb_write8 m_write_2_callback; + devcb_read8 m_read_0_callback; + devcb_read8 m_read_1_callback; + devcb_read8 m_read_2_callback; uint8_t read_port_data(int which); uint8_t read_direction(int which); diff --git a/src/mame/machine/electron.cpp b/src/mame/machine/electron.cpp index 19862d17e72..ce62fe7aad3 100644 --- a/src/mame/machine/electron.cpp +++ b/src/mame/machine/electron.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol +// copyright-holders:Wilbert Pol, Nigel Barnes /****************************************************************************** Acorn Electron driver @@ -121,12 +121,12 @@ TIMER_CALLBACK_MEMBER(electron_state::electron_tape_timer_handler) case 9: /* stop bit */ m_ula.stop_bit = ( ( m_ula.tape_value == 0x0000FFFF ) ? 0 : 1 ); //logerror( "++ Read stop bit: %d\n", m_ula.stop_bit ); - if ( m_ula.start_bit && m_ula.stop_bit && m_ula.tape_byte == 0xFF && ! m_ula.high_tone_set ) + if ( m_ula.start_bit && m_ula.stop_bit && m_ula.tape_byte == 0xFF && !m_ula.high_tone_set ) { electron_interrupt_handler( INT_SET, INT_HIGH_TONE ); m_ula.high_tone_set = 1; } - else if ( ! m_ula.start_bit && m_ula.stop_bit ) + else if ( !m_ula.start_bit && m_ula.stop_bit ) { //logerror( "-- Byte read from tape: %02x\n", m_ula.tape_byte ); electron_interrupt_handler( INT_SET, INT_RECEIVE_FULL ); @@ -251,6 +251,69 @@ WRITE8_MEMBER(electron_state::electron_paged_w) m_exp->expbus_w(0x8000 + offset, data); } +READ8_MEMBER(electronsp_state::electron_paged_r) +{ + uint8_t data = 0; + + /* The processor will run at 2MHz during an access cycle to the ROM */ + m_maincpu->set_clock_scale(1.0f); + + if ((m_ula.rompage & 0x0e) == m_rompages->read()) + { + data = m_romi[m_ula.rompage & 0x01]->read_rom(offset); + } + else + { + switch (m_ula.rompage) + { + case 10: + /* SP64 ROM utilises the spare BASIC ROM page */ + if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) + { + data = m_sp64_ram[offset & 0x1fff]; + } + else + { + data = m_region_sp64->base()[(!BIT(m_sp64_bank, 0) << 14) | offset]; + } + break; + + default: + data = electron_state::electron_paged_r(space, offset, mem_mask); + break; + } + } + return data; +} + +WRITE8_MEMBER(electronsp_state::electron_paged_w) +{ + /* The processor will run at 2MHz during an access cycle to the ROM */ + m_maincpu->set_clock_scale(1.0f); + + if ((m_ula.rompage & 0x0e) == m_rompages->read()) + { + /* TODO: sockets are writeable if RAM */ + } + else + { + switch (m_ula.rompage) + { + case 10: + /* SP64 ROM utilises the spare BASIC ROM page */ + if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) + { + m_sp64_ram[offset & 0x1fff] = data; + } + break; + + default: + electronsp_state::electron_paged_w(space, offset, data, mem_mask); + break; + } + } +} + READ8_MEMBER(electron_state::electron_mos_r) { /* The processor will run at 2MHz during an access cycle to the ROM */ @@ -290,6 +353,41 @@ WRITE8_MEMBER(electron_state::electron_fred_w) m_exp->expbus_w(0xfc00 + offset, data); } +READ8_MEMBER(electronsp_state::electron_fred_r) +{ + uint8_t data = 0; + + /* The processor will run at 2MHz during an access cycle to the ROM */ + m_maincpu->set_clock_scale(1.0f); + + if ((offset & 0xf0) == 0xb0) + { + data = m_via->read(offset & 0x0f); + } + else + { + data = electron_state::electron_fred_r(space, offset, mem_mask); + } + return data;; +} + +WRITE8_MEMBER(electronsp_state::electron_fred_w) +{ + /* The processor will run at 2MHz during an access cycle to the ROM */ + m_maincpu->set_clock_scale(1.0f); + + electron_state::electron_fred_w(space, offset, data, mem_mask); + + if ((offset & 0xf0) == 0xb0) + { + m_via->write(offset & 0x0f, data); + } + else if (offset == 0xfa) + { + m_sp64_bank = data; + } +} + READ8_MEMBER(electron_state::electron_jim_r) { /* The processor will run at 2MHz during an access cycle to the ROM */ @@ -467,12 +565,12 @@ void electron_state::electron_interrupt_handler(int mode, int interrupt) if ( m_ula.interrupt_status & m_ula.interrupt_control & ~0x83 ) { m_ula.interrupt_status |= 0x01; - m_maincpu->set_input_line(0, ASSERT_LINE ); + m_irqs->in_w<0>(ASSERT_LINE); } else { m_ula.interrupt_status &= ~0x01; - m_maincpu->set_input_line(0, CLEAR_LINE ); + m_irqs->in_w<0>(CLEAR_LINE); } } @@ -486,6 +584,31 @@ TIMER_CALLBACK_MEMBER(electron_state::setup_beep) m_beeper->set_clock( 300 ); } +void electron_state::machine_start() +{ + m_ula.interrupt_status = 0x82; + m_ula.interrupt_control = 0x00; + timer_set(attotime::zero, TIMER_SETUP_BEEP); + m_tape_timer = timer_alloc(TIMER_TAPE_HANDLER); + + /* register save states */ + save_item(STRUCT_MEMBER(m_ula, interrupt_status)); + save_item(STRUCT_MEMBER(m_ula, interrupt_control)); + save_item(STRUCT_MEMBER(m_ula, rompage)); + save_item(STRUCT_MEMBER(m_ula, screen_start)); + save_item(STRUCT_MEMBER(m_ula, screen_base)); + save_item(STRUCT_MEMBER(m_ula, screen_size)); + save_item(STRUCT_MEMBER(m_ula, screen_addr)); + save_item(STRUCT_MEMBER(m_ula, screen_dispend)); + save_item(STRUCT_MEMBER(m_ula, current_pal)); + save_item(STRUCT_MEMBER(m_ula, communication_mode)); + save_item(STRUCT_MEMBER(m_ula, screen_mode)); + save_item(STRUCT_MEMBER(m_ula, cassette_motor_mode)); + save_item(STRUCT_MEMBER(m_ula, capslock_mode)); + save_item(NAME(m_mrb_mapped)); + save_item(NAME(m_vdu_drivers)); +} + void electron_state::machine_reset() { m_ula.communication_mode = 0x04; @@ -502,10 +625,35 @@ void electron_state::machine_reset() m_vdu_drivers = false; } -void electron_state::machine_start() +void electronsp_state::machine_start() { - m_ula.interrupt_status = 0x82; - m_ula.interrupt_control = 0x00; - timer_set(attotime::zero, TIMER_SETUP_BEEP); - m_tape_timer = timer_alloc(TIMER_TAPE_HANDLER); + electron_state::machine_start(); + + m_sp64_ram = std::make_unique<uint8_t[]>(0x2000); + + /* register save states */ + save_item(NAME(m_sp64_bank)); + save_pointer(NAME(m_sp64_ram), 0x2000); +} + + +image_init_result electronsp_state::load_rom(device_image_interface &image, generic_slot_device *slot) +{ + uint32_t size = slot->common_get_size("rom"); + + // socket accepts 8K and 16K ROM only + if (size != 0x2000 && size != 0x4000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size: Only 8K/16K is supported"); + return image_init_result::FAIL; + } + + slot->rom_alloc(0x4000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + slot->common_load_rom(slot->get_rom_base(), size, "rom"); + + // mirror 8K ROMs + uint8_t *crt = slot->get_rom_base(); + if (size <= 0x2000) memcpy(crt + 0x2000, crt, 0x2000); + + return image_init_result::PASS; } diff --git a/src/mame/machine/esqpanel.cpp b/src/mame/machine/esqpanel.cpp index 9fb5b1c9d38..f5df1b55e87 100644 --- a/src/mame/machine/esqpanel.cpp +++ b/src/mame/machine/esqpanel.cpp @@ -154,7 +154,7 @@ namespace esqpanel { m_to_send.put(c); const std::string &s = m_to_send.str(); - for (auto iter: m_panels) + for (const auto &iter: m_panels) { external_panel_ptr panel = iter.second; if (panel->send_display_data()) @@ -215,7 +215,7 @@ namespace esqpanel { } // Echo the non-command message to any other connected panels that want it - for (auto iter: m_panels) + for (const auto &iter: m_panels) { external_panel_ptr other_panel = iter.second; if (other_panel != panel && (t & other_panel->send_message_types()) != 0) diff --git a/src/mame/machine/etna.cpp b/src/mame/machine/etna.cpp new file mode 100644 index 00000000000..6afb3de7523 --- /dev/null +++ b/src/mame/machine/etna.cpp @@ -0,0 +1,257 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, Ash Wolf +/*************************************************************************** + + Psion 5mx (EPOC R5) series ETNA peripheral + + Skeleton device by Ryan Holtz, ported from work by Ash Wolf + + More info: + https://github.com/Treeki/WindEmu + +****************************************************************************/ + +#include "etna.h" + +#define LOG_READS (1 << 0) +#define LOG_WRITES (1 << 1) +#define LOG_UNKNOWNS (1 << 2) +#define LOG_PROM (1 << 3) +#define LOG_ALL (LOG_READS | LOG_WRITES | LOG_UNKNOWNS | LOG_PROM) + +#define VERBOSE (0) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(ETNA, etna_device, "etna", "Psion 5mx ETNA") + +etna_device::etna_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, ETNA, tag, owner, clock) + , m_eeprom_data_out(*this) +{ +} + +void etna_device::device_start() +{ + save_item(NAME(m_prom_addr_count)); + save_item(NAME(m_prom_addr)); + save_item(NAME(m_prom_value)); + save_item(NAME(m_prom_cs)); + save_item(NAME(m_prom_clk)); + + save_item(NAME(m_pending_ints)); + + save_item(NAME(m_regs)); + save_item(NAME(m_prom)); +} + +void etna_device::device_reset() +{ + m_prom_addr_count = 0; + m_prom_addr = 0; + m_prom_value = 0; + m_prom_cs = false; + m_prom_clk = false; + + m_pending_ints = 0; + + memset(m_regs, 0, ARRAY_LENGTH(m_regs)); + memset(m_prom, 0, ARRAY_LENGTH(m_prom)); + + // defaults expected by the touchscreen code + m_prom[0x0a] = 20; + m_prom[0x0b] = 20; + m_prom[0x0c] = 20; + m_prom[0x0d] = 30; + + // some basic stuff to begin with + // set up the Psion's unique ID + m_prom[0x1b] = 0xde; + m_prom[0x1a] = 0xad; + m_prom[0x19] = 0xbe; + m_prom[0x18] = 0xef; + + // give ourselves a neat custom device name + const char *key = "PSION"; + const char *name = "MAME!"; + m_prom[0x28] = strlen(name); + for (int i = 0; i < m_prom[0x28]; i++) + m_prom[0x29 + i] = name[i] ^ key[i]; + + // calculate the checksum + uint8_t chk = 0; + for (int i = 0; i < 0x7F; i++) + chk ^= m_prom[i]; + + // EPOC is expecting 66 + m_prom[0x7f] = chk ^ 66; +} + +WRITE8_MEMBER(etna_device::regs_w) +{ + switch (offset) + { + case REG_UNK0: + LOGMASKED(LOG_WRITES, "%s: etna reg write: UNK0 = %02x\n", machine().describe_context(), data); + break; + case REG_UNK1: + LOGMASKED(LOG_WRITES, "%s: etna reg write: UNK1 = %02x\n", machine().describe_context(), data); + break; + case REG_UART_INT_STATUS: + LOGMASKED(LOG_WRITES, "%s: etna reg write: INT_STATUS = %02x\n", machine().describe_context(), data); + break; + case REG_UART_INT_MASK: + LOGMASKED(LOG_WRITES, "%s: etna reg write: INT_MASK = %02x\n", machine().describe_context(), data); + break; + case REG_UART_BAUD_LO: + LOGMASKED(LOG_WRITES, "%s: etna reg write: BAUD_LO = %02x\n", machine().describe_context(), data); + break; + case REG_UART_BAUD_HI: + LOGMASKED(LOG_WRITES, "%s: etna reg write: BAUD_HI = %02x\n", machine().describe_context(), data); + break; + case REG_PCCD_INT_STATUS: + LOGMASKED(LOG_WRITES, "%s: etna reg write: PCCD_INT_STATUS = %02x\n", machine().describe_context(), data); + break; + case REG_PCCD_INT_MASK: + LOGMASKED(LOG_WRITES, "%s: etna reg write: PCCD_INT_MASK = %02x\n", machine().describe_context(), data); + break; + case REG_INT_CLEAR: + LOGMASKED(LOG_WRITES, "%s: etna reg write: INT_CLEAR = %02x\n", machine().describe_context(), data); + m_pending_ints &= ~data; + break; + case REG_SKT_VAR_A0: + LOGMASKED(LOG_WRITES, "%s: etna reg write: SKT_VAR_A0 = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_VAR_A1: + LOGMASKED(LOG_WRITES, "%s: etna reg write: SKT_VAR_A1 = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_CTRL: + LOGMASKED(LOG_WRITES, "%s: etna reg write: SKT_CTRL = %02x\n", machine().describe_context(), data); + break; + case REG_WAKE1: + LOGMASKED(LOG_WRITES, "%s: etna reg write: WAKE1 = %02x\n", machine().describe_context(), data); + m_regs[REG_WAKE1] = data; + break; + case REG_SKT_VAR_B0: + LOGMASKED(LOG_WRITES, "%s: etna reg write: SKT_VAR_B0 = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_VAR_B1: + LOGMASKED(LOG_WRITES, "%s: etna reg write: SKT_VAR_B1 = %02x\n", machine().describe_context(), data); + break; + case REG_WAKE2: + LOGMASKED(LOG_WRITES, "%s: etna reg write: WAKE2 = %02x\n", machine().describe_context(), data); + m_regs[REG_WAKE2] = data; + break; + default: + LOGMASKED(LOG_UNKNOWNS, "%s: etna reg write: Unknown = %02x\n", machine().describe_context(), data); + break; + } +} + +READ8_MEMBER(etna_device::regs_r) +{ + uint8_t data = 0; + switch (offset) + { + case REG_UNK0: + LOGMASKED(LOG_READS, "%s: etna reg read: UNK0 = %02x\n", machine().describe_context(), data); + break; + case REG_UNK1: + LOGMASKED(LOG_READS, "%s: etna reg read: UNK1 = %02x\n", machine().describe_context(), data); + break; + case REG_UART_INT_STATUS: + LOGMASKED(LOG_READS, "%s: etna reg read: INT_STATUS = %02x\n", machine().describe_context(), data); + break; + case REG_UART_INT_MASK: + LOGMASKED(LOG_READS, "%s: etna reg read: INT_MASK = %02x\n", machine().describe_context(), data); + break; + case REG_UART_BAUD_LO: + LOGMASKED(LOG_READS, "%s: etna reg read: BAUD_LO = %02x\n", machine().describe_context(), data); + break; + case REG_UART_BAUD_HI: + LOGMASKED(LOG_READS, "%s: etna reg read: BAUD_HI = %02x\n", machine().describe_context(), data); + break; + case REG_PCCD_INT_STATUS: + LOGMASKED(LOG_READS, "%s: etna reg read: PCCD_INT_STATUS = %02x\n", machine().describe_context(), data); + break; + case REG_PCCD_INT_MASK: + LOGMASKED(LOG_READS, "%s: etna reg read: PCCD_INT_MASK = %02x\n", machine().describe_context(), data); + break; + case REG_INT_CLEAR: + LOGMASKED(LOG_READS, "%s: etna reg read: INT_CLEAR = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_VAR_A0: + LOGMASKED(LOG_READS, "%s: etna reg read: SKT_VAR_A0 = %02x\n", machine().describe_context(), data); + data = 1; + break; + case REG_SKT_VAR_A1: + LOGMASKED(LOG_READS, "%s: etna reg read: SKT_VAR_A1 = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_CTRL: + LOGMASKED(LOG_READS, "%s: etna reg read: SKT_CTRL = %02x\n", machine().describe_context(), data); + break; + case REG_WAKE1: + data = m_regs[REG_WAKE1]; + LOGMASKED(LOG_READS, "%s: etna reg read: WAKE1 = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_VAR_B0: + LOGMASKED(LOG_READS, "%s: etna reg read: SKT_VAR_B0 = %02x\n", machine().describe_context(), data); + break; + case REG_SKT_VAR_B1: + LOGMASKED(LOG_READS, "%s: etna reg read: SKT_VAR_B1 = %02x\n", machine().describe_context(), data); + break; + case REG_WAKE2: + data = m_regs[REG_WAKE2]; + LOGMASKED(LOG_READS, "%s: etna reg read: WAKE2 = %02x\n", machine().describe_context(), data); + break; + default: + LOGMASKED(LOG_UNKNOWNS, "%s: etna reg read: Unknown = %02x\n", machine().describe_context(), data); + break; + } + return data; +} + +WRITE_LINE_MEMBER(etna_device::eeprom_cs_in) +{ + bool old = m_prom_cs; + m_prom_cs = state; + if (!old && m_prom_cs) + { + m_prom_addr_count = 0; + m_prom_addr = 0; + m_prom_value = 0; + } +} + +WRITE_LINE_MEMBER(etna_device::eeprom_clk_in) +{ + bool old = m_prom_clk; + m_prom_clk = state; + + if (!old && m_prom_clk) + { + if (m_prom_addr_count < 10) + { + m_prom_addr <<= 1; + m_prom_addr |= BIT(m_regs[REG_WAKE1], 2); + m_prom_addr_count++; + if (m_prom_addr_count == 10) + { + LOGMASKED(LOG_PROM, "PROM Address: %03x\n", m_prom_addr); + uint16_t byte_addr = (m_prom_addr << 1) % ARRAY_LENGTH(m_prom); + m_prom_value = m_prom[byte_addr] | (m_prom[byte_addr + 1] << 8); + LOGMASKED(LOG_PROM, "PROM Value: %04x\n", m_prom_value); + } + } + else + { + m_regs[REG_WAKE1] &= ~0x08; + m_regs[REG_WAKE1] |= BIT(m_prom_value, 15) << 3; + LOGMASKED(LOG_PROM, "PROM Bit: %d\n", BIT(m_prom_value, 15)); + m_prom_value <<= 1; + } + } +} + +WRITE_LINE_MEMBER(etna_device::eeprom_data_in) +{ +} diff --git a/src/mame/machine/etna.h b/src/mame/machine/etna.h new file mode 100644 index 00000000000..15a14dabec5 --- /dev/null +++ b/src/mame/machine/etna.h @@ -0,0 +1,73 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz, Ash Wolf +/*************************************************************************** + + Psion 5mx (EPOC R5) series ETNA peripheral + + Skeleton driver by Ryan Holtz, ported from work by Ash Wolf + +****************************************************************************/ + +#ifndef MAME_MACHINE_ETNA_H +#define MAME_MACHINE_ETNA_H + +#pragma once + +#include "emu.h" + +class etna_device : public device_t +{ +public: + etna_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0U); + + DECLARE_WRITE8_MEMBER(regs_w); + DECLARE_READ8_MEMBER(regs_r); + + DECLARE_WRITE_LINE_MEMBER(eeprom_cs_in); + DECLARE_WRITE_LINE_MEMBER(eeprom_clk_in); + DECLARE_WRITE_LINE_MEMBER(eeprom_data_in); + + auto eeprom_data_out() { return m_eeprom_data_out.bind(); } + +private: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + enum + { + REG_UNK0, + REG_UNK1, + REG_UART_INT_STATUS, + REG_UART_INT_MASK, + REG_UART_BAUD_LO, + REG_UART_BAUD_HI, + REG_PCCD_INT_STATUS, + REG_PCCD_INT_MASK, + REG_INT_CLEAR, + REG_SKT_VAR_A0, + REG_SKT_VAR_A1, + REG_SKT_CTRL, + REG_WAKE1, + REG_SKT_VAR_B0, + REG_SKT_VAR_B1, + REG_WAKE2 + }; + + devcb_write_line m_eeprom_data_out; + + uint8_t m_prom_addr_count; + uint16_t m_prom_addr; + uint16_t m_prom_value; + bool m_prom_cs; + bool m_prom_clk; + + uint8_t m_pending_ints; + + uint8_t m_regs[0x10]; + uint8_t m_prom[0x80]; +}; + +DECLARE_DEVICE_TYPE(ETNA, etna_device) + +#endif // MAME_MACHINE_ETNA_H diff --git a/src/mame/machine/gaelco3d.cpp b/src/mame/machine/gaelco3d.cpp index 315cba86b4c..9ca7cb00455 100644 --- a/src/mame/machine/gaelco3d.cpp +++ b/src/mame/machine/gaelco3d.cpp @@ -42,7 +42,7 @@ #else #include <unistd.h> #endif -#include <errno.h> +#include <cerrno> #ifdef SHARED_MEM_DRIVER #include <sys/mman.h> #endif diff --git a/src/mame/machine/gdrom.cpp b/src/mame/machine/gdrom.cpp index a25cc5d5373..1958692a442 100644 --- a/src/mame/machine/gdrom.cpp +++ b/src/mame/machine/gdrom.cpp @@ -422,6 +422,8 @@ void gdrom_device::ReadData( uint8_t *data, int dataLength ) case 0x71: memcpy(data, &GDROM_Cmd71_Reply[0], sizeof(GDROM_Cmd71_Reply)); + if (is_real_gdrom_disc) + data[10] = 0x1f; // needed by dimm board firmware break; case 0x40: // Get Subchannel status @@ -465,11 +467,22 @@ void gdrom_device::WriteData( uint8_t *data, int dataLength ) } } +void gdrom_device::SetDevice(void *device) +{ + t10mmc::SetDevice(device); + + // try to find if the mounted chd is from an actual gd-rom disc + if (m_cdrom) + if (cdrom_get_toc(m_cdrom)->flags & CD_FLAG_GDROM) + is_real_gdrom_disc = true; +} + // device type definition DEFINE_DEVICE_TYPE(GDROM, gdrom_device, "gdrom", "GD-ROM") gdrom_device::gdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - atapi_cdrom_device(mconfig, GDROM, tag, owner, clock) + atapi_cdrom_device(mconfig, GDROM, tag, owner, clock), + is_real_gdrom_disc(false) { } @@ -523,3 +536,12 @@ void gdrom_device::process_buffer() atapi_hle_device::process_buffer(); m_sector_number = 0x80 | GDROM_PAUSE_STATE; /// HACK: find out when this should be updated } + +void gdrom_device::signature() +{ + atapi_hle_device::signature(); + + // naomi dimm board firmware needs the upper nibble to be 8 at the beginning + if (is_real_gdrom_disc) + m_sector_number = 0x81; +} diff --git a/src/mame/machine/gdrom.h b/src/mame/machine/gdrom.h index 8fc87e95d2d..12014f62094 100644 --- a/src/mame/machine/gdrom.h +++ b/src/mame/machine/gdrom.h @@ -26,6 +26,8 @@ public: protected: virtual void process_buffer() override; + virtual void signature() override; + virtual void SetDevice(void *device) override; // device-level overrides virtual void device_start() override; @@ -36,6 +38,7 @@ private: uint32_t read_type; // for command 0x30 only uint32_t data_select; // for command 0x30 only uint32_t transferOffset; + bool is_real_gdrom_disc; }; DECLARE_DEVICE_TYPE(GDROM, gdrom_device) diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp index 9bfb19f07e4..4f42dd272b5 100644 --- a/src/mame/machine/mac.cpp +++ b/src/mame/machine/mac.cpp @@ -1482,7 +1482,6 @@ WRITE8_MEMBER(mac_state::mac_via_out_a_pmu) // printf("%02x to PM\n", data); #endif m_pm_data_send = data; - return; } WRITE8_MEMBER(mac_state::mac_via_out_b) diff --git a/src/mame/machine/jazz_mct_adr.cpp b/src/mame/machine/mct_adr.cpp index 8c4c13b325f..168b43ed7d2 100644 --- a/src/mame/machine/jazz_mct_adr.cpp +++ b/src/mame/machine/mct_adr.cpp @@ -19,6 +19,9 @@ * https://github.com/torvalds/linux/tree/master/arch/mips/jazz/ * http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arc/jazz/ * + * https://www.linux-mips.org/archives/riscy/1993-08/msg00064.html + * https://www.linux-mips.org/archives/riscy/1993-08/msg00069.html + * * TODO * - proper width dma * - dma address translation errors @@ -27,16 +30,18 @@ */ #include "emu.h" -#include "jazz_mct_adr.h" +#include "mct_adr.h" #define VERBOSE 0 #include "logmacro.h" -DEFINE_DEVICE_TYPE(JAZZ_MCT_ADR, jazz_mct_adr_device, "jazz_mct_adr", "Jazz MCT-ADR") +DEFINE_DEVICE_TYPE(MCT_ADR, mct_adr_device, "mct_adr", "MCT-ADR Address Path Controller") -jazz_mct_adr_device::jazz_mct_adr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, JAZZ_MCT_ADR, tag, owner, clock) - , m_bus(*this, finder_base::DUMMY_TAG, -1, 64) +mct_adr_device::mct_adr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, MCT_ADR, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_io_config("io", ENDIANNESS_LITTLE, 32, 32, 0) + , m_dma_config("dma", ENDIANNESS_LITTLE, 32, 32, 0, address_map_constructor(FUNC(mct_adr_device::dma), this)) , m_out_int_dma(*this) , m_out_int_device(*this) , m_out_int_timer(*this) @@ -46,7 +51,7 @@ jazz_mct_adr_device::jazz_mct_adr_device(const machine_config &mconfig, const ch { } -void jazz_mct_adr_device::map(address_map &map) +void mct_adr_device::map(address_map &map) { map(0x000, 0x007).lrw32(NAME([this] () { return m_config; }), NAME([this] (u32 data) { m_config = data; })); map(0x008, 0x00f).lr32([] () { return 1; }, "revision_level"); @@ -78,7 +83,7 @@ void jazz_mct_adr_device::map(address_map &map) { u32 const address = (m_ioc_physical_tag & ~0x1) + ((m_ioc_maint & 0x3) << 3); - m_bus->write_dword(address, data); + space(0).write_dword(address, data); } }, "io_cache_buffer_window_lo"); // io_cache_buffer_window_hi @@ -118,7 +123,22 @@ void jazz_mct_adr_device::map(address_map &map) map(0x238, 0x23b).lr32(NAME([this] () { return m_eisa_iack(); })); } -void jazz_mct_adr_device::device_start() +// HACK: this address map translates i386 bus master DMA device access (the +// SONIC network controller) to DRAM. +device_memory_interface::space_config_vector mct_adr_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(0, &m_io_config), + std::make_pair(1, &m_dma_config) + }; +} + +void mct_adr_device::dma(address_map &map) +{ + map(0x00000000U, 0xffffffffU).rw(FUNC(mct_adr_device::dma_r), FUNC(mct_adr_device::dma_w)); +} + +void mct_adr_device::device_start() { m_out_int_dma.resolve(); m_out_int_device.resolve(); @@ -131,11 +151,21 @@ void jazz_mct_adr_device::device_start() m_dma_w[i].resolve_safe(); } - m_config = 0x104; // REV1, REV2 is 0x410 - m_ioc_maint = 0; m_ioc_physical_tag = 0; m_ioc_logical_tag = 0; + + m_irq_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mct_adr_device::irq_check), this)); + m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mct_adr_device::dma_check), this)); + m_interval_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mct_adr_device::interval_timer), this)); + + m_out_int_timer_asserted = false; + m_out_int_device_asserted = false; +} + +void mct_adr_device::device_reset() +{ + m_config = 0x104; // REV1, REV2 is 0x410 m_trans_tbl_base = 0; m_trans_tbl_limit = 0; m_ioc_byte_mask = 0; @@ -146,26 +176,19 @@ void jazz_mct_adr_device::device_start() for (u32 &val : m_dma_reg) val = 0; + m_dma_interrupt_source = 0; m_memory_refresh_rate = 0x18186; m_nvram_protect = 0x7; - m_irq_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jazz_mct_adr_device::irq_check), this)); - m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jazz_mct_adr_device::dma_check), this)); - m_interval_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jazz_mct_adr_device::interval_timer), this)); - - m_out_int_timer_asserted = false; - m_out_int_device_asserted = false; -} - -void jazz_mct_adr_device::device_reset() -{ m_isr = 0; - m_imr = 0; // 0x10; + m_imr = 0x10; // firmware diagnostic expects network interrupts to be unmasked at boot m_interval_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); + + irq_check(nullptr, 0); } -void jazz_mct_adr_device::set_irq_line(int irq, int state) +void mct_adr_device::set_irq_line(int irq, int state) { if ((irq != 3) && (m_isr & (1 << irq)) ^ (state << irq)) LOG("set_irq_line %d state %d m_imr 0x%04x\n", irq, state, m_imr); @@ -178,7 +201,7 @@ void jazz_mct_adr_device::set_irq_line(int irq, int state) m_irq_check->adjust(attotime::zero); } -TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::irq_check) +TIMER_CALLBACK_MEMBER(mct_adr_device::irq_check) { if (bool(m_isr & m_imr) != m_out_int_device_asserted) { @@ -188,13 +211,10 @@ TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::irq_check) } } -u16 jazz_mct_adr_device::isr_r() +u16 mct_adr_device::isr_r() { u16 const pending = m_isr & m_imr; - // FIXME: really? - //m_out_int_device(CLEAR_LINE); - for (u16 irq = 0; irq < 16; irq++) if (BIT(pending, irq)) return (irq + 1) << 2; @@ -202,7 +222,7 @@ u16 jazz_mct_adr_device::isr_r() return 0; } -void jazz_mct_adr_device::imr_w(u16 data) +void mct_adr_device::imr_w(u16 data) { LOG("imr_w 0x%04x (%s)\n", data, machine().describe_context()); @@ -211,7 +231,7 @@ void jazz_mct_adr_device::imr_w(u16 data) m_irq_check->adjust(attotime::zero); } -TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::interval_timer) +TIMER_CALLBACK_MEMBER(mct_adr_device::interval_timer) { if (m_out_int_timer_asserted) m_out_int_timer(0); @@ -221,7 +241,7 @@ TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::interval_timer) m_out_int_timer(1); } -void jazz_mct_adr_device::set_drq_line(int channel, int state) +void mct_adr_device::set_drq_line(int channel, int state) { m_drq_active[channel] = state == ASSERT_LINE; @@ -229,7 +249,7 @@ void jazz_mct_adr_device::set_drq_line(int channel, int state) m_dma_check->adjust(attotime::zero); } -TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::dma_check) +TIMER_CALLBACK_MEMBER(mct_adr_device::dma_check) { bool active = false; @@ -257,7 +277,7 @@ TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::dma_check) // perform dma transfer if (m_dma_reg[(channel << 2) + REG_ENABLE] & DMA_DIRECTION) { - u8 const data = m_bus->read_byte(address); + u8 const data = space(0).read_byte(address); //LOG("dma_w data 0x%02x address 0x%08x\n", data, address); @@ -269,7 +289,7 @@ TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::dma_check) //LOG("dma_r data 0x%02x address 0x%08x\n", data, address); - m_bus->write_byte(address, data); + space(0).write_byte(address, data); } // increment address, decrement count @@ -294,14 +314,14 @@ TIMER_CALLBACK_MEMBER(jazz_mct_adr_device::dma_check) m_dma_check->adjust(attotime::zero); } -u32 jazz_mct_adr_device::translate_address(u32 logical_address) +u32 mct_adr_device::translate_address(u32 logical_address) { u32 page = logical_address >> 12; if (page < (m_trans_tbl_limit) >> 3) { u32 entry_address = (m_trans_tbl_base & 0x7fffffff) + page * 8; - return m_bus->read_dword(entry_address) | (logical_address & 0xfff); + return space(0).read_dword(entry_address) | (logical_address & 0xfff); } else { @@ -310,3 +330,17 @@ u32 jazz_mct_adr_device::translate_address(u32 logical_address) return 0; // FIXME: address error } } + +u32 mct_adr_device::dma_r(offs_t offset, u32 mem_mask) +{ + u32 const address = translate_address(offset << 2); + + return space(0).read_dword(address, mem_mask); +} + +void mct_adr_device::dma_w(offs_t offset, u32 data, u32 mem_mask) +{ + u32 const address = translate_address(offset << 2); + + space(0).write_dword(address, data, mem_mask); +} diff --git a/src/mame/machine/jazz_mct_adr.h b/src/mame/machine/mct_adr.h index 353b905cea2..b515274ad90 100644 --- a/src/mame/machine/jazz_mct_adr.h +++ b/src/mame/machine/mct_adr.h @@ -1,19 +1,19 @@ // license:BSD-3-Clause // copyright-holders:Patrick Mackinlay -#ifndef MAME_MACHINE_JAZZ_MCT_ADR_H -#define MAME_MACHINE_JAZZ_MCT_ADR_H +#ifndef MAME_MACHINE_MCT_ADR_H +#define MAME_MACHINE_MCT_ADR_H #pragma once -class jazz_mct_adr_device : public device_t +class mct_adr_device + : public device_t + , public device_memory_interface { public: - jazz_mct_adr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mct_adr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - template <typename T> void set_bus(T &&tag, int spacenum) { m_bus.set_tag(std::forward<T>(tag), spacenum); } - auto out_int_dma_cb() { return m_out_int_dma.bind(); } auto out_int_device_cb() { return m_out_int_device.bind(); } auto out_int_timer_cb() { return m_out_int_timer.bind(); } @@ -25,7 +25,10 @@ public: template <unsigned IRQ> DECLARE_WRITE_LINE_MEMBER(irq) { set_irq_line(IRQ, state); } template <unsigned DRQ> DECLARE_WRITE_LINE_MEMBER(drq) { set_drq_line(DRQ, state); } - virtual void map(address_map &map); + void map(address_map &map); + + u64 r4k_r(offs_t offset, u64 mem_mask) { return space(0).read_qword(offset << 3, mem_mask); } + void r4k_w(offs_t offset, u64 data, u64 mem_mask) { space(0).write_qword(offset << 3, data, mem_mask); } u16 isr_r(); u16 imr_r() { return m_imr; } @@ -36,7 +39,16 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + //virtual bool memory_translate(int spacenum, int intention, offs_t &address) override; + + u32 dma_r(offs_t offset, u32 mem_mask); + void dma_w(offs_t offset, u32 data, u32 mem_mask); + private: + void dma(address_map &map); + void set_irq_line(int number, int state); void set_drq_line(int channel, int state); @@ -46,7 +58,8 @@ private: u32 translate_address(u32 logical_address); - required_address_space m_bus; + address_space_config m_io_config; + address_space_config m_dma_config; devcb_write_line m_out_int_dma; devcb_write_line m_out_int_device; @@ -146,6 +159,6 @@ private: }; // device type definition -DECLARE_DEVICE_TYPE(JAZZ_MCT_ADR, jazz_mct_adr_device) +DECLARE_DEVICE_TYPE(MCT_ADR, mct_adr_device) -#endif // MAME_MACHINE_JAZZ_MCT_ADR_H +#endif // MAME_MACHINE_MCT_ADR_H diff --git a/src/mame/machine/megadriv.cpp b/src/mame/machine/megadriv.cpp index 495e3612a66..285d64b44f9 100644 --- a/src/mame/machine/megadriv.cpp +++ b/src/mame/machine/megadriv.cpp @@ -945,6 +945,16 @@ void md_base_state::md_ntsc(machine_config &config) m_ymsnd->add_route(1, "rspeaker", 0.50); } +void md_base_state::md2_ntsc(machine_config &config) +{ + md_ntsc(config); + + // Internalized YM3438 in VDP ASIC + YM3438(config.replace(), m_ymsnd, MASTER_CLOCK_NTSC/7); /* 7.67 MHz */ + m_ymsnd->add_route(0, "lspeaker", 0.50); + m_ymsnd->add_route(1, "rspeaker", 0.50); +} + void md_cons_state::dcat16_megadriv_base(machine_config &config) { md_ntsc(config); @@ -995,7 +1005,17 @@ void md_base_state::md_pal(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - YM2612(config, m_ymsnd, MASTER_CLOCK_NTSC/7); /* 7.67 MHz */ + YM2612(config, m_ymsnd, MASTER_CLOCK_PAL / 7); /* 7.67 MHz */ + m_ymsnd->add_route(0, "lspeaker", 0.50); + m_ymsnd->add_route(1, "rspeaker", 0.50); +} + +void md_base_state::md2_pal(machine_config &config) +{ + md_pal(config); + + // Internalized YM3438 in VDP ASIC + YM3438(config.replace(), m_ymsnd, MASTER_CLOCK_PAL / 7); /* 7.67 MHz */ m_ymsnd->add_route(0, "lspeaker", 0.50); m_ymsnd->add_route(1, "rspeaker", 0.50); } @@ -1003,7 +1023,7 @@ void md_base_state::md_pal(machine_config &config) WRITE8_MEMBER(md_base_state::megadriv_tas_callback) { - return; // writeback not allowed + // writeback not allowed } void md_base_state::megadriv_init_common() diff --git a/src/mame/machine/mmboard.cpp b/src/mame/machine/mmboard.cpp index e40c9e45514..489853a6c80 100644 --- a/src/mame/machine/mmboard.cpp +++ b/src/mame/machine/mmboard.cpp @@ -2,145 +2,114 @@ // copyright-holders:Sandro Ronco /********************************************************************** - Mephisto Sensors Board emulation - Mephisto Display Modul emulation +Hegener + Glaser Mephisto Sensors Board, for modular chesscomputers +- Modular +- Muenchen +- Exclusive + +This device can also apply to non-modular boards if I/O is similar +Bavaria board is not emulated here, additional handlers for it are in the driver. *********************************************************************/ #include "emu.h" #include "mmboard.h" -#include "sound/volt_reg.h" - -//************************************************************************** -// DEVICE DEFINITIONS -//************************************************************************** DEFINE_DEVICE_TYPE(MEPHISTO_SENSORS_BOARD, mephisto_sensors_board_device, "msboard", "Mephisto Sensors Board") DEFINE_DEVICE_TYPE(MEPHISTO_BUTTONS_BOARD, mephisto_buttons_board_device, "mbboard", "Mephisto Buttons Board") -DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODUL, mephisto_display_modul_device, "mdisplay_modul", "Mephisto Display Modul") - - -//*************************************************************************** -// IMPLEMENTATION -//*************************************************************************** //------------------------------------------------- -// device_add_mconfig - add device-specific -// machine configuration +// constructor //------------------------------------------------- -void mephisto_sensors_board_device::device_add_mconfig(machine_config &config) +mephisto_board_device::mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , m_board(*this, "board") + , m_led_pwm(*this, "led_pwm") + , m_sensordelay(attotime::from_msec(150)) + , m_led_out(*this, "led%u", 0U) + , m_disable_leds(false) { - SENSORBOARD(config, m_board); - m_board->set_type(sensorboard_device::MAGNETS); - m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); } -//------------------------------------------------- -// device_add_mconfig - add device-specific -// machine configuration -//------------------------------------------------- +mephisto_sensors_board_device::mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mephisto_board_device(mconfig, MEPHISTO_SENSORS_BOARD, tag, owner, clock) +{ +} -void mephisto_buttons_board_device::device_add_mconfig(machine_config &config) +mephisto_buttons_board_device::mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mephisto_board_device(mconfig, MEPHISTO_BUTTONS_BOARD, tag, owner, clock) { - SENSORBOARD(config, m_board); - m_board->set_type(sensorboard_device::BUTTONS); - m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); } -//************************************************************************** -// LIVE DEVICE -//************************************************************************** //------------------------------------------------- -// mephisto_board_device - constructor +// device_add_mconfig //------------------------------------------------- -mephisto_board_device::mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock) - , m_board(*this, "board") - , m_sensordelay(attotime::from_msec(150)) - , m_led(*this, "led%u", 0U) - , m_disable_leds(false) +void mephisto_sensors_board_device::device_add_mconfig(machine_config &config) { + set_config(config, sensorboard_device::MAGNETS); } -//------------------------------------------------- -// mephisto_sensors_board_device - constructor -//------------------------------------------------- - -mephisto_sensors_board_device::mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mephisto_board_device(mconfig, MEPHISTO_SENSORS_BOARD, tag, owner, clock) +void mephisto_buttons_board_device::device_add_mconfig(machine_config &config) { + set_config(config, sensorboard_device::BUTTONS); } -//------------------------------------------------- -// mephisto_buttons_board_device - constructor -//------------------------------------------------- -mephisto_buttons_board_device::mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mephisto_board_device(mconfig, MEPHISTO_BUTTONS_BOARD, tag, owner, clock) +void mephisto_board_device::set_config(machine_config &config, sensorboard_device::sb_type board_type) { + SENSORBOARD(config, m_board).set_type(board_type); + m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); + + PWM_DISPLAY(config, m_led_pwm).set_size(8, 8); + m_led_pwm->output_x().set(FUNC(mephisto_board_device::refresh_leds_w)); } + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void mephisto_board_device::device_start() { - m_led.resolve(); - m_leds_update_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mephisto_board_device::leds_update_callback), this)); - m_leds_refresh_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mephisto_board_device::leds_refresh_callback), this)); - m_leds_update_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); - m_leds_refresh_timer->adjust(attotime::from_hz(5), 0, attotime::from_hz(5)); + m_led_out.resolve(); save_item(NAME(m_mux)); - save_item(NAME(m_leds)); - save_item(NAME(m_leds_state)); + save_item(NAME(m_led_data)); m_board->set_delay(m_sensordelay); } + //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- void mephisto_board_device::device_reset() { - m_mux = 0x00; - m_leds = 0x00; - memset(m_leds_state, 0, sizeof(m_leds_state)); + m_mux = 0xff; + m_led_data = 0x00; + update_led_pwm(); } -TIMER_CALLBACK_MEMBER(mephisto_board_device::leds_update_callback) -{ - for (int i=0; i<8; i++) - for (int j=0; j<8; j++) - { - if (!m_leds_state[i*8 + j] && !BIT(m_mux, i) && BIT(m_leds, j)) - m_leds_state[i*8 + j] = 2; - } -} -TIMER_CALLBACK_MEMBER(mephisto_board_device::leds_refresh_callback) +//------------------------------------------------- +// I/O handlers +//------------------------------------------------- + +WRITE8_MEMBER( mephisto_board_device::refresh_leds_w ) { - for (int i=0; i<8; i++) - for (int j=0; j<8; j++) - { - if (!m_disable_leds) - m_led[i*8 + j] = (m_leds_state[i*8 + j] > 1) ? 1 : 0; - - if (m_leds_state[i*8 + j]) - m_leds_state[i*8 + j]--; - } + if (!m_disable_leds) + m_led_out[(offset >> 6 & 7) | (offset & 7) << 3] = data; } READ8_MEMBER( mephisto_board_device::input_r ) { uint8_t data = 0xff; - for (int i=0; i<8; i++) + for (int i = 0; i < 8; i++) if (!BIT(m_mux, i)) data &= ~m_board->read_rank(i); @@ -155,90 +124,11 @@ READ8_MEMBER( mephisto_board_device::mux_r ) WRITE8_MEMBER( mephisto_board_device::mux_w ) { m_mux = data; + update_led_pwm(); } WRITE8_MEMBER( mephisto_board_device::led_w ) { - m_leds = data; -} - - - -//------------------------------------------------- -// mephisto_display_modul_device - constructor -//------------------------------------------------- - -mephisto_display_modul_device::mephisto_display_modul_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, MEPHISTO_DISPLAY_MODUL, tag, owner, clock) - , m_lcdc(*this, "hd44780") - , m_dac(*this, "dac") -{ -} - -//------------------------------------------------- -// device_add_mconfig -//------------------------------------------------- - -void mephisto_display_modul_device::device_add_mconfig(machine_config &config) -{ - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); - screen.set_refresh_hz(50); - screen.set_size(16*6, 9*2); - screen.set_visarea(0, 16*6-1, 0, 9*2-3); - screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); - screen.set_palette("palette"); - PALETTE(config, "palette", FUNC(mephisto_display_modul_device::lcd_palette), 2); - - HD44780(config, m_lcdc, 0); - m_lcdc->set_lcd_size(2, 16); - - /* sound hardware */ - SPEAKER(config, "speaker").front_center(); - DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); - voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref")); - vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); - vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); -} - - -void mephisto_display_modul_device::lcd_palette(palette_device &palette) const -{ - palette.set_pen_color(0, rgb_t(138, 146, 148)); - palette.set_pen_color(1, rgb_t(92, 83, 88)); -} - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void mephisto_display_modul_device::device_start() -{ - save_item(NAME(m_latch)); - save_item(NAME(m_ctrl)); -} - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void mephisto_display_modul_device::device_reset() -{ - m_latch = 0; - m_ctrl = 0; -} - -WRITE8_MEMBER(mephisto_display_modul_device::latch_w) -{ - m_latch = data; -} - -WRITE8_MEMBER(mephisto_display_modul_device::io_w) -{ - if (BIT(data, 1) && !BIT(m_ctrl, 1)) - m_lcdc->write(BIT(data, 0), m_latch); - - m_dac->write(data >> 2 & 3); - - m_ctrl = data; + m_led_data = data; + update_led_pwm(); } diff --git a/src/mame/machine/mmboard.h b/src/mame/machine/mmboard.h index 554b79424db..eec9804e658 100644 --- a/src/mame/machine/mmboard.h +++ b/src/mame/machine/mmboard.h @@ -2,7 +2,7 @@ // copyright-holders:Sandro Ronco /********************************************************************** - Mephisto Modular + Mephisto Sensors Board *********************************************************************/ @@ -11,18 +11,9 @@ #pragma once - #include "machine/sensorboard.h" -#include "video/hd44780.h" -#include "sound/dac.h" -#include "emupal.h" -#include "screen.h" -#include "speaker.h" - +#include "video/pwm.h" -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** // ======================> mephisto_board_device @@ -33,32 +24,32 @@ public: mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - void set_disable_leds(int _disable_leds) { m_disable_leds = _disable_leds; } - void set_delay(attotime _sensordelay) { m_sensordelay = _sensordelay; } + void set_disable_leds(int disable_leds) { m_disable_leds = disable_leds; } + void set_delay(attotime sensordelay) { m_sensordelay = sensordelay; } + + sensorboard_device *get() { return m_board; } DECLARE_READ8_MEMBER(input_r); DECLARE_WRITE8_MEMBER(led_w); DECLARE_READ8_MEMBER(mux_r); DECLARE_WRITE8_MEMBER(mux_w); - TIMER_CALLBACK_MEMBER(leds_update_callback); - TIMER_CALLBACK_MEMBER(leds_refresh_callback); - protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; -protected: + void set_config(machine_config &config, sensorboard_device::sb_type board_type); + DECLARE_WRITE8_MEMBER(refresh_leds_w); + void update_led_pwm() { m_led_pwm->matrix(~m_mux, m_led_data); } + required_device<sensorboard_device> m_board; + required_device<pwm_display_device> m_led_pwm; attotime m_sensordelay; - output_finder<64> m_led; - emu_timer * m_leds_update_timer; - emu_timer * m_leds_refresh_timer; + output_finder<64> m_led_out; bool m_disable_leds; + uint8_t m_led_data; uint8_t m_mux; - uint8_t m_leds; - uint8_t m_leds_state[64]; }; // ======================> mephisto_sensors_board_device @@ -70,7 +61,6 @@ public: mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); protected: - // optional information overrides virtual void device_add_mconfig(machine_config &config) override; }; @@ -85,43 +75,14 @@ public: mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); protected: - // optional information overrides virtual void device_add_mconfig(machine_config &config) override; }; -// ======================> mephisto_display_modul_device - -class mephisto_display_modul_device : public device_t -{ -public: - // construction/destruction - mephisto_display_modul_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - - DECLARE_WRITE8_MEMBER(latch_w); - DECLARE_WRITE8_MEMBER(io_w); - -protected: - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - virtual void device_add_mconfig(machine_config &config) override; - - void lcd_palette(palette_device &palette) const; - -private: - optional_device<hd44780_device> m_lcdc; - required_device<dac_byte_interface> m_dac; - uint8_t m_latch; - uint8_t m_ctrl; -}; - - // device type definition DECLARE_DEVICE_TYPE(MEPHISTO_SENSORS_BOARD, mephisto_sensors_board_device) DECLARE_DEVICE_TYPE(MEPHISTO_BUTTONS_BOARD, mephisto_buttons_board_device) -DECLARE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODUL, mephisto_display_modul_device) #endif // MAME_MACHINE_MMBOARD_H diff --git a/src/mame/machine/model1.cpp b/src/mame/machine/model1.cpp index 66185ad8849..5cf0749eb53 100644 --- a/src/mame/machine/model1.cpp +++ b/src/mame/machine/model1.cpp @@ -156,18 +156,19 @@ READ32_MEMBER(model1_state::copro_ramadr_r) WRITE32_MEMBER(model1_state::copro_ramdata_w) { - m_check_pram.emplace_back(racc{ m_copro_ram_adr[offset >> 3], data, true }); - COMBINE_DATA(&m_copro_ram_data[m_copro_ram_adr[offset >> 3] & 0x1fff]); + if(m_copro_ram_adr[offset >> 3] & 0x40000) { + COMBINE_DATA(&m_copro_ram_data[0x1000 | (m_copro_ram_adr[offset >> 3] & 0x1fff)]); + } else { + COMBINE_DATA(&m_copro_ram_data[m_copro_ram_adr[offset >> 3] & 0x1fff]); + } m_copro_ram_adr[offset >> 3] ++; } READ32_MEMBER(model1_state::copro_ramdata_r) { - u32 val = m_copro_ram_data[m_copro_ram_adr[offset >> 3] & 0x1fff]; - if(!machine().side_effects_disabled()) { - m_check_pram.emplace_back(racc{ m_copro_ram_adr[offset >> 3], val, false }); + u32 val = (m_copro_ram_adr[offset >> 3] & 0x40000) ? m_copro_ram_data[0x1000 | (m_copro_ram_adr[offset >> 3] & 0x1fff)] : m_copro_ram_data[m_copro_ram_adr[offset >> 3] & 0x1fff]; + if(!machine().side_effects_disabled()) m_copro_ram_adr[offset >> 3] ++; - } return val; } @@ -231,7 +232,7 @@ WRITE32_MEMBER(model1_state::copro_atan_w) READ32_MEMBER(model1_state::copro_atan_r) { - u32 idx = m_copro_atan_base[3]; + u32 idx = m_copro_atan_base[3] & 0xffff; if(idx & 0xc000) idx = 0x3fff; u32 result = m_copro_tables[idx | 0x4000]; @@ -239,20 +240,20 @@ READ32_MEMBER(model1_state::copro_atan_r) // Correct for table bug, it seems that the hardware does something equivalent somehow, // or maybe there are boards with updated opr roms - u16 dt = (result >> 16) + result; - if(dt & 0x001) { + u16 dt = (result >> 16) + result; + if(dt & 0x001) { if((result & 0x00f) == 0x00e) result -= 0x00000001; else result -= 0x00010000; } - if(dt & 0x010) { + if(dt & 0x010) { if((result & 0x0f0) == 0x0e0) result -= 0x00000010; else result -= 0x00100000; } - if(dt & 0x100) { + if(dt & 0x100) { if((result & 0xf00) == 0xe00) result -= 0x00000100; else diff --git a/src/mame/machine/naomig1.cpp b/src/mame/machine/naomig1.cpp index d869554933d..54786ffd025 100644 --- a/src/mame/machine/naomig1.cpp +++ b/src/mame/machine/naomig1.cpp @@ -29,6 +29,8 @@ void naomi_g1_device::amap(address_map &map) naomi_g1_device::naomi_g1_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , irq_cb(*this) + , ext_irq_cb(*this) + , reset_out_cb(*this) { } @@ -36,6 +38,8 @@ void naomi_g1_device::device_start() { timer = timer_alloc(G1_TIMER_ID); irq_cb.resolve_safe(); + ext_irq_cb.resolve_safe(); + reset_out_cb.resolve_safe(); save_item(NAME(gdstar)); save_item(NAME(gdlen)); @@ -51,6 +55,7 @@ void naomi_g1_device::device_reset() gddir = 0; gden = 0; gdst = 0; + set_ext_irq(CLEAR_LINE); } void naomi_g1_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) diff --git a/src/mame/machine/naomig1.h b/src/mame/machine/naomig1.h index 8533b72b66e..96807dce286 100644 --- a/src/mame/machine/naomig1.h +++ b/src/mame/machine/naomig1.h @@ -17,10 +17,12 @@ public: typedef delegate<void (uint32_t main_adr, void *dma_ptr, uint32_t length, uint32_t size, bool to_mainram)> dma_cb; auto irq_callback() { return irq_cb.bind(); } + auto ext_irq_callback() { return ext_irq_cb.bind(); } + auto reset_out_callback() { return reset_out_cb.bind(); } void set_dma_cb(dma_cb cb) { _dma_cb = cb; } - void amap(address_map &map); - virtual void submap(address_map &map) = 0; + void amap(address_map &map); // for range 0x005f7400-0x005f74ff + virtual void submap(address_map &map) = 0; // for range 0x005f7000-0x005f70ff DECLARE_READ32_MEMBER(sb_gdstar_r); // 5f7404 DECLARE_WRITE32_MEMBER(sb_gdstar_w); // 5f7404 @@ -60,11 +62,16 @@ protected: virtual void dma_get_position(uint8_t *&base, uint32_t &limit, bool to_maincpu) = 0; virtual void dma_advance(uint32_t size) = 0; + void set_ext_irq(int state) { ext_irq_cb(state); } + void set_reset_out() { reset_out_cb(ASSERT_LINE); } + private: uint32_t gdstar, gdlen, gddir, gden, gdst; emu_timer *timer; devcb_write8 irq_cb; + devcb_write_line ext_irq_cb; + devcb_write_line reset_out_cb; dma_cb _dma_cb; void dma(void *dma_ptr, uint32_t main_adr, uint32_t size, bool to_mainram); diff --git a/src/mame/machine/naomigd.cpp b/src/mame/machine/naomigd.cpp index 8274fd33bf7..e4bbea9962e 100644 --- a/src/mame/machine/naomigd.cpp +++ b/src/mame/machine/naomigd.cpp @@ -405,17 +405,342 @@ naomi_gdrom_board::naomi_gdrom_board(const machine_config &mconfig, const char * : naomi_board(mconfig, NAOMI_GDROM_BOARD, tag, owner, clock), m_maincpu(*this, "dimmcpu"), m_securitycpu(*this, "pic"), - picdata(*this, finder_base::DUMMY_TAG) + m_i2c0(*this, "i2c_0"), + m_i2c1(*this, "i2c_1"), + m_eeprom(*this, "eeprom"), + m_315_6154(*this, "northbridge"), + m_ide(*this, "ide"), + picdata(*this, finder_base::DUMMY_TAG), + dimm_command(0xffff), + dimm_offsetl(0xffff), + dimm_parameterl(0xffff), + dimm_parameterh(0xffff), + dimm_status(0xffff), + dimm_control(0), + sh4_unknown(0), + dimm_des_key(0) { image_tag = nullptr; + picbus = 0; + picbus_pullup = 0xf; + picbus_io[0] = 0xf; + picbus_io[1] = 0xf; + picbus_used = false; } -void naomi_gdrom_board::sh4_map(address_map& map) +void naomi_gdrom_board::submap(address_map &map) { - map(0x00000000, 0x001fffff).rom().region("bios", 0); + naomi_board::submap(map); + map(0x3c / 2, 0x3c / 2 + 1).rw(FUNC(naomi_gdrom_board::dimm_command_r), FUNC(naomi_gdrom_board::dimm_command_w)); + map(0x40 / 2, 0x40 / 2 + 1).rw(FUNC(naomi_gdrom_board::dimm_offsetl_r), FUNC(naomi_gdrom_board::dimm_offsetl_w)); + map(0x44 / 2, 0x44 / 2 + 1).rw(FUNC(naomi_gdrom_board::dimm_parameterl_r), FUNC(naomi_gdrom_board::dimm_parameterl_w)); + map(0x48 / 2, 0x48 / 2 + 1).rw(FUNC(naomi_gdrom_board::dimm_parameterh_r), FUNC(naomi_gdrom_board::dimm_parameterh_w)); + map(0x4c / 2, 0x4c / 2 + 1).rw(FUNC(naomi_gdrom_board::dimm_status_r), FUNC(naomi_gdrom_board::dimm_status_w)); +} + +void naomi_gdrom_board::sh4_map(address_map &map) +{ + map(0x00000000, 0x001fffff).mirror(0xa0000000).rom().region("bios", 0); + map(0x04000000, 0x040000ff).rw(m_315_6154, FUNC(sega_315_6154_device::registers_r), FUNC(sega_315_6154_device::registers_w)); + map(0x0c000000, 0x0cffffff).ram().share("sh4sdram"); + map(0x10000000, 0x103fffff).ram().share("6154sdram"); + map(0x14000000, 0x17ffffff).rw(m_315_6154, FUNC(sega_315_6154_device::aperture_r<0>), FUNC(sega_315_6154_device::aperture_w<0>)); + map(0x18000000, 0x1bffffff).rw(m_315_6154, FUNC(sega_315_6154_device::aperture_r<1>), FUNC(sega_315_6154_device::aperture_w<1>)); map.unmap_value_high(); } +void naomi_gdrom_board::sh4_io_map(address_map &map) +{ + map(0x00, 0x0f).rw(FUNC(naomi_gdrom_board::i2cmem_dimm_r), FUNC(naomi_gdrom_board::i2cmem_dimm_w)); +} + +void naomi_gdrom_board::pci_map(address_map& map) +{ + map(0x00000000, 0x00000003).rw(FUNC(naomi_gdrom_board::sh4_unknown_r), FUNC(naomi_gdrom_board::sh4_unknown_w)); + map(0x00000014, 0x00000017).rw(FUNC(naomi_gdrom_board::sh4_command_r), FUNC(naomi_gdrom_board::sh4_command_w)); + map(0x00000018, 0x0000001b).rw(FUNC(naomi_gdrom_board::sh4_offsetl_r), FUNC(naomi_gdrom_board::sh4_offsetl_w)); + map(0x0000001c, 0x0000001f).rw(FUNC(naomi_gdrom_board::sh4_parameterl_r), FUNC(naomi_gdrom_board::sh4_parameterl_w)); + map(0x00000020, 0x00000023).rw(FUNC(naomi_gdrom_board::sh4_parameterh_r), FUNC(naomi_gdrom_board::sh4_parameterh_w)); + map(0x00000024, 0x00000027).rw(FUNC(naomi_gdrom_board::sh4_status_r), FUNC(naomi_gdrom_board::sh4_status_w)); + map(0x00000028, 0x0000002b).rw(FUNC(naomi_gdrom_board::sh4_control_r), FUNC(naomi_gdrom_board::sh4_control_w)); + map(0x0000002c, 0x0000002f).lr32([]() { return 0x0c; }, "Constant 0x0c"); // 0x0a or 0x0e possible too + map(0x00000030, 0x00000033).rw(FUNC(naomi_gdrom_board::sh4_des_keyl_r), FUNC(naomi_gdrom_board::sh4_des_keyl_w)); + map(0x00000034, 0x00000037).rw(FUNC(naomi_gdrom_board::sh4_des_keyh_r), FUNC(naomi_gdrom_board::sh4_des_keyh_w)); + map(0x70000000, 0x70ffffff).ram().share("sh4sdram"); + map(0x78000000, 0x783fffff).ram().share("6154sdram"); + map(0xc00001c0, 0xc00001df).rw(FUNC(naomi_gdrom_board::ide_cs0_r), FUNC(naomi_gdrom_board::ide_cs0_w)); + map(0xc00003b0, 0xc00003cf).rw(FUNC(naomi_gdrom_board::ide_cs1_r), FUNC(naomi_gdrom_board::ide_cs1_w)); + map(0xc000cc00, 0xc000cc0f).rw(m_ide, FUNC(bus_master_ide_controller_device::bmdma_r), FUNC(bus_master_ide_controller_device::bmdma_w)); +} + +void naomi_gdrom_board::pci_config_map(address_map& map) +{ + map(0x1000, 0x1003).lr32([]() { return 0x189d11db; }, "Constant 0x189d11db"); // 0x10001022 or 0x11720001 possible too +} + +WRITE16_MEMBER(naomi_gdrom_board::dimm_command_w) +{ + dimm_command = data; +} + +READ16_MEMBER(naomi_gdrom_board::dimm_command_r) +{ + return dimm_command & 0xffff; +} + +WRITE16_MEMBER(naomi_gdrom_board::dimm_offsetl_w) +{ + dimm_offsetl = data; +} + +READ16_MEMBER(naomi_gdrom_board::dimm_offsetl_r) +{ + return dimm_offsetl & 0xffff; +} + +WRITE16_MEMBER(naomi_gdrom_board::dimm_parameterl_w) +{ + dimm_parameterl = data; +} + +READ16_MEMBER(naomi_gdrom_board::dimm_parameterl_r) +{ + return dimm_parameterl & 0xffff; +} + +WRITE16_MEMBER(naomi_gdrom_board::dimm_parameterh_w) +{ + dimm_parameterh = data; +} + +READ16_MEMBER(naomi_gdrom_board::dimm_parameterh_r) +{ + return dimm_parameterh & 0xffff; +} + +WRITE16_MEMBER(naomi_gdrom_board::dimm_status_w) +{ + dimm_status = data; + if (dimm_status & 0x001) + m_maincpu->set_input_line(SH4_IRL3, CLEAR_LINE); + else + m_maincpu->set_input_line(SH4_IRL3, ASSERT_LINE); + if (dimm_status & 0x100) + set_ext_irq(CLEAR_LINE); + else + set_ext_irq(ASSERT_LINE); +} + +READ16_MEMBER(naomi_gdrom_board::dimm_status_r) +{ + return dimm_status & 0xffff; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_unknown_w) +{ + sh4_unknown = data; +} + +READ32_MEMBER(naomi_gdrom_board::sh4_unknown_r) +{ + return sh4_unknown; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_command_w) +{ + dimm_command = data; +} + +READ32_MEMBER(naomi_gdrom_board::sh4_command_r) +{ + return dimm_command; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_offsetl_w) +{ + dimm_offsetl = data; +} + +READ32_MEMBER(naomi_gdrom_board::sh4_offsetl_r) +{ + return dimm_offsetl; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_parameterl_w) +{ + dimm_parameterl = data; +} + +READ32_MEMBER(naomi_gdrom_board::sh4_parameterl_r) +{ + return dimm_parameterl; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_parameterh_w) +{ + dimm_parameterh = data; +} + +READ32_MEMBER(naomi_gdrom_board::sh4_parameterh_r) +{ + return dimm_parameterh; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_status_w) +{ + dimm_status = data; + if (dimm_status & 0x001) + m_maincpu->set_input_line(SH4_IRL3, CLEAR_LINE); + else + m_maincpu->set_input_line(SH4_IRL3, ASSERT_LINE); + if (dimm_status & 0x100) + set_ext_irq(CLEAR_LINE); + else + set_ext_irq(ASSERT_LINE); +} + +READ32_MEMBER(naomi_gdrom_board::sh4_status_r) +{ + return dimm_status; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_control_w) +{ + uint32_t old = dimm_control; + + dimm_control = data; + if (dimm_control & 2) + m_315_6154->memory()->unmap_readwrite(0x10000000, 0x10000000 + dimm_data_size - 1); + else + m_315_6154->memory()->install_ram(0x10000000, 0x10000000 + dimm_data_size - 1, dimm_des_data); + if (((old & 1) == 0) && ((dimm_control & 1) == 1)) + set_reset_out(); +} + +READ32_MEMBER(naomi_gdrom_board::sh4_control_r) +{ + return dimm_control; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_des_keyl_w) +{ + dimm_des_key = (dimm_des_key & 0xffffffff00000000) | (uint64_t)data; +} + +READ32_MEMBER(naomi_gdrom_board::sh4_des_keyl_r) +{ + return (uint32_t)dimm_des_key; +} + +WRITE32_MEMBER(naomi_gdrom_board::sh4_des_keyh_w) +{ + dimm_des_key = (dimm_des_key & 0xffffffff) | ((uint64_t)data << 32); +} + +READ32_MEMBER(naomi_gdrom_board::sh4_des_keyh_r) +{ + return (uint32_t)(dimm_des_key >> 32); +} + +READ64_MEMBER(naomi_gdrom_board::i2cmem_dimm_r) +{ + uint8_t ret; + + ret = m_i2c0->read_sda(); + ret |= m_i2c1->read_sda(); + ret = ret << 1; + if (picbus_used == true) + ret |= ((picbus | picbus_pullup) & 0xf) << 2; + else + ret |= m_eeprom->do_read() << 5; + return ret; +} + +WRITE64_MEMBER(naomi_gdrom_board::i2cmem_dimm_w) +{ + if (data & 0x40000) + { + m_i2c0->write_sda((data & 0x2) ? ASSERT_LINE : CLEAR_LINE); + m_i2c1->write_sda((data & 0x2) ? ASSERT_LINE : CLEAR_LINE); + } + m_i2c0->write_scl((data & 0x1) ? ASSERT_LINE : CLEAR_LINE); + m_i2c1->write_scl((data & 0x1) ? ASSERT_LINE : CLEAR_LINE); + if (data & 0x0200) + { + picbus_used = true; + picbus_io[0] = (uint8_t)(~data >> (16 + 5 * 2 - 3)) & 0x8; // clock only for now + picbus = (data >> 2) & 0xf; + picbus_pullup = (picbus_io[0] & picbus_io[1]) & 0xf; // high if both are inputs + m_maincpu->abort_timeslice(); + machine().scheduler().boost_interleave(attotime::zero, attotime::from_msec(1)); + } + else + { + picbus_used = false; + m_eeprom->di_write((data & 0x4) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->cs_write((data & 0x10) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->clk_write((data & 0x8) ? ASSERT_LINE : CLEAR_LINE); + } +} + +READ32_MEMBER(naomi_gdrom_board::ide_cs0_r) +{ + const int o = offset >> 2; + const int r = (offset & 3) << 3; + + return m_ide->cs0_r(space, o, mem_mask << r) >> r; +} + +READ32_MEMBER(naomi_gdrom_board::ide_cs1_r) +{ + const int o = offset >> 2; + const int r = (offset & 3) << 3; + + return m_ide->cs1_r(space, o, mem_mask << r) >> r; +} + +WRITE32_MEMBER(naomi_gdrom_board::ide_cs0_w) +{ + const int o = offset >> 2; + const int r = (offset & 3) << 3; + + m_ide->cs0_w(space, o, data << r, mem_mask << r); +} + +WRITE32_MEMBER(naomi_gdrom_board::ide_cs1_w) +{ + const int o = offset >> 2; + const int r = (offset & 3) << 3; + + m_ide->cs1_w(space, o, data << r, mem_mask << r); +} + +void naomi_gdrom_board::pic_map(address_map &map) +{ + map(0x00, 0x1f).rw(FUNC(naomi_gdrom_board::pic_dimm_r), FUNC(naomi_gdrom_board::pic_dimm_w)); +} + +READ8_MEMBER(naomi_gdrom_board::pic_dimm_r) +{ + if (offset == 1) + return picbus | picbus_pullup; + return 0; +} + +WRITE8_MEMBER(naomi_gdrom_board::pic_dimm_w) +{ + if (offset == 1) + { + picbus = data; + m_securitycpu->abort_timeslice(); + } + if (offset == 3) + { + picbus_io[1] = data; // for each bit specify direction, 0 out 1 in + picbus_pullup = (picbus_io[0] & picbus_io[1]) & 0xf; // high if both are inputs + } +} + void naomi_gdrom_board::find_file(const char *name, const uint8_t *dir_sector, uint32_t &file_start, uint32_t &file_size) { file_start = 0; @@ -465,6 +790,7 @@ void naomi_gdrom_board::device_start() naomi_board::device_start(); dimm_data = nullptr; + dimm_des_data = nullptr; dimm_data_size = 0; char name[128]; @@ -474,6 +800,15 @@ void naomi_gdrom_board::device_start() uint8_t netpic = 0; + logerror("Work mode is %d\n", work_mode); + if (work_mode != 0) + { + dimm_command = 0; + dimm_offsetl = 0; + dimm_parameterl = 0; + dimm_parameterh = 0; + } + if(picdata) { if(picdata.length() >= 0x4000) { printf("Real PIC binary found\n"); @@ -491,10 +826,11 @@ void naomi_gdrom_board::device_start() netpic = picdata[0x6ee]; // set data for security pic rom - memcpy((uint8_t*)m_securitycpu->space(AS_PROGRAM).get_read_ptr(0), picdata, 0x400); + address_space &ps = m_securitycpu->space(AS_PROGRAM); + memcpy((uint8_t*)ps.get_read_ptr(0), picdata, 0x1000); } else { // use extracted pic data - // printf("This PIC key hasn't been converted to a proper PIC binary yet!\n"); + // printf("This PIC key hasn't been converted to a proper PIC binary yet!\n"); memcpy(name, picdata+33, 7); memcpy(name+7, picdata+25, 7); @@ -568,22 +904,26 @@ void naomi_gdrom_board::device_start() uint32_t file_rounded_size = (file_size + 2047) & -2048; for (dimm_data_size = 4096; dimm_data_size < file_rounded_size; dimm_data_size <<= 1); dimm_data = auto_alloc_array(machine(), uint8_t, dimm_data_size); + if (work_mode == 0) + dimm_des_data = dimm_data; + else + dimm_des_data = auto_alloc_array(machine(), uint8_t, dimm_data_size); if (dimm_data_size != file_rounded_size) memset(dimm_data + file_rounded_size, 0, dimm_data_size - file_rounded_size); - // read encrypted data into dimm_data + // read encrypted data into dimm_des_data uint32_t sectors = file_rounded_size / 2048; for (uint32_t sec = 0; sec != sectors; sec++) - cdrom_read_data(gdromfile, file_start + sec, dimm_data + 2048 * sec, CD_TRACK_MODE1); + cdrom_read_data(gdromfile, file_start + sec, dimm_des_data + 2048 * sec, CD_TRACK_MODE1); uint32_t des_subkeys[32]; des_generate_subkeys(rev64(key), des_subkeys); + // decrypt read data from dimm_des_data to dimm_data for (int i = 0; i < file_rounded_size; i += 8) - write_from_qword(dimm_data + i, rev64(des_encrypt_decrypt(true, rev64(read_to_qword(dimm_data + i)), des_subkeys))); + write_from_qword(dimm_data + i, rev64(des_encrypt_decrypt(true, rev64(read_to_qword(dimm_des_data + i)), des_subkeys))); } - // decrypt loaded data cdrom_close(gdromfile); if(!dimm_data) @@ -591,6 +931,18 @@ void naomi_gdrom_board::device_start() } save_item(NAME(dimm_cur_address)); + save_item(NAME(picbus)); + save_item(NAME(picbus_pullup)); + save_item(NAME(picbus_io)); + save_item(NAME(picbus_used)); + save_item(NAME(dimm_command)); + save_item(NAME(dimm_offsetl)); + save_item(NAME(dimm_parameterl)); + save_item(NAME(dimm_parameterh)); + save_item(NAME(dimm_status)); + save_item(NAME(dimm_control)); + save_item(NAME(sh4_unknown)); + save_item(NAME(dimm_des_key)); } void naomi_gdrom_board::device_reset() @@ -598,6 +950,8 @@ void naomi_gdrom_board::device_reset() naomi_board::device_reset(); dimm_cur_address = 0; + if (work_mode != 0) + m_315_6154->memory()->install_ram(0x10000000, 0x10000000 + dimm_data_size - 1, dimm_des_data); } void naomi_gdrom_board::board_setup_address(uint32_t address, bool is_dma) @@ -618,9 +972,15 @@ void naomi_gdrom_board::board_advance(uint32_t size) dimm_cur_address %= dimm_data_size; } +static void gdrom_devices(device_slot_interface& device) +{ + device.option_add(":gdrom", GDROM); +} + #define CPU_CLOCK 200000000 // need to set the correct value here +#define PIC_CLOCK 20000000 // and here -void naomi_gdrom_board::device_add_mconfig(machine_config& config) +void naomi_gdrom_board::device_add_mconfig(machine_config &config) { SH4LE(config, m_maincpu, CPU_CLOCK); m_maincpu->set_md(0, 1); @@ -634,9 +994,28 @@ void naomi_gdrom_board::device_add_mconfig(machine_config& config) m_maincpu->set_md(8, 0); m_maincpu->set_sh4_clock(CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &naomi_gdrom_board::sh4_map); - m_maincpu->set_disable(); - PIC16C621A(config, m_securitycpu, 1000000); // need to set the correct value for clock - m_securitycpu->set_disable(); + m_maincpu->set_addrmap(AS_IO, &naomi_gdrom_board::sh4_io_map); + SEGA315_6154(config, m_315_6154, 0); + m_315_6154->set_addrmap(sega_315_6154_device::AS_PCI_MEMORY, &naomi_gdrom_board::pci_map); + m_315_6154->set_addrmap(sega_315_6154_device::AS_PCI_CONFIGURATION, &naomi_gdrom_board::pci_config_map); + BUS_MASTER_IDE_CONTROLLER(config, m_ide).options(gdrom_devices, ":gdrom", nullptr, true); + m_ide->irq_handler().set_inputline(m_maincpu, SH4_IRL2); + m_ide->set_bus_master_space(m_315_6154, sega_315_6154_device::AS_PCI_MEMORY); + PIC16C622(config, m_securitycpu, PIC_CLOCK); + m_securitycpu->set_addrmap(AS_IO, &naomi_gdrom_board::pic_map); + m_securitycpu->set_config(0x3fff - 0x04); + I2C_24C01(config, m_i2c0, 0); + m_i2c0->set_e0(0); + m_i2c0->set_wc(1); + I2C_24C01(config, m_i2c1, 0); + m_i2c1->set_e0(1); + m_i2c1->set_wc(1); + EEPROM_93C46_8BIT(config, m_eeprom, 0); + if (work_mode == 0) + { + m_maincpu->set_disable(); + m_securitycpu->set_disable(); + } } // DIMM firmwares: @@ -690,7 +1069,13 @@ ROM_START( dimm ) ROMX_LOAD( "401_203.bin", 0x000000, 0x200000, CRC(a738ea1c) SHA1(edb52597108462bcea8eb2a47c19e51e5fb60638), ROM_BIOS(7)) // dynamically filled with data - ROM_REGION(0x400, "pic", ROMREGION_ERASE00) + ROM_REGION(0x1000, "pic", ROMREGION_ERASE00) + ROM_REGION(0x80, "i2c_0", ROMREGION_ERASE00) + ROM_LOAD("dimmspd.bin", 0x00, 0x80, CRC(45dac6d7) SHA1(4548675f8d31348fa6828d5b4f247af1f072b62d)) + ROM_REGION(0x80, "i2c_1", ROMREGION_ERASE00) + ROM_LOAD("dimmspd.bin", 0x00, 0x80, CRC(45dac6d7) SHA1(4548675f8d31348fa6828d5b4f247af1f072b62d)) + ROM_REGION(0x80, "eeprom", ROMREGION_ERASE00) + ROM_LOAD("93c46.bin", 0x00, 0x80, CRC(daafbccd) SHA1(1e39983779a62ebc6801ec6f2a5138717a7a5259)) ROM_END const tiny_rom_entry *naomi_gdrom_board::device_rom_region() const diff --git a/src/mame/machine/naomigd.h b/src/mame/machine/naomigd.h index 35cb3614f6c..5756fe4585c 100644 --- a/src/mame/machine/naomigd.h +++ b/src/mame/machine/naomigd.h @@ -7,7 +7,11 @@ #include "machine/naomibd.h" #include "cpu/pic16c62x/pic16c62x.h" - +#include "machine/i2cmem.h" +#include "machine/eepromser.h" +#include "machine/315-6154.h" +#include "machine/idectrl.h" +#include "machine/gdrom.h" class naomi_gdrom_board : public naomi_board { @@ -32,7 +36,12 @@ public: naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_add_mconfig(machine_config &config) override; + virtual void submap(address_map& map) override; void sh4_map(address_map &map); + void sh4_io_map(address_map &map); + void pic_map(address_map &map); + void pci_map(address_map &map); + void pci_config_map(address_map &map); void set_image_tag(const char *_image_tag) { @@ -43,6 +52,46 @@ public: virtual const tiny_rom_entry *device_rom_region() const override; + DECLARE_WRITE16_MEMBER(dimm_command_w); // 5f703c + DECLARE_READ16_MEMBER(dimm_command_r); + DECLARE_WRITE16_MEMBER(dimm_offsetl_w); // 5f7040 + DECLARE_READ16_MEMBER(dimm_offsetl_r); + DECLARE_WRITE16_MEMBER(dimm_parameterl_w); // 5f7044 + DECLARE_READ16_MEMBER(dimm_parameterl_r); + DECLARE_WRITE16_MEMBER(dimm_parameterh_w); // 5f7048 + DECLARE_READ16_MEMBER(dimm_parameterh_r); + DECLARE_WRITE16_MEMBER(dimm_status_w); // 5f704c + DECLARE_READ16_MEMBER(dimm_status_r); + + DECLARE_WRITE32_MEMBER(sh4_unknown_w); // 14000000 + DECLARE_READ32_MEMBER(sh4_unknown_r); + DECLARE_WRITE32_MEMBER(sh4_command_w); // 14000014 + DECLARE_READ32_MEMBER(sh4_command_r); + DECLARE_WRITE32_MEMBER(sh4_offsetl_w); // 14000018 + DECLARE_READ32_MEMBER(sh4_offsetl_r); + DECLARE_WRITE32_MEMBER(sh4_parameterl_w); // 1400001c + DECLARE_READ32_MEMBER(sh4_parameterl_r); + DECLARE_WRITE32_MEMBER(sh4_parameterh_w); // 14000020 + DECLARE_READ32_MEMBER(sh4_parameterh_r); + DECLARE_WRITE32_MEMBER(sh4_status_w); // 14000024 + DECLARE_READ32_MEMBER(sh4_status_r); + DECLARE_WRITE32_MEMBER(sh4_control_w); // 14000028 + DECLARE_READ32_MEMBER(sh4_control_r); + DECLARE_WRITE32_MEMBER(sh4_des_keyl_w); // 14000030 + DECLARE_READ32_MEMBER(sh4_des_keyl_r); + DECLARE_WRITE32_MEMBER(sh4_des_keyh_w); // 14000034 + DECLARE_READ32_MEMBER(sh4_des_keyh_r); + + DECLARE_READ64_MEMBER(i2cmem_dimm_r); + DECLARE_WRITE64_MEMBER(i2cmem_dimm_w); + DECLARE_READ8_MEMBER(pic_dimm_r); + DECLARE_WRITE8_MEMBER(pic_dimm_w); + + DECLARE_READ32_MEMBER(ide_cs0_r); + DECLARE_READ32_MEMBER(ide_cs1_r); + DECLARE_WRITE32_MEMBER(ide_cs0_w); + DECLARE_WRITE32_MEMBER(ide_cs1_w); + protected: virtual void device_start() override; virtual void device_reset() override; @@ -53,16 +102,35 @@ protected: private: enum { FILENAME_LENGTH=24 }; + const int work_mode = 0; // set to 1 and rebuild to enable the cpus required_device<sh4_device> m_maincpu; - required_device<pic16c621a_device> m_securitycpu; + required_device<pic16c622_device> m_securitycpu; + required_device<i2cmem_device> m_i2c0; + required_device<i2cmem_device> m_i2c1; + required_device<eeprom_serial_93cxx_device> m_eeprom; + required_device<sega_315_6154_device> m_315_6154; + required_device<bus_master_ide_controller_device> m_ide; const char *image_tag; optional_region_ptr<uint8_t> picdata; uint32_t dimm_cur_address; + uint8_t picbus; + uint8_t picbus_pullup; + uint8_t picbus_io[2]; // 0 for sh4, 1 for pic + bool picbus_used; + uint32_t dimm_command; + uint32_t dimm_offsetl; + uint32_t dimm_parameterl; + uint32_t dimm_parameterh; + uint32_t dimm_status; + uint32_t dimm_control; + uint32_t sh4_unknown; + uint64_t dimm_des_key; // Note: voluntarily not saved into the state + uint8_t *dimm_des_data; uint8_t *dimm_data; uint32_t dimm_data_size; diff --git a/src/mame/machine/nb1414m4.cpp b/src/mame/machine/nb1414m4.cpp index 94ee100f87c..2967ceb58bd 100644 --- a/src/mame/machine/nb1414m4.cpp +++ b/src/mame/machine/nb1414m4.cpp @@ -6,18 +6,17 @@ Nichibutsu 1414M4 device emulation Written by Angelo Salese, based on researches by Tomasz Slanina with Legion -This is some fancy blitter DMA or MCU or even a discrete structure that copies text strings to a 8-bit text layer in +This is some fancy blitter DMA or MCU or even a discrete structure that copies text strings to a 8-bit text layer in various Nihon Bussan games; TODO: -- Identify what exactly this "device" is; -- The overlying text layer should actually be a base device for this (and used where not applicable like galivan, +- Identify what exactly this "device" is; +- The overlying text layer should actually be a base device for this (and used where not applicable like galivan, armedf and bigfightr); - Command triggering condition not understood (and diverges between galivan.cpp and armedf.cpp); - where is the condition that makes "insert coin" text to properly blink? - first byte meaning is completely unknown; - Ninja Emaki triggers unknown commands 0x8000 & 0xff20; -- Ninja Emaki continue screen is corrupt; Notes: - Just before any string in the "MCU" rom, there's a control byte, this meaning is as follows: @@ -48,7 +47,11 @@ nb1414m4_device::nb1414m4_device(const machine_config &mconfig, const char *tag, void nb1414m4_device::device_start() { + m_previous_0200_command = 0xffff; + m_previous_0200_command_frame = 0; m_in_game = false; + save_item(NAME(m_previous_0200_command)); + save_item(NAME(m_previous_0200_command_frame)); save_item(NAME(m_in_game)); } @@ -58,6 +61,8 @@ void nb1414m4_device::device_start() void nb1414m4_device::device_reset() { + m_previous_0200_command = 0xffff; + m_previous_0200_command_frame = 0; m_in_game = false; } @@ -186,6 +191,13 @@ void nb1414m4_device::_0200(uint16_t mcu_cmd, uint8_t *vram) // If it is set, "INSERT COIN" etc. are not displayed. m_in_game = (mcu_cmd & 0x80) != 0; + // If the same command in an extremely short cycle (1 frame or less), ignored it. + // This is required to displaying continue screen of ninjaemak. + // ninjaemak calls this command to clear the screen, draw the continuation screen, and then immediately call the same command. + // This second command must be ignored in order not to corrupt the continue screen. + if (m_previous_0200_command == mcu_cmd && (screen().frame_number() - m_previous_0200_command_frame) <= 1) + return; + dst = (m_data[0x330+((mcu_cmd & 0xf)*2)]<<8)|(m_data[0x331+((mcu_cmd & 0xf)*2)]&0xff); dst &= 0x3fff; @@ -194,6 +206,9 @@ void nb1414m4_device::_0200(uint16_t mcu_cmd, uint8_t *vram) fill(0x0000,m_data[dst],m_data[dst+1],vram); else // src -> dst dma(dst,0x0000,0x400,1,vram); + + m_previous_0200_command = mcu_cmd; + m_previous_0200_command_frame = screen().frame_number(); } /* @@ -318,7 +333,7 @@ void nb1414m4_device::_0e00(uint16_t mcu_cmd, uint8_t *vram) void nb1414m4_device::vblank_trigger() { // TODO: use this for frame number synchronization instead of screen().frame_number() - // real HW references definitely syncs insert coin blinking after POST so whatever is the host actually + // real HW references definitely syncs insert coin blinking after POST so whatever is the host actually // have an interest over vblank signal. } diff --git a/src/mame/machine/nb1414m4.h b/src/mame/machine/nb1414m4.h index 4f1b2bcc713..9c5f1f7661c 100644 --- a/src/mame/machine/nb1414m4.h +++ b/src/mame/machine/nb1414m4.h @@ -31,6 +31,8 @@ private: void _0e00(uint16_t mcu_cmd, uint8_t *vram); required_region_ptr<uint8_t> m_data; + uint16_t m_previous_0200_command; + uint64_t m_previous_0200_command_frame; bool m_in_game; }; diff --git a/src/mame/machine/nl_palestra.cpp b/src/mame/machine/nl_palestra.cpp index 23835ce0606..28f86f9d6af 100644 --- a/src/mame/machine/nl_palestra.cpp +++ b/src/mame/machine/nl_palestra.cpp @@ -709,5 +709,10 @@ NETLIST_START(palestra) HINT(clk, NO_DEACTIVATE) #endif + // Connect power terminals + + NET_C(VCC, N1X1.VCC, N1X2.VCC, N1X3.VCC, N1X4.VCC, N1X5.VCC, N1X6a.VCC, N1X7a.VCC, N1X8.VCC) + NET_C(GND, N1X1.GND, N1X2.GND, N1X3.GND, N1X4.GND, N1X5.GND, N1X7a.GND, N1X6a.GND, N1X8.GND) + NETLIST_END() diff --git a/src/mame/machine/nl_pongf.cpp b/src/mame/machine/nl_pongf.cpp index 534791142c1..e0da08fab29 100644 --- a/src/mame/machine/nl_pongf.cpp +++ b/src/mame/machine/nl_pongf.cpp @@ -7,10 +7,10 @@ ***************************************************************************/ -#ifndef __PLIB_PREPROCESSOR__ +//#ifndef __PLIB_PREPROCESSOR__ #define NL_PROHIBIT_BASEH_INCLUDE 1 #include "netlist/devices/net_lib.h" -#endif +//#endif #define FAST_CLOCK (1) diff --git a/src/mame/machine/nl_stuntcyc.cpp b/src/mame/machine/nl_stuntcyc.cpp index 37a4f639568..536119cb253 100644 --- a/src/mame/machine/nl_stuntcyc.cpp +++ b/src/mame/machine/nl_stuntcyc.cpp @@ -12,8 +12,8 @@ NETLIST_START(stuntcyc) SOLVER(Solver, 48000) + PARAM(Solver.PARALLEL, 0) // Don't do parallel solvers - PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient PARAM(NETLIST.USE_DEACTIVATE, 1) ANALOG_INPUT(V5, 5) @@ -22,8 +22,8 @@ NETLIST_START(stuntcyc) TTL_INPUT(high, 1) TTL_INPUT(low, 0) - MAINCLOCK(main_clk, 14258400) - //MAINCLOCK(main_clk, 14318181) + //MAINCLOCK(main_clk, 14258400) + MAINCLOCK(main_clk, 14318000) ALIAS(Y1, main_clk) #if 1 @@ -326,6 +326,10 @@ NETLIST_START(stuntcyc) NET_C(R15.1, E4_2.Q) //RES(R107, RES_K(1)) + // FIXME: Having the diode in the video output has a negative impact + // on performance. A "fast-but-not-perfect" approach could + // use a switched resistor. + DIODE(D17, "1N914") NET_C(D17.K, COMP_SYNC_Q) //NET_C(D17.A, R107.1, R13.2, R14.2, R15.2) @@ -661,8 +665,8 @@ NETLIST_START(stuntcyc) // Power terminals NET_C(VCC, high.VCC, low.VCC, ANTENNA.VCC, FREESCORE_SW_B0.VCC, FREESCORE_SW_B1.VCC, FREESCORE_SW_B2.VCC, FREESCORE_SW_B3.VCC, - MISS_SW_B0.VCC, MISS_SW_B1.VCC, MISS_SW_B2.VCC, R38_2.VCC, R39_2.VCC) + MISS_SW_B0.VCC, MISS_SW_B1.VCC, MISS_SW_B2.VCC, R38_2.VCC, R39_2.VCC, SPEED_PULSES.VCC, PROBECLK.VCC) NET_C(GND, high.GND, low.GND, ANTENNA.GND, FREESCORE_SW_B0.GND, FREESCORE_SW_B1.GND, FREESCORE_SW_B2.GND, FREESCORE_SW_B3.GND, - MISS_SW_B0.GND, MISS_SW_B1.GND, MISS_SW_B2.GND, R38_2.GND, R39_2.GND) + MISS_SW_B0.GND, MISS_SW_B1.GND, MISS_SW_B2.GND, R38_2.GND, R39_2.GND, SPEED_PULSES.GND, PROBECLK.GND) #endif NETLIST_END() diff --git a/src/mame/machine/rx01.cpp b/src/mame/machine/rx01.cpp index ab91393d93b..b7998f3b38d 100644 --- a/src/mame/machine/rx01.cpp +++ b/src/mame/machine/rx01.cpp @@ -14,6 +14,7 @@ #include "emu.h" #include "machine/rx01.h" +#include "cpu/rx01/rx01.h" #include "formats/basicdsk.h" static LEGACY_FLOPPY_OPTIONS_START( rx01 ) @@ -38,7 +39,7 @@ static const floppy_interface rx01_floppy_interface = // DEVICE DEFINITIONS //************************************************************************** -DEFINE_DEVICE_TYPE(RX01, rx01_device, "rx01", "RX01") +DEFINE_DEVICE_TYPE(RX01, rx01_device, "rx01", "RX01 Floppy Disk Controller") //------------------------------------------------- // rx01_device - constructor @@ -50,12 +51,20 @@ rx01_device::rx01_device(const machine_config &mconfig, const char *tag, device_ { } +void rx01_device::firmware_map(address_map &map) +{ + map(00000, 02777).rom().region("firmware", 0); +} + //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- void rx01_device::device_add_mconfig(machine_config &config) { + rx01_cpu_device &cpu(RX01_CPU(config, "rx01cpu", 20_MHz_XTAL)); + cpu.set_addrmap(AS_PROGRAM, &rx01_device::firmware_map); + for (auto &floppy : m_image) LEGACY_FLOPPY(config, floppy, 0, &rx01_floppy_interface); } @@ -253,3 +262,24 @@ void rx01_device::write_sector(int ddam) /* write data */ m_image[m_unit]->floppy_drive_write_sector_data(0, m_rxsa, (char *)m_buffer, 128, ddam); } + +ROM_START(rx01) + ROM_REGION(0x600, "firmware", 0) // Harris M1-7610-5 (82S126 equivalent) PROMs + ROM_LOAD_NIB_LOW( "23-111a2.e13", 0x000, 0x100, CRC(67ada159) SHA1(7cdc31e4aa64491c6212cb3ec1e00e6ae41eff1e)) + ROM_LOAD_NIB_HIGH("23-421a2.e3", 0x000, 0x100, CRC(d95473f1) SHA1(0fe73ffc3fb9ace480b7100e8f6921cb925f9702)) + ROM_LOAD_NIB_LOW( "23-257a2.e14", 0x100, 0x100, CRC(226f5f48) SHA1(b458bcd6d48158448967bd9fe30ea4a7df3b44d0)) + ROM_LOAD_NIB_HIGH("23-258a2.e4", 0x100, 0x100, CRC(4c0efd41) SHA1(c3cc76fffdd626c1c07e3a38f5c0e5f1481aabfe)) + ROM_LOAD_NIB_LOW( "23-115a2.e15", 0x200, 0x100, CRC(99fc60a3) SHA1(172c9ecfc705a6df404aeec1de210aa992995c40)) + ROM_LOAD_NIB_HIGH("23-116a2.e5", 0x200, 0x100, CRC(35677163) SHA1(0298130686e87416eddff2346e858f38804222fd)) + ROM_LOAD_NIB_LOW( "23-117a2.e16", 0x300, 0x100, CRC(3cec12ee) SHA1(eb2289144bace85b4df04e06b2df3ea4b40c1c63)) + ROM_LOAD_NIB_HIGH("23-118a2.e6", 0x300, 0x100, CRC(d64aaffe) SHA1(06c4729e6d04a24ae0be0022e62389169706715a)) + ROM_LOAD_NIB_LOW( "23-259a2.e17", 0x400, 0x100, CRC(0a382bb3) SHA1(960d9a995ec67b85080765377b1a546bcfe80883)) + ROM_LOAD_NIB_HIGH("23-260a2.e7", 0x400, 0x100, CRC(3643c2e4) SHA1(3e11ae926ca746fcfb849adbea7a78329dbc73a7)) + ROM_LOAD_NIB_LOW( "23-121a2.e18", 0x500, 0x100, CRC(ebc0ced0) SHA1(ef09ba7df66af5afd355ef9d4fef0efb97b3d2f9)) + ROM_LOAD_NIB_HIGH("23-122a2.e8", 0x500, 0x100, CRC(04ab3bbe) SHA1(abf87d731213e51413c6ef3172f14353da36e791)) +ROM_END + +const tiny_rom_entry *rx01_device::device_rom_region() const +{ + return ROM_NAME(rx01); +} diff --git a/src/mame/machine/rx01.h b/src/mame/machine/rx01.h index 599d40c84cb..9735e48a1f8 100644 --- a/src/mame/machine/rx01.h +++ b/src/mame/machine/rx01.h @@ -35,6 +35,7 @@ protected: virtual void device_reset() override; // optional information overrides virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; void command_write(uint16_t data); uint16_t status_read(); @@ -49,6 +50,8 @@ protected: void write_sector(int ddam); private: + void firmware_map(address_map &map); + enum rx01_state { RX01_FILL, RX01_EMPTY, diff --git a/src/mame/machine/segacrpt_device.cpp b/src/mame/machine/segacrpt_device.cpp index 47dc8bfb55c..77819705ede 100644 --- a/src/mame/machine/segacrpt_device.cpp +++ b/src/mame/machine/segacrpt_device.cpp @@ -123,7 +123,7 @@ 315-5064 Water Match used Mister Viking for k.p.a. 315-5065 Bull Fight 315-5069 Star Force game by Tehkan; same key as Super Locomotive - ???-???? Spatter + ???-???? Spatter same encryption scheme is used by the Falcon 03155096 CPU (Z80) 315-5084 Jongkyo TABLE INCOMPLETE game by Kiwako; also has a simple bitswap on top 315-5093 Pitfall II 315-5098 Ninja Princess unencrypted version available; same key as Up'n Down diff --git a/src/mame/machine/ti85.cpp b/src/mame/machine/ti85.cpp index 9bba11de994..4af87659194 100644 --- a/src/mame/machine/ti85.cpp +++ b/src/mame/machine/ti85.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ -#include <stdarg.h> +#include <cstdarg> #include "emu.h" #include "cpu/z80/z80.h" #include "includes/ti85.h" diff --git a/src/mame/machine/ut88.cpp b/src/mame/machine/ut88.cpp index 0f7b2c09d14..da3f4687010 100644 --- a/src/mame/machine/ut88.cpp +++ b/src/mame/machine/ut88.cpp @@ -25,69 +25,69 @@ static const uint8_t hex_to_7seg[16] = /* Driver initialization */ -void ut88_state::init_ut88() +void ut88_state::driver_init() { /* set initially ROM to be visible on first bank */ - uint8_t *RAM = m_region_maincpu->base(); - memset(RAM,0x0000,0x0800); // make first page empty by default - m_bank1->configure_entries(1, 2, RAM, 0x0000); - m_bank1->configure_entries(0, 2, RAM, 0xf800); + uint8_t *ram = m_region_maincpu->base(); + memset(ram, 0x0000, 0x0800); // make first page empty by default + m_bank1->configure_entries(1, 2, ram, 0x0000); + m_bank1->configure_entries(0, 2, ram, 0xf800); } void ut88_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - switch (id) + if (id == TIMER_RESET) { - case TIMER_RESET: m_bank1->set_entry(0); - break; - case TIMER_UPDATE_DISPLAY: - for (int i=0;i<6;i++) + } +} + +void ut88mini_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + if (id == TIMER_UPDATE_DISPLAY) + { + for (int i = 0; i < 6; i++) m_digits[i] = hex_to_7seg[m_lcd_digit[i]]; timer_set(attotime::from_hz(60), TIMER_UPDATE_DISPLAY); - break; - default: - throw emu_fatalerror("Unknown id in ut88_state::device_timer"); } } - -READ8_MEMBER( ut88_state::ut88_8255_portb_r ) +READ8_MEMBER( ut88_state::ppi_portb_r ) { uint8_t data = 0xff; - if ( m_keyboard_mask & 0x01 ) + if (BIT(m_keyboard_mask, 0)) data &= m_io_line0->read(); - if ( m_keyboard_mask & 0x02 ) + if (BIT(m_keyboard_mask, 1)) data &= m_io_line1->read(); - if ( m_keyboard_mask & 0x04 ) + if (BIT(m_keyboard_mask, 2)) data &= m_io_line2->read(); - if ( m_keyboard_mask & 0x08 ) + if (BIT(m_keyboard_mask, 3)) data &= m_io_line3->read(); - if ( m_keyboard_mask & 0x10 ) + if (BIT(m_keyboard_mask, 4)) data &= m_io_line4->read(); - if ( m_keyboard_mask & 0x20 ) + if (BIT(m_keyboard_mask, 5)) data &= m_io_line5->read(); - if ( m_keyboard_mask & 0x40 ) + if (BIT(m_keyboard_mask, 6)) data &= m_io_line6->read(); - if ( m_keyboard_mask & 0x80 ) + if (BIT(m_keyboard_mask, 7)) data &= m_io_line7->read(); return data; } -READ8_MEMBER( ut88_state::ut88_8255_portc_r ) +READ8_MEMBER( ut88_state::ppi_portc_r ) { return m_io_line8->read(); } -WRITE8_MEMBER( ut88_state::ut88_8255_porta_w ) +WRITE8_MEMBER( ut88_state::ppi_porta_w ) { m_keyboard_mask = data ^ 0xff; } -MACHINE_RESET_MEMBER(ut88_state,ut88) +void ut88_state::machine_reset() { timer_set(attotime::from_usec(10), TIMER_RESET); m_bank1->set_entry(1); @@ -95,31 +95,31 @@ MACHINE_RESET_MEMBER(ut88_state,ut88) } -READ8_MEMBER( ut88_state::ut88_keyboard_r ) +READ8_MEMBER( ut88_state::keyboard_r ) { - return m_ppi->read(offset^0x03); + return m_ppi->read(offset ^ 0x03); } -WRITE8_MEMBER( ut88_state::ut88_keyboard_w ) +WRITE8_MEMBER( ut88_state::keyboard_w ) { - m_ppi->write(offset^0x03, data); + m_ppi->write(offset ^ 0x03, data); } -WRITE8_MEMBER( ut88_state::ut88_sound_w ) +WRITE8_MEMBER( ut88_state::sound_w ) { m_dac->write(BIT(data, 0)); m_cassette->output(BIT(data, 0) ? 1 : -1); } -READ8_MEMBER( ut88_state::ut88_tape_r ) +READ8_MEMBER( ut88_base_state::tape_r ) { double level = m_cassette->input(); return (level < 0) ? 0 : 0xff; } -READ8_MEMBER( ut88_state::ut88mini_keyboard_r ) +READ8_MEMBER( ut88mini_state::keyboard_r ) { // This is real keyboard implementation uint8_t *keyrom1 = m_region_proms->base(); @@ -145,7 +145,7 @@ READ8_MEMBER( ut88_state::ut88mini_keyboard_r ) } -WRITE8_MEMBER( ut88_state::ut88mini_write_led ) +WRITE8_MEMBER( ut88mini_state::led_w ) { switch(offset) { @@ -161,17 +161,13 @@ WRITE8_MEMBER( ut88_state::ut88mini_write_led ) } } -void ut88_state::init_ut88mini() -{ -} - -MACHINE_START_MEMBER(ut88_state,ut88mini) +void ut88mini_state::machine_start() { m_digits.resolve(); timer_set(attotime::from_hz(60), TIMER_UPDATE_DISPLAY); } -MACHINE_RESET_MEMBER(ut88_state,ut88mini) +void ut88mini_state::machine_reset() { m_lcd_digit[0] = m_lcd_digit[1] = m_lcd_digit[2] = 0; m_lcd_digit[3] = m_lcd_digit[4] = m_lcd_digit[5] = 0; diff --git a/src/mame/machine/vt1682_uio.cpp b/src/mame/machine/vt1682_uio.cpp new file mode 100644 index 00000000000..d7c5591dfc1 --- /dev/null +++ b/src/mame/machine/vt1682_uio.cpp @@ -0,0 +1,133 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +// UIO seems to be a different IO module to the vt1682_io.cpp one, 8-bit ports instead of 4-bit + +#include "emu.h" +#include "machine/vt1682_uio.h" + +#define LOG_UIO (1U << 1) + +#define LOG_ALL ( LOG_UIO ) + +#define VERBOSE (0) +#include "logmacro.h" + + +DEFINE_DEVICE_TYPE(VT_VT1682_UIO, vrt_vt1682_uio_device, "vt1682uio", "VRT VT1682 UIO") + +vrt_vt1682_uio_device::vrt_vt1682_uio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, VT_VT1682_UIO, tag, owner, clock), + m_porta_out(*this), + m_porta_in(*this), + m_portb_out(*this), + m_portb_in(*this) +{ +} + +READ8_MEMBER(vrt_vt1682_uio_device::inteact_2129_uio_a_data_r) +{ + // TODO, use direction register etc. + uint8_t dat = m_porta_in(); + //logerror("%s: bankswitch inteact_2129_uio_a_data_r %02x\n", machine().describe_context(), m_2129_uio_a_data); + return dat; +} + + +WRITE8_MEMBER(vrt_vt1682_uio_device::inteact_2129_uio_a_data_w) +{ + // TODO, use direction register etc. + + LOGMASKED(LOG_UIO, "%s: inteact_2129_uio_a_data_w %02x\n", machine().describe_context(), data); + m_2129_uio_a_data = data; + m_porta_out(m_2129_uio_a_data); +} + +READ8_MEMBER(vrt_vt1682_uio_device::inteact_212a_uio_a_direction_r) +{ + return m_212a_uio_a_direction; +} + +WRITE8_MEMBER(vrt_vt1682_uio_device::inteact_212a_uio_a_direction_w) +{ + LOGMASKED(LOG_UIO, "%s: inteact_212a_uio_a_direction_w %02x\n", machine().describe_context(), data); + m_212a_uio_a_direction = data; +} + +READ8_MEMBER(vrt_vt1682_uio_device::inteact_212b_uio_a_attribute_r) +{ + return m_212b_uio_a_attribute; +} + +WRITE8_MEMBER(vrt_vt1682_uio_device::inteact_212b_uio_a_attribute_w) +{ + LOGMASKED(LOG_UIO, "%s: inteact_212b_uio_a_attribute_w %02x\n", machine().describe_context(), data); + m_212b_uio_a_attribute = data; +} + + +READ8_MEMBER(vrt_vt1682_uio_device::inteact_2149_uio_b_data_r) +{ + // TODO, use direction register etc. + uint8_t dat = m_portb_in(); + //logerror("%s: bankswitch inteact_2149_uio_b_data_r %02x\n", machine().describe_context(), m_2149_uio_b_data); + return dat; +} + + +WRITE8_MEMBER(vrt_vt1682_uio_device::inteact_2149_uio_b_data_w) +{ + // TODO, use direction register etc. + LOGMASKED(LOG_UIO, "%s: inteact_2149_uio_b_data_w %02x\n", machine().describe_context(), data); + m_2149_uio_b_data = data; + m_portb_out(m_2149_uio_b_data); +} + +READ8_MEMBER(vrt_vt1682_uio_device::inteact_214a_uio_b_direction_r) +{ + return m_214a_uio_b_direction; +} + +WRITE8_MEMBER(vrt_vt1682_uio_device::inteact_214a_uio_b_direction_w) +{ + LOGMASKED(LOG_UIO, "%s: inteact_214a_uio_b_direction_w %02x\n", machine().describe_context(), data); + m_214a_uio_b_direction = data; +} + +READ8_MEMBER(vrt_vt1682_uio_device::inteact_214b_uio_b_attribute_r) +{ + return m_214b_uio_b_attribute; +} + +WRITE8_MEMBER(vrt_vt1682_uio_device::inteact_214b_uio_b_attribute_w) +{ + LOGMASKED(LOG_UIO, "%s: inteact_214b_uio_b_attribute_w %02x\n", machine().describe_context(), data); + m_214b_uio_b_attribute = data; +} + + + +void vrt_vt1682_uio_device::device_start() +{ + m_porta_out.resolve_safe(); + m_porta_in.resolve_safe(0); + m_portb_out.resolve_safe(); + m_portb_in.resolve_safe(0); + + save_item(NAME(m_2129_uio_a_data)); + save_item(NAME(m_212a_uio_a_direction)); + save_item(NAME(m_212b_uio_a_attribute)); + save_item(NAME(m_2149_uio_b_data)); + save_item(NAME(m_214a_uio_b_direction)); + save_item(NAME(m_214b_uio_b_attribute)); +} + +void vrt_vt1682_uio_device::device_reset() +{ + m_2129_uio_a_data = 0; + m_212a_uio_a_direction = 0; + m_212b_uio_a_attribute = 0; + m_2149_uio_b_data = 0; + m_214a_uio_b_direction = 0; + m_214b_uio_b_attribute = 0; +} diff --git a/src/mame/machine/vt1682_uio.h b/src/mame/machine/vt1682_uio.h new file mode 100644 index 00000000000..d3bfc87971c --- /dev/null +++ b/src/mame/machine/vt1682_uio.h @@ -0,0 +1,56 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +#ifndef MAME_MACHINE_VT1682_UIO_H +#define MAME_MACHINE_VT1682_UIO_H + +#pragma once + +DECLARE_DEVICE_TYPE(VT_VT1682_UIO, vrt_vt1682_uio_device) + +class vrt_vt1682_uio_device : public device_t +{ +public: + // construction/destruction + vrt_vt1682_uio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + auto porta_out() { return m_porta_out.bind(); } + auto porta_in() { return m_porta_in.bind(); } + auto portb_out() { return m_portb_out.bind(); } + auto portb_in() { return m_portb_in.bind(); } + + DECLARE_READ8_MEMBER(inteact_2129_uio_a_data_r); + DECLARE_WRITE8_MEMBER(inteact_2129_uio_a_data_w); + DECLARE_READ8_MEMBER(inteact_212a_uio_a_direction_r); + DECLARE_WRITE8_MEMBER(inteact_212a_uio_a_direction_w); + DECLARE_READ8_MEMBER(inteact_212b_uio_a_attribute_r); + DECLARE_WRITE8_MEMBER(inteact_212b_uio_a_attribute_w); + + DECLARE_READ8_MEMBER(inteact_2149_uio_b_data_r); + DECLARE_WRITE8_MEMBER(inteact_2149_uio_b_data_w); + DECLARE_READ8_MEMBER(inteact_214a_uio_b_direction_r); + DECLARE_WRITE8_MEMBER(inteact_214a_uio_b_direction_w); + DECLARE_READ8_MEMBER(inteact_214b_uio_b_attribute_r); + DECLARE_WRITE8_MEMBER(inteact_214b_uio_b_attribute_w); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + devcb_write8 m_porta_out; + devcb_read8 m_porta_in; + devcb_write8 m_portb_out; + devcb_read8 m_portb_in; + + uint8_t m_2129_uio_a_data; + uint8_t m_212a_uio_a_direction; + uint8_t m_212b_uio_a_attribute; + + uint8_t m_2149_uio_b_data; + uint8_t m_214a_uio_b_direction; + uint8_t m_214b_uio_b_attribute; + +}; + +#endif // MAME_MACHINE_VT1682_UIO_H diff --git a/src/mame/machine/williams.cpp b/src/mame/machine/williams.cpp index 1c03c4f60ee..5395fa363fd 100644 --- a/src/mame/machine/williams.cpp +++ b/src/mame/machine/williams.cpp @@ -16,7 +16,7 @@ * *************************************/ -TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_va11_callback) +TIMER_DEVICE_CALLBACK_MEMBER(williams_state::va11_callback) { int scanline = param; @@ -29,7 +29,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_va11_callback) } -TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_count240_callback) +TIMER_DEVICE_CALLBACK_MEMBER(williams_state::count240_callback) { int scanline = param; @@ -44,7 +44,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_count240_callback) * *************************************/ -MACHINE_START_MEMBER(williams_state,williams_common) +void williams_state::machine_start() { /* configure the memory bank */ m_mainbank->configure_entry(1, memregion("maincpu")->base() + 0x10000); @@ -52,20 +52,13 @@ MACHINE_START_MEMBER(williams_state,williams_common) } -MACHINE_START_MEMBER(williams_state,williams) -{ - MACHINE_START_CALL_MEMBER(williams_common); -} - - - /************************************* * * Newer Williams interrupts * *************************************/ -TIMER_DEVICE_CALLBACK_MEMBER(williams2_state::williams2_va11_callback) +TIMER_DEVICE_CALLBACK_MEMBER(williams2_state::va11_callback) { int scanline = param; if (scanline == 256) @@ -77,7 +70,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(williams2_state::williams2_va11_callback) } -TIMER_DEVICE_CALLBACK_MEMBER(williams2_state::williams2_endscreen_callback) +TIMER_DEVICE_CALLBACK_MEMBER(williams2_state::endscreen_callback) { int scanline = param; @@ -93,7 +86,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(williams2_state::williams2_endscreen_callback) * *************************************/ -MACHINE_START_MEMBER(williams2_state,williams2) +void williams2_state::machine_start() { /* configure memory banks */ m_mainbank->configure_entries(1, 4, memregion("maincpu")->base() + 0x10000, 0x10000); @@ -102,10 +95,10 @@ MACHINE_START_MEMBER(williams2_state,williams2) } -MACHINE_RESET_MEMBER(williams2_state,williams2) +void williams2_state::machine_reset() { /* make sure our banking is reset */ - williams2_bank_select_w(0); + bank_select_w(0); } @@ -116,7 +109,7 @@ MACHINE_RESET_MEMBER(williams2_state,williams2) * *************************************/ -void williams_state::williams_vram_select_w(u8 data) +void williams_state::vram_select_w(u8 data) { /* VRAM/ROM banking from bit 0 */ m_mainbank->set_entry(data & 0x01); @@ -126,7 +119,7 @@ void williams_state::williams_vram_select_w(u8 data) } -void williams2_state::williams2_bank_select_w(u8 data) +void williams2_state::bank_select_w(u8 data) { /* the low two bits control the paging */ switch (data & 0x03) @@ -160,31 +153,31 @@ void williams2_state::williams2_bank_select_w(u8 data) * *************************************/ -TIMER_CALLBACK_MEMBER(williams_state::williams_deferred_snd_cmd_w) +TIMER_CALLBACK_MEMBER(williams_state::deferred_snd_cmd_w) { m_pia[2]->write_portb(param); m_pia[2]->cb1_w((param == 0xff) ? 0 : 1); } -void williams_state::williams_snd_cmd_w(u8 data) +void williams_state::snd_cmd_w(u8 data) { /* the high two bits are set externally, and should be 1 */ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),this), data | 0xc0); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::deferred_snd_cmd_w),this), data | 0xc0); } -void williams_state::playball_snd_cmd_w(u8 data) +void playball_state::snd_cmd_w(u8 data) { - machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),this), data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(playball_state::deferred_snd_cmd_w),this), data); } -TIMER_CALLBACK_MEMBER(williams2_state::williams2_deferred_snd_cmd_w) +TIMER_CALLBACK_MEMBER(williams2_state::deferred_snd_cmd_w) { m_pia[2]->write_porta(param); } -void williams2_state::williams2_snd_cmd_w(u8 data) +void williams2_state::snd_cmd_w(u8 data) { - machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams2_state::williams2_deferred_snd_cmd_w),this), data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams2_state::deferred_snd_cmd_w),this), data); } @@ -214,7 +207,7 @@ void williams2_state::williams2_snd_cmd_w(u8 data) * 1000 = right/down full */ -u8 williams_state::williams_49way_port_0_r() +u8 williams_state::port_0_49way_r() { static const uint8_t translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 }; return (translate49[ioport("49WAYX")->read() >> 4] << 4) | translate49[ioport("49WAYY")->read() >> 4]; @@ -228,14 +221,14 @@ u8 williams_state::williams_49way_port_0_r() * *************************************/ -void williams_state::williams_cmos_w(offs_t offset, u8 data) +void williams_state::cmos_w(offs_t offset, u8 data) { /* only 4 bits are valid */ m_nvram[offset] = data | 0xf0; } -void williams_state::bubbles_cmos_w(offs_t offset, u8 data) +void bubbles_state::cmos_w(offs_t offset, u8 data) { /* bubbles has additional CMOS for a full 8 bits */ m_nvram[offset] = data; @@ -249,7 +242,7 @@ void williams_state::bubbles_cmos_w(offs_t offset, u8 data) * *************************************/ -WRITE8_MEMBER(williams_state::williams_watchdog_reset_w) +WRITE8_MEMBER(williams_state::watchdog_reset_w) { /* yes, the data bits are checked for this specific value */ if (data == 0x39) @@ -257,7 +250,7 @@ WRITE8_MEMBER(williams_state::williams_watchdog_reset_w) } -WRITE8_MEMBER(williams2_state::williams2_watchdog_reset_w) +WRITE8_MEMBER(williams2_state::watchdog_reset_w) { /* yes, the data bits are checked for this specific value */ if ((data & 0x3f) == 0x14) @@ -272,7 +265,7 @@ WRITE8_MEMBER(williams2_state::williams2_watchdog_reset_w) * *************************************/ -void williams2_state::williams2_7segment_w(u8 data) +void williams2_state::segments_w(u8 data) { int n; char dot; @@ -313,24 +306,19 @@ void williams2_state::williams2_7segment_w(u8 data) * *************************************/ -MACHINE_START_MEMBER(williams_state,defender) -{ -} - - -MACHINE_RESET_MEMBER(williams_state,defender) +void defender_state::machine_reset() { - defender_bank_select_w(0); + bank_select_w(0); } -void williams_state::defender_video_control_w(u8 data) +void defender_state::video_control_w(u8 data) { m_cocktail = data & 0x01; } -void williams_state::defender_bank_select_w(u8 data) +void defender_state::bank_select_w(u8 data) { m_bankc000->set_bank(data & 0x0f); } @@ -343,14 +331,14 @@ void williams_state::defender_bank_select_w(u8 data) * *************************************/ -u8 williams_state::mayday_protection_r(offs_t offset) +u8 mayday_state::protection_r(offs_t offset) { /* Mayday does some kind of protection check that is not currently understood */ /* However, the results of that protection check are stored at $a190 and $a191 */ /* These are compared against $a193 and $a194, respectively. Thus, to prevent */ - /* the protection from resetting the machine(), we just return $a193 for $a190, */ + /* the protection from resetting the machine, we just return $a193 for $a190, */ /* and $a194 for $a191. */ - return m_mayday_protection[offset + 3]; + return m_protection[offset + 3]; } @@ -361,10 +349,10 @@ u8 williams_state::mayday_protection_r(offs_t offset) * *************************************/ -void williams_state::sinistar_vram_select_w(u8 data) +void sinistar_state::vram_select_w(u8 data) { /* low two bits are standard */ - williams_vram_select_w(data); + williams_state::vram_select_w(data); /* window enable from bit 2 (clips to 0x7400) */ m_blitter_window_enable = data & 0x04; @@ -378,14 +366,14 @@ void williams_state::sinistar_vram_select_w(u8 data) * *************************************/ -MACHINE_START_MEMBER(blaster_state,blaster) +void blaster_state::machine_start() { /* banking is different for blaster */ m_mainbank->configure_entries(1, 16, memregion("maincpu")->base() + 0x18000, 0x4000); m_mainbank->configure_entry(0, m_videoram); - m_blaster_bankb->configure_entries(1, 16, memregion("maincpu")->base() + 0x10000, 0x0000); - m_blaster_bankb->configure_entry(0, &m_videoram[0x4000]); + m_bankb->configure_entries(1, 16, memregion("maincpu")->base() + 0x10000, 0x0000); + m_bankb->configure_entry(0, &m_videoram[0x4000]); /* register for save states */ save_item(NAME(m_vram_bank)); @@ -396,11 +384,11 @@ MACHINE_START_MEMBER(blaster_state,blaster) inline void blaster_state::update_blaster_banking() { m_mainbank->set_entry(m_vram_bank * (m_rom_bank + 1)); - m_blaster_bankb->set_entry(m_vram_bank * (m_rom_bank + 1)); + m_bankb->set_entry(m_vram_bank * (m_rom_bank + 1)); } -void blaster_state::blaster_vram_select_w(u8 data) +void blaster_state::vram_select_w(u8 data) { /* VRAM/ROM banking from bit 0 */ m_vram_bank = data & 0x01; @@ -414,14 +402,14 @@ void blaster_state::blaster_vram_select_w(u8 data) } -void blaster_state::blaster_bank_select_w(u8 data) +void blaster_state::bank_select_w(u8 data) { m_rom_bank = data & 0x0f; update_blaster_banking(); } -TIMER_CALLBACK_MEMBER(blaster_state::blaster_deferred_snd_cmd_w) +TIMER_CALLBACK_MEMBER(blaster_state::deferred_snd_cmd_w) { uint8_t l_data = param | 0x80; uint8_t r_data = (param >> 1 & 0x40) | (param & 0x3f) | 0x80; @@ -431,9 +419,9 @@ TIMER_CALLBACK_MEMBER(blaster_state::blaster_deferred_snd_cmd_w) } -void blaster_state::blaster_snd_cmd_w(u8 data) +void blaster_state::snd_cmd_w(u8 data) { - machine().scheduler().synchronize(timer_expired_delegate(FUNC(blaster_state::blaster_deferred_snd_cmd_w),this), data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(blaster_state::deferred_snd_cmd_w),this), data); } @@ -453,13 +441,26 @@ WRITE_LINE_MEMBER(williams_state::lottofun_coin_lock_w) /************************************* * + * Williams 2nd-gen-specific routines + * + *************************************/ + +void williams2_state::video_control_w(u8 data) +{ + m_cocktail = data & 0x01; +} + + + +/************************************* + * * Turkey Shoot-specific routines * *************************************/ -MACHINE_START_MEMBER(tshoot_state,tshoot) +void tshoot_state::machine_start() { - MACHINE_START_CALL_MEMBER(williams2); + williams2_state::machine_start(); m_grenade_lamp.resolve(); m_gun_lamp.resolve(); m_p1_gun_recoil.resolve(); @@ -494,35 +495,29 @@ void tshoot_state::lamp_w(u8 data) * *************************************/ -MACHINE_START_MEMBER(joust2_state,joust2) -{ - MACHINE_START_CALL_MEMBER(williams2); - save_item(NAME(m_joust2_current_sound_data)); -} - - -MACHINE_RESET_MEMBER(joust2_state,joust2) +void joust2_state::machine_start() { - MACHINE_RESET_CALL_MEMBER(williams2); + williams2_state::machine_start(); + save_item(NAME(m_current_sound_data)); } -TIMER_CALLBACK_MEMBER(joust2_state::joust2_deferred_snd_cmd_w) +TIMER_CALLBACK_MEMBER(joust2_state::deferred_snd_cmd_w) { m_pia[2]->write_porta(param & 0xff); } -WRITE_LINE_MEMBER(joust2_state::joust2_pia_3_cb1_w) +WRITE_LINE_MEMBER(joust2_state::pia_3_cb1_w) { - m_joust2_current_sound_data = (m_joust2_current_sound_data & ~0x100) | ((state << 8) & 0x100); - m_cvsd_sound->write(m_joust2_current_sound_data); + m_current_sound_data = (m_current_sound_data & ~0x100) | ((state << 8) & 0x100); + m_cvsd_sound->write(m_current_sound_data); } -WRITE8_MEMBER(joust2_state::joust2_snd_cmd_w) +void joust2_state::snd_cmd_w(u8 data) { - m_joust2_current_sound_data = (m_joust2_current_sound_data & ~0xff) | (data & 0xff); - m_cvsd_sound->write(m_joust2_current_sound_data); - machine().scheduler().synchronize(timer_expired_delegate(FUNC(joust2_state::joust2_deferred_snd_cmd_w),this), m_joust2_current_sound_data); + m_current_sound_data = (m_current_sound_data & ~0xff) | (data & 0xff); + m_cvsd_sound->write(m_current_sound_data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(joust2_state::deferred_snd_cmd_w),this), m_current_sound_data); } diff --git a/src/mame/machine/x68k_kbd.cpp b/src/mame/machine/x68k_kbd.cpp index 6704afad127..d74a77f17a6 100644 --- a/src/mame/machine/x68k_kbd.cpp +++ b/src/mame/machine/x68k_kbd.cpp @@ -276,7 +276,7 @@ void x68k_keyboard_device::device_reset() buffered_rs232_device::device_reset(); set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); - set_rate(38'400); // TODO: Should be 2400 but MC68901 doesn't support divide by 16 + set_rate(2400); receive_register_reset(); transmit_register_reset(); diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp index 3f3a364b848..9c28dfad770 100644 --- a/src/mame/machine/xbox.cpp +++ b/src/mame/machine/xbox.cpp @@ -36,7 +36,7 @@ bool xbox_base_state::find_bios_hash(int bios, uint32_t &crc32) { if (ROMENTRY_ISFILE(re)) { - if (ROM_GETBIOSFLAGS(re) == (bios + 1)) + if (ROM_GETBIOSFLAGS(re) == (uint32_t)(bios + 1)) { const std::string &h = re.hashdata(); util::hash_collection hc(h.c_str()); diff --git a/src/mame/machine/xbox_pci.cpp b/src/mame/machine/xbox_pci.cpp index 1aecb382084..5dc8a0b8862 100644 --- a/src/mame/machine/xbox_pci.cpp +++ b/src/mame/machine/xbox_pci.cpp @@ -462,21 +462,21 @@ void mcpx_isalpc_device::set_virtual_line(int line, int state) return; } /* Will be updated to support dma - line = line - 16; - if (line < 4) - { - switch (line) - { - case 0: - break; - case 1: - break; - case 2: - break; - case 3: - break; - } - } + line = line - 16; + if (line < 4) + { + switch (line) + { + case 0: + break; + case 1: + break; + case 2: + break; + case 3: + break; + } + } */ } diff --git a/src/mame/machine/z80ne.cpp b/src/mame/machine/z80ne.cpp index c9e1677e667..aefb0b7dc44 100644 --- a/src/mame/machine/z80ne.cpp +++ b/src/mame/machine/z80ne.cpp @@ -66,7 +66,7 @@ TIMER_CALLBACK_MEMBER(z80ne_state::z80ne_cassette_tc) } -void z80ne_state::init_z80ne() +void z80ne_state::driver_init() { /* first two entries point to rom on reset */ uint8_t *RAM = m_region_z80ne->base(); @@ -75,16 +75,12 @@ void z80ne_state::init_z80ne() m_bank2->configure_entry(0, &RAM[0x14000]); /* ep382 at 0x8000 */ } -void z80ne_state::init_z80net() +void z80net_state::driver_init() { - init_z80ne(); + z80ne_state::driver_init(); } -void z80ne_state::init_z80netb() -{ -} - -void z80netf_state::init_z80netf() +void z80netf_state::driver_init() { /* first two entries point to rom on reset */ uint8_t *RAM = m_region_z80ne->base(); @@ -162,7 +158,7 @@ void z80ne_state::device_timer(emu_timer &timer, device_timer_id id, int param, } } -void z80ne_state::reset_lx387() +void z80net_state::reset_lx387() { m_lx387_kr2376->set_input_pin( kr2376_device::KR2376_DSII, 0); m_lx387_kr2376->set_input_pin( kr2376_device::KR2376_PII, 0); @@ -231,13 +227,9 @@ void z80netf_state::reset_lx390_banking() */ } -MACHINE_RESET_MEMBER(z80ne_state,z80ne_base) +void z80ne_state::base_reset() { - int i; - - LOG("In machine_reset z80ne_base\n"); - - for ( i=0; i<LX383_KEYS; i++) + for (int i = 0; i < LX383_KEYS; i++) m_lx383_key[i] = 0xf0 | i; m_lx383_scan_counter = 0x0f; m_lx383_downsampler = LX383_DOWNSAMPLING; @@ -282,32 +274,28 @@ MACHINE_RESET_MEMBER(z80ne_state,z80ne_base) } -MACHINE_RESET_MEMBER(z80ne_state,z80ne) +void z80ne_state::machine_reset() { - LOG("In machine_reset z80ne\n"); reset_lx382_banking(); - MACHINE_RESET_CALL_MEMBER( z80ne_base ); + base_reset(); } -MACHINE_RESET_MEMBER(z80ne_state,z80net) +void z80net_state::machine_reset() { - LOG("In machine_reset z80net\n"); - MACHINE_RESET_CALL_MEMBER( z80ne ); + z80ne_state::machine_reset(); reset_lx387(); } -MACHINE_RESET_MEMBER(z80ne_state,z80netb) +void z80netb_state::machine_reset() { - LOG("In machine_reset z80netb\n"); - MACHINE_RESET_CALL_MEMBER( z80ne_base ); + base_reset(); reset_lx387(); } -MACHINE_RESET_MEMBER(z80netf_state,z80netf) +void z80netf_state::machine_reset() { - LOG("In machine_reset z80netf\n"); reset_lx390_banking(); - MACHINE_RESET_CALL_MEMBER( z80ne_base ); + base_reset(); reset_lx387(); } @@ -322,7 +310,7 @@ INPUT_CHANGED_MEMBER(z80ne_state::z80ne_reset) } } -INPUT_CHANGED_MEMBER(z80ne_state::z80ne_nmi) +INPUT_CHANGED_MEMBER(z80net_state::z80net_nmi) { uint8_t nmi; nmi = m_io_lx387_brk->read(); @@ -333,10 +321,8 @@ INPUT_CHANGED_MEMBER(z80ne_state::z80ne_nmi) } } -MACHINE_START_MEMBER(z80ne_state,z80ne) +void z80ne_state::machine_start() { - LOG("In MACHINE_START z80ne\n"); - m_timer_nmi = timer_alloc(0); m_timer_reset = timer_alloc(1); @@ -351,23 +337,9 @@ MACHINE_START_MEMBER(z80ne_state,z80ne) m_kbd_timer->adjust(attotime::from_hz(1000), 0, attotime::from_hz(1000)); } -MACHINE_START_MEMBER(z80ne_state,z80net) -{ - MACHINE_START_CALL_MEMBER( z80ne ); - LOG("In MACHINE_START z80net\n"); -} - -MACHINE_START_MEMBER(z80ne_state,z80netb) +void z80netf_state::machine_start() { - MACHINE_START_CALL_MEMBER( z80net ); - LOG("In MACHINE_START z80netb\n"); -} - -MACHINE_START_MEMBER(z80netf_state,z80netf) -{ - MACHINE_START_CALL_MEMBER( z80net ); - LOG("In MACHINE_START z80netf\n"); - + z80ne_state::machine_start(); m_drv_led.resolve(); } @@ -557,41 +529,38 @@ WRITE_LINE_MEMBER(z80ne_state::lx385_uart_tx_clock_w) m_uart->write_tcp(state); } -READ_LINE_MEMBER(z80ne_state::lx387_shift_r) +READ_LINE_MEMBER(z80net_state::lx387_shift_r) { return BIT(m_io_modifiers->read(), 0) || BIT(m_io_modifiers->read(), 2); } -READ_LINE_MEMBER(z80ne_state::lx387_control_r) +READ_LINE_MEMBER(z80net_state::lx387_control_r) { return BIT(m_io_modifiers->read(), 1); } -READ8_MEMBER(z80ne_state::lx388_mc6847_videoram_r) +READ8_MEMBER(z80net_state::lx388_mc6847_videoram_r) { if (offset == ~0) return 0xff; - uint8_t *videoram = m_videoram; - int d6 = BIT(videoram[offset], 6); - int d7 = BIT(videoram[offset], 7); + int d6 = BIT(m_videoram[offset], 6); + int d7 = BIT(m_videoram[offset], 7); m_vdg->inv_w(d6 && d7); m_vdg->as_w(!d6 && d7); m_vdg->intext_w(!d6 && d7); - return videoram[offset]; + return m_videoram[offset]; } -READ8_MEMBER(z80ne_state::lx387_data_r) +READ8_MEMBER(z80net_state::lx387_data_r) { - uint8_t data; - - data = m_lx387_kr2376->data_r(space, 0) & 0x7f; + uint8_t data = m_lx387_kr2376->data_r(space, 0) & 0x7f; data |= m_lx387_kr2376->get_output_pin(kr2376_device::KR2376_SO) << 7; return data; } -READ8_MEMBER(z80ne_state::lx388_read_field_sync) +READ8_MEMBER(z80net_state::lx388_read_field_sync) { return m_vdg->fs_r() << 7; } diff --git a/src/mame/machine/zx8302.cpp b/src/mame/machine/zx8302.cpp index 97d5c0ee0c9..d2e9b4f5c00 100644 --- a/src/mame/machine/zx8302.cpp +++ b/src/mame/machine/zx8302.cpp @@ -23,7 +23,7 @@ #include "imagedev/microdrv.h" -#include <time.h> +#include <ctime> diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 232ddaf5393..bc9c1ae5d56 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -914,6 +914,9 @@ actfancrj // (c) 1989 Data East Corporation (Japan) triothep // (c) 1989 Data East Corporation (World) triothepj // (c) 1989 Data East Corporation (Japan) +@source:actions_atj2279b.cpp +rbitgen + @source:acvirus.cpp virusa // (c) 1997 Access GmbH virusb // (c) 1999 Access GmbH @@ -925,6 +928,9 @@ viruscl // (c) 2004 Access GmbH @source:adam.cpp adam // Coleco Adam +@source:adm11.cpp +adm12 // + @source:adm23.cpp adm23 // @@ -988,6 +994,9 @@ age_cand // AGE Candy Crane agat7 // Agat-7 agat9 // Agat-9 +@source:aid80f.cpp +aid80f // + @source:aim65.cpp aim65 // Rockwell AIM65 @@ -2447,12 +2456,6 @@ sh386sx20 // Shuttle 386SX REV 2.0A motherboard (386sx) ppm3333p // DTK Computer PPM-3333P scsxaio // Peacock 386sx Ver. 2.0 motherboard SCsxAIO (386sx) pcd204 // Philips PCD204 (PCD200 series, 286) -a486ap4 // ASUS PVI-486AP4 -a486sp3 // ASUS PVI-486SP3 -a486sp3g // ASUS PCI/I-486SP3G -aa486s // ASUS PCI/I-A486S -a486sv1 // ASUS VL/EISA-486SV1 -a486sv2g // ASUS VL/I-486SV2G mb8433uud // Biostar MB8433UUD-A mb133340 // Biostar MB-1333/40PMB-CH, rev B.3 c286lt // 1990 Commodore Laptop 286-LT @@ -2475,6 +2478,7 @@ comportiii // Compaq Portable III comslt286 // Compaq SLT/286 dsys200 // Dell System 200 pcd2 // 1986 Siemens PCD-2 +pcd3nsl // Siemens-Nixdorf PCD-3Nsl pcd3nsx // Siemens-Nixdorf PCD-3Nsx pcd4x // Siemens-Nixdorf PCD-4H and other 486 desktops and towers pcd4nl // 1995 Siemens-Nixdorf PCD-4NL 486 subnotebook @@ -2505,7 +2509,6 @@ headg2 // motherboards with Headland G2 chipset (286) mb1212c // Biostar MB-1212C motherboard (286) bam16a0 // VIP-M21502A BAM16-A0 motherboard (286) cmpa286 // CMP enterprise CO.LTD. motherboard (286) -suntac5 // 286 motherboards using the 5-chip SUNTAC chipset ht12a // 286 motherboards using the Headland HT12/A chipset ht18c // 286 motherboards using the Headland HT18/C chipset vlsi5 // 286 motherboards using the 5-chip VLSI chipset @@ -2597,85 +2600,132 @@ xb42639a // 1990 Apricot XEN-S (Venus II Motherboard 286) xb42663 // 1988 Apricot Qi 300 (Rev D,E & F Motherboard) xb42664 // 1989 Apricot XEN-S (Venus I Motherboard 386) (Bios:3.10.17i) xb42664a // 1990 Apricot XEN-S (Venus II Motherboard 386) (Bios:1.02.17) +ataripc4 // Atari PC4 (286) +ataripc5 // Atari PC5 (386) +atariabc286 // Atari ABC-286/30 lion3500 // 1993 Lion 3500C/T notebook o286foxii // Octek Fox II motherboard (286) +ocjagii // Octek Jaguar II motherboard (386) ocjagv // Octek Jaguar V motherboard (386) ocpanii // Octek Panther II motherboard (386sx) ochipcom // Octek Hippo COM motherboard (486) chn333sc // Chaintech 333SC motherboard (386) elt386sx // Elitegroup ELT-386SX-160BE motherboard (386sx) -ms4138 // MSI MS-4138 motherboard (486) mbc18nb // Sanyo MBC-18NB notebook (386sx) tam25p2 // AUVA TAM/25-P2 motherboard (386) zito4dps // ZIDA Tomato board 4DPS (486) -alator2 // Alaris Tornado 2 motherboard (486) -ochipvlp // Octek Hippo VL+ motherboard (486) -sto486wb // Auva-Cam-33-P2 = See-Thru Sto486Wb motherboard (486) -ga486vf // Gigabyte GA-486VF motherboard (486) -ga486vs // Gigabyte GA-486VS motherboard (486) amibaby // AMI Mark V Baby Screamer motherboard (386) ecsfx3000 // Elitegroup FX-3000 motherboard (386) frx386c // Micro-Express Inc. Forex 386 Cache -um486 // Elitegroup UM486/UM486sx Rev.1.4. motherboard (486) -um486v // Elitegroup UM486V-AIO motherboard (486) -sm48650usc // Vintage Sprite SM 486-50USC motherboard (486) -ch4slez1 // Chaintech 486SLE M106 4SLE-Z1 motherboard (486) -ec4915aio // Elitegroup ECS UC4915 A AIO motherboard (486) -via4386vio // Via 4386 VIO / Highscreen universal board (486) -hot433 // Shuttle HOT-433 motherboard (486) +alim1489 // 486 motherboards using the ALi 1487/1489 chipset +op82c392 // 486 motherboards using the OPTi OPTi 82C392, 82C493, 82C206 chipset +sis85c471 // 486 motherboards using the SiS 85C471/85C407 chipset +sis85c496 // 486 motherboards using the SiS 85C496/85C497 chipset +um8886 // 486 motherboards using the UMC UM8886BF/UM8881F chipset +um8498f // 486 motherboards using the UMC UM8498F, UM8496F chipset +uni4800 // 486 motherboards using the UNI4800 chipset +atc1415 // A-Trend ATC-1415 motherboard (486) +atc1425a // A-Trend ATC-1425A +abah4 // Abit AH4(T) motherboard (486) +abpi4 // Abit PI4(T) motherboard (486) +abae4 // Abit 486 EISA-AE4 motherboard (486) abpb4 // Abit AB-PB4 motherboard (486) +abpm4 // Abit AB-PM4 motherboard (486) +abpv4 // Abit AB-PM4 motherboard (486) abpw4 // Abit AB-PW4 motherboard (486) -ochawk // Octek Hawk motherboard (486) -pt430 // Pine Technology PT-430 motherboard (486) -ch491e // Chicony CH-491E motherboard (486) -a486sv2 // Asus ISA-486SV2 motherboard (486) +alator2 // Alaris Tornado 2 motherboard (486) +alaleolx // RYC Alaris LEOPARD LX REV D (486) +amient2 // AMI EISA Enterprise II motherboard (486) +amient3 // AMI EISA Enterprise III motherboard (486) +amient4 // AMI EISA Enterprise IV motherboard (486) +amisvpci2 // AMI Super Voyager PCI-II motherboard (486) +amisvvlb // AMI Super Voyager VLB motherboard (486) +amisvvlb2 // AMI Super Voyager VLB-II motherboard (486) +amisvvlb3 // AMI Super Voyager VLB-III motherboard (486) +aoap43 // Aopen AP43 motherboard (486) +aovi15g // Aopen VI15G motherboard (486) mb4d33 // Aquarius System (ASI) MB-4D33/50NR motherboard (486) -uniwb4407 // UNICHIP 486 WB 4407 REV 1.0 motherboard (486) -px486p3 // QDI PX486P3 motherboard (486) -um8886 // 486 motherboards using the UMC UM8886BF/UM8881F chipset -gete486vl // GENOA TurboExpress 486 VL motherboard (486) -pck486dx // Peacock PCK 486 DX motherboard -sis85c471 // 486 motherboards using the SiS 85C471/85C407 chipset -um8498f // 486 motherboards using the UMC UM8498F, UM8496F chipset +md4duvc // Aquarius MD-4DUVC motherboard (486) +as496 // Arstoria AS496 motherboard (486) +a486sv2 // ASUS ISA-486SV2 motherboard (486) +a486ap4 // ASUS PVI-486AP4 +a486sp3 // ASUS PVI-486SP3 +a486sp3g // ASUS PCI/I-486SP3G +aa486s // ASUS PCI/I-A486S +a486sv1 // ASUS VL/EISA-486SV1 +a486sv2g // ASUS VL/I-486SV2G +sto486wb // Auva-Cam-33-P2 = See-Thru Sto486Wb motherboard (486) +mb1433ucv // Biostar MB-1433UCV motherboard (486) +mb1433uiv // Biostar MB-1433UIV motherboard (486) +ch4slez1 // Chaintech 486SLE M106 4SLE-Z1 motherboard (486) +ch486spm // Chaintech 486SPM motherboard (486) +ch491e // Chicony CH-491E motherboard (486) +ch48633c // Chicony CH-486-33C motherboard (486) 486ccv // Diamond Flower, Inc. (DFI) 486-CCV motherboard (486) -alaleolx // RYC Alaris LEOPARD LX REV D (486) -alim1489 // 486 motherboards using the ALi 1487/1489 chipset -ms4125 // MSI MS-4125 motherboard (486) +4dmshl3g // EFA 4DMS HL3G-L4-VI motherboard (486) +4dmuhl3s // EFA 4DMU HL3S motherboard (486) +486apio // EFA 486 APIO motherboard pkm0038s // DTK PKM-0038S aka Gemlight GMB-486SG motherboard (486) -v4p895p3 // QDI V4P895P3/SMT V5.0 motherboard (486) -op82c392 // 486 motherboards using the OPTi OPTi 82C392, 82C493, 82C206 chipset -ls486e // LuckyStar LS-486E Rev:C motherboard (486) -pm486pu // PROTECH PM486PU-S7 motherboard (486) +gc10a // Eagle EAGLEN486 GC10A motherboard (486) ec4913 // Elitegroup UC4913 REV:1.1 motherboard (486) +ec4915aio // Elitegroup ECS UC4915 A AIO motherboard (486) +um486 // Elitegroup UM486/UM486sx Rev.1.4. motherboard (486) +um486v // Elitegroup UM486V-AIO motherboard (486) +um8810paio // Elitegroup UM8810 PAIO motherboard (486) +exp4044 // ExpertChip EXP4044 motherboard (486) +ft486f55 // Freetech 486FT55 motherboard (486) +gete486vl // GENOA TurboExpress 486 VL motherboard (486 +ga486vf // Gigabyte GA-486VF motherboard (486) +ga486vs // Gigabyte GA-486VS motherboard (486) +ga486am // Gigabyte GA486AM/S motherboard (486) +jwj446a // Jetway J-446A motherboard (486) +ls486e // LuckyStar LS-486E Rev:C motherboard (486) +ms4125 // MSI MS-4125 motherboard (486) +ms4134 // MSI MS-4134 motherboard (486) +ms4138 // MSI MS-4138 motherboard (486) ms4144 // MSI MS-4144 motherboard (486) -pt432b // Pine PT-432b aka SR-M401-A motherboard (486) +ms4145 // MSI MS-4145 motherboard (486) +ochawk // Octek Hawk motherboard (486) ochipdca2 // Octek Hippo DCA2 motherboard (486) -as496 // Arstoria AS496 motherboard (486) +ochipvlp // Octek Hippo VL+ motherboard (486) +pck486dx // Peacock PCK 486 DX motherboard +pt430 // Pine Technology PT-430 motherboard (486) +pt432b // Pine PT-432b aka SR-M401-A motherboard (486) +pm486pu // PROTECH PM486PU-S7 motherboard (486) +px486p3 // QDI PX486P3 motherboard (486) +v4p895p3 // QDI V4P895P3/SMT V5.0 motherboard (486) hot307h // Shuttle HOT-307H motherboard (486) -mb1433ucv // Biostar MB-1433UCV motherboard (486) -gc10a // EAGLEN486 GC10A motherboard (486) hot419 // Shuttle HOT-419 motherboard (486) +hot433 // Shuttle HOT-433 motherboard (486) +so025r2 // SOYO 025R2 motherboard (486) +so30h // SOYO 30H motherboard (486) +so4saw2 // SOYO SY-4SAW2 motherboard (486) +pci48af // TMC Research Corporation PCI48AF motherboard (486) +uniwb4407 // UNICHIP 486 WB 4407 REV 1.0 motherboard (486) +via4386vio // Via 4386 VIO / Highscreen universal board (486) +sm48650usc // Vintage Sprite SM 486-50USC motherboard (486) +zi4dvs // Zida 4DVS motherboard (486) ts34t25 // Highscreen 486-25 aka Midwest Micro Elite TS34T-25 notebook wpc250 // Wang PC-250/16 (286) suntac303 // motherboards using the Suntac ST62C303 chipset -abah4 // Abit AH4(T) motherboard (486) -abpi4 // Abit PI4(T) motherboard (486) -abae4 // Abit 486 EISA-AE4 motherboard (486) -so4saw2 // SOYO SY-4SAW2 motherboard (486) nat48pv // NAT48PV-1.00 VL motherboard (486) olyport40 // AEG Olympia Olyport 40-21 micral45 // Bull Micral 45 (286) epsax // Epson PC AX epsax2e // Epson PC AX2e epsax3 // Epson PC AX3 -md4duvc // Aquarius MD-4DUVC motherboard (486) kma300g // Arche Technologies Inc. KMA-300G-25 asc486slc // Computechnik ASC486SLC slot CPU (386sx) -um8810paio // Elitegroup UM8810 PAIO motherboard (486) -pci48af // TMC Research Corporation PCI48AF motherboard (486) -ft486f55 // Freetech 486FT55 motherboard (486) -ga486am // Gigabyte GA486AM/S motherboard (486) -jwj446a // Jetway J-446A motherboard (486) +bluenote // Highscreen Colani Blue Note (486) +suntac6 // motherboards using the six chip SUNTAC chipset (286) +bay1000c // Mintek BAY-1000C V1.01 motherboard (286) +profpc33 // Profex PC 33 (286) +3siud // 3SIUD-1.1 motherboard (386sx) +ed486vl3h // Edom 486VL3H motherboard (486) +edmv035f // Edom MV035F motherboard (486) +td4ipaio // TD-4IP-UMC-AIO motherboard (486) +dvbslan // Datavan Book-Size LAN station (386sx) +486igb21 // 486IG-B-2-1 motherboard (486) @source:atari_s1.cpp @@ -2952,11 +3002,21 @@ atrwild atricmon atrbonpk +@source:att3b2.cpp +3b2_300 // +3b2_310 // +3b2_400 // +3b2_600 // + @source:att4425.cpp att4425 // +@source:att610.cpp +att610 // + @source:att630.cpp att630 // +att730x // @source:attache.cpp attache // (c) 1982 Otrona @@ -3038,6 +3098,7 @@ botanic2 // (c) 1983 botanicf // (c) 1984 pickin // (c) 1983 sbagman // (c) 1984 +sbagman2 // (c) 1984 sbagmani // (c) 1984 + Itisa license sbagmans // (c) 1984 + Stern license squaitsa // (c) 1985 @@ -3089,6 +3150,9 @@ triviaes5 // (c) 19?? (Maibesa hardware) @source:banctec.cpp banctec // BancTec ESeries panel +@source:bandai_design_master.cpp +bdesignm + @source:bankp.cpp bankp // (c) 1984 Sega, made by Sanritsu combh // (c) 1987 Sega, made by Sanritsu @@ -3167,8 +3231,7 @@ pro128s // 1987 Olivetti Prodest PC 128S autoc15 // 1988 Autocue 1500 reutapm // 1985 Reuters APM Board torchf // 1982 Torch CF240 -torchh10 // 1982 Torch CH240/10 -torchh21 // 1982 Torch CH240/21 +torchh // 1982 Torch CH240 @source:bbcbc.cpp bbcbc // 1985 BBC Bridge Companion @@ -9185,6 +9248,7 @@ megadble // (c) 1990 Blitz Systems Inc. megadblj // (c) 1990 Blitz Systems Inc. poker52 // (c) 1993 Blitz Systems Inc. ? steaser // (c) 1993 unknown +texasrls // (c) 1998 Cadillac Jack @source:blktiger.cpp blkdrgon // 8/1987 (c) 1987 (Japan) @@ -9335,6 +9399,7 @@ disco // (c) 1982 discof // (c) 1982 lnc // (c) 1981 mmonkey // (c) 1982 Technos Japan + Roller Tron +mmonkeyj // (c) 1982 Technos Japan + Roller Tron protennb // bootleg sdtennis // (c) 1983 tisland // (c) 1982 @@ -9951,9 +10016,11 @@ quizard2 // (c) TAB Austria 1995 quizard2_22 // (c) TAB Austria 199? quizard3 // (c) TAB Austria 1996 quizard3_32 // (c) TAB Austria 1996 +quizard3a // (c) TAB Austria 1996 quizard4 // (c) TAB Austria 1998 quizard4_40 // (c) TAB Austria 1997 quizard4_41 // (c) TAB Austria 1998 +quizard4cz // (c) TAB Austria 1998 @source:cdsys5.cpp minijook // @@ -11204,12 +11271,15 @@ cubeqsta // (c) 1983 Simutrek Inc. @source:cubo.cpp cndypuzl // (c) 1995 cubo // Base unit +eldoralg // haremchl // (c) 1995 lasstixx // (c) 1995 lsrquiz // (c) 1995 -lsrquiz2 // (c) 1995 +lsrquizg // (c) 1995 +lsrquiz2i // (c) 1995 mgnumber // (c) 1995 mgprem11 // (c) 1995 +odeontw // odeontw2 // (c) 1999 @source:cultures.cpp @@ -11934,6 +12004,10 @@ digijet // @source:dim68k.cpp dim68k // +@source:dinoking.cpp +dkbattle // +dkkids // + @source:discoboy.cpp discoboy // (c) 1993 Soft Art Co. discoboyp // (c) 1993 Soft Art Co. (Promat license?) @@ -11969,9 +12043,11 @@ bmfinal // GXC01 (c) 2002 (Japan) hmcompm2 // GX988 (c) 2000 hmcompmx // GX858 (c) 1999 popn1 // GX803 (c) 1998 (Asia) +popn1k // GX803 (c) 1998 (Korea) +popn1j // GX803 (c) 1998 (Japan) popn2 // GX831 (c) 1998 (Japan) popn3 // GX980 (c) 1999 (Japan) -popnstage // GQ970 (c) 1999 (Japan) +popnstex // GQ970 (c) 1999 (Japan) @source:dkmb.cpp dkmb @@ -12810,6 +12886,9 @@ rad_baskp rad_sinv rad_tetr airblsjs +buzztime +sudoelan +carlecfg @source:electra.cpp avenger // (c) 1975 Electra @@ -12819,6 +12898,7 @@ electron // 1983 Acorn Electron electront // 1983 Acorn Electron (Trial) btm2105 // 1985 BT Merlin M2105 electron64 // 1987 Acorn Electron (64K Master RAM Board) +electronsp // 1991 Acorn Electron (Stop Press 64i) @source:elekscmp.cpp elekscmp // @@ -12933,6 +13013,8 @@ deluxe5 // (c) 2000 ESD deluxe5a // (c) 2000 ESD deluxe5b // (c) 2000 ESD deluxe4u // (c) 2000 ESD +fantstry // (c) 2002 Z Soft +fantstrya // (c) 2002 Z Soft hedpanic // (c) 2000 ESD hedpanica // (c) 1999 ESD hedpanicf // (c) 2000 ESD + Fuuki, Co. Ltd. @@ -12947,7 +13029,6 @@ multchmpa // (c) 1998 (World) multchmpk // (c) 1998 (Korea) swatpolc // (c) 2001 ESD tangtang // (c) 2000 ESD -fantstry // (c) 2002 Z Soft @source:esh.cpp esh // (c) 1984 Funai / Gakken @@ -13273,6 +13354,9 @@ wofabl // bootleg @source:feversoc.cpp feversoc // (c) 2004 +@source:ffantasy_ms.cpp +ffantasym // + @source:fgoal.cpp fgoal // TF (c) 1979 Taito Corporation fgoala // MF (c) 1979 Taito Corporation @@ -13336,6 +13420,7 @@ fex68kb // fex68km2 // fex68km2a // fex68km3 // +fex68km4 // @source:fidel_elite.cpp feasbu // @@ -13913,6 +13998,7 @@ losttomb // (c) 1982 Stern losttombh // (c) 1982 Stern luctoday // 1980 Sigma mandinga // bootleg (Artemi) +mandingaeg // bootleg (Electrogame) mandingarf // bootleg (Recreativos Franco S.A.) mandingac // bootleg (Centromatic) mltiwars // bootleg (Gayton Games) @@ -14053,6 +14139,7 @@ dkongjrmc // bootleg (Centromatic) drivfrcb // bootleg drivfrcg // [1984] Shinkai (Magic Electronics USA license) drivfrcsg // [1984] Seatongrove +drivfrcsga // [1984] Seatongrove drivfrct // bootleg froggerv // bootleg guttangt // @@ -14488,8 +14575,9 @@ suprpokra // (c) 1986 Grayhound Electronics suprpokrb // (c) 1986 Grayhound Electronics @source:generalplus_gpl32612.cpp -jak_tmnthp jak_swbstrik +jak_tmnthp +jak_dchp @source:geneve.cpp geneve // 1987 Myarc Geneve 9640 @@ -14519,6 +14607,7 @@ pcega // 1987 PC with EGA pcherc // 1987 PC with Hercules (for testing hercules) pcmda // 1987 PC with MDA pcvga // 198? PC-XT (VGA, MF2 Keyboard) +pcv20 // 198? PC-XT with V20 CPU @source:ggconnie.cpp fishingm // (c) 1997 Capcom @@ -14534,6 +14623,9 @@ touryuu // (c) 200? Yuki Enterprise giclasex giclassvr +@source:gigatron.cpp +gigatron // (c) 2018 Marcel van Kervinck + @source:gijoe.cpp gijoe // GX069 (c) 1991 (World) gijoea // GX069 (c) 1991 (Asia) @@ -14907,18 +14999,23 @@ nc96c // (c) 1996 Amcoe nc96d // (c) 1996 Amcoe nc96e // (c) 1996 Amcoe nc96f // (c) 1996 Amcoe +nc96g // (c) 1996 Amcoe +nc96h // (c) 1996 Amcoe +nc96i // (c) 1996 Amcoe nc96txt // (c) 2000 Amcoe ncb3 // (c) 199? Dyna Electronics nfb96 // (c) 1996 Amcoe nfb96a // (c) 1996 Amcoe nfb96b // (c) 1996 Amcoe nfb96c // (c) 1996 Amcoe +nfb96d // (c) 1996 Amcoe nfb96se // bootleg nfb96sea // bootleg nfb96seb // bootleg nfb96sec // bootleg nfb96txt // (c) 2000 Amcoe nfm // bootleg +nfma // bootleg ns8lines // unknown ns8linew // unknown ns8linewa // unknown @@ -14944,7 +15041,9 @@ unkch1 // bootleg unkch2 // bootleg unkch3 // bootleg unkch4 // bootleg +war3cb // wcat3 // +wcat3a // wcherry // bootleg @source:gomoku.cpp @@ -15598,6 +15697,7 @@ gnw_manhole // Nintendo gnw_manholeg // Nintendo gnw_mario // Nintendo gnw_mariocm // Nintendo +gnw_mariocmt // Nintendo gnw_mariotj // Nintendo gnw_mbaway // Nintendo gnw_mmouse // Nintendo @@ -15895,6 +15995,7 @@ battlcryc // (c) 1989 Home Data battlcryp // (c) 1989 Home Data hourouki // (c) 1987 Home Data jogakuen // (c) 1992 Windom corporation +lastapos // (c) 1988 Home Data lemnangl // (c) 1990 Home Data mhgaiden // (c) 1987 Home Data mirderby // (c) 1988 Home Data? @@ -15906,7 +16007,7 @@ mjkinjas // (c) 1991 Home Data mjkojink // (c) 1989 Home Data mjprivat // (c) 1991 Matoba mjyougo // (c) 1989 Home Data -mjjoship // (c) 1988 Home Data +mjjoship // (c) 1988 Home Data mrokumei // (c) 1988 Home Data reikaids // (c) 1988 Home Data vitaminc // (c) 1989 Home Data @@ -16366,7 +16467,7 @@ iqblock // (c) 1993 iqunlim // 199? IQ Unlimited (680x0) @source:iris3130.cpp -sgi_ip2 // IP2: IRIS 3xx0, 68020, 16MHz +iris3130 // IP2: IRIS 3xx0, 68020, 16MHz @source:irisha.cpp irisha // @@ -16501,6 +16602,7 @@ shufshot // (c) Strata/Incredible Technologies shufshot137 // (c) Strata/Incredible Technologies shufshot139 // (c) Strata/Incredible Technologies timekill // (c) 1992 Strata/Incredible Technologies +timekill100 // (c) 1992 Strata/Incredible Technologies timekill121 // (c) 1992 Strata/Incredible Technologies timekill121a // (c) 1992 Strata/Incredible Technologies timekill131 // (c) 1992 Strata/Incredible Technologies @@ -18231,6 +18333,8 @@ jupiter3 // @source:jvh.cpp escape // +formula1 // +icemania // movmastr // @source:k1003.cpp @@ -18378,6 +18482,7 @@ klax4 // 136075 (c) 1989 klax5 // 136075 (c) 1989 klax5bl // bootleg klax5bl2 // bootleg +klax5bl3 // bootleg klaxd2 // 136075 (c) 1989 (Germany) klaxj3 // 136075 (c) 1989 (Japan) klaxj4 // 136075 (c) 1989 (Japan) @@ -18396,6 +18501,10 @@ koikoi // (c) 1983 Kiwako @source:konamigq.cpp cryptklr // Crypt Killer (GQ420 UAA) +@source:konamigs.cpp +ddrkids // 2000.?? Dance Dance Revolution Kids +musclhit // 2000.11 Muscle Ranking Kinniku Banzuke Spray Hitter + @source:konamigv.cpp btchamp // GV053, UAA01 hyperath // GV021, Japan 1.00 @@ -18471,6 +18580,7 @@ kbadlands // GX455 (c) 1984 kbadlandsh // GX455 (c) 1984 @source:konendev.cpp +konendev // Konami Endeavour BIOS aadvent // African Adventure dragnfly // Dragonfly enchlamp // Enchanted Lamp @@ -18498,6 +18608,7 @@ ddboya shuriboy fuusenpn tsukande +mariorou @source:konmedal68k.cpp kzaurus @@ -18791,6 +18902,7 @@ leappad // (c) 2001 LeapFrog / Knowledge Kids Enterprise leappadca // (c) 2004 LeapFrog mfleappad // (c) 2002 LeapFrog mfleappadus // (c) 2004 LeapFrog +ltleappad @source:leapster.cpp leapster // @@ -18812,7 +18924,8 @@ cupsoca // (c) 1992 Seibu cupsocb // (c) 1992 Seibu cupsocs // (c) 1992 Seibu cupsocs2 // (c) 1992 Seibu -denjinmk // (c) 199? Banpresto +denjinmk // (c) 1994 Banpresto +denjinmka // (c) 1994 Banpresto godzilla // (c) 1993 Banpresto grainbow // (c) 1993 Banpresto grainbowk // (c) 1993 Banpresto @@ -21615,6 +21728,8 @@ wmega // 1992 Sega Wondermega (Japan) wmegam2 // 1993 Victor Wondermega M2 (Japan) xeye // 1993 JVC X'eye (USA) dcat16 // +gen_nomd // 1995 Sega Genesis Nomad (USA) +megajet // 1993 Sega Mega Jet (Japan) @source:megadriv_acbl.cpp aladmdb // MegaDrive-based hack @@ -21780,6 +21895,12 @@ mekd5 // 1980 Motorola Evaluation Kit crzyddz2 // 2006 Sealy menghong // 2004? Sealy +@source:mephisto_berlin.cpp +berl16 // 1992 Mephisto Berlin 68000 +berlinp // 1994 Mephisto Berlin Pro 68020 +berl16l // 1996 Mephisto Berlin 68000 London Upgrade +berlinpl // 1996 Mephisto Berlin Pro London Upgrade + @source:mephisto_brikett.cpp mephisto mephisto2 @@ -21828,10 +21949,16 @@ gen32 // 1993 Mephisto Genius 68030 gen32l // 1996 Mephisto Genius 68030 London Upgrade lond16 // 1996 Mephisto London 16 Bit lond32 // 1996 Mephisto London 32 Bit -berl16 // 1992 Mephisto Berlin 68000 -berlinp // 1994 Mephisto Berlin Pro 68020 -berl16l // 1996 Mephisto Berlin 68000 London Upgrade -bpl32 // 1996 Mephisto Berlin Pro London Upgrade + +@source:mephisto_modular_tm.cpp +port32t +lyon32t +lyon32t8 +van32t +van32t8 +berl32t8p +lond32t +lond32t8 @source:mephisto_mondial68k.cpp mondl68k // 1988 Mephisto Mondial 68000XL @@ -21875,6 +22002,7 @@ dodgectyb // (c) 1986 Merit dodgectyc // (c) 1986 Merit dtrvwz5 // (c) 1987 Merit iowapp // (c) 1990 Merit +matchemg // (c) 1986 Merit misdraw // (c) 1986 Merit / Big Apple Games mdchoice // (c) 1983 Merit mpchoice // (c) 1983 Merit @@ -21971,6 +22099,10 @@ realbrod // (c) 1996 Merit realbroda // (c) 1995 Merit spitboss // (c) 1988 Merit +@source:merits.cpp +scrpiond // +scrpionda // + @source:meritum.cpp meritum1 // meritum2 // @@ -29125,6 +29257,7 @@ mrdot // 8201 (c) 1982 + Taito license mrdoy // 8201 (c) 1982 mrdu // bootleg mrlo // bootleg +mrdofabr // bootleg (Fabremar) yankeedo // bootleg @source:mrflea.cpp @@ -30021,6 +30154,7 @@ gamsharaj // 2002.08 Gamshara (10021 Ver.A) gjspace // 2001.12 Gekitoride-Jong Space (10011 Ver.A) g13jnc // 2001.?? Golgo 13: Juusei no Chinkonka (Japan, GLT1 VER.A) gunbalina // 2000.12 Gunbalina (GNN1 Ver.A) +kd2001 // 2011.1? Knock Down 2001 (KD11 Ver.B) knpuzzle // 2001.12 Kotoba no Puzzle Mojipittan (KPM1 Ver.A) konotako // 2003.?? Kono Tako (10021 Ver.A) mrdrilr2 // 2000.07 Mr Driller 2 (DR21 Ver.A) @@ -30033,6 +30167,7 @@ ptblank3 // 2000.12 Point Blank 3 (GNN2 Ver.A) sekaikh // 2004.04 Sekai Kaseki Hakken (Japan, SKH1 Ver.A) startrgn // 2002.07 Star Trigon (STT1 Ver.A) taiko6 // 2004.?? Taiko no Tatsujin 6 (Japan, TK61 Ver.A) +unks10md // 200?.?? unknown Namco System 10 medal game (MTL1 SPRB0) @source:namcos11.cpp danceyes // 1996.10 Dancing Eyes (US, DC3/VER.C) @@ -30311,7 +30446,8 @@ chocomk // 2002.06 Musapey's Choco Marker (Rev A) claychal // 2008.11 Sega Clay Challenge cleoftp // 2002.05 Cleopatra Fortune Plus clubk2k3 // 2003.?? Club Kart: European Session (2003, Rev A) -clubk2kp // 2003.?? Club Kart: European Session (2003, prototype) +clubk2kp // 2003.?? Club Kart: European Session (2003, prototype, set 1) +clubk2kpa // 2003.?? Club Kart: European Session (2003, prototype, set 2) clubkcyc // 2003.?? Club Kart Cycraft Edition (Rev A) clubkcyco // 2003.?? Club Kart Cycraft Edition clubkprz // 2003.?? Club Kart Prize @@ -30769,6 +30905,9 @@ ncd16 // 1989 Network Computing Devices ncd17c // 1990 Network Computing Devices ncd19 // 1990 Network Computing Devices +@source:ncd88k.cpp +ncd19c // + @source:ncdmips.cpp hmxpro // 1994 Network Computing Devices @@ -31130,6 +31269,9 @@ m82p // Nintendo M82 Display Unit PAL nes // Nintendo Entertainment System nespal // Nintendo Entertainment System PAL +@source:nes_boot.cpp +pjoypj001 + @source:nes_vt.cpp vdogdeme vdogdemo @@ -31138,11 +31280,14 @@ vtpinball // From V.R. Technology VT SDK vtsndtest // From V.R. Technology VT SDK vtboxing // From V.R. Technology VT SDK ablpinb +papsudok mc_dgear dgun2500 dgun2561 lxcmcy +lxcmc250 lxcmcysw +lxcmcyfz cybar120 mc_dg101 mc_aa2 @@ -31150,6 +31295,7 @@ mc_105te mc_sp69 polmega silv35 +lpgm240 mc_dcat8 mc_dcat8a pjoyn50 @@ -31171,11 +31317,14 @@ gprnrs16 ddrdismx // (c) 2006 Majesco / Konami [(c) 2001 Disney on title screen] ddrstraw // (c) 2006 Majesco / Konami majkon +majgnc +sudopptv ablping vgpocket vgpmini sy889 sy888b +rfcp168 dgun2573 bittboy mc_89in1 @@ -31195,8 +31344,14 @@ ts_handy11 @source:vt1682.cpp ii8in1 ii32in1 +zone7in1 miwi2_16 +miwi2_7 intact89 +intg5410 +exsprt48 +exsprt48a +wowwg @source:newbrain.cpp newbrain // @@ -31329,6 +31484,7 @@ grdnstrmj // (c) 1998 (Japan) grdnstrmk // (c) 1998 (Korea) grdnstrmv // (c) 1998 Apples Industries license gunnail // (c) 1993 NMK / Tecmo +gunnailp // (c) 1992 NMK gunnailb // bootleg hachamf // (c) 1991 NMK hachamfa // (c) 1991 NMK @@ -31486,8 +31642,8 @@ savant2 // @source:novag_sexpert.cpp sexperta // +sexperta1 // sexpertb // -sexpertb1 // sexpertc // sexpertc1 // sfortea // @@ -31496,6 +31652,12 @@ sfortea2 // sforteb // sfortec // +@source:novag_supremo.cpp +supremo + +@source:ns5652.cpp +ns5652 // + @source:nsg6809.cpp pitchhit // @@ -33124,6 +33286,7 @@ madrace // zira // @source:play_3.cpp +flashman // fldragon // fldragona // ironball // @@ -33767,6 +33930,9 @@ psionp350 // psionp464 // psionxp // +@source:psion5.cpp +psion5mx // + @source:psx.cpp psa // 1995 Sony PlayStation (Asia-Pacific) pse // 1995 Sony PlayStation (Europe) @@ -33788,6 +33954,10 @@ sol20 // @source:pturn.cpp pturn // (c) 1984 Jaleco +@source:pubint_storyreader.cpp +pi_stry +pi_stry2 + @source:pubtimed.cpp pubtimed // @@ -34051,6 +34221,7 @@ metamaq2 // Metamaquina 2 desktop 3d printer @source:rampart.cpp rampart // 136082 (c) 1990 rampart2p // 136082 (c) 1990 +rampart2pa // 136082 (c) 1990 rampartj // 136082 (c) 1990 (Japan) @source:ramtek.cpp @@ -34268,6 +34439,7 @@ stratvox // [1980 Sun Electronics] Taito stratvoxa // [1980 Sun Electronics] Taito stratvoxb // bootleg ttmahjng // 1981 Alpha Denshi Co. / Taito +vscompmj // 1981 Nichibutsu @source:rowamet.cpp heavymtl // @@ -34277,6 +34449,7 @@ cafebrk // "528" Mahjong Cafe Break (C) 1999 Nakanihon / cafedoll // "76" (c) 1993 Dynax cafepara // "001" 1999 Techno-Top cafetime // "63" (c) 1992 Dynax +chalgirl // bootleg daisyari // (c) 1989 Best System dondenmj // "03" (c) 1986 Dyna Electronics ippatsu // 01? (c) 1986 Dyna Electronics @@ -35163,9 +35336,10 @@ zektor // (c) 1982 @source:segahang.cpp endurob2 // (c) 1985 (Beta bootleg) endurobl // (c) 1985 (Herb bootleg) -enduror // (c) 1985 (YM2151, FD1089B) +enduror // (c) 1985 (Rev A, YM2151, FD1089B) enduror1 // (c) 1985 (YM2203, FD1089B) -endurora // (c) 1985 (YM2151, Mask ROM sprites, FD1089B) +endurora // (c) 1985 (Rev A, YM2151, Mask ROM sprites, FD1089B) +endurorb // (c) 1985 (YM2151, FD1089B) enduror1d // bootleg endurord // bootleg hangon // (c) 1985 (Rev A) @@ -35567,6 +35741,7 @@ loveber3 // loveber3cn // lovebero // lovebery // 2004.10 Oshare Majo Love and Berry / Fashionable Witch Love and Berry +mirworld // 2007.06 Mirage World (satellite) ochaken // segasp // tetgiano // @@ -35723,6 +35898,7 @@ seicross // (c) 1984 + Alice cupsocsb // bootleg cupsocsb2 // bootleg cupsocsb3 // bootleg +cupsocsb4 // bootleg @source:selz80.cpp dagz80 // @@ -36299,6 +36475,9 @@ skeetsht // (c) 1991 @source:skimaxx.cpp skimaxx // (c) 1996 Kyle Hodgetts/ICE +@source:skopro.cpp +drgdance // 2008 + @source:skullxbo.cpp skullxbo // 136072 (c) 1989 skullxbo1 // 136072 (c) 1989 @@ -37318,15 +37497,17 @@ srangerw // (c) 1988 SunA (WDK License) starfigh // (c) 1990 SunA @source:sunplus_gcm394.cpp +jak_s500 smartfp // Smart Fit Park wlsair60 // Wireless Air 60 wrlshunt // Wireless: Hunting Video Game System +tkmag220 // jak_car2 jak_gtg jak_tsm vbaby beambox - +bkrankp @source:supbtime.cpp chinatwn // MAK (c) 1991 Data East Corporation (Japan) @@ -38209,6 +38390,9 @@ tceptor2 // (c) 1986 @source:tdv2324.cpp tdv2324 // +@source:teamjocs.cpp +diaelite // + @source:tec1.cpp tec1 // Talking Electronics Computer tecjmon // Talking Electronics Computer @@ -38549,6 +38733,7 @@ bikkuric // Peni Soft (NOT Konami) chkun // Peni Soft (NOT Konami) psurge // (c) 1988 unknown (NOT Konami) spaceplt // bootleg +spaceplta // bootleg timeplt // GX393 (c) 1982 timeplta // GX393 (c) 1982 + Atari license timepltc // GX393 (c) 1982 + Centuri license @@ -38598,6 +38783,7 @@ spellb // spellb79 // @source:tk2000.cpp +mpf2 // Multitech MPF-II tk2000 // Microdigital TK2000 @source:tk635.cpp @@ -38858,6 +39044,7 @@ shippumd // (c) 1994 Raizing/8ing snowbro2 // TP-033 (c) 1994 Hanafram snowbro2b // snowbro2b2 // +snowbro2ny // TP-033 (c) 1994 Nyanko sstriker // (c) 1993 Raizing sstrikerk // (c) 1993 Raizing tekipaki // TP-020 (c) 1991 Toaplan @@ -39017,6 +39204,7 @@ trivrus // 2009 AGT. Trivia R Us @source:trkfldch.cpp trkfldch // (c) 2007 Konami my1stddr // (c) 2006 Konami +abl4play @source:trs80.cpp ht108064 // Hradstechnika Szvetkezet HT-1080Z/64 @@ -39170,6 +39358,9 @@ tv910 // tv912b // tv912c // +@source:tv924.cpp +tv924 // + @source:tv950.cpp tv950 // @@ -39657,8 +39848,20 @@ jak_capb // jak_spdmo // conyteni // conyping // +conyfght -@source:vii.cpp +@source:spg2xx.cpp +rad_skat // +rad_skatp // +rad_sktv // +rad_crik // +rad_fb2 // +mattelcs // +abltenni // +tvsprt10 // +wiwi18 // + +@source:spg2xx_jakks.cpp jak_batm // The Batman, 2004 jak_wall // jak_wwe // @@ -39681,35 +39884,70 @@ jak_pooh // jak_care // jak_nick // jak_sbfc // -lexizeus // Lexibook -vii // KenSingTon / Jungle Soft / Siatronics Vii + +@source:spg2xx_zone.cpp wirels60 // Wireless 60 zone40 // Zone 40 +reactmd +itvg49 zone60 // Zone 60 +zone100 // lx_jg7415 // -rad_skat // -rad_skatp // -rad_sktv // -rad_crik // -rad_fb2 // -mattelcs // -dreamlif // + +@source:spg2xx_zone_32bit.cpp +mywicodx // +zon32bit // Zone 32-bit + +@source:spg2xx_senario.cpp +senmil +senbbs +senapren +senpmate +sencosmo + +@source:spg2xx_senario_poker.cpp +sentx6p // +sentx6puk +sentx6pd + +@source:spg2xx_vii.cpp +vii // KenSingTon / Jungle Soft / Siatronics Vii + +@source:spg2xx_ican.cpp icanguit // icanpian // -tvgogo // + +@source:spg2xx_playvision.cpp pvmil // + +@source:spg2xx_shredmjr.cpp taikeegr // shredmjr // -sentx6p // + +@source:spg2xx_telestory.cpp +telestry // + +@source:spg2xx_tvgogo.cpp +tvgogo // + +@source:spg2xx_pdc.cpp +pdc100 +tmntpdc + +@source:spg2xx_dreamlife.cpp +dreamlif // + +@source:spg2xx_lexibook.cpp +lexizeus // Lexibook +lexiseal // @source:vsmile.cpp vsmile // -vsmilef // -vsmileg // vsmilem // @source:vsmileb.cpp vsmileb // +vsmilebs // vsmilebsw // @source:vsmilepro.cpp @@ -39880,6 +40118,12 @@ vstennisb // (c) 1984 Nintendo Co., Ltd. / Nintendo of Ame vstetris // (c) 1988 Atari wrecking // (c) 1984 Nintendo +@source:vt52.cpp +vt52 // 1975 Digital Equipment Corporation + +@source:vt62.cpp +vt62 // 1978 Digital Equipment Corporation + @source:vt100.cpp vt100 // 1978 Digital Equipment Corporation vt100ac // 1979 Digital Equipment Corporation @@ -40104,6 +40348,7 @@ lotr_sp6 // lotr_sp7 // lotr_sp8 // lotr_sp9 // +lotr3 // lotr401 // lotr410 // lotr5 // @@ -40864,7 +41109,10 @@ rad_snowp // rad_madf // rad_fb // rad_socr // +epo_bowl // +epo_esdx // epo_epp // +epo_eppk // epo_epp3 // epo_efdx // epo_ebox // @@ -40879,11 +41127,14 @@ rad_bdp // has_wamg // ltv_tam // tak_geig // +jarajal // +tcarnavi // ban_onep // ekara // ekaraa // ekaraj // ekarag // +ekaras // ekaraphs // epitch // ekaramix // diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 67500aa6b79..ab15fb5ae03 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -22,13 +22,16 @@ aci_ggm.cpp aci_prodigy.cpp acrnsys1.cpp acrnsys.cpp +actions_atj2279b.cpp acvirus.cpp adam.cpp +adm11.cpp adm23.cpp adm31.cpp adm36.cpp advision.cpp agat.cpp +aid80f.cpp aim65.cpp aim65_40.cpp akaiax80.cpp @@ -83,7 +86,9 @@ atarist.cpp atm.cpp atom.cpp atpci.cpp +att3b2.cpp att4425.cpp +att610.cpp att630.cpp attache.cpp aussiebyte.cpp @@ -94,6 +99,7 @@ b16.cpp b2m.cpp babbage.cpp banctec.cpp +bandai_design_master.cpp basic52.cpp bbc.cpp bbcbc.cpp @@ -309,6 +315,7 @@ geneve.cpp geniusiq.cpp geniusjr.cpp genpc.cpp +gigatron.cpp gimix.cpp gkidabc.cpp gizmondo.cpp @@ -484,12 +491,14 @@ mekd2.cpp mekd3.cpp mekd4.cpp mekd5.cpp +mephisto_berlin.cpp mephisto_brikett.cpp mephisto_glasgow.cpp mephisto_mm1.cpp mephisto_mm2.cpp mephisto_modena.cpp mephisto_modular.cpp +mephisto_modular_tm.cpp mephisto_mondial68k.cpp mephisto_montec.cpp mephisto_polgar.cpp @@ -568,13 +577,14 @@ nanos.cpp nascom1.cpp nc.cpp ncd68k.cpp +ncd88k.cpp ncdmips.cpp ncdppc.cpp nds.cpp neogeocd.cpp nes.cpp +nes_boot.cpp nes_vt.cpp -vt1682.cpp newbrain.cpp next.cpp nforcepc.cpp @@ -588,6 +598,8 @@ novag_diablo.cpp novag_presto.cpp novag_savant.cpp novag_sexpert.cpp +novag_supremo.cpp +ns5652.cpp o2.cpp ob68k1a.cpp octane.cpp @@ -683,9 +695,11 @@ proteus3.cpp ps2.cpp ps2sony.cpp psion.cpp +psion5.cpp psx.cpp pt68k4.cpp ptcsol.cpp +pubint_storyreader.cpp pulsar.cpp pv1000.cpp pv2000.cpp @@ -789,6 +803,21 @@ special.cpp specpls3.cpp spectrum.cpp spg110.cpp +spg2xx.cpp +spg2xx_dreamlife.cpp +spg2xx_ican.cpp +spg2xx_jakks.cpp +spg2xx_lexibook.cpp +spg2xx_pdc.cpp +spg2xx_playvision.cpp +spg2xx_senario.cpp +spg2xx_senario_poker.cpp +spg2xx_shredmjr.cpp +spg2xx_telestory.cpp +spg2xx_tvgogo.cpp +spg2xx_vii.cpp +spg2xx_zone.cpp +spg2xx_zone_32bit.cpp squale.cpp ssem.cpp st17xx.cpp @@ -893,6 +922,7 @@ tti.cpp tutor.cpp tv910.cpp tv912.cpp +tv924.cpp tv950.cpp tv955.cpp tv965.cpp @@ -944,11 +974,14 @@ vp60.cpp vsmile.cpp vsmileb.cpp vsmilepro.cpp +vt52.cpp +vt62.cpp vt100.cpp vt220.cpp vt240.cpp vt320.cpp vt520.cpp +vt1682.cpp vta2000.cpp vtech1.cpp vtech2.cpp diff --git a/src/mame/nl.lst b/src/mame/nl.lst index ae847034bcc..fe8a59900a2 100644 --- a/src/mame/nl.lst +++ b/src/mame/nl.lst @@ -20,6 +20,224 @@ 1942p // prototype 1942h // hack (Two Bit Score?) +/* FIXME: games commented out complain about being a clone of a game not in the driver */ + +@source:galaxian.cpp +600 // GX353 (c) 1981 Konami +amidar // GX337 (c) 1982 Konami +amidar1 // GX337 (c) 1981 Konami +amidarb // bootleg +amidaro // GX337 (c) 1982 Konami + Olympia license +amidars // GX337 (c) 1982 Konami +amidaru // GX337 (c) 1982 Konami + Stern license +amigo // bootleg +amigo2 // bootleg +anteater // (c) 1982 Tago +anteaterg // (c) 1983 TV-Tuning (F.E.G. license) +anteatergg // bootleg +anteateruk // (c) 1983 Free Enterprise Games +aracnis // bootleg +armorcar // (c) 1981 Stern +armorcar2 // (c) 1981 Stern +asideral // bootleg +astrians // +atlantis // (c) 1981 Comsoft +atlantis2 // (c) 1981 Comsoft +atlantisb // bootleg +azurian // (c) 1982 Rait Electronics Ltd +//batman2 // bootleg +blkhole // TDS (Tokyo Denshi Sekkei) & MINTS +bomber // +calipso // (c) 1982 Tago +catacomb // 1982 MTM Games +checkman // (c) 1982 Zilec-Zenitone +checkmanj // (c) 1982 Jaleco (Zenitone/Zilec in ROM CM4, and the programmer names) +chewing // ?? unknown +//devilfsg // (c) 1984 Vision / Artic (bootleg?) +dingo // (c) 1983 Ashby Computers and Graphics LTD. + Jaleco license +dingoe // (c) 1983 Ashby Computers and Graphics LTD. + Jaleco license +eagle // [1980] Centuri +eagle2 // [1980] Centuri +eagle3 // [1980] Centuri +exodus // Subelectro - bootleg? +explorer // bootleg +fantastc // (c) Taito (Brazil) - rewrite of Galaga +fantazia // bootleg +frogf // bootleg +frogg // bootleg +frogger // GX392 (c) 1981 Konami +froggeram // bootleg +froggermc // 800-3110 (c) 1981 Sega +froggers // bootleg +froggers1 // (c) 1981 Sega +froggers2 // 834-0068 (c) 1981 Sega +froggers3 // +froggrs // +froggervd // Video Dens +fourplay // multigame +galap1 // hack +galap4 // hack +galapx // hack +galaxbsf // hack +galaxbsf2 // bootleg +galaxian // (c) Namco +galaxiana // (c) Namco +galaxianbl // bootleg +galaxianbl2 // bootleg +galaxiani // (c) Irem +galaxianm // (c) Midway +galaxianmo // (c) Midway +galaxiant // (c) Taito +galaxrcgg // bootleg (Recreativos Covadonga) +galaxrf // bootleg (Recreativos Franco) +galaxrfgg // bootleg (Recreativos Franco) +galemp // (c) Taito do Brasil +galturbo // hack +//ghostmun // +gmgalax // bootleg +gteikoku // (c) Irem +gteikokub // bootleg +gteikokub2 // bootleg +gteikokub3 // bootleg (Honly Enterprises) +jumpbug // (c) 1981 Rock-ola +jumpbugb // (c) 1981 Sega +//jungsub // bootleg +kamakazi3 // Video Games (UK) Ltd., hack or bootleg? +kamikazp // bootleg (Potomac Games) +kingball // (c) 1980 Namco +kingballj // (c) 1980 Namco +kong // (c) Taito (Brazil) - rewrite of Donkey Kong +//ladybugg // bootleg +levers // (c) 1983 Rock-ola +losttomb // (c) 1982 Stern +losttombh // (c) 1982 Stern +luctoday // 1980 Sigma +mandinga // bootleg (Artemi) +mandingaeg // bootleg (Electrogame) +mandingarf // bootleg (Recreativos Franco S.A.) +mandingac // bootleg (Centromatic) +mltiwars // bootleg (Gayton Games) +monsterz // (c) 1982 Nihon (Arcade TV Game List - P.102, Left, 20 from top) +moonal2 // [1980] Nichibutsu +moonal2b // [1980] Nichibutsu +moonaln // [Nichibutsu] (Karateco license) or hack +mooncmw // bootleg +mooncptc // bootleg (Petaco S.A.) +mooncreg // bootleg +mooncrgx // bootleg +mooncrs2 // bootleg +mooncrs3 // bootleg +mooncrs4 // bootleg +mooncrs5 // bootleg +mooncrsb // bootleg +mooncrsl // bootleg (Laguna S.A.) +mooncrst // (c) 1980 Nichibutsu +mooncrstg // (c) 1980 Gremlin +mooncrstso // (c) 1980 SegaSA / Sonic +mooncrsto // (c) 1980 Nichibutsu +mooncrstu // (c) 1980 Nichibutsu USA +mooncrstuk // (c) 1980 Nichibutsu UK +mooncrstuku // (c) 1980 Nichibutsu UK +moonqsr // (c) 1980 Nichibutsu +moonwar // (c) 1981 Stern +moonwara // (c) 1981 Stern +mshuttle // (c) 1981 Nichibutsu +mshuttle2 // (c) 1981 Nichibutsu +mshuttlea // (c) 1981 Nichibutsu +mshuttlej // (c) 1981 Nichibutsu +mshuttlej2 // (c) 1981 Nichibutsu +ncentury // bootleg (Petaco S.A.) +offensiv // bootleg (Video Dens) +omegab // bootleg +omni // bootleg +orbitron // (c) 1982 Signatron USA (Arcade Tv Game List - P.160, Left, 22 from top) +//pacmanbl // bootleg +//pacmanbla // bootleg +//pacmanblb // bootleg +//pacmanblv // bootleg (Video Dens) +pajaroes // bootleg +//phoenxp2 // bootleg +pisces // Subelectro +piscesb // bootleg +quaak // bootleg +redufo // (c) Artic +redufob // bootleg +redufob2 // bootleg +scobra // GX316 (c) 1981 Konami +scobrab // GX316 (c) 1981 Karateco (bootleg?) +scobrae // GX316 (c) 1981 Stern +scobrae2 // +scobrag // AVG by Zaccaria (bootleg?) +scobraggi // bootleg (Cocamatic) +scobras // GX316 (c) 1981 Stern +scobrase // GX316 (c) 1981 Sega +scorpion // (c) 1982 Zaccaria +scorpiona // (c) 1982 Zaccaria +scorpionb // (c) 1982 Zaccaria +scorpionmc // bootleg +scramble // GX387 (c) 1981 Konami +scramblebb // bootleg? +kamikazesp // bootleg (Euromatic S.A.) +scramblebf // bootleg +scrambles // GX387 (c) 1981 Stern +scrambles2 // GX387 (c) 1981 Stern +scrambp // bootleg (Billport S.A.) +scramce // bootleg (Centromatic S.A.) +scrammr // bootleg (Model Racing) +scrampt // bootleg (Petaco S.A.) +scramrf // bootleg (Recreativos Franco) +sfx // (c) 1983 Nichibutsu +skelagon // (c) 1983 Nichibutsu USA +skybase // (c) 1982 Omori Electric Co., Ltd. +skyraidr // bootleg +smooncrs // Gremlin +spacbat2 // bootleg +spacbatt // bootleg +spacempr // bootleg +spactrai // +spcdrag // bootleg +spcdraga // bootleg +spctbird // (c) Fortrek +spdcoin // (c) 1984 Stern +sstarcrs // Taito (Brazil) +starfght // hack +starfgmc // bootleg +stera // bootleg +streakng // [1980] Shoei +streaknga // [1980] Shoei +strfbomb // bootleg +superbon // bootleg +superg // hack +supergs // Silver Systems hack +supergx // [1980] Nichibutsu +suprheli // bootleg +swarm // hack +tazmania // (c) 1982 Stern +tdpgal // 1983 Design Labs / Thomas Automatics +tenspot // (c) 1982 Thomas Automatics +theend // (c) 1980 Konami +takeoff // (c) 1980 Sidam (bootleg) +theends // (c) 1980 Stern +//thepitm // bootleg +timefgtr // (c) Taito (Brazil) - rewrite of Time Pilot +tst_galx // Galaxian Test ROM +turpin // (c) 1981 Sega +turpins // (c) 1981 bootleg +turtles // (c) 1981 Stern +uniwars // (c) Irem +uniwarsa // (c) Karateco +victoryc // (c) Comsoft +victorycb // (c) Comsoft (bootleg) +videight // multigame +warofbug // (c) 1981 Armenia +warofbugg // German Version +warofbugu // (c) 1981 Armenia +zerotime // hack (Petaco S.A.) +zerotimed // hack (Datamat) +zerotimemc // hack (Marti Colls) +zigzagb // (c) 1982 LAX (bootleg) +zigzagb2 // (c) 1982 LAX (bootleg) + @source:gamemachine.cpp 2001tgm // @@ -72,6 +290,150 @@ popeyej popeyejo popeyehs +@source:segas16b.cpp +aceattac // (c) 1988 (FD1094) +//afightere +//afighterf +//afighterg +//afighterh +aliensyn // (c) 1987 (Unprotected) +aliensyn3 // (c) 1987 (FD1089A) +aliensyn7 // (c) 1987 (MC-8123B) +aliensynj // (c) 1987 (FD1089A) +altbeast // (c) 1988 (8751) +altbeast2 // (c) 1988 (MC-8123B) +altbeast4 // (c) 1988 (MC-8123B) +altbeast5 // (c) 1988 (FD1094) +altbeast5d // +altbeast6 // (c) 1988 (8751) +altbeastj // (c) 1988 (8751) +altbeastj1 // (c) 1988 (protected) +altbeastj3 // (c) 1988 (FD1094) +altbeastj3d // +atomicp // (c) 1990 Philko - korean clone board +aurail // (c) 1990 Sega / Westone +aurail1 // (c) 1990 Sega / Westone (FD1089B) +aurail1d // +aurailj // (C) 1990 Sega / Westone (FD1089A) +aurailjd // +bayroute // (c) 1989 Sunsoft / Sega (FD1094) +bayroute1 // (c) 1989 Sunsoft / Sega (Unprotected) +bayrouted // +bayroutej // (c) 1989 Sunsoft / Sega (FD1094) +bayroutejd // +bullet // (c) 1987 (FD1094) +bulletd // +cencourt // (c) 1988 (MC-8123B) +cotton // (c) 1990 (FD1094) +cottond // +cottonj // (c) 1990 (FD1094) +cottonja // (c) 1990 (FD1094) +cottonjad // +cottonjd // +cottonu // (c) 1990 (FD1094) +cottonud // +ddux // (c) 1989 (FD1094) +ddux1 // (c) 1989 (8751) +dduxd // +dduxj // (c) 1989 (FD1094) +dduxjd // +//defense // (c) 1987 (FD1094) +dfjail // +dunkshot // (c) 1986 (FD1089A) +dunkshota // (c) 1986 (FD1089A) +dunkshoto // (c) 1986 (FD1089A) +eswat // (c) 1989 (FD1094) +eswatd // +eswatj // (c) 1989 (FD1094) +eswatj1 // (c) 1989 (FD1094) +eswatj1d // +eswatjd // +eswatu // (c) 1989 (FD1094) +eswatud // +exctleag // (c) 1988 (FD1094) +exctleagd // +fantzn2x // (c) 2008 Sega / M2 +fantzn2xp // (c) 2008 Sega / M2 +//fantzoneta // (c) 2008 Sega / M2 (bootleg conversion) +fpoint // (c) 1989 (Japan, FD1094) +fpoint1 // (c) 1989 (Japan, FD1094) +fpoint1d // +fpointbj // (c) 1989 (Datsu bootleg, Japan) +fpointbl // (c) 1989 (Datsu bootleg) +fpointbla // +fpointd // +goldnaxe // (c) 1989 (8751) +goldnaxe1 // (c) 1989 (FD1094) +goldnaxe1d // +goldnaxe2 // (c) 1989 (8751) +goldnaxe3 // (c) 1989 (FD1094) +goldnaxe3d // +goldnaxej // (c) 1989 (FD1094) +goldnaxejd // +goldnaxeu // (c) 1989 (FD1094) +goldnaxeud // +hwchamp // (c) 1987 (Unprotected) +hwchampj // (c) 1987 (FD1094) +hwchampjd // +isgsm // +lockonph // +mvp // (c) 1989 (FD1094) +mvpd // +mvpj // (c) 1989 (FD1094) +mvpjd // +passsht // (c) 1988 (FD1094) +passshta // (c) 1988 (FD1094) +passshtad // +passshtd // +passshtj // (c) 1988 (FD1094) +passshtjd // +riotcity // (c) 1991 Sega / Westone (Unprotected) +ryukyu // (c) 1990 (FD1094) +ryukyua // (c) 1990 (FD1094) +ryukyud // +//sdib // (c) 1987 (FD1089A) +//sdibl // (c) 1987 bootleg +//sdibl2 // bootleg +//sdibl3 // bootleg +//sdibl4 // bootleg +//sdibl5 // bootleg +//sdibl6 // bootleg +shinfz // +//shinobi2 // (c) 1987 (FD1094) +//shinobi2d // +//shinobi3 // (c) 1987 (MC-8123B) +//shinobi4 // (c) 1987 (MC-8123B) +//shinobi5 // (c) 1987 (Unprotected) +//shinobi6 // (c) 1987 (Unprotected) +sjryuko // (c) 1988 White Board (FD1094) +snapper // (c) 1990 Philko - korean clone board +sonicbom // (c) 1987 (FD1094) +sonicbomd // +suprleag // (c) 1987 (FD1094) +tetrbx // +//tetris1 // (c) 1988 (FD1094) S16B +//tetris1d // +//tetris2 // (c) 1988 (FD1094) S16B +//tetris2d // +timescan // (c) 1987 (Unprotected) +toryumon // (c) 1995 (Unprotected) +tturf // (c) 1989 Sega / Sunsoft (8751) +tturfu // (c) 1989 Sega / Sunsoft (8751) +ultracin // (c) 1996 Sega (Unprotected) +wb3 // (c) 1988 Sega / Westone (8751) +wb32 // (c) 1988 Sega / Westone (FD1094) +wb32d // +wb33 // (c) 1988 Sega / Westone (FD1094) +wb33d // +wb34 // (c) 1988 Sega / Westone (FD1094) +wb34d // +wrestwar // (c) 1989 (8751) +wrestwar1 // (c) 1989 (FD1094) +wrestwar1d // +wrestwar2 // (c) 1989 (FD1094) +wrestwar2d // + + @source:testpat.cpp tp1983 tp1985 diff --git a/src/mame/video/3dom2_te.cpp b/src/mame/video/3dom2_te.cpp index 2f3b33cbd2f..5b6d6b633e5 100644 --- a/src/mame/video/3dom2_te.cpp +++ b/src/mame/video/3dom2_te.cpp @@ -11,7 +11,7 @@ #include "machine/3dom2.h" -#include <math.h> +#include <cmath> /* TODO: @@ -1224,9 +1224,9 @@ void m2_te_device::setup_triangle(uint32_t flags) if ((vb.y - vc.y) < 0.0f) a |= 2; if ((vc.y - va.y) < 0.0f) a |= 1; - const se_vtx *v1 = NULL; - const se_vtx *v2 = NULL; - const se_vtx *v3 = NULL; + const se_vtx *v1 = nullptr; + const se_vtx *v2 = nullptr; + const se_vtx *v3 = nullptr; switch (a) { diff --git a/src/mame/video/apple2.cpp b/src/mame/video/apple2.cpp index a42a1f3e2c4..49dc2408b59 100644 --- a/src/mame/video/apple2.cpp +++ b/src/mame/video/apple2.cpp @@ -985,7 +985,7 @@ void a2_video_device::hgr_update_tk2000(screen_device &screen, bitmap_ind16 &bit } break; - case 1: + case 1: w >>= 7; if (vram_row[col] & 0x80) { @@ -1142,8 +1142,8 @@ void a2_video_device::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, c } /* - Latest Apple II NTSC palette from "Apple II Video Display Theory" - https://docs.google.com/spreadsheets/d/1rKR6A_bVniSCtIP_rrv8QLWJdj4h6jEU1jJj0AebWwg/ + Latest Apple II NTSC palette from "Apple II Video Display Theory" + https://docs.google.com/spreadsheets/d/1rKR6A_bVniSCtIP_rrv8QLWJdj4h6jEU1jJj0AebWwg/ */ static const rgb_t apple2_palette[] = { diff --git a/src/mame/video/armedf.cpp b/src/mame/video/armedf.cpp index d89789a9d31..868014e9eb4 100644 --- a/src/mame/video/armedf.cpp +++ b/src/mame/video/armedf.cpp @@ -35,8 +35,8 @@ TILEMAP_MAPPER_MEMBER(armedf_state::armedf_scan_type3) TILE_GET_INFO_MEMBER(armedf_state::get_nb1414m4_tx_tile_info) { - int tile_number = m_text_videoram[tile_index] & 0xff; - int attributes; + u8 tile_number = m_text_videoram[tile_index] & 0xff; + u8 attributes; /* TODO: Armed F doesn't seem to use the NB1414M4! */ //if (m_scroll_type == 1) @@ -46,7 +46,7 @@ TILE_GET_INFO_MEMBER(armedf_state::get_nb1414m4_tx_tile_info) attributes = m_text_videoram[tile_index + 0x400] & 0xff; // TODO: skip drawing the NB1414M4 params, how the HW actually handles this? - if(tile_index < 0x12) + if (tile_index < 0x12) tile_number = attributes = 0x00; } @@ -61,8 +61,8 @@ TILE_GET_INFO_MEMBER(armedf_state::get_nb1414m4_tx_tile_info) TILE_GET_INFO_MEMBER(armedf_state::get_armedf_tx_tile_info) { - int tile_number = m_text_videoram[tile_index] & 0xff; - int attributes; + u8 tile_number = m_text_videoram[tile_index] & 0xff; + u8 attributes; /* TODO: Armed F doesn't seem to use the NB1414M4! */ //if (m_scroll_type == 1) @@ -71,7 +71,7 @@ TILE_GET_INFO_MEMBER(armedf_state::get_armedf_tx_tile_info) //{ // attributes = m_text_videoram[tile_index + 0x400] & 0xff; // - // if(tile_index < 0x12) /* don't draw the NB1414M4 params! TODO: could be a better fix */ + // if (tile_index < 0x12) /* don't draw the NB1414M4 params! TODO: could be a better fix */ // tile_number = attributes = 0x00; //} @@ -87,7 +87,7 @@ TILE_GET_INFO_MEMBER(armedf_state::get_armedf_tx_tile_info) TILE_GET_INFO_MEMBER(armedf_state::get_fg_tile_info) { - int data = m_fg_videoram[tile_index]; + const u16 data = m_fg_videoram[tile_index]; SET_TILE_INFO_MEMBER(1, data&0x7ff, data>>11, @@ -97,7 +97,7 @@ TILE_GET_INFO_MEMBER(armedf_state::get_fg_tile_info) TILE_GET_INFO_MEMBER(armedf_state::get_bg_tile_info) { - int data = m_bg_videoram[tile_index]; + const u16 data = m_bg_videoram[tile_index]; SET_TILE_INFO_MEMBER(2, data & 0x3ff, data >> 11, @@ -128,11 +128,6 @@ VIDEO_START_MEMBER(armedf_state,terraf) if (m_scroll_type != 1) m_tx_tilemap->set_scrollx(0, -128); - - m_text_videoram = std::make_unique<uint8_t[]>(0x1000); - memset(m_text_videoram.get(), 0x00, 0x1000); - - save_pointer(NAME(m_text_videoram), 0x1000); } VIDEO_START_MEMBER(armedf_state,armedf) @@ -150,11 +145,6 @@ VIDEO_START_MEMBER(armedf_state,armedf) if (m_scroll_type != 1) m_tx_tilemap->set_scrollx(0, -128); - - m_text_videoram = std::make_unique<uint8_t[]>(0x1000); - memset(m_text_videoram.get(), 0x00, 0x1000); - - save_pointer(NAME(m_text_videoram), 0x1000); } /*************************************************************************** @@ -163,88 +153,70 @@ VIDEO_START_MEMBER(armedf_state,armedf) ***************************************************************************/ -READ8_MEMBER(armedf_state::nb1414m4_text_videoram_r) -{ - return m_text_videoram[offset]; -} - -WRITE8_MEMBER(armedf_state::nb1414m4_text_videoram_w) -{ - m_text_videoram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset & 0x7ff); -} - -READ8_MEMBER(armedf_state::armedf_text_videoram_r) +u8 armedf_state::text_videoram_r(offs_t offset) { return m_text_videoram[offset]; } -WRITE8_MEMBER(armedf_state::armedf_text_videoram_w) +void armedf_state::text_videoram_w(offs_t offset, u8 data) { m_text_videoram[offset] = data; m_tx_tilemap->mark_tile_dirty(offset & 0x7ff); } -WRITE16_MEMBER(armedf_state::armedf_fg_videoram_w) +void armedf_state::fg_videoram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_fg_videoram[offset]); m_fg_tilemap->mark_tile_dirty(offset); } -WRITE16_MEMBER(armedf_state::armedf_bg_videoram_w) +void armedf_state::bg_videoram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_bg_videoram[offset]); m_bg_tilemap->mark_tile_dirty(offset); } -WRITE16_MEMBER(armedf_state::terraf_fg_scrolly_w) +void armedf_state::terrafb_fg_scrolly_w(u8 data) { - if (ACCESSING_BITS_8_15) - { - m_fg_scrolly = ((data >> 8) & 0xff) | (m_fg_scrolly & 0x300); - m_waiting_msb = 1; - } + m_fg_scrolly = (data & 0xff) | (m_fg_scrolly & 0x300); + m_waiting_msb = 1; } -WRITE16_MEMBER(armedf_state::terraf_fg_scrollx_w) +void armedf_state::terrafb_fg_scrollx_w(u8 data) { - if (ACCESSING_BITS_8_15) + if (m_waiting_msb) { - if (m_waiting_msb) - { - m_scroll_msb = data >> 8; - m_fg_scrollx = (m_fg_scrollx & 0xff) | (((m_scroll_msb >> 4) & 3) << 8); - m_fg_scrolly = (m_fg_scrolly & 0xff) | (((m_scroll_msb >> 0) & 3) << 8); - //popmessage("%04X %04X %04X",data,m_fg_scrollx,m_fg_scrolly); - } - else - m_fg_scrollx = ((data >> 8) & 0xff) | (m_fg_scrollx & 0x300); + m_scroll_msb = data; + m_fg_scrollx = (m_fg_scrollx & 0xff) | (((m_scroll_msb >> 4) & 3) << 8); + m_fg_scrolly = (m_fg_scrolly & 0xff) | (((m_scroll_msb >> 0) & 3) << 8); + //popmessage("%04X %04X %04X",data,m_fg_scrollx,m_fg_scrolly); } + else + m_fg_scrollx = (data & 0xff) | (m_fg_scrollx & 0x300); } -WRITE16_MEMBER(armedf_state::terraf_fg_scroll_msb_arm_w) +void armedf_state::terrafb_fg_scroll_msb_arm_w(u8 data) { - if (ACCESSING_BITS_8_15) - m_waiting_msb = 0; + m_waiting_msb = 0; } -WRITE16_MEMBER(armedf_state::armedf_fg_scrollx_w) +void armedf_state::fg_scrollx_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_fg_scrollx); } -WRITE16_MEMBER(armedf_state::armedf_fg_scrolly_w) +void armedf_state::fg_scrolly_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_fg_scrolly); } -WRITE16_MEMBER(armedf_state::armedf_bg_scrollx_w) +void armedf_state::bg_scrollx_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_bg_scrollx); m_bg_tilemap->set_scrollx(0, m_bg_scrollx); } -WRITE16_MEMBER(armedf_state::armedf_bg_scrolly_w) +void armedf_state::bg_scrolly_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_bg_scrolly); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); @@ -260,11 +232,14 @@ WRITE16_MEMBER(armedf_state::armedf_bg_scrolly_w) /* custom code to handle color cycling effect, handled by m_spr_pal_clut */ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx, - uint32_t code,uint32_t color, uint32_t clut,int flipx,int flipy,int offsx,int offsy, - int transparent_color) + u32 code,u32 color, u32 clut,int flipx,int flipy,int offsx,int offsy, + bitmap_ind8 &primap, u32 pmask, int transparent_color) { + // high bit of the mask is implicitly on + pmask |= 1 << 31; + const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint8_t *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); int x_index_base, y_index, sx, sy, ex, ey; int xinc, yinc; @@ -311,15 +286,19 @@ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,g { for (y = sy; y < ey; y++) { - const uint8_t *source = source_base + y_index*gfx->rowbytes(); - uint16_t *dest = &dest_bmp.pix16(y); + const u8 *source = source_base + y_index*gfx->rowbytes(); + u16 *dest = &dest_bmp.pix16(y); + u8 *destpri = &primap.pix8(y); int x_index = x_index_base; for (x = sx; x < ex; x++) { int c = (source[x_index] & ~0xf) | ((m_spr_pal_clut[clut*0x10+(source[x_index] & 0xf)]) & 0xf); if (c != transparent_color) - dest[x] = pal[c]; - + { + if (((1 << (destpri[x] & 0x1f)) & pmask) == 0) + dest[x] = pal[c]; + destpri[x] = 0x1f; + } x_index += xinc; } y_index += yinc; @@ -329,13 +308,13 @@ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,g } -void armedf_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ) +void armedf_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &primap ) { - uint16_t *buffered_spriteram = m_spriteram->buffer(); - int offs; + u16 *buffered_spriteram = m_spriteram->buffer(); - for (offs = 0; offs < m_spriteram->bytes() / 2; offs += 4) + for (int offs = (m_spriteram->bytes() / 2) - 4; offs >= 0; offs -= 4) { + u32 pmask = 0; int code = buffered_spriteram[offs + 1]; /* ??YX?TTTTTTTTTTT */ int flipx = code & 0x2000; int flipy = code & 0x1000; @@ -343,6 +322,18 @@ void armedf_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect int clut = (buffered_spriteram[offs + 2]) & 0x7f; int sx = buffered_spriteram[offs + 3]; int sy = m_sprite_offy + 240 - (buffered_spriteram[offs + 0] & 0x1ff); + int pri = ((buffered_spriteram[offs + 0] & 0x3000) >> 12); + if (pri == 3) // mimic previous driver behavior, correct? + continue; + + if (pri >= 1) + pmask |= GFX_PMASK_4; + if (pri >= 2) + pmask |= GFX_PMASK_2; + /* + if (pri >= 3) + pmask |= GFX_PMASK_1; + */ if (flip_screen()) { @@ -352,18 +343,15 @@ void armedf_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect flipy = !flipy; /* in all the games supported by this driver */ } - if (((buffered_spriteram[offs + 0] & 0x3000) >> 12) == priority) - { - armedf_drawgfx(bitmap,cliprect,m_gfxdecode->gfx(3), - code & 0xfff, - color,clut, - flipx,flipy, - sx,sy,15); - } + armedf_drawgfx(bitmap,cliprect,m_gfxdecode->gfx(3), + code & 0xfff, + color,clut, + flipx,flipy, + sx,sy,primap,pmask,15); } } -uint32_t armedf_state::screen_update_armedf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 armedf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int sprite_enable = m_vreg & 0x200; @@ -375,7 +363,7 @@ uint32_t armedf_state::screen_update_armedf(screen_device &screen, bitmap_ind16 { case 0: /* terra force, kozure ookami */ case 2: /* legion */ - case 3: /* crazy climber */ + case 3: /* crazy climber 2 */ m_fg_tilemap->set_scrollx(0, (m_fg_scrollx & 0x3ff)); m_fg_tilemap->set_scrolly(0, (m_fg_scrolly & 0x3ff)); break; @@ -387,24 +375,16 @@ uint32_t armedf_state::screen_update_armedf(screen_device &screen, bitmap_ind16 } - bitmap.fill(0xff, cliprect ); - - m_tx_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1), 0); - - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - if (sprite_enable) - draw_sprites(bitmap, cliprect, 2); - - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - if (sprite_enable) - draw_sprites(bitmap, cliprect, 1); + screen.priority().fill(0, cliprect); + bitmap.fill(0xff, cliprect); - m_tx_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_CATEGORY(0), 0); + m_tx_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1), 1); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2); + m_tx_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_CATEGORY(0), 4); if (sprite_enable) - draw_sprites(bitmap, cliprect, 0); + draw_sprites(bitmap, cliprect, screen.priority()); return 0; } diff --git a/src/mame/video/atarisy1.cpp b/src/mame/video/atarisy1.cpp index a625f752c43..bdbbc1d35ed 100644 --- a/src/mame/video/atarisy1.cpp +++ b/src/mame/video/atarisy1.cpp @@ -396,6 +396,10 @@ READ16_MEMBER( atarisy1_state::atarisy1_int3state_r ) void atarisy1_state::update_timers(int scanline) { +} + +void atarisy1r_state::update_timers(int scanline) +{ int offset = m_mob->bank() * 64 * 4; int link = 0, best = scanline, found = 0; uint8_t spritevisit[64]; diff --git a/src/mame/video/elan_eu3a05vid.cpp b/src/mame/video/elan_eu3a05vid.cpp index 31b4c054f33..689f4b14a9b 100644 --- a/src/mame/video/elan_eu3a05vid.cpp +++ b/src/mame/video/elan_eu3a05vid.cpp @@ -8,12 +8,15 @@ DEFINE_DEVICE_TYPE(ELAN_EU3A05_VID, elan_eu3a05vid_device, "elan_eu3a05vid", "El // tilemaps start at 0x0600 in mainram, sprites at 0x3e00, unlike eu3a14 these could be fixed addresses -elan_eu3a05vid_device::elan_eu3a05vid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : elan_eu3a05commonvid_device(mconfig, ELAN_EU3A05_VID, tag, owner, clock), +elan_eu3a05vid_device::elan_eu3a05vid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + elan_eu3a05commonvid_device(mconfig, ELAN_EU3A05_VID, tag, owner, clock), device_memory_interface(mconfig, *this), m_cpu(*this, finder_base::DUMMY_TAG), m_bank(*this, finder_base::DUMMY_TAG), - m_space_config("regs", ENDIANNESS_NATIVE, 8, 5, 0, address_map_constructor(FUNC(elan_eu3a05vid_device::map), this)) + m_space_config("regs", ENDIANNESS_NATIVE, 8, 5, 0, address_map_constructor(FUNC(elan_eu3a05vid_device::map), this)), + m_bytes_per_tile_entry(4), + m_vrambase(0x600), + m_spritebase(0x3e00) { } @@ -72,12 +75,20 @@ void elan_eu3a05vid_device::device_reset() for (int i=0;i<2;i++) m_splitpos[i] = 0x00; + +} + +void elan_eu3a05vid_device::set_is_sudoku() +{ + m_bytes_per_tile_entry = 2; + m_vrambase = 0x200; + m_spritebase = 0x1000; } uint8_t elan_eu3a05vid_device::read_spriteram(int offset) { address_space& cpuspace = m_cpu->space(AS_PROGRAM); - int realoffset = offset+0x3e00; + int realoffset = offset+m_spritebase; if (realoffset < 0x4000) { return cpuspace.read_byte(realoffset); @@ -90,7 +101,7 @@ uint8_t elan_eu3a05vid_device::read_spriteram(int offset) uint8_t elan_eu3a05vid_device::read_vram(int offset) { address_space& cpuspace = m_cpu->space(AS_PROGRAM); - int realoffset = offset+0x0600; + int realoffset = offset+m_vrambase; if (realoffset < 0x4000) { return cpuspace.read_byte(realoffset); @@ -259,12 +270,20 @@ void elan_eu3a05vid_device::draw_sprites(screen_device &screen, bitmap_ind16 &bi // a hacky mess for now bool elan_eu3a05vid_device::get_tile_data(int base, int drawpri, int& tile, int &attr, int &unk2) { - tile = read_vram(base * 4) + (read_vram((base * 4) + 1) << 8); + tile = read_vram(base * m_bytes_per_tile_entry) + (read_vram((base * m_bytes_per_tile_entry) + 1) << 8); // these seem to be the basically the same as attr/unk2 in the sprites, which also make // very little sense. - attr = read_vram((base * 4) + 2); - unk2 = read_vram((base * 4) + 3); + if (m_bytes_per_tile_entry == 4) + { + attr = read_vram((base * m_bytes_per_tile_entry) + 2); + unk2 = read_vram((base * m_bytes_per_tile_entry) + 3); + } + else + { + attr = 0; + unk2 = 0; + } /* hack for phoenix title screens.. the have attr set to 0x3f which change the colour bank in ways we don't want and also by our interpretation of 0x0f bits sets the tiles to priority over sprites (although in this case diff --git a/src/mame/video/elan_eu3a05vid.h b/src/mame/video/elan_eu3a05vid.h index 00332fe63ad..9c8d82a888f 100644 --- a/src/mame/video/elan_eu3a05vid.h +++ b/src/mame/video/elan_eu3a05vid.h @@ -20,6 +20,8 @@ public: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void set_is_sudoku(); + protected: // device-level overrides virtual void device_start() override; @@ -75,6 +77,10 @@ private: DECLARE_READ8_MEMBER(read_unmapped); DECLARE_WRITE8_MEMBER(write_unmapped); + + int m_bytes_per_tile_entry; + int m_vrambase; + int m_spritebase; }; DECLARE_DEVICE_TYPE(ELAN_EU3A05_VID, elan_eu3a05vid_device) diff --git a/src/mame/video/electron.cpp b/src/mame/video/electron.cpp index a5050c3bcf4..e506a4e930c 100644 --- a/src/mame/video/electron.cpp +++ b/src/mame/video/electron.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol +// copyright-holders:Wilbert Pol, Nigel Barnes /****************************************************************************** Acorn Electron driver diff --git a/src/mame/video/galivan.cpp b/src/mame/video/galivan.cpp index 28f6c367257..bddac18114f 100644 --- a/src/mame/video/galivan.cpp +++ b/src/mame/video/galivan.cpp @@ -196,7 +196,7 @@ TILE_GET_INFO_MEMBER(galivan_state::ninjemak_get_tx_tile_info) // TODO: skip drawing the NB1414M4 params, how the HW actually handles this? if (index < 0x12) index = 0x12; - + int attr = m_videoram[index + 0x400]; int code = m_videoram[index] | ((attr & 0x03) << 8); SET_TILE_INFO_MEMBER(0, diff --git a/src/mame/video/galpani2.cpp b/src/mame/video/galpani2.cpp index ec950a0a7b6..63bf9edb0b4 100644 --- a/src/mame/video/galpani2.cpp +++ b/src/mame/video/galpani2.cpp @@ -140,6 +140,10 @@ if (machine().input().code_pressed(KEYCODE_Z)) if (layers_ctrl & 0x1) copybg15(screen, bitmap, cliprect); if (layers_ctrl & 0x2) copybg8(screen, bitmap, cliprect, 0); if (layers_ctrl & 0x4) copybg8(screen, bitmap, cliprect, 1); - if (layers_ctrl & 0x8) m_kaneko_spr->render_sprites(bitmap, cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + if (layers_ctrl & 0x8) + { + m_kaneko_spr->render_sprites(cliprect, m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->copybitmap(bitmap, cliprect, screen.priority()); + } return 0; } diff --git a/src/mame/video/homedata.cpp b/src/mame/video/homedata.cpp index 41b3bbfc7ce..de4fe30f65d 100644 --- a/src/mame/video/homedata.cpp +++ b/src/mame/video/homedata.cpp @@ -148,7 +148,7 @@ void homedata_state::reikaids_handleblit( int rom_base ) dest_addr = (dest_param & 0x3fff); flipx = (dest_param & 0x8000); -// logerror( "[blit %02x %04x %04x]\n",blitter_bank,source_addr,dest_param); + //logerror( "[blit %02x %04x %04x]\n",m_blitter_bank,source_addr,dest_param); if (m_visible_page == 0) base_addr += 0x2000 << 2; @@ -452,7 +452,7 @@ inline void homedata_state::reikaids_info( tile_data &tileinfo, int tile_index, } /* reikaids_gfx_bank[0]: - * -xxx.x--- layer#1 + * xxxx.x--- layer#1 * ----.-xxx layer#3 * * reikaids_gfx_bank[1]: @@ -471,12 +471,12 @@ TILE_GET_INFO_MEMBER(homedata_state::reikaids_get_info1_0) TILE_GET_INFO_MEMBER(homedata_state::reikaids_get_info0_1) { - reikaids_info(tileinfo, tile_index, 0, 1, ((m_gfx_bank[0] & 0x78) >> 3)); + reikaids_info(tileinfo, tile_index, 0, 1, ((m_gfx_bank[0]) >> 3)); } TILE_GET_INFO_MEMBER(homedata_state::reikaids_get_info1_1) { - reikaids_info(tileinfo, tile_index, 1, 1, ((m_gfx_bank[0] & 0x78) >> 3)); + reikaids_info(tileinfo, tile_index, 1, 1, ((m_gfx_bank[0]) >> 3)); } TILE_GET_INFO_MEMBER(homedata_state::reikaids_get_info0_2) diff --git a/src/mame/video/k001005.h b/src/mame/video/k001005.h index cf7a12fa0a4..586de02d410 100644 --- a/src/mame/video/k001005.h +++ b/src/mame/video/k001005.h @@ -9,7 +9,7 @@ #include "cpu/sharc/sharc.h" #include "video/k001006.h" -#include <float.h> +#include <cfloat> struct k001005_polydata diff --git a/src/mame/video/k052109.cpp b/src/mame/video/k052109.cpp index 6d5d66af66e..b4cac11c2b2 100644 --- a/src/mame/video/k052109.cpp +++ b/src/mame/video/k052109.cpp @@ -86,9 +86,11 @@ address lines), and then reading it from the 051962. 1 = 64 (actually 40) columns ---xx--- layer B row scroll --x----- layer B column scroll - surpratk sets this register to 70 during the second boss. There is - nothing obviously wrong so it's not clear what should happen. + suratk sets this register to 70 during the second boss to produce rotating star field, using X and Y scroll in the same time. + not emulated due to MAME's tilemaps restrictions, currently handled in hacky way. glfgreat sets it to 30 when showing the leader board + mariorou sets it to 36 when ingame, while actually does per-row scroll for layer A and per-collumn scroll for layer B. + such usage not supported by current implementation, hacked in game driver instead. 1d00 : bits 0 & 1 might enable NMI and FIRQ, not sure : bit 2 = IRQ enable 1d80 : ROM bank selector bits 0-3 = bank 0 bits 4-7 = bank 1 @@ -246,6 +248,9 @@ void k052109_device::device_start() m_tilemap[1]->set_transparent_pen(0); m_tilemap[2]->set_transparent_pen(0); + m_tilemap[1]->set_scrolldx(6, 6); + m_tilemap[2]->set_scrolldx(6, 6); + save_pointer(NAME(m_ram), 0x6000); save_item(NAME(m_rmrd_line)); save_item(NAME(m_romsubbank)); @@ -516,19 +521,21 @@ popmessage("%x %x %x %x", } #endif +// note: this chip can do both per-column and per-row scroll in the same time, currently not emulated. + if ((m_scrollctrl & 0x03) == 0x02) { uint8_t *scrollram = &m_ram[0x1a00]; - m_tilemap[1]->set_scroll_rows(256); + m_tilemap[1]->set_scroll_rows(32); m_tilemap[1]->set_scroll_cols(1); yscroll = m_ram[0x180c]; m_tilemap[1]->set_scrolly(0, yscroll); - for (offs = 0; offs < 256; offs++) + yscroll /= 8; + for (offs = 0; offs < 32; offs++) { - xscroll = scrollram[2 * (offs & 0xfff8) + 0] + 256 * scrollram[2 * (offs & 0xfff8) + 1]; - xscroll -= 6; - m_tilemap[1]->set_scrollx((offs + yscroll) & 0xff, xscroll); + xscroll = scrollram[16 * offs + 0] + 256 * scrollram[16 * offs + 1]; + m_tilemap[1]->set_scrollx((offs + yscroll) & 31, xscroll); } } else if ((m_scrollctrl & 0x03) == 0x03) @@ -542,7 +549,6 @@ popmessage("%x %x %x %x", for (offs = 0; offs < 256; offs++) { xscroll = scrollram[2 * offs + 0] + 256 * scrollram[2 * offs + 1]; - xscroll -= 6; m_tilemap[1]->set_scrollx((offs + yscroll) & 0xff, xscroll); } } @@ -551,14 +557,14 @@ popmessage("%x %x %x %x", uint8_t *scrollram = &m_ram[0x1800]; m_tilemap[1]->set_scroll_rows(1); - m_tilemap[1]->set_scroll_cols(512); + m_tilemap[1]->set_scroll_cols(64); xscroll = m_ram[0x1a00] + 256 * m_ram[0x1a01]; - xscroll -= 6; m_tilemap[1]->set_scrollx(0, xscroll); - for (offs = 0; offs < 512; offs++) + xscroll /= 8; + for (offs = 0; offs < 64; offs++) { - yscroll = scrollram[offs / 8]; - m_tilemap[1]->set_scrolly((offs + xscroll) & 0x1ff, yscroll); + yscroll = scrollram[offs]; + m_tilemap[1]->set_scrolly((offs + xscroll) & 63, yscroll); } } else @@ -568,7 +574,6 @@ popmessage("%x %x %x %x", m_tilemap[1]->set_scroll_rows(1); m_tilemap[1]->set_scroll_cols(1); xscroll = scrollram[0] + 256 * scrollram[1]; - xscroll -= 6; yscroll = m_ram[0x180c]; m_tilemap[1]->set_scrollx(0, xscroll); m_tilemap[1]->set_scrolly(0, yscroll); @@ -578,15 +583,18 @@ popmessage("%x %x %x %x", { uint8_t *scrollram = &m_ram[0x3a00]; - m_tilemap[2]->set_scroll_rows(256); + m_tilemap[2]->set_scroll_rows(32); m_tilemap[2]->set_scroll_cols(1); yscroll = m_ram[0x380c]; + // + if (m_scrollctrl == 0x70) yscroll = m_ram[0x3823]; // hack for suratk 2nd boss rotating star field + // m_tilemap[2]->set_scrolly(0, yscroll); - for (offs = 0; offs < 256; offs++) + yscroll /= 8; + for (offs = 0; offs < 32; offs++) { - xscroll = scrollram[2 * (offs & 0xfff8) + 0] + 256 * scrollram[2 * (offs & 0xfff8) + 1]; - xscroll -= 6; - m_tilemap[2]->set_scrollx((offs + yscroll) & 0xff, xscroll); + xscroll = scrollram[16 * offs + 0] + 256 * scrollram[16 * offs + 1]; + m_tilemap[2]->set_scrollx((offs + yscroll) & 31, xscroll); } } else if ((m_scrollctrl & 0x18) == 0x18) @@ -600,7 +608,6 @@ popmessage("%x %x %x %x", for (offs = 0; offs < 256; offs++) { xscroll = scrollram[2 * offs + 0] + 256 * scrollram[2 * offs + 1]; - xscroll -= 6; m_tilemap[2]->set_scrollx((offs + yscroll) & 0xff, xscroll); } } @@ -609,14 +616,14 @@ popmessage("%x %x %x %x", uint8_t *scrollram = &m_ram[0x3800]; m_tilemap[2]->set_scroll_rows(1); - m_tilemap[2]->set_scroll_cols(512); + m_tilemap[2]->set_scroll_cols(64); xscroll = m_ram[0x3a00] + 256 * m_ram[0x3a01]; - xscroll -= 6; m_tilemap[2]->set_scrollx(0, xscroll); - for (offs = 0; offs < 512; offs++) + xscroll /= 8; + for (offs = 0; offs < 64; offs++) { - yscroll = scrollram[offs / 8]; - m_tilemap[2]->set_scrolly((offs + xscroll) & 0x1ff, yscroll); + yscroll = scrollram[offs]; + m_tilemap[2]->set_scrolly((offs + xscroll) & 63, yscroll); } } else @@ -626,7 +633,6 @@ popmessage("%x %x %x %x", m_tilemap[2]->set_scroll_rows(1); m_tilemap[2]->set_scroll_cols(1); xscroll = scrollram[0] + 256 * scrollram[1]; - xscroll -= 6; yscroll = m_ram[0x380c]; m_tilemap[2]->set_scrollx(0, xscroll); m_tilemap[2]->set_scrolly(0, yscroll); diff --git a/src/mame/video/k054156_k054157_k056832.cpp b/src/mame/video/k054156_k054157_k056832.cpp index 2d0cb0d5724..b40ebd5aae2 100644 --- a/src/mame/video/k054156_k054157_k056832.cpp +++ b/src/mame/video/k054156_k054157_k056832.cpp @@ -479,6 +479,7 @@ void k056832_device::get_tile_info( tile_data &tileinfo, int tile_index, int pa const struct K056832_SHIFTMASKS *smptr; int layer, flip, fbits, attr, code, color, flags; + int priority = 0; uint16_t *pMem; pMem = &m_videoram[(pageIndex << 12) + (tile_index << 1)]; @@ -505,12 +506,13 @@ void k056832_device::get_tile_info( tile_data &tileinfo, int tile_index, int pa color = (attr & smptr->palm1) | (attr >> smptr->pals2 & smptr->palm2); flags = TILE_FLIPYX(flip); - m_k056832_cb(layer, &code, &color, &flags); + m_k056832_cb(layer, &code, &color, &flags, &priority); SET_TILE_INFO_MEMBER(m_gfx_num, code, color, flags); + tileinfo.category = priority; } @@ -676,7 +678,7 @@ u32 k056832_device::k_6bpp_rom_long_r(offs_t offset, u32 mem_mask) u8 k056832_device::konmedal_rom_r(offs_t offset) { - uint32_t addr = ((m_regs[0x1b] << 7) | ((m_regs[0x1a] & 0xc) * 0x800)) + offset; + uint32_t addr = (((m_regs[0x1a] << 9) & 0x60000) | ((m_regs[0x1b] << 15) & 0x18000) | ((m_regs[0x1a] << 3) & 0x06000)) + offset; return m_rombase[addr]; } diff --git a/src/mame/video/k054156_k054157_k056832.h b/src/mame/video/k054156_k054157_k056832.h index 57cfeff1c7d..79bd099386f 100644 --- a/src/mame/video/k054156_k054157_k056832.h +++ b/src/mame/video/k054156_k054157_k056832.h @@ -8,7 +8,7 @@ #include "video/k055555.h" // still needs k055555_get_palette_index #include "tilemap.h" -#define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags) +#define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags, int *priority) #define K056832_PAGE_COUNT 16 @@ -31,7 +31,7 @@ class k055555_device; class k056832_device : public device_t, public device_gfx_interface { public: - using tile_delegate = device_delegate<void (int layer, int *code, int *color, int *flags)>; + using tile_delegate = device_delegate<void (int layer, int *code, int *color, int *flags, int *priority)>; template <typename T> k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&mixer_tag) : k056832_device(mconfig, tag, owner, clock) diff --git a/src/mame/video/kaneko16.cpp b/src/mame/video/kaneko16.cpp index c978c061f02..1ac1ee998c8 100644 --- a/src/mame/video/kaneko16.cpp +++ b/src/mame/video/kaneko16.cpp @@ -83,7 +83,7 @@ u32 kaneko16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c if (!m_disp_enable) return 0; screen_update_common(screen, bitmap, cliprect); - m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram->buffer(), m_spriteram->bytes()); + m_kaneko_spr->copybitmap(bitmap, cliprect, screen.priority()); return 0; } @@ -229,6 +229,6 @@ u32 kaneko16_berlwall_state::screen_update(screen_device &screen, bitmap_rgb32 & if (!m_disp_enable) return 0; screen_update_common(screen, bitmap, cliprect); - m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram->buffer(), m_spriteram->bytes()/2); + m_kaneko_spr->copybitmap(bitmap, cliprect, screen.priority()); return 0; } diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp index 598c005f9cd..d55557f69b5 100644 --- a/src/mame/video/kaneko_spr.cpp +++ b/src/mame/video/kaneko_spr.cpp @@ -70,12 +70,14 @@ void kaneko16_sprite_device::device_start() m_first_sprite = std::make_unique<struct tempsprite_t[]>(0x400); m_sprites_regs = make_unique_clear<u16[]>(0x20/2); screen().register_screen_bitmap(m_sprites_bitmap); + screen().register_screen_bitmap(m_sprites_maskmap); save_item(NAME(m_sprite_flipx)); save_item(NAME(m_sprite_flipy)); save_pointer(NAME(m_sprites_regs), 0x20/2); save_item(NAME(m_keep_sprites)); save_item(NAME(m_sprites_bitmap)); + save_item(NAME(m_sprites_maskmap)); } @@ -238,12 +240,11 @@ int kaneko16_sprite_device::parse_sprite_type012(int i, struct tempsprite_t *s, // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities -template<class _BitmapClass> -void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, +void kaneko16_sprite_device::draw_sprites_custom(const rectangle &clip,gfx_element *gfx, u32 code,u32 color,bool flipx,bool flipy,int sx,int sy, - bitmap_ind8 &priority_bitmap, int priority) + int priority) { - const pen_t pen_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); + const pen_t pen_base = gfx->granularity() * (color % gfx->colors()); const u8 *source_base = gfx->get_data(code % gfx->elements()); int dx, dy; @@ -301,17 +302,11 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re if (ex > sx) { /* skip if inner loop doesn't draw anything */ - typename _BitmapClass::pixel_t *dest; - int rgb; - if (sizeof(*dest) == 2) rgb = 0; - else rgb = 1; - - const pen_t *pal = gfx->palette().pens(); for (int y = sy; y < ey; y++) { const u8 *source = source_base + y_index * gfx->rowbytes(); - dest = &dest_bmp.pix(y); - u8 *pri = &priority_bitmap.pix8(y); + u16 *dest = &m_sprites_bitmap.pix16(y); + u8 *pri = &m_sprites_maskmap.pix8(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) @@ -319,11 +314,9 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re const u8 c = source[x_index]; if (c != 0) { - if (pri[x] < priority) - { - if (!rgb) dest[x] = pen_base + c; - else dest[x] = pal[pen_base + c]; - } + if (pri[x] == 0) + dest[x] = ((pen_base + c) & 0x3fff) + ((priority & 3) << 14); + pri[x] = 0xff; // mark it "already drawn" } x_index += dx; @@ -335,8 +328,7 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re /* Build a list of sprites to display & draw them */ -template<class _BitmapClass> -void kaneko16_sprite_device::draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::draw_sprites(const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes) { /* Sprites *must* be parsed from the first in RAM to the last, because of the multisprite feature. But they *must* be drawn @@ -442,18 +434,13 @@ void kaneko16_sprite_device::draw_sprites(_BitmapClass &bitmap, const rectangle for (s--; s >= m_first_sprite.get(); s--) { - const int curr_pri = s->priority; - - const u32 primask = m_priority.sprite[curr_pri]; - draw_sprites_custom( - bitmap,cliprect,gfx(0), + cliprect,gfx(0), s->code, s->color, s->flipx, s->flipy, s->x, s->y, - priority_bitmap, - primask); + s->priority); } } @@ -556,49 +543,53 @@ void kaneko16_sprite_device::regs_w(offs_t offset, u16 data, u16 mem_mask) } -void kaneko16_sprite_device::copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - copybitmap_trans(bitmap,m_sprites_bitmap,0,0,0,0,cliprect,0); -} +void kaneko16_sprite_device::copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { copybitmap_common(bitmap, cliprect, priority_bitmap); } +void kaneko16_sprite_device::copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { copybitmap_common(bitmap, cliprect, priority_bitmap); } -void kaneko16_sprite_device::copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect) +template<class _BitmapClass> +void kaneko16_sprite_device::copybitmap_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { const pen_t *pal = gfx(0)->palette().pens(); + typename _BitmapClass::pixel_t *dstbitmap; + int rgb; + if (sizeof(*dstbitmap) == 2) rgb = 0; + else rgb = 1; + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { + dstbitmap = &bitmap.pix(y); + u8 *dstprimap = &priority_bitmap.pix8(y); u16* srcbitmap = &m_sprites_bitmap.pix16(y); - u32* dstbitmap = &bitmap.pix32(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - const u16 pix = srcbitmap[x]; - if (pix) dstbitmap[x] = pal[pix]; + const u16 pri = (srcbitmap[x] & 0xc000) >> 14; + const u16 pix = srcbitmap[x] & 0x3fff; + if (m_priority.sprite[pri] > dstprimap[x]) + { + if (pix & 0x3fff) + { + if (!rgb) dstbitmap[x] = m_colbase + pix; + else dstbitmap[x] = pal[m_colbase + pix]; + } + } } } } -void kaneko16_sprite_device::render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) { render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } -void kaneko16_sprite_device::render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) { render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } - -template<class _BitmapClass> -void kaneko16_sprite_device::render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::render_sprites(const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes) { /* Sprites last (rendered with pdrawgfx, so they can slip in between the layers) */ - if (m_keep_sprites) - { - /* keep sprites on screen - used by mgcrystl when you get the first gem and it shows instructions */ - draw_sprites(m_sprites_bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); - copybitmap(bitmap,cliprect); - } - else - { + m_sprites_maskmap.fill(0, cliprect); + /* keep sprites on screen - used by mgcrystl when you get the first gem and it shows instructions */ + if (!m_keep_sprites) m_sprites_bitmap.fill(0, cliprect); - draw_sprites(bitmap,cliprect, priority_bitmap, spriteram16, spriteram16_bytes); - } + + draw_sprites(cliprect, spriteram16, spriteram16_bytes); } kaneko_vu002_sprite_device::kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) diff --git a/src/mame/video/kaneko_spr.h b/src/mame/video/kaneko_spr.h index 00ea0c7640f..69539361711 100644 --- a/src/mame/video/kaneko_spr.h +++ b/src/mame/video/kaneko_spr.h @@ -46,16 +46,16 @@ public: // (legacy) used in the bitmap clear functions virtual int get_sprite_type(void) =0; - void render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); - void render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); + void render_sprites(const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes); + void copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); + void copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); template<class _BitmapClass> - void render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); + void copybitmap_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); void bootleg_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes); - u16 regs_r(offs_t offset); void regs_w(offs_t offset, u16 data, u16 mem_mask); @@ -97,21 +97,17 @@ private: std::unique_ptr<struct tempsprite_t[]> m_first_sprite; int m_keep_sprites; bitmap_ind16 m_sprites_bitmap; + bitmap_ind8 m_sprites_maskmap; - template<class _BitmapClass> - void draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); + void draw_sprites(const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes); - template<class _BitmapClass> - void draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, + void draw_sprites_custom(const rectangle &clip,gfx_element *gfx, u32 code,u32 color,bool flipx,bool flipy,int sx,int sy, - bitmap_ind8 &priority_bitmap, int priority); + int priority); int parse_sprite_type012(int i, struct tempsprite_t *s, u16* spriteram16, int spriteram16_bytes); - - void copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); - void copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); }; //extern const device_type KANEKO16_SPRITE; diff --git a/src/mame/video/klax.cpp b/src/mame/video/klax.cpp index 5daf385e18b..afa3634a385 100644 --- a/src/mame/video/klax.cpp +++ b/src/mame/video/klax.cpp @@ -74,7 +74,7 @@ const atari_motion_objects_config klax_state::s_mob_config = * *************************************/ -void klax_state::klax_latch_w(u16 data) +void klax_state::latch_w(u16 data) { } diff --git a/src/mame/video/mmdisplay2.cpp b/src/mame/video/mmdisplay2.cpp new file mode 100644 index 00000000000..93b212ddbe2 --- /dev/null +++ b/src/mame/video/mmdisplay2.cpp @@ -0,0 +1,106 @@ +// license:BSD-3-Clause +// copyright-holders:Sandro Ronco +/********************************************************************** + +Hegener + Glaser Mephisto Display Module for modular chesscomputers, +the 2nd version with 2 LCD lines. The 16/32bit module also includes 8KB NVRAM, +but that part is emulated in the driver. + +TODO: +- add mmdisplay1.cpp, the one with shift registers and 4-digit lcd + +*********************************************************************/ + +#include "emu.h" + +#include "mmdisplay2.h" +#include "sound/volt_reg.h" + + +DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display_module2_device, "mdisplay2", "Mephisto Display Module 2") + +//------------------------------------------------- +// constructor +//------------------------------------------------- + +mephisto_display_module2_device::mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, MEPHISTO_DISPLAY_MODULE2, tag, owner, clock) + , m_lcdc(*this, "hd44780") + , m_dac(*this, "dac") +{ +} + + +//------------------------------------------------- +// device_add_mconfig +//------------------------------------------------- + +void mephisto_display_module2_device::device_add_mconfig(machine_config &config) +{ + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(50); + screen.set_size(16*6, 9*2); + screen.set_visarea(0, 16*6-1, 0, 9*2-3); + screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); + screen.set_palette("palette"); + PALETTE(config, "palette", FUNC(mephisto_display_module2_device::lcd_palette), 2); + + HD44780(config, m_lcdc, 0); + m_lcdc->set_lcd_size(2, 16); + + /* sound hardware */ + SPEAKER(config, "speaker").front_center(); + DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref")); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); +} + +void mephisto_display_module2_device::lcd_palette(palette_device &palette) const +{ + palette.set_pen_color(0, rgb_t(138, 146, 148)); + palette.set_pen_color(1, rgb_t(92, 83, 88)); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void mephisto_display_module2_device::device_start() +{ + save_item(NAME(m_latch)); + save_item(NAME(m_ctrl)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void mephisto_display_module2_device::device_reset() +{ + m_latch = 0; + m_ctrl = 0; +} + + +//------------------------------------------------- +// I/O handlers +//------------------------------------------------- + +WRITE8_MEMBER(mephisto_display_module2_device::latch_w) +{ + m_latch = data; +} + +WRITE8_MEMBER(mephisto_display_module2_device::io_w) +{ + if (BIT(data, 1) && !BIT(m_ctrl, 1)) + m_lcdc->write(BIT(data, 0), m_latch); + + m_dac->write(data >> 2 & 3); + + m_ctrl = data; +} diff --git a/src/mame/video/mmdisplay2.h b/src/mame/video/mmdisplay2.h new file mode 100644 index 00000000000..26e2d2bfad4 --- /dev/null +++ b/src/mame/video/mmdisplay2.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:Sandro Ronco +/********************************************************************** + + Mephisto Display Module (2nd version) + +*********************************************************************/ + +#ifndef MAME_VIDEO_MMDISPLAY2_H +#define MAME_VIDEO_MMDISPLAY2_H + +#pragma once + +#include "video/hd44780.h" +#include "sound/dac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" + + +// ======================> mephisto_display_module2_device + +class mephisto_display_module2_device : public device_t +{ +public: + // construction/destruction + mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + hd44780_device *get() { return m_lcdc; } + + DECLARE_WRITE8_MEMBER(latch_w); + DECLARE_WRITE8_MEMBER(io_w); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + void lcd_palette(palette_device &palette) const; + +private: + optional_device<hd44780_device> m_lcdc; + required_device<dac_byte_interface> m_dac; + uint8_t m_latch; + uint8_t m_ctrl; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display_module2_device) + +#endif // MAME_VIDEO_MMDISPLAY2_H diff --git a/src/mame/video/ms32_sprite.cpp b/src/mame/video/ms32_sprite.cpp index 0a98f2cddd1..88526a0780e 100644 --- a/src/mame/video/ms32_sprite.cpp +++ b/src/mame/video/ms32_sprite.cpp @@ -3,13 +3,13 @@ /* Jaleco Megasystem 32 sprite hardware - TODO: - verify hardware configuration + TODO: + verify hardware configuration used by: ms32.cpp - bnstars.cpp (Dual screen configuration) - tetrisp2.cpp (Slightly different - no zoom, etc) + bnstars.cpp (Dual screen configuration) + tetrisp2.cpp (Slightly different - no zoom, etc) Sprite format (16 byte per each sprite): Offset Bits Description diff --git a/src/mame/video/pdp1.cpp b/src/mame/video/pdp1.cpp index f04aa496d83..6f2462196a6 100644 --- a/src/mame/video/pdp1.cpp +++ b/src/mame/video/pdp1.cpp @@ -21,7 +21,7 @@ #include "cpu/pdp1/pdp1.h" #include "includes/pdp1.h" -#include <math.h> +#include <cmath> #include <algorithm> diff --git a/src/mame/video/pgm.cpp b/src/mame/video/pgm.cpp index 5fc5016dbad..a26506389a1 100644 --- a/src/mame/video/pgm.cpp +++ b/src/mame/video/pgm.cpp @@ -69,6 +69,18 @@ inline void pgm_state::pgm_draw_pix_pri(int xdrawpos, u16* dest, u8* destpri, co } } +inline u8 pgm_state::get_sprite_pix() +{ + const u8 srcdat = ((m_adata[m_aoffset & m_adata.mask()] >> m_abit) & 0x1f); + m_abit += 5; // 5 bit per pixel, 3 pixels in each word; 15 bit used + if (m_abit >= 15) + { + m_aoffset++; + m_abit = 0; + } + return srcdat; +} + /************************************************************************* Full Sprite Renderer for complex zoomed cases @@ -78,22 +90,17 @@ void pgm_state::draw_sprite_line(int wide, u16* dest, u8* destpri, const rectang { int xoffset = 0; int xdrawpos = 0; - - u8 *adata = m_sprite_a_region.get(); - size_t adatasize = m_sprite_a_region_size - 1; - int xcntdraw = 0; for (int xcnt = 0; xcnt < wide; xcnt++) { - u16 msk = ((m_bdata[(m_boffset + 1) & m_bdata.mask()] << 8) |(m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0)); + u16 msk = m_bdata[m_boffset & m_bdata.mask()]; for (int x = 0; x < 16; x++) { if (!(BIT(msk, 0))) { - const u16 srcdat = adata[m_aoffset & adatasize] + palt * 32; - m_aoffset++; + const u16 srcdat = get_sprite_pix() + palt * 32; if (draw) { @@ -151,7 +158,7 @@ void pgm_state::draw_sprite_line(int wide, u16* dest, u8* destpri, const rectang msk >>= 1; } - m_boffset += 2; + m_boffset++; } } @@ -160,11 +167,11 @@ void pgm_state::draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, i int ydrawpos; int xcnt = 0; - m_aoffset = (m_bdata[(m_boffset + 3) & m_bdata.mask()] << 24) | (m_bdata[(m_boffset + 2) & m_bdata.mask()] << 16) | - (m_bdata[(m_boffset + 1) & m_bdata.mask()] << 8) | (m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0); - m_aoffset = m_aoffset >> 2; m_aoffset *= 3; + m_aoffset = (m_bdata[(m_boffset + 1) & m_bdata.mask()] << 16) | (m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0); + m_aoffset = m_aoffset >> 2; + m_abit = 0; - m_boffset += 4; + m_boffset += 2; /* precalculate where drawing will end, for flipped zoomed cases. */ /* if we're to avoid pre-decoding the data for each sprite each time we draw then we have to draw the sprite data @@ -209,6 +216,7 @@ void pgm_state::draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, i if (yzoombit && ygrow) // double this line { const int temp_aoffset = m_aoffset; + const int temp_abit = m_abit; const int temp_boffset = m_boffset; if (!(flip & 0x02)) @@ -231,6 +239,7 @@ void pgm_state::draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, i // we need to draw this line again, so restore our pointers to previous values m_aoffset = temp_aoffset; + m_abit = temp_abit; m_boffset = temp_boffset; if (!(flip & 0x02)) @@ -310,23 +319,19 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r { int xoffset = 0; int xdrawpos = 0; - u8 *adata = m_sprite_a_region.get(); - size_t adatasize = m_sprite_a_region_size - 1; - int xcntdraw = 0; if (!pri) { for (int xcnt = 0; xcnt < wide; xcnt++) { - u16 msk = ((m_bdata[(m_boffset + 1) & m_bdata.mask()] << 8) |(m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0)); + u16 msk = m_bdata[m_boffset & m_bdata.mask()]; for (int x = 0; x < 16; x++) { if (!(BIT(msk, 0))) { - const u16 srcdat = adata[m_aoffset & adatasize] + palt * 32; - m_aoffset++; + const u16 srcdat = get_sprite_pix() + palt * 32; if (draw) { @@ -352,21 +357,20 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r msk >>= 1; } - m_boffset += 2; + m_boffset++; } } else { for (int xcnt = 0; xcnt < wide; xcnt++) { - u16 msk = ((m_bdata[(m_boffset + 1) & m_bdata.mask()] << 8) |(m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0)); + u16 msk = m_bdata[m_boffset & m_bdata.mask()]; for (int x = 0; x < 16; x++) { if (!(BIT(msk, 0))) { - const u16 srcdat = adata[m_aoffset & adatasize] + palt * 32; - m_aoffset++; + const u16 srcdat = get_sprite_pix() + palt * 32; if (draw) { @@ -392,7 +396,7 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r msk >>= 1; } - m_boffset += 2; + m_boffset++; } } } @@ -406,11 +410,11 @@ void pgm_state::draw_sprite_new_basic(int wide, int high, int xpos, int ypos, in { int ydrawpos; - m_aoffset = (m_bdata[(m_boffset + 3) & m_bdata.mask()] << 24) | (m_bdata[(m_boffset + 2) & m_bdata.mask()] << 16) | - (m_bdata[(m_boffset + 1) & m_bdata.mask()] << 8) | (m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0); - m_aoffset = m_aoffset >> 2; m_aoffset *= 3; + m_aoffset = (m_bdata[(m_boffset + 1) & m_bdata.mask()] << 16) | (m_bdata[(m_boffset + 0) & m_bdata.mask()] << 0); + m_aoffset = m_aoffset >> 2; + m_abit = 0; - m_boffset += 4; + m_boffset += 2; const int realysize = high - 1; const int realxsize = (wide * 16) - 1; @@ -506,7 +510,6 @@ void pgm_state::draw_sprites(bitmap_ind16& spritebitmap, const rectangle &clipre u32 xzoom = (sprite_zoomtable[xzom * 2] << 16) | sprite_zoomtable[xzom * 2 + 1]; u32 yzoom = (sprite_zoomtable[yzom * 2] << 16) | sprite_zoomtable[yzom * 2 + 1]; - boff *= 2; if (xpos > 0x3ff) xpos -= 0x800; if (ypos > 0x1ff) ypos -= 0x400; @@ -576,6 +579,7 @@ TILE_GET_INFO_MEMBER(pgm_state::get_bg_tile_info) void pgm_state::video_start() { m_aoffset = 0; + m_abit = 0; m_boffset = 0; m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(pgm_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); diff --git a/src/mame/video/popeye.cpp b/src/mame/video/popeye.cpp index a685e1a6d2d..3c6af625e04 100644 --- a/src/mame/video/popeye.cpp +++ b/src/mame/video/popeye.cpp @@ -270,13 +270,13 @@ void tnx1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { struct attribute_memory { - int row; - int sx; - uint8_t color; - uint16_t code; - int flipx; - int flipy; - } attributes[64] = { 0 }; + int row = 0; + int sx = 0; + uint8_t color = 0; + uint16_t code = 0; + int flipx = 0; + int flipy = 0; + } attributes[64]; for (int offs = 4; offs < m_dmasource.bytes(); offs += 4) { diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp index a97299b6fcb..bd10a122f15 100644 --- a/src/mame/video/powervr2.cpp +++ b/src/mame/video/powervr2.cpp @@ -730,7 +730,7 @@ void powervr2_device::tex_get_info(texinfo *t) // fprintf(stderr, "tex %d %d %d %d\n", t->pf, t->mode, pal_ram_ctrl, t->mipmapped); if(!t->textured) { - t->r = NULL; + t->r = nullptr; } else { diff --git a/src/mame/video/skyfox.cpp b/src/mame/video/skyfox.cpp index 0d42c6f23bc..80a79461e0e 100644 --- a/src/mame/video/skyfox.cpp +++ b/src/mame/video/skyfox.cpp @@ -217,7 +217,7 @@ void skyfox_state::draw_background(bitmap_ind16 &bitmap, const rectangle &clipre This PCB seems does not support background flip. */ /* This looks perfect at first glance. - but when strict compared on "1UP START" screen, + but when strict compared on "1UP START" screen, it seems the blinking pattern in each star may be different. */ if (((m_bg_ctrl >> 4) & 3) != (pen & 3) || !blinking) bitmap.pix16(y % 256, x % 512) = pen; diff --git a/src/mame/video/stfight_dev.cpp b/src/mame/video/stfight_dev.cpp index 7c5d26f04b5..f1a14375b99 100644 --- a/src/mame/video/stfight_dev.cpp +++ b/src/mame/video/stfight_dev.cpp @@ -252,21 +252,30 @@ uint32_t stfight_video_device::screen_update_stfight(screen_device &screen, bitm m_temp_sprite_bitmap.fill(-1, cliprect); draw_sprites(screen, m_temp_sprite_bitmap, cliprect); - m_temp_bitmap.fill(-1, cliprect); - m_bg_tilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0); - mix_txlayer(screen, bitmap, m_temp_bitmap, cliprect, m_bg_clut, 0x00, 0x00, 0x00, false); + if (m_bg_tilemap->enabled()) + { + m_temp_bitmap.fill(-1, cliprect); + m_bg_tilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0); + mix_txlayer(screen, bitmap, m_temp_bitmap, cliprect, m_bg_clut, 0x00, 0x00, 0x00, false); + } if (m_vregs[0x07] & 0x40) mix_txlayer(screen, bitmap, m_temp_sprite_bitmap, cliprect, m_spr_clut, 0x80, 0x100, 0x100, false); // low priority sprites - m_temp_bitmap.fill(-1, cliprect); - m_fg_tilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0); - mix_txlayer(screen, bitmap, m_temp_bitmap, cliprect, m_fg_clut, 0x40, 0x00, 0x00, false); + if (m_fg_tilemap->enabled()) + { + m_temp_bitmap.fill(-1, cliprect); + m_fg_tilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0); + mix_txlayer(screen, bitmap, m_temp_bitmap, cliprect, m_fg_clut, 0x40, 0x00, 0x00, false); + } if (m_vregs[0x07] & 0x40) mix_txlayer(screen, bitmap, m_temp_sprite_bitmap, cliprect, m_spr_clut, 0x80, 0x100, 0x000, false); // high priority sprites - m_temp_bitmap.fill(-1, cliprect); - m_tx_tilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0); - mix_txlayer(screen, bitmap, m_temp_bitmap, cliprect, m_tx_clut, 0xc0, 0x00, 0x00, true); + if (m_tx_tilemap->enabled()) + { + m_temp_bitmap.fill(-1, cliprect); + m_tx_tilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0); + mix_txlayer(screen, bitmap, m_temp_bitmap, cliprect, m_tx_clut, 0xc0, 0x00, 0x00, true); + } // return 0; } diff --git a/src/mame/video/system1.cpp b/src/mame/video/system1.cpp index d04a9e6f1b6..a1be96877c9 100644 --- a/src/mame/video/system1.cpp +++ b/src/mame/video/system1.cpp @@ -90,7 +90,84 @@ #include "emu.h" #include "includes/system1.h" +#include "video/resnet.h" +void system1_state::system1_palette(palette_device &palette) const +{ + /* + There are two kind of color handling: in the System 1 games, values in the + palette RAM are directly mapped to colors with the usual BBGGGRRR format; + in the System 2 ones (Choplifter, WBML, etc.), the value in the palette RAM + is a lookup offset for three palette PROMs in RRRRGGGGBBBB format. + + It's hard to tell for sure because they use resistor packs, but here's + what I think the values are from measurment with a volt meter: + + Blue: .250K ohms + Blue: .495K ohms + Green:.250K ohms + Green:.495K ohms + Green:.995K ohms + Red: .495K ohms + Red: .250K ohms + Red: .995K ohms + + accurate to +/- .003K ohms. + */ + + if (m_color_prom != nullptr) + { + for (int pal = 0; pal < 256; pal++) + { + u8 val; + val = m_color_prom[pal + 0 * 256]; + u8 r = 0x0e * BIT(val, 0) + 0x1f * BIT(val, 1) + 0x43 * BIT(val, 2) + 0x8f * BIT(val, 3); + + val = m_color_prom[pal + 1 * 256]; + u8 g = 0x0e * BIT(val, 0) + 0x1f * BIT(val, 1) + 0x43 * BIT(val, 2) + 0x8f * BIT(val, 3); + + val = m_color_prom[pal + 2 * 256]; + u8 b = 0x0e * BIT(val, 0) + 0x1f * BIT(val, 1) + 0x43 * BIT(val, 2) + 0x8f * BIT(val, 3); + + palette.set_indirect_color(pal, rgb_t(r, g, b)); + } + } + else + { + static constexpr int resistances_rg[3] = { 995, 495, 250 }; + static constexpr int resistances_b [2] = { 495, 250 }; + + double weights_r[3], weights_g[3], weights_b[2]; + compute_resistor_weights(0, 255, -1.0, + 3, resistances_rg, weights_r, 0, 0, + 3, resistances_rg, weights_g, 0, 0, + 2, resistances_b, weights_b, 0, 0); + + for (int i = 0; i < 256; i++) + { + int bit0, bit1, bit2; + + // red component + bit0 = BIT(i, 0); + bit1 = BIT(i, 1); + bit2 = BIT(i, 2); + int const r = combine_weights(weights_r, bit0, bit1, bit2); + + // green component + bit0 = BIT(i, 3); + bit1 = BIT(i, 4); + bit2 = BIT(i, 5); + int const g = combine_weights(weights_g, bit0, bit1, bit2); + + // blue component + bit0 = BIT(i, 6); + bit1 = BIT(i, 7); + int const b = combine_weights(weights_b, bit0, bit1); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + } +} /************************************* * @@ -100,16 +177,15 @@ TILE_GET_INFO_MEMBER(system1_state::tile_get_info) { - const uint8_t *rambase = (const uint8_t *)tilemap.user_data(); - uint32_t tiledata = rambase[tile_index*2+0] | (rambase[tile_index*2+1] << 8); - uint32_t code = ((tiledata >> 4) & 0x800) | (tiledata & 0x7ff); - uint32_t color = (tiledata >> 5) & 0xff; + const u8 *rambase = (const u8 *)tilemap.user_data(); + u32 tiledata = rambase[tile_index*2+0] | (rambase[tile_index*2+1] << 8); + u32 code = ((tiledata >> 4) & 0x800) | (tiledata & 0x7ff); + u32 color = (tiledata >> 5) & 0xff; SET_TILE_INFO_MEMBER(0, code, color, 0); } - /************************************* * * Video startup @@ -121,12 +197,12 @@ void system1_state::video_start_common(int pagecount) int pagenum; /* allocate memory for the collision arrays */ - m_mix_collide = make_unique_clear<uint8_t[]>(64); - m_sprite_collide = make_unique_clear<uint8_t[]>(1024); + m_mix_collide = make_unique_clear<u8[]>(64); + m_sprite_collide = make_unique_clear<u8[]>(1024); /* allocate memory for videoram */ m_tilemap_pages = pagecount; - m_videoram = make_unique_clear<uint8_t[]>(0x800 * pagecount); + m_videoram = make_unique_clear<u8[]>(0x800 * pagecount); /* create the tilemap pages */ for (pagenum = 0; pagenum < pagecount; pagenum++) @@ -162,14 +238,13 @@ VIDEO_START_MEMBER(system1_state,system2) } - /************************************* * * Video control * *************************************/ -WRITE8_MEMBER(system1_state::system1_videomode_w) +WRITE8_MEMBER(system1_state::common_videomode_w) { if (data & 0x6e) logerror("videomode = %02x\n",data); @@ -181,28 +256,27 @@ WRITE8_MEMBER(system1_state::system1_videomode_w) } - /************************************* * * Mixer collision I/O * *************************************/ -READ8_MEMBER(system1_state::system1_mixer_collision_r) +READ8_MEMBER(system1_state::mixer_collision_r) { // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); return m_mix_collide[offset & 0x3f] | 0x7e | (m_mix_collide_summary << 7); } -WRITE8_MEMBER(system1_state::system1_mixer_collision_w) +WRITE8_MEMBER(system1_state::mixer_collision_w) { // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); m_mix_collide[offset & 0x3f] = 0; } -WRITE8_MEMBER(system1_state::system1_mixer_collision_reset_w) +WRITE8_MEMBER(system1_state::mixer_collision_reset_w) { // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); @@ -210,28 +284,27 @@ WRITE8_MEMBER(system1_state::system1_mixer_collision_reset_w) } - /************************************* * * Sprite collision I/O * *************************************/ -READ8_MEMBER(system1_state::system1_sprite_collision_r) +READ8_MEMBER(system1_state::sprite_collision_r) { // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); return m_sprite_collide[offset & 0x3ff] | 0x7e | (m_sprite_collide_summary << 7); } -WRITE8_MEMBER(system1_state::system1_sprite_collision_w) +WRITE8_MEMBER(system1_state::sprite_collision_w) { // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); m_sprite_collide[offset & 0x3ff] = 0; } -WRITE8_MEMBER(system1_state::system1_sprite_collision_reset_w) +WRITE8_MEMBER(system1_state::sprite_collision_reset_w) { // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); @@ -239,7 +312,6 @@ WRITE8_MEMBER(system1_state::system1_sprite_collision_reset_w) } - /************************************* * * Video RAM access @@ -254,27 +326,25 @@ inline void system1_state::videoram_wait_states(cpu_device *cpu) /* this assumes 4 5MHz pixel clocks per FIXST, or 8*4 20MHz CPU clocks, and is based on a dump of 315-5137 */ - const uint32_t cpu_cycles_per_fixst = 4 * 4; - const uint32_t fixst_offset = 2 * 4; - uint32_t cycles_until_next_fixst = cpu_cycles_per_fixst - ((cpu->total_cycles() - fixst_offset) % cpu_cycles_per_fixst); + const u32 cpu_cycles_per_fixst = 4 * 4; + const u32 fixst_offset = 2 * 4; + u32 cycles_until_next_fixst = cpu_cycles_per_fixst - ((cpu->total_cycles() - fixst_offset) % cpu_cycles_per_fixst); cpu->adjust_icount(-cycles_until_next_fixst); } -READ8_MEMBER(system1_state::system1_videoram_r) +READ8_MEMBER(system1_state::videoram_r) { - uint8_t *videoram = m_videoram.get(); videoram_wait_states(m_maincpu); offset |= 0x1000 * ((m_videoram_bank >> 1) % (m_tilemap_pages / 2)); - return videoram[offset]; + return m_videoram[offset]; } -WRITE8_MEMBER(system1_state::system1_videoram_w) +WRITE8_MEMBER(system1_state::videoram_w) { - uint8_t *videoram = m_videoram.get(); videoram_wait_states(m_maincpu); offset |= 0x1000 * ((m_videoram_bank >> 1) % (m_tilemap_pages / 2)); - videoram[offset] = data; + m_videoram[offset] = data; m_tilemap_page[offset / 0x800]->mark_tile_dirty((offset % 0x800) / 2); @@ -286,66 +356,25 @@ WRITE8_MEMBER(system1_state::system1_videoram_w) } } -WRITE8_MEMBER(system1_state::system1_videoram_bank_w) +WRITE8_MEMBER(system1_state::videoram_bank_w) { m_videoram_bank = data; } - /************************************* * * Palette RAM access * *************************************/ -WRITE8_MEMBER(system1_state::system1_paletteram_w) +WRITE8_MEMBER(system1_state::paletteram_w) { - /* - There are two kind of color handling: in the System 1 games, values in the - palette RAM are directly mapped to colors with the usual BBGGGRRR format; - in the System 2 ones (Choplifter, WBML, etc.), the value in the palette RAM - is a lookup offset for three palette PROMs in RRRRGGGGBBBB format. - - It's hard to tell for sure because they use resistor packs, but here's - what I think the values are from measurment with a volt meter: - - Blue: .250K ohms - Blue: .495K ohms - Green:.250K ohms - Green:.495K ohms - Green:.995K ohms - Red: .495K ohms - Red: .250K ohms - Red: .995K ohms - - accurate to +/- .003K ohms. - */ - - if (m_color_prom != nullptr) - { - m_paletteram[offset] = data; - uint8_t val; - - val = m_color_prom[data + 0 * 256]; - uint8_t r = 0x0e * BIT(val, 0) + 0x1f * BIT(val, 1) + 0x43 * BIT(val, 2) + 0x8f * BIT(val, 3); - - val = m_color_prom[data + 1 * 256]; - uint8_t g = 0x0e * BIT(val, 0) + 0x1f * BIT(val, 1) + 0x43 * BIT(val, 2) + 0x8f * BIT(val, 3); - - val = m_color_prom[data + 2 * 256]; - uint8_t b = 0x0e * BIT(val, 0) + 0x1f * BIT(val, 1) + 0x43 * BIT(val, 2) + 0x8f * BIT(val, 3); - - m_palette->set_pen_color(offset, rgb_t(r, g, b)); - } - else - { - m_palette->write8(offset, data); - } + m_paletteram[offset] = data; + m_palette->set_pen_indirect(offset, m_paletteram[offset]); } - /************************************* * * Sprite rendering @@ -354,25 +383,20 @@ WRITE8_MEMBER(system1_state::system1_paletteram_w) void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset) { - uint32_t gfxbanks = memregion("sprites")->bytes() / 0x8000; - const uint8_t *gfxbase = memregion("sprites")->base(); - uint8_t *spriteram = m_spriteram; - int flipscreen = flip_screen(); - int spritenum; + const u32 gfxbanks = m_spriterom.bytes() / 0x8000; + const int flipscreen = flip_screen(); /* up to 32 sprites total */ - for (spritenum = 0; spritenum < 32; spritenum++) + for (int spritenum = 0; spritenum < 32; spritenum++) { - const uint8_t *spritedata = &spriteram[spritenum * 0x10]; - uint16_t srcaddr = spritedata[6] + (spritedata[7] << 8); - uint16_t stride = spritedata[4] + (spritedata[5] << 8); - uint8_t bank = ((spritedata[3] & 0x80) >> 7) | ((spritedata[3] & 0x40) >> 5) | ((spritedata[3] & 0x20) >> 3); - int xstart = ((spritedata[2] | (spritedata[3] << 8)) & 0x1ff) + xoffset; + const u8 *spritedata = &m_spriteram[spritenum * 0x10]; + u16 srcaddr = spritedata[6] + (spritedata[7] << 8); + const u16 stride = spritedata[4] + (spritedata[5] << 8); + u8 bank = ((spritedata[3] & 0x80) >> 7) | ((spritedata[3] & 0x40) >> 5) | ((spritedata[3] & 0x20) >> 3); + const int xstart = ((spritedata[2] | (spritedata[3] << 8)) & 0x1ff) + xoffset; int bottom = spritedata[1] + 1; int top = spritedata[0] + 1; - uint16_t palettebase = spritenum * 0x10; - const uint8_t *gfxbankbase; - int x, y, i; + const u16 palettebase = spritenum * 0x10; /* writing an 0xff into the first byte of sprite RAM seems to disable all sprites; not sure if this applies to each sprite or only to the first one; see pitfall2 @@ -382,7 +406,7 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect /* clamp the bank to the size of the sprite ROMs */ bank %= gfxbanks; - gfxbankbase = gfxbase + bank * 0x8000; + const u8 *gfxbankbase = &m_spriterom[bank * 0x8000]; /* flip sprites vertically */ if (flipscreen) @@ -393,11 +417,9 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } /* iterate over all rows of the sprite */ - for (y = top; y < bottom; y++) + for (int y = top; y < bottom; y++) { - uint16_t *destbase = &bitmap.pix16(y); - uint16_t curaddr; - int addrdelta; + u16 *destbase = &bitmap.pix16(y); /* advance by the row counter */ srcaddr += stride; @@ -407,13 +429,12 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect continue; /* iterate over X */ - addrdelta = (srcaddr & 0x8000) ? -1 : 1; - for (x = xstart, curaddr = srcaddr; ; x += 4, curaddr += addrdelta) + int addrdelta = (srcaddr & 0x8000) ? -1 : 1; + for (int x = xstart, curaddr = srcaddr; ; x += 4, curaddr += addrdelta) { - uint8_t color1, color2; - uint8_t data; + u8 color1, color2; - data = gfxbankbase[curaddr & 0x7fff]; + const u8 data = gfxbankbase[curaddr & 0x7fff]; /* non-flipped case */ if (!(curaddr & 0x8000)) @@ -434,12 +455,12 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect /* draw if non-transparent */ if (color1 != 0) { - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { - int effx = flipscreen ? 0x1fe - (x + i) : (x + i); + const int effx = flipscreen ? 0x1fe - (x + i) : (x + i); if (effx >= cliprect.min_x && effx <= cliprect.max_x) { - int prevpix = destbase[effx]; + const int prevpix = destbase[effx]; if ((prevpix & 0x0f) != 0) m_sprite_collide[((prevpix >> 4) & 0x1f) + 32 * spritenum] = m_sprite_collide_summary = 1; @@ -455,12 +476,12 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect /* draw if non-transparent */ if (color2 != 0) { - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { - int effx = flipscreen ? 0x1fe - (x + 2 + i) : (x + 2 + i); + const int effx = flipscreen ? 0x1fe - (x + 2 + i) : (x + 2 + i); if (effx >= cliprect.min_x && effx <= cliprect.max_x) { - int prevpix = destbase[effx]; + const int prevpix = destbase[effx]; if ((prevpix & 0x0f) != 0) m_sprite_collide[((prevpix >> 4) & 0x1f) + 32 * spritenum] = m_sprite_collide_summary = 1; @@ -474,7 +495,6 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } - /************************************* * * Generic update code @@ -483,44 +503,44 @@ void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect void system1_state::video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs) { - const uint8_t *lookup = memregion("proms")->base(); - int x, y; - + if (m_video_mode & 0x10) + { + bitmap.fill(0, cliprect); + return; + } /* first clear the sprite bitmap and draw sprites within this area */ m_sprite_bitmap.fill(0, cliprect); draw_sprites(m_sprite_bitmap, cliprect, spritexoffs); /* iterate over rows */ - for (y = cliprect.min_y; y <= cliprect.max_y; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t *fgbase = &fgpixmap.pix16(y & 0xff); - uint16_t *sprbase = &m_sprite_bitmap.pix16(y & 0xff); - uint16_t *dstbase = &bitmap.pix16(y); - int bgy = (y + bgyscroll) & 0x1ff; - int bgxscroll = bgrowscroll[y >> 3 & 0x1f]; - uint16_t *bgbase[2]; + const u16 *fgbase = &fgpixmap.pix16(y & 0xff); + const u16 *sprbase = &m_sprite_bitmap.pix16(y & 0xff); + u16 *dstbase = &bitmap.pix16(y); + const int bgy = (y + bgyscroll) & 0x1ff; + const int bgxscroll = bgrowscroll[y >> 3 & 0x1f]; + const u16 *bgbase[2]; /* get the base of the left and right pixmaps for the effective background Y */ bgbase[0] = &bgpixmaps[(bgy >> 8) * 2 + 0]->pix16(bgy & 0xff); bgbase[1] = &bgpixmaps[(bgy >> 8) * 2 + 1]->pix16(bgy & 0xff); /* iterate over pixels */ - for (x = cliprect.min_x; x <= cliprect.max_x; x++) + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - int bgx = ((x - bgxscroll) / 2) & 0x1ff; - uint16_t fgpix = fgbase[(x / 2) & 0xff]; - uint16_t bgpix = bgbase[bgx >> 8][bgx & 0xff]; - uint16_t sprpix = sprbase[x]; - uint8_t lookup_index; - uint8_t lookup_value; + const int bgx = ((x - bgxscroll) / 2) & 0x1ff; + const u16 fgpix = fgbase[(x / 2) & 0xff]; + const u16 bgpix = bgbase[bgx >> 8][bgx & 0xff]; + const u16 sprpix = sprbase[x]; /* using the sprite, background, and foreground pixels, look up the color behavior */ - lookup_index = (((sprpix & 0xf) == 0) << 0) | + const u8 lookup_index = (((sprpix & 0xf) == 0) << 0) | (((fgpix & 7) == 0) << 1) | (((fgpix >> 9) & 3) << 2) | (((bgpix & 7) == 0) << 4) | (((bgpix >> 9) & 3) << 5); - lookup_value = lookup[lookup_index]; + u8 lookup_value = m_lookup_prom[lookup_index]; /* compute collisions based on two of the PROM bits */ if (!(lookup_value & 4)) @@ -528,9 +548,7 @@ void system1_state::video_update_common(screen_device &screen, bitmap_ind16 &bit /* the lower 2 PROM bits select the palette and which pixels */ lookup_value &= 3; - if (m_video_mode & 0x10) - dstbase[x] = 0; - else if (lookup_value == 0) + if (lookup_value == 0) dstbase[x] = 0x000 | (sprpix & 0x1ff); else if (lookup_value == 1) dstbase[x] = 0x200 | (fgpix & 0x1ff); @@ -541,20 +559,16 @@ void system1_state::video_update_common(screen_device &screen, bitmap_ind16 &bit } - /************************************* * * Board-specific update front-ends * *************************************/ -uint32_t system1_state::screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 system1_state::screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *videoram = m_videoram.get(); bitmap_ind16 *bgpixmaps[4]; int bgrowscroll[32]; - int xscroll, yscroll; - int y; /* all 4 background pages are the same, fixed to page 0 */ bgpixmaps[0] = bgpixmaps[1] = bgpixmaps[2] = bgpixmaps[3] = &m_tilemap_page[0]->pixmap(); @@ -563,8 +577,8 @@ uint32_t system1_state::screen_update_system1(screen_device &screen, bitmap_ind1 bitmap_ind16 &fgpixmap = m_tilemap_page[1]->pixmap(); /* get fixed scroll offsets */ - xscroll = (int16_t)((videoram[0xffc] | (videoram[0xffd] << 8)) + 28); - yscroll = videoram[0xfbd]; + int xscroll = (s16)((m_videoram[0xffc] | (m_videoram[0xffd] << 8)) + 28); + int yscroll = m_videoram[0xfbd]; /* adjust for flipping */ if (flip_screen()) @@ -574,7 +588,7 @@ uint32_t system1_state::screen_update_system1(screen_device &screen, bitmap_ind1 } /* fill in the row scroll table */ - for (y = 0; y < 32; y++) + for (int y = 0; y < 32; y++) bgrowscroll[y] = xscroll; /* common update */ @@ -583,20 +597,18 @@ uint32_t system1_state::screen_update_system1(screen_device &screen, bitmap_ind1 } -uint32_t system1_state::screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 system1_state::screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *videoram = m_videoram.get(); bitmap_ind16 *bgpixmaps[4]; int rowscroll[32]; int xscroll, yscroll; int sprxoffset; - int y; /* 4 independent background pages */ - bgpixmaps[0] = &m_tilemap_page[videoram[0x740] & 7]->pixmap(); - bgpixmaps[1] = &m_tilemap_page[videoram[0x742] & 7]->pixmap(); - bgpixmaps[2] = &m_tilemap_page[videoram[0x744] & 7]->pixmap(); - bgpixmaps[3] = &m_tilemap_page[videoram[0x746] & 7]->pixmap(); + bgpixmaps[0] = &m_tilemap_page[m_videoram[0x740] & 7]->pixmap(); + bgpixmaps[1] = &m_tilemap_page[m_videoram[0x742] & 7]->pixmap(); + bgpixmaps[2] = &m_tilemap_page[m_videoram[0x744] & 7]->pixmap(); + bgpixmaps[3] = &m_tilemap_page[m_videoram[0x746] & 7]->pixmap(); /* foreground is fixed to page 0 */ bitmap_ind16 &fgpixmap = m_tilemap_page[0]->pixmap(); @@ -604,19 +616,19 @@ uint32_t system1_state::screen_update_system2(screen_device &screen, bitmap_ind1 /* get scroll offsets */ if (!flip_screen()) { - xscroll = ((videoram[0x7c0] | (videoram[0x7c1] << 8)) & 0x1ff) - 512 + 10; - yscroll = videoram[0x7ba]; + xscroll = ((m_videoram[0x7c0] | (m_videoram[0x7c1] << 8)) & 0x1ff) - 512 + 10; + yscroll = m_videoram[0x7ba]; sprxoffset = 14; } else { - xscroll = 512 + 512 + 10 - (((videoram[0x7f6] | (videoram[0x7f7] << 8)) & 0x1ff) - 512 + 10); - yscroll = 512 + 512 - videoram[0x784]; + xscroll = 512 + 512 + 10 - (((m_videoram[0x7f6] | (m_videoram[0x7f7] << 8)) & 0x1ff) - 512 + 10); + yscroll = 512 + 512 - m_videoram[0x784]; sprxoffset = -14; } /* fill in the row scroll table */ - for (y = 0; y < 32; y++) + for (int y = 0; y < 32; y++) rowscroll[y] = xscroll; /* common update */ @@ -625,20 +637,18 @@ uint32_t system1_state::screen_update_system2(screen_device &screen, bitmap_ind1 } -uint32_t system1_state::screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 system1_state::screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *videoram = m_videoram.get(); bitmap_ind16 *bgpixmaps[4]; int rowscroll[32]; int yscroll; int sprxoffset; - int y; /* 4 independent background pages */ - bgpixmaps[0] = &m_tilemap_page[videoram[0x740] & 7]->pixmap(); - bgpixmaps[1] = &m_tilemap_page[videoram[0x742] & 7]->pixmap(); - bgpixmaps[2] = &m_tilemap_page[videoram[0x744] & 7]->pixmap(); - bgpixmaps[3] = &m_tilemap_page[videoram[0x746] & 7]->pixmap(); + bgpixmaps[0] = &m_tilemap_page[m_videoram[0x740] & 7]->pixmap(); + bgpixmaps[1] = &m_tilemap_page[m_videoram[0x742] & 7]->pixmap(); + bgpixmaps[2] = &m_tilemap_page[m_videoram[0x744] & 7]->pixmap(); + bgpixmaps[3] = &m_tilemap_page[m_videoram[0x746] & 7]->pixmap(); /* foreground is fixed to page 0 */ bitmap_ind16 &fgpixmap = m_tilemap_page[0]->pixmap(); @@ -646,18 +656,18 @@ uint32_t system1_state::screen_update_system2_rowscroll(screen_device &screen, b /* get scroll offsets */ if (!flip_screen()) { - for (y = 0; y < 32; y++) - rowscroll[y] = ((videoram[0x7c0 + y * 2] | (videoram[0x7c1 + y * 2] << 8)) & 0x1ff) - 512 + 10; + for (int y = 0; y < 32; y++) + rowscroll[y] = ((m_videoram[0x7c0 + y * 2] | (m_videoram[0x7c1 + y * 2] << 8)) & 0x1ff) - 512 + 10; - yscroll = videoram[0x7ba]; + yscroll = m_videoram[0x7ba]; sprxoffset = 14; } else { - for (y = 0; y < 32; y++) - rowscroll[y] = 512 + 512 + 10 - (((videoram[0x7fe - y * 2] | (videoram[0x7ff - y * 2] << 8)) & 0x1ff) - 512 + 10); + for (int y = 0; y < 32; y++) + rowscroll[y] = 512 + 512 + 10 - (((m_videoram[0x7fe - y * 2] | (m_videoram[0x7ff - y * 2] << 8)) & 0x1ff) - 512 + 10); - yscroll = 512 + 512 - videoram[0x784]; + yscroll = 512 + 512 - m_videoram[0x784]; sprxoffset = -14; } diff --git a/src/mame/video/tecmosys.cpp b/src/mame/video/tecmosys.cpp index 53c43e887ed..a5947d49b89 100644 --- a/src/mame/video/tecmosys.cpp +++ b/src/mame/video/tecmosys.cpp @@ -41,24 +41,24 @@ void tecmosys_state::render_sprites_to_bitmap(const rectangle &cliprect, u16 ext for (int i = (m_spritelist * 0x4000) / 2; i < ((m_spritelist + 1) * 0x4000) / 2; i += 8) { /* - sprite format (16 bytes per each sprite) - fedcba98 76543210 - 00 ------xx xxxxxxxx X position (10 bit signed) - 02 -------x xxxxxxxx Y position (9 bit signed) - 04 ----iiii ffffffff Zoom X (add destination X position per each X counter, 4.8(8.8?) fixed point)* - 06 ----iiii ffffffff Zoom Y (add destination Y position per each Y counter, 4.8(8.8?) fixed point)* - 08 x------- -------- Disable this sprite - --xxxxxx -------- Palette select (256 color each) - -------- x------- Flip Y - -------- -x------ Flip X - -------- --xx---- Priority - -------- ----xxxx ROM offset MSB - 0a xxxxxxxx xxxxxxxx ROM offset LSB (256 byte each) - 0c xxxxxxxx -------- Source Width (16 pixel each) - -------- xxxxxxxx Source Height (16 pixel each) - 0e -------- -------- Unused - - * : i = integer value, f = fraction value + sprite format (16 bytes per each sprite) + fedcba98 76543210 + 00 ------xx xxxxxxxx X position (10 bit signed) + 02 -------x xxxxxxxx Y position (9 bit signed) + 04 ----iiii ffffffff Zoom X (add destination X position per each X counter, 4.8(8.8?) fixed point)* + 06 ----iiii ffffffff Zoom Y (add destination Y position per each Y counter, 4.8(8.8?) fixed point)* + 08 x------- -------- Disable this sprite + --xxxxxx -------- Palette select (256 color each) + -------- x------- Flip Y + -------- -x------ Flip X + -------- --xx---- Priority + -------- ----xxxx ROM offset MSB + 0a xxxxxxxx xxxxxxxx ROM offset LSB (256 byte each) + 0c xxxxxxxx -------- Source Width (16 pixel each) + -------- xxxxxxxx Source Height (16 pixel each) + 0e -------- -------- Unused + + * : i = integer value, f = fraction value */ if (m_spriteram[i+4] & 0x8000) diff --git a/src/mame/video/thomson.cpp b/src/mame/video/thomson.cpp index a3e386b1e3c..d4f9acbe778 100644 --- a/src/mame/video/thomson.cpp +++ b/src/mame/video/thomson.cpp @@ -11,7 +11,7 @@ #include "emu.h" #include "includes/thomson.h" -#include <math.h> +#include <cmath> //#define VERBOSE 1 #include "logmacro.h" diff --git a/src/mame/video/ut88.cpp b/src/mame/video/ut88.cpp index f8c8bd7b4ba..565d27cae48 100644 --- a/src/mame/video/ut88.cpp +++ b/src/mame/video/ut88.cpp @@ -24,20 +24,14 @@ const gfx_layout ut88_charlayout = 8*8 /* size of one char */ }; -VIDEO_START_MEMBER(ut88_state,ut88) +uint32_t ut88_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { -} - -uint32_t ut88_state::screen_update_ut88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int x,y; - - for(y = 0; y < 28; y++ ) + for (int y = 0; y < 28; y++) { - for(x = 0; x < 64; x++ ) + for (int x = 0; x < 64; x++) { - int code = m_p_videoram[ x + y*64 ] & 0x7f; - int attr = m_p_videoram[ x+1 + y*64 ] & 0x80; + int code = m_p_videoram[x + y*64] & 0x7f; + int attr = m_p_videoram[x+1 + y*64] & 0x80; m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code | attr, 0, 0,0, x*8,y*8); } } diff --git a/src/mame/video/vectrex.cpp b/src/mame/video/vectrex.cpp index 67502327e24..e819911e162 100644 --- a/src/mame/video/vectrex.cpp +++ b/src/mame/video/vectrex.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Mathis Rosenhauer -#include <math.h> +#include <cmath> #include "emu.h" #include "includes/vectrex.h" #include "cpu/m6809/m6809.h" diff --git a/src/mame/video/vtvideo.cpp b/src/mame/video/vtvideo.cpp index 8e67e6957b5..1eed93f2736 100644 --- a/src/mame/video/vtvideo.cpp +++ b/src/mame/video/vtvideo.cpp @@ -139,7 +139,9 @@ void vt100_video_device::device_start() void vt100_video_device::device_reset() { m_palette->set_pen_color(0, 0x00, 0x00, 0x00); // black - m_palette->set_pen_color(1, 0xff, 0xff, 0xff); // white + m_palette->set_pen_color(1, 0xff - 100, 0xff - 100, 0xff - 100); // WHITE (dim) + m_palette->set_pen_color(2, 0xff - 50, 0xff - 50, 0xff - 50); // WHITE NORMAL + m_palette->set_pen_color(3, 0xff, 0xff, 0xff); // WHITE (brighter) m_height = 25; m_height_MAX = 25; @@ -363,80 +365,12 @@ WRITE8_MEMBER(vt100_video_device::brightness_w) -void vt100_video_device::display_char(bitmap_ind16 &bitmap, uint8_t code, int x, int y, uint8_t scroll_region, uint8_t display_type) -{ - uint8_t line = 0; - int bit = 0, prevbit, invert = 0, j; - int double_width = (display_type == 2) ? 1 : 0; - - int char_lines = m_linedoubler ? 20 : 10; - for (int i = 0; i < char_lines; i++) - { - int yy = y * char_lines + i; - assert(yy < bitmap.height()); - - switch (display_type) - { - case 0: // bottom half, double height - j = (i >> (m_linedoubler ? 2 : 1)) + 5; break; - case 1: // top half, double height - j = i >> (m_linedoubler ? 2 : 1); break; - case 2: // double width - case 3: // normal - j = i >> (m_linedoubler ? 1 : 0); break; - default: j = 0; break; - } - // modify line since that is how it is stored in rom - if (j == 0) j = 15; else j = j - 1; - - line = m_char_rom[(code & 0x7f) * 16 + j]; - - if (m_basic_attribute == 1) - { - if ((code & 0x80) == 0x80) - invert = 1; - else - invert = 0; - } - - for (int b = 0; b < 8; b++) - { - prevbit = bit; - bit = BIT((line << b), 7); - if (double_width) - { - bitmap.pix16(yy, x * 20 + b * 2) = (bit | prevbit) ^ invert; - bitmap.pix16(yy, x * 20 + b * 2 + 1) = bit ^ invert; - } - else - { - bitmap.pix16(yy, x * 10 + b) = (bit | prevbit) ^ invert; - } - } - prevbit = bit; - // char interleave is filled with last bit - if (double_width) - { - bitmap.pix16(yy, x * 20 + 16) = (bit | prevbit) ^ invert; - bitmap.pix16(yy, x * 20 + 17) = bit ^ invert; - bitmap.pix16(yy, x * 20 + 18) = bit ^ invert; - bitmap.pix16(yy, x * 20 + 19) = bit ^ invert; - } - else - { - bitmap.pix16(yy, x * 10 + 8) = (bit | prevbit) ^ invert; - bitmap.pix16(yy, x * 10 + 9) = bit ^ invert; - } - } -} - void vt100_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) { uint16_t addr = 0; int line = 0; int xpos = 0; int ypos = 0; - uint8_t code; int x = 0; uint8_t scroll_region = 1; // binary 1 uint8_t display_type = 3; // binary 11 @@ -454,24 +388,24 @@ void vt100_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &cli } while (line < vert_charlines_MAX) { - code = m_read_ram(addr + xpos); + uint8_t code = m_read_ram(addr + xpos); if (code == 0x7f) { // end of line, fill empty till end of line if (line >= fill_lines) { - for (x = xpos; x < ((display_type == 2) ? (m_columns / 2) : m_columns); x++) + for (x = xpos; x < ((display_type != 3) ? (m_columns / 2) : m_columns); x++) { - display_char(bitmap, code, x, ypos, scroll_region, display_type); + display_char(bitmap, code, x, ypos, scroll_region, display_type, false, false, false, false, false); } } // move to new data temp = m_read_ram(addr + xpos + 1) * 256 + m_read_ram(addr + xpos + 2); addr = (temp)& 0x1fff; - // if A12 is 1 then it is 0x2000 block, if 0 then 0x4000 (AVO) - if (addr & 0x1000) addr &= 0xfff; else addr |= 0x2000; + // if A12 is 1 then it is 0x2000 block, if 0 then 0x4000 (AVO - not actually implemented?) + /*if (addr & 0x1000)*/ addr &= 0xfff; /*else addr |= 0x2000;*/ scroll_region = (temp >> 15) & 1; - display_type = (temp >> 13) & 3; + display_type = bitswap<2>((temp >> 13) & 3, 0, 1); if (line >= fill_lines) ypos++; xpos = 0; @@ -484,7 +418,8 @@ void vt100_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &cli // display regular char if (line >= fill_lines) { - display_char(bitmap, code, xpos, ypos, scroll_region, display_type); + uint8_t attr = m_read_ram(0x1000 + addr + xpos); + display_char(bitmap, code & 0x7f, xpos, ypos, scroll_region, display_type, BIT(code, 7), !BIT(attr, 2), !BIT(attr, 0), !BIT(attr, 1), false); } xpos++; if (xpos > m_columns) @@ -515,11 +450,11 @@ void vt100_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &cli // LINE ATTRIBUTE 'double_height' always is interpreted as 'double width + double height' // ATTRIBUTES: No attributes = 0x0E -// 1 = display char. in REVERSE (encoded as 8 in display_type) HIGH ACTIVE -// 0 = display char. in BOLD (encoded as 16 in display_type) LOW ACTIVE -// 0 = display char. w. BLINK (encoded as 32 in display_type) LOW ACTIVE -// 0 = display char. w. UNDERLINE (encoded as 64 in display_type) LOW ACTIVE -void rainbow_video_device::display_char(bitmap_ind16 &bitmap, uint8_t code, int x, int y, uint8_t scroll_region, uint8_t display_type) +// 1 = display char. in REVERSE (encoded as 1 in attribute) HIGH ACTIVE +// 0 = display char. in BOLD (encoded as 2 in attribute) LOW ACTIVE +// 0 = display char. w. BLINK (encoded as 4 in attribute) LOW ACTIVE +// 0 = display char. w. UNDERLINE (encoded as 8 in attribute) LOW ACTIVE +void vt100_video_device::display_char(bitmap_ind16 &bitmap, uint8_t code, int x, int y, uint8_t scroll_region, uint8_t display_type, bool invert, bool bold, bool blink, bool underline, bool blank) { uint16_t x_preset = x << 3; // x_preset = x * 9 (= 132 column mode) x_preset += x; @@ -540,12 +475,6 @@ void rainbow_video_device::display_char(bitmap_ind16 &bitmap, uint8_t code, int int fg_intensity; int back_intensity, back_default_intensity; - int invert = (display_type & 8) ? 1 : 0; // REVERSE - int bold = (display_type & 16) ? 0 : 1; // BIT 4 - int blink = (display_type & 32) ? 0 : 1; // BIT 5 - int underline = (display_type & 64) ? 0 : 1; // BIT 6 - bool blank = (display_type & 128) ? true : false; // BIT 7 - display_type = display_type & 3; // * SCREEN ATTRIBUTES (see VT-180 manual 6-30) * @@ -746,17 +675,18 @@ void rainbow_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &c { code = m_read_ram(addr + xpos); + bool force_blank; if (code == 0x00) // TODO: investigate side effect on regular zero character! - display_type |= 0x80; // DEFAULT: filler chars (till end of line) and empty lines (00) will be blanked + force_blank = true; // DEFAULT: filler chars (till end of line) and empty lines (00) will be blanked else - display_type &= 0x7f; // else activate display. + force_blank = false; // else activate display. if (code == 0xff) // end of line, fill empty till end of line { - // HINT: display_type is already shifted! All except 3 is DOUBLE WIDTH 40 or 66 chars per line + // All except 3 is DOUBLE WIDTH 40 or 66 chars per line for (x = xpos; x < ((display_type != 3) ? (m_columns / 2) : m_columns); x++) { - display_char(bitmap, code, x, ypos, scroll_region, display_type | 0x80); + display_char(bitmap, code, x, ypos, scroll_region, display_type, false, false, false, false, true); } // LINE ATTRIBUTE - valid for all chars on next line ** DO NOT SHUFFLE ** @@ -783,10 +713,10 @@ void rainbow_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &c else { attr_addr = 0x1000 | ((addr + xpos) & 0x0fff); - temp = (m_read_ram(attr_addr) & 15) << 3; // get character attributes + temp = (m_read_ram(attr_addr) & 15); // get character attributes // see 'display_char' for an explanation of attribute encoding - - display_char(bitmap, code, xpos, ypos, scroll_region, display_type | temp); + display_char(bitmap, code, xpos, ypos, scroll_region, display_type, BIT(temp, 0), !BIT(temp, 1), !BIT(temp, 2), !BIT(temp, 3), force_blank); xpos++; if (xpos > m_columns) @@ -919,10 +849,5 @@ TIMER_CALLBACK_MEMBER(vt100_video_device::lba3_change) void vt100_video_device::device_add_mconfig(machine_config &config) { - PALETTE(config, m_palette, palette_device::MONOCHROME); -} - -void rainbow_video_device::device_add_mconfig(machine_config &config) -{ PALETTE(config, m_palette).set_entries(4); } diff --git a/src/mame/video/vtvideo.h b/src/mame/video/vtvideo.h index 0d135a3973b..5a475716d29 100644 --- a/src/mame/video/vtvideo.h +++ b/src/mame/video/vtvideo.h @@ -48,7 +48,7 @@ protected: // internal state void recompute_parameters(); void vblank_callback(screen_device &screen, bool state); - virtual void display_char(bitmap_ind16 &bitmap, uint8_t code, int x, int y, uint8_t scroll_region, uint8_t display_type); + void display_char(bitmap_ind16 &bitmap, uint8_t code, int x, int y, uint8_t scroll_region, uint8_t display_type, bool invert, bool bold, bool blink, bool underline, bool blank); TIMER_CALLBACK_MEMBER(lba3_change); TIMER_CALLBACK_MEMBER(lba7_change); virtual void notify_vblank(bool choice) { } @@ -101,10 +101,8 @@ public: void palette_select(int choice); protected: - virtual void display_char(bitmap_ind16 &bitmap, uint8_t code, int x, int y, uint8_t scroll_region, uint8_t display_type) override; virtual void notify_vblank(bool choice) override; virtual void device_reset() override; - virtual void device_add_mconfig(machine_config &config) override; }; DECLARE_DEVICE_TYPE(VT100_VIDEO, vt100_video_device) diff --git a/src/mame/video/williams.cpp b/src/mame/video/williams.cpp index e7bdd55087b..6dfeaca70ba 100644 --- a/src/mame/video/williams.cpp +++ b/src/mame/video/williams.cpp @@ -167,23 +167,23 @@ void williams_state::state_save_register() } -VIDEO_START_MEMBER(williams_state,williams) +void williams_state::video_start() { blitter_init(m_blitter_config, nullptr); state_save_register(); } -VIDEO_START_MEMBER(blaster_state,blaster) +void blaster_state::video_start() { blitter_init(m_blitter_config, memregion("proms")->base()); state_save_register(); - save_item(NAME(m_blaster_color0)); - save_item(NAME(m_blaster_video_control)); + save_item(NAME(m_color0)); + save_item(NAME(m_video_control)); } -VIDEO_START_MEMBER(williams2_state,williams2) +void williams2_state::video_start() { blitter_init(m_blitter_config, nullptr); @@ -193,7 +193,7 @@ VIDEO_START_MEMBER(williams2_state,williams2) state_save_register(); save_item(NAME(m_tilemap_xscroll)); - save_item(NAME(m_williams2_fg_color)); + save_item(NAME(m_fg_color)); } @@ -204,7 +204,7 @@ VIDEO_START_MEMBER(williams2_state,williams2) * *************************************/ -uint32_t williams_state::screen_update_williams(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t williams_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rgb_t pens[16]; int x, y; @@ -231,32 +231,31 @@ uint32_t williams_state::screen_update_williams(screen_device &screen, bitmap_rg } -uint32_t blaster_state::screen_update_blaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t blaster_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rgb_t pens[16]; - int x, y; /* precompute the palette */ - for (x = 0; x < 16; x++) + for (int x = 0; x < 16; x++) pens[x] = m_palette->pen_color(m_paletteram[x]); /* if we're blitting from the top, start with a 0 for color 0 */ - if (cliprect.min_y == screen.visible_area().min_y || !(m_blaster_video_control & 1)) - m_blaster_color0 = m_palette->pen_color(m_blaster_palette_0[0] ^ 0xff); + if (cliprect.min_y == screen.visible_area().min_y || !(m_video_control & 1)) + m_color0 = m_palette->pen_color(m_palette_0[0] ^ 0xff); /* loop over rows */ - for (y = cliprect.min_y; y <= cliprect.max_y; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - int erase_behind = m_blaster_video_control & m_blaster_scanline_control[y] & 2; + int erase_behind = m_video_control & m_scanline_control[y] & 2; uint8_t *source = &m_videoram[y]; uint32_t *dest = &bitmap.pix32(y); /* latch a new color0 pen? */ - if (m_blaster_video_control & m_blaster_scanline_control[y] & 1) - m_blaster_color0 = m_palette->pen_color(m_blaster_palette_0[y] ^ 0xff); + if (m_video_control & m_scanline_control[y] & 1) + m_color0 = m_palette->pen_color(m_palette_0[y] ^ 0xff); /* loop over columns */ - for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2) + for (int x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2) { int pix = source[(x/2) * 256]; @@ -265,34 +264,33 @@ uint32_t blaster_state::screen_update_blaster(screen_device &screen, bitmap_rgb3 source[(x/2) * 256] = 0; /* now draw */ - dest[x+0] = (pix & 0xf0) ? pens[pix >> 4] : rgb_t(m_blaster_color0 | pens[0]); - dest[x+1] = (pix & 0x0f) ? pens[pix & 0x0f] : rgb_t(m_blaster_color0 | pens[0]); + dest[x+0] = (pix & 0xf0) ? pens[pix >> 4] : rgb_t(m_color0 | pens[0]); + dest[x+1] = (pix & 0x0f) ? pens[pix & 0x0f] : rgb_t(m_color0 | pens[0]); } } return 0; } -uint32_t williams2_state::screen_update_williams2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t williams2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rgb_t pens[16]; - int x, y; /* draw the background */ m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* fetch the relevant pens */ - for (x = 1; x < 16; x++) - pens[x] = m_palette->pen_color(m_williams2_fg_color * 16 + x); + for (int x = 1; x < 16; x++) + pens[x] = m_palette->pen_color(m_fg_color * 16 + x); /* loop over rows */ - for (y = cliprect.min_y; y <= cliprect.max_y; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { uint8_t *source = &m_videoram[y]; uint32_t *dest = &bitmap.pix32(y); /* loop over columns */ - for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2) + for (int x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2) { int pix = source[(x/2) * 256]; @@ -313,7 +311,7 @@ uint32_t williams2_state::screen_update_williams2(screen_device &screen, bitmap_ * *************************************/ -void williams_state::williams_palette(palette_device &palette) const +void williams_state::palette_init(palette_device &palette) const { static constexpr int resistances_rg[3] = { 1200, 560, 330 }; static constexpr int resistances_b[2] = { 560, 330 }; @@ -340,7 +338,7 @@ void williams_state::williams_palette(palette_device &palette) const -void williams2_state::williams2_paletteram_w(offs_t offset, u8 data) +void williams2_state::paletteram_w(offs_t offset, u8 data) { static const uint8_t ztable[16] = { @@ -365,9 +363,9 @@ void williams2_state::williams2_paletteram_w(offs_t offset, u8 data) } -void williams2_state::williams2_fg_select_w(u8 data) +void williams2_state::fg_select_w(u8 data) { - m_williams2_fg_color = data & 0x3f; + m_fg_color = data & 0x3f; } @@ -378,7 +376,7 @@ void williams2_state::williams2_fg_select_w(u8 data) * *************************************/ -u8 williams_state::williams_video_counter_r() +u8 williams_state::video_counter_r() { if (m_screen->vpos() < 0x100) return m_screen->vpos() & 0xfc; @@ -397,77 +395,78 @@ u8 williams_state::williams_video_counter_r() TILE_GET_INFO_MEMBER(williams2_state::get_tile_info) { int mask = m_gfxdecode->gfx(0)->elements() - 1; - int data = m_williams2_tileram[tile_index]; + int data = m_tileram[tile_index]; int y = (tile_index >> 1) & 7; - int color = 0; - switch (m_williams2_tilemap_config) - { - case WILLIAMS_TILEMAP_MYSTICM: - { - /* IC79 is a 74LS85 comparator that controls the low bit */ - int a = 1 | ((color & 1) << 2) | ((color & 1) << 3); - int b = ((y & 6) >> 1); - int casc = (y & 1); - color = (a > b) || ((a == b) && !casc); - break; - } + /* On tshoot and inferno, IC79 is a 74LS157 selector jumpered to be enabled */ + int color = y; - case WILLIAMS_TILEMAP_TSHOOT: - /* IC79 is a 74LS157 selector jumpered to be enabled */ - color = y; - break; + SET_TILE_INFO_MEMBER(0, data & mask, color, (data & ~mask) ? TILE_FLIPX : 0); +} - case WILLIAMS_TILEMAP_JOUST2: - /* IC79 is a 74LS157 selector jumpered to be disabled */ - color = 0; - break; - } +TILE_GET_INFO_MEMBER(mysticm_state::get_tile_info) +{ + int mask = m_gfxdecode->gfx(0)->elements() - 1; + int data = m_tileram[tile_index]; + int y = (tile_index >> 1) & 7; + int color = 0; // TODO: This seems highly suspect. Could it be why the palette doesn't work in mysticm? + + /* IC79 is a 74LS85 comparator that controls the low bit */ + int a = 1 | ((color & 1) << 2) | ((color & 1) << 3); + int b = ((y & 6) >> 1); + int casc = (y & 1); + color = (a > b) || ((a == b) && !casc); SET_TILE_INFO_MEMBER(0, data & mask, color, (data & ~mask) ? TILE_FLIPX : 0); } +TILE_GET_INFO_MEMBER(joust2_state::get_tile_info) +{ + int mask = m_gfxdecode->gfx(0)->elements() - 1; + int data = m_tileram[tile_index]; -void williams2_state::williams2_bg_select_w(u8 data) + /* IC79 is a 74LS157 selector jumpered to be disabled */ + int color = 0; + + SET_TILE_INFO_MEMBER(0, data & mask, color, (data & ~mask) ? TILE_FLIPX : 0); +} + +/* based on the board type, only certain bits are used */ +/* the rest are determined by other factors */ + +void williams2_state::bg_select_w(u8 data) { - /* based on the tilemap config, only certain bits are used */ - /* the rest are determined by other factors */ - switch (m_williams2_tilemap_config) - { - case WILLIAMS_TILEMAP_MYSTICM: - /* IC79 is a 74LS85 comparator that controls the low bit */ - data &= 0x3e; - break; - - case WILLIAMS_TILEMAP_TSHOOT: - /* IC79 is a 74LS157 selector jumpered to be enabled */ - data &= 0x38; - break; - - case WILLIAMS_TILEMAP_JOUST2: - /* IC79 is a 74LS157 selector jumpered to be disabled */ - data &= 0x3f; - break; - } - m_bg_tilemap->set_palette_offset(data * 16); + /* IC79 is a 74LS157 selector jumpered to be enabled */ + m_bg_tilemap->set_palette_offset((data & 0x38) << 4); } +void mysticm_state::bg_select_w(u8 data) +{ + /* IC79 is a 74LS85 comparator that controls the low bit */ + m_bg_tilemap->set_palette_offset((data & 0x3e) << 4); +} -void williams2_state::williams2_tileram_w(offs_t offset, u8 data) +void joust2_state::bg_select_w(u8 data) { - m_williams2_tileram[offset] = data; + /* IC79 is a 74LS157 selector jumpered to be disabled */ + m_bg_tilemap->set_palette_offset((data & 0x3f) << 4); +} + +void williams2_state::tileram_w(offs_t offset, u8 data) +{ + m_tileram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } -void williams2_state::williams2_xscroll_low_w(u8 data) +void williams2_state::xscroll_low_w(u8 data) { m_tilemap_xscroll = (m_tilemap_xscroll & ~0x00f) | ((data & 0x80) >> 4) | (data & 0x07); m_bg_tilemap->set_scrollx(0, (m_tilemap_xscroll & 7) + ((m_tilemap_xscroll >> 3) * 6)); } -void williams2_state::williams2_xscroll_high_w(u8 data) +void williams2_state::xscroll_high_w(u8 data) { m_tilemap_xscroll = (m_tilemap_xscroll & 0x00f) | (data << 4); m_bg_tilemap->set_scrollx(0, (m_tilemap_xscroll & 7) + ((m_tilemap_xscroll >> 3) * 6)); @@ -481,16 +480,16 @@ void williams2_state::williams2_xscroll_high_w(u8 data) * *************************************/ -void blaster_state::blaster_remap_select_w(u8 data) +void blaster_state::remap_select_w(u8 data) { m_blitter_remap_index = data; m_blitter_remap = m_blitter_remap_lookup.get() + data * 256; } -void blaster_state::blaster_video_control_w(u8 data) +void blaster_state::video_control_w(u8 data) { - m_blaster_video_control = data; + m_video_control = data; } @@ -504,7 +503,6 @@ void blaster_state::blaster_video_control_w(u8 data) void williams_state::blitter_init(int blitter_config, const uint8_t *remap_prom) { static const uint8_t dummy_table[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }; - int i,j; /* by default, there is no clipping window - this will be touched only by games that have one */ m_blitter_window_enable = 0; @@ -516,20 +514,17 @@ void williams_state::blitter_init(int blitter_config, const uint8_t *remap_prom) m_blitter_remap_lookup = std::make_unique<uint8_t[]>(256 * 256); m_blitter_remap_index = 0; m_blitter_remap = m_blitter_remap_lookup.get(); - for (i = 0; i < 256; i++) + for (int i = 0; i < 256; i++) { const uint8_t *table = remap_prom ? (remap_prom + (i & 0x7f) * 16) : dummy_table; - for (j = 0; j < 256; j++) + for (int j = 0; j < 256; j++) m_blitter_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; } } -WRITE8_MEMBER(williams_state::williams_blitter_w) +WRITE8_MEMBER(williams_state::blitter_w) { - int sstart, dstart, w, h, accesses; - int estimated_clocks_at_4MHz; - /* store the data */ m_blitterram[offset] = data; @@ -538,28 +533,29 @@ WRITE8_MEMBER(williams_state::williams_blitter_w) return; /* compute the starting locations */ - sstart = (m_blitterram[2] << 8) + m_blitterram[3]; - dstart = (m_blitterram[4] << 8) + m_blitterram[5]; + int sstart = (m_blitterram[2] << 8) + m_blitterram[3]; + int dstart = (m_blitterram[4] << 8) + m_blitterram[5]; /* compute the width and height */ - w = m_blitterram[6] ^ m_blitter_xor; - h = m_blitterram[7] ^ m_blitter_xor; + int w = m_blitterram[6] ^ m_blitter_xor; + int h = m_blitterram[7] ^ m_blitter_xor; /* adjust the width and height */ if (w == 0) w = 1; if (h == 0) h = 1; /* do the actual blit */ - accesses = blitter_core(space, sstart, dstart, w, h, data); + int accesses = blitter_core(space, sstart, dstart, w, h, data); /* based on the number of memory accesses needed to do the blit, compute how long the blit will take */ + int estimated_clocks_at_4MHz = 4; if(data & WMS_BLITTER_CONTROLBYTE_SLOW) { - estimated_clocks_at_4MHz = 4 + 4 * (accesses + 2); + estimated_clocks_at_4MHz += 4 * (accesses + 2); } else { - estimated_clocks_at_4MHz = 4 + 2 * (accesses + 3); + estimated_clocks_at_4MHz += 2 * (accesses + 3); } m_maincpu->adjust_icount(-((estimated_clocks_at_4MHz + 3) / 4)); @@ -575,7 +571,7 @@ WRITE8_MEMBER(williams_state::williams_blitter_w) } -void williams2_state::williams2_blit_window_enable_w(u8 data) +void williams2_state::blit_window_enable_w(u8 data) { m_blitter_window_enable = data & 0x01; } @@ -636,27 +632,24 @@ inline void williams_state::blit_pixel(address_space &space, int dstaddr, int sr int williams_state::blitter_core(address_space &space, int sstart, int dstart, int w, int h, int controlbyte) { - int source, sxadv, syadv; - int dest, dxadv, dyadv; - int x, y; int accesses = 0; /* compute how much to advance in the x and y loops */ - sxadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) ? 0x100 : 1; - syadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) ? 1 : w; - dxadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) ? 0x100 : 1; - dyadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) ? 1 : w; + int sxadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) ? 0x100 : 1; + int syadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) ? 1 : w; + int dxadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) ? 0x100 : 1; + int dyadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) ? 1 : w; - int pixdata=0; + int pixdata = 0; /* loop over the height */ - for (y = 0; y < h; y++) + for (int y = 0; y < h; y++) { - source = sstart & 0xffff; - dest = dstart & 0xffff; + int source = sstart & 0xffff; + int dest = dstart & 0xffff; /* loop over the width */ - for (x = 0; x < w; x++) + for (int x = 0; x < w; x++) { if (!(controlbyte & WMS_BLITTER_CONTROLBYTE_SHIFT)) //no shift { diff --git a/src/mame/video/xavix.cpp b/src/mame/video/xavix.cpp index 58a12e516a3..2c576515c83 100644 --- a/src/mame/video/xavix.cpp +++ b/src/mame/video/xavix.cpp @@ -202,11 +202,13 @@ void xavix_state::update_pen(int pen, uint8_t shval, uint8_t lval) int b_real = b1 * 255.0f; m_palette->set_pen_color(pen, r_real, g_real, b_real); + + m_screen->update_partial(m_screen->vpos()); } -void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which) +void xavix_state::draw_tilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int which) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -287,7 +289,7 @@ void xavix_state::decode_inline_header(int &flipx, int &flipy, int &test, int &p //if (debug_packets) LOG("\n"); } -void xavix_state::draw_tilemap_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int line) +void xavix_state::draw_tilemap_line(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int which, int line) { uint8_t* tileregs; if (which == 0) @@ -488,7 +490,7 @@ void xavix_state::draw_tilemap_line(screen_device &screen, bitmap_ind16 &bitmap, } } -void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void xavix_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -496,7 +498,7 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons } } -void xavix_state::draw_sprites_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int line) +void xavix_state::draw_sprites_line(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int line) { int alt_addressing = 0; @@ -703,9 +705,9 @@ void xavix_state::draw_sprites_line(screen_device &screen, bitmap_ind16 &bitmap, } } -void xavix_state::draw_tile_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int zval, int line) +void xavix_state::draw_tile_line(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int zval, int line) { - //const pen_t *paldata = m_palette->pens(); + const pen_t *paldata = m_palette->pens(); if (ypos > cliprect.max_y || ypos < cliprect.min_y) return; @@ -760,11 +762,8 @@ void xavix_state::draw_tile_line(screen_device &screen, bitmap_ind16 &bitmap, co if ((m_palram_sh[pen] & 0x1f) < 24) // hue values 24-31 are transparent { - uint16_t* yposptr = &bitmap.pix16(ypos); - yposptr[col] = pen; - - //uint32_t* yposptr = &bitmap.pix32(ypos); - //yposptr[col] = paldata[pen]; + uint32_t* yposptr = &bitmap.pix32(ypos); + yposptr[col] = paldata[pen]; zyposptr[col] = zval; } @@ -774,8 +773,9 @@ void xavix_state::draw_tile_line(screen_device &screen, bitmap_ind16 &bitmap, co } } -uint32_t xavix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t xavix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + const pen_t *paldata = m_palette->pens(); // not sure what you end up with if you fall through all layers as transparent, so far no issues noticed bitmap.fill(m_palette->black_pen(), cliprect); m_zbuffer.fill(0, cliprect); @@ -810,7 +810,7 @@ uint32_t xavix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, clip.max_x = cliprect.max_x; } } - bitmap.fill(0, clip); + bitmap.fill(paldata[0], clip); draw_tilemap(screen, bitmap, clip, 1); draw_tilemap(screen, bitmap, clip, 0); @@ -862,7 +862,7 @@ uint32_t xavix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { for (int x = 0; x < width; x++) { - uint16_t* yposptr = &bitmap.pix16(y); + uint32_t* yposptr = &bitmap.pix32(y); uint16_t* zyposptr = &m_zbuffer.pix16(y); uint8_t dat = 0; @@ -877,7 +877,7 @@ uint32_t xavix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { if (zval >= zyposptr[x]) { - yposptr[x] = dat + 0x100; + yposptr[x] = paldata[dat + 0x100]; zyposptr[x] = zval; } } diff --git a/src/osd/eigccx86.h b/src/osd/eigccx86.h index 3c8f63aa47e..c5ec0848e01 100644 --- a/src/osd/eigccx86.h +++ b/src/osd/eigccx86.h @@ -15,7 +15,7 @@ // Include MMX/SSE intrinsics headers #ifdef __SSE2__ -#include <stdlib.h> +#include <cstdlib> #include <mmintrin.h> // MMX #include <xmmintrin.h> // SSE #include <emmintrin.h> // SSE2 diff --git a/src/osd/mac/video.cpp b/src/osd/mac/video.cpp index 3f585458f8d..dbbf0324289 100644 --- a/src/osd/mac/video.cpp +++ b/src/osd/mac/video.cpp @@ -232,7 +232,7 @@ void mac_osd_interface::extract_video_config() video_config.syncrefresh = 0; } - if (video_config.prescale < 1 || video_config.prescale > 3) + if (video_config.prescale < 1 || video_config.prescale > 8) { osd_printf_warning("Invalid prescale option, reverting to '1'\n"); video_config.prescale = 1; diff --git a/src/osd/mac/window.cpp b/src/osd/mac/window.cpp index d22268f86f4..8a1f4d3fd3f 100644 --- a/src/osd/mac/window.cpp +++ b/src/osd/mac/window.cpp @@ -9,7 +9,7 @@ //============================================================ // standard C headers -#include <math.h> +#include <cmath> #ifndef _MSC_VER #include <unistd.h> #endif diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp index e30f8712d2f..c993eaa5c66 100644 --- a/src/osd/modules/debugger/debuggdbstub.cpp +++ b/src/osd/modules/debugger/debuggdbstub.cpp @@ -327,7 +327,7 @@ public: { } - virtual ~debug_gdbstub() { } + virtual ~debug_gdbstub() = default; virtual int init(const osd_options &options) override; virtual void exit() override; @@ -346,9 +346,9 @@ public: bool is_thread_id_ok(const char *buf); void handle_character(char ch); - void send_nack(void); - void send_ack(void); - void handle_packet(void); + void send_nack(); + void send_ack(); + void handle_packet(); enum cmd_reply { @@ -387,12 +387,12 @@ public: readbuf_state m_readbuf_state; - void generate_target_xml(void); + void generate_target_xml(); - int readchar(void); + int readchar(); void send_reply(const char *str); - void send_stop_packet(void); + void send_stop_packet(); private: running_machine *m_machine; @@ -449,7 +449,7 @@ int debug_gdbstub::init(const osd_options &options) } //------------------------------------------------------------------------- -void debug_gdbstub::exit(void) +void debug_gdbstub::exit() { } @@ -460,7 +460,7 @@ void debug_gdbstub::init_debugger(running_machine &machine) } //------------------------------------------------------------------------- -int debug_gdbstub::readchar(void) +int debug_gdbstub::readchar() { // NOTE: we don't use m_socket.getc() because it does not work with // sockets (it assumes seeking is possible). @@ -497,7 +497,7 @@ static std::string escape_packet(const std::string src) } //------------------------------------------------------------------------- -void debug_gdbstub::generate_target_xml(void) +void debug_gdbstub::generate_target_xml() { // Note: we do not attempt to replicate the regnum values from old // GDB clients that did not support target.xml. @@ -587,7 +587,7 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop) #endif std::string socket_name = string_format("socket.localhost:%d", m_debugger_port); - osd_file::error filerr = m_socket.open(socket_name.c_str()); + osd_file::error filerr = m_socket.open(socket_name); if ( filerr != osd_file::error::NONE ) fatalerror("gdbstub: failed to start listening on port %d\n", m_debugger_port); osd_printf_info("gdbstub: listening on port %d\n", m_debugger_port); @@ -622,7 +622,7 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop) } //------------------------------------------------------------------------- -void debug_gdbstub::debugger_update(void) +void debug_gdbstub::debugger_update() { while ( true ) { @@ -634,13 +634,13 @@ void debug_gdbstub::debugger_update(void) } //------------------------------------------------------------------------- -void debug_gdbstub::send_nack(void) +void debug_gdbstub::send_nack() { m_socket.puts("-"); } //------------------------------------------------------------------------- -void debug_gdbstub::send_ack(void) +void debug_gdbstub::send_ack() { m_socket.puts("+"); } @@ -1090,7 +1090,7 @@ debug_gdbstub::cmd_reply debug_gdbstub::handle_Z(const char *buf) //------------------------------------------------------------------------- -void debug_gdbstub::send_stop_packet(void) +void debug_gdbstub::send_stop_packet() { int signal = 5; // GDB_SIGNAL_TRAP std::string reply = string_format("T%02x", signal); @@ -1119,7 +1119,7 @@ void debug_gdbstub::send_stop_packet(void) } //------------------------------------------------------------------------- -void debug_gdbstub::handle_packet(void) +void debug_gdbstub::handle_packet() { // For any command not supported by the stub, an empty response // (‘$#00’) should be returned. That way it is possible to extend diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 487ad42ecc5..d34f256de8e 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -116,7 +116,7 @@ public: { } - virtual ~debug_imgui() { } + virtual ~debug_imgui() = default; virtual int init(const osd_options &options) override { return 0; } virtual void exit() override {}; @@ -261,7 +261,7 @@ static inline void map_attr_to_fg_bg(unsigned char attr, rgb_t *fg, rgb_t *bg) bool debug_imgui::get_view_source(void* data, int idx, const char** out_text) { - debug_view* vw = static_cast<debug_view*>(data); + auto* vw = static_cast<debug_view*>(data); *out_text = vw->source(idx)->name(); return true; } @@ -295,7 +295,7 @@ void debug_imgui::handle_mouse_views() view_main_disasm->view->set_cursor_position(newpos); view_main_disasm->view->set_cursor_visible(true); } - for(std::vector<debug_area*>::iterator it = view_list.begin();it != view_list.end();++it) + for(auto it = view_list.begin();it != view_list.end();++it) { rect.min_x = (*it)->ofs_x; rect.min_y = (*it)->ofs_y; @@ -323,7 +323,7 @@ void debug_imgui::handle_keys() debug_area* focus_view = nullptr; // find view that has focus (should only be one at a time) - for(std::vector<debug_area*>::iterator view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) + for(auto view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) if((*view_ptr)->has_focus) focus_view = *view_ptr; @@ -425,7 +425,7 @@ void debug_imgui::handle_keys_views() { debug_area* focus_view = nullptr; // find view that has focus (should only be one at a time) - for(std::vector<debug_area*>::iterator view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) + for(auto view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) if((*view_ptr)->has_focus) focus_view = *view_ptr; @@ -522,7 +522,7 @@ void debug_imgui::handle_console(running_machine* machine) // don't bother adding to history if the current command matches the previous one if(view_main_console->console_prev != view_main_console->console_input) { - view_main_console->console_history.push_back(std::string(view_main_console->console_input)); + view_main_console->console_history.emplace_back(std::string(view_main_console->console_input)); view_main_console->console_prev = view_main_console->console_input; } history_pos = view_main_console->console_history.size(); @@ -764,7 +764,7 @@ void debug_imgui::draw_disasm(debug_area* view_ptr, bool* opened) { if(ImGui::BeginMenu("Options")) { - debug_view_disasm* disasm = downcast<debug_view_disasm*>(view_ptr->view); + auto* disasm = downcast<debug_view_disasm*>(view_ptr->view); int rightcol = disasm->right_column(); if(ImGui::MenuItem("Raw opcodes", nullptr,(rightcol == DASM_RIGHTCOL_RAW) ? true : false)) @@ -845,7 +845,7 @@ void debug_imgui::draw_memory(debug_area* view_ptr, bool* opened) { if(ImGui::BeginMenu("Options")) { - debug_view_memory* mem = downcast<debug_view_memory*>(view_ptr->view); + auto* mem = downcast<debug_view_memory*>(view_ptr->view); bool physical = mem->physical(); bool rev = mem->reverse(); int format = mem->get_data_format(); @@ -949,7 +949,7 @@ void debug_imgui::mount_image() case file_entry_type::DIRECTORY: { util::zippath_directory::ptr dir; - err = util::zippath_directory::open(m_selected_file->fullpath.c_str(), dir); + err = util::zippath_directory::open(m_selected_file->fullpath, dir); } if(err == osd_file::error::NONE) { @@ -958,7 +958,7 @@ void debug_imgui::mount_image() } break; case file_entry_type::FILE: - m_dialog_image->load(m_selected_file->fullpath.c_str()); + m_dialog_image->load(m_selected_file->fullpath); ImGui::CloseCurrentPopup(); break; } @@ -971,7 +971,7 @@ void debug_imgui::create_image() if(m_dialog_image->image_type() == IO_FLOPPY) { - floppy_image_device *fd = static_cast<floppy_image_device *>(m_dialog_image); + auto *fd = static_cast<floppy_image_device *>(m_dialog_image); res = fd->create(m_path,nullptr,nullptr); if(res == image_init_result::PASS) fd->setup_write(m_typelist.at(m_format_sel).format); @@ -1036,7 +1036,7 @@ void debug_imgui::refresh_filelist() void debug_imgui::refresh_typelist() { - floppy_image_device *fd = static_cast<floppy_image_device *>(m_dialog_image); + auto *fd = static_cast<floppy_image_device *>(m_dialog_image); m_typelist.clear(); if(m_dialog_image->formatlist().empty()) @@ -1106,7 +1106,7 @@ void debug_imgui::draw_mount_dialog(const char* label) { // render dialog //ImGui::SetNextWindowContentWidth(200.0f); - if(ImGui::BeginPopupModal(label,NULL,ImGuiWindowFlags_AlwaysAutoResize)) + if(ImGui::BeginPopupModal(label,nullptr,ImGuiWindowFlags_AlwaysAutoResize)) { if(m_filelist_refresh) refresh_filelist(); @@ -1115,7 +1115,7 @@ void debug_imgui::draw_mount_dialog(const char* label) ImGui::Separator(); { ImGui::ListBoxHeader("##filelist",m_filelist.size(),15); - for(std::vector<file_entry>::iterator f = m_filelist.begin();f != m_filelist.end();++f) + for(auto f = m_filelist.begin();f != m_filelist.end();++f) { std::string txt_name; bool sel = false; @@ -1157,7 +1157,7 @@ void debug_imgui::draw_create_dialog(const char* label) { // render dialog //ImGui::SetNextWindowContentWidth(200.0f); - if(ImGui::BeginPopupModal(label,NULL,ImGuiWindowFlags_AlwaysAutoResize)) + if(ImGui::BeginPopupModal(label,nullptr,ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::LabelText("##static1","Filename:"); ImGui::SameLine(); @@ -1177,7 +1177,7 @@ void debug_imgui::draw_create_dialog(const char* label) { std::string combo_str; combo_str.clear(); - for(std::vector<image_type_entry>::iterator f = m_typelist.begin();f != m_typelist.end();++f) + for(auto f = m_typelist.begin();f != m_typelist.end();++f) { // TODO: perhaps do this at the time the format list is generated, rather than every frame combo_str.append((*f).longname); @@ -1282,12 +1282,12 @@ void debug_imgui::draw_console() { if(ImGui::MenuItem("Show all")) { - for(std::vector<debug_area*>::iterator view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) + for(auto view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) ImGui::SetWindowCollapsed((*view_ptr)->title.c_str(),false); } ImGui::Separator(); // list all extra windows, so we can un-collapse the windows if necessary - for(std::vector<debug_area*>::iterator view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) + for(auto view_ptr = view_list.begin();view_ptr != view_list.end();++view_ptr) { bool collapsed = false; if((*view_ptr)->is_collapsed) diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp index 975e7ba6bc6..2b1fb212ef0 100644 --- a/src/osd/modules/debugger/debugwin.cpp +++ b/src/osd/modules/debugger/debugwin.cpp @@ -44,7 +44,7 @@ public: { } - virtual ~debugger_windows() { } + virtual ~debugger_windows() = default; virtual int init(const osd_options &options) override { return 0; } virtual void exit() override; diff --git a/src/osd/modules/debugger/none.cpp b/src/osd/modules/debugger/none.cpp index 3ce8d6572bc..1ef02c98fa7 100644 --- a/src/osd/modules/debugger/none.cpp +++ b/src/osd/modules/debugger/none.cpp @@ -22,7 +22,7 @@ public: { } - virtual ~debug_none() { } + virtual ~debug_none() = default; virtual int init(const osd_options &options) override { return 0; } virtual void exit() override { } diff --git a/src/osd/modules/debugger/osx/debugview.mm b/src/osd/modules/debugger/osx/debugview.mm index 731ea8227b2..a414e4ad8a4 100644 --- a/src/osd/modules/debugger/osx/debugview.mm +++ b/src/osd/modules/debugger/osx/debugview.mm @@ -16,7 +16,7 @@ #include "util/xmlfile.h" -#include <string.h> +#include <cstring> static NSColor *DefaultForeground; diff --git a/src/osd/modules/debugger/win/consolewininfo.cpp b/src/osd/modules/debugger/win/consolewininfo.cpp index 88367c09fc9..6ca18743945 100644 --- a/src/osd/modules/debugger/win/consolewininfo.cpp +++ b/src/osd/modules/debugger/win/consolewininfo.cpp @@ -95,6 +95,7 @@ consolewin_info::~consolewin_info() { } + void consolewin_info::set_cpu(device_t &device) { // exit if this cpu is already selected @@ -281,7 +282,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) std::string as = slmap.find(opt_name)->second; /* Make sure a folder was specified, and that it exists */ - if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos)) + if ((!osd::directory::open(as)) || (as.find(':') == std::string::npos)) { /* Default to emu directory */ osd_get_full_path(as, "."); @@ -321,7 +322,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) buf.erase(0, t1+1); // load software - img->load_software( buf.c_str()); + img->load_software(buf); } } } @@ -351,7 +352,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) as = buf; // the only path /* Make sure a folder was specified, and that it exists */ - if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos)) + if ((!osd::directory::open(as)) || (as.find(':') == std::string::npos)) { /* Default to emu directory */ osd_get_full_path(as, "."); @@ -377,7 +378,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) if (GetOpenFileName(&ofn)) { auto utf8_buf = osd::text::from_tstring(selectedFilename); - img->load(utf8_buf.c_str()); + img->load(utf8_buf); } } } @@ -406,7 +407,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) as = buf; // the only path /* Make sure a folder was specified, and that it exists */ - if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos)) + if ((!osd::directory::open(as)) || (as.find(':') == std::string::npos)) { /* Default to emu directory */ osd_get_full_path(as, "."); @@ -432,7 +433,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) if (GetSaveFileName(&ofn)) { auto utf8_buf = osd::text::from_tstring(selectedFilename); - img->create(utf8_buf.c_str(), img->device_get_indexed_creatable_format(0), nullptr); + img->create(utf8_buf, img->device_get_indexed_creatable_format(0), nullptr); } } } @@ -443,7 +444,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) } if (img->device().type() == CASSETTE) { - cassette_image_device *const cassette = downcast<cassette_image_device *>(&img->device()); + auto *const cassette = downcast<cassette_image_device *>(&img->device()); bool s; switch ((LOWORD(wparam) - ID_DEVICE_OPTIONS) % DEVOPTION_MAX) { @@ -598,7 +599,7 @@ bool consolewin_info::get_softlist_info(device_image_interface *img) while (sl_root && !passes_tests) { std::string test_path = sl_root + sl_dir; - if (osd::directory::open(test_path.c_str())) + if (osd::directory::open(test_path)) { passes_tests = true; slmap[opt_name] = test_path; diff --git a/src/osd/modules/debugger/win/debugviewinfo.cpp b/src/osd/modules/debugger/win/debugviewinfo.cpp index 782489924f2..ff46d13c7fe 100644 --- a/src/osd/modules/debugger/win/debugviewinfo.cpp +++ b/src/osd/modules/debugger/win/debugviewinfo.cpp @@ -758,7 +758,7 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam) void debugview_info::static_update(debug_view &view, void *osdprivate) { - debugview_info *const info = (debugview_info *)osdprivate; + auto *const info = (debugview_info *)osdprivate; assert(info->m_view == &view); info->update(); } @@ -774,7 +774,7 @@ LRESULT CALLBACK debugview_info::static_view_proc(HWND wnd, UINT message, WPARAM return 0; } - debugview_info *const info = (debugview_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); + auto *const info = (debugview_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); if (info == nullptr) return DefWindowProc(wnd, message, wparam, lparam); diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index ac60b980439..1645582038c 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -437,7 +437,7 @@ LRESULT debugwin_info::window_proc(UINT message, WPARAM wparam, LPARAM lparam) // get min/max info: set the minimum window size case WM_GETMINMAXINFO: { - MINMAXINFO *minmax = (MINMAXINFO *)lparam; + auto *minmax = (MINMAXINFO *)lparam; minmax->ptMinTrackSize.x = m_minwidth; minmax->ptMinTrackSize.y = m_minheight; minmax->ptMaxSize.x = minmax->ptMaxTrackSize.x = m_maxwidth; @@ -575,14 +575,14 @@ LRESULT CALLBACK debugwin_info::static_window_proc(HWND wnd, UINT message, WPARA { // set the info pointer CREATESTRUCT const *const createinfo = (CREATESTRUCT *)lparam; - debugwin_info *const info = (debugwin_info *)createinfo->lpCreateParams; + auto *const info = (debugwin_info *)createinfo->lpCreateParams; SetWindowLongPtr(wnd, GWLP_USERDATA, (LONG_PTR)createinfo->lpCreateParams); if (info->m_handler) SetWindowLongPtr(wnd, GWLP_WNDPROC, (LONG_PTR)info->m_handler); return 0; } - debugwin_info *const info = (debugwin_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); + auto *const info = (debugwin_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); if (info == nullptr) return DefWindowProc(wnd, message, wparam, lparam); diff --git a/src/osd/modules/debugger/win/disasmbasewininfo.cpp b/src/osd/modules/debugger/win/disasmbasewininfo.cpp index c466e059f23..0d22b7b8d39 100644 --- a/src/osd/modules/debugger/win/disasmbasewininfo.cpp +++ b/src/osd/modules/debugger/win/disasmbasewininfo.cpp @@ -105,7 +105,7 @@ void disasmbasewin_info::update_menu() { editwin_info::update_menu(); - disasmview_info *const dasmview = downcast<disasmview_info *>(m_views[0].get()); + auto *const dasmview = downcast<disasmview_info *>(m_views[0].get()); HMENU const menu = GetMenu(window()); bool const disasm_cursor_visible = dasmview->cursor_visible(); @@ -151,7 +151,7 @@ void disasmbasewin_info::update_menu() bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { - disasmview_info *const dasmview = downcast<disasmview_info *>(m_views[0].get()); + auto *const dasmview = downcast<disasmview_info *>(m_views[0].get()); switch (HIWORD(wparam)) { @@ -192,7 +192,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) command = string_format("bpset 0x%X", address); else command = string_format("bpclear 0x%X", bp->index()); - machine().debugger().console().execute_command(command.c_str(), true); + machine().debugger().console().execute_command(command, true); } } return true; @@ -220,7 +220,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { std::string command; command = string_format(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", (uint32_t)bp->index()); - machine().debugger().console().execute_command(command.c_str(), true); + machine().debugger().console().execute_command(command, true); } } } @@ -234,7 +234,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { std::string command; command = string_format("go 0x%X", address); - machine().debugger().console().execute_command(command.c_str(), true); + machine().debugger().console().execute_command(command, true); } else { diff --git a/src/osd/modules/debugger/win/disasmviewinfo.h b/src/osd/modules/debugger/win/disasmviewinfo.h index a032475af7f..0685d762346 100644 --- a/src/osd/modules/debugger/win/disasmviewinfo.h +++ b/src/osd/modules/debugger/win/disasmviewinfo.h @@ -30,4 +30,4 @@ public: void set_right_column(disasm_right_column contents); }; -#endif +#endif // MAME_DEBUGGER_WIN_DISASMVIEWINFO_H diff --git a/src/osd/modules/debugger/win/editwininfo.cpp b/src/osd/modules/debugger/win/editwininfo.cpp index af3dd1bf66e..61717439c25 100644 --- a/src/osd/modules/debugger/win/editwininfo.cpp +++ b/src/osd/modules/debugger/win/editwininfo.cpp @@ -199,7 +199,7 @@ LRESULT editwin_info::edit_proc(UINT message, WPARAM wparam, LPARAM lparam) // process { auto utf8_buffer = osd::text::from_tstring(buffer); - process_string(utf8_buffer.c_str()); + process_string(utf8_buffer); } } break; @@ -237,7 +237,7 @@ LRESULT editwin_info::edit_proc(UINT message, WPARAM wparam, LPARAM lparam) LRESULT CALLBACK editwin_info::static_edit_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) { - editwin_info *const info = (editwin_info *)uintptr_t(GetWindowLongPtr(wnd, GWLP_USERDATA)); + auto *const info = (editwin_info *)uintptr_t(GetWindowLongPtr(wnd, GWLP_USERDATA)); assert(info->m_editwnd == wnd); return info->edit_proc(message, wparam, lparam); } diff --git a/src/osd/modules/debugger/win/logviewinfo.h b/src/osd/modules/debugger/win/logviewinfo.h index e2fa9d31643..d7ca0df8c9e 100644 --- a/src/osd/modules/debugger/win/logviewinfo.h +++ b/src/osd/modules/debugger/win/logviewinfo.h @@ -24,4 +24,4 @@ public: void clear(); }; -#endif +#endif // MAME_DEBUGGER_WIN_LOGVIEWINFO_H diff --git a/src/osd/modules/debugger/win/logwininfo.cpp b/src/osd/modules/debugger/win/logwininfo.cpp index 6d2cd59b554..6ed0f63a1c3 100644 --- a/src/osd/modules/debugger/win/logwininfo.cpp +++ b/src/osd/modules/debugger/win/logwininfo.cpp @@ -53,6 +53,7 @@ logwin_info::~logwin_info() { } + bool logwin_info::handle_command(WPARAM wparam, LPARAM lparam) { if ((HIWORD(wparam) == 0) && (LOWORD(wparam) == ID_CLEAR_LOG)) diff --git a/src/osd/modules/debugger/win/memoryviewinfo.h b/src/osd/modules/debugger/win/memoryviewinfo.h index a897698f0bd..d2c5d719abe 100644 --- a/src/osd/modules/debugger/win/memoryviewinfo.h +++ b/src/osd/modules/debugger/win/memoryviewinfo.h @@ -33,4 +33,4 @@ public: void set_physical(bool physical); }; -#endif +#endif // MAME_DEBUGGER_WIN_MEMORYVIEWINFO_H diff --git a/src/osd/modules/debugger/win/memorywininfo.cpp b/src/osd/modules/debugger/win/memorywininfo.cpp index 6f461295ec2..93151cc018d 100644 --- a/src/osd/modules/debugger/win/memorywininfo.cpp +++ b/src/osd/modules/debugger/win/memorywininfo.cpp @@ -178,7 +178,7 @@ void memorywin_info::update_menu() { editwin_info::update_menu(); - memoryview_info *const memview = downcast<memoryview_info *>(m_views[0].get()); + auto *const memview = downcast<memoryview_info *>(m_views[0].get()); HMENU const menu = GetMenu(window()); CheckMenuItem(menu, ID_1_BYTE_CHUNKS, MF_BYCOMMAND | (memview->data_format() == 1 ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(menu, ID_2_BYTE_CHUNKS, MF_BYCOMMAND | (memview->data_format() == 2 ? MF_CHECKED : MF_UNCHECKED)); @@ -196,7 +196,7 @@ void memorywin_info::update_menu() bool memorywin_info::handle_command(WPARAM wparam, LPARAM lparam) { - memoryview_info *const memview = downcast<memoryview_info *>(m_views[0].get()); + auto *const memview = downcast<memoryview_info *>(m_views[0].get()); switch (HIWORD(wparam)) { // combo box selection changed diff --git a/src/osd/modules/diagnostics/diagnostics_win32.cpp b/src/osd/modules/diagnostics/diagnostics_win32.cpp index 677cd93bff7..e76f3ca6d70 100644 --- a/src/osd/modules/diagnostics/diagnostics_win32.cpp +++ b/src/osd/modules/diagnostics/diagnostics_win32.cpp @@ -610,7 +610,7 @@ uintptr_t symbol_manager::get_text_section_base() ImageNtHeader_fn image_nt_header = m_dbghelp_dll->bind<ImageNtHeader_fn>("ImageNtHeader"); // start with the image base - PVOID base = reinterpret_cast<PVOID>(GetModuleHandleUni()); + auto base = reinterpret_cast<PVOID>(GetModuleHandleUni()); assert(base != nullptr); // make sure we have the functions we need @@ -663,7 +663,7 @@ sampling_profiler::~sampling_profiler() } -//------------------------------------------------- +////------------------------------------------------- // start - begin gathering profiling information //------------------------------------------------- @@ -712,8 +712,8 @@ void sampling_profiler::stop() int CLIB_DECL sampling_profiler::compare_address(const void *item1, const void *item2) { - const uintptr_t *entry1 = reinterpret_cast<const uintptr_t *>(item1); - const uintptr_t *entry2 = reinterpret_cast<const uintptr_t *>(item2); + const auto *entry1 = reinterpret_cast<const uintptr_t *>(item1); + const auto *entry2 = reinterpret_cast<const uintptr_t *>(item2); int mincount = std::min(entry1[0], entry2[0]); // sort in order of: bucket, caller, caller's caller, etc. @@ -733,8 +733,8 @@ int CLIB_DECL sampling_profiler::compare_address(const void *item1, const void * int CLIB_DECL sampling_profiler::compare_frequency(const void *item1, const void *item2) { - const uintptr_t *entry1 = reinterpret_cast<const uintptr_t *>(item1); - const uintptr_t *entry2 = reinterpret_cast<const uintptr_t *>(item2); + const auto *entry1 = reinterpret_cast<const uintptr_t *>(item1); + const auto *entry2 = reinterpret_cast<const uintptr_t *>(item2); // sort by frequency, then by address if (entry1[0] != entry2[0]) diff --git a/src/osd/modules/diagnostics/none.cpp b/src/osd/modules/diagnostics/none.cpp index 8a731fe9009..e4028124514 100644 --- a/src/osd/modules/diagnostics/none.cpp +++ b/src/osd/modules/diagnostics/none.cpp @@ -11,9 +11,7 @@ class diagnostics_none : public diagnostics_module { public: - diagnostics_none() - { - } + diagnostics_none() = default; int init_crash_diagnostics() override { diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index 8c78d28cbd5..4f56a8432d4 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -50,9 +50,9 @@ #include <vector> #include <fcntl.h> -#include <limits.h> +#include <climits> #include <sys/stat.h> -#include <stdlib.h> +#include <cstdlib> #include <unistd.h> diff --git a/src/osd/modules/file/posixptty.cpp b/src/osd/modules/file/posixptty.cpp index a590dc682e2..5b38acc750a 100644 --- a/src/osd/modules/file/posixptty.cpp +++ b/src/osd/modules/file/posixptty.cpp @@ -15,9 +15,9 @@ #include <cstring> #include <fcntl.h> -#include <limits.h> +#include <climits> #include <unistd.h> -#include <stdlib.h> +#include <cstdlib> #if defined(__FreeBSD_kernel__) || defined(__DragonFly__) #include <termios.h> diff --git a/src/osd/modules/file/stdfile.cpp b/src/osd/modules/file/stdfile.cpp index cb1f1b536b2..0bf38945f5a 100644 --- a/src/osd/modules/file/stdfile.cpp +++ b/src/osd/modules/file/stdfile.cpp @@ -14,7 +14,7 @@ #include <cstdlib> #include <string> -#include <stdio.h> // for fileno +#include <cstdio> // for fileno #include <unistd.h> // for ftruncate diff --git a/src/osd/modules/file/windir.cpp b/src/osd/modules/file/windir.cpp index f9575b27e74..73bcae13f04 100644 --- a/src/osd/modules/file/windir.cpp +++ b/src/osd/modules/file/windir.cpp @@ -20,8 +20,8 @@ #include "winutil.h" // standard C headers -#include <stdio.h> -#include <ctype.h> +#include <cstdio> +#include <cctype> #include <cassert> #include <cstring> diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp index 5df7c4bb8b1..b0869b7c70f 100644 --- a/src/osd/modules/file/winfile.cpp +++ b/src/osd/modules/file/winfile.cpp @@ -26,8 +26,8 @@ #include <winioctl.h> #include <tchar.h> #include <shlwapi.h> -#include <stdlib.h> -#include <ctype.h> +#include <cstdlib> +#include <cctype> namespace { diff --git a/src/osd/modules/file/winptty.cpp b/src/osd/modules/file/winptty.cpp index 61867a869df..d4207d1d73d 100644 --- a/src/osd/modules/file/winptty.cpp +++ b/src/osd/modules/file/winptty.cpp @@ -10,7 +10,7 @@ #include <cassert> #include <windows.h> -#include <stdlib.h> +#include <cstdlib> namespace { @@ -100,7 +100,7 @@ osd_file::error win_open_ptty(std::string const &path, std::uint32_t openflags, else { DWORD state = PIPE_NOWAIT; - SetNamedPipeHandleState(pipe, &state, NULL, NULL); + SetNamedPipeHandleState(pipe, &state, nullptr, nullptr); } try diff --git a/src/osd/modules/file/winrtdir.cpp b/src/osd/modules/file/winrtdir.cpp index be42b6fd874..2d61097a3b4 100644 --- a/src/osd/modules/file/winrtdir.cpp +++ b/src/osd/modules/file/winrtdir.cpp @@ -20,8 +20,8 @@ #include "../../windows/winutil.h" // standard C headers -#include <stdio.h> -#include <ctype.h> +#include <cstdio> +#include <cctype> #include <cassert> #include <cstring> diff --git a/src/osd/modules/file/winrtfile.cpp b/src/osd/modules/file/winrtfile.cpp index 83d8d7c4915..8e6ed4e5f43 100644 --- a/src/osd/modules/file/winrtfile.cpp +++ b/src/osd/modules/file/winrtfile.cpp @@ -26,8 +26,8 @@ #include <winioctl.h> #include <tchar.h> #include <shlwapi.h> -#include <stdlib.h> -#include <ctype.h> +#include <cstdlib> +#include <cctype> namespace { diff --git a/src/osd/modules/file/winrtptty.cpp b/src/osd/modules/file/winrtptty.cpp index ec1e6e73b38..b442409a79e 100644 --- a/src/osd/modules/file/winrtptty.cpp +++ b/src/osd/modules/file/winrtptty.cpp @@ -9,7 +9,7 @@ #include <cassert> #include <windows.h> -#include <stdlib.h> +#include <cstdlib> namespace { diff --git a/src/osd/modules/file/winrtsocket.cpp b/src/osd/modules/file/winrtsocket.cpp index 3f2241c25b5..3e4880605bf 100644 --- a/src/osd/modules/file/winrtsocket.cpp +++ b/src/osd/modules/file/winrtsocket.cpp @@ -19,8 +19,8 @@ #include <windows.h> #include <winioctl.h> #include <tchar.h> -#include <stdlib.h> -#include <ctype.h> +#include <cstdlib> +#include <cctype> namespace { diff --git a/src/osd/modules/file/winsocket.cpp b/src/osd/modules/file/winsocket.cpp index a383a876f9d..9fd0bb31165 100644 --- a/src/osd/modules/file/winsocket.cpp +++ b/src/osd/modules/file/winsocket.cpp @@ -22,8 +22,8 @@ #include <windows.h> #include <winioctl.h> #include <tchar.h> -#include <stdlib.h> -#include <ctype.h> +#include <cstdlib> +#include <cctype> namespace { diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp index 04ccf11a7ce..82f70c17672 100644 --- a/src/osd/modules/font/font_dwrite.cpp +++ b/src/osd/modules/font/font_dwrite.cpp @@ -366,7 +366,7 @@ public: // find the font HR_RET0(find_font( - familyName.c_str(), + familyName, bold ? DWRITE_FONT_WEIGHT_BOLD : DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, italic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL, diff --git a/src/osd/modules/font/font_none.cpp b/src/osd/modules/font/font_none.cpp index dc6116625a8..a36514899a2 100644 --- a/src/osd/modules/font/font_none.cpp +++ b/src/osd/modules/font/font_none.cpp @@ -11,7 +11,7 @@ class osd_font_none : public osd_font { public: - virtual ~osd_font_none() { } + virtual ~osd_font_none() = default; virtual bool open(std::string const &font_path, std::string const &name, int &height) override { return false; } virtual void close() override { } diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index 0b5eb348dc0..e694cd8c63c 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -403,7 +403,7 @@ public: // populate the buttons for (butnum = 0; butnum < devinfo->dinput.caps.dwButtons; butnum++) { - uintptr_t offset = reinterpret_cast<uintptr_t>(&static_cast<DIMOUSESTATE *>(nullptr)->rgbButtons[butnum]); + auto offset = reinterpret_cast<uintptr_t>(&static_cast<DIMOUSESTATE *>(nullptr)->rgbButtons[butnum]); // add to the mouse device std::string name = device_item_name(devinfo, offset, default_button_name(butnum), nullptr); @@ -535,7 +535,7 @@ int dinput_joystick_device::configure() // populate the buttons for (uint32_t butnum = 0; butnum < dinput.caps.dwButtons; butnum++) { - uintptr_t offset = reinterpret_cast<uintptr_t>(&static_cast<DIJOYSTATE2 *>(nullptr)->rgbButtons[butnum]); + auto offset = reinterpret_cast<uintptr_t>(&static_cast<DIJOYSTATE2 *>(nullptr)->rgbButtons[butnum]); std::string name = dinput_module::device_item_name(this, offset, default_button_name(butnum), nullptr); input_item_id itemid; @@ -602,7 +602,7 @@ public: static int32_t dinput_joystick_pov_get_state(void *device_internal, void *item_internal) { - dinput_joystick_device *devinfo = static_cast<dinput_joystick_device *>(device_internal); + auto *devinfo = static_cast<dinput_joystick_device *>(device_internal); int povnum = reinterpret_cast<uintptr_t>(item_internal) / 4; int povdir = reinterpret_cast<uintptr_t>(item_internal) % 4; int32_t result = 0; diff --git a/src/osd/modules/input/input_mac.cpp b/src/osd/modules/input/input_mac.cpp index 0784501573f..85afdaeb9cb 100644 --- a/src/osd/modules/input/input_mac.cpp +++ b/src/osd/modules/input/input_mac.cpp @@ -14,8 +14,8 @@ #if defined(OSD_MAC) // System headers -#include <ctype.h> -#include <stddef.h> +#include <cctype> +#include <cstddef> #include <mutex> #include <memory> #include <algorithm> diff --git a/src/osd/modules/input/input_rawinput.cpp b/src/osd/modules/input/input_rawinput.cpp index 9243ec4a0f4..7876b297867 100644 --- a/src/osd/modules/input/input_rawinput.cpp +++ b/src/osd/modules/input/input_rawinput.cpp @@ -619,7 +619,7 @@ protected: { std::lock_guard<std::mutex> scope_lock(m_module_lock); - RAWINPUT *input = reinterpret_cast<RAWINPUT*>(data); + auto *input = reinterpret_cast<RAWINPUT*>(data); // find the device in the list and update auto target_device = std::find_if(devicelist()->begin(), devicelist()->end(), [input](auto &device) @@ -661,7 +661,7 @@ protected: return; // allocate and link in a new device - rawinput_keyboard_device *devinfo = create_rawinput_device<rawinput_keyboard_device>(machine, device); + auto *devinfo = create_rawinput_device<rawinput_keyboard_device>(machine, device); if (devinfo == nullptr) return; @@ -706,7 +706,7 @@ protected: return; // allocate and link in a new device - rawinput_mouse_device *devinfo = create_rawinput_device<rawinput_mouse_device>(machine, device); + auto *devinfo = create_rawinput_device<rawinput_mouse_device>(machine, device); if (devinfo == nullptr) return; @@ -755,7 +755,7 @@ protected: return; // allocate and link in a new device - rawinput_lightgun_device *devinfo = create_rawinput_device<rawinput_lightgun_device>(machine, device); + auto *devinfo = create_rawinput_device<rawinput_lightgun_device>(machine, device); if (devinfo == nullptr) return; diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index 596895e9e39..51af4750eb1 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -18,9 +18,9 @@ // standard sdl header #include <SDL2/SDL.h> -#include <ctype.h> +#include <cctype> // ReSharper disable once CppUnusedIncludeDirective -#include <stddef.h> +#include <cstddef> #include <mutex> #include <memory> #include <queue> @@ -386,6 +386,19 @@ public: keyboard.state[sdlevent.key.keysym.scancode] = 0x80; if (sdlevent.key.keysym.sym < 0x20) machine().ui_input().push_char_event(osd_common_t::s_window_list.front()->target(), sdlevent.key.keysym.sym); + else if (keyboard.state[SDL_SCANCODE_LCTRL] == 0x80 || keyboard.state[SDL_SCANCODE_RCTRL] == 0x80) + { + // SDL filters out control characters for text input, so they are decoded here + if (sdlevent.key.keysym.sym >= 0x40 && sdlevent.key.keysym.sym < 0x7f) + machine().ui_input().push_char_event(osd_common_t::s_window_list.front()->target(), sdlevent.key.keysym.sym & 0x1f); + else if (keyboard.state[SDL_SCANCODE_LSHIFT] == 0x80 || keyboard.state[SDL_SCANCODE_RSHIFT] == 0x80) + { + if (sdlevent.key.keysym.sym == SDLK_6) // Ctrl-^ (RS) + machine().ui_input().push_char_event(osd_common_t::s_window_list.front()->target(), 0x1e); + else if (sdlevent.key.keysym.sym == SDLK_MINUS) // Ctrl-_ (US) + machine().ui_input().push_char_event(osd_common_t::s_window_list.front()->target(), 0x1f); + } + } break; case SDL_KEYUP: diff --git a/src/osd/modules/input/input_sdlcommon.cpp b/src/osd/modules/input/input_sdlcommon.cpp index 2e6611c74ac..a227fa9f46f 100644 --- a/src/osd/modules/input/input_sdlcommon.cpp +++ b/src/osd/modules/input/input_sdlcommon.cpp @@ -15,8 +15,8 @@ // standard sdl header #include <SDL2/SDL.h> -#include <ctype.h> -#include <stddef.h> +#include <cctype> +#include <cstddef> #include <mutex> #include <memory> #include <algorithm> diff --git a/src/osd/modules/input/input_win32.cpp b/src/osd/modules/input/input_win32.cpp index c07a1c681d8..a28fb08ebed 100644 --- a/src/osd/modules/input/input_win32.cpp +++ b/src/osd/modules/input/input_win32.cpp @@ -72,7 +72,7 @@ public: virtual void input_init(running_machine &machine) override { // Add a single win32 keyboard device that we'll monitor using Win32 - win32_keyboard_device *devinfo = devicelist()->create_device<win32_keyboard_device>(machine, "Win32 Keyboard 1", "Win32 Keyboard 1", *this); + auto *devinfo = devicelist()->create_device<win32_keyboard_device>(machine, "Win32 Keyboard 1", "Win32 Keyboard 1", *this); keyboard_trans_table &table = keyboard_trans_table::instance(); diff --git a/src/osd/modules/input/input_winhybrid.cpp b/src/osd/modules/input/input_winhybrid.cpp index 1436ae009d6..ed6d88fd26b 100644 --- a/src/osd/modules/input/input_winhybrid.cpp +++ b/src/osd/modules/input/input_winhybrid.cpp @@ -104,8 +104,8 @@ private: public: variant_wrapper() - : m_variant({0}) { + VariantInit(&m_variant); } ~variant_wrapper() diff --git a/src/osd/modules/input/input_x11.cpp b/src/osd/modules/input/input_x11.cpp index 6b66220e32a..e8888865ad5 100644 --- a/src/osd/modules/input/input_x11.cpp +++ b/src/osd/modules/input/input_x11.cpp @@ -20,8 +20,8 @@ // standard sdl header #include <SDL2/SDL.h> -#include <ctype.h> -#include <stddef.h> +#include <cctype> +#include <cstddef> #include <mutex> #include <memory> #include <queue> diff --git a/src/osd/modules/lib/osdlib_macosx.cpp b/src/osd/modules/lib/osdlib_macosx.cpp index 372293ec1a3..6f7f5f4c3e6 100644 --- a/src/osd/modules/lib/osdlib_macosx.cpp +++ b/src/osd/modules/lib/osdlib_macosx.cpp @@ -8,12 +8,12 @@ // //============================================================ -#include <stdlib.h> +#include <cstdlib> #include <unistd.h> #include <sys/mman.h> #include <sys/sysctl.h> #include <sys/types.h> -#include <signal.h> +#include <csignal> #include <dlfcn.h> #include <cstdio> diff --git a/src/osd/modules/lib/osdlib_unix.cpp b/src/osd/modules/lib/osdlib_unix.cpp index 2b0e7a3d780..c2a34be7c98 100644 --- a/src/osd/modules/lib/osdlib_unix.cpp +++ b/src/osd/modules/lib/osdlib_unix.cpp @@ -8,11 +8,11 @@ // //============================================================ -#include <stdlib.h> +#include <cstdlib> #include <unistd.h> #include <sys/mman.h> #include <sys/types.h> -#include <signal.h> +#include <csignal> #include <dlfcn.h> #include <cstdio> diff --git a/src/osd/modules/lib/osdlib_uwp.cpp b/src/osd/modules/lib/osdlib_uwp.cpp index 8d20c552cab..680594d9cc8 100644 --- a/src/osd/modules/lib/osdlib_uwp.cpp +++ b/src/osd/modules/lib/osdlib_uwp.cpp @@ -11,7 +11,7 @@ #include <windows.h> #include <mmsystem.h> -#include <stdlib.h> +#include <cstdlib> #include <cstdio> #include <memory> diff --git a/src/osd/modules/lib/osdlib_win32.cpp b/src/osd/modules/lib/osdlib_win32.cpp index 911f95c3bfe..b1051dad7a6 100644 --- a/src/osd/modules/lib/osdlib_win32.cpp +++ b/src/osd/modules/lib/osdlib_win32.cpp @@ -11,7 +11,7 @@ #include <windows.h> #include <mmsystem.h> -#include <stdlib.h> +#include <cstdlib> #ifndef _MSC_VER #include <unistd.h> #endif @@ -192,7 +192,7 @@ static std::string convert_ansi(LPCVOID data) // osd_get_clipboard_text //============================================================ -std::string osd_get_clipboard_text(void) +std::string osd_get_clipboard_text() { std::string result; @@ -210,7 +210,7 @@ std::string osd_get_clipboard_text(void) // osd_getpid //============================================================ -int osd_getpid(void) +int osd_getpid() { return GetCurrentProcessId(); } @@ -262,7 +262,7 @@ protected: if (module != nullptr) { - generic_fptr_t function = reinterpret_cast<generic_fptr_t>(GetProcAddress(module, symbol)); + auto function = reinterpret_cast<generic_fptr_t>(GetProcAddress(module, symbol)); if (function != nullptr) { diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index 8e284eba055..25d4b979e87 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -95,7 +95,7 @@ const options_entry osd_options::s_option_entries[] = { nullptr, nullptr, OPTION_HEADER, "OSD ACCELERATED VIDEO OPTIONS" }, { OSDOPTION_FILTER ";glfilter;flt", "1", OPTION_BOOLEAN, "use bilinear filtering when scaling emulated video" }, - { OSDOPTION_PRESCALE "(1-3)", "1", OPTION_INTEGER, "scale emulated video by this factor before applying filters/shaders" }, + { OSDOPTION_PRESCALE "(1-8)", "1", OPTION_INTEGER, "scale emulated video by this factor before applying filters/shaders" }, #if USE_OPENGL { nullptr, nullptr, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" }, @@ -445,7 +445,7 @@ void osd_common_t::init(running_machine &machine) m_machine = &machine; - osd_options &options = downcast<osd_options &>(machine.options()); + auto &options = downcast<osd_options &>(machine.options()); // extract the verbose printing option if (options.verbose()) set_verbose(true); @@ -624,7 +624,7 @@ bool osd_common_t::execute_command(const char *command) else if (strcmp(command, OSDCOMMAND_LIST_MIDI_DEVICES) == 0) { osd_module *om = select_module_options(options(), OSD_MIDI_PROVIDER); - midi_module *pm = select_module_options<midi_module *>(options(), OSD_MIDI_PROVIDER); + auto *pm = select_module_options<midi_module *>(options(), OSD_MIDI_PROVIDER); if (om->probe()) { diff --git a/src/osd/modules/midi/none.cpp b/src/osd/modules/midi/none.cpp index adacee7d634..72fc07fb4e2 100644 --- a/src/osd/modules/midi/none.cpp +++ b/src/osd/modules/midi/none.cpp @@ -21,20 +21,20 @@ public: : osd_module(OSD_MIDI_PROVIDER, "pm"), midi_module() { } - virtual ~none_module() { } + virtual ~none_module() = default; virtual int init(const osd_options &options) override; virtual void exit() override; virtual osd_midi_device *create_midi_device() override; - virtual void list_midi_devices(void) override; + virtual void list_midi_devices() override; }; class osd_midi_device_none : public osd_midi_device { public: - virtual ~osd_midi_device_none() { } + virtual ~osd_midi_device_none() = default; virtual bool open_input(const char *devname) override; virtual bool open_output(const char *devname) override; virtual void close() override; @@ -58,7 +58,7 @@ void none_module::exit() { } -void none_module::list_midi_devices(void) +void none_module::list_midi_devices() { osd_printf_warning("\nMIDI is not supported in this build\n"); } diff --git a/src/osd/modules/midi/portmidi.cpp b/src/osd/modules/midi/portmidi.cpp index 418295a7a5c..e5c35c91162 100644 --- a/src/osd/modules/midi/portmidi.cpp +++ b/src/osd/modules/midi/portmidi.cpp @@ -24,13 +24,13 @@ public: : osd_module(OSD_MIDI_PROVIDER, "pm"), midi_module() { } - virtual ~pm_module() { } + virtual ~pm_module() = default; virtual int init(const osd_options &options)override; virtual void exit()override; virtual osd_midi_device *create_midi_device() override; - virtual void list_midi_devices(void) override; + virtual void list_midi_devices() override; }; @@ -43,7 +43,7 @@ class osd_midi_device_pm : public osd_midi_device { public: osd_midi_device_pm(): pmStream(nullptr), xmit_cnt(0), last_status(0), rx_sysex(false) { } - virtual ~osd_midi_device_pm() { } + virtual ~osd_midi_device_pm() = default; virtual bool open_input(const char *devname) override; virtual bool open_output(const char *devname) override; virtual void close() override; @@ -77,7 +77,7 @@ void pm_module::exit() Pm_Terminate(); } -void pm_module::list_midi_devices(void) +void pm_module::list_midi_devices() { int num_devs = Pm_CountDevices(); const PmDeviceInfo *pmInfo; diff --git a/src/osd/modules/monitor/monitor_dxgi.cpp b/src/osd/modules/monitor/monitor_dxgi.cpp index 6638f98806c..36890e36f27 100644 --- a/src/osd/modules/monitor/monitor_dxgi.cpp +++ b/src/osd/modules/monitor/monitor_dxgi.cpp @@ -164,7 +164,7 @@ protected: // if we're verbose, print the list of monitors { - for (auto monitor : list()) + for (const auto &monitor : list()) { osd_printf_verbose("Video: Monitor %I64u = \"%s\" %s\n", monitor->oshandle(), monitor->devicename(), monitor->is_primary() ? "(primary)" : ""); } diff --git a/src/osd/modules/monitor/monitor_win32.cpp b/src/osd/modules/monitor/monitor_win32.cpp index 6bcd6094e83..5780a9590c2 100644 --- a/src/osd/modules/monitor/monitor_win32.cpp +++ b/src/osd/modules/monitor/monitor_win32.cpp @@ -94,7 +94,7 @@ protected: // if we're verbose, print the list of monitors { - for (auto monitor : list()) + for (const auto &monitor : list()) { osd_printf_verbose("Video: Monitor %I64u = \"%s\" %s\n", monitor->oshandle(), monitor->devicename(), monitor->is_primary() ? "(primary)" : ""); } @@ -106,7 +106,7 @@ protected: private: static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect, LPARAM data) { - win32_monitor_module* self = reinterpret_cast<win32_monitor_module*>(data); + auto* self = reinterpret_cast<win32_monitor_module*>(data); MONITORINFOEX info; BOOL result; diff --git a/src/osd/modules/netdev/none.cpp b/src/osd/modules/netdev/none.cpp index a5b520f26a5..97bc3d435da 100644 --- a/src/osd/modules/netdev/none.cpp +++ b/src/osd/modules/netdev/none.cpp @@ -16,7 +16,7 @@ public: { } - virtual ~netdev_none() { } + virtual ~netdev_none() = default; virtual int init(const osd_options &options) override { return 0; } }; diff --git a/src/osd/modules/netdev/pcap.cpp b/src/osd/modules/netdev/pcap.cpp index 68e9512b14a..4e4ed81b1ae 100644 --- a/src/osd/modules/netdev/pcap.cpp +++ b/src/osd/modules/netdev/pcap.cpp @@ -46,7 +46,7 @@ public: { } - virtual ~pcap_module() { } + virtual ~pcap_module() = default; virtual int init(const osd_options &options) override; virtual void exit() override; @@ -250,7 +250,7 @@ netdev_pcap::~netdev_pcap() static CREATE_NETDEV(create_pcap) { - class netdev_pcap *dev = global_alloc(netdev_pcap(ifname, ifdev, rate)); + auto *dev = global_alloc(netdev_pcap(ifname, ifdev, rate)); return dynamic_cast<osd_netdev *>(dev); } diff --git a/src/osd/modules/netdev/taptun.cpp b/src/osd/modules/netdev/taptun.cpp index 91ca323a178..b6012224081 100644 --- a/src/osd/modules/netdev/taptun.cpp +++ b/src/osd/modules/netdev/taptun.cpp @@ -10,7 +10,7 @@ #include <fcntl.h> #include <sys/ioctl.h> #include <net/if.h> -#include <errno.h> +#include <cerrno> #endif #include "emu.h" @@ -40,7 +40,7 @@ public: taptun_module() : osd_module(OSD_NETDEV_PROVIDER, "taptun"), netdev_module() { } - virtual ~taptun_module() { } + virtual ~taptun_module() = default; virtual int init(const osd_options &options); virtual void exit(); @@ -337,7 +337,7 @@ int netdev_tap::recv_dev(uint8_t **buf) static CREATE_NETDEV(create_tap) { - class netdev_tap *dev = global_alloc(netdev_tap(ifname, ifdev, rate)); + auto *dev = global_alloc(netdev_tap(ifname, ifdev, rate)); return dynamic_cast<osd_netdev *>(dev); } diff --git a/src/osd/modules/opengl/gl_shader_mgr.cpp b/src/osd/modules/opengl/gl_shader_mgr.cpp index 0cf3f9b6617..a4f01bca611 100644 --- a/src/osd/modules/opengl/gl_shader_mgr.cpp +++ b/src/osd/modules/opengl/gl_shader_mgr.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Sven Gothel -#include <stdio.h> /* snprintf */ -#include <stdlib.h> /* malloc */ +#include <cstdio> /* snprintf */ +#include <cstdlib> /* malloc */ #include "osdcomm.h" #include "osd_opengl.h" diff --git a/src/osd/modules/opengl/gl_shader_tool.cpp b/src/osd/modules/opengl/gl_shader_tool.cpp index dedb59fbb7c..5696d14f834 100644 --- a/src/osd/modules/opengl/gl_shader_tool.cpp +++ b/src/osd/modules/opengl/gl_shader_tool.cpp @@ -395,7 +395,7 @@ int gl_compile_shader_file( GLhandleARB *shader, GLenum type, const char * shade int const buffer_len = (int)ftell(file); fseek(file, 0, SEEK_SET); - GLcharARB *const buffer = (GLcharARB *)malloc(buffer_len + 1); + auto *const buffer = (GLcharARB *)malloc(buffer_len + 1); memset(buffer, 0, buffer_len + 1); /* Load Shader Sources */ diff --git a/src/osd/modules/output/console.cpp b/src/osd/modules/output/console.cpp index c9983736fb0..58896737829 100644 --- a/src/osd/modules/output/console.cpp +++ b/src/osd/modules/output/console.cpp @@ -18,7 +18,7 @@ public: : osd_module(OSD_OUTPUT_PROVIDER, "console"), output_module() { } - virtual ~output_console() { } + virtual ~output_console() = default; virtual int init(const osd_options &options) override { return 0; } virtual void exit() override { } diff --git a/src/osd/modules/output/network.cpp b/src/osd/modules/output/network.cpp index e92b009670f..eafbf7b95e2 100644 --- a/src/osd/modules/output/network.cpp +++ b/src/osd/modules/output/network.cpp @@ -26,7 +26,7 @@ class output_client { public: - virtual ~output_client() {} + virtual ~output_client() = default; virtual void deliver(std::string &msg) = 0; }; @@ -160,7 +160,7 @@ public: void deliver_to_all(std::string msg) { - for (auto client: m_clients) + for (const auto &client: m_clients) client->deliver(msg); } @@ -197,9 +197,7 @@ public: { } - virtual ~output_network() - { - } + virtual ~output_network() = default; virtual int init(const osd_options &options) override { diff --git a/src/osd/modules/output/none.cpp b/src/osd/modules/output/none.cpp index a4a613ef29f..a5f142c9766 100644 --- a/src/osd/modules/output/none.cpp +++ b/src/osd/modules/output/none.cpp @@ -18,7 +18,7 @@ public: : osd_module(OSD_OUTPUT_PROVIDER, "none"), output_module() { } - virtual ~output_none() { } + virtual ~output_none() = default; virtual int init(const osd_options &options) override { return 0; } virtual void exit() override { } diff --git a/src/osd/modules/output/win32_output.cpp b/src/osd/modules/output/win32_output.cpp index 199219ac5ef..8d7c0f7ba67 100644 --- a/src/osd/modules/output/win32_output.cpp +++ b/src/osd/modules/output/win32_output.cpp @@ -69,7 +69,7 @@ public: : osd_module(OSD_OUTPUT_PROVIDER, "windows"), output_module(), m_output_hwnd(nullptr), m_clientlist(nullptr) { } - virtual ~output_win32() { } + virtual ~output_win32() = default; virtual int init(const osd_options &options) override; virtual void exit() override; @@ -326,7 +326,7 @@ LRESULT output_win32::send_id_string(HWND hwnd, LPARAM id) // allocate memory for the message datalen = sizeof(copydata_id_string) + strlen(name) + 1; std::vector<uint8_t> buffer(datalen); - copydata_id_string *temp = (copydata_id_string *)&buffer[0]; + auto *temp = (copydata_id_string *)&buffer[0]; temp->id = id; strcpy(temp->string, name); diff --git a/src/osd/modules/render/bgfx/chain.cpp b/src/osd/modules/render/bgfx/chain.cpp index 58b7956e6bf..924bc6ab67f 100644 --- a/src/osd/modules/render/bgfx/chain.cpp +++ b/src/osd/modules/render/bgfx/chain.cpp @@ -119,7 +119,7 @@ void bgfx_chain::process(chain_manager::screen_prim &prim, int view, int screen, static int64_t last = m_current_time; const int64_t frameTime = m_current_time - last; last = m_current_time; - const double freq = double(bx::getHPFrequency()); + const auto freq = double(bx::getHPFrequency()); const double toMs = 1000.0 / freq; const double frameTimeInSeconds = (double)frameTime / 1000000.0; @@ -145,7 +145,7 @@ uint32_t bgfx_chain::applicable_passes() void bgfx_chain::insert_effect(uint32_t index, bgfx_effect *effect, std::string name, std::string source, chain_manager &chains) { - clear_state *clear = new clear_state(BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, 0, 1.0f, 0); + auto *clear = new clear_state(BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, 0, 1.0f, 0); std::vector<bgfx_suppressor*> suppressors; std::vector<bgfx_input_pair*> inputs; diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp index 8f8eedc1214..ca3354ee6b3 100644 --- a/src/osd/modules/render/bgfx/chainentry.cpp +++ b/src/osd/modules/render/bgfx/chainentry.cpp @@ -73,11 +73,11 @@ void bgfx_chain_entry::submit(int view, chain_manager::screen_prim &prim, textur uint32_t tint = 0xffffffff; if (m_apply_tint) { - const uint8_t a = (uint8_t)std::round(prim.m_prim->color.a * 255); - const uint8_t r = (uint8_t)std::round(prim.m_prim->color.r * 255); - const uint8_t g = (uint8_t)std::round(prim.m_prim->color.g * 255); - const uint8_t b = (uint8_t)std::round(prim.m_prim->color.b * 255); - tint = (a << 24) | (r << 16) | (g << 8) | b; + const auto a = (uint8_t)std::round(prim.m_prim->color.a * 255); + const auto r = (uint8_t)std::round(prim.m_prim->color.r * 255); + const auto g = (uint8_t)std::round(prim.m_prim->color.g * 255); + const auto b = (uint8_t)std::round(prim.m_prim->color.b * 255); + tint = (a << 24) | (b << 16) | (g << 8) | r; } bgfx::TransientVertexBuffer buffer; @@ -291,7 +291,7 @@ void bgfx_chain_entry::put_screen_buffer(uint16_t screen_width, uint16_t screen_ return; } - ScreenVertex* vertex = reinterpret_cast<ScreenVertex*>(buffer->data); + auto* vertex = reinterpret_cast<ScreenVertex*>(buffer->data); float x[4] = { 0, 1, 0, 1 }; float y[4] = { 0, 0, 1, 1 }; diff --git a/src/osd/modules/render/bgfx/chainentryreader.cpp b/src/osd/modules/render/bgfx/chainentryreader.cpp index f14d9d76f64..e04e0a11751 100644 --- a/src/osd/modules/render/bgfx/chainentryreader.cpp +++ b/src/osd/modules/render/bgfx/chainentryreader.cpp @@ -178,7 +178,7 @@ bgfx_chain_entry* chain_entry_reader::read_from_value(const Value& value, std::s } std::string sampler = input["sampler"].GetString(); - bgfx_input_pair* input_pair = new bgfx_input_pair(i, sampler, texture_name, texture_names, selection, chains, screen_index); + auto* input_pair = new bgfx_input_pair(i, sampler, texture_name, texture_names, selection, chains, screen_index); inputs.push_back(input_pair); } } diff --git a/src/osd/modules/render/bgfx/clearreader.cpp b/src/osd/modules/render/bgfx/clearreader.cpp index 3cbd714463c..948d96a7393 100644 --- a/src/osd/modules/render/bgfx/clearreader.cpp +++ b/src/osd/modules/render/bgfx/clearreader.cpp @@ -30,7 +30,7 @@ clear_state* clear_reader::read_from_value(const Value& value, std::string prefi for (int i = 0; i < colors.Size(); i++) { if (!READER_CHECK(colors[i].IsNumber(), (prefix + "clearcolor[" + std::to_string(i) + "] must be a numeric value\n").c_str())) return nullptr; - int32_t val = int32_t(float(colors[i].GetDouble()) * 255.0f); + auto val = int32_t(float(colors[i].GetDouble()) * 255.0f); if (val > 255) val = 255; if (val < 0) val = 0; clear_color |= val << (24 - (i * 3)); diff --git a/src/osd/modules/render/bgfx/effect.cpp b/src/osd/modules/render/bgfx/effect.cpp index 9359faeb494..6707b5cfc43 100644 --- a/src/osd/modules/render/bgfx/effect.cpp +++ b/src/osd/modules/render/bgfx/effect.cpp @@ -51,6 +51,6 @@ void bgfx_effect::submit(int view, uint64_t blend) bgfx_uniform* bgfx_effect::uniform(std::string name) { - std::map<std::string, bgfx_uniform*>::iterator iter = m_uniforms.find(name); + auto iter = m_uniforms.find(name); return iter != m_uniforms.end() ? iter->second : nullptr; } diff --git a/src/osd/modules/render/bgfx/inputpair.h b/src/osd/modules/render/bgfx/inputpair.h index fb3fc58e1f7..8060ce8c4dd 100644 --- a/src/osd/modules/render/bgfx/inputpair.h +++ b/src/osd/modules/render/bgfx/inputpair.h @@ -27,7 +27,7 @@ class bgfx_input_pair : public slider_changed_notifier { public: bgfx_input_pair(int index, std::string sampler, std::string texture, std::vector<std::string> available_textures, std::string selection, chain_manager& chains, uint32_t screen_index); - ~bgfx_input_pair(); + virtual ~bgfx_input_pair(); void bind(bgfx_effect *effect, const int32_t screen) const; int32_t texture_changed(int32_t index, std::string *str, int32_t newval); diff --git a/src/osd/modules/render/bgfx/paramreader.cpp b/src/osd/modules/render/bgfx/paramreader.cpp index f24bb6a475b..1b14b2aa56a 100644 --- a/src/osd/modules/render/bgfx/paramreader.cpp +++ b/src/osd/modules/render/bgfx/paramreader.cpp @@ -43,7 +43,7 @@ bgfx_parameter* parameter_reader::read_from_value(const Value& value, std::strin } else if (type == bgfx_parameter::parameter_type::PARAM_TIME) { - float limit = float(value["limit"].GetDouble()); + auto limit = float(value["limit"].GetDouble()); return new bgfx_time_parameter(name, type, limit); } else diff --git a/src/osd/modules/render/bgfx/shaders/shader.mk b/src/osd/modules/render/bgfx/shaders/shader.mk index e7db3cdc242..049f9ebd506 100644 --- a/src/osd/modules/render/bgfx/shaders/shader.mk +++ b/src/osd/modules/render/bgfx/shaders/shader.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2019 Branimir Karadzic. All rights reserved. +# Copyright 2011-2020 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # diff --git a/src/osd/modules/render/bgfx/slider.cpp b/src/osd/modules/render/bgfx/slider.cpp index 0cc97275497..4d51edfc0c4 100644 --- a/src/osd/modules/render/bgfx/slider.cpp +++ b/src/osd/modules/render/bgfx/slider.cpp @@ -25,7 +25,7 @@ bgfx_slider::bgfx_slider(running_machine &machine, std::string name, float min, m_max = max; m_value = def; - for (std::string string : strings) + for (const std::string &string : strings) { m_strings.push_back(string); } @@ -103,7 +103,7 @@ int32_t bgfx_slider::update(std::string *str, int32_t newval) default: { - float *val_ptr = reinterpret_cast<float *>(&m_value); + auto *val_ptr = reinterpret_cast<float *>(&m_value); if (newval != SLIDER_NOCHANGE) { *val_ptr = float(newval) * m_step; diff --git a/src/osd/modules/render/bgfx/sliderreader.cpp b/src/osd/modules/render/bgfx/sliderreader.cpp index 6d55c9b4db5..e74f10adcc9 100644 --- a/src/osd/modules/render/bgfx/sliderreader.cpp +++ b/src/osd/modules/render/bgfx/sliderreader.cpp @@ -60,7 +60,7 @@ std::vector<bgfx_slider*> slider_reader::read_from_value(const Value& value, std { return sliders; } - strings.push_back(std::string(string_array[i].GetString())); + strings.emplace_back(std::string(string_array[i].GetString())); } } diff --git a/src/osd/modules/render/bgfx/statereader.cpp b/src/osd/modules/render/bgfx/statereader.cpp index 0f43ad71b09..afc6d652d9b 100644 --- a/src/osd/modules/render/bgfx/statereader.cpp +++ b/src/osd/modules/render/bgfx/statereader.cpp @@ -9,7 +9,7 @@ #include "statereader.h" -#include <math.h> +#include <cmath> uint64_t state_reader::get_enum_from_value(const Value& value, std::string name, const uint64_t default_value, const string_to_enum* enums, const int count) { diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp index 35973ee584f..adc2ca5acee 100644 --- a/src/osd/modules/render/bgfx/targetmanager.cpp +++ b/src/osd/modules/render/bgfx/targetmanager.cpp @@ -47,7 +47,7 @@ target_manager::~target_manager() bgfx_target* target_manager::create_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen) { - bgfx_target* target = new bgfx_target(name, format, width, height, style, double_buffer, filter, scale, screen); + auto* target = new bgfx_target(name, format, width, height, style, double_buffer, filter, scale, screen); std::string full_name = name + std::to_string(screen); m_targets[full_name] = target; @@ -70,7 +70,7 @@ void target_manager::destroy_target(std::string name, uint32_t screen) bgfx_target* target_manager::create_backbuffer(void *handle, uint16_t width, uint16_t height) { - bgfx_target* target = new bgfx_target(handle, width, height); + auto* target = new bgfx_target(handle, width, height); m_targets["backbuffer"] = target; return target; } @@ -95,7 +95,7 @@ bool target_manager::update_target_sizes(uint32_t screen, uint16_t width, uint16 // Ensure that there's an entry to fill while (sizes.size() <= screen) { - sizes.push_back(osd_dim(0, 0)); + sizes.emplace_back(osd_dim(0, 0)); } if (width != sizes[screen].width() || height != sizes[screen].height()) @@ -144,7 +144,7 @@ void target_manager::update_screen_count(uint32_t count) // Ensure that there's an entry to fill while (count > m_native_dims.size()) { - m_native_dims.push_back(osd_dim(0, 0)); + m_native_dims.emplace_back(osd_dim(0, 0)); } if (count != m_screen_count) diff --git a/src/osd/modules/render/bgfx/texture.cpp b/src/osd/modules/render/bgfx/texture.cpp index 7b6747e0c54..a187741798d 100644 --- a/src/osd/modules/render/bgfx/texture.cpp +++ b/src/osd/modules/render/bgfx/texture.cpp @@ -6,7 +6,7 @@ // //============================================================ -#include <string.h> +#include <cstring> #include "texture.h" diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp index e2614133205..861c6e5b617 100644 --- a/src/osd/modules/render/bgfx/texturemanager.cpp +++ b/src/osd/modules/render/bgfx/texturemanager.cpp @@ -37,7 +37,7 @@ texture_manager::~texture_manager() void texture_manager::add_provider(std::string name, bgfx_texture_handle_provider* provider) { - std::map<std::string, bgfx_texture_handle_provider*>::iterator iter = m_textures.find(name); + auto iter = m_textures.find(name); if (iter != m_textures.end()) { iter->second = provider; @@ -50,7 +50,7 @@ void texture_manager::add_provider(std::string name, bgfx_texture_handle_provide bgfx_texture* texture_manager::create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags) { - bgfx_texture* texture = new bgfx_texture(name, format, width, height, flags, data); + auto* texture = new bgfx_texture(name, format, width, height, flags, data); m_textures[name] = texture; return texture; } @@ -67,13 +67,13 @@ bgfx_texture* texture_manager::create_png_texture(std::string path, std::string return nullptr; } - uint8_t *data = new uint8_t[bitmap.width() * bitmap.height() * 4]; - uint32_t *data32 = reinterpret_cast<uint32_t *>(data); + auto *data = new uint8_t[bitmap.width() * bitmap.height() * 4]; + auto *data32 = reinterpret_cast<uint32_t *>(data); const uint32_t width = bitmap.width(); const uint32_t height = bitmap.height(); const uint32_t rowpixels = bitmap.rowpixels(); - uint32_t* base = reinterpret_cast<uint32_t *>(bitmap.raw_pixptr(0)); + auto* base = reinterpret_cast<uint32_t *>(bitmap.raw_pixptr(0)); for (int y = 0; y < height; y++) { copy_util::copyline_argb32(data32 + y * width, base + y * rowpixels, width, nullptr); @@ -96,7 +96,7 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; if (old_key != ~0ULL) { - std::map<uint64_t, sequenced_handle>::iterator iter = m_mame_textures.find(old_key); + auto iter = m_mame_textures.find(old_key); if (iter != m_mame_textures.end()) { handle = iter->second.handle; @@ -129,7 +129,7 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form } else { - std::map<uint64_t, sequenced_handle>::iterator iter = m_mame_textures.find(key); + auto iter = m_mame_textures.find(key); if (iter != m_mame_textures.end()) { handle = iter->second.handle; @@ -168,7 +168,7 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form bgfx::TextureHandle texture_manager::handle(std::string name) { bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; - std::map<std::string, bgfx_texture_handle_provider*>::iterator iter = m_textures.find(name); + auto iter = m_textures.find(name); if (iter != m_textures.end()) { handle = (iter->second)->texture(); @@ -180,7 +180,7 @@ bgfx::TextureHandle texture_manager::handle(std::string name) bgfx_texture_handle_provider* texture_manager::provider(std::string name) { - std::map<std::string, bgfx_texture_handle_provider*>::iterator iter = m_textures.find(name); + auto iter = m_textures.find(name); if (iter != m_textures.end()) { return iter->second; diff --git a/src/osd/modules/render/bgfx/uniformreader.cpp b/src/osd/modules/render/bgfx/uniformreader.cpp index c97ca484e48..f2bf1114ec6 100644 --- a/src/osd/modules/render/bgfx/uniformreader.cpp +++ b/src/osd/modules/render/bgfx/uniformreader.cpp @@ -32,7 +32,7 @@ bgfx_uniform* uniform_reader::read_from_value(const Value& value, std::string pr const size_t array_size = value_array.Size() * sizeof(float); const size_t alloc_size = (type_size > array_size) ? type_size : array_size; - float* data = reinterpret_cast<float*>(new char[alloc_size]); + auto* data = reinterpret_cast<float*>(new char[alloc_size]); unsigned int index = 0; for (; index < type_size / 4 && index < value_array.Size(); index++) @@ -45,7 +45,7 @@ bgfx_uniform* uniform_reader::read_from_value(const Value& value, std::string pr data[index] = 0.0f; } - bgfx_uniform* uniform = new bgfx_uniform(name, type); + auto* uniform = new bgfx_uniform(name, type); uniform->set((void*)data, type_size); delete [] data; diff --git a/src/osd/modules/render/bgfxutil.cpp b/src/osd/modules/render/bgfxutil.cpp index 1ce3c244ba4..de3e3fe30d0 100644 --- a/src/osd/modules/render/bgfxutil.cpp +++ b/src/osd/modules/render/bgfxutil.cpp @@ -39,9 +39,9 @@ const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::Text const bgfx::Memory* bgfx_util::mame_texture_data_to_argb32(uint32_t src_format, int width, int height, int rowpixels, const rgb_t *palette, void *base) { const bgfx::Memory* mem = bgfx::alloc(width * height * 4); - uint32_t* dst = reinterpret_cast<uint32_t*>(mem->data); - uint16_t* src16 = reinterpret_cast<uint16_t*>(base); - uint32_t* src32 = reinterpret_cast<uint32_t*>(base); + auto* dst = reinterpret_cast<uint32_t*>(mem->data); + auto* src16 = reinterpret_cast<uint16_t*>(base); + auto* src32 = reinterpret_cast<uint32_t*>(base); for (int y = 0; y < height; y++) { diff --git a/src/osd/modules/render/binpacker.cpp b/src/osd/modules/render/binpacker.cpp index aa80f600e2a..c213b99e1e8 100644 --- a/src/osd/modules/render/binpacker.cpp +++ b/src/osd/modules/render/binpacker.cpp @@ -19,7 +19,7 @@ bool rectangle_packer::pack(const std::vector<packable_rectangle>& rects, std::v // Add rects to member array, and check to make sure none is too big for (size_t rect = 0; rect < rects.size(); rect++) { - m_rects.push_back(rectangle(0, 0, rects[rect].width(), rects[rect].height(), rects[rect].hash(), rects[rect].format(), rects[rect].rowpixels(), rects[rect].palette(), rects[rect].base())); + m_rects.emplace_back(rectangle(0, 0, rects[rect].width(), rects[rect].height(), rects[rect].hash(), rects[rect].format(), rects[rect].rowpixels(), rects[rect].palette(), rects[rect].base())); } // Sort from greatest to least area @@ -29,7 +29,7 @@ bool rectangle_packer::pack(const std::vector<packable_rectangle>& rects, std::v while (m_num_packed < (int)m_rects.size()) { int i = m_packs.size(); - m_packs.push_back(rectangle(m_pack_size)); + m_packs.emplace_back(rectangle(m_pack_size)); m_roots.push_back(i); if (!fill(i)) { @@ -179,7 +179,7 @@ void rectangle_packer::add_pack_to_array(int pack, std::vector<packed_rectangle> { if (m_packs[pack].hash != 0) { - array.push_back(packed_rectangle(m_packs[pack].hash, m_packs[pack].format, + array.emplace_back(packed_rectangle(m_packs[pack].hash, m_packs[pack].format, m_packs[pack].w, m_packs[pack].h, m_packs[pack].x, m_packs[pack].y, m_packs[pack].rowpixels, m_packs[pack].palette, m_packs[pack].base)); diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index b0ce9983f54..9233aabc002 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -114,7 +114,7 @@ public: for (int y = 0; y < m_height; y++) { - DWORD *src = (DWORD *)((BYTE *)rect.pBits + y * rect.Pitch); + auto *src = (DWORD *)((BYTE *)rect.pBits + y * rect.Pitch); uint32_t *dst = &m_frame.pix32(y); for (int x = 0; x < m_width; x++) @@ -342,7 +342,7 @@ void shaders::render_snapshot(IDirect3DSurface9 *surface) for (int y = 0; y < height; y++) { - DWORD *src = (DWORD *)((BYTE *)rect.pBits + y * rect.Pitch); + auto *src = (DWORD *)((BYTE *)rect.pBits + y * rect.Pitch); uint32_t *dst = &snapshot.pix32(y); for (int x = 0; x < width; x++) @@ -492,7 +492,7 @@ bool shaders::init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *r enumerate_screens(); - windows_options &winoptions = downcast<windows_options &>(machine->options()); + auto &winoptions = downcast<windows_options &>(machine->options()); post_fx_enable = winoptions.d3d_hlsl_enable(); oversampling_enable = winoptions.d3d_hlsl_oversampling(); @@ -2013,7 +2013,7 @@ int32_t slider::update(std::string *str, int32_t newval) { case SLIDER_INT_ENUM: { - int32_t *val_ptr = reinterpret_cast<int32_t *>(m_value); + auto *val_ptr = reinterpret_cast<int32_t *>(m_value); if (newval != SLIDER_NOCHANGE) { *val_ptr = newval; @@ -2041,7 +2041,7 @@ int32_t slider::update(std::string *str, int32_t newval) default: { - float *val_ptr = reinterpret_cast<float *>(m_value); + auto *val_ptr = reinterpret_cast<float *>(m_value); if (newval != SLIDER_NOCHANGE) { *val_ptr = (float)newval * m_desc->scale; @@ -2354,7 +2354,7 @@ void shaders::init_slider_list() for (int j = 0; j < count; j++) { - slider* slider_arg = new slider(desc, get_slider_option(desc->id, j), &options->params_dirty); + auto* slider_arg = new slider(desc, get_slider_option(desc->id, j), &options->params_dirty); internal_sliders.push_back(slider_arg); std::string name = desc->name; switch (desc->slider_type) diff --git a/src/osd/modules/render/draw13.cpp b/src/osd/modules/render/draw13.cpp index f99ebf70601..96b04efc3d9 100644 --- a/src/osd/modules/render/draw13.cpp +++ b/src/osd/modules/render/draw13.cpp @@ -11,8 +11,8 @@ //============================================================ // standard C headers -#include <math.h> -#include <stdio.h> +#include <cmath> +#include <cstdio> // MAME headers #include "emu.h" diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index 54b113ac146..e9ca64ef392 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -454,7 +454,7 @@ bgfx::VertexLayout ScreenVertex::ms_decl; void renderer_bgfx::put_packed_quad(render_primitive *prim, uint32_t hash, ScreenVertex* vertices) { rectangle_packer::packed_rectangle& rect = m_hash_to_entry[hash]; - float size = float(CACHE_SIZE); + auto size = float(CACHE_SIZE); float u0 = (float(rect.x()) + 0.5f) / size; float v0 = (float(rect.y()) + 0.5f) / size; float u1 = u0 + (float(rect.width()) - 1.0f) / size; @@ -517,7 +517,7 @@ void renderer_bgfx::vertex(ScreenVertex* vertex, float x, float y, float z, uint void renderer_bgfx::render_post_screen_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int32_t screen) { - ScreenVertex* vertices = reinterpret_cast<ScreenVertex*>(buffer->data); + auto* vertices = reinterpret_cast<ScreenVertex*>(buffer->data); float x[4] = { prim->bounds.x0, prim->bounds.x1, prim->bounds.x0, prim->bounds.x1 }; float y[4] = { prim->bounds.y0, prim->bounds.y0, prim->bounds.y1, prim->bounds.y1 }; @@ -553,7 +553,7 @@ void renderer_bgfx::render_avi_quad() bgfx::TransientVertexBuffer buffer; bgfx::allocTransientVertexBuffer(&buffer, 6, ScreenVertex::ms_decl); - ScreenVertex* vertices = reinterpret_cast<ScreenVertex*>(buffer.data); + auto* vertices = reinterpret_cast<ScreenVertex*>(buffer.data); float x[4] = { 0.0f, float(m_width[0]), 0.0f, float(m_width[0]) }; float y[4] = { 0.0f, 0.0f, float(m_height[0]), float(m_height[0]) }; @@ -576,7 +576,7 @@ void renderer_bgfx::render_avi_quad() void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::TransientVertexBuffer* buffer) { - ScreenVertex* vertices = reinterpret_cast<ScreenVertex*>(buffer->data); + auto* vertices = reinterpret_cast<ScreenVertex*>(buffer->data); uint32_t rgba = u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255); float x[4] = { prim->bounds.x0, prim->bounds.x1, prim->bounds.x0, prim->bounds.x1 }; diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 140315620d9..56c905636a4 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -489,9 +489,9 @@ texture_info *d3d_texture_manager::find_texinfo(const render_texinfo *texinfo, u // find a match for (auto it = m_texture_list.begin(); it != m_texture_list.end(); it++) { - uint32_t test_screen = (uint32_t)((*it)->get_texinfo().unique_id >> 57); + auto test_screen = (uint32_t)((*it)->get_texinfo().unique_id >> 57); uint32_t test_page = (uint32_t)((*it)->get_texinfo().unique_id >> 56) & 1; - uint32_t prim_screen = (uint32_t)(texinfo->unique_id >> 57); + auto prim_screen = (uint32_t)(texinfo->unique_id >> 57); uint32_t prim_page = (uint32_t)(texinfo->unique_id >> 56) & 1; if (test_screen != prim_screen || test_page != prim_page) continue; @@ -778,7 +778,7 @@ void renderer_d3d9::update_gamma_ramp() if (win->fullscreen()) { // only set the gamma if it's not 1.0 - windows_options &options = downcast<windows_options &>(win->machine().options()); + auto &options = downcast<windows_options &>(win->machine().options()); float brightness = options.full_screen_brightness(); float contrast = options.full_screen_contrast(); float gamma = options.full_screen_gamma(); @@ -801,8 +801,12 @@ void renderer_d3d9::update_gamma_ramp() // device_create //============================================================ -int renderer_d3d9::device_create(HWND device_hwnd) +int renderer_d3d9::device_create(HWND hwnd) { + // identify the actual window; this is needed so that -attach_window + // can work on a non-root HWND + HWND device_hwnd = GetAncestor(hwnd, GA_ROOT); + // if a device exists, free it if (m_device != nullptr) { @@ -1480,8 +1484,8 @@ void renderer_d3d9::batch_vectors(int vector_count) ((rotation_0 || rotation_90) && orientation_swap_xy) || ((rotation_180 || rotation_90) && !orientation_swap_xy); - float screen_width = float(this->get_width()); - float screen_height = float(this->get_height()); + auto screen_width = float(this->get_width()); + auto screen_height = float(this->get_height()); float half_screen_width = screen_width * 0.5f; float half_screen_height = screen_height * 0.5f; float screen_swap_x_factor = 1.0f / screen_width * screen_height; @@ -1610,10 +1614,10 @@ void renderer_d3d9::batch_vector(const render_primitive &prim) } // determine the color of the line - int32_t r = (int32_t)(prim.color.r * 255.0f); - int32_t g = (int32_t)(prim.color.g * 255.0f); - int32_t b = (int32_t)(prim.color.b * 255.0f); - int32_t a = (int32_t)(prim.color.a * 255.0f); + auto r = (int32_t)(prim.color.r * 255.0f); + auto g = (int32_t)(prim.color.g * 255.0f); + auto b = (int32_t)(prim.color.b * 255.0f); + auto a = (int32_t)(prim.color.a * 255.0f); DWORD color = D3DCOLOR_ARGB(a, r, g, b); // set the color, Z parameters to standard values @@ -1680,10 +1684,10 @@ void renderer_d3d9::draw_line(const render_primitive &prim) vertex[3].v0 = stop.c.y; // determine the color of the line - int32_t r = (int32_t)(prim.color.r * 255.0f); - int32_t g = (int32_t)(prim.color.g * 255.0f); - int32_t b = (int32_t)(prim.color.b * 255.0f); - int32_t a = (int32_t)(prim.color.a * 255.0f); + auto r = (int32_t)(prim.color.r * 255.0f); + auto g = (int32_t)(prim.color.g * 255.0f); + auto b = (int32_t)(prim.color.b * 255.0f); + auto a = (int32_t)(prim.color.a * 255.0f); DWORD color = D3DCOLOR_ARGB(a, r, g, b); // set the color, Z parameters to standard values @@ -1749,10 +1753,10 @@ void renderer_d3d9::draw_quad(const render_primitive &prim) } // determine the color, allowing for over modulation - int32_t r = (int32_t)(prim.color.r * 255.0f); - int32_t g = (int32_t)(prim.color.g * 255.0f); - int32_t b = (int32_t)(prim.color.b * 255.0f); - int32_t a = (int32_t)(prim.color.a * 255.0f); + auto r = (int32_t)(prim.color.r * 255.0f); + auto g = (int32_t)(prim.color.g * 255.0f); + auto b = (int32_t)(prim.color.b * 255.0f); + auto a = (int32_t)(prim.color.a * 255.0f); DWORD color = D3DCOLOR_ARGB(a, r, g, b); // adjust half pixel X/Y offset, set the color, Z parameters to standard values @@ -2702,8 +2706,8 @@ bool d3d_render_target::init(renderer_d3d9 *d3d, int source_width, int source_he float scale_factor = 0.75f; int scale_count = vector_screen ? MAX_BLOOM_COUNT : HALF_BLOOM_COUNT; - float bloom_width = (float)source_width; - float bloom_height = (float)source_height; + auto bloom_width = (float)source_width; + auto bloom_height = (float)source_height; float bloom_size = bloom_width < bloom_height ? bloom_width : bloom_height; for (int bloom_index = 0; bloom_index < scale_count && bloom_size >= 2.0f; bloom_size *= scale_factor) { diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h index 92923904d77..03527d7374e 100644 --- a/src/osd/modules/render/drawd3d.h +++ b/src/osd/modules/render/drawd3d.h @@ -18,7 +18,7 @@ #include <mmsystem.h> #include <d3d9.h> #include <d3dx9.h> -#include <math.h> +#include <cmath> #undef interface #include "d3d/d3dcomm.h" diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp index 0668834e19a..ae030224e74 100644 --- a/src/osd/modules/render/drawogl.cpp +++ b/src/osd/modules/render/drawogl.cpp @@ -13,8 +13,8 @@ //============================================================ // standard C headers -#include <math.h> -#include <stdio.h> +#include <cmath> +#include <cstdio> // MAME headers #include "osdcomm.h" @@ -41,8 +41,8 @@ #include "modules/opengl/gl_shader_mgr.h" #if defined(SDLMAME_MACOSX) || defined(OSD_MAC) -#include <string.h> -#include <stdio.h> +#include <cstring> +#include <cstdio> #include <sys/types.h> #include <sys/sysctl.h> @@ -1649,7 +1649,7 @@ void renderer_ogl::texture_compute_size_type(const render_texinfo *texsource, og // texture_create //============================================================ -static int gl_checkFramebufferStatus(void) +static int gl_checkFramebufferStatus() { GLenum status; status=(GLenum)pfn_glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); @@ -1714,8 +1714,8 @@ static int texture_fbo_create(uint32_t text_unit, uint32_t text_name, uint32_t f glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); pfn_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, text_name, 0); @@ -1893,8 +1893,8 @@ int renderer_ogl::texture_shader_create(const render_texinfo *texsource, ogl_tex } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } GL_CHECK_ERROR_NORMAL(); @@ -2015,8 +2015,8 @@ ogl_texture_info *renderer_ogl::texture_create(const render_texinfo *texsource, if( texture->texTarget==GL_TEXTURE_RECTANGLE_ARB ) { // texture rectangles can't wrap - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } else { // set wrapping mode appropriately if (texture->flags & PRIMFLAG_TEXWRAP_MASK) @@ -2026,8 +2026,8 @@ ogl_texture_info *renderer_ogl::texture_create(const render_texinfo *texsource, } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } } } diff --git a/src/osd/modules/render/drawsdl.cpp b/src/osd/modules/render/drawsdl.cpp index 5e04f6d4b15..76dc1375e5b 100644 --- a/src/osd/modules/render/drawsdl.cpp +++ b/src/osd/modules/render/drawsdl.cpp @@ -11,8 +11,8 @@ //============================================================ // standard C headers -#include <math.h> -#include <stdio.h> +#include <cmath> +#include <cstdio> // MAME headers #include "emu.h" diff --git a/src/osd/modules/sound/coreaudio_sound.cpp b/src/osd/modules/sound/coreaudio_sound.cpp index 1eb7e7fff30..dd9c953ceb5 100644 --- a/src/osd/modules/sound/coreaudio_sound.cpp +++ b/src/osd/modules/sound/coreaudio_sound.cpp @@ -21,7 +21,7 @@ #include <memory> #include <new> -#include <string.h> +#include <cstring> #ifdef MAC_OS_X_VERSION_MAX_ALLOWED diff --git a/src/osd/modules/sound/direct_sound.cpp b/src/osd/modules/sound/direct_sound.cpp index 4d6c8c26c50..c7943362e61 100644 --- a/src/osd/modules/sound/direct_sound.cpp +++ b/src/osd/modules/sound/direct_sound.cpp @@ -60,7 +60,7 @@ public: m_buffer_overflows(0) { } - virtual ~sound_direct_sound() { } + virtual ~sound_direct_sound() = default; virtual int init(osd_options const &options) override; virtual void exit() override; @@ -541,7 +541,7 @@ error: // destroy_buffers //============================================================ -void sound_direct_sound::destroy_buffers(void) +void sound_direct_sound::destroy_buffers() { // stop any playback if (m_stream_buffer) diff --git a/src/osd/modules/sound/none.cpp b/src/osd/modules/sound/none.cpp index 685cdc884c2..c13a1951e27 100644 --- a/src/osd/modules/sound/none.cpp +++ b/src/osd/modules/sound/none.cpp @@ -18,7 +18,7 @@ public: : osd_module(OSD_SOUND_PROVIDER, "none"), sound_module() { } - virtual ~sound_none() { } + virtual ~sound_none() = default; virtual int init(const osd_options &options) override { return 0; } virtual void exit() override { } diff --git a/src/osd/modules/sound/pa_sound.cpp b/src/osd/modules/sound/pa_sound.cpp index 41645318672..0f67d86d828 100644 --- a/src/osd/modules/sound/pa_sound.cpp +++ b/src/osd/modules/sound/pa_sound.cpp @@ -38,7 +38,7 @@ public: : osd_module(OSD_SOUND_PROVIDER, "portaudio"), sound_module() { } - virtual ~sound_pa() { } + virtual ~sound_pa() = default; virtual int init(osd_options const &options) override; virtual void exit() override; diff --git a/src/osd/modules/sound/xaudio2_sound.cpp b/src/osd/modules/sound/xaudio2_sound.cpp index 1d9e1036f9a..da78dfb3aa7 100644 --- a/src/osd/modules/sound/xaudio2_sound.cpp +++ b/src/osd/modules/sound/xaudio2_sound.cpp @@ -226,7 +226,7 @@ public: { } - virtual ~sound_xaudio2() { } + virtual ~sound_xaudio2() = default; bool probe() override; int init(osd_options const &options) override; diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index 7e7ac805ad2..dfb9ab8ecde 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -13,8 +13,8 @@ #pragma once -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> #include <array> #include <cstdint> diff --git a/src/osd/osdcore.cpp b/src/osd/osdcore.cpp index 250f51a90bc..fd696706e6b 100644 --- a/src/osd/osdcore.cpp +++ b/src/osd/osdcore.cpp @@ -11,7 +11,7 @@ #ifdef _WIN32 #include <windows.h> -#include <stdio.h> +#include <cstdio> #include <shellapi.h> #include "strconv.h" #endif @@ -137,7 +137,7 @@ void osd_vprintf_debug(util::format_argument_pack<std::ostream> const &args) // osd_ticks //============================================================ -osd_ticks_t osd_ticks(void) +osd_ticks_t osd_ticks() { return std::chrono::high_resolution_clock::now().time_since_epoch().count(); } @@ -147,7 +147,7 @@ osd_ticks_t osd_ticks(void) // osd_ticks_per_second //============================================================ -osd_ticks_t osd_ticks_per_second(void) +osd_ticks_t osd_ticks_per_second() { return std::chrono::high_resolution_clock::period::den / std::chrono::high_resolution_clock::period::num; } diff --git a/src/osd/osdnet.cpp b/src/osd/osdnet.cpp index 3e1cb3596e1..070b4e96a2d 100644 --- a/src/osd/osdnet.cpp +++ b/src/osd/osdnet.cpp @@ -116,7 +116,7 @@ int netdev_count() return netdev_list.size(); } -void osd_list_network_adapters(void) +void osd_list_network_adapters() { #ifdef USE_NETWORK int num_devs = netdev_list.size(); diff --git a/src/osd/osdsync.cpp b/src/osd/osdsync.cpp index f8143aa2c51..85950b33093 100644 --- a/src/osd/osdsync.cpp +++ b/src/osd/osdsync.cpp @@ -10,10 +10,10 @@ #include <windows.h> #include <process.h> #include <tchar.h> -#include <stdlib.h> +#include <cstdlib> #ifdef __GNUC__ -#include <stdint.h> +#include <cstdint> #endif #endif #include <mutex> @@ -85,7 +85,7 @@ static void spin_while_not(const volatile _AtomType * volatile atom, const _Main // osd_num_processors //============================================================ -int osd_get_num_processors(void) +int osd_get_num_processors() { #if defined(SDLMAME_EMSCRIPTEN) // multithreading is not supported at this time @@ -211,7 +211,7 @@ int osd_num_processors = 0; // FUNCTION PROTOTYPES //============================================================ -static int effective_num_processors(void); +static int effective_num_processors(); static void * worker_thread_entry(void *param); static void worker_thread_process(osd_work_queue *queue, work_thread_info *thread); static bool queue_has_list_items(osd_work_queue *queue); @@ -445,20 +445,18 @@ void osd_work_queue_free(osd_work_queue *queue) // free all items in the free list while (queue->free.load() != nullptr) { - osd_work_item *item = (osd_work_item *)queue->free; + auto *item = (osd_work_item *)queue->free; queue->free = item->next; - if (item->event != nullptr) - delete item->event; + delete item->event; delete item; } // free all items in the active list while (queue->list.load() != nullptr) { - osd_work_item *item = (osd_work_item *)queue->list; + auto *item = (osd_work_item *)queue->list; queue->list = item->next; - if (item->event != nullptr) - delete item->event; + delete item->event; delete item; } @@ -641,7 +639,7 @@ void osd_work_item_release(osd_work_item *item) // effective_num_processors //============================================================ -static int effective_num_processors(void) +static int effective_num_processors() { int physprocs = osd_get_num_processors(); @@ -672,7 +670,7 @@ static int effective_num_processors(void) static void *worker_thread_entry(void *param) { - work_thread_info *thread = (work_thread_info *)param; + auto *thread = (work_thread_info *)param; osd_work_queue &queue = thread->queue; // loop until we exit diff --git a/src/osd/sdl/video.cpp b/src/osd/sdl/video.cpp index 9fdb6b74c56..e7af55e56ba 100644 --- a/src/osd/sdl/video.cpp +++ b/src/osd/sdl/video.cpp @@ -254,7 +254,7 @@ void sdl_osd_interface::extract_video_config() video_config.syncrefresh = 0; } - if (video_config.prescale < 1 || video_config.prescale > 3) + if (video_config.prescale < 1 || video_config.prescale > 8) { osd_printf_warning("Invalid prescale option, reverting to '1'\n"); video_config.prescale = 1; diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp index e12337e4a97..70886d76a73 100644 --- a/src/osd/sdl/window.cpp +++ b/src/osd/sdl/window.cpp @@ -16,7 +16,7 @@ #include <SDL2/SDL.h> // standard C headers -#include <math.h> +#include <cmath> #ifndef _MSC_VER #include <unistd.h> #endif diff --git a/src/osd/strconv.cpp b/src/osd/strconv.cpp index 9ea2e00bd1a..717a17d862c 100644 --- a/src/osd/strconv.cpp +++ b/src/osd/strconv.cpp @@ -9,7 +9,7 @@ #include <windows.h> #endif #include <algorithm> -#include <assert.h> +#include <cassert> // MAMEOS headers #include "strconv.h" diff --git a/src/osd/uwp/uwpcompat.cpp b/src/osd/uwp/uwpcompat.cpp index bd7103b8e31..e4e1149f72c 100644 --- a/src/osd/uwp/uwpcompat.cpp +++ b/src/osd/uwp/uwpcompat.cpp @@ -9,7 +9,7 @@ #include "uwpcompat.h" #include <windows.h> -#include <errno.h> +#include <cerrno> #undef interface diff --git a/src/osd/uwp/uwpcompat.h b/src/osd/uwp/uwpcompat.h index 2d495238a99..5d0dbb07dcb 100644 --- a/src/osd/uwp/uwpcompat.h +++ b/src/osd/uwp/uwpcompat.h @@ -17,7 +17,7 @@ extern "C" { #define NOGDI #endif #include <windows.h> -#include <stdio.h> +#include <cstdio> int system(const char *command); diff --git a/src/osd/uwp/video.cpp b/src/osd/uwp/video.cpp index 9ed9a6c98d3..f63b76c037e 100644 --- a/src/osd/uwp/video.cpp +++ b/src/osd/uwp/video.cpp @@ -178,7 +178,7 @@ void windows_osd_interface::extract_video_config() video_config.triplebuf = options().triple_buffer(); video_config.switchres = options().switch_res(); - if (video_config.prescale < 1 || video_config.prescale > 3) + if (video_config.prescale < 1 || video_config.prescale > 8) { osd_printf_warning("Invalid prescale option, reverting to '1'\n"); video_config.prescale = 1; diff --git a/src/osd/watchdog.cpp b/src/osd/watchdog.cpp index 09f720b7fcc..4e5177cd300 100644 --- a/src/osd/watchdog.cpp +++ b/src/osd/watchdog.cpp @@ -43,7 +43,7 @@ void osd_watchdog::setTimeout(int timeout) void *osd_watchdog::watchdog_thread(void *param) { - osd_watchdog *const thiz(reinterpret_cast<osd_watchdog *>(param)); + auto *const thiz(reinterpret_cast<osd_watchdog *>(param)); while (true) { diff --git a/src/osd/windows/ledutil.cpp b/src/osd/windows/ledutil.cpp index 8f2a781b427..f1976cd41bc 100644 --- a/src/osd/windows/ledutil.cpp +++ b/src/osd/windows/ledutil.cpp @@ -34,9 +34,9 @@ // standard C headers #include <conio.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> // MAME output header file typedef int running_machine; diff --git a/src/osd/windows/main.cpp b/src/osd/windows/main.cpp index 6d81d824f02..cfadf9ffe0b 100644 --- a/src/osd/windows/main.cpp +++ b/src/osd/windows/main.cpp @@ -12,7 +12,7 @@ #endif #include <windows.h> #include <tchar.h> -#include <stdlib.h> +#include <cstdlib> #include <vector> #include <string> diff --git a/src/osd/windows/video.cpp b/src/osd/windows/video.cpp index 3f3fe78f1f7..c6f4d3a0a89 100644 --- a/src/osd/windows/video.cpp +++ b/src/osd/windows/video.cpp @@ -57,7 +57,7 @@ bool windows_osd_interface::video_init() window_init(); // create the windows - windows_options &options = downcast<windows_options &>(machine().options()); + auto &options = downcast<windows_options &>(machine().options()); for (int index = 0; index < video_config.numscreens; index++) { win_window_info::create(machine(), index, m_monitor_module->pick_monitor(options, index), &windows[index]); @@ -90,7 +90,7 @@ void windows_osd_interface::update(bool skip_redraw) if (!skip_redraw) { // profiler_mark(PROFILER_BLIT); - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) window->update(); // profiler_mark(PROFILER_END); } @@ -194,7 +194,7 @@ void windows_osd_interface::extract_video_config() video_config.triplebuf = options().triple_buffer(); video_config.switchres = options().switch_res(); - if (video_config.prescale < 1 || video_config.prescale > 3) + if (video_config.prescale < 1 || video_config.prescale > 8) { osd_printf_warning("Invalid prescale option, reverting to '1'\n"); video_config.prescale = 1; diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 3794e79cd14..2d4bdb55880 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -116,7 +116,7 @@ static bool s_aggressive_focus; //============================================================ -static void create_window_class(void); +static void create_window_class(); //============================================================ // window_init @@ -204,7 +204,7 @@ bool windows_osd_interface::window_init() void windows_osd_interface::update_slider_list() { - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) { // check if any window has dirty sliders if (window->has_renderer() && window->renderer().sliders_dirty()) @@ -224,7 +224,7 @@ void windows_osd_interface::build_slider_list() { m_sliders.clear(); - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) { if (window->has_renderer()) { @@ -418,7 +418,7 @@ void winwindow_process_events_periodic(running_machine &machine) static bool is_mame_window(HWND hwnd) { - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) if (std::static_pointer_cast<win_window_info>(window)->platform_window() == hwnd) return true; @@ -577,12 +577,12 @@ void winwindow_dispatch_message(running_machine &machine, MSG *message) // (main thread) //============================================================ -void winwindow_take_snap(void) +void winwindow_take_snap() { assert(GetCurrentThreadId() == main_threadid); // iterate over windows and request a snap - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) { window->renderer().save(); } @@ -595,12 +595,12 @@ void winwindow_take_snap(void) // (main thread) //============================================================ -void winwindow_toggle_fsfx(void) +void winwindow_toggle_fsfx() { assert(GetCurrentThreadId() == main_threadid); // iterate over windows and request a snap - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) { window->renderer().toggle_fsfx(); } @@ -613,12 +613,12 @@ void winwindow_toggle_fsfx(void) // (main thread) //============================================================ -void winwindow_take_video(void) +void winwindow_take_video() { assert(GetCurrentThreadId() == main_threadid); // iterate over windows and request a snap - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) { window->renderer().record(); } @@ -631,12 +631,12 @@ void winwindow_take_video(void) // (main thread) //============================================================ -void winwindow_toggle_full_screen(void) +void winwindow_toggle_full_screen() { assert(GetCurrentThreadId() == main_threadid); // if we are in debug mode, never go full screen - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) if (window->machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) return; @@ -644,7 +644,7 @@ void winwindow_toggle_full_screen(void) video_config.windowed = !video_config.windowed; // iterate over windows and toggle their fullscreen state - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) SendMessage(std::static_pointer_cast<win_window_info>(window)->platform_window(), WM_USER_SET_FULLSCREEN, !video_config.windowed, 0); // Set the first window as foreground @@ -658,10 +658,10 @@ void winwindow_toggle_full_screen(void) // (main or window thread) //============================================================ -bool winwindow_has_focus(void) +bool winwindow_has_focus() { // see if one of the video windows has focus - for (auto window : osd_common_t::s_window_list) + for (const auto &window : osd_common_t::s_window_list) { switch (std::static_pointer_cast<win_window_info>(window)->focus()) { @@ -752,7 +752,7 @@ void win_window_info::create(running_machine &machine, int index, std::shared_pt // set main window if (window->m_index > 0) { - for (auto w : osd_common_t::s_window_list) + for (const auto &w : osd_common_t::s_window_list) { if (w->m_index == 0) { @@ -769,7 +769,7 @@ void win_window_info::create(running_machine &machine, int index, std::shared_pt // see if we are safe for fullscreen window->m_fullscreen_safe = TRUE; - for (auto win : osd_common_t::s_window_list) + for (const auto &win : osd_common_t::s_window_list) if (win->monitor() == monitor.get()) window->m_fullscreen_safe = FALSE; @@ -780,7 +780,7 @@ void win_window_info::create(running_machine &machine, int index, std::shared_pt window->m_target = machine.render().target_alloc(); // set the specific view - windows_options &options = downcast<windows_options &>(machine.options()); + auto &options = downcast<windows_options &>(machine.options()); const char *defview = options.view(); window->set_starting_view(index, defview, options.view(index)); @@ -930,7 +930,7 @@ void win_window_info::update() // (main thread) //============================================================ -static void create_window_class(void) +static void create_window_class() { static int classes_created = FALSE; @@ -1180,7 +1180,7 @@ int win_window_info::complete_create() LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) { LONG_PTR ptr = GetWindowLongPtr(wnd, GWLP_USERDATA); - win_window_info *window = (win_window_info *)ptr; + auto *window = (win_window_info *)ptr; // we may get called before SetWindowLongPtr is called if (window != nullptr) @@ -1293,7 +1293,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR // get min/max info: set the minimum window size case WM_GETMINMAXINFO: { - MINMAXINFO *minmax = (MINMAXINFO *)lparam; + auto *minmax = (MINMAXINFO *)lparam; minmax->ptMinTrackSize.x = MIN_WINDOW_DIM; minmax->ptMinTrackSize.y = MIN_WINDOW_DIM; break; diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 1ce656c2a37..05888769c0d 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -21,9 +21,9 @@ #include "modules/monitor/monitor_common.h" // standard C headers -#include <ctype.h> -#include <stdarg.h> -#include <stdio.h> +#include <cctype> +#include <cstdarg> +#include <cstdio> // standard windows headers #include <windows.h> @@ -523,7 +523,7 @@ void windows_osd_interface::init(running_machine &machine) osd_common_t::init(machine); const char *stemp; - windows_options &options = downcast<windows_options &>(machine.options()); + auto &options = downcast<windows_options &>(machine.options()); // determine if we are benchmarking, and adjust options appropriately int bench = options.bench(); @@ -566,7 +566,7 @@ void windows_osd_interface::init(running_machine &machine) osd_common_t::init_subsystems(); // notify listeners of screen configuration - for (auto info : osd_common_t::s_window_list) + for (const auto &info : osd_common_t::s_window_list) { machine.output().set_value(string_format("Orientation(%s)", info->monitor()->devicename()).c_str(), std::static_pointer_cast<win_window_info>(info)->m_targetorient); } diff --git a/src/osd/windows/winutf8.cpp b/src/osd/windows/winutf8.cpp index a860aeb55cc..dcaa99ce7bc 100644 --- a/src/osd/windows/winutf8.cpp +++ b/src/osd/windows/winutf8.cpp @@ -10,7 +10,7 @@ #include "winutf8.h" #include "strconv.h" -#include <stdlib.h> +#include <cstdlib> // standard windows headers #include <shellapi.h> @@ -100,7 +100,7 @@ std::string win_get_window_text_utf8(HWND window) if (length <= 0) return std::string(); - TCHAR *buffer = (TCHAR *) alloca((length + 1) * sizeof(TCHAR)); + auto *buffer = (TCHAR *) alloca((length + 1) * sizeof(TCHAR)); GetWindowText(window, buffer, length + 1); return osd::text::from_tstring(buffer); } diff --git a/src/osd/windows/winutil.cpp b/src/osd/windows/winutil.cpp index c06b4d2eee2..b662974cfd1 100644 --- a/src/osd/windows/winutil.cpp +++ b/src/osd/windows/winutil.cpp @@ -51,7 +51,7 @@ std::chrono::system_clock::time_point win_time_point_from_filetime(LPFILETIME fi // win_is_gui_application //============================================================ -BOOL win_is_gui_application(void) +BOOL win_is_gui_application() { static BOOL is_gui_frontend; static BOOL is_first_time = TRUE; diff --git a/src/tools/aueffectutil.mm b/src/tools/aueffectutil.mm index d232c735db3..661800a3b48 100644 --- a/src/tools/aueffectutil.mm +++ b/src/tools/aueffectutil.mm @@ -13,7 +13,7 @@ #include <utility> #include <vector> -#include <stdlib.h> +#include <cstdlib> #ifdef MAC_OS_X_VERSION_MAX_ALLOWED diff --git a/src/tools/castool.cpp b/src/tools/castool.cpp index 6c10cfe4ed8..eb9973ad48d 100644 --- a/src/tools/castool.cpp +++ b/src/tools/castool.cpp @@ -10,12 +10,12 @@ ***************************************************************************/ -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <stdlib.h> -#include <time.h> -#include <assert.h> +#include <cstdio> +#include <cstring> +#include <cctype> +#include <cstdlib> +#include <ctime> +#include <cassert> #include "corestr.h" diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp index 153a4e34157..44e73083ff4 100644 --- a/src/tools/chdman.cpp +++ b/src/tools/chdman.cpp @@ -5,8 +5,8 @@ CHD compression frontend ****************************************************************************/ -#include <stdio.h> // must be here otherwise issues with I64FMT in MINGW -#include <assert.h> +#include <stdio.h> // must be stdio.h and here otherwise issues with I64FMT in MINGW +#include <cassert> #include "osdcore.h" #include "corefile.h" @@ -17,11 +17,11 @@ #include "md5.h" #include "sha1.h" #include "vbiparse.h" -#include <stdarg.h> -#include <stdlib.h> -#include <stdio.h> -#include <time.h> -#include <ctype.h> +#include <cstdarg> +#include <cstdlib> +#include <cstdio> +#include <ctime> +#include <cctype> #include <iostream> #include <cassert> diff --git a/src/tools/floptool.cpp b/src/tools/floptool.cpp index 1953e7b0538..b140119dd72 100644 --- a/src/tools/floptool.cpp +++ b/src/tools/floptool.cpp @@ -10,13 +10,13 @@ ***************************************************************************/ -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <stdlib.h> -#include <time.h> -#include <stdarg.h> -#include <assert.h> +#include <cstdio> +#include <cstring> +#include <cctype> +#include <cstdlib> +#include <ctime> +#include <cstdarg> +#include <cassert> #include "corestr.h" @@ -50,6 +50,7 @@ #include "formats/applix_dsk.h" #include "formats/hpi_dsk.h" +#include "formats/img_dsk.h" #include "formats/dvk_mx_dsk.h" #include "formats/aim_dsk.h" @@ -98,6 +99,7 @@ static floppy_format_type floppy_formats[] = { FLOPPY_APPLIX_FORMAT, FLOPPY_HPI_FORMAT, + FLOPPY_IMG_FORMAT, FLOPPY_DVK_MX_FORMAT, FLOPPY_AIM_FORMAT, diff --git a/src/tools/imgtool/filtbas.cpp b/src/tools/imgtool/filtbas.cpp index 37bf5f0ef71..4cffd0a34c3 100644 --- a/src/tools/imgtool/filtbas.cpp +++ b/src/tools/imgtool/filtbas.cpp @@ -18,9 +18,9 @@ *****************************************************************************/ -#include <string.h> -#include <stdarg.h> -#include <ctype.h> +#include <cstring> +#include <cstdarg> +#include <cctype> #include "imgtool.h" #include "formats/imageutl.h" diff --git a/src/tools/imgtool/filteoln.cpp b/src/tools/imgtool/filteoln.cpp index bb589e8fafe..5a4c2f873a3 100644 --- a/src/tools/imgtool/filteoln.cpp +++ b/src/tools/imgtool/filteoln.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ -#include <string.h> +#include <cstring> #include "imgtool.h" diff --git a/src/tools/imgtool/filter.cpp b/src/tools/imgtool/filter.cpp index e26c51a623b..df9c6ea28ac 100644 --- a/src/tools/imgtool/filter.cpp +++ b/src/tools/imgtool/filter.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ -#include <string.h> +#include <cstring> #include "imgtool.h" diff --git a/src/tools/imgtool/filter.h b/src/tools/imgtool/filter.h index 7ddd999c2a2..e46d3781262 100644 --- a/src/tools/imgtool/filter.h +++ b/src/tools/imgtool/filter.h @@ -11,8 +11,8 @@ #ifndef FILTER_H #define FILTER_H -#include <stdlib.h> -#include <stdio.h> +#include <cstdlib> +#include <cstdio> #include "library.h" diff --git a/src/tools/imgtool/formats/coco_dsk.cpp b/src/tools/imgtool/formats/coco_dsk.cpp index 6f509c92767..4e5bc4aa7c6 100644 --- a/src/tools/imgtool/formats/coco_dsk.cpp +++ b/src/tools/imgtool/formats/coco_dsk.cpp @@ -8,9 +8,9 @@ *********************************************************************/ -#include <string.h> -#include <time.h> -#include <assert.h> +#include <cstring> +#include <ctime> +#include <cassert> #include "formats/coco_dsk.h" #include "formats/basicdsk.h" diff --git a/src/tools/imgtool/formats/vt_dsk.cpp b/src/tools/imgtool/formats/vt_dsk.cpp index 02f74668b0f..c29d08ba88b 100644 --- a/src/tools/imgtool/formats/vt_dsk.cpp +++ b/src/tools/imgtool/formats/vt_dsk.cpp @@ -8,9 +8,9 @@ *********************************************************************/ -#include <stdio.h> -#include <string.h> -#include <assert.h> +#include <cstdio> +#include <cstring> +#include <cassert> #include "formats/vt_dsk.h" #include "formats/basicdsk.h" diff --git a/src/tools/imgtool/imgtool.cpp b/src/tools/imgtool/imgtool.cpp index b51d7b4d478..fb24da8a872 100644 --- a/src/tools/imgtool/imgtool.cpp +++ b/src/tools/imgtool/imgtool.cpp @@ -8,8 +8,8 @@ ***************************************************************************/ -#include <string.h> -#include <ctype.h> +#include <cstring> +#include <cctype> #include <iostream> #include "imgtool.h" diff --git a/src/tools/imgtool/imgtool.h b/src/tools/imgtool/imgtool.h index aa4ae79e29e..614b3564dcf 100644 --- a/src/tools/imgtool/imgtool.h +++ b/src/tools/imgtool/imgtool.h @@ -11,9 +11,9 @@ #ifndef IMGTOOL_H #define IMGTOOL_H -#include <stdlib.h> -#include <stdio.h> -#include <assert.h> +#include <cstdlib> +#include <cstdio> +#include <cassert> #include <functional> #include "corestr.h" diff --git a/src/tools/imgtool/library.cpp b/src/tools/imgtool/library.cpp index 785054575b0..e3c75203805 100644 --- a/src/tools/imgtool/library.cpp +++ b/src/tools/imgtool/library.cpp @@ -9,7 +9,7 @@ ****************************************************************************/ -#include <string.h> +#include <cstring> #include <algorithm> #include "imgtool.h" diff --git a/src/tools/imgtool/library.h b/src/tools/imgtool/library.h index c709a70201b..6dc9ea8224b 100644 --- a/src/tools/imgtool/library.h +++ b/src/tools/imgtool/library.h @@ -17,7 +17,7 @@ #ifndef LIBRARY_H #define LIBRARY_H -#include <time.h> +#include <ctime> #include <list> #include <chrono> diff --git a/src/tools/imgtool/main.cpp b/src/tools/imgtool/main.cpp index d5320beb347..d289bd01ff3 100644 --- a/src/tools/imgtool/main.cpp +++ b/src/tools/imgtool/main.cpp @@ -13,11 +13,11 @@ #include "modules.h" #include "strformat.h" -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <stdlib.h> -#include <time.h> +#include <cstdio> +#include <cstring> +#include <cctype> +#include <cstdlib> +#include <ctime> #include <iostream> #ifdef _WIN32 diff --git a/src/tools/imgtool/modules/amiga.cpp b/src/tools/imgtool/modules/amiga.cpp index c1c5563012e..91488fb91a5 100644 --- a/src/tools/imgtool/modules/amiga.cpp +++ b/src/tools/imgtool/modules/amiga.cpp @@ -14,9 +14,9 @@ *****************************************************************************/ -#include <time.h> -#include <string.h> -#include <ctype.h> +#include <ctime> +#include <cstring> +#include <cctype> #include "imgtool.h" #include "iflopimg.h" diff --git a/src/tools/imgtool/modules/bml3.cpp b/src/tools/imgtool/modules/bml3.cpp index a1a3bdc203d..19c60570acc 100644 --- a/src/tools/imgtool/modules/bml3.cpp +++ b/src/tools/imgtool/modules/bml3.cpp @@ -18,9 +18,9 @@ - (used with MP-1802 floppy disk controller card) */ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> #include "imgtool.h" #include "iflopimg.h" diff --git a/src/tools/imgtool/modules/concept.cpp b/src/tools/imgtool/modules/concept.cpp index 6bc0fe1bf22..18b80c73c23 100644 --- a/src/tools/imgtool/modules/concept.cpp +++ b/src/tools/imgtool/modules/concept.cpp @@ -8,10 +8,10 @@ Raphael Nabet, 2003 */ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <limits.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> +#include <climits> #include "imgtool.h" struct UINT16xE diff --git a/src/tools/imgtool/modules/fat.cpp b/src/tools/imgtool/modules/fat.cpp index 029050d1e9c..68110275e07 100644 --- a/src/tools/imgtool/modules/fat.cpp +++ b/src/tools/imgtool/modules/fat.cpp @@ -134,8 +134,8 @@ ****************************************************************************/ -#include <time.h> -#include <ctype.h> +#include <ctime> +#include <cctype> #include "imgtool.h" #include "formats/imageutl.h" #include "unicode.h" diff --git a/src/tools/imgtool/modules/mac.cpp b/src/tools/imgtool/modules/mac.cpp index 90c68323f76..f7bc2ff118b 100644 --- a/src/tools/imgtool/modules/mac.cpp +++ b/src/tools/imgtool/modules/mac.cpp @@ -89,11 +89,11 @@ *****************************************************************************/ -#include <ctype.h> -#include <string.h> -#include <time.h> -#include <limits.h> -#include <stddef.h> +#include <cctype> +#include <cstring> +#include <ctime> +#include <climits> +#include <cstddef> #include "formats/imageutl.h" #include "imgtool.h" diff --git a/src/tools/imgtool/modules/macbin.cpp b/src/tools/imgtool/modules/macbin.cpp index 30400dffdbb..29fa90f9e59 100644 --- a/src/tools/imgtool/modules/macbin.cpp +++ b/src/tools/imgtool/modules/macbin.cpp @@ -46,7 +46,7 @@ *****************************************************************************/ -#include <string.h> +#include <cstring> #include "imgtool.h" #include "formats/imageutl.h" diff --git a/src/tools/imgtool/modules/os9.cpp b/src/tools/imgtool/modules/os9.cpp index cc016250c31..539b53c1818 100644 --- a/src/tools/imgtool/modules/os9.cpp +++ b/src/tools/imgtool/modules/os9.cpp @@ -8,7 +8,7 @@ ****************************************************************************/ -#include <time.h> +#include <ctime> #include "imgtool.h" #include "formats/imageutl.h" diff --git a/src/tools/imgtool/modules/rsdos.cpp b/src/tools/imgtool/modules/rsdos.cpp index 4bcde9444ab..43579baad37 100644 --- a/src/tools/imgtool/modules/rsdos.cpp +++ b/src/tools/imgtool/modules/rsdos.cpp @@ -8,9 +8,9 @@ ****************************************************************************/ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> #include "imgtool.h" #include "formats/coco_dsk.h" #include "iflopimg.h" diff --git a/src/tools/imgtool/modules/rt11.cpp b/src/tools/imgtool/modules/rt11.cpp index 01ab8741dd6..be6535550bb 100644 --- a/src/tools/imgtool/modules/rt11.cpp +++ b/src/tools/imgtool/modules/rt11.cpp @@ -75,9 +75,9 @@ #include "formats/imageutl.h" #include "iflopimg.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> namespace diff --git a/src/tools/imgtool/modules/thomson.cpp b/src/tools/imgtool/modules/thomson.cpp index f122bc00520..2acb03d8b01 100644 --- a/src/tools/imgtool/modules/thomson.cpp +++ b/src/tools/imgtool/modules/thomson.cpp @@ -115,7 +115,7 @@ #include "iflopimg.h" #include "formats/imageutl.h" -#include <time.h> +#include <ctime> #define MAXSIZE 80*16*256*2 /* room for two faces, double-density, 80 tracks */ diff --git a/src/tools/imgtool/modules/ti99.cpp b/src/tools/imgtool/modules/ti99.cpp index 226adc213d2..8ca2d49c529 100644 --- a/src/tools/imgtool/modules/ti99.cpp +++ b/src/tools/imgtool/modules/ti99.cpp @@ -18,11 +18,11 @@ - check allocation bitmap against corruption when an image is opened */ -#include <limits.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <time.h> +#include <climits> +#include <cstdio> +#include <cstring> +#include <cstdlib> +#include <ctime> #include "imgtool.h" #include "harddisk.h" #include "imghd.h" diff --git a/src/tools/imgtool/modules/ti990hd.cpp b/src/tools/imgtool/modules/ti990hd.cpp index 6a9a37063b0..9bf77fa6a6c 100644 --- a/src/tools/imgtool/modules/ti990hd.cpp +++ b/src/tools/imgtool/modules/ti990hd.cpp @@ -8,10 +8,10 @@ Raphael Nabet, 2003 */ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <limits.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> +#include <climits> #include "imgtool.h" /* Max sector length is bytes. Generally 256, except for a few older disk diff --git a/src/tools/imgtool/modules/vzdos.cpp b/src/tools/imgtool/modules/vzdos.cpp index bf46863bb28..6a9d5b0c394 100644 --- a/src/tools/imgtool/modules/vzdos.cpp +++ b/src/tools/imgtool/modules/vzdos.cpp @@ -8,10 +8,10 @@ ****************************************************************************/ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <math.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> +#include <cmath> #include "imgtool.h" #include "formats/imageutl.h" #include "formats/vt_dsk.h" diff --git a/src/tools/imgtool/stream.cpp b/src/tools/imgtool/stream.cpp index 9a29180c9da..9f6cba27353 100644 --- a/src/tools/imgtool/stream.cpp +++ b/src/tools/imgtool/stream.cpp @@ -8,8 +8,8 @@ ***************************************************************************/ -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> #include <zlib.h> #include "unzip.h" diff --git a/src/tools/jedutil.cpp b/src/tools/jedutil.cpp index 8fcc650c1d7..b500e689785 100644 --- a/src/tools/jedutil.cpp +++ b/src/tools/jedutil.cpp @@ -112,10 +112,10 @@ ***************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> #include "corestr.h" #include "jedparse.h" #include "plaparse.h" diff --git a/src/tools/ldresample.cpp b/src/tools/ldresample.cpp index 5386ac31229..57c20f7777c 100644 --- a/src/tools/ldresample.cpp +++ b/src/tools/ldresample.cpp @@ -8,12 +8,12 @@ ****************************************************************************/ -#include <stdio.h> -#include <ctype.h> -#include <stdlib.h> -#include <math.h> +#include <cstdio> +#include <cctype> +#include <cstdlib> +#include <cmath> #include <new> -#include <assert.h> +#include <cassert> #include "bitmap.h" #include "chd.h" #include "avhuff.h" diff --git a/src/tools/ldverify.cpp b/src/tools/ldverify.cpp index 2a326508323..deee9afba36 100644 --- a/src/tools/ldverify.cpp +++ b/src/tools/ldverify.cpp @@ -8,11 +8,11 @@ ****************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> +#include <cctype> #include <new> -#include <assert.h> +#include <cassert> #include "coretmpl.h" #include "aviio.h" #include "avhuff.h" diff --git a/src/tools/pngcmp.cpp b/src/tools/pngcmp.cpp index af104e928b3..eb56d4a7ee7 100644 --- a/src/tools/pngcmp.cpp +++ b/src/tools/pngcmp.cpp @@ -8,11 +8,11 @@ ****************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <assert.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> +#include <cassert> #include "osdcore.h" #include "png.h" diff --git a/src/tools/regrep.cpp b/src/tools/regrep.cpp index 91dcaecd518..f45351272a7 100644 --- a/src/tools/regrep.cpp +++ b/src/tools/regrep.cpp @@ -6,12 +6,12 @@ ****************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> #include <new> -#include <assert.h> +#include <cassert> #include "osdcore.h" #include "png.h" diff --git a/src/tools/romcmp.cpp b/src/tools/romcmp.cpp index 6a781bc8c29..9f072fc0e4f 100644 --- a/src/tools/romcmp.cpp +++ b/src/tools/romcmp.cpp @@ -13,8 +13,8 @@ #include "osdcomm.h" #include "hash.h" -#include <stdarg.h> -#include <stdlib.h> +#include <cstdarg> +#include <cstdlib> #define MAX_FILES 1000 diff --git a/src/tools/split.cpp b/src/tools/split.cpp index 4ef18b6ad06..ba455c04b51 100644 --- a/src/tools/split.cpp +++ b/src/tools/split.cpp @@ -8,11 +8,11 @@ ****************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <assert.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> +#include <cassert> #include "corefile.h" #include "corestr.h" #include "sha1.h" diff --git a/src/tools/src2html.cpp b/src/tools/src2html.cpp index 32a21de065e..7b0293ac4b1 100644 --- a/src/tools/src2html.cpp +++ b/src/tools/src2html.cpp @@ -15,11 +15,11 @@ ***************************************************************************/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <assert.h> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <cctype> +#include <cassert> #include "osdcore.h" #include "corestr.h" #include "corefile.h" diff --git a/src/tools/testkeys.cpp b/src/tools/testkeys.cpp index 9ee08808c19..7bc93dc6532 100644 --- a/src/tools/testkeys.cpp +++ b/src/tools/testkeys.cpp @@ -2,7 +2,7 @@ // // testkeys.cpp - A small utility to analyze SDL keycodes // -// Copyright (c) 1996-2019, Nicola Salmoria and the MAME Team. +// Copyright (c) 1996-2020, Nicola Salmoria and the MAME Team. // Visit http://mamedev.org for licensing and usage restrictions. // // SDLMAME by Olivier Galibert and R. Belmont diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp index c7b125dc54f..808f5020d57 100644 --- a/src/tools/unidasm.cpp +++ b/src/tools/unidasm.cpp @@ -52,6 +52,7 @@ using util::BIT; #include "cpu/f8/f8dasm.h" #include "cpu/fr/frdasm.h" #include "cpu/g65816/g65816ds.h" +#include "cpu/gigatron/gigatrondasm.h" #include "cpu/h6280/6280dasm.h" #include "cpu/h8/h8d.h" #include "cpu/h8/h8hd.h" @@ -89,6 +90,7 @@ using util::BIT; #include "cpu/m68000/m68kdasm.h" #include "cpu/m6805/6805dasm.h" #include "cpu/m6809/6x09dasm.h" +#include "cpu/m88000/m88000d.h" #include "cpu/mb86233/mb86233d.h" #include "cpu/mb86235/mb86235d.h" #include "cpu/mb88xx/mb88dasm.h" @@ -108,6 +110,7 @@ using util::BIT; #include "cpu/nec/necdasm.h" #include "cpu/ns32000/ns32000dasm.h" #include "cpu/nuon/nuondasm.h" +#include "cpu/pace/pacedasm.h" #include "cpu/patinhofeio/patinho_feio_dasm.h" #include "cpu/pdp1/pdp1dasm.h" #include "cpu/pdp1/tx0dasm.h" @@ -119,6 +122,7 @@ using util::BIT; #include "cpu/psx/psxdasm.h" #include "cpu/rii/riidasm.h" #include "cpu/rsp/rsp_dasm.h" +#include "cpu/rx01/rx01dasm.h" #include "cpu/s2650/2650dasm.h" #include "cpu/saturn/saturnds.h" #include "cpu/sc61860/scdasm.h" @@ -158,6 +162,9 @@ using util::BIT; #include "cpu/upd7810/upd7810_dasm.h" #include "cpu/v60/v60d.h" #include "cpu/v810/v810dasm.h" +#include "cpu/vt50/vt50dasm.h" +#include "cpu/vt61/vt61dasm.h" +#include "cpu/we32000/we32100d.h" #include "cpu/z180/z180dasm.h" #include "cpu/z8/z8dasm.h" #include "cpu/z80/z80dasm.h" @@ -172,7 +179,7 @@ using util::BIT; #include <iostream> #include <stdexcept> -#include <ctype.h> +#include <cctype> using u8 = util::u8; using u16 = util::u16; @@ -365,6 +372,7 @@ static const dasm_table_entry dasm_table[] = { "f8", be, 0, []() -> util::disasm_interface * { return new f8_disassembler; } }, { "fr", be, 0, []() -> util::disasm_interface * { return new fr_disassembler; } }, { "g65816", le, 0, []() -> util::disasm_interface * { return new g65816_disassembler(&g65816_unidasm); } }, + { "gigatron", be, -1, []() -> util::disasm_interface * { return new gigatron_disassembler; } }, { "h6280", le, 0, []() -> util::disasm_interface * { return new h6280_disassembler; } }, { "h8", be, 0, []() -> util::disasm_interface * { return new h8_disassembler; } }, { "h8h", be, 0, []() -> util::disasm_interface * { return new h8h_disassembler; } }, @@ -433,6 +441,8 @@ static const dasm_table_entry dasm_table[] = { "mb86233", le, -2, []() -> util::disasm_interface * { return new mb86233_disassembler; } }, { "mb86235", le, -3, []() -> util::disasm_interface * { return new mb86235_disassembler; } }, { "mb88", le, 0, []() -> util::disasm_interface * { return new mb88_disassembler; } }, + { "mc88100", be, 0, []() -> util::disasm_interface * { return new mc88100_disassembler; } }, + { "mc88110", be, 0, []() -> util::disasm_interface * { return new mc88110_disassembler; } }, { "mcs48", le, 0, []() -> util::disasm_interface * { return new mcs48_disassembler(false, false); } }, { "minx", le, 0, []() -> util::disasm_interface * { return new minx_disassembler; } }, { "mips1be", be, 0, []() -> util::disasm_interface * { return new mips1_disassembler; } }, @@ -445,6 +455,7 @@ static const dasm_table_entry dasm_table[] = { "ns32000", le, 0, []() -> util::disasm_interface * { return new ns32000_disassembler; } }, { "nuon", be, 0, []() -> util::disasm_interface * { return new nuon_disassembler; } }, { "nsc8105", be, 0, []() -> util::disasm_interface * { return new m680x_disassembler(8105); } }, + { "pace", le, -1, []() -> util::disasm_interface * { return new pace_disassembler; } }, { "patinho_feio", le, 0, []() -> util::disasm_interface * { return new patinho_feio_disassembler; } }, { "pdp1", be, 0, []() -> util::disasm_interface * { return new pdp1_disassembler; } }, { "pdp8", be, 0, []() -> util::disasm_interface * { return new pdp8_disassembler; } }, @@ -456,7 +467,8 @@ static const dasm_table_entry dasm_table[] = { "r65c02", le, 0, []() -> util::disasm_interface * { return new r65c02_disassembler; } }, { "r65c19", le, 0, []() -> util::disasm_interface * { return new r65c19_disassembler; } }, { "rsp", le, 0, []() -> util::disasm_interface * { return new rsp_disassembler; } }, - { "s2650", le, 0, []() -> util::disasm_interface * { return new s2650_disassembler(&s2650_unidasm); } }, + { "rx01", le, 0, []() -> util::disasm_interface * { return new rx01_disassembler; } }, + { "s2650", be, 0, []() -> util::disasm_interface * { return new s2650_disassembler(&s2650_unidasm); } }, { "saturn", le, 0, []() -> util::disasm_interface * { return new saturn_disassembler(&saturn_unidasm); } }, { "sc61860", le, 0, []() -> util::disasm_interface * { return new sc61860_disassembler; } }, { "scmp", le, 0, []() -> util::disasm_interface * { return new scmp_disassembler; } }, @@ -523,6 +535,10 @@ static const dasm_table_entry dasm_table[] = { "upi41", le, 0, []() -> util::disasm_interface * { return new mcs48_disassembler(true, false); } }, { "v60", le, 0, []() -> util::disasm_interface * { return new v60_disassembler; } }, { "v810", le, 0, []() -> util::disasm_interface * { return new v810_disassembler; } }, + { "vt50", le, 0, []() -> util::disasm_interface * { return new vt50_disassembler; } }, + { "vt52", le, 0, []() -> util::disasm_interface * { return new vt52_disassembler; } }, + { "vt61", le, -1, []() -> util::disasm_interface * { return new vt61_disassembler; } }, + { "we32100", be, 0, []() -> util::disasm_interface * { return new we32100_disassembler; } }, { "x86_16", le, 0, []() -> util::disasm_interface * { i386_unidasm.mode = 16; return new i386_disassembler(&i386_unidasm); } }, { "x86_32", le, 0, []() -> util::disasm_interface * { i386_unidasm.mode = 32; return new i386_disassembler(&i386_unidasm); } }, { "x86_64", le, 0, []() -> util::disasm_interface * { i386_unidasm.mode = 64; return new i386_disassembler(&i386_unidasm); } }, @@ -591,18 +607,17 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const switch(entry->pcshift) { case -1: lr8 = [](offs_t pc) -> u8 { throw std::logic_error("debug_disasm_buffer::debug_data_buffer: r8 access on 16-bits granularity bus\n"); }; - lr16 = [this](offs_t pc) -> u16 { - const u16 *src = get_ptr<u16>(pc); - return src[0]; - }; - switch(entry->endian) { case le: + lr16 = [this](offs_t pc) -> u16 { + const u16 *src = get_ptr<u16>(pc); + return little_endianize_int16(src[0]); + }; lr32 = [this, page_mask](offs_t pc) -> u32 { offs_t lpc = disasm->pc_real_to_linear(pc); u32 r = 0; for(int j=0; j != 2; j++) { - r |= get<u16>(disasm->pc_linear_to_real(lpc)) << (j*16); + r |= little_endianize_int16(get<u16>(disasm->pc_linear_to_real(lpc))) << (j*16); lpc = (lpc & ~page_mask) | ((lpc + 1) & page_mask); } return r; @@ -611,7 +626,7 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const offs_t lpc = disasm->pc_real_to_linear(pc); u64 r = 0; for(int j=0; j != 4; j++) { - r |= u64(get<u16>(disasm->pc_linear_to_real(lpc))) << (j*16); + r |= u64(little_endianize_int16(get<u16>(disasm->pc_linear_to_real(lpc)))) << (j*16); lpc = (lpc & ~page_mask) | ((lpc + 1) & page_mask); } return r; @@ -619,11 +634,15 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const break; case be: + lr16 = [this](offs_t pc) -> u16 { + const u16 *src = get_ptr<u16>(pc); + return big_endianize_int16(src[0]); + }; lr32 = [this, page_mask](offs_t pc) -> u32 { offs_t lpc = disasm->pc_real_to_linear(pc); u32 r = 0; for(int j=0; j != 2; j++) { - r |= get<u16>(disasm->pc_linear_to_real(lpc)) << ((1-j)*16); + r |= big_endianize_int16(get<u16>(disasm->pc_linear_to_real(lpc))) << ((1-j)*16); lpc = (lpc & ~page_mask) | ((lpc + 1) & page_mask); } return r; @@ -632,7 +651,7 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const offs_t lpc = disasm->pc_real_to_linear(pc); u64 r = 0; for(int j=0; j != 4; j++) { - r |= u64(get<u16>(disasm->pc_linear_to_real(lpc))) << ((3-j)*16); + r |= u64(big_endianize_int16(get<u16>(disasm->pc_linear_to_real(lpc)))) << ((3-j)*16); lpc = (lpc & ~page_mask) | ((lpc + 1) & page_mask); } return r; @@ -785,46 +804,52 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const case -1: lr8 = [](offs_t pc) -> u8 { abort(); }; - lr16 = [this](offs_t pc) -> u16 { - const u16 *p = get_ptr<u16>(pc); - return p ? - p[0] - : 0x0000; - }; switch(entry->endian) { case le: + lr16 = [this](offs_t pc) -> u16 { + const u16 *p = get_ptr<u16>(pc); + return p ? + little_endianize_int16(p[0]) + : 0x0000; + }; lr32 = [this](offs_t pc) -> u32 { const u16 *p = get_ptr<u16>(pc); return p ? - p[0] | - (p[1] << 16) + little_endianize_int16(p[0]) | + (little_endianize_int16(p[1]) << 16) : 0x00000000; }; lr64 = [this](offs_t pc) -> u64 { const u16 *p = get_ptr<u16>(pc); return p ? - p[0] | - (p[1] << 16) | - (u64(p[2]) << 32) | - (u64(p[3]) << 48) + little_endianize_int16(p[0]) | + (little_endianize_int16(p[1]) << 16) | + (u64(little_endianize_int16(p[2])) << 32) | + (u64(little_endianize_int16(p[3])) << 48) : 0x0000000000000000; }; break; case be: + lr16 = [this](offs_t pc) -> u16 { + const u16 *p = get_ptr<u16>(pc); + return p ? + big_endianize_int16(p[0]) + : 0x0000; + }; lr32 = [this](offs_t pc) -> u32 { const u16 *p = get_ptr<u16>(pc); return p ? - (p[0] << 16)| - p[1] + (big_endianize_int16(p[0]) << 16)| + big_endianize_int16(p[1]) : 0x00000000; }; lr64 = [this](offs_t pc) -> u64 { const u16 *p = get_ptr<u16>(pc); return p ? - (u64(p[0]) << 48) | - (u64(p[1]) << 32) | - (p[2] << 16) | - p[3] + (u64(big_endianize_int16(p[0])) << 48) | + (u64(big_endianize_int16(p[1])) << 32) | + (big_endianize_int16(p[2]) << 16) | + big_endianize_int16(p[3]) : 0x0000000000000000; }; break; @@ -834,28 +859,34 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const case -2: lr8 = [](offs_t pc) -> u8 { abort(); }; lr16 = [](offs_t pc) -> u16 { abort(); }; - lr32 = [this](offs_t pc) -> u32 { - const u32 *p = get_ptr<u32>(pc); - return p ? - p[0] - : 0x00000000; - }; switch(entry->endian) { case le: + lr32 = [this](offs_t pc) -> u32 { + const u32 *p = get_ptr<u32>(pc); + return p ? + little_endianize_int32(p[0]) + : 0x00000000; + }; lr64 = [this](offs_t pc) -> u64 { const u32 *p = get_ptr<u32>(pc); return p ? - p[0] | - (u64(p[1]) << 32) + little_endianize_int32(p[0]) | + (u64(little_endianize_int32(p[1])) << 32) : 0x0000000000000000; }; break; case be: + lr32 = [this](offs_t pc) -> u32 { + const u32 *p = get_ptr<u32>(pc); + return p ? + big_endianize_int32(p[0]) + : 0x00000000; + }; lr64 = [this](offs_t pc) -> u64 { const u32 *p = get_ptr<u32>(pc); return p ? - (u64(p[0]) << 32) | - p[1] + (u64(big_endianize_int32(p[0])) << 32) | + big_endianize_int32(p[1]) : 0x0000000000000000; }; break; @@ -866,26 +897,38 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const lr8 = [](offs_t pc) -> u8 { abort(); }; lr16 = [](offs_t pc) -> u16 { abort(); }; lr32 = [](offs_t pc) -> u32 { abort(); }; - lr64 = [this](offs_t pc) -> u64 { - const u64 *p = get_ptr<u64>(pc); - return p ? - p[0] - : 0x0000000000000000; + switch(entry->endian) { + case le: + lr64 = [this](offs_t pc) -> u64 { + const u64 *p = get_ptr<u64>(pc); + return p ? + little_endianize_int64(p[0]) + : 0x0000000000000000; + }; + break; + case be: + lr64 = [this](offs_t pc) -> u64 { + const u64 *p = get_ptr<u64>(pc); + return p ? + big_endianize_int64(p[0]) + : 0x0000000000000000; + }; + break; }; break; case 3: lr8 = [](offs_t pc) -> u8 { abort(); }; - lr16 = [this](offs_t pc) -> u16 { - if(pc < base_pc) - return 0x0000; - offs_t delta = (pc - base_pc) >> 3; - if(delta >= size) - return 0x0000; - return reinterpret_cast<const u16 *>(&data[delta])[0]; - }; switch(entry->endian) { case le: + lr16 = [this](offs_t pc) -> u16 { + if(pc < base_pc) + return 0x0000; + offs_t delta = (pc - base_pc) >> 3; + if(delta >= size) + return 0x0000; + return little_endianize_int16(reinterpret_cast<const u16 *>(&data[delta])[0]); + }; lr32 = [this](offs_t pc) -> u32 { if(pc < base_pc) return 0x00000000; @@ -893,10 +936,18 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const if(delta >= size + 2) return 0x00000000; auto p = reinterpret_cast<const u16 *>(&data[delta]); - return p[0] | (u32(p[1]) << 16); + return little_endianize_int16(p[0]) | (u32(little_endianize_int16(p[1])) << 16); }; break; case be: + lr16 = [this](offs_t pc) -> u16 { + if(pc < base_pc) + return 0x0000; + offs_t delta = (pc - base_pc) >> 3; + if(delta >= size) + return 0x0000; + return big_endianize_int16(reinterpret_cast<const u16 *>(&data[delta])[0]); + }; lr32 = [this](offs_t pc) -> u32 { if(pc < base_pc) return 0x00000000; @@ -904,7 +955,7 @@ unidasm_data_buffer::unidasm_data_buffer(util::disasm_interface *_disasm, const if(delta >= size + 2) return 0x00000000; auto p = reinterpret_cast<const u16 *>(&data[delta]); - return (u32(p[0]) << 16) | p[1]; + return (u32(big_endianize_int16(p[0])) << 16) | big_endianize_int16(p[1]); }; break; } diff --git a/tests/LICENSE b/tests/LICENSE index fb9f046cc43..9b30d5a81a9 100644 --- a/tests/LICENSE +++ b/tests/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019, MAME Development Team +Copyright (c) 2020, MAME Development Team All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/uismall.bdf b/uismall.bdf index 7897c0ae6c5..b97d498c4a6 100644 --- a/uismall.bdf +++ b/uismall.bdf @@ -1,5 +1,5 @@ STARTFONT 2.1 -COMMENT Copyright (C) 1997-2019 MAMEDev and contributors +COMMENT Copyright (C) 1997-2020 MAMEDev and contributors FONT -mamedev-uismall-Medium-R-Normal--16-120-96-96-P-100-ISO10646-1 SIZE 12 96 96 FONTBOUNDINGBOX 8 11 0 -2 diff --git a/web/LICENSE b/web/LICENSE index fb9f046cc43..9b30d5a81a9 100644 --- a/web/LICENSE +++ b/web/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019, MAME Development Team +Copyright (c) 2020, MAME Development Team All rights reserved. Redistribution and use in source and binary forms, with or without |